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