MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / addTo

Method addTo

Engine/modules/Verve/Core/VTreeNode.cpp:288–324  ·  view source on GitHub ↗

----------------------------------------------------------------------------- VTreeNode::addTo( pNode ); Attach this node to the back of the target node. -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

286//
287//-----------------------------------------------------------------------------
288void VTreeNode::addTo( ITreeNode *pNode )
289{
290 if ( inTree() )
291 {
292 // Already In Tree.
293 return;
294 }
295
296 // Set Parent.
297 mParentNode = pNode;
298
299 if ( !pNode->mChildNode )
300 {
301 // Store Child Node.
302 pNode->mChildNode = this;
303 }
304 else
305 {
306 // Front Node.
307 ITreeNode *headNode = pNode->mChildNode;
308
309 // Fetch Head Node.
310 while ( headNode->mSiblingNextNode )
311 {
312 headNode = headNode->mSiblingNextNode;
313 }
314
315 // Reference Next Node.
316 headNode->mSiblingNextNode = this;
317
318 // Reference Previous Node.
319 mSiblingPrevNode = headNode;
320 }
321
322 // Callback.
323 onAttach();
324}
325
326//-----------------------------------------------------------------------------
327//

Callers 3

VController.cppFile · 0.45
VObject.cppFile · 0.45
readObjectsFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected