28#include <wx/xml/xml.h>
49 if(
nullptr != aParent )
65 wxT(
" * [INFO] Destroying Shape with %zu children, %zu references, "
66 "%and ul back pointers." ),
73 if(
nullptr == aTopNode ||
nullptr == aNode )
82 for( prop = aNode->GetAttributes(); prop !=
nullptr; prop = prop->GetNext() )
84 const wxString& pname = prop->GetName();
86 if( pname == wxT(
"DEF" ) )
93 for( wxXmlNode* child = aNode->GetChildren(); child !=
nullptr; child = child->GetNext() )
95 wxString
name = child->GetName();
99 else if(
name == wxT(
"IndexedFaceSet" ) &&
nullptr ==
geometry )
118 if(
nullptr != aParent )
126 if(
nullptr !=
m_Parent && doUnlink )
140 if(
nullptr == aNode )
148 std::list< X3DNODE* >::iterator sC =
m_Children.begin();
149 std::list< X3DNODE* >::iterator eC =
m_Children.end();
193 if(
nullptr == aNode )
201 std::list< X3DNODE* >::iterator sR =
m_Refs.begin();
202 std::list< X3DNODE* >::iterator eR =
m_Refs.end();
216 m_Refs.push_back( aNode );
229 m_Refs.push_back( aNode );
249 wxT(
" * [INFO] Translating Shape with %zu children, %zu references, "
250 "and %zu back pointers." ),
258 wxT(
" * [BUG] Shape does not have a Transform parent (parent ID: %d)" ),
266 if(
nullptr != aParent )
289 if(
nullptr == pApp ||
nullptr == pGeom )
317 if(
nullptr == aNode )
331 if(
nullptr == aNode )
bool Attach(SGNODE *aNode) override
Associate a given SGNODE* with this wrapper.
The wrapper for the SGFACESET class.
bool Attach(SGNODE *aNode) override
Associate a given SGNODE* with this wrapper.
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.
The base class of all Scene Graph nodes.
The base class of all X3D nodes.
void addNodeRef(X3DNODE *aNode)
Add a pointer to a node which references, but does not own, this node.
std::list< X3DNODE * > m_Children
std::list< X3DNODE * > m_BackPointers
virtual bool AddChildNode(X3DNODE *aNode)=0
std::list< X3DNODE * > m_Refs
X3DNODES GetNodeType(void) const
Return the type of this node instance.
X3DNODE * GetParent(void) const
Return a pointer to the parent node of this object or NULL if the object has no parent (ie.
virtual SGNODE * TranslateToSG(SGNODE *aParent)=0
Produce a representation of the data using the intermediate scenegraph structures of the kicad_3dsg l...
virtual void unlinkRefNode(const X3DNODE *aNode)
Remove pointers to a referenced node; it is invoked by the referenced node upon destruction to ensure...
virtual bool SetParent(X3DNODE *aParent, bool doUnlink=true)=0
Set the parent X3DNODE of this object.
virtual void unlinkChildNode(const X3DNODE *aNode)
Remove references to an owned child; it is invoked by the child upon destruction to ensure that the p...
virtual void unlinkRefNode(const X3DNODE *aNode) override
Remove pointers to a referenced node; it is invoked by the referenced node upon destruction to ensure...
SGNODE * TranslateToSG(SGNODE *aParent) override
Produce a representation of the data using the intermediate scenegraph structures of the kicad_3dsg l...
bool SetParent(X3DNODE *aParent, bool doUnlink=true) override
Set the parent X3DNODE of this object.
bool AddChildNode(X3DNODE *aNode) override
bool Read(wxXmlNode *aNode, X3DNODE *aTopNode, X3D_DICT &aDict) override
bool AddRefNode(X3DNODE *aNode) override
virtual void unlinkChildNode(const X3DNODE *aNode) override
Remove references to an owned child; it is invoked by the child upon destruction to ensure that the p...
bool AddName(const wxString &aName, X3DNODE *aNode)
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)
bool ReadIndexedFaceSet(wxXmlNode *aNode, X3DNODE *aParent, X3D_DICT &aDict)
bool ReadAppearance(wxXmlNode *aNode, X3DNODE *aParent, X3D_DICT &aDict)