faceDecomposition.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | cfMesh: A library for mesh generation
4  \\ / O peration |
5  \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6  \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of cfMesh.
10 
11  cfMesh is free software; you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by the
13  Free Software Foundation; either version 3 of the License, or (at your
14  option) any later version.
15 
16  cfMesh 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 cfMesh. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  faceDecomposition
26 
27 Description
28  Decomposition of a face into triangles
29 
30 SourceFiles
31  faceDecomposition.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef faceDecomposition_H
36 #define faceDecomposition_H
37 
38 #include "faceList.H"
39 #include "pointField.H"
40 
41 namespace Foam
42 {
43 
44 /*---------------------------------------------------------------------------*\
45  Class faceDecomposition Declaration
46 \*---------------------------------------------------------------------------*/
47 
49 {
50  // private data
51  const face& f_;
52 
53  const pointField& points_;
54 
55  // private member functions
56  //- find concave vertex and return its position
57  //- in the face
58  label concaveVertex() const;
59 
60  //- decomposes the face into triangle starting from
61  //- the given vertex
63 
64  //- disallows bitwise construct
65  void operator=(const faceDecomposition&);
66 
67  //- copy constructor
69 
70 public:
71 
72  // Constructors
73 
74  //- construct components
76  (
77  const face&,
78  const pointField&
79  );
80 
81  //- Destructor
83 
84  // Member functions
85  //- check if the face is convex
86  bool isFaceConvex() const;
87 
88  //- check if the face is planar
89  bool isFacePlanar() const;
90  bool isFacePlanar(const scalar tol) const;
91 
92  //- decompose face into triangles
94 
95  //- decompose face into the minimal number
96  //- of convex faces
97  faceList decomposeFace() const;
98 };
99 
100 
101 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
102 
103 } // End namespace Foam
104 
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
107 #endif
108 
109 // ************************************************************************* //
Foam::faceDecomposition::isFacePlanar
bool isFacePlanar() const
check if the face is planar
Definition: faceDecomposition.C:130
Foam::faceDecomposition::~faceDecomposition
~faceDecomposition()
Destructor.
Definition: faceDecomposition.C:99
Foam::faceDecomposition::decomposeFaceIntoTriangles
faceList decomposeFaceIntoTriangles() const
decompose face into triangles
Definition: faceDecomposition.C:278
Foam::faceDecomposition::isFaceConvex
bool isFaceConvex() const
check if the face is convex
Definition: faceDecomposition.C:103
faceList.H
Foam::faceDecomposition::operator=
void operator=(const faceDecomposition &)
disallows bitwise construct
Foam::faceDecomposition::decomposeFace
faceList decomposeFace() const
Definition: faceDecomposition.C:143
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::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::faceDecomposition::faceDecomposition
faceDecomposition(const faceDecomposition &)
copy constructor
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
pointField.H
Foam::faceDecomposition::concaveVertex
label concaveVertex() const
Definition: faceDecomposition.C:40
Foam::faceDecomposition
Definition: faceDecomposition.H:47
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::faceDecomposition::points_
const pointField & points_
Definition: faceDecomposition.H:52
Foam::faceDecomposition::f_
const face & f_
Definition: faceDecomposition.H:50
Foam::face
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:75