xc
BlockPyramid.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 //BLOCKPYRAMID.h
22 
23 #ifndef BLOCKPYRAMID_H
24 #define BLOCKPYRAMID_H
25 
26 #include <iostream>
27 #include "../GeomObj3d.h"
28 #include "utility/geom/pos_vec/Pos3d.h"
29 #include "utility/geom/d3/HalfSpace3d.h"
30 #include "utility/matrices/m_double.h"
31 
32 
34 //
36 class BlockPyramid: public GeomObj3d
37  {
38  protected:
39  std::deque<HalfSpace3d> half_spaces;
40 
41  std::deque<Vector3d> haz_vectores(void) const;
42  static bool es_interior(const HalfSpace3d &,const Vector3d &);
43  bool es_interior(const Vector3d &) const;
44  std::deque<Vector3d> haz_vectores_interiores(void) const;
45  public:
46  BlockPyramid(void);
47  explicit BlockPyramid(const std::deque<HalfSpace3d> &);
48  virtual GeomObj *getCopy(void) const
49  { return new BlockPyramid(*this); }
50  inline unsigned short int Dimension(void) const
51  { return 3; }
52  GEOM_FT getLength(void) const;
53  GEOM_FT getArea(void) const;
54  GEOM_FT getVolume(void) const;
55  GEOM_FT Ix(void) const;
56  GEOM_FT Iy(void) const;
57  GEOM_FT Iz(void) const;
58  Pos3d getCenterOfMass(void) const;
59  GEOM_FT GetMax(unsigned short int i) const;
60  GEOM_FT GetMin(unsigned short int i) const;
61  m_double getVectoresBorde(void) const;
62  Vector2d getVectorExterno1(const Ref2d3d &) const;
63  Vector2d getVectorExterno2(const Ref2d3d &) const;
64  std::deque<Vector2d> getVectoresExternos(const Ref2d3d &) const;
65  bool Vacio(void) const;
66  void Print(std::ostream &os) const;
67  };
68 
69 #endif
bool Vacio(void) const
Return true if has no borders.
Definition: BlockPyramid.cc:248
Pos3d getCenterOfMass(void) const
Return the position of the center of mass.
Definition: BlockPyramid.cc:142
std::deque< Vector3d > haz_vectores_interiores(void) const
From the haz de vectors that results from intersecting the half spaces 2 by 2, return those thar are ...
Definition: BlockPyramid.cc:75
GEOM_FT GetMax(unsigned short int i) const
Return the maximum value of the i-th coordinate.
Definition: BlockPyramid.cc:149
std::deque< Vector2d > getVectoresExternos(const Ref2d3d &) const
Return the pairs of external vectors of the projected pyramid.
Definition: BlockPyramid.cc:234
GEOM_FT Iy(void) const
Return the moment of inertia with respect to the y axis.
Definition: BlockPyramid.cc:126
Polyhedral angle.
Definition: BlockPyramid.h:36
unsigned short int Dimension(void) const
Return the dimension of the object 0, 1, 2 or 3.
Definition: BlockPyramid.h:50
std::deque< Vector3d > haz_vectores(void) const
Return el haz de vectors that results from intersecting the half spaces 2 by 2.
Definition: BlockPyramid.cc:33
Vector en dos dimensiones.
Definition: Vector2d.h:40
static bool es_interior(const HalfSpace3d &, const Vector3d &)
Return true if the vector is oriented inwards the half space.
Definition: BlockPyramid.cc:49
void Print(std::ostream &os) const
Print stuff.
Definition: BlockPyramid.cc:255
std::deque< HalfSpace3d > half_spaces
Half spaces that define the object.
Definition: BlockPyramid.h:39
GEOM_FT getArea(void) const
Return the area of the object surface.
Definition: BlockPyramid.cc:102
Posición en tres dimensiones.
Definition: Pos3d.h:44
GEOM_FT Ix(void) const
Return the moment of inertia with respect to the x axis.
Definition: BlockPyramid.cc:118
GEOM_FT getVolume(void) const
Return the volume of the object.
Definition: BlockPyramid.cc:110
GEOM_FT GetMin(unsigned short int i) const
Return the minimum value of the i-th coordinate.
Definition: BlockPyramid.cc:155
BlockPyramid(void)
Default constructor.
Definition: BlockPyramid.cc:86
GEOM_FT Iz(void) const
Return the moment of inertia with respect to the z axis.
Definition: BlockPyramid.cc:134
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
Vector en tres dimensiones.
Definition: Vector3d.h:39
Two-dimensional reference system defined in a three-dimensional space.
Definition: Ref2d3d.h:41
GEOM_FT getLength(void) const
Return the object length.
Definition: BlockPyramid.cc:94
Clase base para los objetos en tres dimensiones.
Definition: GeomObj3d.h:43