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