STLpoint.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-2016 OpenFOAM Foundation
9  Copyright (C) 2016-2017 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::STLpoint
29 
30 Description
31  A vertex point or facet normal representation for STL files.
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef STLpoint_H
36 #define STLpoint_H
37 
38 #include "point.H"
39 #include "floatVector.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class STLpoint Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 class STLpoint
51 :
52  public floatVector
53 {
54 
55 public:
56 
57  // Constructors
58 
59  //- Construct null
60  inline STLpoint()
61  {}
62 
63  //- Construct from single-precision point
64  inline STLpoint(const Vector<float>& p)
65  :
66  floatVector(p)
67  {}
68 
69  //- Construct from double-precision point
70  inline STLpoint(const Vector<double>& p)
71  :
72  floatVector(float(p.x()), float(p.y()), float(p.z()))
73  {}
74 
75  //- Construct from single-precision components
76  inline STLpoint(float x, float y, float z)
77  :
78  floatVector(x, y, z)
79  {}
80 
81  //- Construct from double-precision components
82  inline STLpoint(double x, double y, double z)
83  :
84  floatVector(float(x), float(y), float(z))
85  {}
86 
87 
88  // Member Operators
89 
90  #ifdef WM_DP
91  //- Conversion to double-precision point
92  inline operator point() const
93  {
94  return point(x(), y(), z());
95  }
96  #endif
97 };
98 
99 
100 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
101 
102 } // End namespace Foam
103 
104 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
105 
106 #endif
107 
108 // ************************************************************************* //
floatVector.H
Foam::Vector::x
const Cmpt & x() const
Access to the vector x component.
Definition: VectorI.H:73
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::STLpoint::STLpoint
STLpoint(float x, float y, float z)
Construct from single-precision components.
Definition: STLpoint.H:75
point.H
Foam::Vector::z
const Cmpt & z() const
Access to the vector z component.
Definition: VectorI.H:85
Foam::STLpoint::STLpoint
STLpoint(const Vector< double > &p)
Construct from double-precision point.
Definition: STLpoint.H:69
Foam::STLpoint::STLpoint
STLpoint(double x, double y, double z)
Construct from double-precision components.
Definition: STLpoint.H:81
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::STLpoint::STLpoint
STLpoint(const Vector< float > &p)
Construct from single-precision point.
Definition: STLpoint.H:63
Foam::Vector::y
const Cmpt & y() const
Access to the vector y component.
Definition: VectorI.H:79
Foam::STLpoint
A vertex point or facet normal representation for STL files.
Definition: STLpoint.H:49
Foam::Vector
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Definition: Vector.H:62
Foam::STLpoint::STLpoint
STLpoint()
Construct null.
Definition: STLpoint.H:59
Foam::point
vector point
Point is a vector.
Definition: point.H:43