26 #include "utility/utils/misc_utils/mchne_eps.h" 27 #include "utility/matrices/op_tensor.h" 28 #include "../cgal_types.h" 29 #include "../ProtoGeom.h" 30 #include <boost/iterator/iterator_facade.hpp> 46 explicit Vector2d(
const CGVector_2 &v)
48 explicit Vector2d(
const CGDirection_2 &dir)
50 Vector2d(
const GEOM_FT &x,
const GEOM_FT &y);
51 explicit Vector2d(
const boost::python::list &);
57 bool operator!=(
const Vector2d &)
const;
58 const CGVector_2 &ToCGAL(
void)
const 60 inline int dimension(
void)
const 61 {
return cgvct.dimension(); }
64 inline Vector2d operator-(
void)
const 70 bool Nulo(
void)
const;
71 void SetX(
const GEOM_FT &vx);
72 void SetY(
const GEOM_FT &vy);
73 void Set(
unsigned short int i,
const GEOM_FT &v);
75 inline GEOM_FT at(
const size_t &i)
const 76 {
return cgvct.cartesian(i); }
77 inline GEOM_FT operator()(
const size_t &i)
const 79 inline GEOM_FT operator[](
const size_t &j)
const 81 inline GEOM_FT x()
const 82 {
return Vector2d::operator()(1); }
83 inline GEOM_FT y()
const 84 {
return Vector2d::operator()(2); }
86 boost::python::list
getPyList(
void)
const;
93 Vector2d &operator*=(
const GEOM_FT &);
95 Vector2d &operator/=(
const GEOM_FT &);
97 inline virtual GEOM_FT GetModulus2(
void)
const 98 {
return (x()*x()+y()*y()); }
100 bool EsUnitario(
const double &tol= mchne_eps_dbl)
const;
110 Dir2d getDirection(
void)
const;
113 GEOM_FT XAxisAngle(
void)
const;
114 GEOM_FT YAxisAngle(
void)
const;
117 inline virtual GEOM_FT GetDot(
const Vector2d &v)
const 118 {
return (x()*v.x()+y()*v.y()); }
119 virtual GEOM_FT GetDot(
const FT_matrix &m)
const;
121 {
return v1.GetDot(v2); }
133 boost::python::dict
getPyDict(
void)
const;
134 void setPyDict(
const boost::python::dict &);
136 void Print(std::ostream &stream)
const;
137 void Plot(Plotter &psos)
const;
138 friend std::ostream &operator<<(std::ostream &stream,
const Vector2d &n);
141 struct iterator : boost::iterator_facade<iterator, int, boost::single_pass_traversal_tag, GEOM_FT>
148 : v_ptr(v), current_(i) {}
150 bool equal(
iterator const& other)
const 151 {
return ((v_ptr==other.v_ptr) && (current_ == other.current_)); }
152 GEOM_FT dereference()
const 153 {
return v_ptr->at(current_); }
162 inline GEOM_FT Abs2(
const Vector2d &v)
163 {
return v.GetModulus2(); }
164 inline GEOM_FT Abs(
const Vector2d &v)
Dirección en dos dimensiones.
Definition: Dir2d.h:36
Vector2d Normal(void) const
Return a vector normal to this one.
Definition: Vector2d.cc:286
virtual GEOM_FT GetModulus(void) const
Return el módulo del vector.
Definition: Vector2d.cc:248
Vector2d operator/(const GEOM_FT &) const
Return the product of the vector and the inverse of the given scalar.
Definition: Vector2d.cc:138
Vector2d operator*(const GEOM_FT &) const
Return the product of the vector and the given scalar.
Definition: Vector2d.cc:128
Posición en dos dimensiones.
Definition: Pos2d.h:41
Definition: Vector2d.h:141
int getIndexMaxValue(void) const
Returns the index of the maximum of the values of the components.
Definition: Vector2d.cc:170
Vector2d Rotated(const double &ang_rad) const
Return the vector that results from rotating this one by the given angle.
Definition: Vector2d.cc:277
GEOM_FT getSignedAngle(const Vector2d &v) const
Return the angle with the vector argument.
Definition: Vector2d.cc:216
int getIndexMinValue(void) const
Returns the index of the maximum of the values of the components.
Definition: Vector2d.cc:181
Vector2d getNormalized(void) const
Return el versor (vector de módulo unidad) correspondiente a éste vector.
Definition: Vector2d.h:103
void Normalize(void)
Normalize vector.
Definition: Vector2d.cc:165
Vector2d Perpendicular(const Orientacion &o) const
Return a vector perpendicular to this one with the given orientation.
Definition: Vector2d.cc:291
Vector en dos dimensiones.
Definition: Vector2d.h:41
bool notAVector(void) const
Return true if one of the coordinate components is not a number.
Definition: Vector2d.cc:235
FT_matrix getMatrix(void) const
Return the point coordinates in a matrix.
Definition: Vector2d.cc:148
ProtoGeom(void)
False when solution is not possible: intersection of parallel planes.
Definition: ProtoGeom.cc:33
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: Vector2d.cc:339
Base class for geometry objects.
Definition: ProtoGeom.h:33
boost::python::dict getPyDict(void) const
Return a Python dictionary with the object members values.
Definition: Vector2d.cc:330
GEOM_FT getAngle(const Vector2d &v) const
Return the angle with the argument vector.
Definition: Vector2d.cc:220
Vector2d operator+(const Vector2d &) const
Return la suma de los vectores.
Definition: Vector2d.cc:120
int getIndexMaxAbsValue(void) const
Returns the index of the maximum of the values of the components.
Definition: Vector2d.cc:192
virtual bool operator==(const Vector2d &) const
Comparison operator.
Definition: Vector2d.cc:65
boost::python::list getPyList(void) const
Return the point coordinates in a Python list.
Definition: Vector2d.cc:156
int getIndexMinAbsValue(void) const
Returns the index of the maximum of the values of the components.
Definition: Vector2d.cc:203
Matrix which components are GEOM_FT numbers.
Definition: FT_matrix.h:40