mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0029902: Data Exchange, XCAF - provide extended Material definition for visualization purposes
Introduced new attribute XCAFDoc_VisMaterial storing visualization material definition. XCAFPrs_Style has been exteneded Material() property. XCAFPrs_AISObject::DispatchStyles() maps new XCAFPrs_Style::Material() property onto graphics aspects. RWGltf_GltfJsonParser and RWObj_CafReader now put Material definition into XCAF document instead of a color label. RWGltf_MaterialMetallicRoughness - added missing properties AlphaMode, AlphaCutOff and IsDoubleSided; fixed default values in constructor for Metallic and Roughness. Added commands XGetAllVisMaterials, XGetVisMaterial, XAddVisMaterial, XRemoveVisMaterial, XSetVisMaterial, XUnsetVisMaterial for working with new visualization materials table in the document.
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <XCAFDoc_DocumentTool.hxx>
|
||||
|
||||
#include <Standard_GUID.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
@@ -27,12 +28,12 @@
|
||||
#include <XCAFDoc_ColorTool.hxx>
|
||||
#include <XCAFDoc_ClippingPlaneTool.hxx>
|
||||
#include <XCAFDoc_DimTolTool.hxx>
|
||||
#include <XCAFDoc_DocumentTool.hxx>
|
||||
#include <XCAFDoc_LayerTool.hxx>
|
||||
#include <XCAFDoc_MaterialTool.hxx>
|
||||
#include <XCAFDoc_NotesTool.hxx>
|
||||
#include <XCAFDoc_ShapeTool.hxx>
|
||||
#include <XCAFDoc_ViewTool.hxx>
|
||||
#include <XCAFDoc_VisMaterialTool.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(XCAFDoc_DocumentTool,TDF_Attribute)
|
||||
|
||||
@@ -225,6 +226,17 @@ TDF_Label XCAFDoc_DocumentTool::NotesLabel(const TDF_Label& acces)
|
||||
return L;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VisMaterialLabel
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
TDF_Label XCAFDoc_DocumentTool::VisMaterialLabel (const TDF_Label& theLabel)
|
||||
{
|
||||
TDF_Label aLabel = DocLabel (theLabel).FindChild (10, Standard_True);
|
||||
TDataStd_Name::Set (aLabel, "VisMaterials");
|
||||
return aLabel;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ShapeTool
|
||||
//purpose :
|
||||
@@ -246,6 +258,14 @@ Handle(XCAFDoc_ColorTool) XCAFDoc_DocumentTool::ColorTool (const TDF_Label& acce
|
||||
return XCAFDoc_ColorTool::Set(ColorsLabel(acces));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VisMaterialTool
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(XCAFDoc_VisMaterialTool) XCAFDoc_DocumentTool::VisMaterialTool (const TDF_Label& theLabel)
|
||||
{
|
||||
return XCAFDoc_VisMaterialTool::Set (VisMaterialLabel (theLabel));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LayerTool
|
||||
|
Reference in New Issue
Block a user