53#ifndef LASS_GUARDIAN_OF_INCLUSION_PRIM_VECTOR_3D_H
54#define LASS_GUARDIAN_OF_INCLUSION_PRIM_VECTOR_3D_H
74 typedef Vector3D<T> TSelf;
76 typedef typename util::CallTraits<T>::TValue TValue;
77 typedef typename util::CallTraits<T>::TParam TParam;
78 typedef typename util::CallTraits<T>::TReference TReference;
79 typedef typename util::CallTraits<T>::TConstReference TConstReference;
80 typedef num::NumTraits<T> TNumTraits;
82 enum { dimension = 3 };
84 template <
typename U>
struct Rebind
86 typedef Vector3D<U> Type;
100 Vector3D(TParam x, TParam y, TParam z);
101 template <
typename U>
explicit Vector3D(
const Vector3D<U>& other);
102 template <
typename U> Vector3D(
const U& x,
const U& y,
const U& z);
104 typename Vector3D::TConstReference operator[](
size_t index)
const;
105 typename Vector3D::TReference operator[](
size_t index) ;
106 typename Vector3D::TConstReference
at(
signed index)
const;
107 typename Vector3D::TReference
at(
signed index);
110 const Vector3D<T> operator-()
const;
127 const Vector3D<T>
project(
const Vector3D<T>& other)
const;
128 const Vector3D<T>
reject(
const Vector3D<T>& other)
const;
129 const Vector3D<T> reflect(
const Vector3D<T>& other)
const;
134 template <
class RandomGenerator>
static Vector3D<T>
random(RandomGenerator& generator);
163template<
typename T,
typename Char,
typename Traits>
164std::basic_ostream<Char, Traits>& operator<<(std::basic_ostream<Char, Traits>& stream,
const Vector3D<T>& b);
165template<
typename T,
typename Char,
typename Traits>
166std::basic_istream<Char, Traits>& operator>>(std::basic_istream<Char, Traits>& stream,
Vector3D<T>& b);
178#define LASS_PRIM_HAVE_PY_EXPORT_TRAITS_VECTOR_3D
179#ifdef LASS_GUARDIAN_OF_INCLUSION_UTIL_PYOBJECT_PLUS_H
Output stream for writing a selection of geometric primitives to XML files.
cyclic iterator over xyz indices
#define LASS_SIMD_ALIGN
if LASS_SIMD_ALIGNMENT is set, use LASS_SIMD_ALIGN to align some structures on SIMD alignment boundar...
set of geometrical primitives
Library for Assembled Shared Sources.
const Vector3D< T > project(const Vector3D< T > &other) const
Project vector on this one.
Vector3D::TConstReference at(signed index) const
Wrap index around range.
const TValue squaredNorm() const
Return squared norm of vector.
void normalize()
Normalize vector.
Vector3D< T > & operator-=(TParam other)
subtract other of each component of this.
Vector3D< T > & operator*=(TParam other)
multiply each component of this with other.
const Vector3D< T > reject(const Vector3D< T > &other) const
Reject vector from this one.
const Vector3D< T > transform(T(*op)(T)) const
apply a function to every component
Vector3D< T > & operator/=(TParam other)
divide each component of this by other.
XYZ majorAxis() const
Return axis with the greatest absolute value.
const TValue norm() const
Return norm of vector.
Vector3D< T > & operator/=(const Vector3D< T > &other)
Componentwise division.
Vector3D< T > & operator-=(const Vector3D< T > &other)
componentwise subtraction
Vector3D< T > & operator+=(TParam other)
add other to each component of this.
static Vector3D< T > random(RandomGenerator &generator)
Random unit vector.
bool isNaN() const
Return true if at least one of the components is NaN.
Vector3D< T > & operator+=(const Vector3D< T > &other)
componentwise addition
bool isZero() const
Return true if all the components are (exactly!) zero.
const Vector3D< T > & operator+() const
A weird way to get back the same object.
const Vector3D< T > normal() const
return a unit vector with same direction/sense as this vector.
const Vector3D< T > reciprocal() const
return the reciprocal version of this vector
Vector3D::TReference at(signed index)
Wrap index around range.
Vector3D< T > & operator*=(const Vector3D< T > &other)
Componentwise multiplication.