xc
RightPrism3d.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 //RightPrism3d.h
22 
23 #ifndef RIGHTPRISM3D_H
24 #define RIGHTPRISM3D_H
25 
26 #include "Prism3d.h"
27 #include "../SolidExtruPolygon3d.h"
28 #include "utility/geom/pos_vec/Pos3d.h"
29 
30 
32 //
34 template<class PG>
35 class RightPrism3d : public Prism3d
36  {
38  protected:
39  inline unsigned int get_num_vertices_plgno(void) const
40  { return extru.getNumVertices(); }
41  public:
42  RightPrism3d(void) {}
43  RightPrism3d(const PG &secc,const GEOM_FT &lng): Prism3d(), extru(secc,lng) {}
44  inline virtual GeomObj *getCopy(void) const
45  { return new RightPrism3d<PG>(*this); }
46  inline void self_offset(const GEOM_FT &offset)
47  { extru.self_offset(offset); }
48  inline RightPrism3d<PG> offset(const GEOM_FT &offset) const
49  {
50  RightPrism3d<PG> retval(*this);
51  retval.self_offset(offset);
52  return retval;
53  }
54 /* inline virtual Polyhedron::v_ind_vertices IndVerticesFaceta(unsigned int faceta) const */
55 /* { return extru.IndVerticesFaceta(faceta); } */
56  const PG &Section(void) const
57  { return extru.Section(); }
58  PG &Section(void)
59  { return extru.Section(); }
61  inline GEOM_FT getLength(void) const
62  { return extru.getLength(); }
64  inline GEOM_FT getArea(void) const
65  { return extru.getArea(); }
67  inline GEOM_FT getVolume(void) const
68  { return extru.getVolume(); }
69  inline virtual GEOM_FT Ix(void) const
70  { return extru.Ix(); }
71  inline virtual GEOM_FT Iy(void) const
72  { return extru.Iy(); }
73  inline virtual GEOM_FT Iz(void) const
74  { return extru.Iz(); }
76  inline virtual GEOM_FT GetMax(unsigned short int i) const
77  { return extru.GetMax(i); }
79  inline virtual GEOM_FT GetMin(unsigned short int i) const
80  { return extru.GetMin(i); }
81  inline virtual unsigned int getNumVertices(void) const
82  { return extru.getNumVertices(); }
83  inline virtual unsigned int getNumVerticesFaceta(unsigned int faceta) const
84  { return extru.getNumVerticesFaceta(faceta); }
85  inline virtual unsigned int getNumEdges(void) const
86  { return extru.getNumEdges(); }
87  inline virtual unsigned int GetNumFacetas(void) const
88  { return extru.GetNumFacetas(); }
89  inline Pos3d Vertice(unsigned int i) const
90  { return extru.Vertice(i); }
91 /* virtual v_ind_vertices IndVerticesArista(unsigned int arista) const */
92 /* { return extru.IndVerticesArista(arista); } */
93  BND3d Bnd(void) const
94  //Return la extension del objeto.
95  { return extru.Bnd(); }
96  inline FT_matrix I(void) const
97  { return extru.I(); }
98  inline Pos3d getCenterOfMass(void) const
99  { return extru.getCenterOfMass(); }
100  inline Pos3d getCenterOfMassOfTop(void) const
101  { return extru.getCenterOfMassOfTop(); }
102  inline Pos3d getCenterOfMassOfBottom(void) const
103  { return extru.getCenterOfMassOfBottom(); }
104  inline Pos3d getCenterOfMassOfFacet(unsigned int faceta) const
105  { return this->Faceta(faceta).getCenterOfMass(); }
106 
107  };
108 
109 #endif
void self_offset(const GEOM_FT &offset)
offset this object.
Definition: SolidExtru3d.h:58
Sólido de extrusión generado por un polígono.
Definition: SolidExtruPolygon3d.h:32
virtual GEOM_FT GetMin(unsigned short int i) const
Return the minimum value of the i-th coordinate.
Definition: RightPrism3d.h:79
virtual GEOM_FT GetMax(unsigned short int i) const
Return the maximum value of the i-th coordinate.
Definition: SolidExtru3d.h:119
virtual GEOM_FT GetMin(unsigned short int i) const
Return the minimum value of the i-th coordinate.
Definition: SolidExtru3d.h:127
GEOM_FT getArea(void) const
Return the object area.
Definition: RightPrism3d.h:64
Base class for prims in a three-dimensional space.
Definition: Prism3d.h:32
GEOM_FT getLength(void) const
Return object length.
Definition: SolidExtru3d.h:84
Right prism.
Definition: RightPrism3d.h:35
const PG & Section(void) const
Return the extruded section.
Definition: SolidExtru3d.h:71
"boundary" en tres dimensiones.
Definition: BND3d.h:34
GEOM_FT getLength(void) const
Return the object length.
Definition: RightPrism3d.h:61
GEOM_FT getArea(void) const
Return the object area.
Definition: SolidExtru3d.h:77
GEOM_FT getVolume(void) const
Return the object volume.
Definition: RightPrism3d.h:67
Posición en tres dimensiones.
Definition: Pos3d.h:44
GEOM_FT getVolume(void) const
Return the object volume.
Definition: SolidExtru3d.h:87
Clase base para las entidades geométricas.
Definition: GeomObj.h:40
Matrix which components are GEOM_FT numbers.
Definition: FT_matrix.h:40
virtual GEOM_FT GetMax(unsigned short int i) const
Return the maximum value of the i-th coordinate.
Definition: RightPrism3d.h:76