xc
Surface3d.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 //Surface3d.h
22 
23 #ifndef SURFACE3D_H
24 #define SURFACE3D_H
25 
26 #include "../d3/GeomObj3d.h"
27 
28 
29 class Pos3d;
30 
31 
33 //
35 class Surface3d : public GeomObj3d
36  {
37  public:
38  Surface3d(void): GeomObj3d(){}
39 
41  inline virtual unsigned short int Dimension(void) const
42  { return 2; }
44  virtual GEOM_FT getLength(void) const
45  { return 0.0; }
46  GEOM_FT getPerimeter(void) const
47  { return getLength(); }
48  virtual GEOM_FT getArea(void) const;
50  virtual GEOM_FT getVolume(void) const
51  { return 0.0; }
52  virtual inline GEOM_FT IArea(void) const
53  { return getArea(); }
54  virtual GEOM_FT dist(const Pos3d &p) const;
55  virtual GEOM_FT dist2(const Pos3d &p) const;
56  };
57 #endif
58 
59 
60 
Base class for surfaces in a three-dimensional space.
Definition: Surface3d.h:35
virtual unsigned short int Dimension(void) const
Return the dimension of the object 0, 1, 2 or 3.
Definition: Surface3d.h:41
virtual GEOM_FT getVolume(void) const
Return the volume of the object.
Definition: Surface3d.h:50
virtual GEOM_FT dist(const Pos3d &p) const
Return the distance from the point to this surface.
Definition: Surface3d.cc:33
Posición en tres dimensiones.
Definition: Pos3d.h:44
virtual GEOM_FT getArea(void) const
Return the object area.
Definition: Surface3d.cc:29
virtual GEOM_FT getLength(void) const
Return the length of the object.
Definition: Surface3d.h:44
virtual GEOM_FT dist2(const Pos3d &p) const
Return the squared distance from the point to this surface.
Definition: Surface3d.cc:41
Clase base para los objetos en tres dimensiones.
Definition: GeomObj3d.h:43