xc
GeomGroup2d.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 //GeomGroup2d.h
22 
23 #ifndef GEOMGROUP2D_H
24 #define GEOMGROUP2D_H
25 
26 #include "utility/utils/stl/pdeque.h"
27 #include "GeomObj2d.h"
28 #include "utility/geom/lists/GeomGroup.h"
29 
30 class Line2d;
31 
33 //
35 class GeomGroup2d : public GeomGroup<GeomObj2d>
36  {
37 
38  virtual GEOM_FT inertia(const Line2d &e) const;
39  public:
40  typedef pdeque_geom_obj::const_iterator const_iterator;
41  typedef pdeque_geom_obj::iterator iterator;
42 
43 
45 
46  virtual GeomObj2d *getCopy(void) const
47  { return new GeomGroup2d(*this); }
48 
50  inline virtual GEOM_FT getVolume(void) const
51  { return 0.0; }
52  virtual Pos2d getCenterOfMass(void) const;
53 
54  virtual GEOM_FT Ix(void) const;
55  virtual GEOM_FT Iy(void) const;
56  GEOM_FT Pxy(void) const;
57 
58  void Print(std::ostream &stream) const;
59  void Plot(Plotter &) const;
60 
61  void Transform(const Trf2d &trf2d);
62  };
63 
64 #endif
Posición en dos dimensiones.
Definition: Pos2d.h:41
virtual GEOM_FT Ix(void) const
Moment of inertia with respect to an axis parallel to the x axis passing through the center of mass...
Definition: GeomGroup2d.cc:58
Line in a two-dimensional space.
Definition: Line2d.h:61
Base class for two-dimensional transformations.
Definition: Trf2d.h:40
Base class for the two-dimensional geometric objects.
Definition: GeomObj2d.h:37
Group of 3D entities.
Definition: GeomGroup2d.h:35
virtual Pos2d getCenterOfMass(void) const
Return the center of mass.
Definition: GeomGroup2d.cc:77
void Transform(const Trf2d &trf2d)
Applies the transformation to the points.
Definition: GeomGroup2d.cc:103
virtual GEOM_FT getVolume(void) const
Return the volume of the object.
Definition: GeomGroup2d.h:50
Base class for geometric entities groups.
Definition: GeomGroup.h:33
GEOM_FT Pxy(void) const
Moment of inertia with respect to the axis parallel to the x and y axis passing through the center of...
Definition: GeomGroup2d.cc:68
virtual GEOM_FT Iy(void) const
Moment of inertia with respect to an axis parallel to the y axis passing through the center of mass...
Definition: GeomGroup2d.cc:63