intersection.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) 2011-2015 OpenFOAM Foundation
9 Copyright (C) 2017 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::intersection
29
30Description
31 Foam::intersection
32
33SourceFiles
34 intersection.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef intersection_H
39#define intersection_H
40
41#include "scalar.H"
42#include "Enum.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49/*---------------------------------------------------------------------------*\
50 Class intersection Declaration
51\*---------------------------------------------------------------------------*/
53class intersection
54{
55private:
56
57 // Static data
58
59 //- Relative tolerance for point in a plane.
60 // The tolerance is relative to the object size.
61 // Used to determine if a half-ray from a point in plane of triangle
62 // intersects the triangle or not.
63 static scalar planarTol_;
64
65public:
67 enum direction
68 {
69 VECTOR,
71 };
73 enum algorithm
74 {
75 FULL_RAY, // Intersecting with full ray
76 HALF_RAY, // Intersecting with half ray
77 VISIBLE // Intersecting with the visible side
78 };
79
80 // Static Member Functions
81
82 //- Direction names
84
85 //- Projection algorithm names
87
88 //- Return planar tolerance
89 static scalar planarTol()
90 {
91 return planarTol_;
92 }
93
94 //- Set the planar tolerance, returning the previous value
95 static scalar setPlanarTol(const scalar t)
96 {
97 if (t < -VSMALL)
98 {
100 << abort(FatalError);
101 }
102
103 scalar oldTol = planarTol_;
104 planarTol_ = t;
105
106 return oldTol;
107 }
108};
109
110
111// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112
113} // End namespace Foam
114
115// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116
117#endif
118
119// ************************************************************************* //
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: Enum.H:61
Foam::intersection.
Definition: intersection.H:53
static const Enum< direction > directionNames_
Direction names.
Definition: intersection.H:82
static const Enum< algorithm > algorithmNames_
Projection algorithm names.
Definition: intersection.H:85
static scalar setPlanarTol(const scalar t)
Set the planar tolerance, returning the previous value.
Definition: intersection.H:94
static scalar planarTol()
Return planar tolerance.
Definition: intersection.H:88
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
Namespace for OpenFOAM.
errorManip< error > abort(error &err)
Definition: errorManip.H:144
error FatalError