37typedef std::pair< std::string, WRL2NODES >
NODEITEM;
38typedef std::map< std::string, WRL2NODES >
NODEMAP;
139 (*sBP)->unlinkRefNode(
this );
143 std::list< WRL2NODE* >::iterator sC =
m_Refs.begin();
144 std::list< WRL2NODE* >::iterator eC =
m_Refs.end();
148 (*sC)->delNodeRef(
this );
158 (*sC)->SetParent(
nullptr,
false );
173 std::list< WRL2NODE* >::iterator np =
185 std::list< WRL2NODE* >::iterator np =
195 " * [BUG] delNodeRef() did not find its target." ),
196 __FILE__, __FUNCTION__, __LINE__ );
223 std::set< std::string >::iterator item =
badNames.find( aName );
229 " * [INFO] invalid node name '%s' (matches restricted word)" ),
230 __FILE__, __FUNCTION__, __LINE__, *item );
236 if( isdigit( aName[0] ) )
239 " * [INFO] invalid node name '%s' (begins with digit)" ),
240 __FILE__, __FUNCTION__, __LINE__, aName );
249 #define BAD_CHARS1 "\"\'#,.\\[]{}\x00\x01\x02\x03\x04\x05\x06\x09\x0A\x0B\x0C\x0D\x0E\x0F"
250 #define BAD_CHARS2 "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"
252 if( std::string::npos != aName.find_first_of(
BAD_CHARS1 )
253 || std::string::npos != aName.find_first_of(
BAD_CHARS2 ) )
257 " * [INFO] invalid node name '%s' (contains invalid character)" ),
258 __FILE__, __FUNCTION__, __LINE__, aName );
272 return "*INVALID_TYPE*";
275 return "*VIRTUAL_BASE*";
277 NODEMAP::iterator it =
nodenames.begin();
280 return it->first.c_str();
286 NODEMAP::iterator it =
nodenames.find( aNodeName );
303 if( aNodeName.empty() )
306 if( !
m_Name.compare( aNodeName ) )
309 std::list< WRL2NODE* >::iterator sLA =
m_Children.begin();
310 std::list< WRL2NODE* >::iterator eLA =
m_Children.end();
316 if( *sLA != aCaller )
318 psg = (*sLA)->
FindNode( aNodeName,
this );
329 return m_Parent->FindNode( aNodeName,
this );
340 if(
nullptr !=
m_Parent && doUnlink )
354 wxCHECK_MSG( aNode,
false, wxT(
"Invalid node pointer." ) );
356 wxT(
"Attempting to add a base node to another node." ) );
359 std::list< WRL2NODE* >::iterator sC =
m_Children.begin();
360 std::list< WRL2NODE* >::iterator eC =
m_Children.end();
381 wxCHECK_MSG( aNode,
false, wxT(
"Invalid node pointer." ) );
383 wxT(
"Attempt to add a base node reference to another base node" ) );
385 std::list< WRL2NODE* >::iterator sR =
m_Refs.begin();
386 std::list< WRL2NODE* >::iterator eR =
m_Refs.end();
396 m_Refs.push_back( aNode );
405 std::list< WRL2NODE* >::iterator sL =
m_Children.begin();
406 std::list< WRL2NODE* >::iterator eL =
m_Children.end();
423 std::list< WRL2NODE* >::iterator sL =
m_Refs.begin();
424 std::list< WRL2NODE* >::iterator eL =
m_Refs.end();
void addNodeRef(WRL2NODE *aNode)
Add a pointer to a node which references but does not own this node.
virtual bool SetName(const std::string &aName)
WRL2NODES getNodeTypeID(const std::string &aNodeName)
std::list< WRL2NODE * > m_BackPointers
WRL2NODE * GetParent(void) const
virtual std::string GetName(void)
virtual bool SetParent(WRL2NODE *aParent, bool doUnlink=true)
Set the parent WRL2NODE of this object.
virtual void unlinkChildNode(const WRL2NODE *aNode)
Remove references to an owned child.
std::string GetError(void)
std::list< WRL2NODE * > m_Children
virtual WRL2NODE * FindNode(const std::string &aNodeName, const WRL2NODE *aCaller)
Search the tree of linked nodes and returns a reference to the first node found with the given name.
virtual bool AddRefNode(WRL2NODE *aNode)
void delNodeRef(WRL2NODE *aNode)
Remove a pointer to a node which references but does not own this node.
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)
const wxChar *const traceVrmlPlugin
Flag to enable VRML plugin trace output.
std::map< std::string, std::vector< SGNODE * > > NODEMAP
std::pair< std::string, std::vector< SGNODE * > > NODEITEM
static std::set< std::string > badNames
@ WRL2_POSITIONINTERPOLATOR
@ WRL2_SCALARINTERPOLATOR
@ WRL2_ORIENTATIONINTERPOLATOR
@ WRL2_NORMALINTERPOLATOR
@ WRL2_COORDINATEINTERPOLATOR