xc
Tetrahedron3d.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // xc utils library; general purpose classes and functions.
4 //
5 // Copyright (C) Luis C. Pérez Tato
6 //
7 // XC utils is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // This software is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program.
19 // If not, see <http://www.gnu.org/licenses/>.
20 //----------------------------------------------------------------------------
21 //TETRAHEDRON3D.h
22 
23 #ifndef TETRAHEDRON3D_H
24 #define TETRAHEDRON3D_H
25 
26 #include <iostream>
27 #include "PolyhedronBase.h"
28 #include "PolygonMap.h"
29 
30 class HalfSpace3d;
31 class Polyhedron3d;
32 
34 //
37  {
38  CGTetrahedron_3 cgtetrahedron;
39  public:
40  Tetrahedron3d(void);
41  Tetrahedron3d(const Pos3d &p0, const Pos3d &p1,const Pos3d &p2, const Pos3d &p3);
42  Tetrahedron3d(const HalfSpace3d &, const HalfSpace3d &,const HalfSpace3d &, const HalfSpace3d &);
43  GeomObj *getCopy(void) const
44  { return new Tetrahedron3d(*this); }
45  Polyhedron3d getPolyhedron3d(void) const;
46  GEOM_FT getArea(void) const;
47  GEOM_FT getVolumeWithSign(void) const;
48  GEOM_FT getVolume(void) const;
49  double GetMax(short unsigned int i) const;
50  double GetMin(short unsigned int i) const;
51  bool In(const Pos3d &,const double &) const;
52  void Print(std::ostream &os) const;
53  };
54 
55 PolygonMap<CGPolyhedron_3> getPolygonMap(const Tetrahedron3d &t);
56 
57 #endif
Tetrahedron.
Definition: Tetrahedron3d.h:36
void Print(std::ostream &os) const
Prints object.
Definition: Tetrahedron3d.cc:106
Definition: PolygonMap.h:115
GEOM_FT getVolumeWithSign(void) const
Return the volume of the body with sign.
Definition: Tetrahedron3d.cc:89
Base class for polyhedrons in a three-dimensional space.
Definition: Polyhedron3d.h:41
GEOM_FT getVolume(void) const
Return the volume of the object.
Definition: Tetrahedron3d.cc:95
Base class for the polyhedrons.
Definition: PolyhedronBase.h:35
bool In(const Pos3d &, const double &) const
Returns true if point inside tetrahedron.
Definition: Tetrahedron3d.cc:99
Tetrahedron3d(void)
Default constructor.
Definition: Tetrahedron3d.cc:39
Posición en tres dimensiones.
Definition: Pos3d.h:44
GEOM_FT getArea(void) const
Return the object area.
Definition: Tetrahedron3d.cc:85
The points of the half space are those that line at the back of the plane, this being understood as t...
Definition: HalfSpace3d.h:42
Clase base para las entidades geométricas.
Definition: GeomObj.h:40