indexedVertex.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2013-2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 CGAL::indexedVertex
28
29Description
30 An indexed form of CGAL::Triangulation_vertex_base_2<K> used to keep
31 track of the vertices in the triangulation.
32
33\*---------------------------------------------------------------------------*/
34
35#ifndef Foam_CGAL_indexedVertex_H
36#define Foam_CGAL_indexedVertex_H
37
38// Silence boost bind deprecation warnings (before CGAL-5.2.1)
39#include "CGAL/version.h"
40#if defined(CGAL_VERSION_NR) && (CGAL_VERSION_NR < 1050211000)
41#define BOOST_BIND_GLOBAL_PLACEHOLDERS
42#endif
43
44// ------------------------------------------------------------------------- //
45
46#include "CGAL/Triangulation_2.h"
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace CGAL
51{
52
53// Forward declaration of friend functions and operators
54
55template<class Gt, class Vb>
56class indexedVertex;
57
58template<class Gt, class Vb>
59bool pointPair
60(
61 const indexedVertex<Gt, Vb>& v0,
62 const indexedVertex<Gt, Vb>& v1
63);
64
65template<class Gt, class Vb>
67(
68 const indexedVertex<Gt, Vb>& v0,
69 const indexedVertex<Gt, Vb>& v1,
70 const indexedVertex<Gt, Vb>& v2
71);
72
73template<class Gt, class Vb>
75(
76 const indexedVertex<Gt, Vb>& v0,
77 const indexedVertex<Gt, Vb>& v1,
78 const indexedVertex<Gt, Vb>& v2
79);
80
81/*---------------------------------------------------------------------------*\
82 Class indexedVertex Declaration
83\*---------------------------------------------------------------------------*/
84
85template<class Gt, class Vb=CGAL::Triangulation_vertex_base_2<Gt>>
86class indexedVertex
87:
88 public Vb
89{
90 // Private data
91
92 //- The index for this triangle vertex
93 int index_;
94
95 //- Index of pair-point :
96 // NEAR_BOUNDARY_POINT : internal near boundary point.
97 // INTERNAL_POINT : internal point.
98 // FAR_POINT : far-point.
99 // >= 0 : part of point-pair. Index of other point.
100 // Lowest numbered is inside one (master).
101 int type_;
102
103
104public:
106 enum pointTypes
110 MIRROR_POINT = -2,
112 };
115 typedef typename Vb::Face_handle Face_handle;
116 typedef typename Vb::Point Point;
117
118 template<class TDS2>
119 struct Rebind_TDS
121 typedef typename Vb::template Rebind_TDS<TDS2>::Other Vb2;
123 };
124
125
126 // Constructors
128 inline indexedVertex();
130 inline indexedVertex(const Point& p);
131
132 inline indexedVertex(const Point& p, const int index, const int& type);
133
134 inline indexedVertex(const Point& p, Face_handle f);
135
137
138
139 // Member Functions
141 inline int& index();
143 inline int index() const;
145 inline int& type();
147 inline int type() const;
148
149 //- Is point a far-point
150 inline bool farPoint() const;
151
152 //- Is point internal, i.e. not on boundary
153 inline bool internalPoint() const;
154
155 //- Is point internal and near the boundary
156 inline bool nearBoundary() const;
157
158 //- Set the point to be near the boundary
159 inline void setNearBoundary();
160
161 //- Is point a mirror point
162 inline bool mirrorPoint() const;
163
164 //- Either master or slave of pointPair.
165 inline bool pairPoint() const;
166
167 //- Master of a pointPair is the lowest numbered one.
168 inline bool ppMaster() const;
169
170 //- Slave of a pointPair is the highest numbered one.
171 inline bool ppSlave() const;
172
173 //- Either original internal point or master of pointPair.
174 inline bool internalOrBoundaryPoint() const;
175
176 //- Is point near the boundary or part of the boundary definition
177 inline bool nearOrOnBoundary() const;
178
179
180 // Friend Functions
181
182 //- Do the two given vertices constitute a boundary point-pair
183 friend bool pointPair <Gt, Vb>
184 (
185 const indexedVertex<Gt, Vb>& v0,
186 const indexedVertex<Gt, Vb>& v1
187 );
188
189 //- Do the three given vertices constitute a boundary triangle
190 friend bool boundaryTriangle <Gt, Vb>
191 (
192 const indexedVertex<Gt, Vb>& v0,
193 const indexedVertex<Gt, Vb>& v1,
194 const indexedVertex<Gt, Vb>& v2
195 );
196
197 //- Do the three given vertices constitute an outside triangle
198 friend bool outsideTriangle <Gt, Vb>
199 (
200 const indexedVertex<Gt, Vb>& v0,
201 const indexedVertex<Gt, Vb>& v1,
202 const indexedVertex<Gt, Vb>& v2
203 );
204
205};
206
207
208// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209
210} // End namespace CGAL
211
212// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213
214#include "indexedVertexI.H"
215
216// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217
218#endif
219
220// ************************************************************************* //
An indexed form of CGAL::Triangulation_vertex_base_3<K> used to keep track of the Delaunay vertices i...
Definition: indexedVertex.H:88
vertexType & type()
bool mirrorPoint() const
Is point a mirror point.
bool ppSlave() const
Slave of a pointPair is the highest numbered one.
bool nearBoundary() const
Is point internal and near the boundary.
void setNearBoundary()
Set the point to be near the boundary.
bool farPoint() const
Is point a far-point.
indexedVertex(const Point &p)
bool internalOrBoundaryPoint() const
Either original internal point or master of pointPair.
Tds::Vertex_handle Vertex_handle
bool nearOrOnBoundary() const
Is point near the boundary or part of the boundary definition.
Foam::label & index()
bool ppMaster() const
Master of a pointPair is the lowest numbered one.
bool internalPoint() const
Is point internal, i.e. not on boundary.
Vb::Face_handle Face_handle
bool pairPoint() const
Either master or slave of pointPair.
Vb::Vertex_handle Vertex_handle
volScalarField & p
bool outsideTriangle(const indexedVertex< Gt, Vb > &v0, const indexedVertex< Gt, Vb > &v1, const indexedVertex< Gt, Vb > &v2)
bool pointPair(const indexedVertex< Gt, Vb > &v0, const indexedVertex< Gt, Vb > &v1)
bool boundaryTriangle(const indexedVertex< Gt, Vb > &v0, const indexedVertex< Gt, Vb > &v1, const indexedVertex< Gt, Vb > &v2)
labelList f(nPoints)
Vb::template Rebind_TDS< TDS2 >::Other Vb2
indexedVertex< Gt, Vb2 > Other