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

#include <vrml2_faceset.h>

Inheritance diagram for WRL2FACESET:
WRL2NODE

Public Member Functions

 WRL2FACESET ()
 
 WRL2FACESET (WRL2NODE *aParent)
 
virtual ~WRL2FACESET ()
 
bool Read (WRLPROC &proc, WRL2BASE *aTopNode) override
 
bool AddRefNode (WRL2NODE *aNode) override
 
bool AddChildNode (WRL2NODE *aNode) override
 
SGNODETranslateToSG (SGNODE *aParent) override
 Produce a representation of the data using the intermediate scenegraph structures of the kicad_3dsg library.
 
bool HasColors (void)
 
bool isDangling (void) override
 Determine whether an object should be moved to a different parent during the VRML to SG* translation.
 
void unlinkChildNode (const WRL2NODE *aNode) override
 Remove references to an owned child.
 
void unlinkRefNode (const WRL2NODE *aNode) override
 Remove pointers to a referenced node.
 
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.
 
std::string GetError (void)
 
WRL2NODES getNodeTypeID (const std::string &aNodeName)
 
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 checkNodeType (WRL2NODES aType)
 
void setDefaults (void)
 

Private Attributes

WRL2NODEcolor
 
WRL2NODEcoord
 
WRL2NODEnormal
 
WRL2NODEtexCoord
 
bool ccw
 
bool colorPerVertex
 
bool convex
 
bool normalPerVertex
 
bool solid
 
std::vector< int > colorIndex
 
std::vector< int > coordIndex
 
std::vector< int > normalIndex
 
float creaseAngle
 
float creaseLimit
 

Detailed Description

Definition at line 40 of file vrml2_faceset.h.

Constructor & Destructor Documentation

◆ WRL2FACESET() [1/2]

WRL2FACESET::WRL2FACESET ( )

Definition at line 38 of file vrml2_faceset.cpp.

References WRL2NODE::m_Type, and setDefaults().

◆ WRL2FACESET() [2/2]

WRL2FACESET::WRL2FACESET ( WRL2NODE aParent)

◆ ~WRL2FACESET()

WRL2FACESET::~WRL2FACESET ( )
virtual

Member Function Documentation

◆ AddChildNode()

bool WRL2FACESET::AddChildNode ( WRL2NODE aNode)
overridevirtual

◆ 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()

bool WRL2FACESET::AddRefNode ( WRL2NODE aNode)
overridevirtual

◆ checkNodeType()

bool WRL2FACESET::checkNodeType ( WRL2NODES  aType)
private
Returns
true if the node type is a valid subnode of FaceSet.

Definition at line 83 of file vrml2_faceset.cpp.

Referenced by AddChildNode(), and 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 WRL2BASE::implementUse().

◆ GetError()

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

Definition at line 299 of file vrml2_node.cpp.

References WRL2NODE::m_error.

◆ GetName()

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

Reimplemented in WRL2BASE.

Definition at line 216 of file vrml2_node.cpp.

References WRL2NODE::m_Name.

◆ 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 WRL2BASE::ReadNode().

◆ GetNodeTypeName()

◆ GetParent()

WRL2NODE * WRL2NODE::GetParent ( void  ) const
inherited

◆ HasColors()

bool WRL2FACESET::HasColors ( void  )
Returns
true if the face set has a color node.

Definition at line 766 of file vrml2_faceset.cpp.

References color.

◆ isDangling()

bool WRL2FACESET::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 108 of file vrml2_faceset.cpp.

References WRL2NODE::GetNodeType(), and WRL2NODE::m_Parent.

◆ Read()

◆ setDefaults()

void WRL2FACESET::setDefaults ( void  )
private

Definition at line 65 of file vrml2_faceset.cpp.

References ccw, color, colorPerVertex, convex, coord, creaseAngle, creaseLimit, normal, normalPerVertex, solid, and texCoord.

Referenced by WRL2FACESET().

◆ SetName()

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

Reimplemented in WRL2BASE.

Definition at line 222 of file vrml2_node.cpp.

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

Referenced by WRL2BASE::implementDef().

◆ SetParent()

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

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 WRL2NODE::AddChildNode(), WRL2NODE::m_Parent, and WRL2NODE::unlinkChildNode().

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

◆ TranslateToSG()

SGNODE * WRL2FACESET::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 544 of file vrml2_faceset.cpp.

References FACET::AddColor(), S3D::AddSGNodeChild(), S3D::AddSGNodeRef(), FACET::AddVertex(), SHAPE::CalcShape(), ccw, color, colorIndex, colorPerVertex, coord, coordIndex, creaseLimit, WRL2COLOR::GetColor(), S3D::GetSGNodeParent(), S3D::GetSGNodeType(), FACET::HasMinPoints(), FACET::Init(), WRL2NODE::m_BackPointers, WRL2NODE::m_Children, WRL2NODE::m_Refs, WRL2NODE::m_sgNode, SHAPE::NewFacet(), SGCOLOR::SetColor(), S3D::SGTYPE_SHAPE, and traceVrmlPlugin.

◆ unlinkChildNode()

void WRL2FACESET::unlinkChildNode ( const WRL2NODE aNode)
overridevirtual

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

Definition at line 724 of file vrml2_faceset.cpp.

References color, coord, WRL2NODE::GetParent(), normal, texCoord, and WRL2NODE::unlinkChildNode().

◆ unlinkRefNode()

void WRL2FACESET::unlinkRefNode ( const WRL2NODE aNode)
overridevirtual

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

Definition at line 745 of file vrml2_faceset.cpp.

References color, coord, WRL2NODE::GetParent(), normal, texCoord, and WRL2NODE::unlinkRefNode().

Member Data Documentation

◆ ccw

bool WRL2FACESET::ccw
private

Definition at line 75 of file vrml2_faceset.h.

Referenced by Read(), setDefaults(), and TranslateToSG().

◆ color

WRL2NODE* WRL2FACESET::color
private

◆ colorIndex

std::vector< int > WRL2FACESET::colorIndex
private

Definition at line 81 of file vrml2_faceset.h.

Referenced by Read(), and TranslateToSG().

◆ colorPerVertex

bool WRL2FACESET::colorPerVertex
private

Definition at line 76 of file vrml2_faceset.h.

Referenced by Read(), setDefaults(), and TranslateToSG().

◆ convex

bool WRL2FACESET::convex
private

Definition at line 77 of file vrml2_faceset.h.

Referenced by Read(), and setDefaults().

◆ coord

WRL2NODE* WRL2FACESET::coord
private

◆ coordIndex

std::vector< int > WRL2FACESET::coordIndex
private

Definition at line 82 of file vrml2_faceset.h.

Referenced by Read(), and TranslateToSG().

◆ creaseAngle

float WRL2FACESET::creaseAngle
private

Definition at line 85 of file vrml2_faceset.h.

Referenced by Read(), and setDefaults().

◆ creaseLimit

float WRL2FACESET::creaseLimit
private

Definition at line 86 of file vrml2_faceset.h.

Referenced by Read(), setDefaults(), and TranslateToSG().

◆ m_BackPointers

◆ m_Children

◆ m_error

std::string WRL2NODE::m_error
protectedinherited

Definition at line 176 of file vrml2_node.h.

Referenced by WRL2NODE::GetError().

◆ 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

◆ normal

WRL2NODE* WRL2FACESET::normal
private

Definition at line 72 of file vrml2_faceset.h.

Referenced by AddChildNode(), AddRefNode(), setDefaults(), unlinkChildNode(), and unlinkRefNode().

◆ normalIndex

std::vector< int > WRL2FACESET::normalIndex
private

Definition at line 83 of file vrml2_faceset.h.

Referenced by Read().

◆ normalPerVertex

bool WRL2FACESET::normalPerVertex
private

Definition at line 78 of file vrml2_faceset.h.

Referenced by Read(), and setDefaults().

◆ solid

bool WRL2FACESET::solid
private

Definition at line 79 of file vrml2_faceset.h.

Referenced by Read(), and setDefaults().

◆ texCoord

WRL2NODE* WRL2FACESET::texCoord
private

Definition at line 73 of file vrml2_faceset.h.

Referenced by AddChildNode(), AddRefNode(), setDefaults(), unlinkChildNode(), and unlinkRefNode().


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