26 #include "utility/utils/misc_utils/mchne_eps.h" 27 #include "../ProtoGeom.h" 28 #include "../cgal_types.h" 43 Vector3d(
void): cgvct(CGAL::NULL_VECTOR){}
44 explicit Vector3d(
const CGVector_3 &v)
46 Vector3d(
const GEOM_FT &x,
const GEOM_FT &y,
const GEOM_FT &z);
48 explicit Vector3d(
const boost::python::list &);
52 const CGVector_3 &ToCGAL(
void)
const 54 inline int dimension(
void)
const 55 {
return cgvct.dimension(); }
58 bool Nulo(
void)
const;
59 void SetX(
const GEOM_FT &vx);
60 void SetY(
const GEOM_FT &vy);
61 void SetZ(
const GEOM_FT &vz);
62 void Set(
unsigned short int i,
const GEOM_FT &v);
63 inline GEOM_FT at(
const size_t &i)
const 64 {
return cgvct.cartesian(i); }
65 inline GEOM_FT operator()(
const size_t &i)
const 67 inline GEOM_FT operator[](
const size_t &i)
const 69 inline GEOM_FT x(
void)
const 71 inline GEOM_FT y(
void)
const 73 inline GEOM_FT z(
void)
const 76 boost::python::list
getPyList(
void)
const;
78 Dir3d getDirection(
void)
const;
84 Vector3d &operator*=(
const GEOM_FT &);
86 Vector3d &operator/=(
const GEOM_FT &);
90 {
return (x()*x()+y()*y()+z()*z()); }
92 bool EsUnitario(
const double &tol= mchne_eps_dbl)
const;
119 {
return cross(v1,v2); }
121 friend std::ostream &operator<<(std::ostream &stream,
const Vector3d &n);
123 boost::python::dict
getPyDict(
void)
const;
124 void setPyDict(
const boost::python::dict &);
128 struct iterator : boost::iterator_facade<iterator, int, boost::single_pass_traversal_tag, GEOM_FT>
135 : v_ptr(v), current_(i) {}
137 bool equal(
iterator const& other)
const 138 {
return ((v_ptr==other.v_ptr) && (current_ == other.current_)); }
139 GEOM_FT dereference()
const 140 {
return v_ptr->at(current_); }
161 inline GEOM_FT Abs2(
const Vector3d &v)
Vector3d getCross(const Vector3d &v) const
Return the cross product.
Definition: Vector3d.cc:250
Vector3d operator/(const GEOM_FT &) const
Return el producto del vector por el inverso del escalar.
Definition: Vector3d.cc:288
void Normalize(void)
Normalize vector.
Definition: Vector3d.cc:131
int getIndexMinValue(void) const
Returns the index of the maximum of the values of the components.
Definition: Vector3d.cc:154
bool notAVector(void) const
return true if one of the coordinate components is not a number.
Definition: Vector3d.cc:109
boost::python::list getPyList(void) const
Return the point coordinates in a Python list.
Definition: Vector3d.cc:96
virtual GEOM_FT GetDot(const Vector3d &v) const
Return el producto escalar.
Definition: Vector3d.cc:238
FT_matrix getMatrix(void) const
Return a column vector.
Definition: Vector3d.cc:88
int getIndexMinAbsValue(void) const
Returns the index of the maximum of the values of the components.
Definition: Vector3d.cc:190
bool operator!=(const Vector3d &) const
Comparison operator.
Definition: Vector3d.cc:81
Vector3d operator-(const Vector3d &) const
Return la resta de los vectores.
Definition: Vector3d.cc:274
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: Vector3d.cc:462
boost::python::dict getPyDict(void) const
Return a Python dictionary with the object members values.
Definition: Vector3d.cc:452
GEOM_FT getAngle(const Vector3d &v) const
Return the angle between this vector and the argument.
Definition: Vector3d.cc:391
Base class for geometry objects.
Definition: ProtoGeom.h:33
virtual GEOM_FT GetModulus(void) const
Return el módulo del vector.
Definition: Vector3d.cc:234
virtual bool operator==(const Vector3d &) const
Comparison operator.
Definition: Vector3d.cc:66
Vector3d getNormalized(void) const
Return the normalized vector.
Definition: Vector3d.cc:122
Vector3d Perpendicular(const Vector3d &v) const
Return the vector obtained from projecting v onto the perpendicular direction to this vector...
Definition: Vector3d.cc:342
Dirección en el espacio de tres dimensiones.
Definition: Dir3d.h:35
int getIndexMaxAbsValue(void) const
Returns the index of the maximum of the values of the components.
Definition: Vector3d.cc:172
int getIndexMaxValue(void) const
Returns the index of the maximum of the values of the components.
Definition: Vector3d.cc:136
Posición en tres dimensiones.
Definition: Pos3d.h:44
GEOM_FT getSignedAngle(const Vector3d &v) const
Return the angle between this vector and the argument.
Definition: Vector3d.cc:371
Definition: Vector3d.h:128
GEOM_FT getPolarAngle(void) const
Get the polar angle (spherical coordinates)
Definition: Vector3d.cc:415
virtual GEOM_FT GetModulus2(void) const
Return the squared modulus.
Definition: Vector3d.h:89
GEOM_FT getAzimuthalAngle(void) const
Get the azimuthal angle (spherical coordinates)
Definition: Vector3d.cc:419
Matrix which components are GEOM_FT numbers.
Definition: FT_matrix.h:40
Vector3d Normal(void) const
Return a vector perpendicular to this one.
Definition: Vector3d.cc:299
Vector3d operator+(const Vector3d &) const
Return la suma de los vectores.
Definition: Vector3d.cc:270
Vector en tres dimensiones.
Definition: Vector3d.h:39
Vector3d operator*(const GEOM_FT &) const
Return el producto del vector por el escalar.
Definition: Vector3d.cc:278