40 m_Type = WRL2NODES::WRL2_SHAPE;
48 m_Type = WRL2NODES::WRL2_SHAPE;
59 wxT(
" * [INFO] Destroying Shape node with %zu children, %zu"
60 "references, and %zu back pointers." ),
82 wxCHECK_MSG( aNode,
false, wxT(
"Invalid node." ) );
90 " * [INFO] bad file format; unexpected child node '%s'." ),
96 if( WRL2NODES::WRL2_APPEARANCE == type )
102 " * [INFO] bad file format; multiple appearance nodes." ),
103 __FILE__, __FUNCTION__, __LINE__ );
116 " * [INFO] bad file format; multiple geometry nodes." ),
117 __FILE__, __FUNCTION__, __LINE__ );
129 wxCHECK_MSG( aNode,
false, wxT(
"Invalid node." ) );
137 " * [INFO] bad file format; unexpected child node '%s'." ),
143 if( WRL2NODES::WRL2_APPEARANCE == type )
149 " * [INFO] bad file format; multiple appearance nodes." ),
150 __FILE__, __FUNCTION__, __LINE__ );
163 " * [INFO] bad file format; multiple geometry nodes." ),
164 __FILE__, __FUNCTION__, __LINE__ );
178 case WRL2NODES::WRL2_APPEARANCE:
179 case WRL2NODES::WRL2_BOX:
180 case WRL2NODES::WRL2_CONE:
181 case WRL2NODES::WRL2_CYLINDER:
182 case WRL2NODES::WRL2_ELEVATIONGRID:
183 case WRL2NODES::WRL2_EXTRUSION:
184 case WRL2NODES::WRL2_INDEXEDFACESET:
185 case WRL2NODES::WRL2_INDEXEDLINESET:
186 case WRL2NODES::WRL2_POINTSET:
187 case WRL2NODES::WRL2_SPHERE:
188 case WRL2NODES::WRL2_TEXT:
202 wxCHECK_MSG( aTopNode,
false, wxT(
"Invalid top node." ) );
204 char tok = proc.
Peek();
209 " * [INFO] bad file format; unexpected eof %s." ),
219 " * [INFO] bad file format; expecting '{' but got '%s' %s." ),
230 if( proc.
Peek() ==
'}' )
240 __FILE__, __FUNCTION__, __LINE__ , proc.
GetError() );
248 if( !glob.compare(
"appearance" ) )
250 if( !aTopNode->
ReadNode( proc,
this,
nullptr ) )
254 " * [INFO] could not read appearance node information." ),
255 __FILE__, __FUNCTION__, __LINE__ );
260 else if( !glob.compare(
"geometry" ) )
262 if( !aTopNode->
ReadNode( proc,
this,
nullptr ) )
266 " * [INFO] could not read geometry node information." ),
267 __FILE__, __FUNCTION__, __LINE__ );
276 " * [INFO] invalid Shape %s.\n"
277 " * [INFO] file: '%s'\n" ),
298 case WRL2NODES::WRL2_INDEXEDLINESET:
299 case WRL2NODES::WRL2_POINTSET:
300 case WRL2NODES::WRL2_TEXT:
309 wxT(
" * [INFO] Translating Shape with %zu children, %zu references, and"
310 "%zu back pointers." ),
313 bool vcolors =
false;
331 wxString::Format( wxT(
"Shape does not have a Transform parent (parent "
332 "ID: %d)." ), ptype ) );
336 if(
nullptr != aParent )
358 if(
nullptr == pGeom )
371 if(
nullptr !=
appearance &&
nullptr == pApp )
388 if(
nullptr == aNode )
402 if(
nullptr == aNode )
IFSG_FACESET is the wrapper for the SGFACESET class.
bool Attach(SGNODE *aNode) override
Function Attach associates a given SGNODE* with this wrapper.
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.
The base class of all Scene Graph nodes.
The top node of a VRML2 model.
bool ReadNode(WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
std::list< WRL2NODE * > m_BackPointers
virtual void unlinkChildNode(const WRL2NODE *aNode)
Remove references to an owned child.
std::list< WRL2NODE * > m_Children
virtual SGNODE * TranslateToSG(SGNODE *aParent)=0
Produce a representation of the data using the intermediate scenegraph structures of the kicad_3dsg l...
virtual bool AddRefNode(WRL2NODE *aNode)
virtual void unlinkRefNode(const WRL2NODE *aNode)
Remove pointers to a referenced node.
const char * GetNodeTypeName(WRL2NODES aNodeType) const
WRL2NODES GetNodeType(void) const
std::list< WRL2NODE * > m_Refs
virtual bool AddChildNode(WRL2NODE *aNode)
bool AddRefNode(WRL2NODE *aNode) override
bool checkNodeType(WRL2NODES aType)
SGNODE * TranslateToSG(SGNODE *aParent) override
Produce a representation of the data using the intermediate scenegraph structures of the kicad_3dsg l...
bool Read(WRLPROC &proc, WRL2BASE *aTopNode) override
bool AddChildNode(WRL2NODE *aNode) override
bool isDangling(void) override
Determine whether an object should be moved to a different parent during the VRML to SG* translation.
void unlinkRefNode(const WRL2NODE *aNode) override
Remove pointers to a referenced node.
void unlinkChildNode(const WRL2NODE *aNode) override
Remove references to an owned child.
std::string GetFileName(void)
std::string GetError(void)
bool ReadName(std::string &aName)
std::string GetFilePosition() const
const wxChar *const traceVrmlPlugin
Flag to enable VRML plugin trace output.
collects header files for all SG* wrappers and the API
SGLIB_API S3D::SGTYPES GetSGNodeType(SGNODE *aNode)
SGLIB_API SGNODE * GetSGNodeParent(SGNODE *aNode)
SGLIB_API bool AddSGNodeChild(SGNODE *aParent, SGNODE *aChild)
SGLIB_API bool AddSGNodeRef(SGNODE *aParent, SGNODE *aChild)