#include <UT_Vector2.h>
Public Member Functions | |
| UT_Vector2T (void) | |
| UT_Vector2T (T vx, T vy) | |
| UT_Vector2T (const fpreal32 v[2]) | |
| UT_Vector2T (const fpreal64 v[2]) | |
| UT_Vector2T (const UT_Vector3T< T > &v) | |
| UT_Vector2T (const UT_Vector4T< T > &v) | |
| template<typename S > | |
| UT_Vector2T (const UT_Vector2T< S > &v) | |
| template<typename S > | |
| UT_Vector2T< T > & | operator= (const UT_Vector2T< S > &v) |
| UT_Vector2T< T > & | operator= (const UT_Vector3T< T > &v) |
| Assignment operator that truncates a V3 to a V2. | |
| UT_Vector2T< T > & | operator= (const UT_Vector4T< T > &v) |
| Assignment operator that truncates a V4 to a V2. | |
| UT_Vector2T< T > | operator- () const |
| UT_Vector2T< T > & | operator+= (const UT_Vector2T< T > &v) |
| UT_Vector2T< T > & | operator-= (const UT_Vector2T< T > &v) |
| unsigned | operator== (const UT_Vector2T< T > &v) const |
| unsigned | operator!= (const UT_Vector2T< T > &v) const |
| int | equalZero (T tol=0.00001f) const |
| int | isEqual (const UT_Vector2T< T > &v, T tol=0.00001f) const |
| bool | isNan () const |
| void | negate () |
| void | multiplyComponents (const UT_Vector2T< T > &v) |
| T | whichSide (const UT_Vector2T< T > &e1, const UT_Vector2T< T > &e2) const |
| UT_Vector2T< T > & | operator= (T scalar) |
| UT_Vector2T< T > & | operator+= (T scalar) |
| UT_Vector2T< T > & | operator-= (T scalar) |
| UT_Vector2T< T > & | operator*= (T scalar) |
| UT_Vector2T< T > & | operator*= (const UT_Vector2T< T > &v) |
| UT_Vector2T< T > & | operator/= (T scalar) |
| UT_Vector2T< T > & | operator/= (const UT_Vector2T< T > &v) |
| template<typename S > | |
| UT_Vector2T< T > & | operator*= (const UT_Matrix2T< S > &mat) |
| T | dot (const UT_Vector2T< T > &v) const |
| T | normalize (void) |
| T | length (void) const |
| The vector length (not to be confused with the vector dimension). | |
| T | length2 (void) const |
| The vector length squared. | |
| UT_Vector2T< T > | project (const UT_Vector2T< T > &u) |
| Calculates the orthogonal projection of a vector u on the *this vector. | |
| UT_Vector2T< T > | projection (const UT_Vector2T< T > &p, const UT_Vector2T< T > &v) const |
| UT_Vector3T< T > | getBary (const UT_Vector2T< T > &t0, const UT_Vector2T< T > &t1, const UT_Vector2T< T > &t2, bool *degen=NULL) const |
| unsigned | hash () const |
| Compute a hash. | |
| void | assign (T xx=0.0f, T yy=0.0f) |
| Set the values of the vector components. | |
| void | assign (const T *v) |
| Set the values of the vector components. | |
| int | findMinAbsAxis () const |
| These allow you to find out what indices to use for different axes. | |
| int | findMaxAbsAxis () const |
| These allow you to find out what indices to use for different axes. | |
| const T * | data (void) const |
| T * | data (void) |
| T & | x (void) |
| T | x (void) const |
| T & | y (void) |
| T | y (void) const |
| T & | operator() (unsigned i) |
| T | operator() (unsigned i) const |
| T & | operator[] (unsigned i) |
| T | operator[] (unsigned i) const |
| void | homogenize (void) |
| Express the point in homogeneous coordinates or vice-versa. | |
| void | dehomogenize (void) |
| Express the point in homogeneous coordinates or vice-versa. | |
| void | save (ostream &os, int binary=0) const |
| Protected I/O methods. | |
| bool | load (UT_IStream &is) |
| Protected I/O methods. | |
| bool | save (UT_JSONWriter &w) const |
| bool | save (UT_JSONValue &v) const |
| bool | load (UT_JSONParser &p) |
Static Public Member Functions | |
| static int | entries () |
| Returns the vector size. | |
Public Attributes | |
| T | vec [2] |
| The data. | |
Friends | |
| ostream & | operator<< (ostream &os, const UT_Vector2T< T > &v) |
| I/O friends. | |
Definition at line 117 of file UT_Vector2.h.
| UT_Vector2T< T >::UT_Vector2T | ( | void | ) | [inline] |
Default constructor. No data is initialized! Use it for extra speed.
Definition at line 121 of file UT_Vector2.h.
| UT_Vector2T< T >::UT_Vector2T | ( | T | vx, | |
| T | vy | |||
| ) | [inline] |
Definition at line 124 of file UT_Vector2.h.
| UT_Vector2T< T >::UT_Vector2T | ( | const fpreal32 | v[2] | ) | [inline, explicit] |
Definition at line 128 of file UT_Vector2.h.
| UT_Vector2T< T >::UT_Vector2T | ( | const fpreal64 | v[2] | ) | [inline, explicit] |
Definition at line 130 of file UT_Vector2.h.
| UT_Vector2T< T >::UT_Vector2T | ( | const UT_Vector3T< T > & | v | ) | [explicit] |
| UT_Vector2T< T >::UT_Vector2T | ( | const UT_Vector4T< T > & | v | ) | [explicit] |
| UT_Vector2T< T >::UT_Vector2T | ( | const UT_Vector2T< S > & | v | ) | [inline] |
Definition at line 135 of file UT_Vector2.h.
| void UT_Vector2T< T >::assign | ( | const T * | v | ) | [inline] |
| void UT_Vector2T< T >::assign | ( | T | xx = 0.0f, |
|
| T | yy = 0.0f | |||
| ) | [inline] |
| T* UT_Vector2T< T >::data | ( | void | ) | [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 307 of file UT_Vector2.h.
| const T* UT_Vector2T< T >::data | ( | void | ) | const [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 306 of file UT_Vector2.h.
| void UT_Vector2T< T >::dehomogenize | ( | void | ) | [inline] |
Express the point in homogeneous coordinates or vice-versa.
Definition at line 350 of file UT_Vector2.h.
| T UT_Vector2T< T >::dot | ( | const UT_Vector2T< T > & | v | ) | const [inline] |
Definition at line 248 of file UT_Vector2.h.
| static int UT_Vector2T< T >::entries | ( | void | ) | [inline, static] |
| int UT_Vector2T< T >::equalZero | ( | T | tol = 0.00001f |
) | const [inline] |
Definition at line 171 of file UT_Vector2.h.
| int UT_Vector2T< T >::findMaxAbsAxis | ( | ) | const [inline] |
These allow you to find out what indices to use for different axes.
Definition at line 273 of file UT_Vector2.h.
| int UT_Vector2T< T >::findMinAbsAxis | ( | ) | const [inline] |
These allow you to find out what indices to use for different axes.
Definition at line 266 of file UT_Vector2.h.
| UT_Vector3T<T> UT_Vector2T< T >::getBary | ( | const UT_Vector2T< T > & | t0, | |
| const UT_Vector2T< T > & | t1, | |||
| const UT_Vector2T< T > & | t2, | |||
| bool * | degen = NULL | |||
| ) | const |
Compute (homogeneous) barycentric co-ordinates of this point relative to the triangle defined by t0, t1 and t2. (The point is projected into the triangle's plane.)
| unsigned UT_Vector2T< T >::hash | ( | ) | const [inline] |
| void UT_Vector2T< T >::homogenize | ( | void | ) | [inline] |
Express the point in homogeneous coordinates or vice-versa.
Definition at line 349 of file UT_Vector2.h.
| int UT_Vector2T< T >::isEqual | ( | const UT_Vector2T< T > & | v, | |
| T | tol = 0.00001f | |||
| ) | const [inline] |
Definition at line 176 of file UT_Vector2.h.
| bool UT_Vector2T< T >::isNan | ( | ) | const [inline] |
Definition at line 182 of file UT_Vector2.h.
| T UT_Vector2T< T >::length | ( | void | ) | const [inline] |
The vector length (not to be confused with the vector dimension).
Definition at line 283 of file UT_Vector2.h.
| T UT_Vector2T< T >::length2 | ( | void | ) | const [inline] |
| bool UT_Vector2T< T >::load | ( | UT_JSONParser & | p | ) |
Methods to serialize to a JSON stream. The vector is stored as an array of 2 reals.
| bool UT_Vector2T< T >::load | ( | UT_IStream & | is | ) |
Protected I/O methods.
| void UT_Vector2T< T >::multiplyComponents | ( | const UT_Vector2T< T > & | v | ) | [inline] |
Definition at line 187 of file UT_Vector2.h.
| void UT_Vector2T< T >::negate | ( | void | ) | [inline] |
Definition at line 185 of file UT_Vector2.h.
| T UT_Vector2T< T >::normalize | ( | void | ) | [inline] |
Definition at line 252 of file UT_Vector2.h.
| unsigned UT_Vector2T< T >::operator!= | ( | const UT_Vector2T< T > & | v | ) | const [inline] |
Definition at line 170 of file UT_Vector2.h.
| T UT_Vector2T< T >::operator() | ( | unsigned | i | ) | const [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 317 of file UT_Vector2.h.
| T& UT_Vector2T< T >::operator() | ( | unsigned | i | ) | [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 312 of file UT_Vector2.h.
| UT_Vector2T<T>& UT_Vector2T< T >::operator*= | ( | const UT_Matrix2T< S > & | mat | ) | [inline] |
Definition at line 244 of file UT_Vector2.h.
| UT_Vector2T<T>& UT_Vector2T< T >::operator*= | ( | const UT_Vector2T< T > & | v | ) | [inline] |
Definition at line 226 of file UT_Vector2.h.
| UT_Vector2T<T>& UT_Vector2T< T >::operator*= | ( | T | scalar | ) | [inline] |
Definition at line 220 of file UT_Vector2.h.
| UT_Vector2T<T>& UT_Vector2T< T >::operator+= | ( | T | scalar | ) | [inline] |
Definition at line 210 of file UT_Vector2.h.
| UT_Vector2T<T>& UT_Vector2T< T >::operator+= | ( | const UT_Vector2T< T > & | v | ) | [inline] |
Definition at line 154 of file UT_Vector2.h.
| UT_Vector2T<T> UT_Vector2T< T >::operator- | ( | ) | const [inline] |
Definition at line 150 of file UT_Vector2.h.
| UT_Vector2T<T>& UT_Vector2T< T >::operator-= | ( | T | scalar | ) | [inline] |
Definition at line 216 of file UT_Vector2.h.
| UT_Vector2T<T>& UT_Vector2T< T >::operator-= | ( | const UT_Vector2T< T > & | v | ) | [inline] |
Definition at line 160 of file UT_Vector2.h.
| UT_Vector2T<T>& UT_Vector2T< T >::operator/= | ( | const UT_Vector2T< T > & | v | ) | [inline] |
Definition at line 236 of file UT_Vector2.h.
| UT_Vector2T<T>& UT_Vector2T< T >::operator/= | ( | T | scalar | ) | [inline] |
Definition at line 232 of file UT_Vector2.h.
| UT_Vector2T<T>& UT_Vector2T< T >::operator= | ( | T | scalar | ) | [inline] |
Definition at line 205 of file UT_Vector2.h.
| UT_Vector2T<T>& UT_Vector2T< T >::operator= | ( | const UT_Vector4T< T > & | v | ) |
Assignment operator that truncates a V4 to a V2.
| UT_Vector2T<T>& UT_Vector2T< T >::operator= | ( | const UT_Vector3T< T > & | v | ) |
Assignment operator that truncates a V3 to a V2.
| UT_Vector2T<T>& UT_Vector2T< T >::operator= | ( | const UT_Vector2T< S > & | v | ) | [inline] |
Definition at line 140 of file UT_Vector2.h.
| unsigned UT_Vector2T< T >::operator== | ( | const UT_Vector2T< T > & | v | ) | const [inline] |
Definition at line 166 of file UT_Vector2.h.
| T UT_Vector2T< T >::operator[] | ( | unsigned | i | ) | const [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 327 of file UT_Vector2.h.
| T& UT_Vector2T< T >::operator[] | ( | unsigned | i | ) | [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 322 of file UT_Vector2.h.
| UT_Vector2T<T> UT_Vector2T< T >::project | ( | const UT_Vector2T< T > & | u | ) |
Calculates the orthogonal projection of a vector u on the *this vector.
| UT_Vector2T<T> UT_Vector2T< T >::projection | ( | const UT_Vector2T< T > & | p, | |
| const UT_Vector2T< T > & | v | |||
| ) | const |
Vector p (representing a point in 2-space) and vector v define a line. This member returns the projection of "this" onto the line (the point on the line that is closest to this point).
| bool UT_Vector2T< T >::save | ( | UT_JSONValue & | v | ) | const |
Methods to serialize to a JSON stream. The vector is stored as an array of 2 reals.
| bool UT_Vector2T< T >::save | ( | UT_JSONWriter & | w | ) | const |
Methods to serialize to a JSON stream. The vector is stored as an array of 2 reals.
| void UT_Vector2T< T >::save | ( | ostream & | os, | |
| int | binary = 0 | |||
| ) | const |
Protected I/O methods.
| T UT_Vector2T< T >::whichSide | ( | const UT_Vector2T< T > & | e1, | |
| const UT_Vector2T< T > & | e2 | |||
| ) | const [inline] |
Given an oriented line from e1 passing through e2, determine on which side of the line the point p lies. Alternatively, determine in which half plane, positive or negative, the point lies. If the segment degenerates to a point, then the point is always on it.
Definition at line 199 of file UT_Vector2.h.
| T UT_Vector2T< T >::x | ( | void | ) | const [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 309 of file UT_Vector2.h.
| T& UT_Vector2T< T >::x | ( | void | ) | [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 308 of file UT_Vector2.h.
| T UT_Vector2T< T >::y | ( | void | ) | const [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 311 of file UT_Vector2.h.
| T& UT_Vector2T< T >::y | ( | void | ) | [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 310 of file UT_Vector2.h.
| ostream& operator<< | ( | ostream & | os, | |
| const UT_Vector2T< T > & | v | |||
| ) | [friend] |
| T UT_Vector2T< T >::vec[2] |
1.5.9