KiCad PCB EDA Suite
WRL1GROUP Class Reference

#include <vrml1_group.h>

Inheritance diagram for WRL1GROUP:
WRL1NODE

Public Member Functions

 WRL1GROUP (NAMEREGISTER *aDictionary)
 
 WRL1GROUP (NAMEREGISTER *aDictionary, WRL1NODE *aNode)
 
virtual ~WRL1GROUP ()
 
bool Read (WRLPROC &proc, WRL1BASE *aTopNode) override
 
SGNODETranslateToSG (SGNODE *aParent, WRL1STATUS *sp) override
 Produce a representation of the data using the intermediate scenegraph structures of the kicad_3dsg library. More...
 
void cancelDict (void)
 
WRL1NODES getNodeTypeID (const std::string &aNodeName)
 Return the ID based on the given aNodeName or WRL1_INVALID (WRL1_END) if no such node name exists. More...
 
virtual void unlinkChildNode (const WRL1NODE *aNode)
 Remove references to an owned child; it is invoked by the child upon destruction to ensure that the parent has no invalid references. More...
 
virtual void unlinkRefNode (const WRL1NODE *aNode)
 Remove pointers to a referenced node; it is invoked by the referenced node upon destruction to ensure that the referring node has no invalid references. More...
 
void addNodeRef (WRL1NODE *aNode)
 Add a pointer to a node which references, but does not own, this node. More...
 
void delNodeRef (WRL1NODE *aNode)
 Remove a pointer to a node which references, but does not own, this node. More...
 
WRL1NODES GetNodeType (void) const
 Return the type of this node instance. More...
 
WRL1NODEGetParent (void) const
 Return a pointer to the parent SGNODE of this object or NULL if the object has no parent (ie. More...
 
virtual bool SetParent (WRL1NODE *aParent, bool doUnlink=true)
 Set the parent WRL1NODE of this object. More...
 
virtual std::string GetName (void)
 
virtual bool SetName (const std::string &aName)
 
const char * GetNodeTypeName (WRL1NODES aNodeType) const
 
size_t GetNItems (void) const
 
virtual WRL1NODEFindNode (const std::string &aNodeName)
 Search the tree of linked nodes and returns a reference to the current node with the given name. More...
 
virtual bool AddChildNode (WRL1NODE *aNode)
 
virtual bool AddRefNode (WRL1NODE *aNode)
 
std::string GetError (void)
 

Protected Attributes

WRL1NODEm_Parent
 
WRL1NODES m_Type
 
std::string m_Name
 
std::list< WRL1NODE * > m_BackPointers
 
std::list< WRL1NODE * > m_Children
 
std::list< WRL1NODE * > m_Refs
 
std::list< WRL1NODE * > m_Items
 
std::string m_error
 
WRL1STATUS m_current
 
SGNODEm_sgNode
 
NAMEREGISTERm_dictionary
 

Detailed Description

Definition at line 38 of file vrml1_group.h.

Constructor & Destructor Documentation

◆ WRL1GROUP() [1/2]

WRL1GROUP::WRL1GROUP ( NAMEREGISTER aDictionary)

Definition at line 40 of file vrml1_group.cpp.

40  : WRL1NODE( aDictionary )
41 {
43 }
WRL1NODE(NAMEREGISTER *aDictionary)
Definition: vrml1_node.cpp:91
WRL1NODES m_Type
Definition: vrml1_node.h:227

References WRL1NODE::m_Type, and WRL1_GROUP.

◆ WRL1GROUP() [2/2]

WRL1GROUP::WRL1GROUP ( NAMEREGISTER aDictionary,
WRL1NODE aNode 
)

Definition at line 46 of file vrml1_group.cpp.

46  :
47  WRL1NODE( aDictionary )
48 {
50  m_Parent = aParent;
51 
52  if( nullptr != m_Parent )
53  m_Parent->AddChildNode( this );
54 }
WRL1NODE(NAMEREGISTER *aDictionary)
Definition: vrml1_node.cpp:91
virtual bool AddChildNode(WRL1NODE *aNode)
Definition: vrml1_node.cpp:376
WRL1NODES m_Type
Definition: vrml1_node.h:227
WRL1NODE * m_Parent
Definition: vrml1_node.h:226

References WRL1NODE::AddChildNode(), WRL1NODE::m_Parent, WRL1NODE::m_Type, and WRL1_GROUP.

◆ ~WRL1GROUP()

WRL1GROUP::~WRL1GROUP ( )
virtual

Definition at line 57 of file vrml1_group.cpp.

58 {
59  wxLogTrace( traceVrmlPlugin,
60  wxT( " * [INFO] Destroying Group with %zu children, %zu references, and %zu "
61  "back pointers." ),
62  m_Children.size(), m_Refs.size(), m_BackPointers.size() );
63 }
std::list< WRL1NODE * > m_BackPointers
Definition: vrml1_node.h:230
std::list< WRL1NODE * > m_Refs
Definition: vrml1_node.h:232
const wxChar *const traceVrmlPlugin
Flag to enable VRML plugin trace output.
Definition: vrml.cpp:63
std::list< WRL1NODE * > m_Children
Definition: vrml1_node.h:231

References WRL1NODE::m_BackPointers, WRL1NODE::m_Children, WRL1NODE::m_Refs, and traceVrmlPlugin.

Member Function Documentation

◆ AddChildNode()

bool WRL1NODE::AddChildNode ( WRL1NODE aNode)
virtualinherited

Reimplemented in WRL1COORDS, WRL1MATERIAL, WRL1FACESET, WRL1MATBINDING, WRL1SHAPEHINTS, and WRL1TRANSFORM.

Definition at line 376 of file vrml1_node.cpp.

377 {
378  wxCHECK_MSG( aNode, false, wxT( "Invalid node pointer." ) );
379  wxCHECK_MSG( aNode->GetNodeType() != WRL1NODES::WRL1_BASE, false,
380  wxT( "Attempting to add a base node to another node." ) );
381 
382  std::list< WRL1NODE* >::iterator sC = m_Children.begin();
383  std::list< WRL1NODE* >::iterator eC = m_Children.end();
384 
385  while( sC != eC )
386  {
387  if( *sC == aNode )
388  return false;
389 
390  ++sC;
391  }
392 
393  m_Children.push_back( aNode );
394  addItem( aNode );
395 
396  if( aNode->GetParent() != this )
397  aNode->SetParent( this );
398 
399  return true;
400 }
WRL1NODE * GetParent(void) const
Return a pointer to the parent SGNODE of this object or NULL if the object has no parent (ie.
Definition: vrml1_node.cpp:260
virtual bool SetParent(WRL1NODE *aParent, bool doUnlink=true)
Set the parent WRL1NODE of this object.
Definition: vrml1_node.cpp:359
WRL1NODES GetNodeType(void) const
Return the type of this node instance.
Definition: vrml1_node.cpp:254
void addItem(WRL1NODE *aNode)
Definition: vrml1_node.cpp:458
std::list< WRL1NODE * > m_Children
Definition: vrml1_node.h:231

References WRL1NODE::addItem(), WRL1NODE::GetNodeType(), WRL1NODE::GetParent(), WRL1NODE::m_Children, WRL1NODE::SetParent(), and WRL1_BASE.

Referenced by WRL1NODE::SetParent(), WRL1COORDS::WRL1COORDS(), WRL1FACESET::WRL1FACESET(), WRL1GROUP(), WRL1MATBINDING::WRL1MATBINDING(), WRL1MATERIAL::WRL1MATERIAL(), WRL1SEPARATOR::WRL1SEPARATOR(), WRL1SHAPEHINTS::WRL1SHAPEHINTS(), WRL1SWITCH::WRL1SWITCH(), and WRL1TRANSFORM::WRL1TRANSFORM().

◆ addNodeRef()

void WRL1NODE::addNodeRef ( WRL1NODE aNode)
inherited

Add a pointer to a node which references, but does not own, this node.

Such back-pointers are required to ensure that invalidated references are removed when a node is deleted

Parameters
aNodeis the node holding a reference to this object.

Definition at line 216 of file vrml1_node.cpp.

217 {
218  // the parent node must never be added as a backpointer
219  if( aNode == m_Parent )
220  return;
221 
222  std::list< WRL1NODE* >::iterator sR = m_BackPointers.begin();
223  std::list< WRL1NODE* >::iterator eR = m_BackPointers.end();
224 
225  while( sR != eR )
226  {
227  if( *sR == aNode )
228  return;
229 
230  ++sR;
231  }
232 
233  m_BackPointers.push_back( aNode );
234 }
std::list< WRL1NODE * > m_BackPointers
Definition: vrml1_node.h:230
WRL1NODE * m_Parent
Definition: vrml1_node.h:226

References WRL1NODE::m_BackPointers, and WRL1NODE::m_Parent.

Referenced by WRL1NODE::AddRefNode().

◆ AddRefNode()

bool WRL1NODE::AddRefNode ( WRL1NODE aNode)
virtualinherited

Reimplemented in WRL1COORDS, WRL1MATERIAL, WRL1FACESET, WRL1MATBINDING, WRL1SHAPEHINTS, and WRL1TRANSFORM.

Definition at line 403 of file vrml1_node.cpp.

404 {
405  wxCHECK_MSG( aNode, false, wxT( "Invalid node pointer." ) );
406  wxCHECK_MSG( aNode->GetNodeType() != WRL1NODES::WRL1_BASE, false,
407  wxT( "Attempt to add a base node reference to another base node" ) );
408 
409  // note: the VRML1 spec does not prevent the reuse of a node at
410  // the same level; for example a Coordinate3 node can be recalled
411  // at any time to set the current coordinate set.
412  m_Refs.push_back( aNode );
413  aNode->addNodeRef( this );
414  addItem( aNode );
415 
416  return true;
417 }
void addNodeRef(WRL1NODE *aNode)
Add a pointer to a node which references, but does not own, this node.
Definition: vrml1_node.cpp:216
std::list< WRL1NODE * > m_Refs
Definition: vrml1_node.h:232
WRL1NODES GetNodeType(void) const
Return the type of this node instance.
Definition: vrml1_node.cpp:254
void addItem(WRL1NODE *aNode)
Definition: vrml1_node.cpp:458

References WRL1NODE::addItem(), WRL1NODE::addNodeRef(), WRL1NODE::GetNodeType(), WRL1NODE::m_Refs, and WRL1_BASE.

Referenced by WRL1BASE::implementUse().

◆ cancelDict()

void WRL1NODE::cancelDict ( void  )
inherited

Definition at line 198 of file vrml1_node.cpp.

199 {
200  std::list< WRL1NODE* >::iterator sC = m_Children.begin();
201  std::list< WRL1NODE* >::iterator eC = m_Children.end();
202 
203  while( sC != eC )
204  {
205  (*sC)->cancelDict();
206  ++sC;
207  }
208 
209  if( m_Type == WRL1NODES::WRL1_BASE && nullptr != m_dictionary )
210  delete m_dictionary;
211 
212  m_dictionary = nullptr;
213 }
NAMEREGISTER * m_dictionary
Definition: vrml1_node.h:246
WRL1NODES m_Type
Definition: vrml1_node.h:227
std::list< WRL1NODE * > m_Children
Definition: vrml1_node.h:231

References WRL1NODE::m_Children, WRL1NODE::m_dictionary, WRL1NODE::m_Type, and WRL1_BASE.

Referenced by WRL1BASE::~WRL1BASE().

◆ delNodeRef()

void WRL1NODE::delNodeRef ( WRL1NODE aNode)
inherited

Remove a pointer to a node which references, but does not own, this node.

Parameters
aNodeis the node holding a reference to this object.

Definition at line 237 of file vrml1_node.cpp.

238 {
239  std::list< WRL1NODE* >::iterator np = std::find( m_BackPointers.begin(),
240  m_BackPointers.end(), aNode );
241 
242  if( np != m_BackPointers.end() )
243  {
244  m_BackPointers.erase( np );
245  return;
246  }
247 
248  wxLogTrace( traceVrmlPlugin, wxT( "%s:%s:%d\n"
249  " * [BUG] delNodeRef() did not find its target." ),
250  __FILE__, __FUNCTION__, __LINE__ );
251 }
std::list< WRL1NODE * > m_BackPointers
Definition: vrml1_node.h:230
const wxChar *const traceVrmlPlugin
Flag to enable VRML plugin trace output.
Definition: vrml.cpp:63

References WRL1NODE::m_BackPointers, and traceVrmlPlugin.

◆ FindNode()

WRL1NODE * WRL1NODE::FindNode ( const std::string &  aNodeName)
virtualinherited

Search the tree of linked nodes and returns a reference to the current node with the given name.

The reference is then typically added to another node via AddRefNode().

Parameters
aNodeNameis the name of the node to search for.
Returns
is a valid node pointer on success, otherwise NULL.

Definition at line 350 of file vrml1_node.cpp.

351 {
352  if( nullptr == m_dictionary )
353  return nullptr;
354 
355  return m_dictionary->FindName( aNodeName );
356 }
WRL1NODE * FindName(const std::string &aName)
Definition: vrml1_node.cpp:72
NAMEREGISTER * m_dictionary
Definition: vrml1_node.h:246

References NAMEREGISTER::FindName(), and WRL1NODE::m_dictionary.

Referenced by WRL1BASE::implementUse().

◆ GetError()

std::string WRL1NODE::GetError ( void  )
inherited

Definition at line 344 of file vrml1_node.cpp.

345 {
346  return m_error;
347 }
std::string m_error
Definition: vrml1_node.h:234

References WRL1NODE::m_error.

◆ GetName()

std::string WRL1NODE::GetName ( void  )
virtualinherited

Reimplemented in WRL1BASE.

Definition at line 266 of file vrml1_node.cpp.

267 {
268  return m_Name;
269 }
std::string m_Name
Definition: vrml1_node.h:228

References WRL1NODE::m_Name.

◆ GetNItems()

size_t WRL1NODE::GetNItems ( void  ) const
inherited

Definition at line 338 of file vrml1_node.cpp.

339 {
340  return m_Items.size();
341 }
std::list< WRL1NODE * > m_Items
Definition: vrml1_node.h:233

References WRL1NODE::m_Items.

◆ GetNodeType()

WRL1NODES WRL1NODE::GetNodeType ( void  ) const
inherited

Return the type of this node instance.

Definition at line 254 of file vrml1_node.cpp.

255 {
256  return m_Type;
257 }
WRL1NODES m_Type
Definition: vrml1_node.h:227

References WRL1NODE::m_Type.

Referenced by WRL1NODE::AddChildNode(), WRL1NODE::AddRefNode(), WRL1BASE::implementUse(), TranslateToSG(), and WRL1TRANSFORM::TranslateToSG().

◆ getNodeTypeID()

WRL1NODES WRL1NODE::getNodeTypeID ( const std::string &  aNodeName)
inherited

Return the ID based on the given aNodeName or WRL1_INVALID (WRL1_END) if no such node name exists.

Definition at line 327 of file vrml1_node.cpp.

328 {
329  NODEMAP::iterator it = nodenames.find( aNodeName );
330 
331  if( nodenames.end() != it )
332  return it->second;
333 
335 }
static NODEMAP nodenames
Definition: vrml1_node.cpp:88

References nodenames, and WRL1_INVALID.

Referenced by WRL1BASE::ReadNode().

◆ GetNodeTypeName()

const char * WRL1NODE::GetNodeTypeName ( WRL1NODES  aNodeType) const
inherited

Definition at line 312 of file vrml1_node.cpp.

313 {
314  if( aNodeType < WRL1NODES::WRL1_BASE || aNodeType >= WRL1NODES::WRL1_END )
315  return "*INVALID_TYPE*";
316 
317  if( aNodeType == WRL1NODES::WRL1_BASE )
318  return "*VIRTUAL_BASE*";
319 
320  NODEMAP::iterator it = nodenames.begin();
321  advance( it, ( static_cast<int>( aNodeType ) - static_cast<int>( WRL1NODES::WRL1_BEGIN ) ) );
322 
323  return it->first.c_str();
324 }
static NODEMAP nodenames
Definition: vrml1_node.cpp:88

References nodenames, WRL1_BASE, WRL1_BEGIN, and WRL1_END.

Referenced by WRL1BASE::implementUse().

◆ GetParent()

WRL1NODE * WRL1NODE::GetParent ( void  ) const
inherited

Return a pointer to the parent SGNODE of this object or NULL if the object has no parent (ie.

top level transform).

Definition at line 260 of file vrml1_node.cpp.

261 {
262  return m_Parent;
263 }
WRL1NODE * m_Parent
Definition: vrml1_node.h:226

References WRL1NODE::m_Parent.

Referenced by WRL1NODE::AddChildNode().

◆ Read()

bool WRL1GROUP::Read ( WRLPROC proc,
WRL1BASE aTopNode 
)
overridevirtual

Implements WRL1NODE.

Definition at line 66 of file vrml1_group.cpp.

67 {
68  if( nullptr == aTopNode )
69  {
70  wxLogTrace( traceVrmlPlugin, wxT( "%s:%s:%d\n"
71  " * [BUG] aTopNode is NULL" ),
72  __FILE__, __FUNCTION__, __LINE__ );
73 
74  return false;
75  }
76 
77  char tok = proc.Peek();
78 
79  if( proc.eof() )
80  {
81  wxLogTrace( traceVrmlPlugin,
82  wxT( "%s:%s:%d\n"
83  " * [INFO] bad file format; unexpected eof %s." ),
84  __FILE__, __FUNCTION__, __LINE__, proc.GetFilePosition() );
85 
86  return false;
87  }
88 
89  if( '{' != tok )
90  {
91  wxLogTrace( traceVrmlPlugin,
92  wxT( "%s:%s:%d\n"
93  " * [INFO] bad file format; expecting '{' but got '%s' %s." ),
94  __FILE__, __FUNCTION__, __LINE__, tok, proc.GetFilePosition() );
95 
96  return false;
97  }
98 
99  proc.Pop();
100 
101  while( true )
102  {
103  if( proc.Peek() == '}' )
104  {
105  proc.Pop();
106  break;
107  }
108 
109  if( !aTopNode->ReadNode( proc, this, nullptr ) )
110  {
111  wxLogTrace( traceVrmlPlugin,
112  wxT( "%s:%s:%d\n"
113  " * [INFO] bad file format; unexpected eof %s." ),
114  __FILE__, __FUNCTION__, __LINE__, proc.GetFilePosition() );
115 
116  return false;
117  }
118 
119  if( proc.Peek() == ',' )
120  proc.Pop();
121 
122  } // while( true ) -- reading contents of Group{}
123 
124  return true;
125 }
void Pop(void)
Definition: wrlproc.cpp:2035
bool ReadNode(WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
Definition: vrml1_base.cpp:200
std::string GetFilePosition() const
Definition: wrlproc.cpp:1982
char Peek(void)
Definition: wrlproc.cpp:2007
const wxChar *const traceVrmlPlugin
Flag to enable VRML plugin trace output.
Definition: vrml.cpp:63
bool eof(void)
Definition: wrlproc.cpp:1954

References WRLPROC::eof(), WRLPROC::GetFilePosition(), WRLPROC::Peek(), WRLPROC::Pop(), WRL1BASE::ReadNode(), and traceVrmlPlugin.

Referenced by WRL1BASE::readGroup().

◆ SetName()

bool WRL1NODE::SetName ( const std::string &  aName)
virtualinherited

Reimplemented in WRL1BASE.

Definition at line 272 of file vrml1_node.cpp.

273 {
274  if( aName.empty() )
275  return false;
276 
277  if( isdigit( aName[0] ) )
278  {
279  wxLogTrace( traceVrmlPlugin, wxT( "%s:%s:%d\n"
280  " * [INFO] invalid node name '%s' (begins with digit)" ),
281  __FILE__, __FUNCTION__, __LINE__, aName );
282 
283  return false;
284  }
285 
286  // The character '+' is not allowed in names as per the VRML1 specification;
287  // however many parsers accept them and many bad generators use them so the rules
288  // have been relaxed here.
289  #define BAD_CHARS1 "\"\'#,.\\[]{}\x00\x01\x02\x03\x04\x05\x06\x09\x0A\x0B\x0C\x0D\x0E\x0F"
290  #define BAD_CHARS2 "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"
291 
292  if( std::string::npos != aName.find_first_of( BAD_CHARS1 )
293  || std::string::npos != aName.find_first_of( BAD_CHARS2 ) )
294  {
295  wxLogTrace( traceVrmlPlugin,
296  wxT( "%s:%s:%d\n"
297  " * [INFO] invalid node name '%s' (contains invalid character)" ),
298  __FILE__, __FUNCTION__, __LINE__, aName );
299 
300  return false;
301  }
302 
303  m_Name = aName;
304 
305  if( m_dictionary )
306  m_dictionary->AddName( aName, this );
307 
308  return true;
309 }
std::string m_Name
Definition: vrml1_node.h:228
bool AddName(const std::string &aName, WRL1NODE *aNode)
Definition: vrml1_node.cpp:39
const wxChar *const traceVrmlPlugin
Flag to enable VRML plugin trace output.
Definition: vrml.cpp:63
NAMEREGISTER * m_dictionary
Definition: vrml1_node.h:246
#define BAD_CHARS2
#define BAD_CHARS1

References NAMEREGISTER::AddName(), BAD_CHARS1, BAD_CHARS2, WRL1NODE::m_dictionary, WRL1NODE::m_Name, and traceVrmlPlugin.

Referenced by WRL1BASE::implementDef().

◆ SetParent()

bool WRL1NODE::SetParent ( WRL1NODE aParent,
bool  doUnlink = true 
)
virtualinherited

Set the parent WRL1NODE of this object.

Parameters
aParent[in] is the desired parent node.
doUnlinkindicates that the child must be unlinked from the parent
Returns
true if the operation succeeds; false if the given node is not allowed to be a parent to the derived object.

Reimplemented in WRL1BASE.

Definition at line 359 of file vrml1_node.cpp.

360 {
361  if( aParent == m_Parent )
362  return true;
363 
364  if( nullptr != m_Parent && doUnlink )
365  m_Parent->unlinkChildNode( this );
366 
367  m_Parent = aParent;
368 
369  if( nullptr != m_Parent )
370  m_Parent->AddChildNode( this );
371 
372  return true;
373 }
virtual void unlinkChildNode(const WRL1NODE *aNode)
Remove references to an owned child; it is invoked by the child upon destruction to ensure that the p...
Definition: vrml1_node.cpp:420
virtual bool AddChildNode(WRL1NODE *aNode)
Definition: vrml1_node.cpp:376
WRL1NODE * m_Parent
Definition: vrml1_node.h:226

References WRL1NODE::AddChildNode(), WRL1NODE::m_Parent, and WRL1NODE::unlinkChildNode().

Referenced by WRL1NODE::AddChildNode().

◆ TranslateToSG()

SGNODE * WRL1GROUP::TranslateToSG ( SGNODE aParent,
WRL1STATUS sp 
)
overridevirtual

Produce a representation of the data using the intermediate scenegraph structures of the kicad_3dsg library.

Parameters
aParentis a pointer to the parent SG node.
Returns
is non-NULL on success.
Todo:
Determine if this is a bug or can actually happen parsing a VRML file. If it's a bug, this should be an assertion not a trace.

Implements WRL1NODE.

Definition at line 128 of file vrml1_group.cpp.

129 {
130  wxCHECK_MSG( m_Parent, nullptr, wxT( "Group has no parent." ) );
131 
132  wxLogTrace( traceVrmlPlugin,
133  wxT( " * [INFO] Translating Group with %zu children, %zu references, %zu back "
134  "pointers, and %zu items." ),
135  m_Children.size(), m_Refs.size(), m_BackPointers.size(), m_Items.size() );
136 
138  {
139  if( nullptr == sp )
140  {
143  wxLogTrace( traceVrmlPlugin, " * [INFO] bad model: no base data given." );
144 
145  return nullptr;
146  }
147  }
148  else if( nullptr == sp )
149  {
150  m_current.Init();
151  sp = &m_current;
152  }
153 
154  S3D::SGTYPES ptype = S3D::GetSGNodeType( aParent );
155 
156  wxCHECK_MSG( nullptr == aParent && ptype == S3D::SGTYPE_TRANSFORM, nullptr,
158  wxT(" * [BUG] Group does not have a Transform parent (parent ID: %d" ),
159  ptype ) );
160 
161  IFSG_TRANSFORM txNode( aParent );
162  bool hasContent = false;
163 
164  std::list< WRL1NODE* >::iterator sI = m_Items.begin();
165  std::list< WRL1NODE* >::iterator eI = m_Items.end();
166 
167  SGNODE* node = txNode.GetRawPtr();
168 
169  while( sI != eI )
170  {
171  if( nullptr != (*sI)->TranslateToSG( node, sp ) )
172  hasContent = true;
173 
174  ++sI;
175  }
176 
177  if( !hasContent )
178  {
179  txNode.Destroy();
180  return nullptr;
181  }
182 
183  return node;
184 }
WRL1STATUS m_current
Definition: vrml1_node.h:236
The base class of all Scene Graph nodes.
Definition: sg_node.h:74
void Init()
Definition: vrml1_node.h:74
std::list< WRL1NODE * > m_BackPointers
Definition: vrml1_node.h:230
std::list< WRL1NODE * > m_Refs
Definition: vrml1_node.h:232
const wxChar *const traceVrmlPlugin
Flag to enable VRML plugin trace output.
Definition: vrml.cpp:63
SGTYPES
Definition: sg_types.h:34
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
SGLIB_API S3D::SGTYPES GetSGNodeType(SGNODE *aNode)
Definition: ifsg_api.cpp:483
WRL1NODES GetNodeType(void) const
Return the type of this node instance.
Definition: vrml1_node.cpp:254
std::list< WRL1NODE * > m_Items
Definition: vrml1_node.h:233
IFSG_TRANSFORM is the wrapper for the VRML compatible TRANSFORM block class SCENEGRAPH.
WRL1NODE * m_Parent
Definition: vrml1_node.h:226
std::list< WRL1NODE * > m_Children
Definition: vrml1_node.h:231

References IFSG_NODE::Destroy(), Format(), WRL1NODE::GetNodeType(), IFSG_NODE::GetRawPtr(), S3D::GetSGNodeType(), WRL1STATUS::Init(), WRL1NODE::m_BackPointers, WRL1NODE::m_Children, WRL1NODE::m_current, WRL1NODE::m_Items, WRL1NODE::m_Parent, WRL1NODE::m_Refs, S3D::SGTYPE_TRANSFORM, traceVrmlPlugin, and WRL1_BASE.

◆ unlinkChildNode()

void WRL1NODE::unlinkChildNode ( const WRL1NODE aNode)
virtualinherited

Remove references to an owned child; it is invoked by the child upon destruction to ensure that the parent has no invalid references.

Parameters
aNodeis the child which is being deleted.

Definition at line 420 of file vrml1_node.cpp.

421 {
422  std::list< WRL1NODE* >::iterator sL = m_Children.begin();
423  std::list< WRL1NODE* >::iterator eL = m_Children.end();
424 
425  while( sL != eL )
426  {
427  if( *sL == aNode )
428  {
429  m_Children.erase( sL );
430  delItem( aNode );
431  return;
432  }
433 
434  ++sL;
435  }
436 }
void delItem(const WRL1NODE *aNode)
Definition: vrml1_node.cpp:464
std::list< WRL1NODE * > m_Children
Definition: vrml1_node.h:231

References WRL1NODE::delItem(), and WRL1NODE::m_Children.

Referenced by WRL1NODE::SetParent(), and WRL1NODE::~WRL1NODE().

◆ unlinkRefNode()

void WRL1NODE::unlinkRefNode ( const WRL1NODE aNode)
virtualinherited

Remove pointers to a referenced node; it is invoked by the referenced node upon destruction to ensure that the referring node has no invalid references.

Parameters
aNodeis the node which is being deleted.

Definition at line 439 of file vrml1_node.cpp.

440 {
441  std::list< WRL1NODE* >::iterator sL = m_Refs.begin();
442  std::list< WRL1NODE* >::iterator eL = m_Refs.end();
443 
444  while( sL != eL )
445  {
446  if( *sL == aNode )
447  {
448  m_Refs.erase( sL );
449  delItem( aNode );
450  return;
451  }
452 
453  ++sL;
454  }
455 }
std::list< WRL1NODE * > m_Refs
Definition: vrml1_node.h:232
void delItem(const WRL1NODE *aNode)
Definition: vrml1_node.cpp:464

References WRL1NODE::delItem(), and WRL1NODE::m_Refs.

Member Data Documentation

◆ m_BackPointers

◆ m_Children

◆ m_current

◆ m_dictionary

◆ m_error

std::string WRL1NODE::m_error
protectedinherited

Definition at line 234 of file vrml1_node.h.

Referenced by WRL1NODE::GetError().

◆ m_Items

◆ m_Name

std::string WRL1NODE::m_Name
protectedinherited

Definition at line 228 of file vrml1_node.h.

Referenced by WRL1NODE::GetName(), WRL1NODE::SetName(), and WRL1NODE::~WRL1NODE().

◆ m_Parent

◆ m_Refs

◆ m_sgNode

SGNODE* WRL1NODE::m_sgNode
protectedinherited

Definition at line 237 of file vrml1_node.h.

Referenced by WRL1NODE::WRL1NODE().

◆ m_Type


The documentation for this class was generated from the following files: