23 #ifndef PLANEPOLYLINE3D_H 24 #define PLANEPOLYLINE3D_H 26 #include "utility/geom/d2/D2to3d.h" 27 #include "utility/geom/pos_vec/Vector3d.h" 28 #include "utility/geom/d1/Polyline2d.h" 29 #include "../cgal_types.h" 30 #include "utility/geom/d2/Plane.h" 40 typedef Polyline2d::iterator iterator;
41 typedef Polyline2d::const_iterator const_iterator;
45 inline Pos2d computePos2d(
const Pos3d &p)
const 47 const Plane plane= this->getPlane();
54 template <
typename InputIterator>
62 virtual GeomObj *getCopy(
void)
const 65 inline void push_back(
const Pos3d &p)
66 { pline2d.push_back(
to_2d(p)); }
68 Pos3d getFromPoint(
void)
const 69 {
return to_3d(this->pline2d.getFromPoint()); }
71 Pos3d getToPoint(
void)
const 72 {
return to_3d(this->pline2d.getToPoint()); }
75 Polygon3d getBufferPolygon(
const GEOM_FT &d,
const size_t &numVertices= 8)
const;
77 bool empty(
void)
const;
78 GEOM_FT GetXMax(
void)
const;
79 GEOM_FT GetYMax(
void)
const;
80 GEOM_FT GetZMax(
void)
const;
81 GEOM_FT GetXMin(
void)
const;
82 GEOM_FT GetYMin(
void)
const;
83 GEOM_FT GetZMin(
void)
const;
85 inline virtual unsigned int getNumVertices(
void)
const 86 {
return pline2d.getNumVertices(); }
87 inline virtual unsigned int getNumSegments(
void)
const 88 {
return pline2d.getNumSegments(); }
92 inline std::vector<GEOM_FT> getLengths(
void)
const 94 inline boost::python::list getLengthsPy(
void)
const 97 inline GEOM_FT getLambda(
const Pos3d &p)
const 99 bool isClosed(
const GEOM_FT &tol= 1e-6)
const;
126 boost::python::list
DividePy(
int num_partes)
const;
128 boost::python::list
DividePy(
const boost::python::list &)
const;
132 Plane getPlaneFromSide0(
unsigned int i)
const;
133 Plane getPlaneFromSide(
unsigned int i)
const;
136 GEOM_FT
Ix(
void)
const;
137 GEOM_FT
Iy(
void)
const;
138 GEOM_FT
Iz(
void)
const;
140 GEOM_FT
GetMax(
unsigned short int i)
const;
141 GEOM_FT
GetMin(
unsigned short int i)
const;
142 bool In(
const Pos3d &p,
const double &tol)
const;
157 void simplify(GEOM_FT epsilon, iterator it1, iterator it2);
164 boost::python::list split(
const Pos3d &)
const;
166 void Print(std::ostream &os)
const;
169 template <
typename InputIterator>
170 PlanePolyline3d::PlanePolyline3d(InputIterator begin,InputIterator end)
175 const Pos3d A= *i; i++;
176 const Pos3d B= *i; i++;
180 for(InputIterator i= begin; i!= end; i++)
Pos2d to_2d(const Pos3d &) const
Return the 2D point corresponding to the 3D point argument.
Definition: D2to3d.cc:132
VectorPos3d Divide(int num_partes) const
Return the points that results from the segment division.
Definition: PlanePolyline3d.cc:411
PlanePolyline3d getRightChunk(const Pos3d &, const GEOM_FT &tol) const
Return the polyline chunk that goes the nearest vertex to to p to its end.
Definition: PlanePolyline3d.cc:307
std::vector< GEOM_FT > getLengths(void) const
Return the lengths corresponding to each vertex.
Definition: PolyPos.h:195
int getIndexOfSegmentAtLength(const GEOM_FT &s) const
Return the index of the segment that lies at the point at a distance "s" measured along the polyline ...
Definition: PlanePolyline3d.cc:339
const Pos3d appendVertex(const Pos3d &)
Append the projection of the vertex to the polyline.
Definition: PlanePolyline3d.cc:256
Plane polygon in a 3D space.
Definition: Polygon3d.h:35
void insertVertex(const Pos3d &, const GEOM_FT &tol=1e-6)
Insert the point argurment as vertex by splitting the nearest segment.
Definition: PlanePolyline3d.cc:277
Segment3d getNearestSegment(const Pos3d &) const
Return the nearest 2D segment.
Definition: PlanePolyline3d.cc:213
Segment en tres dimensiones.
Definition: Segment3d.h:41
Base class for position lists.
Definition: PolyPos.h:35
void removeRepeated(const GEOM_FT &tol=0.0)
Remove vertices that are closer than the given tolerance.
Definition: PlanePolyline3d.cc:684
const Pos2d & Vertice(const size_t &) const
Return the i-th vertex (the first one has the index 1).
Definition: Polyline2d.cc:311
Polyline3d getPolyline3d(void) const
Return the corresponding 3D polyline.
Definition: PlanePolyline3d.cc:364
Posición en dos dimensiones.
Definition: Pos2d.h:41
Segment3d getSegment0(unsigned int i) const
Return the i-th side (i between 0 and num_sides-1).
Definition: PlanePolyline3d.cc:357
const_iterator getSegmentAtLength(const GEOM_FT &s) const
Return an iterator pointing to the vertex that is just before the point at a distance "s" measured al...
Definition: PlanePolyline3d.cc:332
int getIndexOfSegmentAtParam(const GEOM_FT &lambda) const
Return the index of the segment that lies at the point at a distance "lambda*L" measured along the po...
Definition: PlanePolyline3d.cc:346
Vector3d Base1(void) const
Return un vector ortogonal al devuelto por Normal().
Definition: Plane.cc:145
PlanePolyline3d getLeftChunk(const Pos3d &, const GEOM_FT &tol) const
Return the polyline chunk that goes from its beginning to the nearest vertex to p.
Definition: PlanePolyline3d.cc:297
Polyline in a three-dimensional space.
Definition: Polyline3d.h:37
Vector3d getIVectorAtLength(const GEOM_FT &) const
Return the I vector of the segment that lies at the point at a distance "s" measured along the polyli...
Definition: PlanePolyline3d.cc:382
Vector3d getKVectorAtLength(const GEOM_FT &) const
Return the K vector of the segment that lies at the point at a distance "s" measured along the polyli...
Definition: PlanePolyline3d.cc:402
Plane in a three-dimensional space.
Definition: Plane.h:49
PlanePolyline3d getChunk(const Pos3d &, const short int &, const GEOM_FT &) const
Assuming that p is a vertex of the polyline Return the chunk: from the beginning to p if sgn < 0 from...
Definition: PlanePolyline3d.cc:287
bool isClosed(const GEOM_FT &tol=1e-6) const
Returns true if the polyline is closed.
Definition: PlanePolyline3d.cc:325
Pos3d Vertice0(unsigned int j) const
Return the position of the i-th vertex (0 based: j=0..getNumVertices()-1)
Definition: PlanePolyline3d.h:112
GEOM_FT GetMin(unsigned short int i) const
Return the minimum value of the i-th coordinate.
Definition: PlanePolyline3d.cc:535
Pos3d Projection(const Pos3d &) const
Return the projection of the given point into the polyline.
Definition: PlanePolyline3d.cc:241
bool empty(void) const
Return true if there are no vertices.
Definition: PlanePolyline3d.cc:100
Pos3d Vertice(unsigned int i) const
Return the position of the i-th vertex.
Definition: PlanePolyline3d.h:108
boost::python::list DividePy(int num_partes) const
Return a Python list containing the points that results from the segment division.
Definition: PlanePolyline3d.cc:426
GEOM_FT getLengthUpTo(const Pos3d &) const
Return the length along the polyline upto the given point.
Definition: PlanePolyline3d.cc:249
const Pos2d & Vertice0(const size_t &) const
Return the i-th vertex (the first one has the index 0).
Definition: Polyline2d.cc:315
bool TocaCuadrante(const int &) const
Return true if alguno de los vertices toca el cuadrante que se pasa como parámetro.
Definition: PlanePolyline3d.cc:643
GEOM_FT GetMax(unsigned short int i) const
Return the maximum value of the i-th coordinate.
Definition: PlanePolyline3d.cc:530
const Pos3d appendVertexLeft(const Pos3d &)
Append a vertex to the beginning of the polyline.
Definition: PlanePolyline3d.cc:266
GeomObj::list_Pos3d getVertexList(void) const
Return a Python list containing the positions of the polyline vertices.
Definition: PlanePolyline3d.cc:78
void simplify(GEOM_FT epsilon, iterator it1, iterator it2)
Douglas Peucker algorithm implementation.
Definition: PlanePolyline3d.cc:674
GEOM_FT getLength(void) const
Return the length of the object.
Definition: PlanePolyline3d.h:90
Class that places 2D objects (circle, ellipse, polygons, ...) in a 3D space.
Definition: D2to3d.h:44
Segment3d getSegment(unsigned int i) const
Return the i-th edge (i between 1 and num_sides).
Definition: PlanePolyline3d.cc:350
virtual GEOM_FT getLength(void) const
Return the length of the object.
Definition: Polyline2d.h:104
Pos3d getPointAtLength(const GEOM_FT &) const
Return the the point at a distance "s" measured along the polyline from its origin.
Definition: PlanePolyline3d.cc:372
Vector3d Base2(void) const
Return un vector ortogonal al devuelto por Normal() y al devuelto por Base1().
Definition: Plane.cc:152
D2to3d(void)
Constructor.
Definition: D2to3d.cc:40
void removeBackwardSegments(const GEOM_FT &tol)
Remove emove the vertices that generate backward segments.
Definition: PlanePolyline3d.cc:689
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: PlanePolyline3d.cc:505
Pos3d Projection(const Pos3d &) const
Return the projection of the point onto this plane.
Definition: Plane.cc:176
GEOM_FT Iz(void) const
Moment of inertia with respect to an axis parallel to the z axis passing through the center of mass...
Definition: PlanePolyline3d.cc:523
Posición en tres dimensiones.
Definition: Pos3d.h:44
Line in a three-dimensional space.
Definition: Line3d.h:62
boost::python::list getLengthsPy(void) const
Return the lengths corresponding to each vertex in a Python list.
Definition: PolyPos.h:217
Vector3d getJVectorAtLength(const GEOM_FT &) const
Return the J vector of the segment that lies at the point at a distance "s" measured along the polyli...
Definition: PlanePolyline3d.cc:392
Pos3d getCenterOfMass(void) const
Return the center of mass of the polyline.
Definition: PlanePolyline3d.cc:497
Polyline in a two-dimensional space.
Definition: Polyline2d.h:41
Vector de posiciones en tres dimensiones [(x1,y1,z1),(x1,y2,z2),...].
Definition: VectorPos3d.h:32
Clase base para las entidades geométricas.
Definition: GeomObj.h:40
GeomObj3d::list_Pos3d getIntersection(const Line3d &) const
Return the intersection with the line argument.
Definition: PlanePolyline3d.cc:613
Plane polygon in a 3D space.
Definition: PlanePolyline3d.h:37
bool intersects(const Line3d &) const
Return true if the line intersects the polyline.
Definition: PlanePolyline3d.cc:595
Vector en tres dimensiones.
Definition: Vector3d.h:39
Two-dimensional reference system defined in a three-dimensional space.
Definition: Ref2d3d.h:41
bool In(const Pos3d &p, const double &tol) const
Return true if the point lies inside the polyline (i.
Definition: PlanePolyline3d.cc:481
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: PlanePolyline3d.cc:514
Three-dimensional reference system defined in a three-dimensional space.
Definition: Ref3d3d.h:39
boost::python::list getVertexListPy(void) const
Return a Python list containing the positions of the polyline vertices.
Definition: PlanePolyline3d.cc:89
Pos3d to_3d(const Pos2d &) const
Return the 3D point corresponding to the 2D point argument.
Definition: D2to3d.cc:100