STLpoint.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM 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 OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::STLpoint
26 
27 Description
28  A vertex point representation for STL files.
29 
30 SourceFiles
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef STLpoint_H
35 #define STLpoint_H
36 
37 #include "point.H"
38 #include "Istream.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class STLpoint Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 class STLpoint
50 :
51  public Vector<float>
52 {
53 
54 public:
55 
56  // Constructors
57 
58  //- Construct null
59  inline STLpoint()
60  {}
61 
62  //- Construct from components
63  inline STLpoint(float x, float y, float z)
64  :
65  Vector<float>(x, y, z)
66  {}
67 
68  //- Construct from point
69  inline STLpoint(const point& pt)
70  :
71  Vector<float>(float(pt.x()), float(pt.y()), float(pt.z()))
72  {}
73 
74  //- Construct from istream
75  inline STLpoint(Istream& is)
76  :
77  Vector<float>(is)
78  {}
79 
80 
81  // Member Operators
82 
83  #if defined(WM_DP) || defined(WM_LP)
84  //- Conversion to double-precision point
85  inline operator point() const
86  {
87  return point(x(), y(), z());
88  }
89  #endif
90 };
91 
92 
93 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
94 
95 } // End namespace Foam
96 
97 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
98 
99 #endif
100 
101 // ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
const float & z() const
Definition: VectorI.H:87
const float & y() const
Definition: VectorI.H:81
STLpoint()
Construct null.
Definition: STLpoint.H:58
const float & x() const
Definition: VectorI.H:75
Templated 3D Vector derived from VectorSpace adding construction from 3 components, element access using x(), y() and z() member functions and the inner-product (dot-product) and cross product operators.
Definition: Vector.H:57
vector point
Point is a vector.
Definition: point.H:41
A vertex point representation for STL files.
Definition: STLpoint.H:48
Namespace for OpenFOAM.