Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
vhacdManifoldMesh.h
Go to the documentation of this file.
1/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot com)
2All rights reserved.
3
4
5 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
6following conditions are met:
7
8 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
9disclaimer.
10
11 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
12disclaimer in the documentation and/or other materials provided with the distribution.
13
14 3. The names of the contributors may not be used to endorse or promote products derived from this software without
15specific prior written permission.
16
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
18INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24*/
25#pragma once
26
30
31namespace tesseract_collision
32{
33namespace VHACD
34{
35class TMMTriangle;
36class TMMEdge;
37class TMMesh;
38class ICHull;
39
42{
43public:
44 void Initialize();
45 TMMVertex(void);
46 ~TMMVertex(void);
47
48 TMMVertex(const TMMVertex&) = delete;
49 TMMVertex(TMMVertex&&) = default;
50 TMMVertex& operator=(const TMMVertex&) = default;
52
53private:
55 int32_t m_name;
56 size_t m_id;
57 CircularListElement<TMMEdge>* m_duplicate; // pointer to incident cone edge (or NULL)
59 bool m_tag;
60
61 friend class ICHull;
62 friend class TMMesh;
63 friend class TMMTriangle;
64 friend class TMMEdge;
65};
66
69{
70public:
71 void Initialize();
72 TMMEdge(void);
73 ~TMMEdge(void);
74
75 TMMEdge(const TMMEdge&) = delete;
76 TMMEdge(TMMEdge&&) = default;
77 TMMEdge& operator=(const TMMEdge&) = default;
78 TMMEdge& operator=(TMMEdge&&) = default;
79
80private:
81 size_t m_id;
85 friend class ICHull;
86 friend class TMMTriangle;
87 friend class TMMVertex;
88 friend class TMMesh;
89};
90
93{
94public:
95 void Initialize();
96 TMMTriangle(void);
97 ~TMMTriangle(void);
98
99 TMMTriangle(const TMMTriangle&) = delete;
103
104private:
105 size_t m_id;
109
110 friend class ICHull;
111 friend class TMMesh;
112 friend class TMMVertex;
113 friend class TMMEdge;
114};
117{
118public:
120 inline size_t GetNVertices() const { return m_vertices.GetSize(); }
122 inline size_t GetNEdges() const { return m_edges.GetSize(); }
124 inline size_t GetNTriangles() const { return m_triangles.GetSize(); }
126 inline const CircularList<TMMVertex>& GetVertices() const { return m_vertices; }
128 inline const CircularList<TMMEdge>& GetEdges() const { return m_edges; }
130 inline const CircularList<TMMTriangle>& GetTriangles() const { return m_triangles; }
144 void Print();
146 void GetIFS(Vec3<double>* const points, Vec3<int32_t>* const triangles);
148 void Clear();
150 void Copy(TMMesh& mesh);
152 bool CheckConsistancy();
154 bool Normalize();
158 TMMesh();
160 virtual ~TMMesh(void);
161
162private:
166
167 // not defined
168 TMMesh(const TMMesh& rhs);
169 friend class ICHull;
170};
171} // namespace VHACD
172} // namespace tesseract_collision
CircularListElement class.
Definition: vhacdCircularList.h:36
CircularList class.
Definition: vhacdCircularList.h:60
Definition: vhacdICHull.h:44
Edge data structure used in a triangular manifold mesh (TMM).
Definition: vhacdManifoldMesh.h:69
CircularListElement< TMMTriangle > * m_newFace
Definition: vhacdManifoldMesh.h:84
TMMEdge(void)
Definition: vhacdManifoldMesh.cpp:41
TMMEdge & operator=(const TMMEdge &)=default
size_t m_id
Definition: vhacdManifoldMesh.h:81
~TMMEdge(void)
Definition: vhacdManifoldMesh.cpp:48
TMMEdge(const TMMEdge &)=delete
void Initialize()
Definition: vhacdManifoldMesh.cpp:42
CircularListElement< TMMVertex > * m_vertices[2]
Definition: vhacdManifoldMesh.h:83
CircularListElement< TMMTriangle > * m_triangles[2]
Definition: vhacdManifoldMesh.h:82
TMMEdge & operator=(TMMEdge &&)=default
Triangle data structure used in a triangular manifold mesh (TMM).
Definition: vhacdManifoldMesh.h:93
TMMTriangle & operator=(TMMTriangle &&)=default
TMMTriangle(void)
Definition: vhacdManifoldMesh.cpp:59
TMMTriangle & operator=(const TMMTriangle &)=default
TMMTriangle(const TMMTriangle &)=delete
size_t m_id
Definition: vhacdManifoldMesh.h:105
~TMMTriangle(void)
Definition: vhacdManifoldMesh.cpp:60
bool m_visible
Definition: vhacdManifoldMesh.h:108
CircularListElement< TMMVertex > * m_vertices[3]
Definition: vhacdManifoldMesh.h:107
void Initialize()
Definition: vhacdManifoldMesh.cpp:49
CircularListElement< TMMEdge > * m_edges[3]
Definition: vhacdManifoldMesh.h:106
TMMTriangle(TMMTriangle &&)=default
Vertex data structure used in a triangular manifold mesh (TMM).
Definition: vhacdManifoldMesh.h:42
TMMVertex & operator=(TMMVertex &&)=default
~TMMVertex(void)
Definition: vhacdManifoldMesh.cpp:40
CircularListElement< TMMEdge > * m_duplicate
Definition: vhacdManifoldMesh.h:57
TMMVertex & operator=(const TMMVertex &)=default
TMMVertex(const TMMVertex &)=delete
size_t m_id
Definition: vhacdManifoldMesh.h:56
Vec3< double > m_pos
Definition: vhacdManifoldMesh.h:54
int32_t m_name
Definition: vhacdManifoldMesh.h:55
void Initialize()
Definition: vhacdManifoldMesh.cpp:31
bool m_onHull
Definition: vhacdManifoldMesh.h:58
bool m_tag
Definition: vhacdManifoldMesh.h:59
TMMVertex(void)
Definition: vhacdManifoldMesh.cpp:30
triangular manifold mesh data structure.
Definition: vhacdManifoldMesh.h:117
CircularList< TMMEdge > & GetEdges()
Returns the edges circular list.
Definition: vhacdManifoldMesh.h:134
void Print()
Print mesh information.
CircularList< TMMVertex > m_vertices
Definition: vhacdManifoldMesh.h:163
void GetIFS(Vec3< double > *const points, Vec3< int32_t > *const triangles)
Definition: vhacdManifoldMesh.cpp:63
CircularListElement< TMMVertex > * AddVertex()
Add vertex to the mesh.
Definition: vhacdManifoldMesh.h:138
CircularList< TMMVertex > & GetVertices()
Returns the vertices circular list.
Definition: vhacdManifoldMesh.h:132
const CircularList< TMMVertex > & GetVertices() const
Returns the vertices circular list.
Definition: vhacdManifoldMesh.h:126
CircularList< TMMTriangle > & GetTriangles()
Returns the triangles circular list.
Definition: vhacdManifoldMesh.h:136
CircularListElement< TMMEdge > * AddEdge()
Add vertex to the mesh.
Definition: vhacdManifoldMesh.h:140
size_t GetNVertices() const
Returns the number of vertices>
Definition: vhacdManifoldMesh.h:120
void Copy(TMMesh &mesh)
Definition: vhacdManifoldMesh.cpp:89
CircularList< TMMTriangle > m_triangles
Definition: vhacdManifoldMesh.h:165
TMMesh()
Constructor.
Definition: vhacdManifoldMesh.cpp:61
size_t GetNEdges() const
Returns the number of edges.
Definition: vhacdManifoldMesh.h:122
virtual ~TMMesh(void)
Destructor.
Definition: vhacdManifoldMesh.cpp:62
CircularListElement< TMMTriangle > * AddTriangle()
Add vertex to the mesh.
Definition: vhacdManifoldMesh.h:142
void Clear()
Definition: vhacdManifoldMesh.cpp:83
const CircularList< TMMTriangle > & GetTriangles() const
Returns the triangles circular list.
Definition: vhacdManifoldMesh.h:130
bool CheckConsistancy()
Definition: vhacdManifoldMesh.cpp:192
const CircularList< TMMEdge > & GetEdges() const
Returns the edges circular list.
Definition: vhacdManifoldMesh.h:128
CircularList< TMMEdge > m_edges
Definition: vhacdManifoldMesh.h:164
size_t GetNTriangles() const
Returns the number of triangles.
Definition: vhacdManifoldMesh.h:124
Vector dim 3.
Definition: vhacdVector.h:37
Definition: bullet_cast_bvh_manager.h:49
auto mesh
Definition: tesseract_geometry_unit.cpp:25