KiCad PCB EDA Suite
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 <cirilo.bernardo@gmail.com>
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 
45 #include "plugins/3dapi/sg_base.h"
46 #include "plugins/3dapi/sg_types.h"
47 
48 class SGNODE;
49 
55 {
56 protected:
58 
59 public:
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 );
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 
147  SGNODE* FindNode( const char *aNodeName );
148 
156  bool AddRefNode( SGNODE* aNode );
157  bool AddRefNode( IFSG_NODE& aNode );
158 
165  bool AddChildNode( SGNODE* aNode );
166  bool AddChildNode( IFSG_NODE& aNode );
167 };
168 
169 #endif // IFSG_NODE_H
defines the types of intermediate scene graph objects
SGNODE * m_node
Definition: ifsg_node.h:57
Class IFSG_NODE represents the base class of all DLL-safe Scene Graph nodes.
Definition: ifsg_node.h:54
Class SGNODE represents the base class of all Scene Graph nodes.
Definition: sg_node.h:76
defines the low level classes common to scene graph nodes
SGTYPES
Definition: sg_types.h:34
#define SGLIB_API
Definition: ifsg_defs.h:56
XNODE * FindNode(XNODE *aChild, wxString aTag)
char const * GetNodeTypeName(S3D::SGTYPES aType)
Function GetNodeTypeName returns the name of the given type of node.
Definition: sg_node.cpp:51