KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sg_normals.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#ifndef SG_NORMALS_H
26#define SG_NORMALS_H
27
28#include <vector>
29#include "3d_cache/sg/sg_node.h"
30
34class SGNORMALS : public SGNODE
35{
36public:
37 SGNORMALS( SGNODE* aParent );
38 virtual ~SGNORMALS();
39
40 virtual bool SetParent( SGNODE* aParent, bool notify = true ) override;
41
42 SGNODE* FindNode( const char* aNodeName, const SGNODE* aCaller ) noexcept override;
43 bool AddRefNode( SGNODE* aNode ) noexcept override;
44 bool AddChildNode( SGNODE* aNode ) noexcept override;
45
46 bool GetNormalList( size_t& aListSize, SGVECTOR*& aNormalList );
47 void SetNormalList( size_t aListSize, const SGVECTOR* aNormalList );
48 void AddNormal( double aXValue, double aYValue, double aZValue );
49 void AddNormal( const SGVECTOR& aNormal );
50
51 void ReNameNodes( void ) override;
52 bool WriteVRML( std::ostream& aFile, bool aReuseFlag ) override;
53
54 bool WriteCache( std::ostream& aFile, SGNODE* parentNode ) override;
55 bool ReadCache( std::istream& aFile, SGNODE* parentNode ) override;
56
57 void unlinkChildNode( const SGNODE* aNode ) noexcept override;
58 void unlinkRefNode( const SGNODE* aNode ) noexcept override;
59
60 std::vector< SGVECTOR > norms;
61};
62
63#endif // SG_NORMALS_H
SGNODE(SGNODE *aParent)
Definition sg_node.cpp:72
virtual bool SetParent(SGNODE *aParent, bool notify=true) override
Set the parent SGNODE of this object.
bool AddChildNode(SGNODE *aNode) noexcept override
void ReNameNodes(void) override
Rename a node and all its child nodes in preparation for write operations.
bool WriteCache(std::ostream &aFile, SGNODE *parentNode) override
Write this node's data to a binary cache file.
void AddNormal(double aXValue, double aYValue, double aZValue)
bool GetNormalList(size_t &aListSize, SGVECTOR *&aNormalList)
virtual ~SGNORMALS()
bool WriteVRML(std::ostream &aFile, bool aReuseFlag) override
Writes this node's data to a VRML file.
void SetNormalList(size_t aListSize, const SGVECTOR *aNormalList)
bool ReadCache(std::istream &aFile, SGNODE *parentNode) override
Reads binary format data from a cache file.
void unlinkRefNode(const SGNODE *aNode) noexcept override
Remove pointers to a referenced node.
SGNODE * FindNode(const char *aNodeName, const SGNODE *aCaller) noexcept override
Search the tree of linked nodes and return a reference to the first node found with the given name.
SGNORMALS(SGNODE *aParent)
bool AddRefNode(SGNODE *aNode) noexcept override
void unlinkChildNode(const SGNODE *aNode) noexcept override
Remove references to an owned child.
std::vector< SGVECTOR > norms
Definition sg_normals.h:60