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
29/*
30 * NOTES:
31 * 1. The IFSG wrapper classes shall be aimed at creating a VRML-like
32 * intermediate scenegraph representation. Although objects are
33 * readily created and added to the structure, no provision shall
34 * be made to inspect the structures in detail. For example the
35 * SCENEGRAPH class may contain various SGSHAPE and SCENEGRAPH
36 * nodes but there shall be no provision to extract those nodes.
37 * This was done because in principle all the detailed data shall
38 * only be handled within the SG* classes and only data processed
39 * via GetRenderData() shall be available via the wrappers.
40 */
41
42#ifndef IFSG_NODE_H
43#define IFSG_NODE_H
44
47
48class SGNODE;
49
55{
56protected:
58
59public:
60 IFSG_NODE();
61 virtual ~IFSG_NODE();
62
63 // deleted operators
64 IFSG_NODE( const IFSG_NODE& aParent ) = delete;
65 IFSG_NODE& operator= ( const IFSG_NODE& ) = delete;
66
71 void Destroy( void );
72
77 virtual bool Attach( SGNODE* aNode ) = 0;
78
83 virtual bool NewNode( SGNODE* aParent ) = 0;
84 virtual bool NewNode( IFSG_NODE& aParent ) = 0;
85
90 SGNODE* GetRawPtr( void ) noexcept;
91
96 S3D::SGTYPES GetNodeType( void ) const;
97
103 SGNODE* GetParent( void ) const;
104
114 bool SetParent( SGNODE* aParent );
115
120 const char* GetName( void );
121
129 bool SetName( const char *aName );
130
136 const char * GetNodeTypeName( S3D::SGTYPES aNodeType ) const;
137
146 SGNODE* FindNode( const char *aNodeName );
147
155 bool AddRefNode( SGNODE* aNode );
156 bool AddRefNode( IFSG_NODE& aNode );
157
164 bool AddChildNode( SGNODE* aNode );
165 bool AddChildNode( IFSG_NODE& aNode );
166};
167
168#endif // IFSG_NODE_H
IFSG_NODE represents the base class of all DLL-safe Scene Graph nodes.
Definition: ifsg_node.h:55
IFSG_NODE(const IFSG_NODE &aParent)=delete
virtual bool NewNode(IFSG_NODE &aParent)=0
virtual bool NewNode(SGNODE *aParent)=0
Function NewNode creates a new node to associate with this wrapper.
virtual bool Attach(SGNODE *aNode)=0
Function Attach associates a given SGNODE* with this wrapper.
SGNODE * m_node
Definition: ifsg_node.h:57
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:35
defines the low level classes common to scene graph nodes
defines the types of intermediate scene graph objects