Open CASCADE Technology
7.4.0
|
Generic 4-components vector. To be used as RGBA color vector or XYZW 3D-point with special W-component for operations with projection / model view matrices. Use this class for 3D-points carefully because declared W-component may results in incorrect results if used without matrices. More...
#include <NCollection_Vec4.hxx>
Public Member Functions | |
NCollection_Vec4 () | |
Empty constructor. Construct the zero vector. More... | |
NCollection_Vec4 (const Element_t theValue) | |
Initialize ALL components of vector within specified value. More... | |
NCollection_Vec4 (const Element_t theX, const Element_t theY, const Element_t theZ, const Element_t theW) | |
Per-component constructor. More... | |
NCollection_Vec4 (const NCollection_Vec2< Element_t > &theVec2) | |
Constructor from 2-components vector. More... | |
NCollection_Vec4 (const NCollection_Vec3< Element_t > &theVec3, const Element_t theW=Element_t(0)) | |
Constructor from 3-components vector + optional 4th value. More... | |
template<typename OtherElement_t > | |
NCollection_Vec4 (const NCollection_Vec4< OtherElement_t > &theOtherVec4) | |
Conversion constructor (explicitly converts some 4-component vector with other element type to a new 4-component vector with the element type Element_t, whose elements are static_cast'ed corresponding elements of theOtherVec4 vector) More... | |
void | SetValues (const Element_t theX, const Element_t theY, const Element_t theZ, const Element_t theW) |
Assign new values to the vector. More... | |
void | SetValues (const NCollection_Vec3< Element_t > &theVec3, const Element_t theW) |
Assign new values as 3-component vector and a 4-th value. More... | |
Element_t | x () const |
Alias to 1st component as X coordinate in XYZW. More... | |
Element_t | r () const |
Alias to 1st component as RED channel in RGBA. More... | |
Element_t | y () const |
Alias to 2nd component as Y coordinate in XYZW. More... | |
Element_t | g () const |
Alias to 2nd component as GREEN channel in RGBA. More... | |
Element_t | z () const |
Alias to 3rd component as Z coordinate in XYZW. More... | |
Element_t | b () const |
Alias to 3rd component as BLUE channel in RGBA. More... | |
Element_t | w () const |
Alias to 4th component as W coordinate in XYZW. More... | |
Element_t | a () const |
Alias to 4th component as ALPHA channel in RGBA. More... | |
Element_t & | x () |
Alias to 1st component as X coordinate in XYZW. More... | |
Element_t & | r () |
Alias to 1st component as RED channel in RGBA. More... | |
Element_t & | y () |
Alias to 2nd component as Y coordinate in XYZW. More... | |
Element_t & | g () |
Alias to 2nd component as GREEN channel in RGBA. More... | |
Element_t & | z () |
Alias to 3rd component as Z coordinate in XYZW. More... | |
Element_t & | b () |
Alias to 3rd component as BLUE channel in RGBA. More... | |
Element_t & | w () |
Alias to 4th component as W coordinate in XYZW. More... | |
Element_t & | a () |
Alias to 4th component as ALPHA channel in RGBA. More... | |
bool | IsEqual (const NCollection_Vec4 &theOther) const |
Check this vector with another vector for equality (without tolerance!). More... | |
bool | operator== (const NCollection_Vec4 &theOther) |
Check this vector with another vector for equality (without tolerance!). More... | |
bool | operator== (const NCollection_Vec4 &theOther) const |
bool | operator!= (const NCollection_Vec4 &theOther) |
Check this vector with another vector for non-equality (without tolerance!). More... | |
bool | operator!= (const NCollection_Vec4 &theOther) const |
const Element_t * | GetData () const |
Raw access to the data (for OpenGL exchange). More... | |
Element_t * | ChangeData () |
operator const Element_t * () const | |
operator Element_t * () | |
NCollection_Vec4 & | operator+= (const NCollection_Vec4 &theAdd) |
Compute per-component summary. More... | |
NCollection_Vec4 | operator- () const |
Unary -. More... | |
NCollection_Vec4 & | operator-= (const NCollection_Vec4 &theDec) |
Compute per-component subtraction. More... | |
NCollection_Vec4 & | operator*= (const NCollection_Vec4 &theRight) |
Compute per-component multiplication. More... | |
void | Multiply (const Element_t theFactor) |
Compute per-component multiplication. More... | |
NCollection_Vec4 & | operator*= (const Element_t theFactor) |
Compute per-component multiplication. More... | |
NCollection_Vec4 | operator* (const Element_t theFactor) const |
Compute per-component multiplication. More... | |
NCollection_Vec4 | Multiplied (const Element_t theFactor) const |
Compute per-component multiplication. More... | |
NCollection_Vec4 | cwiseMin (const NCollection_Vec4 &theVec) const |
Compute component-wise minimum of two vectors. More... | |
NCollection_Vec4 | cwiseMax (const NCollection_Vec4 &theVec) const |
Compute component-wise maximum of two vectors. More... | |
NCollection_Vec4 | cwiseAbs () const |
Compute component-wise modulus of the vector. More... | |
Element_t | maxComp () const |
Compute maximum component of the vector. More... | |
Element_t | minComp () const |
Compute minimum component of the vector. More... | |
Element_t | Dot (const NCollection_Vec4 &theOther) const |
Computes the dot product. More... | |
NCollection_Vec4 & | operator/= (const Element_t theInvFactor) |
Compute per-component division by scale factor. More... | |
NCollection_Vec4 & | operator/= (const NCollection_Vec4 &theRight) |
Compute per-component division. More... | |
NCollection_Vec4 | operator/ (const Element_t theInvFactor) |
Compute per-component division by scale factor. More... | |
template<> | |
NCollection_Vec4< float > & | operator/= (const float theInvFactor) |
Optimized concretization for float type. More... | |
template<> | |
NCollection_Vec4< double > & | operator/= (const double theInvFactor) |
Optimized concretization for double type. More... | |
Static Public Member Functions | |
static int | Length () |
Returns the number of components. More... | |
Friends | |
NCollection_Vec4 | operator+ (const NCollection_Vec4 &theLeft, const NCollection_Vec4 &theRight) |
Compute per-component summary. More... | |
NCollection_Vec4 | operator- (const NCollection_Vec4 &theLeft, const NCollection_Vec4 &theRight) |
Compute per-component subtraction. More... | |
NCollection_Vec4 | operator* (const NCollection_Vec4 &theLeft, const NCollection_Vec4 &theRight) |
Compute per-component multiplication. More... | |
NCollection_Vec4 | operator/ (const NCollection_Vec4 &theLeft, const NCollection_Vec4 &theRight) |
Compute per-component division. More... | |
Generic 4-components vector. To be used as RGBA color vector or XYZW 3D-point with special W-component for operations with projection / model view matrices. Use this class for 3D-points carefully because declared W-component may results in incorrect results if used without matrices.
|
inline |
Empty constructor. Construct the zero vector.
|
inlineexplicit |
Initialize ALL components of vector within specified value.
|
inlineexplicit |
Per-component constructor.
|
inlineexplicit |
Constructor from 2-components vector.
|
inlineexplicit |
Constructor from 3-components vector + optional 4th value.
|
inlineexplicit |
Conversion constructor (explicitly converts some 4-component vector with other element type to a new 4-component vector with the element type Element_t, whose elements are static_cast'ed corresponding elements of theOtherVec4 vector)
OtherElement_t | the element type of the other 4-component vector theOtherVec4 |
theOtherVec4 | the 4-component vector that needs to be converted |
|
inline |
Alias to 4th component as ALPHA channel in RGBA.
|
inline |
Alias to 4th component as ALPHA channel in RGBA.
|
inline |
Alias to 3rd component as BLUE channel in RGBA.
|
inline |
Alias to 3rd component as BLUE channel in RGBA.
|
inline |
|
inline |
Compute component-wise modulus of the vector.
|
inline |
Compute component-wise maximum of two vectors.
|
inline |
Compute component-wise minimum of two vectors.
|
inline |
Computes the dot product.
|
inline |
Alias to 2nd component as GREEN channel in RGBA.
|
inline |
Alias to 2nd component as GREEN channel in RGBA.
|
inline |
Raw access to the data (for OpenGL exchange).
|
inline |
Check this vector with another vector for equality (without tolerance!).
|
inlinestatic |
Returns the number of components.
|
inline |
Compute maximum component of the vector.
|
inline |
Compute minimum component of the vector.
|
inline |
Compute per-component multiplication.
|
inline |
Compute per-component multiplication.
|
inline |
|
inline |
|
inline |
Check this vector with another vector for non-equality (without tolerance!).
|
inline |
|
inline |
Compute per-component multiplication.
|
inline |
Compute per-component multiplication.
|
inline |
Compute per-component multiplication.
|
inline |
Compute per-component summary.
|
inline |
Unary -.
|
inline |
Compute per-component subtraction.
|
inline |
Compute per-component division by scale factor.
|
inline |
Compute per-component division by scale factor.
|
inline |
Compute per-component division.
|
inline |
Optimized concretization for float type.
|
inline |
Optimized concretization for double type.
|
inline |
Check this vector with another vector for equality (without tolerance!).
|
inline |
|
inline |
Alias to 1st component as RED channel in RGBA.
|
inline |
Alias to 1st component as RED channel in RGBA.
|
inline |
Assign new values to the vector.
|
inline |
Assign new values as 3-component vector and a 4-th value.
|
inline |
Alias to 4th component as W coordinate in XYZW.
|
inline |
Alias to 4th component as W coordinate in XYZW.
|
inline |
Alias to 1st component as X coordinate in XYZW.
|
inline |
Alias to 1st component as X coordinate in XYZW.
|
inline |
Alias to 2nd component as Y coordinate in XYZW.
|
inline |
Alias to 2nd component as Y coordinate in XYZW.
|
inline |
Alias to 3rd component as Z coordinate in XYZW.
|
inline |
Alias to 3rd component as Z coordinate in XYZW.
|
friend |
Compute per-component multiplication.
|
friend |
Compute per-component summary.
|
friend |
Compute per-component subtraction.
|
friend |
Compute per-component division.