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

The top node of a VRML2 model. More...

#include <vrml2_base.h>

Inheritance diagram for WRL2BASE:
WRL2NODE

Public Member Functions

 WRL2BASE ()
 
virtual ~WRL2BASE ()
 
void SetEnableInline (bool enable)
 
bool GetEnableInline (void)
 
SGNODEGetInlineData (const std::string &aName)
 
bool Read (WRLPROC &proc)
 
bool ReadNode (WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
 
virtual std::string GetName (void) override
 
virtual bool SetName (const std::string &aName) override
 
bool Read (WRLPROC &proc, WRL2BASE *aTopNode) override
 
bool SetParent (WRL2NODE *aParent, bool doUnlink=true) override
 Set the parent WRL2NODE of this object.
 
SGNODETranslateToSG (SGNODE *aParent) override
 Produce a representation of the data using the intermediate scenegraph structures of the kicad_3dsg library.
 
bool isDangling (void) override
 Determine whether an object should be moved to a different parent during the VRML to SG* translation.
 
WRL2NODES GetNodeType (void) const
 
WRL2NODEGetParent (void) const
 
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)
 
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.
 

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
 

Private Member Functions

bool implementUse (WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
 
bool implementDef (WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
 
bool readTransform (WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
 
bool readShape (WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
 
bool readAppearance (WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
 
bool readMaterial (WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
 
bool readFaceSet (WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
 
bool readLineSet (WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
 
bool readPointSet (WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
 
bool readCoords (WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
 
bool readNorms (WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
 
bool readColor (WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
 
bool readBox (WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
 
bool readSwitch (WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
 
bool readInline (WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
 

Private Attributes

bool m_useInline
 
std::string m_dir
 
std::map< std::string, SGNODE * > m_inlineModels
 

Detailed Description

The top node of a VRML2 model.

Definition at line 59 of file vrml2_base.h.

Constructor & Destructor Documentation

◆ WRL2BASE()

WRL2BASE::WRL2BASE ( )

Definition at line 53 of file vrml2_base.cpp.

References WRL2NODE::m_Type, and m_useInline.

◆ ~WRL2BASE()

WRL2BASE::~WRL2BASE ( )
virtual

Definition at line 60 of file vrml2_base.cpp.

References S3D::DestroyNode(), S3D::GetSGNodeParent(), and m_inlineModels.

Member Function Documentation

◆ AddChildNode()

◆ addNodeRef()

void WRL2NODE::addNodeRef ( WRL2NODE 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 171 of file vrml2_node.cpp.

References WRL2NODE::m_BackPointers, and WRL2NODE::m_Parent.

Referenced by WRL2NODE::AddRefNode().

◆ AddRefNode()

◆ delNodeRef()

void WRL2NODE::delNodeRef ( WRL2NODE 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 187 of file vrml2_node.cpp.

References WRL2NODE::m_BackPointers, and traceVrmlPlugin.

◆ FindNode()

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

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 WRL2NODE::FindNode(), WRL2NODE::m_Children, WRL2NODE::m_Name, and WRL2NODE::m_Parent.

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

◆ GetEnableInline()

bool WRL2BASE::GetEnableInline ( void  )

Definition at line 92 of file vrml2_base.cpp.

References m_useInline.

◆ GetError()

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

Definition at line 299 of file vrml2_node.cpp.

References WRL2NODE::m_error.

◆ GetInlineData()

SGNODE * WRL2BASE::GetInlineData ( const std::string &  aName)

Definition at line 98 of file vrml2_base.cpp.

References FN_NORMALIZE_FLAGS, LoadVRML(), m_dir, and m_inlineModels.

Referenced by WRL2INLINE::TranslateToSG().

◆ GetName()

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

Reimplemented from WRL2NODE.

Definition at line 152 of file vrml2_base.cpp.

◆ GetNodeType()

◆ getNodeTypeID()

WRL2NODES WRL2NODE::getNodeTypeID ( const std::string &  aNodeName)
inherited
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 ReadNode().

◆ GetNodeTypeName()

◆ GetParent()

WRL2NODE * WRL2NODE::GetParent ( void  ) const
inherited

◆ implementDef()

bool WRL2BASE::implementDef ( WRLPROC proc,
WRL2NODE aParent,
WRL2NODE **  aNode 
)
private

◆ implementUse()

bool WRL2BASE::implementUse ( WRLPROC proc,
WRL2NODE aParent,
WRL2NODE **  aNode 
)
private

◆ isDangling()

bool WRL2BASE::isDangling ( void  )
overridevirtual

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.

Implements WRL2NODE.

Definition at line 181 of file vrml2_base.cpp.

◆ Read() [1/2]

bool WRL2BASE::Read ( WRLPROC proc)

Definition at line 164 of file vrml2_base.cpp.

References WRLPROC::eof(), WRLPROC::GetParentDir(), WRLPROC::GetVRMLType(), m_dir, and ReadNode().

Referenced by LoadVRML().

◆ Read() [2/2]

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

Implements WRL2NODE.

Definition at line 633 of file vrml2_base.cpp.

◆ readAppearance()

bool WRL2BASE::readAppearance ( WRLPROC proc,
WRL2NODE aParent,
WRL2NODE **  aNode 
)
private

Definition at line 679 of file vrml2_base.cpp.

References WRL2APPEARANCE::Read().

Referenced by ReadNode().

◆ readBox()

bool WRL2BASE::readBox ( WRLPROC proc,
WRL2NODE aParent,
WRL2NODE **  aNode 
)
private

Definition at line 839 of file vrml2_base.cpp.

References WRL2BOX::Read().

Referenced by ReadNode().

◆ readColor()

bool WRL2BASE::readColor ( WRLPROC proc,
WRL2NODE aParent,
WRL2NODE **  aNode 
)
private

Definition at line 819 of file vrml2_base.cpp.

References WRL2COLOR::Read().

Referenced by ReadNode().

◆ readCoords()

bool WRL2BASE::readCoords ( WRLPROC proc,
WRL2NODE aParent,
WRL2NODE **  aNode 
)
private

Definition at line 779 of file vrml2_base.cpp.

References WRL2COORDS::Read().

Referenced by ReadNode().

◆ readFaceSet()

bool WRL2BASE::readFaceSet ( WRLPROC proc,
WRL2NODE aParent,
WRL2NODE **  aNode 
)
private

Definition at line 719 of file vrml2_base.cpp.

References WRL2FACESET::Read().

Referenced by ReadNode().

◆ readInline()

bool WRL2BASE::readInline ( WRLPROC proc,
WRL2NODE aParent,
WRL2NODE **  aNode 
)
private

◆ readLineSet()

bool WRL2BASE::readLineSet ( WRLPROC proc,
WRL2NODE aParent,
WRL2NODE **  aNode 
)
private

Definition at line 739 of file vrml2_base.cpp.

References WRL2LINESET::Read().

Referenced by ReadNode().

◆ readMaterial()

bool WRL2BASE::readMaterial ( WRLPROC proc,
WRL2NODE aParent,
WRL2NODE **  aNode 
)
private

Definition at line 699 of file vrml2_base.cpp.

References WRL2MATERIAL::Read().

Referenced by ReadNode().

◆ ReadNode()

◆ readNorms()

bool WRL2BASE::readNorms ( WRLPROC proc,
WRL2NODE aParent,
WRL2NODE **  aNode 
)
private

Definition at line 799 of file vrml2_base.cpp.

References WRL2NORMS::Read().

Referenced by ReadNode().

◆ readPointSet()

bool WRL2BASE::readPointSet ( WRLPROC proc,
WRL2NODE aParent,
WRL2NODE **  aNode 
)
private

Definition at line 759 of file vrml2_base.cpp.

References WRL2POINTSET::Read().

Referenced by ReadNode().

◆ readShape()

bool WRL2BASE::readShape ( WRLPROC proc,
WRL2NODE aParent,
WRL2NODE **  aNode 
)
private

Definition at line 659 of file vrml2_base.cpp.

References WRL2SHAPE::Read().

Referenced by ReadNode().

◆ readSwitch()

bool WRL2BASE::readSwitch ( WRLPROC proc,
WRL2NODE aParent,
WRL2NODE **  aNode 
)
private

Definition at line 859 of file vrml2_base.cpp.

References WRL2SWITCH::Read().

Referenced by ReadNode().

◆ readTransform()

bool WRL2BASE::readTransform ( WRLPROC proc,
WRL2NODE aParent,
WRL2NODE **  aNode 
)
private

Definition at line 639 of file vrml2_base.cpp.

References WRL2TRANSFORM::Read().

Referenced by ReadNode().

◆ SetEnableInline()

void WRL2BASE::SetEnableInline ( bool  enable)

Definition at line 86 of file vrml2_base.cpp.

References m_useInline.

Referenced by LoadVRML().

◆ SetName()

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

Reimplemented from WRL2NODE.

Definition at line 158 of file vrml2_base.cpp.

◆ SetParent()

bool WRL2BASE::SetParent ( WRL2NODE aParent,
bool  doUnlink = true 
)
overridevirtual

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

Definition at line 80 of file vrml2_base.cpp.

◆ TranslateToSG()

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

Definition at line 912 of file vrml2_base.cpp.

References S3D::AddSGNodeChild(), S3D::AddSGNodeRef(), IFSG_NODE::Destroy(), IFSG_NODE::GetRawPtr(), S3D::GetSGNodeParent(), WRL2NODE::m_Children, and WRL2NODE::m_sgNode.

Referenced by LoadVRML().

◆ unlinkChildNode()

void WRL2NODE::unlinkChildNode ( const WRL2NODE 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 WRL2APPEARANCE, WRL2FACESET, WRL2LINESET, WRL2POINTSET, and WRL2SHAPE.

Definition at line 407 of file vrml2_node.cpp.

References WRL2NODE::m_Children.

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

◆ unlinkRefNode()

void WRL2NODE::unlinkRefNode ( const WRL2NODE 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 WRL2APPEARANCE, WRL2FACESET, WRL2LINESET, WRL2POINTSET, and WRL2SHAPE.

Definition at line 425 of file vrml2_node.cpp.

References WRL2NODE::m_Refs.

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

Member Data Documentation

◆ m_BackPointers

◆ m_Children

◆ m_dir

std::string WRL2BASE::m_dir
private

Definition at line 107 of file vrml2_base.h.

Referenced by GetInlineData(), and Read().

◆ m_error

std::string WRL2NODE::m_error
protectedinherited

Definition at line 176 of file vrml2_node.h.

Referenced by WRL2NODE::GetError().

◆ m_inlineModels

std::map< std::string, SGNODE* > WRL2BASE::m_inlineModels
private

Definition at line 108 of file vrml2_base.h.

Referenced by GetInlineData(), and ~WRL2BASE().

◆ m_Name

std::string WRL2NODE::m_Name
protectedinherited

Definition at line 171 of file vrml2_node.h.

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

◆ m_Parent

◆ m_Refs

◆ m_sgNode

◆ m_Type

◆ m_useInline

bool WRL2BASE::m_useInline
private

Definition at line 106 of file vrml2_base.h.

Referenced by GetEnableInline(), readInline(), SetEnableInline(), and WRL2BASE().


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