OpenWalnut  1.5.0dev
WNewVertex.cpp
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2013 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #include "WNewVertex.h"
26 
27 
28 namespace butterfly
29 {
30 WNewVertex::WNewVertex( size_t toID )
31 {
32  this->m_toID = toID;
33  this->m_newVertexID = 0;
34  this->m_isValid = true;
35  this->m_coordinate = osg::Vec3( 0, 0, 0 );
36 }
37 
39 {
40  //No arrays or vectors to decompose
41 }
42 
43 size_t WNewVertex::getNewVertexID() // NOLINT
44 {
45  return this->m_newVertexID;
46 }
47 void WNewVertex::setNewVertexID( size_t newVertexID )
48 {
49  this->m_newVertexID = newVertexID;
50 }
51 
53 {
54  return this->m_toID;
55 }
56 void WNewVertex::setValid( bool isValid )
57 {
58  this->m_isValid = isValid;
59 }
61 {
62  return this->m_isValid;
63 }
65 {
66  return this->m_coordinate;
67 }
68 void WNewVertex::setCoordinate( osg::Vec3 coordinate )
69 {
70  this->m_coordinate = coordinate;
71 }
72 
73 } /* namespace butterfly */
void setNewVertexID(size_t newVertexID)
Sets the proposed ID for that new vertex.
Definition: WNewVertex.cpp:47
virtual ~WNewVertex()
Destroys the new vertex property.
Definition: WNewVertex.cpp:38
osg::Vec3 m_coordinate
Coordinate of the new vertex.
Definition: WNewVertex.h:125
size_t getToID()
Returns the second vertex ID where the new vertex lies between these two points.
Definition: WNewVertex.cpp:52
bool m_isValid
Property whether the new vertex is valid for subdivision.
Definition: WNewVertex.h:131
size_t getNewVertexID()
Returns the proposed ID of that new vertex.
Definition: WNewVertex.cpp:43
void setValid(bool isValid)
Sets the new vertex property whether it's valid for butterfly subdivision or not.
Definition: WNewVertex.cpp:56
osg::Vec3 getCoordinate()
Returns coordinates of the new vertex.
Definition: WNewVertex.cpp:64
bool isValid()
Returns whether the new vertex is marked to be valid for the butterfly subdivison of a line between t...
Definition: WNewVertex.cpp:60
size_t m_newVertexID
ID the new vertex is proposed to have in the final triangle mesh.
Definition: WNewVertex.h:120
void setCoordinate(osg::Vec3 coordinate)
Sets coordinates of the new vertex.
Definition: WNewVertex.cpp:68
WNewVertex(size_t toID)
Initializes properties of a new vertex with all its necessary parameters.
Definition: WNewVertex.cpp:30
size_t m_toID
The id of the second vertex the new vertex is connected to.
Definition: WNewVertex.h:115