28 #include "../cgal_types.h" 29 #include "../ProtoGeom.h" 48 explicit Pos2d(
const CGPoint_2 &p);
49 Pos2d(
const GEOM_FT &Ax,
const GEOM_FT &Ay);
50 Pos2d(
const GEOM_RT &x,
const GEOM_RT &y,
const GEOM_RT &h);
59 inline bool operator!=(
const Pos2d &other)
const 60 {
return !(*
this==other); }
61 const CGPoint_2 &ToCGAL(
void)
const 63 inline GEOM_FT operator()(
const size_t &i)
const 64 {
return cgpt.cartesian(i-1); }
65 inline GEOM_FT at0(
const size_t &j)
const 66 {
return cgpt.cartesian(j); }
67 inline GEOM_FT operator[](
const size_t &j)
const 69 inline GEOM_FT x()
const 70 {
return Pos2d::operator()(1); }
71 inline GEOM_FT y()
const 72 {
return Pos2d::operator()(2); }
73 inline const GEOM_RT hx()
const 75 inline const GEOM_RT hy()
const 77 inline const GEOM_RT hw()
const 80 void SetX(
const GEOM_FT &vx);
81 void SetY(
const GEOM_FT &vy);
82 void Set(
unsigned short int i,
const GEOM_FT &v);
84 size_t dimension(
void)
const 85 {
return cgpt.dimension(); }
87 bool domina_a(
const Pos2d &)
const;
97 friend bool colineales(
const Pos2d &p1,
const Pos2d &p2,
const Pos2d &p3);
101 void Print(std::ostream &os)
const;
102 void Plot(Plotter &psos)
const;
104 boost::python::dict
getPyDict(
void)
const;
105 void setPyDict(
const boost::python::dict &);
108 std::ostream &operator << (std::ostream &stream,
const Pos2d &n);
111 {
return p1.
dist2(p2); }
114 {
return p1.
dist(p2); }
117 {
return Pos2d(std::max(a.x(),b.x()),std::max(a.y(),b.y())); }
119 {
return Pos2d(std::min(a.x(),b.x()),std::min(a.y(),b.y())); }
121 const Pos2d Origin2d;
GEOM_FT dist(const Pos2d &) const
Return the distance to the point.
Definition: Pos2d.cc:147
virtual bool operator==(const Pos2d &) const
Comparison operator.
Definition: Pos2d.cc:92
Posición en dos dimensiones.
Definition: Pos2d.h:41
Pos2d & operator+=(const Vector2d &v)
Adds a vector.
Definition: Pos2d.cc:57
bool notAPoint(void) const
return true if one of the coordinate components is not a number.
Definition: Pos2d.cc:53
Line in a two-dimensional space.
Definition: Line2d.h:61
Polygon2d getBufferPolygon(const GEOM_FT &d, const size_t &numVertices=8) const
Return a buffer polygon around the point.
Definition: Pos2d.cc:184
Vector en dos dimensiones.
Definition: Vector2d.h:40
Pos2d(void)
Default constructor.
Definition: Pos2d.cc:37
Base class for geometry objects.
Definition: ProtoGeom.h:33
Vector2d operator-(const Pos2d &) const
Vector between points.
Definition: Pos2d.cc:71
Polígono en dos dimensiones.
Definition: Polygon2d.h:38
Segment in a two-dimensional space.
Definition: Segment2d.h:38
Pos2d & operator-=(const Vector2d &v)
Substracts a vector.
Definition: Pos2d.cc:64
boost::python::dict getPyDict(void) const
Return a Python dictionary with the object members values.
Definition: Pos2d.cc:196
Vector2d VectorPos(void) const
Return the position vector of the point.
Definition: Pos2d.cc:107
Pos2d operator+(const Vector2d &) const
Return the point obtained by adding the vector.
Definition: Pos2d.cc:85
Ray in a two-dimensional space.
Definition: Ray2d.h:35
GEOM_FT dist2(const Pos2d &) const
Return the squared distance to the point.
Definition: Pos2d.cc:151
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: Pos2d.cc:205