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) 2013-2016 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_2<K> used to keep
29  track of the vertices in the triangulation.
30 
31 \*---------------------------------------------------------------------------*/
32 
33 #ifndef indexedVertex_H
34 #define indexedVertex_H
35 
36 #include "CGAL/Triangulation_2.h"
37 
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 
40 namespace CGAL
41 {
42 
43 // Forward declaration of friend functions and operators
44 
45 template<class Gt, class Vb>
46 class indexedVertex;
47 
48 template<class Gt, class Vb>
49 bool pointPair
50 (
51  const indexedVertex<Gt, Vb>& v0,
52  const indexedVertex<Gt, Vb>& v1
53 );
54 
55 template<class Gt, class Vb>
57 (
58  const indexedVertex<Gt, Vb>& v0,
59  const indexedVertex<Gt, Vb>& v1,
60  const indexedVertex<Gt, Vb>& v2
61 );
62 
63 template<class Gt, class Vb>
64 bool outsideTriangle
65 (
66  const indexedVertex<Gt, Vb>& v0,
67  const indexedVertex<Gt, Vb>& v1,
68  const indexedVertex<Gt, Vb>& v2
69 );
70 
71 /*---------------------------------------------------------------------------*\
72  Class indexedVertex Declaration
73 \*---------------------------------------------------------------------------*/
74 
75 template<class Gt, class Vb=CGAL::Triangulation_vertex_base_2<Gt>>
76 class indexedVertex
77 :
78  public Vb
79 {
80  // Private data
81 
82  //- The index for this triangle vertex
83  int index_;
84 
85  //- Index of pair-point :
86  // NEAR_BOUNDARY_POINT : internal near boundary point.
87  // INTERNAL_POINT : internal point.
88  // FAR_POINT : far-point.
89  // >= 0 : part of point-pair. Index of other point.
90  // Lowest numbered is inside one (master).
91  int type_;
92 
93 
94 public:
95 
96  enum pointTypes
97  {
101  FAR_POINT = -1
102  };
105  typedef typename Vb::Face_handle Face_handle;
106  typedef typename Vb::Point Point;
107 
108  template<class TDS2>
109  struct Rebind_TDS
110  {
111  typedef typename Vb::template Rebind_TDS<TDS2>::Other Vb2;
113  };
114 
115 
116  // Constructors
117 
118  inline indexedVertex();
119 
120  inline indexedVertex(const Point& p);
121 
122  inline indexedVertex(const Point& p, const int index, const int& type);
123 
124  inline indexedVertex(const Point& p, Face_handle f);
125 
126  inline indexedVertex(Face_handle f);
127 
128 
129  // Member Functions
130 
131  inline int& index();
132 
133  inline int index() const;
134 
135  inline int& type();
136 
137  inline int type() const;
138 
139  //- Is point a far-point
140  inline bool farPoint() const;
141 
142  //- Is point internal, i.e. not on boundary
143  inline bool internalPoint() const;
144 
145  //- Is point internal and near the boundary
146  inline bool nearBoundary() const;
147 
148  //- Set the point to be near the boundary
149  inline void setNearBoundary();
150 
151  //- Is point a mirror point
152  inline bool mirrorPoint() const;
153 
154  //- Either master or slave of pointPair.
155  inline bool pairPoint() const;
156 
157  //- Master of a pointPair is the lowest numbered one.
158  inline bool ppMaster() const;
159 
160  //- Slave of a pointPair is the highest numbered one.
161  inline bool ppSlave() const;
162 
163  //- Either original internal point or master of pointPair.
164  inline bool internalOrBoundaryPoint() const;
165 
166  //- Is point near the boundary or part of the boundary definition
167  inline bool nearOrOnBoundary() const;
168 
169 
170  // Friend Functions
171 
172  //- Do the two given vertices consitute a boundary point-pair
173  friend bool pointPair <Gt, Vb>
174  (
175  const indexedVertex<Gt, Vb>& v0,
176  const indexedVertex<Gt, Vb>& v1
177  );
178 
179  //- Do the three given vertices consitute a boundary triangle
180  friend bool boundaryTriangle <Gt, Vb>
181  (
182  const indexedVertex<Gt, Vb>& v0,
183  const indexedVertex<Gt, Vb>& v1,
184  const indexedVertex<Gt, Vb>& v2
185  );
186 
187  //- Do the three given vertices consitute an outside triangle
188  friend bool outsideTriangle <Gt, Vb>
189  (
190  const indexedVertex<Gt, Vb>& v0,
191  const indexedVertex<Gt, Vb>& v1,
192  const indexedVertex<Gt, Vb>& v2
193  );
194 
195 };
196 
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 } // End namespace CGAL
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #include "indexedVertexI.H"
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 #endif
209 
210 // ************************************************************************* //
void setNearBoundary()
Set the point to be near the boundary.
bool farPoint() const
Is point a far-point.
bool pairPoint() const
Either master or slave of pointPair.
bool ppMaster() const
Master of a pointPair is the lowest numbered one.
vertexType & type()
bool internalPoint() const
Is point internal, i.e. not on boundary.
Foam::label & index()
bool pointPair(const indexedVertex< Gt, Vb > &v0, const indexedVertex< Gt, Vb > &v1)
bool ppSlave() const
Slave of a pointPair is the highest numbered one.
Vb::Face_handle Face_handle
bool nearOrOnBoundary() const
Is point near the boundary or part of the boundary definition.
An indexed form of CGAL::Triangulation_vertex_base_3<K> used to keep track of the Delaunay vertices i...
Definition: indexedVertex.H:51
bool mirrorPoint() const
Is point a mirror point.
bool boundaryTriangle(const indexedVertex< Gt, Vb > &v0, const indexedVertex< Gt, Vb > &v1, const indexedVertex< Gt, Vb > &v2)
labelList f(nPoints)
Tds::Vertex_handle Vertex_handle
indexedVertex< Gt, Vb2 > Other
volScalarField & p
bool internalOrBoundaryPoint() const
Either original internal point or master of pointPair.
Vb::template Rebind_TDS< TDS2 >::Other Vb2
bool outsideTriangle(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.