xc
CircularSector2d.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 //CircularSector2d.h
22 
23 #ifndef SECTORCIRCULAR2D_H
24 #define SECTORCIRCULAR2D_H
25 
26 #include "Circle2d.h"
27 
28 class Pos2d;
29 class Pos2dArray;
30 
32 //
34 class CircularSector2d : public Circle2d
35  {
36  bool ckwise;
37  double theta1;
38  double theta2;
39  public:
40  CircularSector2d(void);
41  CircularSector2d(const Circle2d &c,const double &th1,const double &th2, bool ckwise= false);
42  CircularSector2d(const Pos2d &p1,const Pos2d &p2,const Pos2d &p3);
43 
44  virtual bool operator==(const CircularSector2d &) const;
45  virtual Surface2d *getCopy(void) const;
46  virtual Pos2d getCenterOfMass(void) const;
47  virtual Pos2d ArcCentroid(void) const;
48  Pos2d PInic(void) const;
49  Pos2d PFin(void) const;
50  Pos2d PMed(void) const;
51  inline const double &Theta1(void) const
52  { return theta1; }
53  inline double &Theta1(void)
54  { return theta1; }
55  inline const double &Theta2(void) const
56  { return theta2; }
57  inline double &Theta2(void)
58  { return theta2; }
59  double getAngle(const Pos2d &p) const;
60  double getLambda(const Pos2d &) const;
61  double getIncludedAngle(void) const;
62  virtual GEOM_FT getArcLength(void) const;
63  virtual GEOM_FT getLength(void) const;
64  virtual GEOM_FT getArea(void) const;
65  virtual GEOM_FT Ix(void) const;
66  virtual GEOM_FT Iy(void) const;
67  virtual GEOM_FT Pxy(void) const;
68  virtual GEOM_FT Iz(void) const;
69  virtual GEOM_FT GetMax(unsigned short int i) const;
70  virtual GEOM_FT GetMin(unsigned short int i) const;
71  virtual bool In(const Pos2d &p, const double &tol= 0.0) const;
72  Pos2dArray getArcPoints(const size_t &n) const;
73  boost::python::list getArcPointsPy(const size_t &n) const;
74 
75  CircularSector2d offset(const GEOM_FT &) const;
76 
77  void Print(std::ostream &os) const;
78  void Plot(Plotter &) const;
79  };
80 
81 CircularSector2d CircularSector2dThreepoints(const Pos2d &,const Pos2d &,const Pos2d &);
82 
83 
84 #endif
85 
86 
87 
virtual GEOM_FT GetMin(unsigned short int i) const
Return el valor mínimo of the i coordinate of the object points.
Definition: CircularSector2d.cc:183
virtual GEOM_FT getLength(void) const
Return the length of the circular sector.
Definition: CircularSector2d.cc:168
virtual GEOM_FT Ix(void) const
Return el moment of inertia of the circular sector with respect to axis parallel to x que pasa por su...
Definition: CircularSector2d.cc:192
virtual GEOM_FT GetMax(unsigned short int i) const
Return the maximum value of the i coordinate of the object points.
Definition: CircularSector2d.cc:176
virtual GEOM_FT Iz(void) const
Return el moment of inertia of the circular sector with respect to axis parallel to z que pasa por su...
Definition: CircularSector2d.cc:210
Círculo en dos dimensiones.
Definition: Circle2d.h:37
Posición en dos dimensiones.
Definition: Pos2d.h:41
virtual GEOM_FT Pxy(void) const
Return el product of inertia of the circular sector with respect to the axis parallel to x e y que pa...
Definition: CircularSector2d.cc:219
double getLambda(const Pos2d &) const
Returns the parameter of the point in the arc (distance to the arc&#39;s first point measured over the ar...
Definition: CircularSector2d.cc:155
CircularSector2d offset(const GEOM_FT &) const
Return a circular sector parallel to this one at the distance being passed as parameter.
Definition: CircularSector2d.cc:283
virtual GEOM_FT getArea(void) const
Return the area of the circular sector.
Definition: CircularSector2d.cc:172
Pos2d PInic(void) const
Return the point inicial del arco.
Definition: CircularSector2d.cc:130
Array of positions in a two-dimensional space.
Definition: Pos2dArray.h:38
CircularSector2d(void)
Default constructor.
Definition: CircularSector2d.cc:72
virtual bool In(const Pos2d &p, const double &tol=0.0) const
Return true if the points lies inside the object.
Definition: CircularSector2d.cc:227
Base class for surfaces in a two-dimensional space.
Definition: Surface2d.h:33
virtual GEOM_FT Iy(void) const
Return el moment of inertia of the circular sector with respect to axis parallel to y que pasa por su...
Definition: CircularSector2d.cc:201
double getAngle(const Pos2d &p) const
Return the angle between the line from the center of the circle to the point p and the line from the ...
Definition: CircularSector2d.cc:151
boost::python::list getArcPointsPy(const size_t &n) const
Return a Python list containing the points that results from the division of the arc.
Definition: CircularSector2d.cc:271
virtual GEOM_FT getArcLength(void) const
Return the length of the arc.
Definition: CircularSector2d.cc:164
virtual Pos2d ArcCentroid(void) const
Return the position of the arc centroid.
Definition: CircularSector2d.cc:120
Pos2dArray getArcPoints(const size_t &n) const
Return n points equally spaced over the arc of the circular sector.
Definition: CircularSector2d.cc:240
double getIncludedAngle(void) const
Return the included angle.
Definition: CircularSector2d.cc:160
Pos2d PFin(void) const
Return the point final del arco.
Definition: CircularSector2d.cc:137
virtual Pos2d getCenterOfMass(void) const
Return the position of the center of mass.
Definition: CircularSector2d.cc:111
Pos2d PMed(void) const
Return the mid-point of the arc.
Definition: CircularSector2d.cc:145
2D circular sector.
Definition: CircularSector2d.h:34
virtual bool operator==(const CircularSector2d &) const
Comparison operator.
Definition: CircularSector2d.cc:92
virtual Surface2d * getCopy(void) const
Constructor virtual.
Definition: CircularSector2d.cc:107