triPoints.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 | Copyright (C) 2015 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::triPoints
26 
27 Description
28  Triangle storage. Null constructable (unfortunately triangle<point, point>
29  is not)
30 
31 SourceFiles
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef triPoints_H
36 #define triPoints_H
37 
38 #include "FixedList.H"
39 #include "treeBoundBox.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class triPoints Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 class triPoints
51 :
52  public FixedList<point, 3>
53 {
54 public:
55 
56  // Constructors
57 
58  //- Construct null
59  inline triPoints()
60  {}
61 
62  //- Construct from points
63  inline triPoints
64  (
65  const point& a,
66  const point& b,
67  const point& c
68  )
69  {
70  operator[](0) = a;
71  operator[](1) = b;
72  operator[](2) = c;
73  }
74 
75 
76  // Member Functions
77 
78  //- Calculate the bounding box
79  inline treeBoundBox bounds() const
80  {
81  treeBoundBox bb(operator[](0), operator[](0));
82  for (label i = 1; i < size(); i++)
83  {
84  bb.min() = min(bb.min(), operator[](i));
85  bb.max() = max(bb.max(), operator[](i));
86  }
87  return bb;
88  }
89 };
90 
91 
92 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
93 
94 } // End namespace Foam
95 
96 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
97 
98 #endif
99 
100 // ************************************************************************* //
Foam::boundBox::max
const point & max() const
Maximum describing the bounding box.
Definition: boundBoxI.H:60
Foam::treeBoundBox
Standard boundBox + extra functionality for use in octree.
Definition: treeBoundBox.H:75
Foam::FixedList< point, 3 >::operator[]
T & operator[](const label)
Return element of FixedList.
Foam::triPoints::bounds
treeBoundBox bounds() const
Calculate the bounding box.
Definition: triPoints.H:78
Foam::triPoints
Triangle storage. Null constructable (unfortunately triangle<point, point> is not)
Definition: triPoints.H:49
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::constant::physicoChemical::b
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:28
treeBoundBox.H
Foam::boundBox::min
const point & min() const
Minimum describing the bounding box.
Definition: boundBoxI.H:54
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::triPoints::triPoints
triPoints()
Construct null.
Definition: triPoints.H:58
Foam::max
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
Foam::Vector< scalar >
Foam::FixedList< point, 3 >::size
label size() const
Return the number of elements in the FixedList.
Definition: FixedListI.H:408
Foam::FixedList
A 1D vector of objects of type <T> with a fixed size <Size>.
Definition: FixedList.H:53
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
FixedList.H
Foam::min
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)