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

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)
 Delete the object held by this wrapper.
 
virtual bool Attach (SGNODE *aNode)=0
 Associate a given SGNODE* with this wrapper.
 
virtual bool NewNode (SGNODE *aParent)=0
 Create a new node to associate with this wrapper.
 
virtual bool NewNode (IFSG_NODE &aParent)=0
 
SGNODEGetRawPtr (void) noexcept
 Return the raw internal SGNODE pointer.
 
S3D::SGTYPES GetNodeType (void) const
 Return the type of this node instance.
 
SGNODEGetParent (void) const
 Return a pointer to the parent SGNODE of this object or NULL if the object has no parent (ie.
 
bool SetParent (SGNODE *aParent)
 Set the parent SGNODE of this object.
 
const char * GetName (void)
 Return a pointer to the node name (NULL if no name assigned).
 
bool SetName (const char *aName)
 Set the node's name.
 
const char * GetNodeTypeName (S3D::SGTYPES aNodeType) const
 Return the text representation of the node type or NULL if the node somehow has an invalid type.
 
SGNODEFindNode (const char *aNodeName)
 Search the tree of linked nodes and returns a reference to the first node found with the given name.
 
bool AddRefNode (SGNODE *aNode)
 Add a reference to an existing node which is not owned by (not a child of) this node.
 
bool AddRefNode (IFSG_NODE &aNode)
 
bool AddChildNode (SGNODE *aNode)
 Add a node as a child owned by this node.
 
bool AddChildNode (IFSG_NODE &aNode)
 

Protected Attributes

SGNODEm_node
 

Detailed Description

The base class of all DLL-safe Scene Graph nodes.

Note
The IFSG wrapper classes shall be aimed at creating a VRML-like intermediate scenegraph representation. Although objects are readily created and added to the structure, no provision shall be made to inspect the structures in detail. For example the SCENEGRAPH class may contain various SGSHAPE and SCENEGRAPH nodes but there shall be no provision to extract those nodes. This was done because in principle all the detailed data shall only be handled within the SG* classes and only data processed via GetRenderData() shall be available via the wrappers.

Definition at line 48 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.

References m_node.

◆ ~IFSG_NODE()

IFSG_NODE::~IFSG_NODE ( )
virtual

Definition at line 48 of file ifsg_node.cpp.

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 ( IFSG_NODE aNode)

Definition at line 156 of file ifsg_node.cpp.

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

◆ AddChildNode() [2/2]

bool IFSG_NODE::AddChildNode ( SGNODE aNode)

Add a node as a child owned by this node.

Returns
true on success.

Definition at line 148 of file ifsg_node.cpp.

References SGNODE::AddChildNode(), and m_node.

Referenced by SHAPE::CalcShape(), EXPORTER_PCB_VRML::create_vrml_plane(), EXPORTER_PCB_VRML::create_vrml_shell(), EXPORTER_PCB_VRML::ExportVrmlFootprint(), and makeComponents().

◆ AddRefNode() [1/2]

bool IFSG_NODE::AddRefNode ( IFSG_NODE aNode)

Definition at line 136 of file ifsg_node.cpp.

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

◆ AddRefNode() [2/2]

bool IFSG_NODE::AddRefNode ( SGNODE aNode)

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

References SGNODE::AddRefNode(), and m_node.

Referenced by SHAPE::CalcShape(), EXPORTER_PCB_VRML::create_vrml_plane(), EXPORTER_PCB_VRML::create_vrml_shell(), EXPORTER_PCB_VRML::ExportVrmlFootprint(), makeComponents(), and vrmlToSG().

◆ Attach()

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

Associate a given SGNODE* with this wrapper.

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

◆ Destroy()

◆ FindNode()

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

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

Definition at line 120 of file ifsg_node.cpp.

References SGNODE::FindNode(), and m_node.

◆ GetName()

const char * IFSG_NODE::GetName ( void  )

Return a pointer to the node name (NULL if no name assigned).

Definition at line 95 of file ifsg_node.cpp.

References SGNODE::GetName(), and m_node.

◆ GetNodeType()

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

Return the type of this node instance.

Definition at line 71 of file ifsg_node.cpp.

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

◆ GetNodeTypeName()

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

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

References SGNODE::GetNodeTypeName(), and m_node.

◆ GetParent()

SGNODE * IFSG_NODE::GetParent ( void  ) const

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 79 of file ifsg_node.cpp.

References SGNODE::GetParent(), and m_node.

Referenced by makeComponents().

◆ GetRawPtr()

◆ NewNode() [1/2]

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

◆ NewNode() [2/2]

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

Create a new node to associate with this wrapper.

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

◆ operator=()

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

◆ SetName()

bool IFSG_NODE::SetName ( const char *  aName)

Set the node's name.

If the pointer passed is NULL, the node's name is erased.

Returns
true on success.

Definition at line 103 of file ifsg_node.cpp.

References m_node, and SGNODE::SetName().

◆ SetParent()

bool IFSG_NODE::SetParent ( SGNODE aParent)

Set the parent SGNODE of this object.

Parameters
[in]aParentis 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.

References m_node, and SGNODE::SetParent().

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

Member Data Documentation

◆ m_node


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