KiCad PCB EDA Suite
IFSG_NODE Class Referenceabstract

IFSG_NODE represents the base class of all DLL-safe Scene Graph nodes. More...

#include <ifsg_node.h>

Inheritance diagram for IFSG_NODE:
IFSG_APPEARANCE IFSG_COLORS IFSG_COORDS IFSG_FACESET IFSG_INDEX IFSG_NORMALS IFSG_SHAPE IFSG_TRANSFORM

Public Member Functions

 IFSG_NODE ()
 
virtual ~IFSG_NODE ()
 
 IFSG_NODE (const IFSG_NODE &aParent)=delete
 
IFSG_NODEoperator= (const IFSG_NODE &)=delete
 
void Destroy (void)
 Function Destroy deletes the object held by this wrapper. More...
 
virtual bool Attach (SGNODE *aNode)=0
 Function Attach associates a given SGNODE* with this wrapper. More...
 
virtual bool NewNode (SGNODE *aParent)=0
 Function NewNode creates a new node to associate with this wrapper. More...
 
virtual bool NewNode (IFSG_NODE &aParent)=0
 
SGNODEGetRawPtr (void) noexcept
 Function GetRawPtr() returns the raw internal SGNODE pointer. More...
 
S3D::SGTYPES GetNodeType (void) const
 Function GetNodeType returns the type of this node instance. More...
 
SGNODEGetParent (void) const
 Function GetParent returns a pointer to the parent SGNODE of this object or NULL if the object has no parent (ie. More...
 
bool SetParent (SGNODE *aParent)
 Function SetParent sets the parent SGNODE of this object. More...
 
const char * GetName (void)
 Function GetName returns a pointer to the node name (NULL if no name assigned) More...
 
bool SetName (const char *aName)
 Function SetName sets the node's name; if the pointer passed is NULL then the node's name is erased. More...
 
const char * GetNodeTypeName (S3D::SGTYPES aNodeType) const
 Function GetNodeTypeName returns the text representation of the node type or NULL if the node somehow has an invalid type. More...
 
SGNODEFindNode (const char *aNodeName)
 Function FindNode searches the tree of linked nodes and returns a reference to the first node found with the given name. More...
 
bool AddRefNode (SGNODE *aNode)
 Function AddRefNode adds a reference to an existing node which is not owned by (not a child of) this node. More...
 
bool AddRefNode (IFSG_NODE &aNode)
 
bool AddChildNode (SGNODE *aNode)
 Function AddChildNode adds a node as a child owned by this node. More...
 
bool AddChildNode (IFSG_NODE &aNode)
 

Protected Attributes

SGNODEm_node
 

Detailed Description

IFSG_NODE represents the base class of all DLL-safe Scene Graph nodes.

Definition at line 54 of file ifsg_node.h.

Constructor & Destructor Documentation

◆ IFSG_NODE() [1/2]

IFSG_NODE::IFSG_NODE ( )

Definition at line 42 of file ifsg_node.cpp.

43 {
44  m_node = nullptr;
45 }
SGNODE * m_node
Definition: ifsg_node.h:57

References m_node.

◆ ~IFSG_NODE()

IFSG_NODE::~IFSG_NODE ( )
virtual

Definition at line 48 of file ifsg_node.cpp.

49 {
50  if( m_node )
52 }
SGNODE * m_node
Definition: ifsg_node.h:57
void DisassociateWrapper(SGNODE **aWrapperRef) noexcept
Remove the association between an IFSG* wrapper object and this object.
Definition: sg_node.cpp:223

References SGNODE::DisassociateWrapper(), and m_node.

◆ IFSG_NODE() [2/2]

IFSG_NODE::IFSG_NODE ( const IFSG_NODE aParent)
delete

Member Function Documentation

◆ AddChildNode() [1/2]

bool IFSG_NODE::AddChildNode ( SGNODE aNode)

Function AddChildNode adds a node as a child owned by this node.

Returns
true on success

Definition at line 148 of file ifsg_node.cpp.

149 {
150  wxCHECK( m_node, false );
151 
152  return m_node->AddChildNode( aNode );
153 }
SGNODE * m_node
Definition: ifsg_node.h:57
virtual bool AddChildNode(SGNODE *aNode)=0

References SGNODE::AddChildNode(), and m_node.

Referenced by SHAPE::CalcShape(), export_vrml_footprint(), and makeComponents().

◆ AddChildNode() [2/2]

bool IFSG_NODE::AddChildNode ( IFSG_NODE aNode)

Definition at line 156 of file ifsg_node.cpp.

157 {
158  wxCHECK( m_node, false );
159 
160  SGNODE* np = aNode.GetRawPtr();
161 
162  wxCHECK( np, false );
163 
164  return m_node->AddChildNode( np );
165 }
SGNODE * m_node
Definition: ifsg_node.h:57
The base class of all Scene Graph nodes.
Definition: sg_node.h:74
SGNODE * GetRawPtr(void) noexcept
Function GetRawPtr() returns the raw internal SGNODE pointer.
Definition: ifsg_node.cpp:65
virtual bool AddChildNode(SGNODE *aNode)=0

References SGNODE::AddChildNode(), GetRawPtr(), and m_node.

◆ AddRefNode() [1/2]

bool IFSG_NODE::AddRefNode ( SGNODE aNode)

Function AddRefNode adds a reference to an existing node which is not owned by (not a child of) this node.

Returns
true on success

Definition at line 128 of file ifsg_node.cpp.

129 {
130  wxCHECK( m_node, false );
131 
132  return m_node->AddRefNode( aNode );
133 }
virtual bool AddRefNode(SGNODE *aNode)=0
SGNODE * m_node
Definition: ifsg_node.h:57

References SGNODE::AddRefNode(), and m_node.

Referenced by SHAPE::CalcShape(), export_vrml_footprint(), makeComponents(), and vrmlToSG().

◆ AddRefNode() [2/2]

bool IFSG_NODE::AddRefNode ( IFSG_NODE aNode)

Definition at line 136 of file ifsg_node.cpp.

137 {
138  wxCHECK( m_node, false );
139 
140  SGNODE* np = aNode.GetRawPtr();
141 
142  wxCHECK( np, false );
143 
144  return m_node->AddRefNode( np );
145 }
virtual bool AddRefNode(SGNODE *aNode)=0
SGNODE * m_node
Definition: ifsg_node.h:57
The base class of all Scene Graph nodes.
Definition: sg_node.h:74
SGNODE * GetRawPtr(void) noexcept
Function GetRawPtr() returns the raw internal SGNODE pointer.
Definition: ifsg_node.cpp:65

References SGNODE::AddRefNode(), GetRawPtr(), and m_node.

◆ Attach()

virtual bool IFSG_NODE::Attach ( SGNODE aNode)
pure virtual

Function Attach associates a given SGNODE* with this wrapper.

Implemented in IFSG_TRANSFORM, IFSG_COLORS, IFSG_COORDINDEX, IFSG_COORDS, IFSG_FACESET, IFSG_NORMALS, IFSG_SHAPE, IFSG_INDEX, and IFSG_APPEARANCE.

◆ Destroy()

void IFSG_NODE::Destroy ( void  )

Function Destroy deletes the object held by this wrapper.

Definition at line 55 of file ifsg_node.cpp.

56 {
57  if( m_node )
59 
60  delete m_node;
61  m_node = nullptr;
62 }
SGNODE * m_node
Definition: ifsg_node.h:57
void DisassociateWrapper(SGNODE **aWrapperRef) noexcept
Remove the association between an IFSG* wrapper object and this object.
Definition: sg_node.cpp:223

References SGNODE::DisassociateWrapper(), and m_node.

Referenced by loadIDFBoard(), processComp(), processSolid(), WRL1GROUP::TranslateToSG(), WRL1SEPARATOR::TranslateToSG(), X3DSHAPE::TranslateToSG(), X3DTRANSFORM::TranslateToSG(), WRL2TRANSFORM::TranslateToSG(), WRL2SHAPE::TranslateToSG(), WRL1BASE::TranslateToSG(), WRL2BASE::TranslateToSG(), and MODEL_VRML::~MODEL_VRML().

◆ FindNode()

SGNODE * IFSG_NODE::FindNode ( const char *  aNodeName)

Function FindNode searches 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
Returns
is a valid node pointer on success, otherwise NULL

Definition at line 120 of file ifsg_node.cpp.

121 {
122  wxCHECK( m_node, nullptr );
123 
124  return m_node->FindNode( aNodeName, nullptr );
125 }
SGNODE * m_node
Definition: ifsg_node.h:57
virtual SGNODE * FindNode(const char *aNodeName, const SGNODE *aCaller)=0
Search the tree of linked nodes and return a reference to the first node found with the given name.

References SGNODE::FindNode(), and m_node.

◆ GetName()

const char * IFSG_NODE::GetName ( void  )

Function GetName returns a pointer to the node name (NULL if no name assigned)

Definition at line 95 of file ifsg_node.cpp.

96 {
97  wxCHECK( m_node, nullptr );
98 
99  return m_node->GetName();
100 }
SGNODE * m_node
Definition: ifsg_node.h:57
const char * GetName(void)
Definition: sg_node.cpp:146

References SGNODE::GetName(), and m_node.

◆ GetNodeType()

S3D::SGTYPES IFSG_NODE::GetNodeType ( void  ) const

Function GetNodeType returns the type of this node instance.

Definition at line 71 of file ifsg_node.cpp.

72 {
73  wxCHECK( m_node, S3D::SGTYPE_END );
74 
75  return m_node->GetNodeType();
76 }
SGNODE * m_node
Definition: ifsg_node.h:57
S3D::SGTYPES GetNodeType(void) const noexcept
Return the type of this node instance.
Definition: sg_node.cpp:104

References SGNODE::GetNodeType(), m_node, and S3D::SGTYPE_END.

◆ GetNodeTypeName()

const char * IFSG_NODE::GetNodeTypeName ( S3D::SGTYPES  aNodeType) const

Function GetNodeTypeName returns the text representation of the node type or NULL if the node somehow has an invalid type.

Definition at line 112 of file ifsg_node.cpp.

113 {
114  wxCHECK( m_node, nullptr );
115 
116  return m_node->GetNodeTypeName( aNodeType );
117 }
SGNODE * m_node
Definition: ifsg_node.h:57
const char * GetNodeTypeName(S3D::SGTYPES aNodeType) const noexcept
Definition: sg_node.cpp:164

References SGNODE::GetNodeTypeName(), and m_node.

◆ GetParent()

SGNODE * IFSG_NODE::GetParent ( void  ) const

Function GetParent returns a pointer to the parent SGNODE of this object or NULL if the object has no parent (ie.

top level transform).

Definition at line 79 of file ifsg_node.cpp.

80 {
81  wxCHECK( m_node, nullptr );
82 
83  return m_node->GetParent();
84 }
SGNODE * m_node
Definition: ifsg_node.h:57
SGNODE * GetParent(void) const noexcept
Returns a pointer to the parent SGNODE of this object or NULL if the object has no parent (ie.
Definition: sg_node.cpp:110

References SGNODE::GetParent(), and m_node.

Referenced by makeComponents().

◆ GetRawPtr()

◆ NewNode() [1/2]

virtual bool IFSG_NODE::NewNode ( SGNODE aParent)
pure virtual

Function NewNode creates a new node to associate with this wrapper.

Implemented in IFSG_TRANSFORM, IFSG_COLORS, IFSG_COORDINDEX, IFSG_COORDS, IFSG_FACESET, IFSG_NORMALS, IFSG_SHAPE, IFSG_INDEX, and IFSG_APPEARANCE.

◆ NewNode() [2/2]

virtual bool IFSG_NODE::NewNode ( IFSG_NODE aParent)
pure virtual

◆ operator=()

IFSG_NODE& IFSG_NODE::operator= ( const IFSG_NODE )
delete

◆ SetName()

bool IFSG_NODE::SetName ( const char *  aName)

Function SetName sets the node's name; if the pointer passed is NULL then the node's name is erased.

Returns
true on success

Definition at line 103 of file ifsg_node.cpp.

104 {
105  wxCHECK( m_node, false );
106 
107  m_node->SetName( aName );
108  return true;
109 }
SGNODE * m_node
Definition: ifsg_node.h:57
void SetName(const char *aName)
Definition: sg_node.cpp:155

References m_node, and SGNODE::SetName().

◆ SetParent()

bool IFSG_NODE::SetParent ( SGNODE aParent)

Function SetParent sets the parent SGNODE of this object.

Parameters
aParent[in] is the desired parent node
Returns
true if the operation succeeds; false if the given node is not allowed to be a parent to the derived object

Definition at line 87 of file ifsg_node.cpp.

88 {
89  wxCHECK( m_node, false );
90 
91  return m_node->SetParent( aParent );
92 }
SGNODE * m_node
Definition: ifsg_node.h:57
virtual bool SetParent(SGNODE *aParent, bool notify=true)=0
Set the parent SGNODE of this object.

References m_node, and SGNODE::SetParent().

Referenced by processFace(), and MODEL_VRML::~MODEL_VRML().

Member Data Documentation

◆ m_node


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