33#include <wx/filename.h>
35#include <wx/stdpaths.h>
38#include <wx/wfstream.h>
39#include <wx/zipstrm.h>
45#include <TDocStd_Document.hxx>
47#include <TopoDS_Shape.hxx>
48#include <Quantity_Color.hxx>
49#include <Quantity_ColorRGBA.hxx>
50#include <XCAFApp_Application.hxx>
52#include <IGESControl_Reader.hxx>
53#include <IGESCAFControl_Reader.hxx>
54#include <Interface_Static.hxx>
56#include <STEPControl_Reader.hxx>
57#include <STEPCAFControl_Reader.hxx>
59#include <XCAFDoc_DocumentTool.hxx>
60#include <XCAFDoc_ColorTool.hxx>
61#include <XCAFDoc_ShapeTool.hxx>
63#include <BRep_Tool.hxx>
64#include <BRepMesh_IncrementalMesh.hxx>
67#include <TopoDS_Shape.hxx>
68#include <TopoDS_Face.hxx>
69#include <TopoDS_Compound.hxx>
70#include <TopExp_Explorer.hxx>
72#include <Quantity_Color.hxx>
73#include <Poly_Triangulation.hxx>
74#include <Poly_PolygonOnTriangulation.hxx>
75#include <Precision.hxx>
77#include <NCollection_Sequence.hxx>
78#include <TDF_Label.hxx>
79#include <TDF_ChildIterator.hxx>
80#include <TDF_Tool.hxx>
81#include <TDataStd_Name.hxx>
82#include <Standard_Version.hxx>
88#define MASK_OCE wxT( "PLUGIN_OCE" )
89#define MASK_OCE_EXTRA wxT( "PLUGIN_OCE_EXTRA" )
92typedef std::map<COLORKEY, IFSG_APPEARANCE>
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
156 COLORMAP::iterator sC =
colors.begin();
157 COLORMAP::iterator eC =
colors.end();
162 SGNODE* color = sC->second.GetRawPtr();
181 FACEMAP::iterator sF =
faces.begin();
182 FACEMAP::iterator eF =
faces.end();
198 NODEMAP::iterator sS =
shapes.begin();
199 NODEMAP::iterator eS =
shapes.end();
203 std::vector< SGNODE* >::iterator sV = sS->second.begin();
204 std::vector< SGNODE* >::iterator eV = sS->second.end();
224 if( !m_app.IsNull() && !m_doc.IsNull() && m_app->CanClose( m_doc ) == CDM_CCS_OK )
225 m_app->Close( m_doc );
229 bool GetShape(
const std::string&
id, std::vector< SGNODE* >*& listPtr )
232 NODEMAP::iterator item;
235 if( item ==
shapes.end() )
238 listPtr = &item->second;
245 FACEMAP::iterator item;
246 item =
faces.find(
id );
248 if( item ==
faces.end() )
257 if(
nullptr == colorObj )
274 COLORKEY key = { r, g, b, colorObj->Alpha() };
306 wxFileName fname( wxString::FromUTF8Unchecked( aFileName ) );
307 wxFFileInputStream ifile( fname.GetFullPath() );
312 wxString extension = fname.GetExt().MakeUpper();
314 if( extension == wxT(
"STPZ" ) || extension == wxT(
"STEPZ" ) || extension.EndsWith( wxT(
"GZ" ) ) )
324 const int max_line_count = 3;
326 for(
int ii = 0; ii < max_line_count; ii++ )
328 memset( iline, 0, 82 );
329 ifile.Read( iline, 82 );
334 if( !strncmp( iline,
"ISO-10303-21;", 13 ) )
340 std::string fstr = iline;
344 if( fstr.find(
"urn:oid:1.0.10303." ) != std::string::npos )
350 if( iline[72] ==
'S' && ( iline[80] == 0 || iline[80] == 13 || iline[80] == 10 ) )
354 if( strncmp( iline,
"/*", 2 ) != 0 )
368void getTag(
const TDF_Label& aLabel, std::string& aTag )
370 std::ostringstream ostr;
372 if( aLabel.IsNull() )
374 wxLogTrace(
MASK_OCE, wxT(
"Null label passed to getTag" ) );
378 NCollection_List<int> tagList;
379 TDF_Tool::TagList( aLabel, tagList );
381 for(
const int& tag : tagList )
396 if( !aLabel.IsNull() && aLabel.FindAttribute( TDataStd_Name::GetID(),
name ) )
398 TCollection_ExtendedString extstr =
name->Get();
399 char* str =
new char[extstr.LengthOfCString() + 1];
400 extstr.ToUTF8CString( str );
402 txt = wxString::FromUTF8( str );
419 case TopAbs_COMPOUND:
return "COMPOUND";
420 case TopAbs_COMPSOLID:
return "COMPSOLID";
421 case TopAbs_SOLID:
return "SOLID";
422 case TopAbs_SHELL:
return "SHELL";
423 case TopAbs_FACE:
return "FACE";
424 case TopAbs_WIRE:
return "WIRE";
425 case TopAbs_EDGE:
return "EDGE";
426 case TopAbs_VERTEX:
return "VERTEX";
427 case TopAbs_SHAPE:
return "SHAPE";
439static inline std::ostream&
operator<<( std::ostream& aOStream,
const Quantity_ColorRGBA& aColor )
441 Quantity_Color rgb = aColor.GetRGB();
460 Handle( XCAFDoc_ColorTool ) aColorTool,
const char* aPreMsg =
nullptr )
462 if( aLabel.IsNull() )
468 TCollection_AsciiString entry;
469 TDF_Tool::Entry( aLabel, entry );
470 std::ostringstream ss;
471 ss << aPreMsg << entry <<
", " <<
getLabelName( aLabel )
472 << ( aShapeTool->IsShape( aLabel ) ?
", shape" :
"" )
473 << ( aShapeTool->IsTopLevel( aLabel ) ?
", topLevel" :
"" )
474 << ( aShapeTool->IsFree( aLabel ) ?
", free" :
"" )
475 << ( aShapeTool->IsAssembly( aLabel ) ?
", assembly" :
"" )
476 << ( aShapeTool->IsSimpleShape( aLabel ) ?
", simple" :
"" )
477 << ( aShapeTool->IsCompound( aLabel ) ?
", compound" :
"" )
478 << ( aShapeTool->IsReference( aLabel ) ?
", reference" :
"" )
479 << ( aShapeTool->IsComponent( aLabel ) ?
", component" :
"" )
480 << ( aShapeTool->IsSubShape( aLabel ) ?
", subshape" :
"" );
482 if( aShapeTool->IsSubShape( aLabel ) )
484 auto shape = aShapeTool->GetShape( aLabel );
485 if( !shape.IsNull() )
489 if( aShapeTool->IsShape( aLabel ) )
491 Quantity_ColorRGBA c;
492 if( aColorTool->GetColor( aLabel, XCAFDoc_ColorGen, c ) )
494 if( aColorTool->GetColor( aLabel, XCAFDoc_ColorSurf, c ) )
496 if( aColorTool->GetColor( aLabel, XCAFDoc_ColorCurv, c ) )
500 wxLogTrace(
MASK_OCE, ss.str().c_str() );
513 Handle( XCAFDoc_ColorTool ) aColorTool,
int aDepth = 0 )
515 std::string indent( aDepth * 2,
' ' );
516 printLabel( aLabel, aShapeTool, aColorTool, indent.c_str() );
517 TDF_ChildIterator it;
518 for( it.Initialize( aLabel ); it.More(); it.Next() )
519 dumpLabels( it.Value(), aShapeTool, aColorTool, aDepth + 1 );
527 if( data.m_color->
GetColor( label, XCAFDoc_ColorSurf, color ) )
529 else if( data.m_color->
GetColor( label, XCAFDoc_ColorCurv, color ) )
531 else if( data.m_color->
GetColor( label, XCAFDoc_ColorGen, color ) )
534 label = label.Father();
549 std::vector< SGNODE* >::iterator sL = lp->begin();
550 std::vector< SGNODE* >::iterator eL = lp->end();
569 IGESCAFControl_Reader reader;
570 IFSelect_ReturnStatus stat = reader.ReadFile( fname );
571 reader.PrintCheckLoad(
false, IFSelect_ItemsByEntity );
573 if( stat != IFSelect_RetDone )
577 if( !Interface_Static::SetIVal(
"read.precision.mode", 0 ) )
581 reader.SetColorMode(
true);
582 reader.SetNameMode(
false);
583 reader.SetLayerMode(
false);
585 if( !reader.Transfer( m_doc ) )
589 if( reader.NbShapes() < 1 )
596bool readSTEP(
Handle( TDocStd_Document ) & m_doc,
const char* fname,
double aLinearDeflection )
598 wxLogTrace(
MASK_OCE, wxT(
"Reading step file %s" ), fname );
600 STEPCAFControl_Reader reader;
601 IFSelect_ReturnStatus stat = reader.ReadFile( fname );
603 if( stat != IFSelect_RetDone )
607 if( !Interface_Static::SetIVal(
"read.precision.mode", 1 ) )
611 if( !Interface_Static::SetRVal(
"read.precision.val", aLinearDeflection ) )
615 reader.SetColorMode(
true );
616 reader.SetNameMode(
false );
617 reader.SetLayerMode(
false );
619 if( !reader.Transfer( m_doc ) )
623 if( reader.NbRootsForTransfer() < 1 )
633 wxFileName fname( wxString::FromUTF8Unchecked( aFileName ) );
634 wxFFileInputStream ifile( fname.GetFullPath() );
637 wxFileName outFile( tempPath );
641 if( tempPath.empty() || !ifile.IsOk() )
644 wxFileOffset size = ifile.GetLength();
645 if( size == wxInvalidOffset )
649 ||
static_cast<std::uint64_t
>( size ) > std::numeric_limits<std::size_t>::max() )
658 bool success =
false;
659 wxFFileOutputStream ofile( outFile.GetFullPath() );
664 std::vector<char> buffer(
static_cast<size_t>( size ) );
666 ifile.Read( buffer.data(), size );
668 if( ifile.LastRead() !=
static_cast<size_t>( size ) )
671 std::string expanded;
673 buffer.data(),
static_cast<size_t>( size ), aOptions.
maxExpandedBytes, expanded );
686 if( buffer.size() < 4 || buffer[0] !=
'P' || buffer[1] !=
'K' || buffer[2] != 3 || buffer[3] != 4 )
696 wxZipInputStream izipfile( ifile );
697 std::unique_ptr<wxZipEntry> zip_file( izipfile.GetNextEntry() );
699 if( zip_file && !zip_file->IsDir() && izipfile.CanRead() )
702 std::uint64_t written = 0;
704 while( izipfile.CanRead() )
706 izipfile.Read( chunk,
sizeof( chunk ) );
707 size_t count = izipfile.LastRead();
713 "Expanded STEP exceeds the configured limit" );
718 ofile.Write( chunk, count );
720 if( ofile.LastWrite() != count )
731 ofile.Write( expanded.data(), expanded.size() );
732 success = ofile.LastWrite() == expanded.size();
735 success = ofile.Close() && success;
756 data.m_app = XCAFApp_Application::GetApplication();
757 data.m_app->NewDocument(
"MDTV-XCAF", data.m_doc );
769 if( !
readIGES( data.m_doc, filename ) )
791 data.m_assy = XCAFDoc_DocumentTool::ShapeTool( data.m_doc->Main() );
792 data.m_color = XCAFDoc_DocumentTool::ColorTool( data.m_doc->Main() );
795 if( wxLog::IsAllowedTraceMask(
MASK_OCE ) )
797 dumpLabels( data.m_doc->Main(), data.m_assy, data.m_color );
801 NCollection_Sequence<TDF_Label> frshapes;
802 data.m_assy->GetFreeShapes( frshapes );
813 for(
int i = 1; i <= frshapes.Length(); i++ )
818 const TDF_Label& label = frshapes.Value( i );
820 if( data.m_color->IsVisible( label ) )
835#if ( defined( DEBUG_OCE ) && DEBUG_OCE > 3 )
838 wxFileName fn( wxString::FromUTF8Unchecked( filename ) );
842 output = wxT(
"_step-" );
844 output = wxT(
"_iges-" );
846 output.append( fn.GetName() );
847 output.append( wxT(
".wrl" ) );
853 data.
scene =
nullptr;
860 std::vector<SGNODE*>* items, Quantity_ColorRGBA* color )
865 wxLogTrace(
MASK_OCE, wxT(
"Processing shell" ) );
866 for( it.Initialize( shape,
false,
false ); it.More(); it.Next() )
871 const TopoDS_Face& face = TopoDS::Face( it.Value() );
873 if(
processFace( face, data, parent, items, color ) )
882 std::vector< SGNODE* >* items )
886 Quantity_ColorRGBA col;
887 Quantity_ColorRGBA* lcolor =
nullptr;
889 data.
hasSolid = shape.ShapeType() == TopAbs_SOLID;
891 wxLogTrace(
MASK_OCE, wxT(
"Processing solid" ) );
894 if( !data.m_assy->Search( shape, label ) )
896 static std::atomic_int i{ 0 };
897 std::ostringstream ostr;
898 ostr <<
"KMISC_" << i.fetch_add( 1, std::memory_order_relaxed );
903 bool found_color =
false;
914 if( data.m_assy->Search( shape, label,
false,
true,
true ) &&
925 if( data.m_assy->Search( shape, label,
false,
false,
938 if( data.m_assy->Search( shape, label,
false,
false,
956 std::vector< SGNODE* >* component =
nullptr;
958 if( !partID.empty() )
965 if(
nullptr != items )
966 items->push_back( pptr );
970 std::vector<SGNODE*> itemList;
972 TopAbs_ShapeEnum stype = shape.ShapeType();
973 if( stype == TopAbs_SHELL )
975 if(
processShell( shape, data, pptr, &itemList, lcolor ) )
981 for( it.Initialize( shape,
false,
false ); it.More(); it.Next() )
983 const TopoDS_Shape& subShape = it.Value();
985 if( subShape.ShapeType() == TopAbs_SHELL )
987 if(
processShell( subShape, data, pptr, &itemList, lcolor ) )
992 wxLogTrace(
MASK_OCE, wxT(
"Unsupported subshape in solid" ) );
999 else if(
nullptr != items )
1000 items->push_back( pptr );
1007 std::vector<SGNODE*>* aItems )
1012 std::string labelTag;
1014 if( wxLog::IsAllowedTraceMask(
MASK_OCE ) )
1017 getTag( aLabel, labelTag );
1020 wxLogTrace(
MASK_OCE, wxT(
"Processing label %s" ), labelTag );
1022 TopoDS_Shape originalShape;
1023 TDF_Label shapeLabel = aLabel;
1025 if( !aData.m_assy->
GetShape( shapeLabel, originalShape ) )
1030 TopoDS_Shape shape = originalShape;
1032 if( aData.m_assy->IsReference( aLabel ) )
1034 wxLogTrace(
MASK_OCE, wxT(
"Label %s is ref, trying to pull up referred label" ),
1037 if( !aData.m_assy->GetReferredShape( aLabel, shapeLabel ) )
1042 labelTag =
static_cast<int>( shapeLabel.Tag() );
1045 if( !aData.m_assy->
GetShape( shapeLabel, shape ) )
1055 const TopLoc_Location& loc = originalShape.Location();
1057 if( !loc.IsIdentity() )
1059 wxLogTrace(
MASK_OCE, wxT(
"Label %d has location" ),
static_cast<int>( aLabel.Tag() ) );
1060 gp_Trsf
T = loc.Transformation();
1061 gp_XYZ coord =
T.TranslationPart();
1063 wxLogTrace(
MASK_OCE, wxT(
"Translation %f, %f, %f" ), coord.X(), coord.Y(), coord.Z() );
1067 if(
T.GetRotation( axis, angle ) )
1070 wxLogTrace(
MASK_OCE, wxT(
"Rotation %f, %f, %f, angle %f" ),
1071 axis.X(), axis.Y(), axis.Z(), angle );
1075 TopAbs_ShapeEnum stype = shape.ShapeType();
1081 case TopAbs_COMPOUND:
1085 if( !aData.m_assy->IsAssembly( shapeLabel ) )
1089 for( xp.Init( shape, TopAbs_SOLID ); xp.More(); xp.Next() )
1096 for( xp.Init( shape, TopAbs_SHELL, TopAbs_SOLID ); xp.More(); xp.Next() )
1103 for( xp.Init( shape, TopAbs_FACE, TopAbs_SHELL ); xp.More(); xp.Next() )
1105 const TopoDS_Face& face = TopoDS::Face( xp.Current() );
1106 processFace( face, aData, pptr, aItems,
nullptr );
1126 if(
processFace( TopoDS::Face( shape ), aData, pptr, aItems,
nullptr ) )
1135 if(
nullptr != aItems )
1136 aItems->push_back( pptr );
1138 if( !aData.m_assy->IsSimpleShape( shapeLabel ) && shapeLabel.HasChild() )
1140 wxLogTrace(
MASK_OCE, wxT(
"Label %s has children" ), labelTag );
1141 TDF_ChildIterator it;
1143 for( it.Initialize( shapeLabel ); it.More(); it.Next() )
1155 Quantity_ColorRGBA* color )
1157 if(
true == face.IsNull() )
1160 bool reverse = ( face.Orientation() == TopAbs_REVERSED );
1161 SGNODE* ashape =
nullptr;
1165 bool useBothSides =
false;
1170 useBothSides =
true;
1172 if( data.m_assy->FindShape( face, label,
false ) )
1175 if( !partID.empty() )
1176 ashape = data.
GetFace( partID );
1185 if(
nullptr != items )
1186 items->push_back( ashape );
1190 std::string id2 = partID;
1199 if(
nullptr != items )
1200 items->push_back( shapeB );
1206 TopLoc_Location loc;
1207 bool isTessellate (
false);
1208 Handle( Poly_Triangulation ) triangulation = BRep_Tool::Triangulation( face, loc );
1211 if( triangulation.IsNull() || triangulation->Deflection() > linDeflection + Precision::Confusion() )
1212 isTessellate =
true;
1216 BRepMesh_IncrementalMesh IM(face, linDeflection,
false,
1218 triangulation = BRep_Tool::Triangulation( face, loc );
1224 if( triangulation.IsNull() ==
true )
1227 Quantity_ColorRGBA lcolor;
1230 if( data.m_color->
GetColor( face, XCAFDoc_ColorSurf, lcolor )
1231 || data.m_color->
GetColor( face, XCAFDoc_ColorCurv, lcolor )
1232 || data.m_color->
GetColor( face, XCAFDoc_ColorGen, lcolor ) )
1237 std::vector< SGPOINT > vertices;
1238 std::vector< int > indices;
1239 std::vector< int > indices2;
1243 bool applyTransform = !loc.IsIdentity();
1244 gp_Trsf tx = applyTransform ? loc.Transformation() : gp_Trsf();
1246 for(
int i = 1; i <= triangulation->NbNodes(); i++ )
1248 if( ( i & 0x3FF ) == 0 && data.
IsCanceled() )
1250 gp_XYZ v = applyTransform ? triangulation->Node( i ).Transformed( tx ).Coord()
1251 : triangulation->Node( i ).Coord();
1252 vertices.emplace_back( v.X(), v.Y(), v.Z() );
1255 for(
int i = 1; i <= triangulation->NbTriangles(); i++ )
1257 if( ( i & 0x3FF ) == 0 && data.
IsCanceled() )
1261 triangulation->Triangle(i).Get(a, b, c);
1276 indices.push_back( a );
1277 indices.push_back( b );
1278 indices.push_back( c );
1282 indices2.push_back( b );
1283 indices2.push_back( a );
1284 indices2.push_back( c );
1288 if( vertices.empty() || indices.empty() )
1306 coordIdx.
SetIndices( indices.size(), indices.data() );
1310 if( !partID.empty() )
1317 std::string id2 = partID;
1326 coordIdx2.
SetIndices( indices2.size(), indices2.data() );
1330 if( !partID.empty() )
bool SetDiffuse(float aRVal, float aGVal, float aBVal)
bool SetSpecular(float aRVal, float aGVal, float aBVal)
bool SetShininess(float aShininess) noexcept
bool NewNode(SGNODE *aParent) override
Create a new node to associate with this wrapper.
bool SetAmbient(float aRVal, float aGVal, float aBVal)
bool SetTransparency(float aTransparency) noexcept
The wrapper for SGCOORDINDEX.
The wrapper for SGCOORDS.
bool SetCoordsList(size_t aListSize, const SGPOINT *aCoordsList)
The wrapper for the SGFACESET class.
bool CalcNormals(SGNODE **aPtr)
bool SetIndices(size_t nIndices, int *aIndexList)
Set the number of indices and creates a copy of the given index data.
bool SetParent(SGNODE *aParent)
Set the parent SGNODE of this object.
SGNODE * GetRawPtr(void) noexcept
Return the raw internal SGNODE pointer.
void Destroy(void)
Delete the object held by this wrapper.
The wrapper for the SGSHAPE class.
Scoped holder for the recursive model import lock.
Define the basic data set required to represent a 3D model.
The base class of all Scene Graph nodes.
collects header files for all SG* wrappers and the API
Handle(KICAD3D_INFO) KICAD3D_INFO
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
bool processFace(const TopoDS_Face &face, DATA &data, SGNODE *parent, std::vector< SGNODE * > *items, Quantity_ColorRGBA *color)
std::map< COLORKEY, IFSG_APPEARANCE > COLORMAP
std::pair< std::string, std::vector< SGNODE * > > NODEITEM
std::array< double, 4 > COLORKEY
bool readSTEP(Handle(TDocStd_Document) &m_doc, const char *fname, double aLinearDeflection)
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)
Get a string for a given TopAbs_ShapeEnum element.
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)
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)
SCENEGRAPH * LoadModel(char const *filename, const S3D::MODEL_IMPORT_OPTIONS *aOptions, MODEL_IMPORT_STATUS *aStatus)
std::map< std::string, SGNODE * > FACEMAP
bool readSTEPZ(Handle(TDocStd_Document) &m_doc, const char *aFileName, const S3D::MODEL_IMPORT_OPTIONS &aOptions, MODEL_IMPORT_STATUS *aStatus)
bool readIGES(Handle(TDocStd_Document) &m_doc, const char *fname)
wxString CreateModelImportTempFileName(const wxString &aPrefix)
MODEL_IMPORT_GZIP_RESULT DecompressBoundedModel(const char *aData, std::size_t aSize, std::uint64_t aMaxExpandedBytes, std::string &aExpanded)
Expand a gzip stream into aExpanded, refusing anything over aMaxExpandedBytes.
SGLIB_API bool WriteVRML(const char *filename, bool overwrite, SGNODE *aTopNode, bool reuse, bool renameNodes)
Write out the given node and its subnodes to a VRML2 file.
SGLIB_API SGNODE * GetSGNodeParent(SGNODE *aNode)
SGLIB_API void DestroyNode(SGNODE *aNode) noexcept
Delete the given SG* class node.
SGLIB_API bool AddSGNodeChild(SGNODE *aParent, SGNODE *aChild)
SGLIB_API bool AddSGNodeRef(SGNODE *aParent, SGNODE *aChild)
static SGNODE * getColor(IFSG_SHAPE &shape, int colorIdx)
Handle(XCAFApp_Application) m_app
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)
IFSG_APPEARANCE defaultColor
Wrapper so the node clears it if a shape that took ownership is destroyed first.
S3D::MODEL_IMPORT_OPTIONS options
Handle(XCAFDoc_ShapeTool) m_assy
MODEL_IMPORT_STATUS * status
SGNODE * GetColor(Quantity_ColorRGBA *colorObj)
void Set(S3D::MODEL_IMPORT_ERROR aError, const char *aDiagnostic)
Remove the scratch file an importer expanded a compressed model into.
double stepLinearDeflection
MODEL_IMPORT_FORMAT format
std::uint64_t maxCompressedBytes
std::uint64_t maxExpandedBytes
double stepAngularDeflectionDegrees