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); }
80 inline GEOM_FT getPerimeter(
void)
const 83 inline GEOM_FT getLambda(
const Pos2d &p)
const 85 inline GEOM_FT AreaSigno(
void)
const 86 {
return moment_sign(0,0); }
87 virtual GEOM_FT
getArea(
void)
const;
88 virtual GEOM_FT
GetMax(
unsigned short int i)
const;
89 virtual GEOM_FT
GetMin(
unsigned short int i)
const;
92 GEOM_FT getMoment(
const int &p,
const int &q)
const;
93 virtual GEOM_FT
Ix(
void)
const;
94 virtual GEOM_FT
Iy(
void)
const;
95 virtual GEOM_FT
Pxy(
void)
const;
99 GEOM_FT
DistSigno(
const Pos2d &p,
const bool &clockwise=
false)
const;
112 void Print(std::ostream &os)
const;
113 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:588
Vector2d getLado0Normal(const size_t i) const
Return la normal al lado of the polygon.
Definition: PolygonalSurface2d.cc:45
Base class for position lists.
Definition: PolyPos.h:35
virtual Pos2d Centroide(void) const
Return the centroid (point interior to the polygon).
Definition: PolygonalSurface2d.cc:214
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:467
int getIndexOfProximalEdge(const Pos2d &) const
Return the proximal edge with respect to the point argument.
Definition: PolygonalSurface2d.cc:121
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:580
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:263
Vector en dos dimensiones.
Definition: Vector2d.h:40
Vector2d getVertex0Normal(const size_t i) const
Return la normal en el vértice of the polygon.
Definition: PolygonalSurface2d.cc:50
GeomObj::list_Pos2d getApproxTangentPositions(const Vector2d &) const
Return the points for which the polygon is almost tangent to the direction argument.
Definition: PolygonalSurface2d.cc:275
Base class for the polygonal surfaces.
Definition: PolygonalSurface2d.h:38
virtual GEOM_FT Iy(void) const
Calcula el moment of inertia with respect to an axis parallel to the y axis that passes through the p...
Definition: PolygonalSurface2d.cc:254
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:325
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:377
int getNearestEdgeIndex(const Pos2d &) const
Return the nearest edge to the given point.
Definition: PolygonalSurface2d.cc:529
virtual GEOM_FT getArea(void) const
Return the object area.
Definition: PolygonalSurface2d.cc:180
bool Overlap(const Line2d &r) const
Return true if the line and the polygonal surface overlap.
Definition: PolygonalSurface2d.cc:427
int getIndexOfDistalEdge(const Pos2d &) const
Return the distal edge with respect to the point argument.
Definition: PolygonalSurface2d.cc:101
int getIndexOfDistalVertex(const Pos2d &) const
Return the distal vertex with respect to the point argument.
Definition: PolygonalSurface2d.cc:141
Segment2d Lado0(unsigned int i, unsigned int j) const
Return the segments between vertices i and j (0->n).
Definition: PolygonalSurface2d.cc:73
virtual GEOM_FT GetMin(unsigned short int i) const
Return the minimum value of the i-th coordinate.
Definition: PolygonalSurface2d.cc:194
Polyline2d getPolyline(void) const
Return the closed polyline formed with the vertices of the polygon.
Definition: PolygonalSurface2d.cc:63
virtual GEOM_FT Ix(void) const
Calcula el moment of inertia with respect to an axis parallel to the x axis que pasa por the center o...
Definition: PolygonalSurface2d.cc:245
GEOM_FT Dist(const Pos2d &p) const
Return the distance from the point to the polygon.
Definition: PolygonalSurface2d.cc:370
Segment2d getNearestEdge(const Pos2d &) const
Return the nearest edge to the given point.
Definition: PolygonalSurface2d.cc:563
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:161
GeomObj::list_Pos2d getVertices(void) const
Return los vertices of the polygon.
Definition: PolygonalSurface2d.cc:36
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:184
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:90
virtual Pos2d getCenterOfMass(void) const
Return the center of mass.
Definition: PolygonalSurface2d.cc:204
Segment2d Lado(unsigned int i) const
Return the i-th edge (i between 1 and num_sides).
Definition: PolygonalSurface2d.cc:86