KiCad PCB EDA Suite
Loading...
Searching...
No Matches
WRL2NODE Class Referenceabstract

#include <vrml2_node.h>

Inheritance diagram for WRL2NODE:
WRL2APPEARANCE WRL2BASE WRL2BOX WRL2COLOR WRL2COORDS WRL2FACESET WRL2INLINE WRL2LINESET WRL2MATERIAL WRL2NORMS WRL2POINTSET WRL2SHAPE WRL2SWITCH WRL2TRANSFORM

Public Member Functions

 WRL2NODE ()
 
virtual ~WRL2NODE ()
 
virtual bool Read (WRLPROC &proc, WRL2BASE *aTopNode)=0
 
WRL2NODES GetNodeType (void) const
 
WRL2NODEGetParent (void) const
 
virtual bool SetParent (WRL2NODE *aParent, bool doUnlink=true)
 Set the parent WRL2NODE of this object.
 
virtual std::string GetName (void)
 
virtual bool SetName (const std::string &aName)
 
const char * GetNodeTypeName (WRL2NODES aNodeType) const
 
virtual WRL2NODEFindNode (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 AddChildNode (WRL2NODE *aNode)
 
virtual bool AddRefNode (WRL2NODE *aNode)
 
std::string GetError (void)
 
virtual SGNODETranslateToSG (SGNODE *aParent)=0
 Produce a representation of the data using the intermediate scenegraph structures of the kicad_3dsg library.
 
WRL2NODES getNodeTypeID (const std::string &aNodeName)
 
virtual void unlinkChildNode (const WRL2NODE *aNode)
 Remove references to an owned child.
 
virtual void unlinkRefNode (const WRL2NODE *aNode)
 Remove pointers to a referenced node.
 
void addNodeRef (WRL2NODE *aNode)
 Add a pointer to a node which references but does not own this node.
 
void delNodeRef (WRL2NODE *aNode)
 Remove a pointer to a node which references but does not own this node.
 
virtual bool isDangling (void)=0
 Determine whether an object should be moved to a different parent during the VRML to SG* translation.
 

Protected Attributes

WRL2NODEm_Parent
 
WRL2NODES m_Type
 
std::string m_Name
 
std::list< WRL2NODE * > m_BackPointers
 
std::list< WRL2NODE * > m_Children
 
std::list< WRL2NODE * > m_Refs
 
std::string m_error
 
SGNODEm_sgNode
 

Detailed Description

Definition at line 55 of file vrml2_node.h.

Constructor & Destructor Documentation

◆ WRL2NODE()

WRL2NODE::WRL2NODE ( )

Definition at line 46 of file vrml2_node.cpp.

References badNames, m_Parent, m_sgNode, m_Type, and nodenames.

◆ ~WRL2NODE()

WRL2NODE::~WRL2NODE ( )
virtual

Definition at line 133 of file vrml2_node.cpp.

References m_BackPointers, m_Children, m_Parent, m_Refs, and unlinkChildNode().

Member Function Documentation

◆ AddChildNode()

◆ addNodeRef()

void WRL2NODE::addNodeRef ( WRL2NODE aNode)

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 171 of file vrml2_node.cpp.

References m_BackPointers, and m_Parent.

Referenced by AddRefNode().

◆ AddRefNode()

◆ delNodeRef()

void WRL2NODE::delNodeRef ( WRL2NODE aNode)

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 187 of file vrml2_node.cpp.

References m_BackPointers, and traceVrmlPlugin.

◆ FindNode()

WRL2NODE * WRL2NODE::FindNode ( const std::string &  aNodeName,
const WRL2NODE aCaller 
)
virtual

Search the tree of linked nodes and returns a reference to the first node found 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.
aCalleris a pointer to the node invoking this function.
Returns
is a valid node pointer on success or NULL.

Definition at line 305 of file vrml2_node.cpp.

References FindNode(), m_Children, m_Name, and m_Parent.

Referenced by FindNode(), and WRL2BASE::implementUse().

◆ GetError()

std::string WRL2NODE::GetError ( void  )

Definition at line 299 of file vrml2_node.cpp.

References m_error.

◆ GetName()

std::string WRL2NODE::GetName ( void  )
virtual

Reimplemented in WRL2BASE.

Definition at line 216 of file vrml2_node.cpp.

References m_Name.

◆ GetNodeType()

◆ getNodeTypeID()

WRL2NODES WRL2NODE::getNodeTypeID ( const std::string &  aNodeName)
Returns
The ID based on the given aNodeName or WRL2_INVALID (WRL2_END) if no such node name exists.

Definition at line 288 of file vrml2_node.cpp.

References nodenames.

Referenced by WRL2BASE::ReadNode().

◆ GetNodeTypeName()

◆ GetParent()

WRL2NODE * WRL2NODE::GetParent ( void  ) const

◆ isDangling()

virtual bool WRL2NODE::isDangling ( void  )
pure virtual

Determine whether an object should be moved to a different parent during the VRML to SG* translation.

Returns
true if the object does not have a parent which is a logical container for the object for example if a Shape has a parent which is a Base node.

Implemented in WRL2APPEARANCE, WRL2BASE, WRL2BOX, WRL2COLOR, WRL2COORDS, WRL2FACESET, WRL2INLINE, WRL2LINESET, WRL2MATERIAL, WRL2NORMS, WRL2POINTSET, WRL2SHAPE, WRL2SWITCH, and WRL2TRANSFORM.

Referenced by WRL2SWITCH::AddRefNode(), and WRL2TRANSFORM::AddRefNode().

◆ Read()

virtual bool WRL2NODE::Read ( WRLPROC proc,
WRL2BASE aTopNode 
)
pure virtual

◆ SetName()

bool WRL2NODE::SetName ( const std::string &  aName)
virtual

Reimplemented in WRL2BASE.

Definition at line 222 of file vrml2_node.cpp.

References BAD_CHARS1, BAD_CHARS2, badNames, m_Name, and traceVrmlPlugin.

Referenced by WRL2BASE::implementDef().

◆ SetParent()

bool WRL2NODE::SetParent ( WRL2NODE aParent,
bool  doUnlink = true 
)
virtual

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

Reimplemented in WRL2BASE.

Definition at line 339 of file vrml2_node.cpp.

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

Referenced by AddChildNode(), WRL2SWITCH::AddRefNode(), and WRL2TRANSFORM::AddRefNode().

◆ TranslateToSG()

virtual SGNODE * WRL2NODE::TranslateToSG ( SGNODE aParent)
pure virtual

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.

Implemented in WRL2APPEARANCE, WRL2BASE, WRL2BOX, WRL2COLOR, WRL2COORDS, WRL2FACESET, WRL2INLINE, WRL2LINESET, WRL2MATERIAL, WRL2NORMS, WRL2POINTSET, WRL2SHAPE, WRL2SWITCH, and WRL2TRANSFORM.

Referenced by WRL2APPEARANCE::TranslateToSG(), and WRL2SHAPE::TranslateToSG().

◆ unlinkChildNode()

void WRL2NODE::unlinkChildNode ( const WRL2NODE aNode)
virtual

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 WRL2APPEARANCE, WRL2FACESET, WRL2LINESET, WRL2POINTSET, and WRL2SHAPE.

Definition at line 407 of file vrml2_node.cpp.

References m_Children.

Referenced by SetParent(), WRL2APPEARANCE::unlinkChildNode(), WRL2FACESET::unlinkChildNode(), WRL2LINESET::unlinkChildNode(), WRL2POINTSET::unlinkChildNode(), WRL2SHAPE::unlinkChildNode(), and ~WRL2NODE().

◆ unlinkRefNode()

void WRL2NODE::unlinkRefNode ( const WRL2NODE aNode)
virtual

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 WRL2APPEARANCE, WRL2FACESET, WRL2LINESET, WRL2POINTSET, and WRL2SHAPE.

Definition at line 425 of file vrml2_node.cpp.

References m_Refs.

Referenced by WRL2APPEARANCE::unlinkRefNode(), WRL2FACESET::unlinkRefNode(), WRL2LINESET::unlinkRefNode(), WRL2POINTSET::unlinkRefNode(), and WRL2SHAPE::unlinkRefNode().

Member Data Documentation

◆ m_BackPointers

◆ m_Children

◆ m_error

std::string WRL2NODE::m_error
protected

Definition at line 176 of file vrml2_node.h.

Referenced by GetError().

◆ m_Name

std::string WRL2NODE::m_Name
protected

Definition at line 171 of file vrml2_node.h.

Referenced by FindNode(), GetName(), and SetName().

◆ m_Parent

◆ m_Refs

◆ m_sgNode

◆ m_Type


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