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, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
28
29#ifndef IFSG_NODE_H
30#define IFSG_NODE_H
31
34
35class SGNODE;
36
49{
50protected:
52
53public:
54 IFSG_NODE();
55 virtual ~IFSG_NODE();
56
57 // deleted operators
58 IFSG_NODE( const IFSG_NODE& aParent ) = delete;
59 IFSG_NODE& operator= ( const IFSG_NODE& ) = delete;
60
64 void Destroy( void );
65
69 virtual bool Attach( SGNODE* aNode ) = 0;
70
74 virtual bool NewNode( SGNODE* aParent ) = 0;
75 virtual bool NewNode( IFSG_NODE& aParent ) = 0;
76
80 SGNODE* GetRawPtr( void ) noexcept;
81
85 S3D::SGTYPES GetNodeType( void ) const;
86
91 SGNODE* GetParent( void ) const;
92
100 bool SetParent( SGNODE* aParent );
101
105 const char* GetName( void );
106
114 bool SetName( const char *aName );
115
120 const char * GetNodeTypeName( S3D::SGTYPES aNodeType ) const;
121
131 SGNODE* FindNode( const char *aNodeName );
132
138 bool AddRefNode( SGNODE* aNode );
139 bool AddRefNode( IFSG_NODE& aNode );
140
146 bool AddChildNode( SGNODE* aNode );
147 bool AddChildNode( IFSG_NODE& aNode );
148};
149
150#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:79
bool SetParent(SGNODE *aParent)
Set the parent SGNODE of this object.
Definition ifsg_node.cpp:87
SGNODE * GetRawPtr(void) noexcept
Return the raw internal SGNODE pointer.
Definition ifsg_node.cpp:65
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:95
void Destroy(void)
Delete the object held by this wrapper.
Definition ifsg_node.cpp:55
SGNODE * m_node
Definition ifsg_node.h:51
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.
S3D::SGTYPES GetNodeType(void) const
Return the type of this node instance.
Definition ifsg_node.cpp:71
The base class of all Scene Graph nodes.
Definition sg_node.h:75
#define SGLIB_API
Definition ifsg_defs.h:56
SGTYPES
Definition sg_types.h:36
defines the low level classes common to scene graph nodes
defines the types of intermediate scene graph objects