75 #ifndef SLIP_VECTOR3D_HPP
76 #define SLIP_VECTOR3D_HPP
88 #include <boost/serialization/access.hpp>
89 #include <boost/serialization/split_member.hpp>
90 #include <boost/serialization/version.hpp>
99 bool operator<(const Vector3d<T>& x,
const Vector3d<T>& y);
101 template <
typename T>
104 template <
typename T>
105 bool operator<=(const Vector3d<T>& x,
const Vector3d<T>& y);
107 template <
typename T>
121 template <
typename T>
251 const T&
get_x()
const;
267 const T&
get_y()
const;
284 const T&
get_z()
const;
304 void set_x(
const T& r);
321 void set_y(
const T& g);
338 void set_z(
const T& r);
353 void set(
const T& x1,
371 self product(
const self& other)
const ;
379 std::string
name()
const;
384 template<
class Archive>
385 void save(Archive & ar,
const unsigned int version)
const
387 ar & boost::serialization::base_object<slip::kvector<T,3> >(*this);
389 template<
class Archive>
390 void load(Archive & ar,
const unsigned int version)
392 ar & boost::serialization::base_object<slip::kvector<T,3> >(*this);
394 BOOST_SERIALIZATION_SPLIT_MEMBER()
470 tmp[0] = -(*this)[0];
471 tmp[1] = -(*this)[1];
472 tmp[2] = -(*this)[2];
480 bool operator<(const Vector3d<T>& x,
483 return (slip::Euclidean_norm<T>(x.begin(),x.end())
485 slip::Euclidean_norm<T>(y.begin(),y.end())
501 bool operator<=(const Vector3d<T>& x,
611 tmp[0] = ( ((*this)[1] * other[2]) - ((*
this)[2] * other[1]) );
612 tmp[1] = ( ((*this)[2] * other[0]) - ((*
this)[0] * other[2]) );
613 tmp[2] = ( ((*this)[0] * other[1]) - ((*
this)[1] * other[0]) );
629 tmp[0] = V1[0] + V2[0];
630 tmp[1] = V1[1] + V2[1];
631 tmp[2] = V1[2] + V2[2];
659 tmp[0] = V1[0] - V2[0];
660 tmp[1] = V1[1] - V2[1];
661 tmp[2] = V1[2] - V2[2];
681 tmp[0] = val - V1[0];
682 tmp[1] = val - V1[1];
683 tmp[2] = val - V1[2];
694 tmp[0] = V1[0] * V2[0];
695 tmp[1] = V1[1] * V2[1];
696 tmp[2] = V1[2] * V2[2];
725 tmp[0] = V1[0] / V2[0];
726 tmp[1] = V1[1] / V2[1];
727 tmp[2] = V1[2] / V2[2];
749 #endif //SLIP_VECTOR3D_HPP
slip::Vector3d< unsigned char > Vector3d_uc
unsigned char alias
slip::Vector3d< unsigned short > Vector3d_us
unsigned long alias
const T & get_z() const
Accessor to the third dimension value of the Vector3d.
const_pointer const_iterator
const T & get_y() const
Accessor to the second dimension value of the Vector3d.
This is a linear (one-dimensional) static vector. This container statisfies the RandomAccessContainer...
This is a Vector3d struct. It is a specialization of kvector. It implements some specific 3d operatio...
void set_x2(const T &x2)
Mutator of the second dimension value of the Vector3d.
Color< T > operator+(const Color< T > &V1, const Color< T > &V2)
slip::Vector3d< float > Vector3d_f
float alias
const T & get_x() const
Accessor to the first dimension value of the Vector3d.
const T & get_x1() const
Accessor to the first dimension value of the Vector3d.
void set_x3(const T &x3)
Mutator of the third dimension value of the Vector3d.
bool operator>(const Array< T > &x, const Array< T > &y)
const value_type * const_pointer
void set_y(const T &g)
Mutator of the second dimension value of the Vector3d.
slip::Vector3d< long > Vector3d_l
long alias
slip::Vector3d< char > Vector3d_c
char alias
slip::Vector3d< double > Vector3d_d
double alias
const T & get_x2() const
Accessor to the second dimension value of the Vector3d.
Vector3d()
Default constructor init all the components to 0.
void set_x(const T &r)
Mutator of the first dimension value of the Vector3d.
const T & v() const
Accessor to the second dimension value of the Vector3d.
const value_type & const_reference
slip::Vector3d< unsigned int > Vector3d_ui
unsigned int alias
ptrdiff_t difference_type
Provides a class to manipulate static and generic vectors.
std::string name() const
Returns the name of the class.
slip::Vector3d< int > Vector3d_i
int alias
void set_z(const T &r)
Mutator of the third dimension value of the Vector3d.
const T & u() const
Accessor to the first dimension value of the Vector3d.
self product(const self &other) const
Computes the vector cross product betwin the current Vector3d and the Vector3d other.
slip::Vector3d< short > Vector3d_s
short alias
const T & get_x3() const
Accessor to the third dimension value of the Vector3d.
const T & w() const
Accessor to the third dimension value of the Vector3d.
slip::Vector3d< unsigned long > Vector3d_ul
unsigned long alias
void set_x1(const T &x1)
Mutator of the first dimension value of the Vector3d.
Color< T > operator*(const Color< T > &V1, const Color< T > &V2)
void set(const T &x1, const T &x2, const T &x3)
Mutator of the three dimension values of the Vector3d.
Color< T > operator/(const Color< T > &V1, const Color< T > &V2)
friend class boost::serialization::access
bool operator>=(const Array< T > &x, const Array< T > &y)
Color< T > operator-(const Color< T > &V1, const Color< T > &V2)
Provides some algorithms to compute norms.