28 #include "../pos_vec/Pos2d.h" 41 Ray2d(
void):
Linear2d(),cgsr(CGPoint_2(0,0),CGPoint_2(1,0)) {}
42 explicit Ray2d(
const CGRay_2 &r)
48 const CGRay_2 &ToCGAL(
void)
const 50 virtual GeomObj *getCopy(
void)
const 51 {
return new Ray2d(*
this); }
53 void TwoPoints(
const Pos2d &p1,
const Pos2d &p2);
54 virtual GEOM_FT
GetMax(
unsigned short int)
const 56 virtual GEOM_FT
GetMin(
unsigned short int)
const 58 virtual Line2d getSupportLine(
void)
const 59 {
return Line2d(cgsr.supporting_line()); }
60 Pos2d getFromPoint(
void)
const 61 {
return Pos2d(cgsr.source()); }
63 {
return getSupportLine().
getSlope(); }
66 const Pos2d Point(
const int &i)
const 67 {
return Pos2d(cgsr.point(i)); }
69 inline bool EsVertical(
void)
const 70 {
return cgsr.is_vertical(); }
71 inline bool isDegenerated(
void)
const 72 {
return cgsr.is_degenerate(); }
74 virtual bool In(
const Pos2d &p,
const double &tol= 0.0)
const 75 {
return cgsr.has_on(p.ToCGAL()); }
86 {
return getSupportLine().
Ordena(ptos); }
88 bool intersects(
const Ray2d &sr2)
const 89 {
return do_intersect(cgsr,sr2.cgsr); }
90 bool intersects(
const Line2d &sr)
const;
99 {
return parallel(getSupportLine(),r); }
107 {
return Pos2d(NAN,NAN); }
114 {
return angle(
VDir(),v); }
115 inline friend GEOM_FT angle(
const Ray2d &r,
const Vector2d &v)
116 {
return r.getAngle(v); }
118 inline virtual GEOM_FT
Ix(
void)
const 121 inline virtual GEOM_FT
Iy(
void)
const 124 inline virtual GEOM_FT
Pxy(
void)
const 127 inline virtual GEOM_FT
Iz(
void)
const 132 boost::python::dict
getPyDict(
void)
const;
133 void setPyDict(
const boost::python::dict &);
135 void Print(std::ostream &os)
const;
136 void Plot(Plotter &psos)
const;
140 {
return r.
dist2(p); }
142 {
return dist2(p,r); }
144 {
return r.
dist(p); }
146 {
return dist(p,r); }
148 inline bool parallel(
const Ray2d &sr,
const Line2d &r)
149 {
return sr.isParallel(r); }
150 inline bool parallel(
const Line2d &r,
const Ray2d &sr)
151 {
return parallel(sr,r); }
152 inline bool parallel(
const Ray2d &r1,
const Ray2d &r2)
153 {
return r1.isParallel(r2); }
155 inline bool intersecan(
const Ray2d &sr1,
const Ray2d &sr2)
156 {
return sr1.intersects(sr2); }
157 inline bool intersecan(
const Ray2d &sr,
const Line2d &r)
158 {
return sr.intersects(r); }
159 inline bool intersecan(
const Line2d &r,
const Ray2d &sr)
160 {
return sr.intersects(r); }
172 inline bool colineales(
const Ray2d &sr,
const Line2d &r)
173 {
return colineales(sr.getSupportLine(),r); }
174 inline bool colineales(
const Line2d &r,
const Ray2d &sr)
175 {
return colineales(sr,r); }
176 inline bool colineales(
const Ray2d &sr1,
const Ray2d &sr2)
177 {
return colineales(sr1,sr2.getSupportLine()); }
Pos2d Projection(const Pos2d &) const
Return the orthogonal projection onto the line.
Definition: Ray2d.cc:205
Vector2d VDir(void) const
Return the direction vector of the segment.
Definition: Segment2d.cc:93
void Transform(const Trf2d &trf2d)
Applies to the ray the transformation argument.
Definition: Ray2d.cc:220
void Put(const Pos2d &p1, const Pos2d &p2)
Set the points that define the ray.
Definition: Ray2d.h:79
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 Iy(void) const
Moment of inertia with respect to the center of mass en local axis.
Definition: Ray2d.h:121
GeomObj2d::list_Pos2d getIntersection(unsigned short int, const double &) const
Return the intersection of the ray with the plane defined by the equation coord_i= d...
Definition: Ray2d.cc:137
Pos2d PtoParametricas(const GEOM_FT &) const
Return a point of the line at a distance lambda from its origin.
Definition: Ray2d.cc:104
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
Vector2d Normal(void) const
Return the direction vector of the segment.
Definition: Ray2d.cc:73
Posición en dos dimensiones.
Definition: Pos2d.h:41
Line in a two-dimensional space.
Definition: Line2d.h:61
virtual GEOM_FT GetMin(unsigned short int) const
Return the minimum value of the i-th coordinate.
Definition: Ray2d.h:56
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: Ray2d.h:85
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: Ray2d.cc:237
void swap(void)
@ brief Swaps the ray orientation.
Definition: Ray2d.cc:60
GEOM_FT dist(const Pos2d &p) const
Return the distance from the point to the ray.
Definition: Ray2d.cc:129
virtual bool In(const Pos2d &p, const double &tol=0.0) const
Return true if the point lies inside the object.
Definition: Ray2d.h:74
Base class for two-dimensional transformations.
Definition: Trf2d.h:40
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
Dir2d GetDir(void) const
Return the direction of the segment.
Definition: Segment2d.cc:89
virtual Vector2d getJVector(void) const
Returns a vector in the direction of the local Y axis.
Definition: Ray2d.cc:95
virtual Vector2d getIVector(void) const
Returns a vector in the direction of the local X axis.
Definition: Ray2d.cc:86
Segment in a two-dimensional space.
Definition: Segment2d.h:38
boost::python::dict getPyDict(void) const
Return a Python dictionary with the object members values.
Definition: Ray2d.cc:228
bool downwards(void) const
Return true if the ray goes down.
Definition: Ray2d.cc:81
virtual GEOM_FT Pxy(void) const
!
Definition: Ray2d.h:124
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
GEOM_FT getSlope(void) const
Return the slope of the line.
Definition: Line2d.cc:264
GEOM_FT dist2(const Pos2d &p) const
Return the squared distance from the point to the ray.
Definition: Ray2d.cc:114
virtual GEOM_FT Iz(void) const
Moment of inertia polar with respect to the center of mass en local axis.
Definition: Ray2d.h:127
virtual GEOM_FT Ix(void) const
Moment of inertia with respect to the center of mass en local axis.
Definition: Ray2d.h:118
virtual GEOM_FT getLength(void) const
Return the length of the object.
Definition: Ray2d.h:104
Clase base para las entidades geométricas.
Definition: GeomObj.h:40
virtual bool operator==(const Ray2d &) const
Comparison operator.
Definition: Ray2d.cc:45
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
virtual GEOM_FT GetMax(unsigned short int) const
Return the maximum value of the i-th coordinate.
Definition: Ray2d.h:54
bool upwards(void) const
Return true if the ray goes up.
Definition: Ray2d.cc:77
GEOM_FT getAngle(const Vector2d &v) const
Return the angle of the segment with the vector (0->2PI).
Definition: Segment2d.cc:123