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