28 #include <wx/xml/xml.h> 47 if(
nullptr != aParent )
63 wxT(
" * [INFO] Destroying Transform with %zu children, %zu references, " 64 "and %zu back pointers." ),
103 wxXmlAttribute* prop;
109 for( prop = aNode->GetAttributes(); prop !=
nullptr; prop = prop->GetNext() )
111 const wxString& pname = prop->GetName();
113 if( pname == wxT(
"DEF" ) )
115 m_Name = prop->GetValue();
118 else if( pname == wxT(
"center" ) )
123 else if( pname == wxT(
"scale" ) )
127 else if( pname == wxT(
"translation" ) )
132 else if( pname == wxT(
"rotation" ) )
136 else if( pname == wxT(
"scaleOrientation" ) )
146 if(
nullptr == aTopNode ||
nullptr == aNode )
153 for( wxXmlNode* child = aNode->GetChildren(); child !=
nullptr; child = child->GetNext() )
155 wxString
name = child->GetName();
157 if(
name == wxT(
"Transform" ) ||
name == wxT(
"Group" ) )
159 else if(
name == wxT(
"Switch" ) )
161 else if(
name == wxT(
"Shape" ) )
181 if(
nullptr != aParent )
189 if(
nullptr !=
m_Parent && doUnlink )
203 if(
nullptr == aNode )
211 std::list< X3DNODE* >::iterator sC =
m_Children.begin();
212 std::list< X3DNODE* >::iterator eC =
m_Children.end();
233 if(
nullptr == aNode )
241 std::list< X3DNODE* >::iterator sR =
m_Refs.begin();
242 std::list< X3DNODE* >::iterator eR =
m_Refs.end();
252 m_Refs.push_back( aNode );
262 wxT(
" * [INFO] Translating Transform with %zu children, %zu references, " 263 "and %zu back pointers." ),
274 wxT(
" * [BUG] Transform does not have a Transform parent (parent ID: %d)" ),
282 if(
nullptr != aParent )
301 std::list< X3DNODE* >::iterator sC =
m_Children.begin();
302 std::list< X3DNODE* >::iterator eC =
m_Children.end();
312 for(
int i = 0; i < 2; ++i )
316 type = (*sC)->GetNodeType();
324 if(
nullptr != (*sC)->TranslateToSG( txNode.
GetRawPtr() ) )
virtual bool SetParent(X3DNODE *aParent, bool doUnlink=true)=0
Set the parent X3DNODE of this object.
std::list< X3DNODE * > m_BackPointers
X3DNODE * GetParent(void) const
Return a pointer to the parent node of this object or NULL if the object has no parent (ie.
SGLIB_API SGNODE * GetSGNodeParent(SGNODE *aNode)
void addNodeRef(X3DNODE *aNode)
Add a pointer to a node which references, but does not own, this node.
The base class of all Scene Graph nodes.
collects header files for all SG* wrappers and the API
SGNODE * GetRawPtr(void) noexcept
Function GetRawPtr() returns the raw internal SGNODE pointer.
bool ReadTransform(wxXmlNode *aNode, X3DNODE *aParent, X3D_DICT &aDict)
SGLIB_API bool AddSGNodeRef(SGNODE *aParent, SGNODE *aChild)
std::list< X3DNODE * > m_Children
The base class of all X3D nodes.
SGLIB_API bool AddSGNodeChild(SGNODE *aParent, SGNODE *aChild)
virtual bool AddChildNode(X3DNODE *aNode)=0
X3DNODES GetNodeType(void) const
Return the type of this node instance.
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...
const wxChar *const traceVrmlPlugin
Flag to enable VRML plugin trace output.
bool AddName(const wxString &aName, X3DNODE *aNode)
bool ParseSFRotation(const wxString &aSource, WRLROTATION &aResult)
bool ReadShape(wxXmlNode *aNode, X3DNODE *aParent, X3D_DICT &aDict)
SGLIB_API S3D::SGTYPES GetSGNodeType(SGNODE *aNode)
bool ParseSFVec3(const wxString &aSource, WRLVEC3F &aResult)
bool ReadSwitch(wxXmlNode *aNode, X3DNODE *aParent, X3D_DICT &aDict)
void Destroy(void)
Function Destroy deletes the object held by this wrapper.
std::list< X3DNODE * > m_Refs