29 #include "../pos_vec/Pos2d.h" 48 const CGSegment_2 &ToCGAL(
void)
const 50 virtual GeomObj *getCopy(
void)
const;
52 void TwoPoints(
const Pos2d &p1,
const Pos2d &p2);
53 virtual GEOM_FT
GetMax(
unsigned short int i)
const 54 {
return std::max(getFromPoint()(i),getToPoint()(i)); }
55 virtual GEOM_FT
GetMin(
unsigned short int i)
const 56 {
return std::min(getFromPoint()(i),getToPoint()(i)); }
57 Line2d getSupportLine(
void)
const 58 {
return Line2d(cgseg.supporting_line()); }
59 Pos2d getFromPoint(
void)
const 60 {
return Pos2d(cgseg.source()); }
61 Pos2d getToPoint(
void)
const 62 {
return Pos2d(cgseg.target()); }
66 const Pos2d Point(
const int &i)
const 67 {
return Pos2d(cgseg.point(i)); }
72 inline bool EsVertical(
void)
const 73 {
return cgseg.is_vertical(); }
74 inline bool isDegenerated(
void)
const 75 {
return cgseg.is_degenerate(); }
76 virtual bool In(
const Pos2d &,
const double &tol= 0.0)
const;
87 {
return getSupportLine().
Ordena(ptos); }
93 inline bool intersects(
const Segment2d &r2)
const 94 {
return do_intersect(cgseg,r2.cgseg); }
95 bool intersects(
const Line2d &r)
const;
96 bool intersects(
const Ray2d &sr)
const;
111 {
return parallel(getSupportLine(),r); }
113 {
return parallel(getSupportLine(),sr); }
115 {
return parallel(getSupportLine(),r.getSupportLine()); }
133 inline GEOM_FT Azimuth(
void)
const 134 {
return getSupportLine().
Azimuth(); }
137 inline virtual GEOM_FT
Ix(
void)
const 140 inline virtual GEOM_FT
Iy(
void)
const 143 inline virtual GEOM_FT
Pxy(
void)
const 146 inline virtual GEOM_FT
Iz(
void)
const 150 boost::python::list
DividePy(
int num_partes)
const;
152 boost::python::list
DividePy(
const boost::python::list &)
const;
153 boost::python::list
split(
const Pos2d &)
const;
155 boost::python::dict
getPyDict(
void)
const;
156 void setPyDict(
const boost::python::dict &);
160 void Print(std::ostream &os)
const;
164 {
return r.
dist2(p); }
166 {
return dist2(p,r); }
169 {
return dist(p,r); }
177 {
return parallel(sg,r); }
181 {
return parallel(sg,sr); }
186 {
return sg.intersects(r); }
188 {
return sg.intersects(r); }
190 {
return sg.intersects(sr); }
192 {
return sg.intersects(sr); }
194 {
return r1.intersects(r2); }
207 {
return colineales(sg.getSupportLine(),r); }
209 {
return colineales(sg,r); }
211 {
return colineales(sg.getSupportLine(),sr); }
213 {
return colineales(sg,sr); }
215 {
return colineales(sg1,sg2.getSupportLine()); }
224 std::list<Segment2d> without_degenerated(
const std::list<Segment2d> &);
227 std::list<Polyline2d> get_polylines(
const std::list<Segment2d> &,
const GEOM_FT &tol);
228 boost::python::list py_get_2d_polylines(
const boost::python::list &,
const GEOM_FT &tol);
Vector2d GetVector(void) const
Return the vector from origin to the segment end point.
Definition: Segment2d.cc:119
Vector2d VDir(void) const
Return the direction vector of the segment.
Definition: Segment2d.cc:93
GEOM_FT YAxisAngle(void) const
Return the angle of the segment con el Y axis.
Definition: Segment2d.cc:152
Pos2d Projection(const Pos2d &) const
Return the orthogonal projection onto the line.
Definition: Segment2d.cc:502
Line2d getPerpendicularBisector(void) const
Return the perpendicular_bisector of the segment.
Definition: Segment2d.cc:225
Line2d isParallel(const Pos2d &v) const
Return the line parallel to the segment through p.
Definition: Segment2d.cc:179
Dirección en dos dimensiones.
Definition: Dir2d.h:36
virtual GEOM_FT dist2(const Pos2d &p) const
Return the squared distance to the segment.
Definition: Segment2d.cc:260
virtual GEOM_FT Pxy(void) const
Product of inertia.
Definition: Segment2d.h:143
Base class for position lists.
Definition: PolyPos.h:35
virtual Pos2d getCenterOfMass(void) const
Return the position of the center of mass of the segment.
Definition: Segment2d.cc:166
Posición en dos dimensiones.
Definition: Pos2d.h:41
GeomObj2d::list_Pos2d getIntersection(unsigned short int, const double &) const
Return the intersection of the line with a plane defined by the equation coord_i=cte.
Definition: Segment2d.cc:309
virtual GEOM_FT getLength(void) const
Return object length.
Definition: Segment2d.cc:162
virtual GEOM_FT Iz(void) const
Moment of inertia with respect to the center of mass en local axis.
Definition: Segment2d.h:146
Line in a two-dimensional space.
Definition: Line2d.h:61
virtual GEOM_FT Ix(void) const
Moment of inertia with respect to the center of mass en local axis.
Definition: Segment2d.h:137
void Transform(const Trf2d &trf2d)
Applies to the segment the transformation argument.
Definition: Segment2d.cc:616
virtual Vector2d getJVector(void) const
Returns a vector in the direction of the local Y axis.
Definition: Segment2d.cc:111
virtual GEOM_FT Iy(void) const
Moment of inertia with respect to the center of mass en local axis.
Definition: Segment2d.h:140
Line2d Perpendicular(const Pos2d &p) const
Return the line perpendicular to the segment through p.
Definition: Segment2d.cc:175
Base class for two-dimensional transformations.
Definition: Trf2d.h:40
bool connected(const Pos2d &, const GEOM_FT &tol=0.0) const
Return true if the segment is connected to the argument point (i.
Definition: Segment2d.cc:487
GEOM_FT getSlope(void) const
Return the angle or the line with respect to XY plane.
Definition: Segment2d.cc:77
Vector en dos dimensiones.
Definition: Vector2d.h:40
Vector de posiciones en dos dimensiones [(x1,y1),(x1,y2),...].
Definition: VectorPos2d.h:33
GEOM_FT getSignedAngle(const Vector2d &v) const
Return the angle of the segment with the vector (-PI->0->PI).
Definition: Segment2d.cc:135
double getParamNaturalCoord(const GEOM_FT &) const
Return the parametric coordinate that corresponds to the natural coordinate argument.
Definition: Segment2d.cc:294
Dir2d GetDir(void) const
Return the direction of the segment.
Definition: Segment2d.cc:89
void swap(void)
@ brief Swaps the ray orientation.
Definition: Segment2d.cc:67
Pos2d PtoParametricas(const GEOM_FT &) const
Return a point of the segment at a distance lambda from its origin.
Definition: Segment2d.cc:285
virtual GEOM_FT GetMin(unsigned short int i) const
Return the minimum value of the i-th coordinate.
Definition: Segment2d.h:55
Polígono en dos dimensiones.
Definition: Polygon2d.h:38
Segment in a two-dimensional space.
Definition: Segment2d.h:38
virtual GEOM_FT GetMax(unsigned short int i) const
Return the maximum value of the i-th coordinate.
Definition: Segment2d.h:53
virtual Vector2d getIVector(void) const
Returns a vector in the direction of the local X axis.
Definition: Segment2d.cc:102
double Azimuth(void) const
Return the angle con el Y axis.
Definition: Line2d.cc:587
Segment2d offset(const Vector2d &v) const
Return the a copy of the segment translated along the vector argument.
Definition: Segment2d.cc:184
bool upwards(void) const
Return true if the segment goes up.
Definition: Segment2d.cc:81
Polygon2d getBufferPolygon(const GEOM_FT &d, const size_t &numVertices=8) const
Return a buffer polygon around the segment.
Definition: Segment2d.cc:206
VectorPos2d Divide(int num_partes) const
Return the points that results from the segment division.
Definition: Segment2d.cc:522
GeomObj::list_Pos2d Ordena(const GeomObj::list_Pos2d &ptos) const
Return the points ordered by the value of the parameter of its projection onto the line from lowest t...
Definition: Line2d.cc:380
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: Segment2d.cc:607
virtual bool In(const Pos2d &, const double &tol=0.0) const
Return true if the point is on the segment.
Definition: Segment2d.cc:234
virtual bool operator==(const Segment2d &) const
Comparison operator.
Definition: Segment2d.cc:52
GEOM_FT XAxisAngle(void) const
Return the angle of the segment con el X axis.
Definition: Segment2d.cc:148
Pos2d getMidPoint(void) const
Return the mid point of the segment.
Definition: Segment2d.cc:289
Vector2d Normal(void) const
Return the direction vector of the segment.
Definition: Segment2d.cc:97
void Put(const Pos2d &p1, const Pos2d &p2)
Set the points that define the segment.
Definition: Segment2d.h:80
boost::python::list split(const Pos2d &) const
Return the two segments that result from splitting this one on the point nearest to the argument...
Definition: Segment2d.cc:588
boost::python::dict getPyDict(void) const
Return a Python dictionary with the object members values.
Definition: Segment2d.cc:598
Polyline in a two-dimensional space.
Definition: Polyline2d.h:41
GEOM_FT dist(const Pos2d &p) const
Return the distance from the point to the segment.
Definition: Segment2d.cc:281
boost::python::list DividePy(int num_partes) const
Return a Python list containing the points that results from the segment division.
Definition: Segment2d.cc:529
Clase base para las entidades geométricas.
Definition: GeomObj.h:40
bool downwards(void) const
Return true if the segment goes down.
Definition: Segment2d.cc:85
Ray in a two-dimensional space.
Definition: Ray2d.h:35
Base class for the objects involving a single dimension in a two-dimensional space.
Definition: Linear2d.h:34
GeomObj::list_Pos2d Ordena(const GeomObj::list_Pos2d &ptos) const
Returns the points ordered by the value of the parameter of its projection onto the line from lowest ...
Definition: Segment2d.h:86
Pos2d getPointNaturalCoord(const GEOM_FT &) const
Return the point of the segment with the natural coordinate being passed as parameter.
Definition: Segment2d.cc:299
GEOM_FT getAngle(const Vector2d &v) const
Return the angle of the segment with the vector (0->2PI).
Definition: Segment2d.cc:123