41typedef std::pair< std::string, WRL2NODES >
NODEITEM;
42typedef std::map< std::string, WRL2NODES >
NODEMAP;
143 (*sBP)->unlinkRefNode(
this );
147 std::list< WRL2NODE* >::iterator sC =
m_Refs.begin();
148 std::list< WRL2NODE* >::iterator eC =
m_Refs.end();
152 (*sC)->delNodeRef(
this );
162 (*sC)->SetParent(
nullptr,
false );
177 std::list< WRL2NODE* >::iterator np =
189 std::list< WRL2NODE* >::iterator np =
199 " * [BUG] delNodeRef() did not find its target." ),
200 __FILE__, __FUNCTION__, __LINE__ );
227 std::set< std::string >::iterator item =
badNames.find( aName );
233 " * [INFO] invalid node name '%s' (matches restricted word)" ),
234 __FILE__, __FUNCTION__, __LINE__, *item );
240 if( isdigit( aName[0] ) )
243 " * [INFO] invalid node name '%s' (begins with digit)" ),
244 __FILE__, __FUNCTION__, __LINE__, aName );
253 #define BAD_CHARS1 "\"\'#,.\\[]{}\x00\x01\x02\x03\x04\x05\x06\x09\x0A\x0B\x0C\x0D\x0E\x0F"
254 #define BAD_CHARS2 "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"
256 if( std::string::npos != aName.find_first_of(
BAD_CHARS1 )
257 || std::string::npos != aName.find_first_of(
BAD_CHARS2 ) )
261 " * [INFO] invalid node name '%s' (contains invalid character)" ),
262 __FILE__, __FUNCTION__, __LINE__, aName );
276 return "*INVALID_TYPE*";
279 return "*VIRTUAL_BASE*";
281 NODEMAP::iterator it =
nodenames.begin();
284 return it->first.c_str();
290 NODEMAP::iterator it =
nodenames.find( aNodeName );
307 if( aNodeName.empty() )
310 if( !
m_Name.compare( aNodeName ) )
313 std::list< WRL2NODE* >::iterator sLA =
m_Children.begin();
314 std::list< WRL2NODE* >::iterator eLA =
m_Children.end();
320 if( *sLA != aCaller )
322 psg = (*sLA)->
FindNode( aNodeName,
this );
344 if(
nullptr !=
m_Parent && doUnlink )
358 wxCHECK_MSG( aNode,
false, wxT(
"Invalid node pointer." ) );
360 wxT(
"Attempting to add a base node to another node." ) );
363 std::list< WRL2NODE* >::iterator sC =
m_Children.begin();
364 std::list< WRL2NODE* >::iterator eC =
m_Children.end();
385 wxCHECK_MSG( aNode,
false, wxT(
"Invalid node pointer." ) );
387 wxT(
"Attempt to add a base node reference to another base node" ) );
389 std::list< WRL2NODE* >::iterator sR =
m_Refs.begin();
390 std::list< WRL2NODE* >::iterator eR =
m_Refs.end();
400 m_Refs.push_back( aNode );
409 std::list< WRL2NODE* >::iterator sL =
m_Children.begin();
410 std::list< WRL2NODE* >::iterator eL =
m_Children.end();
427 std::list< WRL2NODE* >::iterator sL =
m_Refs.begin();
428 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::map< std::string, WRL2NODES > NODEMAP
static std::set< std::string > badNames
std::pair< std::string, WRL2NODES > NODEITEM
@ WRL2_POSITIONINTERPOLATOR
@ WRL2_SCALARINTERPOLATOR
@ WRL2_ORIENTATIONINTERPOLATOR
@ WRL2_NORMALINTERPOLATOR
@ WRL2_COORDINATEINTERPOLATOR