35#include <wx/filename.h>
37#include <wx/stdpaths.h>
40#include <wx/wfstream.h>
41#include <wx/zipstrm.h>
44#include <decompress.hpp>
46#include <TDocStd_Document.hxx>
48#include <TopoDS_Shape.hxx>
49#include <Quantity_Color.hxx>
50#include <XCAFApp_Application.hxx>
52#include <AIS_Shape.hxx>
54#include <IGESControl_Reader.hxx>
55#include <IGESCAFControl_Reader.hxx>
56#include <Interface_Static.hxx>
58#include <STEPControl_Reader.hxx>
59#include <STEPCAFControl_Reader.hxx>
61#include <XCAFDoc_DocumentTool.hxx>
62#include <XCAFDoc_ColorTool.hxx>
63#include <XCAFDoc_ShapeTool.hxx>
65#include <BRep_Tool.hxx>
66#include <BRepMesh_IncrementalMesh.hxx>
69#include <TopoDS_Shape.hxx>
70#include <TopoDS_Face.hxx>
71#include <TopoDS_Compound.hxx>
72#include <TopExp_Explorer.hxx>
74#include <Quantity_Color.hxx>
75#include <Poly_Triangulation.hxx>
76#include <Poly_PolygonOnTriangulation.hxx>
77#include <Precision.hxx>
79#include <TDF_LabelSequence.hxx>
80#include <TDF_ChildIterator.hxx>
81#include <TDF_Tool.hxx>
82#include <TDataStd_Name.hxx>
83#include <Standard_Version.hxx>
89#define MASK_OCE wxT( "PLUGIN_OCE" )
90#define MASK_OCE_EXTRA wxT( "PLUGIN_OCE_EXTRA" )
92typedef std::map<std::size_t, SGNODE*>
COLORMAP;
93typedef std::map<std::string, SGNODE*>
FACEMAP;
94typedef std::map<std::string, std::vector<SGNODE*>>
NODEMAP;
95typedef std::pair<std::string, std::vector<SGNODE*>>
NODEITEM;
100 std::vector< SGNODE* >* aItems );
104 std::vector< SGNODE* >* items, Quantity_ColorRGBA*
color );
106#if OCC_VERSION_HEX >= 0x070500
107#define OCC_COLOR_SPACE Quantity_TOC_sRGB
109#define OCC_COLOR_SPACE Quantity_TOC_RGB
130 refColor.SetValues( Quantity_NOC_BLACK );
140 COLORMAP::iterator sC =
colors.begin();
141 COLORMAP::iterator eC =
colors.end();
160 FACEMAP::iterator sF =
faces.begin();
161 FACEMAP::iterator eF =
faces.end();
177 NODEMAP::iterator sS =
shapes.begin();
178 NODEMAP::iterator eS =
shapes.end();
182 std::vector< SGNODE* >::iterator sV = sS->second.begin();
183 std::vector< SGNODE* >::iterator eV = sS->second.end();
205 bool GetShape(
const std::string&
id, std::vector< SGNODE* >*& listPtr )
208 NODEMAP::iterator item;
211 if( item ==
shapes.end() )
214 listPtr = &item->second;
221 FACEMAP::iterator item;
222 item =
faces.find(
id );
224 if( item ==
faces.end() )
233 if(
nullptr == colorObj )
248 Quantity_Color colorRgb = colorObj->GetRGB();
250 Standard_Real r, g, b;
253 std::size_t hash = std::hash<double>{}( colorRgb.Distance(
refColor ) )
254 ^ ( std::hash<float>{}( colorObj->Alpha() ) << 1 );
256 std::map<std::size_t, SGNODE*>::iterator item;
257 item =
colors.find( hash );
259 if( item !=
colors.end() )
264 app.SetSpecular( 0.12f, 0.12f, 0.12f );
265 app.SetAmbient( 0.1f, 0.1f, 0.1f );
266 app.SetDiffuse( r, g, b );
267 app.SetTransparency( 1.0f - colorObj->Alpha() );
268 colors.emplace( hash, app.GetRawPtr() );
270 return app.GetRawPtr();
286 wxFileName fname( wxString::FromUTF8Unchecked( aFileName ) );
287 wxFFileInputStream ifile( fname.GetFullPath() );
292 if( fname.GetExt().MakeUpper().EndsWith( wxT(
"STPZ" ) )
293 || fname.GetExt().MakeUpper().EndsWith( wxT(
"GZ" ) ) )
299 memset( iline, 0, 82 );
300 ifile.Read( iline, 82 );
305 if( !strncmp( iline,
"ISO-10303-21;", 13 ) )
308 std::string fstr = iline;
312 if( fstr.find(
"urn:oid:1.0.10303." ) != std::string::npos )
318 if( iline[72] ==
'S' && ( iline[80] == 0 || iline[80] == 13 || iline[80] == 10 ) )
331void getTag(
const TDF_Label& aLabel, std::string& aTag )
333 std::ostringstream ostr;
335 if( aLabel.IsNull() )
337 wxLogTrace(
MASK_OCE, wxT(
"Null label passed to getTag" ) );
341 TColStd_ListOfInteger tagList;
342 TDF_Tool::TagList( aLabel, tagList );
344 for( TColStd_ListOfInteger::Iterator it( tagList ); it.More(); it.Next() )
358 Handle( TDataStd_Name )
name;
359 if( !aLabel.IsNull() && aLabel.FindAttribute( TDataStd_Name::GetID(),
name ) )
361 TCollection_ExtendedString extstr =
name->Get();
362 char* str =
new char[extstr.LengthOfCString() + 1];
363 extstr.ToUTF8CString( str );
365 txt = wxString::FromUTF8( str );
382 case TopAbs_COMPOUND:
return "COMPOUND";
383 case TopAbs_COMPSOLID:
return "COMPSOLID";
384 case TopAbs_SOLID:
return "SOLID";
385 case TopAbs_SHELL:
return "SHELL";
386 case TopAbs_FACE:
return "FACE";
387 case TopAbs_WIRE:
return "WIRE";
388 case TopAbs_EDGE:
return "EDGE";
389 case TopAbs_VERTEX:
return "VERTEX";
390 case TopAbs_SHAPE:
return "SHAPE";
402static inline std::ostream&
operator<<( std::ostream& aOStream,
const Quantity_ColorRGBA& aColor )
404 Quantity_Color rgb = aColor.GetRGB();
422static void printLabel( TDF_Label aLabel, Handle( XCAFDoc_ShapeTool ) aShapeTool,
423 Handle( XCAFDoc_ColorTool ) aColorTool,
const char* aPreMsg =
nullptr )
425 if( aLabel.IsNull() )
431 TCollection_AsciiString entry;
432 TDF_Tool::Entry( aLabel, entry );
433 std::ostringstream ss;
434 ss << aPreMsg << entry <<
", " <<
getLabelName( aLabel )
435 << ( aShapeTool->IsShape( aLabel ) ?
", shape" :
"" )
436 << ( aShapeTool->IsTopLevel( aLabel ) ?
", topLevel" :
"" )
437 << ( aShapeTool->IsFree( aLabel ) ?
", free" :
"" )
438 << ( aShapeTool->IsAssembly( aLabel ) ?
", assembly" :
"" )
439 << ( aShapeTool->IsSimpleShape( aLabel ) ?
", simple" :
"" )
440 << ( aShapeTool->IsCompound( aLabel ) ?
", compound" :
"" )
441 << ( aShapeTool->IsReference( aLabel ) ?
", reference" :
"" )
442 << ( aShapeTool->IsComponent( aLabel ) ?
", component" :
"" )
443 << ( aShapeTool->IsSubShape( aLabel ) ?
", subshape" :
"" );
445 if( aShapeTool->IsSubShape( aLabel ) )
447 auto shape = aShapeTool->GetShape( aLabel );
448 if( !shape.IsNull() )
452 if( aShapeTool->IsShape( aLabel ) )
454 Quantity_ColorRGBA c;
455 if( aColorTool->GetColor( aLabel, XCAFDoc_ColorGen, c ) )
457 if( aColorTool->GetColor( aLabel, XCAFDoc_ColorSurf, c ) )
459 if( aColorTool->GetColor( aLabel, XCAFDoc_ColorCurv, c ) )
463 wxLogTrace(
MASK_OCE, ss.str().c_str() );
475static void dumpLabels( TDF_Label aLabel, Handle( XCAFDoc_ShapeTool ) aShapeTool,
476 Handle( XCAFDoc_ColorTool ) aColorTool,
int aDepth = 0 )
478 std::string indent( aDepth * 2,
' ' );
479 printLabel( aLabel, aShapeTool, aColorTool, indent.c_str() );
480 TDF_ChildIterator it;
481 for( it.Initialize( aLabel ); it.More(); it.Next() )
482 dumpLabels( it.Value(), aShapeTool, aColorTool, aDepth + 1 );
490 if( data.m_color->
GetColor( label, XCAFDoc_ColorGen,
color ) )
492 else if( data.m_color->
GetColor( label, XCAFDoc_ColorSurf,
color ) )
494 else if( data.m_color->
GetColor( label, XCAFDoc_ColorCurv,
color ) )
497 label = label.Father();
512 std::vector< SGNODE* >::iterator sL = lp->begin();
513 std::vector< SGNODE* >::iterator eL = lp->end();
530bool readIGES( Handle( TDocStd_Document ) & m_doc,
const char* fname )
532 IGESCAFControl_Reader reader;
533 IFSelect_ReturnStatus stat = reader.ReadFile( fname );
534 reader.PrintCheckLoad( Standard_False, IFSelect_ItemsByEntity );
536 if( stat != IFSelect_RetDone )
540 if( !Interface_Static::SetIVal(
"read.precision.mode", 0 ) )
544 reader.SetColorMode(
true);
545 reader.SetNameMode(
false);
546 reader.SetLayerMode(
false);
548 if( !reader.Transfer( m_doc ) )
550 if( m_doc->CanClose() == CDM_CCS_OK )
557 if( reader.NbShapes() < 1 )
559 if( m_doc->CanClose() == CDM_CCS_OK )
569bool readSTEP( Handle(TDocStd_Document)& m_doc,
const char* fname )
571 wxLogTrace(
MASK_OCE, wxT(
"Reading step file %s" ), fname );
573 STEPCAFControl_Reader reader;
574 IFSelect_ReturnStatus stat = reader.ReadFile( fname );
576 if( stat != IFSelect_RetDone )
580 if( !Interface_Static::SetIVal(
"read.precision.mode", 1 ) )
584 if( !Interface_Static::SetRVal(
"read.precision.val",
ADVANCED_CFG::GetCfg().m_OcePluginLinearDeflection ) )
588 reader.SetColorMode(
true );
589 reader.SetNameMode(
false );
590 reader.SetLayerMode(
false );
592 if( !reader.Transfer( m_doc ) )
594 if( m_doc->CanClose() == CDM_CCS_OK )
601 if( reader.NbRootsForTransfer() < 1 )
603 if( m_doc->CanClose() == CDM_CCS_OK )
613bool readSTEPZ( Handle(TDocStd_Document)& m_doc,
const char* aFileName )
615 wxFileName fname( wxString::FromUTF8Unchecked( aFileName ) );
616 wxFFileInputStream ifile( fname.GetFullPath() );
618 wxFileName outFile( fname );
620 outFile.SetPath( wxStandardPaths::Get().GetTempDir() );
621 outFile.SetExt( wxT(
"STEP" ) );
623 wxFileOffset size = ifile.GetLength();
624 wxBusyCursor busycursor;
626 if( size == wxInvalidOffset )
630 bool success =
false;
631 wxFFileOutputStream ofile( outFile.GetFullPath() );
636 char *buffer =
new char[size];
638 ifile.Read( buffer, size);
639 std::string expanded;
643 expanded = gzip::decompress( buffer, size );
649 if( expanded.empty() )
653 wxZipInputStream izipfile( ifile );
654 std::unique_ptr<wxZipEntry> zip_file( izipfile.GetNextEntry() );
656 if( zip_file && !zip_file->IsDir() && izipfile.CanRead() )
658 izipfile.Read( ofile );
664 ofile.Write( expanded.data(), expanded.size() );
674 bool retval =
readSTEP( m_doc, outFile.GetFullPath().mb_str() );
677 wxRemoveFile( outFile.GetFullPath() );
687 Handle(XCAFApp_Application) m_app = XCAFApp_Application::GetApplication();
688 m_app->NewDocument(
"MDTV-XCAF", data.m_doc );
696 if( !
readIGES( data.m_doc, filename ) )
702 if( !
readSTEP( data.m_doc, filename ) )
715 if( m_app->CanClose( data.m_doc ) == CDM_CCS_OK )
716 m_app->Close( data.m_doc );
722 data.m_assy = XCAFDoc_DocumentTool::ShapeTool( data.m_doc->Main() );
723 data.m_color = XCAFDoc_DocumentTool::ColorTool( data.m_doc->Main() );
726 if( wxLog::IsAllowedTraceMask(
MASK_OCE ) )
728 dumpLabels( data.m_doc->Main(), data.m_assy, data.m_color );
732 TDF_LabelSequence frshapes;
733 data.m_assy->GetFreeShapes( frshapes );
741 for( Standard_Integer i = 1; i <= frshapes.Length(); i++ )
743 const TDF_Label& label = frshapes.Value( i );
745 if( data.m_color->IsVisible( label ) )
754 if( m_app->CanClose( data.m_doc ) == CDM_CCS_OK )
755 m_app->Close( data.m_doc );
763#if ( defined( DEBUG_OCE ) && DEBUG_OCE > 3 )
766 wxFileName fn( wxString::FromUTF8Unchecked( filename ) );
770 output = wxT(
"_step-" );
772 output = wxT(
"_iges-" );
774 output.append( fn.GetName() );
775 output.append( wxT(
".wrl" ) );
781 data.
scene =
nullptr;
783 if( m_app->CanClose( data.m_doc ) == CDM_CCS_OK )
784 m_app->Close( data.m_doc );
791 std::vector<SGNODE*>* items, Quantity_ColorRGBA*
color )
796 wxLogTrace(
MASK_OCE, wxT(
"Processing shell" ) );
797 for( it.Initialize( shape,
false,
false ); it.More(); it.Next() )
799 const TopoDS_Face& face = TopoDS::Face( it.Value() );
810 std::vector< SGNODE* >* items )
814 Quantity_ColorRGBA col;
815 Quantity_ColorRGBA* lcolor =
nullptr;
817 data.
hasSolid = shape.ShapeType() == TopAbs_SOLID;
819 wxLogTrace(
MASK_OCE, wxT(
"Processing solid" ) );
822 if( !data.m_assy->Search( shape, label ) )
825 std::ostringstream ostr;
826 ostr <<
"KMISC_" << i++;
831 bool found_color =
false;
842 if( data.m_assy->Search( shape, label, Standard_False, Standard_True, Standard_True ) &&
853 if( data.m_assy->Search( shape, label, Standard_False, Standard_False,
866 if( data.m_assy->Search( shape, label, Standard_False, Standard_False,
884 std::vector< SGNODE* >* component =
nullptr;
886 if( !partID.empty() )
893 if(
nullptr != items )
894 items->push_back( pptr );
898 std::vector<SGNODE*> itemList;
900 TopAbs_ShapeEnum stype = shape.ShapeType();
901 if( stype == TopAbs_SHELL )
903 if(
processShell( shape, data, pptr, &itemList, lcolor ) )
909 for( it.Initialize( shape,
false,
false ); it.More(); it.Next() )
911 const TopoDS_Shape& subShape = it.Value();
913 if( subShape.ShapeType() == TopAbs_SHELL )
915 if(
processShell( subShape, data, pptr, &itemList, lcolor ) )
920 wxLogTrace(
MASK_OCE, wxT(
"Unsupported subshape in solid" ) );
927 else if(
nullptr != items )
928 items->push_back( pptr );
935 std::vector<SGNODE*>* aItems )
937 std::string labelTag;
939 if( wxLog::IsAllowedTraceMask(
MASK_OCE ) )
942 getTag( aLabel, labelTag );
945 wxLogTrace(
MASK_OCE, wxT(
"Processing label %s" ), labelTag );
947 TopoDS_Shape originalShape;
948 TDF_Label shapeLabel = aLabel;
950 if( !aData.m_assy->
GetShape( shapeLabel, originalShape ) )
955 TopoDS_Shape shape = originalShape;
957 if( aData.m_assy->IsReference( aLabel ) )
959 wxLogTrace(
MASK_OCE, wxT(
"Label %s is ref, trying to pull up referred label" ),
962 if( !aData.m_assy->GetReferredShape( aLabel, shapeLabel ) )
967 labelTag =
static_cast<int>( shapeLabel.Tag() );
970 if( !aData.m_assy->
GetShape( shapeLabel, shape ) )
980 const TopLoc_Location& loc = originalShape.Location();
982 if( !loc.IsIdentity() )
984 wxLogTrace(
MASK_OCE, wxT(
"Label %d has location" ),
static_cast<int>( aLabel.Tag() ) );
985 gp_Trsf T = loc.Transformation();
986 gp_XYZ coord = T.TranslationPart();
988 wxLogTrace(
MASK_OCE, wxT(
"Translation %f, %f, %f" ), coord.X(), coord.Y(), coord.Z() );
992 if( T.GetRotation( axis, angle ) )
995 wxLogTrace(
MASK_OCE, wxT(
"Rotation %f, %f, %f, angle %f" ),
996 axis.X(), axis.Y(), axis.Z(), angle );
1000 TopAbs_ShapeEnum stype = shape.ShapeType();
1006 case TopAbs_COMPOUND:
1010 if( !aData.m_assy->IsAssembly( shapeLabel ) )
1014 for( xp.Init( shape, TopAbs_SOLID ); xp.More(); xp.Next() )
1021 for( xp.Init( shape, TopAbs_SHELL, TopAbs_SOLID ); xp.More(); xp.Next() )
1028 for( xp.Init( shape, TopAbs_FACE, TopAbs_SHELL ); xp.More(); xp.Next() )
1030 const TopoDS_Face& face = TopoDS::Face( xp.Current() );
1031 processFace( face, aData, pptr, aItems,
nullptr );
1051 if(
processFace( TopoDS::Face( shape ), aData, pptr, aItems,
nullptr ) )
1060 if(
nullptr != aItems )
1061 aItems->push_back( pptr );
1063 if( !aData.m_assy->IsSimpleShape( shapeLabel ) && shapeLabel.HasChild() )
1065 wxLogTrace(
MASK_OCE, wxT(
"Label %s has children" ), labelTag );
1066 TDF_ChildIterator it;
1068 for( it.Initialize( shapeLabel ); it.More(); it.Next() )
1080 Quantity_ColorRGBA*
color )
1082 if( Standard_True == face.IsNull() )
1085 bool reverse = ( face.Orientation() == TopAbs_REVERSED );
1086 SGNODE* ashape =
nullptr;
1090 bool useBothSides =
false;
1095 useBothSides =
true;
1097 if( data.m_assy->FindShape( face, label, Standard_False ) )
1100 if( !partID.empty() )
1101 ashape = data.
GetFace( partID );
1110 if(
nullptr != items )
1111 items->push_back( ashape );
1115 std::string id2 = partID;
1124 if(
nullptr != items )
1125 items->push_back( shapeB );
1131 TopLoc_Location loc;
1132 Standard_Boolean isTessellate (Standard_False);
1133 Handle( Poly_Triangulation ) triangulation = BRep_Tool::Triangulation( face, loc );
1136 if( triangulation.IsNull() || triangulation->Deflection() > linDeflection + Precision::Confusion() )
1137 isTessellate = Standard_True;
1141 BRepMesh_IncrementalMesh IM(face, linDeflection, Standard_False,
1143 triangulation = BRep_Tool::Triangulation( face, loc );
1146 if( triangulation.IsNull() == Standard_True )
1149 Quantity_ColorRGBA lcolor;
1152 if( data.m_color->
GetColor( face, XCAFDoc_ColorGen, lcolor )
1153 || data.m_color->
GetColor( face, XCAFDoc_ColorCurv, lcolor )
1154 || data.m_color->
GetColor( face, XCAFDoc_ColorSurf, lcolor ) )
1171 std::vector< SGPOINT > vertices;
1172 std::vector< int > indices;
1173 std::vector< int > indices2;
1176 for(
int i = 1; i <= triangulation->NbNodes(); i++ )
1178 gp_XYZ v( triangulation->Node(i).Coord() );
1179 vertices.emplace_back( v.X(), v.Y(), v.Z() );
1182 for(
int i = 1; i <= triangulation->NbTriangles(); i++ )
1185 triangulation->Triangle(i).Get(a, b, c);
1200 indices.push_back( a );
1201 indices.push_back( b );
1202 indices.push_back( c );
1206 indices2.push_back( b );
1207 indices2.push_back( a );
1208 indices2.push_back( c );
1213 coordIdx.
SetIndices( indices.size(), &indices[0] );
1217 if( !partID.empty() )
1224 std::string id2 = partID;
1233 coordIdx2.
SetIndices( indices2.size(), &indices2[0] );
1237 if( !partID.empty() )
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
bool SetDiffuse(float aRVal, float aGVal, float aBVal)
bool SetSpecular(float aRVal, float aGVal, float aBVal)
bool SetShininess(float aShininess) noexcept
bool SetAmbient(float aRVal, float aGVal, float aBVal)
IFSG_COORDINDEX is the wrapper for SGCOORDINDEX.
IFSG_COORDS is the wrapper for SGCOORDS.
bool SetCoordsList(size_t aListSize, const SGPOINT *aCoordsList)
IFSG_FACESET is the wrapper for the SGFACESET class.
bool CalcNormals(SGNODE **aPtr)
bool SetIndices(size_t nIndices, int *aIndexList)
Function SetIndices sets the number of indices and creates a copy of the given index data.
bool SetParent(SGNODE *aParent)
Function SetParent sets the parent SGNODE of this object.
SGNODE * GetRawPtr(void) noexcept
Function GetRawPtr() returns the raw internal SGNODE pointer.
void Destroy(void)
Function Destroy deletes the object held by this wrapper.
IFSG_SHAPE is the wrapper for the SGSHAPE class.
Define the basic data set required to represent a 3D model.
The base class of all Scene Graph nodes.
double m_OcePluginLinearDeflection
OCE (STEP/IGES) 3D Plugin Tesselation Linear Deflection.
collects header files for all SG* wrappers and the API
bool processShell(const TopoDS_Shape &shape, DATA &data, SGNODE *parent, std::vector< SGNODE * > *items, Quantity_ColorRGBA *color)
std::map< std::string, std::vector< SGNODE * > > NODEMAP
std::map< std::size_t, SGNODE * > COLORMAP
bool processFace(const TopoDS_Face &face, DATA &data, SGNODE *parent, std::vector< SGNODE * > *items, Quantity_ColorRGBA *color)
std::pair< std::string, std::vector< SGNODE * > > NODEITEM
bool getColor(DATA &data, TDF_Label label, Quantity_ColorRGBA &color)
static int colorFloatToDecimal(float aVal)
void getTag(const TDF_Label &aLabel, std::string &aTag)
Gets the absolute tag string for a given label in the form of ##:##:##:##.
void addItems(SGNODE *parent, std::vector< SGNODE * > *lp)
std::string getShapeName(TopAbs_ShapeEnum aShape)
Gets a string for a given TopAbs_ShapeEnum element.
static void printLabel(TDF_Label aLabel, Handle(XCAFDoc_ShapeTool) aShapeTool, Handle(XCAFDoc_ColorTool) aColorTool, const char *aPreMsg=nullptr)
Gets a string for a given TopAbs_ShapeEnum element.
SCENEGRAPH * LoadModel(char const *filename)
static void dumpLabels(TDF_Label aLabel, Handle(XCAFDoc_ShapeTool) aShapeTool, Handle(XCAFDoc_ColorTool) aColorTool, int aDepth=0)
Dumps a label and the entire tree underneath it.
FormatType fileType(const char *aFileName)
bool readSTEP(Handle(TDocStd_Document)&m_doc, const char *fname)
static std::ostream & operator<<(std::ostream &aOStream, const Quantity_ColorRGBA &aColor)
bool processSolidOrShell(const TopoDS_Shape &shape, DATA &data, SGNODE *parent, std::vector< SGNODE * > *items)
static wxString getLabelName(const TDF_Label &aLabel)
bool processLabel(const TDF_Label &aLabel, DATA &aData, SGNODE *aParent, std::vector< SGNODE * > *aItems)
std::map< std::string, SGNODE * > FACEMAP
bool readSTEPZ(Handle(TDocStd_Document)&m_doc, const char *aFileName)
bool readIGES(Handle(TDocStd_Document) &m_doc, const char *fname)
SGLIB_API bool WriteVRML(const char *filename, bool overwrite, SGNODE *aTopNode, bool reuse, bool renameNodes)
Function WriteVRML writes out the given node and its subnodes to a VRML2 file.
SGLIB_API SGNODE * GetSGNodeParent(SGNODE *aNode)
SGLIB_API void DestroyNode(SGNODE *aNode) noexcept
Function DestroyNode deletes the given SG* class node.
SGLIB_API bool AddSGNodeChild(SGNODE *aParent, SGNODE *aChild)
SGLIB_API bool AddSGNodeRef(SGNODE *aParent, SGNODE *aChild)
Handle(XCAFDoc_ColorTool) m_color
SGNODE * GetFace(const std::string &id)
Handle(TDocStd_Document) m_doc
bool GetShape(const std::string &id, std::vector< SGNODE * > *&listPtr)
Handle(XCAFDoc_ShapeTool) m_assy
SGNODE * GetColor(Quantity_ColorRGBA *colorObj)