KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ifsg_node.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2015 Cirilo Bernardo <[email protected]>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
24
25#ifndef IFSG_NODE_H
26#define IFSG_NODE_H
27
30
31class SGNODE;
32
45{
46protected:
48
49public:
50 IFSG_NODE();
51 virtual ~IFSG_NODE();
52
53 // deleted operators
54 IFSG_NODE( const IFSG_NODE& aParent ) = delete;
55 IFSG_NODE& operator= ( const IFSG_NODE& ) = delete;
56
60 void Destroy( void );
61
65 virtual bool Attach( SGNODE* aNode ) = 0;
66
70 virtual bool NewNode( SGNODE* aParent ) = 0;
71 virtual bool NewNode( IFSG_NODE& aParent ) = 0;
72
76 SGNODE* GetRawPtr( void ) noexcept;
77
81 S3D::SGTYPES GetNodeType( void ) const;
82
87 SGNODE* GetParent( void ) const;
88
96 bool SetParent( SGNODE* aParent );
97
101 const char* GetName( void );
102
110 bool SetName( const char *aName );
111
116 const char * GetNodeTypeName( S3D::SGTYPES aNodeType ) const;
117
127 SGNODE* FindNode( const char *aNodeName );
128
134 bool AddRefNode( SGNODE* aNode );
135 bool AddRefNode( IFSG_NODE& aNode );
136
142 bool AddChildNode( SGNODE* aNode );
143 bool AddChildNode( IFSG_NODE& aNode );
144};
145
146#endif // IFSG_NODE_H
IFSG_NODE(const IFSG_NODE &aParent)=delete
virtual bool NewNode(IFSG_NODE &aParent)=0
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.
SGNODE * GetParent(void) const
Return a pointer to the parent SGNODE of this object or NULL if the object has no parent (ie.
Definition ifsg_node.cpp:75
bool SetParent(SGNODE *aParent)
Set the parent SGNODE of this object.
Definition ifsg_node.cpp:83
SGNODE * GetRawPtr(void) noexcept
Return the raw internal SGNODE pointer.
Definition ifsg_node.cpp:61
SGNODE * FindNode(const char *aNodeName)
Search the tree of linked nodes and returns a reference to the first node found with the given name.
virtual bool NewNode(SGNODE *aParent)=0
Create a new node to associate with this wrapper.
virtual bool Attach(SGNODE *aNode)=0
Associate a given SGNODE* with this wrapper.
const char * GetName(void)
Return a pointer to the node name (NULL if no name assigned).
Definition ifsg_node.cpp:91
void Destroy(void)
Delete the object held by this wrapper.
Definition ifsg_node.cpp:51
SGNODE * m_node
Definition ifsg_node.h:47
bool AddChildNode(SGNODE *aNode)
Add a node as a child owned by this node.
bool AddRefNode(SGNODE *aNode)
Add a reference to an existing node which is not owned by (not a child of) this node.
bool SetName(const char *aName)
Set the node's name.
Definition ifsg_node.cpp:99
S3D::SGTYPES GetNodeType(void) const
Return the type of this node instance.
Definition ifsg_node.cpp:67
The base class of all Scene Graph nodes.
Definition sg_node.h:71
#define SGLIB_API
Definition ifsg_defs.h:52
SGTYPES
Definition sg_types.h:32
defines the low level classes common to scene graph nodes
defines the types of intermediate scene graph objects