KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sg_faceset.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-2017 Cirilo Bernardo <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
24
25
26#ifndef SG_FACESET_H
27#define SG_FACESET_H
28
29#include <vector>
30#include "3d_cache/sg/sg_node.h"
31
32
33class SGCOLORS;
34class SGCOORDS;
35class SGNORMALS;
36class SGCOLORINDEX;
37class SGCOORDINDEX;
38
42class SGFACESET : public SGNODE
43{
44public:
45 SGFACESET( SGNODE* aParent );
46 virtual ~SGFACESET();
47
48 virtual bool SetParent( SGNODE* aParent, bool notify = true ) override;
49
50 SGNODE* FindNode( const char* aNodeName, const SGNODE* aCaller ) override;
51 bool AddRefNode( SGNODE* aNode ) override;
52 bool AddChildNode( SGNODE* aNode ) override;
53
54 bool CalcNormals( SGNODE** aPtr );
55
56 void ReNameNodes( void ) override;
57 bool WriteVRML( std::ostream& aFile, bool aReuseFlag ) override;
58
59 bool WriteCache( std::ostream& aFile, SGNODE* parentNode ) override;
60 bool ReadCache( std::istream& aFile, SGNODE* parentNode ) override;
61
66 void GatherCoordIndices( std::vector< int >& aIndexList );
67
68 void unlinkChildNode( const SGNODE* aNode ) override;
69 void unlinkRefNode( const SGNODE* aNode ) override;
70
71 // validate the data held by this face set
72 bool validate( void );
73
74 // owned objects
79
80 // referenced objects
84
85private:
86 bool valid;
88 void unlinkNode( const SGNODE* aNode, bool isChild );
89 bool addNode( SGNODE* aNode, bool isChild );
90
91};
92
93/*
94 p.88
95 IndexedFaceSet {
96 color NULL
97 coord NULL
98 normal NULL
99 texCoord NULL
100 ccw TRUE
101 colorIndex []
102 colorPerVertex TRUE
103 convex TRUE
104 coordIndex []
105 creaseAngle 0
106 normalIndex []
107 normalPerVertex TRUE
108 solid TRUE
109 texCoordIndex []
110 }
111*/
112
113#endif // SG_FACESET_H
Define an RGB color set for a scenegraph object.
Definition sg_colors.h:35
An object to maintain a coordinate index list.
Define a vertex coordinate set for a scenegraph object.
Definition sg_coords.h:37
bool validated
Definition sg_faceset.h:87
void GatherCoordIndices(std::vector< int > &aIndexList)
Add all internal coordinate indices to the given list in preparation for a normals calculation.
void unlinkRefNode(const SGNODE *aNode) override
Remove pointers to a referenced node.
SGCOORDS * m_RCoords
Definition sg_faceset.h:82
SGCOORDINDEX * m_CoordIndices
Definition sg_faceset.h:77
SGNODE * FindNode(const char *aNodeName, const SGNODE *aCaller) override
Search the tree of linked nodes and return a reference to the first node found with the given name.
bool addNode(SGNODE *aNode, bool isChild)
SGCOORDS * m_Coords
Definition sg_faceset.h:76
bool CalcNormals(SGNODE **aPtr)
SGFACESET(SGNODE *aParent)
void ReNameNodes(void) override
Rename a node and all its child nodes in preparation for write operations.
SGNORMALS * m_Normals
Definition sg_faceset.h:78
virtual bool SetParent(SGNODE *aParent, bool notify=true) override
Set the parent SGNODE of this object.
void unlinkChildNode(const SGNODE *aNode) override
Remove references to an owned child.
void unlinkNode(const SGNODE *aNode, bool isChild)
SGCOLORS * m_RColors
Definition sg_faceset.h:81
SGNORMALS * m_RNormals
Definition sg_faceset.h:83
bool AddRefNode(SGNODE *aNode) override
virtual ~SGFACESET()
bool valid
Definition sg_faceset.h:86
bool validate(void)
SGCOLORS * m_Colors
Definition sg_faceset.h:75
bool AddChildNode(SGNODE *aNode) override
bool WriteCache(std::ostream &aFile, SGNODE *parentNode) override
Write this node's data to a binary cache file.
bool WriteVRML(std::ostream &aFile, bool aReuseFlag) override
Writes this node's data to a VRML file.
bool ReadCache(std::istream &aFile, SGNODE *parentNode) override
Reads binary format data from a cache file.
SGNODE(SGNODE *aParent)
Definition sg_node.cpp:72
Define a set of vertex normals for a scene graph object.
Definition sg_normals.h:35