indexedVertexI.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 | Copyright (C) 2013-2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
27 
28 template<class Gt, class Vb>
30 :
31  Vb(),
32  index_(INTERNAL_POINT),
33  type_(INTERNAL_POINT)
34 {}
35 
36 
37 template<class Gt, class Vb>
38 inline CGAL::indexedVertex<Gt, Vb>::indexedVertex(const Point& p)
39 :
40  Vb(p),
41  index_(INTERNAL_POINT),
42  type_(INTERNAL_POINT)
43 {}
44 
45 
46 template<class Gt, class Vb>
48 (
49  const Point& p,
50  const int index,
51  const int& type
52 )
53 :
54  Vb(p),
55  index_(index),
56  type_(type)
57 {}
58 
59 
60 template<class Gt, class Vb>
62 :
63  Vb(f, p),
64  index_(INTERNAL_POINT),
65  type_(INTERNAL_POINT)
66 {}
67 
68 
69 template<class Gt, class Vb>
71 :
72  Vb(f),
73  index_(INTERNAL_POINT),
74  type_(INTERNAL_POINT)
75 {}
76 
77 
78 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
79 
80 template<class Gt, class Vb>
82 {
83  return index_;
84 }
85 
86 
87 template<class Gt, class Vb>
88 inline int CGAL::indexedVertex<Gt, Vb>::index() const
89 {
90  return index_;
91 }
92 
93 
94 template<class Gt, class Vb>
96 {
97  return type_;
98 }
99 
100 
101 template<class Gt, class Vb>
102 inline int CGAL::indexedVertex<Gt, Vb>::type() const
103 {
104  return type_;
105 }
106 
107 
108 template<class Gt, class Vb>
109 inline bool CGAL::indexedVertex<Gt, Vb>::farPoint() const
110 {
111  return type_ == FAR_POINT;
112 }
113 
114 
115 template<class Gt, class Vb>
117 {
118  return type_ <= INTERNAL_POINT;
119 }
120 
121 
122 template<class Gt, class Vb>
124 {
125  return type_ == NEAR_BOUNDARY_POINT;
126 }
127 
128 
129 template<class Gt, class Vb>
131 {
132  type_ = NEAR_BOUNDARY_POINT;
133 }
134 
135 
136 template<class Gt, class Vb>
138 {
139  return type_ == MIRROR_POINT;
140 }
141 
142 
143 template<class Gt, class Vb>
145 {
146  return type_ >= 0;
147 }
148 
149 
150 template<class Gt, class Vb>
152 {
153  if (type_ > index_)
154  {
155  return true;
156  }
157  else
158  {
159  return false;
160  }
161 }
162 
163 
164 template<class Gt, class Vb>
166 {
167  if (type_ >= 0 && type_ < index_)
168  {
169  return true;
170  }
171  else
172  {
173  return false;
174  }
175 }
176 
177 
178 template<class Gt, class Vb>
180 {
181  return internalPoint() || ppMaster();
182 }
183 
184 
185 template<class Gt, class Vb>
187 {
188  return pairPoint() || mirrorPoint() || nearBoundary();
189 }
190 
191 
192 // * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
193 
194 template<class Gt, class Vb>
195 bool CGAL::pointPair
196 (
197  const indexedVertex<Gt, Vb>& v0,
198  const indexedVertex<Gt, Vb>& v1
199 )
200 {
201  return v0.index_ == v1.type_ || v1.index_ == v0.type_;
202 }
203 
204 
205 template<class Gt, class Vb>
207 (
208  const indexedVertex<Gt, Vb>& v0,
209  const indexedVertex<Gt, Vb>& v1,
210  const indexedVertex<Gt, Vb>& v2
211 )
212 {
213  return (v0.pairPoint() && pointPair(v1, v2))
214  || (v1.pairPoint() && pointPair(v2, v0))
215  || (v2.pairPoint() && pointPair(v0, v1));
216 }
217 
218 
219 template<class Gt, class Vb>
221 (
222  const indexedVertex<Gt, Vb>& v0,
223  const indexedVertex<Gt, Vb>& v1,
224  const indexedVertex<Gt, Vb>& v2
225 )
226 {
227  return (v0.farPoint() || v0.ppSlave())
228  || (v1.farPoint() || v1.ppSlave())
229  || (v2.farPoint() || v2.ppSlave());
230 }
231 
232 
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void setNearBoundary()
Set the point to be near the boundary.
bool mirrorPoint() const
Is point a mirror point.
bool ppMaster() const
Master of a pointPair is the lowest numbered one.
vertexType & type()
Foam::label & index()
bool pointPair(const indexedVertex< Gt, Vb > &v0, const indexedVertex< Gt, Vb > &v1)
Vb::Face_handle Face_handle
An indexed form of CGAL::Triangulation_vertex_base_3<K> used to keep track of the Delaunay vertices i...
Definition: indexedVertex.H:51
bool nearOrOnBoundary() const
Is point near the boundary or part of the boundary definition.
CGAL::indexedVertex< K > Vb
friend bool pointPair(const indexedVertex< Gt, Vb > &v0, const indexedVertex< Gt, Vb > &v1)
Do the two given vertices consitute a boundary point-pair.
bool internalPoint() const
Is point internal, i.e. not on boundary.
bool boundaryTriangle(const indexedVertex< Gt, Vb > &v0, const indexedVertex< Gt, Vb > &v1, const indexedVertex< Gt, Vb > &v2)
bool nearBoundary() const
Is point internal and near the boundary.
bool farPoint() const
Is point a far-point.
bool internalOrBoundaryPoint() const
Either original internal point or master of pointPair.
labelList f(nPoints)
bool pairPoint() const
Either master or slave of pointPair.
bool ppSlave() const
Slave of a pointPair is the highest numbered one.
bool outsideTriangle(const indexedVertex< Gt, Vb > &v0, const indexedVertex< Gt, Vb > &v1, const indexedVertex< Gt, Vb > &v2)