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 | Copyright (C) 2012-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 Class
25  CGAL::indexedVertex
26 
27 Description
28  An indexed form of CGAL::Triangulation_vertex_base_3<K> used to keep
29  track of the Delaunay vertices in the tessellation.
30 
31 SourceFiles
32  indexedVertexI.H
33  indexedVertex.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef indexedVertex_H
38 #define indexedVertex_H
39 
40 #include "CGAL/Triangulation_3.h"
42 #include "tensor.H"
43 #include "triad.H"
44 #include "InfoProxy.H"
45 #include "point.H"
46 #include "indexedVertexEnum.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace CGAL
51 {
52 template<class Gt, class Vb> class indexedVertex;
53 }
54 
55 namespace Foam
56 {
57 
58 class Ostream;
59 class Istream;
60 
61 template<class Gt, class Vb> Ostream& operator<<
62 (
63  Ostream&,
65 );
66 
67 template<class Gt, class Vb> Ostream& operator<<
68 (
69  Ostream&,
71 );
72 
73 template<class Gt, class Vb> Istream& operator>>
74 (
75  Istream&,
77 );
78 
79 inline Istream& operator>>
80 (
81  Istream& is,
82  CGAL::Point_3<baseK>& p
83 );
84 
85 inline Ostream& operator<<
86 (
87  Ostream& os,
88  const CGAL::Point_3<baseK>& p
89 );
90 
91 } // End namespace Foam
92 
93 
94 namespace CGAL
95 {
96 
97 /*---------------------------------------------------------------------------*\
98  Class indexedVertex Declaration
99 \*---------------------------------------------------------------------------*/
100 
101 template<class Gt, class Vb = CGAL::Triangulation_vertex_base_3<Gt> >
102 class indexedVertex
103 :
105  public Vb
106 {
107  // Private data
108 
109  //- Type of pair-point
110  vertexType type_;
111 
112  //- The index for this Delaunay vertex. For referred vertices, the
113  // index is negative for vertices that are the outer (slave) of point
114  // pairs
116 
117  //- Number of the processor that owns this vertex
118  int processor_;
119 
120  //- Required alignment of the dual cell of this vertex
122 
123  //- Target size of the dual cell of this vertex
124  Foam::scalar targetCellSize_;
125 
126  //- Specify whether the vertex is fixed or movable.
127  bool vertexFixed_;
128 
129 
130 public:
131 
132  typedef typename Vb::Triangulation_data_structure Tds;
133  typedef typename Vb::Point Point;
134  typedef typename Tds::Vertex_handle Vertex_handle;
135  typedef typename Tds::Cell_handle Cell_handle;
136 
137  template<typename TDS2>
138  struct Rebind_TDS
139  {
140  typedef typename Vb::template Rebind_TDS<TDS2>::Other Vb2;
142  };
143 
144  // Constructors
145 
146  inline indexedVertex();
147 
148  inline indexedVertex(const Point& p);
149 
150  inline indexedVertex(const Point& p, vertexType type);
151 
152  inline indexedVertex(const Foam::point& p, vertexType type);
153 
154  inline indexedVertex
155  (
156  const Point& p,
158  vertexType type,
159  int processor
160  );
161 
162  inline indexedVertex
163  (
164  const Foam::point& p,
166  vertexType type,
167  int processor
168  );
169 
170  inline indexedVertex(const Point& p, Cell_handle f);
171 
172  inline indexedVertex(Cell_handle f);
173 
174 
175  // Member Functions
176 
177  inline Foam::label& index();
178 
179  inline Foam::label index() const;
180 
181  inline vertexType& type();
182 
183  inline vertexType type() const;
184 
185  inline Foam::tensor& alignment();
186 
187  inline const Foam::tensor& alignment() const;
188 
189  inline Foam::scalar& targetCellSize();
190 
191  inline Foam::scalar targetCellSize() const;
192 
193  //- Is point a far-point
194  inline bool farPoint() const;
195 
196  //- Is point internal, i.e. not on boundary
197  inline bool internalPoint() const;
198 
199  //- Is this a referred vertex
200  inline bool referred() const;
201 
202  //- Is this a "real" point on this processor, i.e. is internal or part
203  // of the boundary description, and not a "far" or "referred" point
204  inline bool real() const;
205 
206  // For referred vertices, what is the original processor index
207  inline int procIndex() const;
208 
209  // For referred vertices, set the original processor index
210  inline int& procIndex();
211 
212  //- Set the point to be internal
213  inline void setInternal();
214 
215  //- Is point internal and near the boundary
216  inline bool nearBoundary() const;
217 
218  //- Set the point to be near the boundary
219  inline void setNearBoundary();
220 
221  //- Is point internal and near a proc boundary
222  inline bool nearProcBoundary() const;
223 
224  //- Set the point to be near a proc boundary
225  inline void setNearProcBoundary();
226 
227  //- Either master or slave of pointPair.
228  inline bool boundaryPoint() const;
229 
230  //- Either original internal point or master of pointPair.
231  inline bool internalOrBoundaryPoint() const;
232 
233  //- Is point near the boundary or part of the boundary definition
234  inline bool nearOrOnBoundary() const;
235 
236  //- Part of a feature point
237  inline bool featurePoint() const;
238 
239  //- Part of a feature edge
240  inline bool featureEdgePoint() const;
241 
242  //- Part of a surface point pair
243  inline bool surfacePoint() const;
244 
245  inline bool internalBoundaryPoint() const;
246  inline bool internalBaffleSurfacePoint() const;
247  inline bool internalBaffleEdgePoint() const;
248 
249  inline bool externalBoundaryPoint() const;
250  inline bool externalBaffleSurfacePoint() const;
251  inline bool externalBaffleEdgePoint() const;
252 
253  inline bool constrained() const;
254 
255  //- Is the vertex fixed or movable
256  inline bool fixed() const;
257 
258  //- Fix the vertex so that it can't be moved
259  inline bool& fixed();
260 
261  inline indexedVertex& operator=(const indexedVertex& rhs)
262  {
263  Vb::operator=(rhs);
264 
265  this->type_ = rhs.type();
266  this->index_ = rhs.index();
267  this->processor_ = rhs.procIndex();
268  this->alignment_ = rhs.alignment();
269  this->targetCellSize_ = rhs.targetCellSize();
270  this->vertexFixed_ = rhs.fixed();
271 
272  return *this;
273  }
274 
275  inline bool operator==(const indexedVertex& rhs) const
276  {
277  return
278  (
279  //this->point() == rhs.point()
280  this->type_ == rhs.type()
281  && this->index_ == rhs.index()
282  && this->processor_ == rhs.procIndex()
283  && this->vertexFixed_ == rhs.fixed()
284  );
285  }
286 
287  inline bool operator!=(const indexedVertex& rhs) const
288  {
289  return !(*this == rhs);
290  }
291 
292 
293  // Info
294 
295  //- Return info proxy.
296  // Used to print indexedVertex information to a stream
298  {
299  return *this;
300  }
301 
302  friend Foam::Ostream& Foam::operator<< <Gt, Vb>
303  (
304  Foam::Ostream&,
306  );
307 
308  friend Foam::Ostream& Foam::operator<< <Gt, Vb>
309  (
310  Foam::Ostream&,
311  const indexedVertex<Gt, Vb>&
312  );
313 
314  friend Foam::Istream& Foam::operator>> <Gt, Vb>
315  (
316  Foam::Istream&,
318  );
319 };
320 
321 
322 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
323 
324 } // End namespace CGAL
325 
326 // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
327 
328 #ifdef CGAL_INEXACT
329 namespace Foam
330 {
331  // For inexact representations where the storage type is a double, the data
332  // is contiguous. This may not be true for exact number types.
333  template<>
334  inline bool contiguous
335  <
337  <
338  K,
339  CGAL::Triangulation_vertex_base_3<K>
340  >
341  >()
342  {
343  return true;
344  }
345 
346 
347  template<>
349  {
350  return true;
351  }
352 
353 } // End namespace Foam
354 #endif
355 
356 
357 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
358 
359 #include "indexedVertexI.H"
360 
361 #ifdef NoRepository
362  #include "indexedVertex.C"
363 #endif
364 
365 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
366 
367 #endif
368 
369 // ************************************************************************* //
Foam::Tensor
Templated 3D tensor derived from VectorSpace adding construction from 9 components,...
Definition: complexI.H:224
CGAL::indexedVertex::alignment
Foam::tensor & alignment()
Definition: indexedVertexI.H:187
CGAL::indexedVertex::nearOrOnBoundary
bool nearOrOnBoundary() const
Is point near the boundary or part of the boundary definition.
CGAL::indexedVertex::setNearBoundary
void setNearBoundary()
Set the point to be near the boundary.
p
p
Definition: pEqn.H:62
Foam::InfoProxy
A helper class for outputting values to Ostream.
Definition: InfoProxy.H:45
CGAL::indexedVertex::type_
vertexType type_
Type of pair-point.
Definition: indexedVertex.H:109
CGAL::indexedVertex::Point
Vb::Point Point
Definition: indexedVertex.H:132
InfoProxy.H
point.H
CGAL::indexedVertex::type
vertexType & type()
CGAL::indexedVertex::featureEdgePoint
bool featureEdgePoint() const
Part of a feature edge.
Definition: indexedVertexI.H:356
CGAL::indexedVertex::targetCellSize_
Foam::scalar targetCellSize_
Target size of the dual cell of this vertex.
Definition: indexedVertex.H:123
triad.H
CGAL::indexedVertex::internalBoundaryPoint
bool internalBoundaryPoint() const
Definition: indexedVertexI.H:305
CGAL::indexedVertex::featurePoint
bool featurePoint() const
Part of a feature point.
Definition: indexedVertexI.H:349
CGAL::indexedVertex
An indexed form of CGAL::Triangulation_vertex_base_3<K> used to keep track of the Delaunay vertices i...
Definition: indexedVertex.H:51
CGAL::indexedVertex::Vertex_handle
Tds::Vertex_handle Vertex_handle
Definition: indexedVertex.H:133
CGAL
Definition: indexedCell.H:54
CGAL::indexedVertex::processor_
int processor_
Number of the processor that owns this vertex.
Definition: indexedVertex.H:117
CGAL::indexedVertex::indexedVertex
indexedVertex()
CGAL::indexedVertex::vertexFixed_
bool vertexFixed_
Specify whether the vertex is fixed or movable.
Definition: indexedVertex.H:126
CGAL::indexedVertex::internalBaffleEdgePoint
bool internalBaffleEdgePoint() const
Definition: indexedVertexI.H:317
tensor.H
CGAL::indexedVertex::setInternal
void setInternal()
Set the point to be internal.
Definition: indexedVertexI.H:263
K
CGAL::Exact_predicates_exact_constructions_kernel K
Definition: CGALTriangulation3DKernel.H:56
Foam::contiguous
bool contiguous()
contiguous
Definition: contiguous.H:54
CGAL::indexedVertex::alignment_
Foam::tensor alignment_
Required alignment of the dual cell of this vertex.
Definition: indexedVertex.H:120
indexedVertexEnum.H
CGAL::indexedVertex::farPoint
bool farPoint() const
Is point a far-point.
CGAL::indexedVertex::fixed
bool fixed() const
Is the vertex fixed or movable.
Definition: indexedVertexI.H:370
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
CGAL::indexedVertex::index
Foam::label & index()
CGAL::indexedVertex::nearProcBoundary
bool nearProcBoundary() const
Is point internal and near a proc boundary.
CGAL::indexedVertex::Rebind_TDS::Vb2
Vb::template Rebind_TDS< TDS2 >::Other Vb2
Definition: indexedVertex.H:139
Foam::indexedVertexEnum
Definition: indexedVertexEnum.H:45
CGAL::indexedVertex::surfacePoint
bool surfacePoint() const
Part of a surface point pair.
Definition: indexedVertexI.H:363
CGAL::indexedVertex::info
Foam::InfoProxy< indexedVertex< Gt, Vb > > info() const
Return info proxy.
Definition: indexedVertex.H:296
CGAL::indexedVertex::operator==
bool operator==(const indexedVertex &rhs) const
Definition: indexedVertex.H:274
CGAL::indexedVertex::targetCellSize
Foam::scalar & targetCellSize()
Definition: indexedVertexI.H:201
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
CGAL::indexedVertex::Tds
Vb::Triangulation_data_structure Tds
Definition: indexedVertex.H:131
CGAL::indexedVertex::externalBaffleEdgePoint
bool externalBaffleEdgePoint() const
Definition: indexedVertexI.H:335
CGAL::indexedVertex::nearBoundary
bool nearBoundary() const
Is point internal and near the boundary.
CGAL::indexedVertex::index_
Foam::label index_
The index for this Delaunay vertex. For referred vertices, the.
Definition: indexedVertex.H:114
CGAL::indexedVertex::internalBaffleSurfacePoint
bool internalBaffleSurfacePoint() const
Definition: indexedVertexI.H:311
CGAL::indexedVertex::referred
bool referred() const
Is this a referred vertex.
Definition: indexedVertexI.H:229
CGAL::indexedVertex::procIndex
int procIndex() const
Definition: indexedVertexI.H:249
indexedVertex.C
CGAL::indexedVertex::operator=
indexedVertex & operator=(const indexedVertex &rhs)
Definition: indexedVertex.H:260
f
labelList f(nPoints)
Foam::Vector< scalar >
CGAL::indexedVertex::Rebind_TDS
Definition: indexedVertex.H:137
CGAL::indexedVertex::internalPoint
bool internalPoint() const
Is point internal, i.e. not on boundary.
CGAL::indexedVertex::Cell_handle
Tds::Cell_handle Cell_handle
Definition: indexedVertex.H:134
indexedVertexI.H
CGAL::indexedVertex::externalBaffleSurfacePoint
bool externalBaffleSurfacePoint() const
Definition: indexedVertexI.H:329
CGAL::indexedVertex::internalOrBoundaryPoint
bool internalOrBoundaryPoint() const
Either original internal point or master of pointPair.
Point
CGAL::Point_3< K > Point
Definition: CGALIndexedPolyhedron.H:51
CGAL::indexedVertex::externalBoundaryPoint
bool externalBoundaryPoint() const
Definition: indexedVertexI.H:323
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
CGAL::indexedVertex::setNearProcBoundary
void setNearProcBoundary()
Set the point to be near a proc boundary.
CGAL::indexedVertex::boundaryPoint
bool boundaryPoint() const
Either master or slave of pointPair.
Definition: indexedVertexI.H:284
CGAL::indexedVertex::Rebind_TDS::Other
indexedVertex< Gt, Vb2 > Other
Definition: indexedVertex.H:140
CGAL::indexedVertex::constrained
bool constrained() const
Definition: indexedVertexI.H:342
CGALTriangulation3DKernel.H
CGAL::indexedVertex::real
bool real() const
Is this a "real" point on this processor, i.e. is internal or part.
Definition: indexedVertexI.H:242
CGAL::indexedVertex::operator!=
bool operator!=(const indexedVertex &rhs) const
Definition: indexedVertex.H:286