KiCad PCB EDA Suite
X3DTRANSFORM Class Reference

#include <x3d_transform.h>

Inheritance diagram for X3DTRANSFORM:
X3DNODE

Public Member Functions

 X3DTRANSFORM ()
 
 X3DTRANSFORM (X3DNODE *aParent)
 
virtual ~X3DTRANSFORM ()
 
bool Read (wxXmlNode *aNode, X3DNODE *aTopNode, X3D_DICT &aDict) override
 
bool SetParent (X3DNODE *aParent, bool doUnlink=true) override
 Set the parent X3DNODE of this object. More...
 
bool AddChildNode (X3DNODE *aNode) override
 
bool AddRefNode (X3DNODE *aNode) override
 
SGNODETranslateToSG (SGNODE *aParent) override
 Produce a representation of the data using the intermediate scenegraph structures of the kicad_3dsg library. More...
 
virtual void unlinkChildNode (const X3DNODE *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 X3DNODE *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 (X3DNODE *aNode)
 Add a pointer to a node which references, but does not own, this node. More...
 
void delNodeRef (X3DNODE *aNode)
 Remove a pointer to a node which references, but does not own, this node. More...
 
X3DNODES GetNodeType (void) const
 Return the type of this node instance. More...
 
X3DNODEGetParent (void) const
 Return a pointer to the parent node of this object or NULL if the object has no parent (ie. More...
 
wxString GetName (void) const
 Return the name of this object. More...
 
std::string GetError (void)
 

Protected Attributes

X3DNODEm_Parent
 
X3DNODES m_Type
 
X3D_DICTm_Dict
 
std::list< X3DNODE * > m_BackPointers
 
std::list< X3DNODE * > m_Children
 
std::list< X3DNODE * > m_Refs
 
std::string m_error
 
wxString m_Name
 
SGNODEm_sgNode
 

Private Member Functions

void init ()
 
void readFields (wxXmlNode *aNode)
 

Private Attributes

WRLVEC3F center
 
WRLVEC3F scale
 
WRLVEC3F translation
 
WRLROTATION rotation
 
WRLROTATION scaleOrientation
 
WRLVEC3F bboxCenter
 
WRLVEC3F bboxSize
 

Detailed Description

Definition at line 39 of file x3d_transform.h.

Constructor & Destructor Documentation

◆ X3DTRANSFORM() [1/2]

X3DTRANSFORM::X3DTRANSFORM ( )

Definition at line 35 of file x3d_transform.cpp.

35  : X3DNODE()
36 {
38  init();
39 }
X3DNODES m_Type
Definition: x3d_base.h:160
X3DNODE()
Definition: x3d_base.cpp:82

References init(), X3DNODE::m_Type, and X3D_TRANSFORM.

◆ X3DTRANSFORM() [2/2]

X3DTRANSFORM::X3DTRANSFORM ( X3DNODE aParent)

Definition at line 41 of file x3d_transform.cpp.

41  : X3DNODE()
42 {
44  init();
45 
46  if( nullptr != aParent )
47  {
48  X3DNODES ptype = aParent->GetNodeType();
49 
50  if( X3D_TRANSFORM == ptype || X3D_SWITCH == ptype )
51  m_Parent = aParent;
52  }
53 
54  if( nullptr != m_Parent )
55  m_Parent->AddChildNode( this );
56 }
X3DNODES m_Type
Definition: x3d_base.h:160
X3DNODE()
Definition: x3d_base.cpp:82
virtual bool AddChildNode(X3DNODE *aNode)=0
X3DNODES GetNodeType(void) const
Return the type of this node instance.
Definition: x3d_base.cpp:184
X3DNODE * m_Parent
Definition: x3d_base.h:159
X3DNODES
Definition: x3d_base.h:59

References X3DNODE::AddChildNode(), X3DNODE::GetNodeType(), init(), X3DNODE::m_Parent, X3DNODE::m_Type, X3D_SWITCH, and X3D_TRANSFORM.

◆ ~X3DTRANSFORM()

X3DTRANSFORM::~X3DTRANSFORM ( )
virtual

Definition at line 59 of file x3d_transform.cpp.

60 {
61  wxLogTrace( traceVrmlPlugin,
62  wxT( " * [INFO] Destroying Transform with %zu children, %zu references, "
63  "and %zu back pointers." ),
64  m_Children.size(), m_Refs.size(), m_BackPointers.size() );
65 }
std::list< X3DNODE * > m_BackPointers
Definition: x3d_base.h:163
std::list< X3DNODE * > m_Children
Definition: x3d_base.h:164
const wxChar *const traceVrmlPlugin
Flag to enable VRML plugin trace output.
Definition: vrml.cpp:63
std::list< X3DNODE * > m_Refs
Definition: x3d_base.h:165

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

Member Function Documentation

◆ AddChildNode()

bool X3DTRANSFORM::AddChildNode ( X3DNODE aNode)
overridevirtual

Implements X3DNODE.

Definition at line 200 of file x3d_transform.cpp.

201 {
202  if( nullptr == aNode )
203  return false;
204 
205  X3DNODES tchild = aNode->GetNodeType();
206 
207  if( X3D_SWITCH != tchild && X3D_TRANSFORM != tchild && X3D_SHAPE != tchild )
208  return false;
209 
210  std::list< X3DNODE* >::iterator sC = m_Children.begin();
211  std::list< X3DNODE* >::iterator eC = m_Children.end();
212 
213  while( sC != eC )
214  {
215  if( *sC == aNode )
216  return false;
217 
218  ++sC;
219  }
220 
221  m_Children.push_back( aNode );
222 
223  if( aNode->GetParent() != this )
224  aNode->SetParent( this );
225 
226  return true;
227 }
virtual bool SetParent(X3DNODE *aParent, bool doUnlink=true)=0
Set the parent X3DNODE of this object.
X3DNODE * GetParent(void) const
Return a pointer to the parent node of this object or NULL if the object has no parent (ie.
Definition: x3d_base.cpp:190
std::list< X3DNODE * > m_Children
Definition: x3d_base.h:164
X3DNODES GetNodeType(void) const
Return the type of this node instance.
Definition: x3d_base.cpp:184
X3DNODES
Definition: x3d_base.h:59

References X3DNODE::GetNodeType(), X3DNODE::GetParent(), X3DNODE::m_Children, X3DNODE::SetParent(), X3D_SHAPE, X3D_SWITCH, and X3D_TRANSFORM.

◆ addNodeRef()

void X3DNODE::addNodeRef ( X3DNODE 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 142 of file x3d_base.cpp.

143 {
144  // the parent node must never be added as a backpointer
145  if( aNode == m_Parent )
146  return;
147 
148  std::list< X3DNODE* >::iterator sR = m_BackPointers.begin();
149  std::list< X3DNODE* >::iterator eR = m_BackPointers.end();
150 
151  while( sR != eR )
152  {
153  if( *sR == aNode )
154  return;
155 
156  ++sR;
157  }
158 
159  m_BackPointers.push_back( aNode );
160 
161  return;
162 }
std::list< X3DNODE * > m_BackPointers
Definition: x3d_base.h:163
X3DNODE * m_Parent
Definition: x3d_base.h:159

References X3DNODE::m_BackPointers, and X3DNODE::m_Parent.

Referenced by X3DIFACESET::AddRefNode(), X3DSHAPE::AddRefNode(), and AddRefNode().

◆ AddRefNode()

bool X3DTRANSFORM::AddRefNode ( X3DNODE aNode)
overridevirtual

Implements X3DNODE.

Definition at line 230 of file x3d_transform.cpp.

231 {
232  if( nullptr == aNode )
233  return false;
234 
235  X3DNODES tchild = aNode->GetNodeType();
236 
237  if( X3D_SWITCH != tchild && X3D_TRANSFORM != tchild && X3D_SHAPE != tchild )
238  return false;
239 
240  std::list< X3DNODE* >::iterator sR = m_Refs.begin();
241  std::list< X3DNODE* >::iterator eR = m_Refs.end();
242 
243  while( sR != eR )
244  {
245  if( *sR == aNode )
246  return true;
247 
248  ++sR;
249  }
250 
251  m_Refs.push_back( aNode );
252  aNode->addNodeRef( this );
253 
254  return true;
255 }
void addNodeRef(X3DNODE *aNode)
Add a pointer to a node which references, but does not own, this node.
Definition: x3d_base.cpp:142
X3DNODES GetNodeType(void) const
Return the type of this node instance.
Definition: x3d_base.cpp:184
X3DNODES
Definition: x3d_base.h:59
std::list< X3DNODE * > m_Refs
Definition: x3d_base.h:165

References X3DNODE::addNodeRef(), X3DNODE::GetNodeType(), X3DNODE::m_Refs, X3D_SHAPE, X3D_SWITCH, and X3D_TRANSFORM.

◆ delNodeRef()

void X3DNODE::delNodeRef ( X3DNODE 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 165 of file x3d_base.cpp.

166 {
167  std::list< X3DNODE* >::iterator np =
168  std::find( m_BackPointers.begin(), m_BackPointers.end(), aNode );
169 
170  if( np != m_BackPointers.end() )
171  {
172  m_BackPointers.erase( np );
173  return;
174  }
175 
176  wxLogTrace( traceVrmlPlugin, wxT( "%s:%s:%d\n"
177  " * [BUG] delNodeRef() did not find its target." ),
178  __FILE__, __FUNCTION__, __LINE__ );
179 
180  return;
181 }
std::list< X3DNODE * > m_BackPointers
Definition: x3d_base.h:163
const wxChar *const traceVrmlPlugin
Flag to enable VRML plugin trace output.
Definition: vrml.cpp:63

References X3DNODE::m_BackPointers, and traceVrmlPlugin.

◆ GetError()

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

Definition at line 202 of file x3d_base.cpp.

203 {
204  return m_error;
205 }
std::string m_error
Definition: x3d_base.h:166

References X3DNODE::m_error.

◆ GetName()

wxString X3DNODE::GetName ( void  ) const
inherited

Return the name of this object.

Definition at line 196 of file x3d_base.cpp.

197 {
198  return m_Name;
199 }
wxString m_Name
Definition: x3d_base.h:168

References X3DNODE::m_Name.

◆ GetNodeType()

◆ GetParent()

X3DNODE * X3DNODE::GetParent ( void  ) const
inherited

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

top level transform).

Definition at line 190 of file x3d_base.cpp.

191 {
192  return m_Parent;
193 }
X3DNODE * m_Parent
Definition: x3d_base.h:159

References X3DNODE::m_Parent.

Referenced by X3DIFACESET::AddChildNode(), X3DSHAPE::AddChildNode(), and AddChildNode().

◆ init()

void X3DTRANSFORM::init ( )
private

Definition at line 68 of file x3d_transform.cpp.

69 {
70  center.x = 0.0;
71  center.y = 0.0;
72  center.z = 0.0;
73 
74  scale.x = 1.0;
75  scale.y = 1.0;
76  scale.z = 1.0;
77 
79 
80  rotation.x = 0.0;
81  rotation.y = 0.0;
82  rotation.z = 1.0;
83 
85 
87  bboxSize = center;
88 }
WRLVEC3F translation
Definition: x3d_transform.h:58
WRLVEC3F bboxSize
Definition: x3d_transform.h:62
WRLVEC3F scale
Definition: x3d_transform.h:57
WRLROTATION scaleOrientation
Definition: x3d_transform.h:60
WRLROTATION rotation
Definition: x3d_transform.h:59
WRLVEC3F bboxCenter
Definition: x3d_transform.h:61
WRLVEC3F center
Definition: x3d_transform.h:56

References bboxCenter, bboxSize, center, rotation, scale, scaleOrientation, and translation.

Referenced by X3DTRANSFORM().

◆ Read()

bool X3DTRANSFORM::Read ( wxXmlNode *  aNode,
X3DNODE aTopNode,
X3D_DICT aDict 
)
overridevirtual

Implements X3DNODE.

Definition at line 143 of file x3d_transform.cpp.

144 {
145  if( nullptr == aTopNode || nullptr == aNode )
146  return false;
147 
148  m_Dict = &aDict;
149  readFields( aNode );
150  bool ok = false;
151 
152  for( wxXmlNode* child = aNode->GetChildren(); child != nullptr; child = child->GetNext() )
153  {
154  wxString name = child->GetName();
155 
156  if( name == "Transform" || name == "Group" )
157  ok |= X3D::ReadTransform( child, this, aDict );
158  else if( name == "Switch" )
159  ok |= X3D::ReadSwitch( child, this, aDict );
160  else if( name == "Shape" )
161  ok |= X3D::ReadShape( child, this, aDict );
162 
163  }
164 
165  if( !ok )
166  return false;
167 
168  if( !SetParent( aTopNode ) )
169  return false;
170 
171  return true;
172 }
bool ReadTransform(wxXmlNode *aNode, X3DNODE *aParent, X3D_DICT &aDict)
Definition: x3d_ops.cpp:34
void readFields(wxXmlNode *aNode)
bool ReadShape(wxXmlNode *aNode, X3DNODE *aParent, X3D_DICT &aDict)
Definition: x3d_ops.cpp:79
const char * name
Definition: DXF_plotter.cpp:59
bool ReadSwitch(wxXmlNode *aNode, X3DNODE *aParent, X3D_DICT &aDict)
Definition: x3d_ops.cpp:72
bool SetParent(X3DNODE *aParent, bool doUnlink=true) override
Set the parent X3DNODE of this object.
X3D_DICT * m_Dict
Definition: x3d_base.h:161

References X3DNODE::m_Dict, name, readFields(), X3D::ReadShape(), X3D::ReadSwitch(), X3D::ReadTransform(), and SetParent().

◆ readFields()

void X3DTRANSFORM::readFields ( wxXmlNode *  aNode)
private

Definition at line 91 of file x3d_transform.cpp.

92 {
93  // DEF
94  // center
95  // scale
96  // translation
97  // rotation
98  // scaleOrientation
99  // bboxCenter (ignored)
100  // bboxSize (ignored)
101 
102  wxXmlAttribute* prop;
103 
104  // note: center/translation are multiplied by 2.54 to retain
105  // legacy behavior of 1 X3D unit = 0.1 inch; the SG*
106  // classes expect all units in mm.
107 
108  for( prop = aNode->GetAttributes(); prop != nullptr; prop = prop->GetNext() )
109  {
110  const wxString& pname = prop->GetName();
111 
112  if( pname == "DEF" )
113  {
114  m_Name = prop->GetValue();
115  m_Dict->AddName( m_Name, this );
116  }
117  else if( pname == "center" )
118  {
119  X3D::ParseSFVec3( prop->GetValue(), center );
120  center *= 2.54;
121  }
122  else if( pname == "scale" )
123  {
124  X3D::ParseSFVec3( prop->GetValue(), scale );
125  }
126  else if( pname == "translation" )
127  {
128  X3D::ParseSFVec3( prop->GetValue(), translation );
129  translation *= 2.54;
130  }
131  else if( pname == "rotation" )
132  {
133  X3D::ParseSFRotation( prop->GetValue(), rotation );
134  }
135  else if( pname == "scaleOrientation" )
136  {
137  X3D::ParseSFRotation( prop->GetValue(), scaleOrientation );
138  }
139  }
140 }
WRLVEC3F translation
Definition: x3d_transform.h:58
wxString m_Name
Definition: x3d_base.h:168
WRLVEC3F scale
Definition: x3d_transform.h:57
WRLROTATION scaleOrientation
Definition: x3d_transform.h:60
WRLROTATION rotation
Definition: x3d_transform.h:59
bool AddName(const wxString &aName, X3DNODE *aNode)
Definition: x3d_base.cpp:35
bool ParseSFRotation(const wxString &aSource, WRLROTATION &aResult)
Definition: x3d_ops.cpp:284
bool ParseSFVec3(const wxString &aSource, WRLVEC3F &aResult)
Definition: x3d_ops.cpp:264
X3D_DICT * m_Dict
Definition: x3d_base.h:161
WRLVEC3F center
Definition: x3d_transform.h:56

References X3D_DICT::AddName(), center, X3DNODE::m_Dict, X3DNODE::m_Name, X3D::ParseSFRotation(), X3D::ParseSFVec3(), rotation, scale, scaleOrientation, and translation.

Referenced by Read().

◆ SetParent()

bool X3DTRANSFORM::SetParent ( X3DNODE aParent,
bool  doUnlink = true 
)
overridevirtual

Set the parent X3DNODE 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 or false if the given node is not allowed to be a parent to the derived object.

Implements X3DNODE.

Definition at line 175 of file x3d_transform.cpp.

176 {
177  if( aParent == m_Parent )
178  return true;
179 
180  if( nullptr != aParent )
181  {
182  X3DNODES nt = aParent->GetNodeType();
183 
184  if( nt != X3D_SWITCH && nt != X3D_TRANSFORM )
185  return false;
186  }
187 
188  if( nullptr != m_Parent && doUnlink )
189  m_Parent->unlinkChildNode( this );
190 
191  m_Parent = aParent;
192 
193  if( nullptr != m_Parent )
194  m_Parent->AddChildNode( this );
195 
196  return true;
197 }
virtual bool AddChildNode(X3DNODE *aNode)=0
X3DNODES GetNodeType(void) const
Return the type of this node instance.
Definition: x3d_base.cpp:184
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...
Definition: x3d_base.cpp:102
X3DNODE * m_Parent
Definition: x3d_base.h:159
X3DNODES
Definition: x3d_base.h:59

References X3DNODE::AddChildNode(), X3DNODE::GetNodeType(), X3DNODE::m_Parent, X3DNODE::unlinkChildNode(), X3D_SWITCH, and X3D_TRANSFORM.

Referenced by Read().

◆ TranslateToSG()

SGNODE * X3DTRANSFORM::TranslateToSG ( SGNODE aParent)
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.

Implements X3DNODE.

Definition at line 258 of file x3d_transform.cpp.

259 {
260  wxLogTrace( traceVrmlPlugin,
261  wxT( " * [INFO] Translating Transform with %zu children, %zu references, "
262  "and %zu back pointers." ),
263  m_Children.size(), m_Refs.size(), m_BackPointers.size() );
264 
265  if( m_Children.empty() && m_Refs.empty() )
266  return nullptr;
267 
268  S3D::SGTYPES ptype = S3D::GetSGNodeType( aParent );
269 
270  wxCHECK_MSG( aParent && ( ptype == S3D::SGTYPE_TRANSFORM ), nullptr,
271  wxString::Format( wxT( "Transform does not have a Transform parent "
272  "(parent ID: %d)" ), ptype ) );
273 
274  if( m_sgNode )
275  {
276  if( nullptr != aParent )
277  {
278  if( nullptr == S3D::GetSGNodeParent( m_sgNode )
279  && !S3D::AddSGNodeChild( aParent, m_sgNode ) )
280  {
281  return nullptr;
282  }
283  else if( aParent != S3D::GetSGNodeParent( m_sgNode )
284  && !S3D::AddSGNodeRef( aParent, m_sgNode ) )
285  {
286  return nullptr;
287  }
288  }
289 
290  return m_sgNode;
291  }
292 
293  IFSG_TRANSFORM txNode( aParent );
294 
295  std::list< X3DNODE* >::iterator sC = m_Children.begin();
296  std::list< X3DNODE* >::iterator eC = m_Children.end();
297  X3DNODES type;
298 
299  // Include only the following in a Transform node:
300  // Shape
301  // Switch
302  // Transform
303  // Inline
304  bool test = false; // set to true if there are any subnodes for display
305 
306  for( int i = 0; i < 2; ++i )
307  {
308  while( sC != eC )
309  {
310  type = (*sC)->GetNodeType();
311 
312  switch( type )
313  {
314  case X3D_SHAPE:
315  case X3D_SWITCH:
316  case X3D_TRANSFORM:
317 
318  if( nullptr != (*sC)->TranslateToSG( txNode.GetRawPtr() ) )
319  test = true;
320 
321  break;
322 
323  default:
324  break;
325  }
326 
327  ++ sC;
328  }
329 
330  sC = m_Refs.begin();
331  eC = m_Refs.end();
332  }
333 
334  if( false == test )
335  {
336  txNode.Destroy();
337  return nullptr;
338  }
339 
340  txNode.SetScale( SGPOINT( scale.x, scale.y, scale.z ) );
341  txNode.SetCenter( SGPOINT( center.x, center.y, center.z ) );
342  txNode.SetTranslation( SGPOINT( translation.x, translation.y, translation.z ) );
343  txNode.SetScaleOrientation( SGVECTOR( scaleOrientation.x, scaleOrientation.y,
345  txNode.SetRotation( SGVECTOR( rotation.x, rotation.y, rotation.z ), rotation.w );
346 
347  m_sgNode = txNode.GetRawPtr();
348 
349  return m_sgNode;
350 }
WRLVEC3F translation
Definition: x3d_transform.h:58
std::list< X3DNODE * > m_BackPointers
Definition: x3d_base.h:163
SGLIB_API SGNODE * GetSGNodeParent(SGNODE *aNode)
Definition: ifsg_api.cpp:492
SGLIB_API bool AddSGNodeRef(SGNODE *aParent, SGNODE *aChild)
Definition: ifsg_api.cpp:501
std::list< X3DNODE * > m_Children
Definition: x3d_base.h:164
WRLVEC3F scale
Definition: x3d_transform.h:57
SGLIB_API bool AddSGNodeChild(SGNODE *aParent, SGNODE *aChild)
Definition: ifsg_api.cpp:510
const wxChar *const traceVrmlPlugin
Flag to enable VRML plugin trace output.
Definition: vrml.cpp:63
WRLROTATION scaleOrientation
Definition: x3d_transform.h:60
WRLROTATION rotation
Definition: x3d_transform.h:59
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
SGNODE * m_sgNode
Definition: x3d_base.h:169
SGLIB_API S3D::SGTYPES GetSGNodeType(SGNODE *aNode)
Definition: ifsg_api.cpp:483
IFSG_TRANSFORM is the wrapper for the VRML compatible TRANSFORM block class SCENEGRAPH.
X3DNODES
Definition: x3d_base.h:59
WRLVEC3F center
Definition: x3d_transform.h:56
std::list< X3DNODE * > m_Refs
Definition: x3d_base.h:165

References S3D::AddSGNodeChild(), S3D::AddSGNodeRef(), center, IFSG_NODE::Destroy(), Format(), IFSG_NODE::GetRawPtr(), S3D::GetSGNodeParent(), S3D::GetSGNodeType(), X3DNODE::m_BackPointers, X3DNODE::m_Children, X3DNODE::m_Refs, X3DNODE::m_sgNode, rotation, scale, scaleOrientation, IFSG_TRANSFORM::SetCenter(), IFSG_TRANSFORM::SetRotation(), IFSG_TRANSFORM::SetScale(), IFSG_TRANSFORM::SetScaleOrientation(), IFSG_TRANSFORM::SetTranslation(), S3D::SGTYPE_TRANSFORM, traceVrmlPlugin, translation, X3D_SHAPE, X3D_SWITCH, and X3D_TRANSFORM.

◆ unlinkChildNode()

void X3DNODE::unlinkChildNode ( const X3DNODE 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.

Reimplemented in X3DSHAPE.

Definition at line 102 of file x3d_base.cpp.

103 {
104  std::list< X3DNODE* >::iterator sL = m_Children.begin();
105  std::list< X3DNODE* >::iterator eL = m_Children.end();
106 
107  while( sL != eL )
108  {
109  if( *sL == aNode )
110  {
111  m_Children.erase( sL );
112  return;
113  }
114 
115  ++sL;
116  }
117 
118  return;
119 }
std::list< X3DNODE * > m_Children
Definition: x3d_base.h:164

References X3DNODE::m_Children.

Referenced by X3DIFACESET::SetParent(), X3DSHAPE::SetParent(), SetParent(), X3DCOORDS::SetParent(), X3DAPP::SetParent(), and X3DSHAPE::unlinkChildNode().

◆ unlinkRefNode()

void X3DNODE::unlinkRefNode ( const X3DNODE 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.

Reimplemented in X3DSHAPE.

Definition at line 122 of file x3d_base.cpp.

123 {
124  std::list< X3DNODE* >::iterator sL = m_Refs.begin();
125  std::list< X3DNODE* >::iterator eL = m_Refs.end();
126 
127  while( sL != eL )
128  {
129  if( *sL == aNode )
130  {
131  m_Refs.erase( sL );
132  return;
133  }
134 
135  ++sL;
136  }
137 
138  return;
139 }
std::list< X3DNODE * > m_Refs
Definition: x3d_base.h:165

References X3DNODE::m_Refs.

Referenced by X3DSHAPE::unlinkRefNode().

Member Data Documentation

◆ bboxCenter

WRLVEC3F X3DTRANSFORM::bboxCenter
private

Definition at line 61 of file x3d_transform.h.

Referenced by init().

◆ bboxSize

WRLVEC3F X3DTRANSFORM::bboxSize
private

Definition at line 62 of file x3d_transform.h.

Referenced by init().

◆ center

WRLVEC3F X3DTRANSFORM::center
private

Definition at line 56 of file x3d_transform.h.

Referenced by init(), readFields(), and TranslateToSG().

◆ m_BackPointers

◆ m_Children

◆ m_Dict

◆ m_error

std::string X3DNODE::m_error
protectedinherited

Definition at line 166 of file x3d_base.h.

Referenced by X3DNODE::GetError().

◆ m_Name

wxString X3DNODE::m_Name
protectedinherited

◆ m_Parent

◆ m_Refs

◆ m_sgNode

SGNODE* X3DNODE::m_sgNode
protectedinherited

◆ m_Type

◆ rotation

WRLROTATION X3DTRANSFORM::rotation
private

Definition at line 59 of file x3d_transform.h.

Referenced by init(), readFields(), and TranslateToSG().

◆ scale

WRLVEC3F X3DTRANSFORM::scale
private

Definition at line 57 of file x3d_transform.h.

Referenced by init(), readFields(), and TranslateToSG().

◆ scaleOrientation

WRLROTATION X3DTRANSFORM::scaleOrientation
private

Definition at line 60 of file x3d_transform.h.

Referenced by init(), readFields(), and TranslateToSG().

◆ translation

WRLVEC3F X3DTRANSFORM::translation
private

Definition at line 58 of file x3d_transform.h.

Referenced by init(), readFields(), and TranslateToSG().


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