KSeExpr 6.0.0.0
|
#include <Vec.h>
Public Types | |
using | T_VEC_VALUE = Vec< T, d, false > |
using | T_VEC_REF = Vec< T, d, true > |
Public Member Functions | |
Vec (T *raw) | |
Initialize vector to be reference to plain raw data. | |
Vec () | |
Empty constructor (this is invalid for a reference type) | |
Vec (T v0) | |
Convenience constant vector initialization (valid for any d) | |
Vec (T v1, T v2) | |
Convenience 2 vector initialization (only for d==2) | |
Vec (T v1, T v2, T v3) | |
Convenience 3 vector initialization (only for d==3) | |
Vec (T v1, T v2, T v3, T v4) | |
Convenience 4 vector initialization (only for d==4) | |
template<class T2 , bool refother> | |
Vec (const Vec< T2, d, refother > &other) | |
Copy construct. Only valid if we are not going to be a reference data! | |
template<class T2 , bool refother> | |
Vec & | operator= (const Vec< T2, d, refother > &other) |
template<class Tother , bool refother> | |
bool | operator== (const Vec< Tother, d, refother > &other) const |
template<class Tother , bool refother> | |
bool | operator!= (const Vec< Tother, d, refother > &other) const |
T & | operator[] (const int i) |
const T & | operator[] (const int i) const |
T | length2 () const |
Square of euclidean (2) norm. | |
T | length () const |
Euclidean (2) norm. | |
T | normalize () |
Normalize in place and return the 2-norm before normalization. | |
Vec< T, d, false > | normalized () const |
Return a copy of the vector that is normalized. | |
Vec & | operator/= (const T val) |
Vec & | operator*= (const T val) |
template<bool refother> | |
Vec & | operator+= (const Vec< T, d, refother > &other) |
template<bool refother> | |
Vec & | operator-= (const Vec< T, d, refother > &other) |
template<bool refother> | |
Vec & | operator*= (const Vec< T, d, refother > &other) |
template<bool refother> | |
Vec & | operator/= (const Vec< T, d, refother > &other) |
T_VEC_VALUE | operator- () const |
template<bool refother> | |
bool | operator== (const Vec< T, d, refother > &other) const |
template<bool refother> | |
bool | operator!= (const Vec< T, d, refother > &other) const |
T_VEC_VALUE | operator* (T s) const |
T_VEC_VALUE | operator/ (T s) const |
template<bool refother> | |
T_VEC_VALUE | operator+ (const Vec< T, d, refother > &other) const |
template<bool refother> | |
T_VEC_VALUE | operator- (const Vec< T, d, refother > &other) const |
template<bool refother> | |
T_VEC_VALUE | operator* (const Vec< T, d, refother > &other) const |
template<bool refother> | |
T_VEC_VALUE | operator/ (const Vec< T, d, refother > &other) const |
template<bool refother> | |
T | dot (const Vec< T, d, refother > &o) const |
template<bool refother> | |
T_VEC_VALUE | cross (const Vec< T, 3, refother > &o) const |
T_VEC_VALUE | orthogonal () const |
template<bool refother> | |
T | angle (const Vec< T, 3, refother > &o) const |
template<bool refother> | |
T_VEC_VALUE | rotateBy (const Vec< T, 3, refother > &axis, T angle) const |
Static Public Member Functions | |
template<class T2 > | |
static Vec< T, d, false > | copy (T2 *raw) |
Initialize vector value using raw memory. | |
Private Attributes | |
static_if< ref, T *, std::array< T, d > >::TYPE | x |
internal data (either an explicit arary or a pointer to raw data) | |
Friends | |
T_VEC_VALUE | operator* (T s, const Vec &v) |
Vec class, generic dimension vector class can also point to data if the template argument ref is true
|
inlineexplicit |
Initialize vector to be reference to plain raw data.
Definition at line 50 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::Vec().
Empty constructor (this is invalid for a reference type)
Definition at line 57 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::Vec().
Referenced by KSeExpr::Vec< T, d, ref >::angle(), KSeExpr::Curve< T >::clampCurveSegment(), KSeExpr::Curve< T >::clampCurveSegment(), KSeExpr::Curve< T >::comp(), KSeExpr::Vec< T, d, ref >::copy(), KSeExpr::Curve< T >::getChannelValue(), KSeExpr::Curve< T >::getLowerBoundCV(), KSeExpr::Curve< T >::getValue(), KSeExpr::Vec< T, d, ref >::length(), KSeExpr::Vec< T, d, ref >::normalize(), KSeExpr::Vec< T, d, ref >::normalized(), KSeExpr::Vec< T, d, ref >::operator!=(), KSeExpr::Vec< T, d, ref >::operator!=(), KSeExpr::Vec< T, d, ref >::operator*(), KSeExpr::Vec< T, d, ref >::operator+(), KSeExpr::Vec< T, d, ref >::operator-(), KSeExpr::Vec< T, d, ref >::operator/(), KSeExpr::Vec< T, d, ref >::operator/=(), KSeExpr::Vec< T, d, ref >::operator==(), KSeExpr::Vec< T, d, ref >::operator[](), KSeExpr::Vec< T, d, ref >::operator[](), KSeExpr::Curve< T >::preparePoints(), KSeExpr::Vec< T, d, ref >::rotateBy(), KSeExpr::ExprCurveAssignSpec< T >::toString(), KSeExpr::Vec< T, d, ref >::Vec(), KSeExpr::Vec< T, d, ref >::Vec(), KSeExpr::Vec< T, d, ref >::Vec(), KSeExpr::Vec< T, d, ref >::Vec(), KSeExpr::Vec< T, d, ref >::Vec(), KSeExpr::Vec< T, d, ref >::Vec(), and KSeExpr::Vec< T, d, ref >::Vec().
Convenience constant vector initialization (valid for any d)
Definition at line 63 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::Vec(), and KSeExpr::Vec< T, d, ref >::x.
Convenience 2 vector initialization (only for d==2)
Definition at line 71 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::Vec(), and KSeExpr::Vec< T, d, ref >::x.
Convenience 3 vector initialization (only for d==3)
Definition at line 80 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::Vec(), and KSeExpr::Vec< T, d, ref >::x.
Convenience 4 vector initialization (only for d==4)
Definition at line 90 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::Vec(), and KSeExpr::Vec< T, d, ref >::x.
Copy construct. Only valid if we are not going to be a reference data!
Copy construct. Only valid if we are not going to be reference data!
Definition at line 105 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::Vec().
|
inline |
Returns the angle in radians between the current vector and the passed in vector.
Definition at line 317 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::dot(), KSeExpr::Vec< T, d, ref >::length(), and KSeExpr::Vec< T, d, ref >::Vec().
Referenced by KSeExpr::Vec< T, d, ref >::rotateBy().
Initialize vector value using raw memory.
Definition at line 40 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::Vec().
|
inline |
Cross product.
Definition at line 301 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::x.
Referenced by KSeExpr::Vec< T, d, ref >::rotateBy().
|
inline |
Inner product.
Definition at line 292 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::x.
Referenced by KSeExpr::Vec< T, d, ref >::angle(), KSeExpr::Vec< T, d, ref >::rotateBy(), KSeExpr::saturate(), KSeExpr::voronoi_f1_3d(), and KSeExpr::voronoi_f1f2_3d().
Euclidean (2) norm.
Definition at line 153 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::length2(), and KSeExpr::Vec< T, d, ref >::Vec().
Referenced by KSeExpr::Vec< T, d, ref >::angle(), KSeExpr::PrintFuncX::evalConstant(), KSeExpr::PrintFuncX::prep(), KSeExpr::SPrintFuncX::prep(), and KSeExpr::rotate().
|
inline |
Square of euclidean (2) norm.
Definition at line 144 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::x.
Referenced by KSeExpr::Vec< T, d, ref >::length(), and KSeExpr::Vec< T, d, ref >::normalize().
Normalize in place and return the 2-norm before normalization.
Definition at line 159 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::length2(), KSeExpr::Vec< T, d, ref >::Vec(), and KSeExpr::Vec< T, d, ref >::x.
Referenced by KSeExpr::Vec< T, d, ref >::normalized().
Return a copy of the vector that is normalized.
Definition at line 173 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::normalize(), and KSeExpr::Vec< T, d, ref >::Vec().
|
inline |
Definition at line 239 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::Vec().
|
inline |
Definition at line 126 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::Vec().
|
inline |
Definition at line 272 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::Vec().
|
inline |
|
inline |
Definition at line 188 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::x.
|
inline |
Definition at line 209 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::x.
|
inline |
Definition at line 258 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::Vec().
|
inline |
Definition at line 195 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::x.
|
inline |
|
inline |
Definition at line 265 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::Vec().
|
inline |
Definition at line 202 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::x.
|
inline |
Definition at line 279 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::Vec().
|
inline |
|
inline |
Definition at line 180 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::Vec(), and KSeExpr::Vec< T, d, ref >::x.
|
inline |
Definition at line 216 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::x.
|
inline |
Definition at line 111 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::x.
|
inline |
Definition at line 231 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::Vec(), and KSeExpr::Vec< T, d, ref >::x.
|
inline |
Definition at line 118 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::x.
|
inline |
Definition at line 132 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::Vec(), and KSeExpr::Vec< T, d, ref >::x.
|
inline |
Definition at line 138 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::Vec(), and KSeExpr::Vec< T, d, ref >::x.
|
inline |
Return a vector orthogonal to the current vector.
Definition at line 307 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::x.
|
inline |
Returns the vector rotated by the angle given in radians about the given axis. (Axis must be normalized)
Definition at line 330 of file Vec.h.
References KSeExpr::Vec< T, d, ref >::angle(), KSeExpr::Vec< T, d, ref >::cross(), KSeExpr::Vec< T, d, ref >::dot(), and KSeExpr::Vec< T, d, ref >::Vec().
Referenced by KSeExpr::rotate(), and KSeExpr::up().
internal data (either an explicit arary or a pointer to raw data)
Definition at line 33 of file Vec.h.
Referenced by KSeExpr::Vec< T, d, ref >::cross(), KSeExpr::Vec< T, d, ref >::dot(), KSeExpr::Curve< T >::getChannelValue(), KSeExpr::Curve< T >::getValue(), KSeExpr::Vec< T, d, ref >::length2(), KSeExpr::Vec< T, d, ref >::normalize(), KSeExpr::Vec< T, d, ref >::operator*=(), KSeExpr::Vec< T, d, ref >::operator*=(), KSeExpr::Vec< T, d, ref >::operator+=(), KSeExpr::Vec< T, d, ref >::operator-=(), KSeExpr::Vec< T, d, ref >::operator/=(), KSeExpr::Vec< T, d, ref >::operator/=(), KSeExpr::Vec< T, d, ref >::operator=(), KSeExpr::Vec< T, d, ref >::operator==(), KSeExpr::Vec< T, d, ref >::operator==(), KSeExpr::Vec< T, d, ref >::operator[](), KSeExpr::Vec< T, d, ref >::operator[](), KSeExpr::Vec< T, d, ref >::orthogonal(), KSeExpr::Vec< T, d, ref >::Vec(), KSeExpr::Vec< T, d, ref >::Vec(), KSeExpr::Vec< T, d, ref >::Vec(), and KSeExpr::Vec< T, d, ref >::Vec().