KiCad PCB EDA Suite
Loading...
Searching...
No Matches
WRL1BASE Class Reference

Represent the top node of a VRML1 model. More...

#include <vrml1_base.h>

Inheritance diagram for WRL1BASE:
WRL1NODE

Public Member Functions

 WRL1BASE ()
 
virtual ~WRL1BASE ()
 
bool Read (WRLPROC &proc)
 
bool ReadNode (WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
 
virtual std::string GetName (void) override
 
virtual bool SetName (const std::string &aName) override
 
bool Read (WRLPROC &proc, WRL1BASE *aTopNode) override
 
bool SetParent (WRL1NODE *aParent, bool doUnlink=true) override
 Set the parent WRL1NODE of this object. More...
 
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...
 
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
 

Private Member Functions

bool implementUse (WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
 
bool implementDef (WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
 
bool readGroup (WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
 
bool readSeparator (WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
 
bool readSwitch (WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
 
bool readMaterial (WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
 
bool readMatBinding (WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
 
bool readCoords (WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
 
bool readFaceSet (WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
 
bool readTransform (WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
 
bool readShapeHints (WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
 
void addItem (WRL1NODE *aNode)
 
void delItem (const WRL1NODE *aNode)
 

Detailed Description

Represent the top node of a VRML1 model.

Definition at line 45 of file vrml1_base.h.

Constructor & Destructor Documentation

◆ WRL1BASE()

WRL1BASE::WRL1BASE ( )

Definition at line 42 of file vrml1_base.cpp.

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

◆ ~WRL1BASE()

WRL1BASE::~WRL1BASE ( )
virtual

Definition at line 50 of file vrml1_base.cpp.

References WRL1NODE::cancelDict(), and traceVrmlPlugin.

Member Function Documentation

◆ AddChildNode()

◆ addItem()

void WRL1NODE::addItem ( WRL1NODE aNode)
privateinherited

Definition at line 458 of file vrml1_node.cpp.

References WRL1NODE::m_Items.

Referenced by WRL1NODE::AddChildNode(), and WRL1NODE::AddRefNode().

◆ 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.

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

Referenced by WRL1NODE::AddRefNode().

◆ AddRefNode()

bool WRL1NODE::AddRefNode ( WRL1NODE aNode)
virtualinherited

◆ cancelDict()

void WRL1NODE::cancelDict ( void  )
inherited

Definition at line 198 of file vrml1_node.cpp.

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

Referenced by ~WRL1BASE().

◆ delItem()

void WRL1NODE::delItem ( const WRL1NODE aNode)
privateinherited

Definition at line 464 of file vrml1_node.cpp.

References WRL1NODE::m_Items.

Referenced by WRL1NODE::unlinkChildNode(), and WRL1NODE::unlinkRefNode().

◆ 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.

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.

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

Referenced by implementUse().

◆ GetError()

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

Definition at line 344 of file vrml1_node.cpp.

References WRL1NODE::m_error.

◆ GetName()

std::string WRL1BASE::GetName ( void  )
overridevirtual

Reimplemented from WRL1NODE.

Definition at line 64 of file vrml1_base.cpp.

◆ GetNItems()

size_t WRL1NODE::GetNItems ( void  ) const
inherited

Definition at line 338 of file vrml1_node.cpp.

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.

References WRL1NODE::m_Type.

Referenced by WRL1NODE::AddChildNode(), WRL1NODE::AddRefNode(), implementUse(), WRL1GROUP::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.

References nodenames.

Referenced by ReadNode().

◆ GetNodeTypeName()

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

Definition at line 312 of file vrml1_node.cpp.

References nodenames.

Referenced by 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.

References WRL1NODE::m_Parent.

Referenced by WRL1NODE::AddChildNode().

◆ implementDef()

bool WRL1BASE::implementDef ( WRLPROC proc,
WRL1NODE aParent,
WRL1NODE **  aNode 
)
private

◆ implementUse()

bool WRL1BASE::implementUse ( WRLPROC proc,
WRL1NODE aParent,
WRL1NODE **  aNode 
)
private

◆ Read() [1/2]

bool WRL1BASE::Read ( WRLPROC proc)

◆ Read() [2/2]

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

Implements WRL1NODE.

Definition at line 346 of file vrml1_base.cpp.

◆ readCoords()

bool WRL1BASE::readCoords ( WRLPROC proc,
WRL1NODE aParent,
WRL1NODE **  aNode 
)
private

Definition at line 449 of file vrml1_base.cpp.

References WRL1NODE::m_dictionary, and WRL1COORDS::Read().

Referenced by ReadNode().

◆ readFaceSet()

bool WRL1BASE::readFaceSet ( WRLPROC proc,
WRL1NODE aParent,
WRL1NODE **  aNode 
)
private

Definition at line 469 of file vrml1_base.cpp.

References WRL1NODE::m_dictionary, and WRL1FACESET::Read().

Referenced by ReadNode().

◆ readGroup()

bool WRL1BASE::readGroup ( WRLPROC proc,
WRL1NODE aParent,
WRL1NODE **  aNode 
)
private

Definition at line 352 of file vrml1_base.cpp.

References WRL1NODE::m_dictionary, and WRL1GROUP::Read().

Referenced by ReadNode().

◆ readMatBinding()

bool WRL1BASE::readMatBinding ( WRLPROC proc,
WRL1NODE aParent,
WRL1NODE **  aNode 
)
private

Definition at line 429 of file vrml1_base.cpp.

References WRL1NODE::m_dictionary, and WRL1MATBINDING::Read().

Referenced by ReadNode().

◆ readMaterial()

bool WRL1BASE::readMaterial ( WRLPROC proc,
WRL1NODE aParent,
WRL1NODE **  aNode 
)
private

Definition at line 409 of file vrml1_base.cpp.

References WRL1NODE::m_dictionary, and WRL1MATERIAL::Read().

Referenced by ReadNode().

◆ ReadNode()

◆ readSeparator()

bool WRL1BASE::readSeparator ( WRLPROC proc,
WRL1NODE aParent,
WRL1NODE **  aNode 
)
private

Definition at line 372 of file vrml1_base.cpp.

References WRL1NODE::m_dictionary, and WRL1SEPARATOR::Read().

Referenced by ReadNode().

◆ readShapeHints()

bool WRL1BASE::readShapeHints ( WRLPROC proc,
WRL1NODE aParent,
WRL1NODE **  aNode 
)
private

Definition at line 509 of file vrml1_base.cpp.

References WRL1NODE::m_dictionary, and WRL1SHAPEHINTS::Read().

Referenced by ReadNode().

◆ readSwitch()

bool WRL1BASE::readSwitch ( WRLPROC proc,
WRL1NODE aParent,
WRL1NODE **  aNode 
)
private

Definition at line 392 of file vrml1_base.cpp.

References WRL1NODE::m_dictionary, and WRL1SWITCH::Read().

Referenced by ReadNode().

◆ readTransform()

bool WRL1BASE::readTransform ( WRLPROC proc,
WRL1NODE aParent,
WRL1NODE **  aNode 
)
private

Definition at line 489 of file vrml1_base.cpp.

References WRL1NODE::m_dictionary, and WRL1TRANSFORM::Read().

Referenced by ReadNode().

◆ SetName()

bool WRL1BASE::SetName ( const std::string &  aName)
overridevirtual

Reimplemented from WRL1NODE.

Definition at line 71 of file vrml1_base.cpp.

◆ SetParent()

bool WRL1BASE::SetParent ( WRL1NODE aParent,
bool  doUnlink = true 
)
overridevirtual

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 from WRL1NODE.

Definition at line 58 of file vrml1_base.cpp.

◆ TranslateToSG()

SGNODE * WRL1BASE::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.

Implements WRL1NODE.

Definition at line 529 of file vrml1_base.cpp.

References IFSG_NODE::Destroy(), IFSG_NODE::GetRawPtr(), WRL1STATUS::Init(), WRL1NODE::m_current, WRL1NODE::m_Items, and traceVrmlPlugin.

Referenced by LoadVRML().

◆ 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.

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.

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: