KiCad PCB EDA Suite
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 <>
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
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  *
19  * or you may search the 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  */
29 #ifndef SG_NORMALS_H
30 #define SG_NORMALS_H
32 #include <vector>
33 #include "3d_cache/sg/sg_node.h"
35 class SGNORMALS : public SGNODE
36 {
37 public:
38  std::vector< SGVECTOR > norms;
40  void unlinkChildNode( const SGNODE* aNode ) noexcept override;
41  void unlinkRefNode( const SGNODE* aNode ) noexcept override;
43 public:
44  SGNORMALS( SGNODE* aParent );
45  virtual ~SGNORMALS();
47  virtual bool SetParent( SGNODE* aParent, bool notify = true ) override;
49  SGNODE* FindNode(const char *aNodeName, const SGNODE *aCaller) noexcept override;
50  bool AddRefNode( SGNODE* aNode ) noexcept override;
51  bool AddChildNode( SGNODE* aNode ) noexcept override;
53  bool GetNormalList( size_t& aListSize, SGVECTOR*& aNormalList );
54  void SetNormalList( size_t aListSize, const SGVECTOR* aNormalList );
55  void AddNormal( double aXValue, double aYValue, double aZValue );
56  void AddNormal( const SGVECTOR& aNormal );
58  void ReNameNodes( void ) override;
59  bool WriteVRML( std::ostream& aFile, bool aReuseFlag ) override;
61  bool WriteCache( std::ostream& aFile, SGNODE* parentNode ) override;
62  bool ReadCache( std::istream& aFile, SGNODE* parentNode ) override;
63 };
65 #endif // SG_NORMALS_H
bool AddChildNode(SGNODE *aNode) noexcept override
Definition: sg_normals.cpp:145
void ReNameNodes(void) override
Function ReNameNodes renames a node and all its child nodes in preparation for Write() operations.
Definition: sg_normals.cpp:201
bool WriteCache(std::ostream &aFile, SGNODE *parentNode) override
Function WriteCache write's this node's data to a binary cache file; the data includes all data of ch...
Definition: sg_normals.cpp:267
void unlinkChildNode(const SGNODE *aNode) noexcept override
Function unlinkChild removes references to an owned child; it is invoked by the child upon destructio...
Definition: sg_normals.cpp:106
virtual bool SetParent(SGNODE *aParent, bool notify=true) override
Function SetParent sets the parent SGNODE of this object.
Definition: sg_normals.cpp:64
void unlinkRefNode(const SGNODE *aNode) noexcept override
Function unlinkRef removes pointers to a referenced node; it is invoked by the referenced node upon d...
Definition: sg_normals.cpp:119
defines the base class of the intermediate scene graph NODE
SGNODE represents the base class of all Scene Graph nodes.
Definition: sg_node.h:76
bool ReadCache(std::istream &aFile, SGNODE *parentNode) override
Function ReadCache Reads binary format data from a cache file.
Definition: sg_normals.cpp:336
virtual ~SGNORMALS()
Definition: sg_normals.cpp:57
bool WriteVRML(std::ostream &aFile, bool aReuseFlag) override
Function WriteVRML writes this node's data to a VRML file; this includes all data of child and refere...
Definition: sg_normals.cpp:211
std::vector< SGVECTOR > norms
Definition: sg_normals.h:38
void AddNormal(double aXValue, double aYValue, double aZValue)
Definition: sg_normals.cpp:187
bool AddRefNode(SGNODE *aNode) noexcept override
Definition: sg_normals.cpp:132
void SetNormalList(size_t aListSize, const SGVECTOR *aNormalList)
Definition: sg_normals.cpp:173
bool GetNormalList(size_t &aListSize, SGVECTOR *&aNormalList)
Definition: sg_normals.cpp:158
Definition: sg_normals.cpp:32
SGNODE * FindNode(const char *aNodeName, const SGNODE *aCaller) noexcept override
Function FindNode searches the tree of linked nodes and returns a reference to the first node found w...
Definition: sg_normals.cpp:94