23 #ifndef POLYGONALSURFACE2D_H 24 #define POLYGONALSURFACE2D_H 26 #include "utility/geom/d2/Surface2d.h" 41 inline GEOM_FT a_i(
unsigned int i)
const 42 {
return Vertice(i).x()*Vertice(i+1).y()-Vertice(i+1).x()*Vertice(i).y(); }
43 GEOM_FT moment_sign(
const int &p,
const int &q)
const;
49 virtual GeomObj *getCopy(
void)
const= 0;
50 inline virtual unsigned int getNumVertices(
void)
const 52 inline virtual unsigned int getNumEdges(
void)
const 53 {
return getNumVertices(); }
54 inline bool empty(
void)
const 55 {
return (getNumVertices()<1); }
56 virtual Pos2d Vertice(
unsigned int i)
const= 0;
58 virtual Pos2d Vertice0(
unsigned int j)
const= 0;
60 inline const Pos2d operator()(
const size_t &i)
const 61 {
return Vertice(i); }
62 inline const Pos2d operator[](
const size_t &j)
const 63 {
return Vertice0(j); }
83 inline GEOM_FT getPerimeter(
void)
const 86 inline GEOM_FT getLambda(
const Pos2d &p)
const 88 inline GEOM_FT AreaSigno(
void)
const 89 {
return moment_sign(0,0); }
90 virtual GEOM_FT
getArea(
void)
const;
91 virtual GEOM_FT
GetMax(
unsigned short int i)
const;
92 virtual GEOM_FT
GetMin(
unsigned short int i)
const;
95 GEOM_FT getMoment(
const int &p,
const int &q)
const;
96 virtual GEOM_FT
Ix(
void)
const;
97 virtual GEOM_FT
Iy(
void)
const;
98 virtual GEOM_FT
Pxy(
void)
const;
102 GEOM_FT
DistSigno(
const Pos2d &p,
const bool &clockwise=
false)
const;
115 void Print(std::ostream &os)
const;
116 void Plot(Plotter &plotter)
const;
virtual GEOM_FT getLengthUpTo(const Pos2d &) const
Return the length along the perimeter upto the given point.
Definition: PolygonalSurface2d.cc:633
Vector2d getLado0Normal(const size_t i) const
Return la normal al lado of the polygon.
Definition: PolygonalSurface2d.cc:90
virtual Pos2d Centroide(void) const
Return the centroid (point interior to the polygon).
Definition: PolygonalSurface2d.cc:259
Posición en dos dimensiones.
Definition: Pos2d.h:41
Segment2d Clip(const Line2d &) const
Return the intersection of the polygon with the line (if exists).
Definition: PolygonalSurface2d.cc:512
int getIndexOfProximalEdge(const Pos2d &) const
Return the proximal edge with respect to the point argument.
Definition: PolygonalSurface2d.cc:166
Line in a two-dimensional space.
Definition: Line2d.h:61
Pos2d Projection(const Pos2d &) const
Return the projection of the given point into the polyline.
Definition: PolygonalSurface2d.cc:625
GeomObj::list_Pos2d getVertexList(void) const
Return the vertices of the polygon.
Definition: PolygonalSurface2d.cc:36
virtual GEOM_FT Pxy(void) const
Calcula el product of inertia with respect to the axis parallel to the axis x and y with origin in th...
Definition: PolygonalSurface2d.cc:308
boost::python::list getEdgeListPy(void) const
Return the edges of the polygon in a python list.
Definition: PolygonalSurface2d.cc:79
Vector en dos dimensiones.
Definition: Vector2d.h:41
Vector2d getVertex0Normal(const size_t i) const
Return la normal en el vértice of the polygon.
Definition: PolygonalSurface2d.cc:95
GeomObj::list_Pos2d getApproxTangentPositions(const Vector2d &) const
Return the points for which the polygon is almost tangent to the direction argument.
Definition: PolygonalSurface2d.cc:320
Base class for the polygonal surfaces.
Definition: PolygonalSurface2d.h:38
virtual GEOM_FT Iy(void) const
Compute the moment of inertia with respect to an axis parallel to the y axis through the center of ma...
Definition: PolygonalSurface2d.cc:299
Base class for surfaces in a two-dimensional space.
Definition: Surface2d.h:33
Polígono en dos dimensiones.
Definition: Polygon2d.h:38
GEOM_FT DistSigno(const Pos2d &p, const bool &clockwise=false) const
Return the distance from the point to the perímeter The distance is computed as the maximum of: -The ...
Definition: PolygonalSurface2d.cc:370
Segment in a two-dimensional space.
Definition: Segment2d.h:38
GEOM_FT getCover(const Pos2d &) const
Return the distance from the point to the nearest edge.
Definition: PolygonalSurface2d.cc:422
int getNearestEdgeIndex(const Pos2d &) const
Return the nearest edge to the given point.
Definition: PolygonalSurface2d.cc:574
virtual GEOM_FT getArea(void) const
Return the object area.
Definition: PolygonalSurface2d.cc:225
bool Overlap(const Line2d &r) const
Return true if the line and the polygonal surface overlap.
Definition: PolygonalSurface2d.cc:472
int getIndexOfDistalEdge(const Pos2d &) const
Return the distal edge with respect to the point argument.
Definition: PolygonalSurface2d.cc:146
int getIndexOfDistalVertex(const Pos2d &) const
Return the distal vertex with respect to the point argument.
Definition: PolygonalSurface2d.cc:186
Segment2d Lado0(unsigned int i, unsigned int j) const
Return the segments between vertices i and j (0->n).
Definition: PolygonalSurface2d.cc:118
virtual GEOM_FT GetMin(unsigned short int i) const
Return the minimum value of the i-th coordinate.
Definition: PolygonalSurface2d.cc:239
boost::python::list getVertexListPy(void) const
Return a Python list containing the positions of the polygon vertices.
Definition: PolygonalSurface2d.cc:46
Polyline2d getPolyline(void) const
Return the closed polyline formed with the vertices of the polygon.
Definition: PolygonalSurface2d.cc:108
virtual GEOM_FT Ix(void) const
Compute the moment of inertia with respect to an axis parallel to the x axis through the center of ma...
Definition: PolygonalSurface2d.cc:290
GEOM_FT Dist(const Pos2d &p) const
Return the distance from the point to the polygon.
Definition: PolygonalSurface2d.cc:415
Segment2d getNearestEdge(const Pos2d &) const
Return the nearest edge to the given point.
Definition: PolygonalSurface2d.cc:608
Polyline in a two-dimensional space.
Definition: Polyline2d.h:41
int getIndexOfProximalVertex(const Pos2d &) const
Return the proximal vertex with respect to the point argument.
Definition: PolygonalSurface2d.cc:206
Clase base para las entidades geométricas.
Definition: GeomObj.h:40
virtual GEOM_FT GetMax(unsigned short int i) const
Return the maximum value of the i-th coordinate.
Definition: PolygonalSurface2d.cc:229
const std::list< Segment2d > getEdgeList(void) const
Return the edges of the polygon.
Definition: PolygonalSurface2d.cc:57
Ray in a two-dimensional space.
Definition: Ray2d.h:35
virtual GEOM_FT getLength(void) const
Return the perimeter of the surface.
Definition: PolygonalSurface2d.cc:135
virtual Pos2d getCenterOfMass(void) const
Return the center of mass.
Definition: PolygonalSurface2d.cc:249
Segment2d Lado(unsigned int i) const
Return the i-th edge (i between 1 and num_sides).
Definition: PolygonalSurface2d.cc:131