Open CASCADE Technology  6.5.4
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Friends
NCollection_Vec4< Element_t > Class Template Reference

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.

#include <NCollection_Vec4.hxx>

Public Member Functions

 NCollection_Vec4 ()
 Empty constructor. Construct the zero vector.
 NCollection_Vec4 (const Element_t theValue)
 Initialize ALL components of vector within specified value.
 NCollection_Vec4 (const Element_t theX, const Element_t theY, const Element_t theZ, const Element_t theW)
 Per-component constructor.
 NCollection_Vec4 (const NCollection_Vec2< Element_t > &theVec2)
 Constructor from 2-components vector.
 NCollection_Vec4 (const NCollection_Vec3< Element_t > &theVec3)
 Constructor from 3-components vector.
 NCollection_Vec4 (const NCollection_Vec3< Element_t > &theVec3, const Element_t theAlpha)
 Constructor from 3-components vector + alpha value.
 NCollection_Vec4 (const NCollection_Vec4 &theVec4)
 Copy constructor.
const NCollection_Vec4operator= (const NCollection_Vec4 &theVec4)
 Assignment operator.
Element_t x () const
 Alias to 1st component as X coordinate in XYZW.
Element_t r () const
 Alias to 1st component as RED channel in RGBA.
Element_t y () const
 Alias to 2nd component as Y coordinate in XYZW.
Element_t g () const
 Alias to 2nd component as GREEN channel in RGBA.
Element_t z () const
 Alias to 3rd component as Z coordinate in XYZW.
Element_t b () const
 Alias to 3rd component as BLUE channel in RGBA.
Element_t w () const
 Alias to 4th component as W coordinate in XYZW.
Element_t a () const
 Alias to 4th component as ALPHA channel in RGBA.
 NCOLLECTION_VEC_COMPONENTS_2D (x, y)
 NCOLLECTION_VEC_COMPONENTS_2D (x, z)
 NCOLLECTION_VEC_COMPONENTS_2D (x, w)
 NCOLLECTION_VEC_COMPONENTS_2D (y, z)
 NCOLLECTION_VEC_COMPONENTS_2D (y, w)
 NCOLLECTION_VEC_COMPONENTS_2D (z, w)
 NCOLLECTION_VEC_COMPONENTS_3D (x, y, z)
 NCOLLECTION_VEC_COMPONENTS_3D (x, y, w)
 NCOLLECTION_VEC_COMPONENTS_3D (x, z, w)
 NCOLLECTION_VEC_COMPONENTS_3D (y, z, w)
 NCOLLECTION_VEC_COMPONENTS_3D (r, g, b)
Element_t & x ()
 Alias to 1st component as X coordinate in XYZW.
Element_t & r ()
 Alias to 1st component as RED channel in RGBA.
Element_t & y ()
 Alias to 2nd component as Y coordinate in XYZW.
Element_t & g ()
 Alias to 2nd component as GREEN channel in RGBA.
Element_t & z ()
 Alias to 3rd component as Z coordinate in XYZW.
Element_t & b ()
 Alias to 3rd component as BLUE channel in RGBA.
Element_t & w ()
 Alias to 4th component as W coordinate in XYZW.
Element_t & a ()
 Alias to 4th component as ALPHA channel in RGBA.
NCollection_Vec2< Element_t > & xy ()
NCollection_Vec2< Element_t > & yz ()
NCollection_Vec2< Element_t > & zw ()
NCollection_Vec3< Element_t > & xyz ()
NCollection_Vec3< Element_t > & yzw ()
const Element_t * GetData () const
 Raw access to the data (for OpenGL exchange).
 operator const Element_t * () const
 operator Element_t * ()
NCollection_Vec4operator+= (const NCollection_Vec4 &theAdd)
 Compute per-component summary.
NCollection_Vec4operator-= (const NCollection_Vec4 &theDec)
 Compute per-component subtraction.
NCollection_Vec4operator*= (const NCollection_Vec4 &theRight)
 Compute per-component multiplication.
void Multiply (const Element_t theFactor)
 Compute per-component multiplication.
NCollection_Vec4operator*= (const Element_t theFactor)
 Compute per-component multiplication.
NCollection_Vec4 operator* (const Element_t theFactor) const
 Compute per-component multiplication.
NCollection_Vec4 Multiplied (const Element_t theFactor) const
 Compute per-component multiplication.
NCollection_Vec4operator/= (const Element_t theInvFactor)
 Compute per-component division by scale factor.
NCollection_Vec4 operator/ (const Element_t theInvFactor)
 Compute per-component division by scale factor.
template<>
NCollection_Vec4< float > & operator/= (const float theInvFactor)
template<>
NCollection_Vec4< double > & operator/= (const double theInvFactor)

Static Public Member Functions

static size_t Length ()
 Returns the number of components.

Friends

NCollection_Vec4 operator+ (const NCollection_Vec4 &theLeft, const NCollection_Vec4 &theRight)
 Compute per-component summary.
NCollection_Vec4 operator- (const NCollection_Vec4 &theLeft, const NCollection_Vec4 &theRight)
 Compute per-component subtraction.
NCollection_Vec4 operator* (const NCollection_Vec4 &theLeft, const NCollection_Vec4 &theRight)
 Compute per-component multiplication.

template<typename Element_t>
class NCollection_Vec4< Element_t >


Constructor & Destructor Documentation

template<typename Element_t >
NCollection_Vec4< Element_t >::NCollection_Vec4 ( ) [inline]
template<typename Element_t >
NCollection_Vec4< Element_t >::NCollection_Vec4 ( const Element_t  theValue) [inline, explicit]
template<typename Element_t >
NCollection_Vec4< Element_t >::NCollection_Vec4 ( const Element_t  theX,
const Element_t  theY,
const Element_t  theZ,
const Element_t  theW 
) [inline, explicit]
template<typename Element_t >
NCollection_Vec4< Element_t >::NCollection_Vec4 ( const NCollection_Vec2< Element_t > &  theVec2) [inline, explicit]
template<typename Element_t >
NCollection_Vec4< Element_t >::NCollection_Vec4 ( const NCollection_Vec3< Element_t > &  theVec3) [inline, explicit]
template<typename Element_t >
NCollection_Vec4< Element_t >::NCollection_Vec4 ( const NCollection_Vec3< Element_t > &  theVec3,
const Element_t  theAlpha 
) [inline, explicit]
template<typename Element_t >
NCollection_Vec4< Element_t >::NCollection_Vec4 ( const NCollection_Vec4< Element_t > &  theVec4) [inline]

Member Function Documentation

template<typename Element_t >
Element_t NCollection_Vec4< Element_t >::a ( ) const [inline]
template<typename Element_t >
Element_t& NCollection_Vec4< Element_t >::a ( ) [inline]
template<typename Element_t >
Element_t NCollection_Vec4< Element_t >::b ( ) const [inline]
template<typename Element_t >
Element_t& NCollection_Vec4< Element_t >::b ( ) [inline]
template<typename Element_t >
Element_t NCollection_Vec4< Element_t >::g ( ) const [inline]
template<typename Element_t >
Element_t& NCollection_Vec4< Element_t >::g ( ) [inline]
template<typename Element_t >
const Element_t* NCollection_Vec4< Element_t >::GetData ( ) const [inline]
template<typename Element_t >
static size_t NCollection_Vec4< Element_t >::Length ( void  ) [inline, static]
template<typename Element_t >
NCollection_Vec4 NCollection_Vec4< Element_t >::Multiplied ( const Element_t  theFactor) const [inline]
template<typename Element_t >
void NCollection_Vec4< Element_t >::Multiply ( const Element_t  theFactor) [inline]
template<typename Element_t >
NCollection_Vec4< Element_t >::NCOLLECTION_VEC_COMPONENTS_2D ( x  ,
y   
)
Returns:
2 of XYZW components in specified order as vector in GLSL-style
template<typename Element_t >
NCollection_Vec4< Element_t >::NCOLLECTION_VEC_COMPONENTS_2D ( x  ,
z   
)
template<typename Element_t >
NCollection_Vec4< Element_t >::NCOLLECTION_VEC_COMPONENTS_2D ( x  ,
w   
)
template<typename Element_t >
NCollection_Vec4< Element_t >::NCOLLECTION_VEC_COMPONENTS_2D ( y  ,
z   
)
template<typename Element_t >
NCollection_Vec4< Element_t >::NCOLLECTION_VEC_COMPONENTS_2D ( y  ,
w   
)
template<typename Element_t >
NCollection_Vec4< Element_t >::NCOLLECTION_VEC_COMPONENTS_2D ( z  ,
w   
)
template<typename Element_t >
NCollection_Vec4< Element_t >::NCOLLECTION_VEC_COMPONENTS_3D ( x  ,
y  ,
z   
)
Returns:
3 of XYZW components in specified order as vector in GLSL-style
template<typename Element_t >
NCollection_Vec4< Element_t >::NCOLLECTION_VEC_COMPONENTS_3D ( x  ,
y  ,
w   
)
template<typename Element_t >
NCollection_Vec4< Element_t >::NCOLLECTION_VEC_COMPONENTS_3D ( x  ,
z  ,
w   
)
template<typename Element_t >
NCollection_Vec4< Element_t >::NCOLLECTION_VEC_COMPONENTS_3D ( y  ,
z  ,
w   
)
template<typename Element_t >
NCollection_Vec4< Element_t >::NCOLLECTION_VEC_COMPONENTS_3D ( r  ,
g  ,
b   
)
Returns:
RGB components as vector
template<typename Element_t >
NCollection_Vec4< Element_t >::operator const Element_t * ( ) const [inline]
template<typename Element_t >
NCollection_Vec4< Element_t >::operator Element_t * ( ) [inline]
template<typename Element_t >
NCollection_Vec4 NCollection_Vec4< Element_t >::operator* ( const Element_t  theFactor) const [inline]
template<typename Element_t >
NCollection_Vec4& NCollection_Vec4< Element_t >::operator*= ( const NCollection_Vec4< Element_t > &  theRight) [inline]
template<typename Element_t >
NCollection_Vec4& NCollection_Vec4< Element_t >::operator*= ( const Element_t  theFactor) [inline]
template<typename Element_t >
NCollection_Vec4& NCollection_Vec4< Element_t >::operator+= ( const NCollection_Vec4< Element_t > &  theAdd) [inline]
template<typename Element_t >
NCollection_Vec4& NCollection_Vec4< Element_t >::operator-= ( const NCollection_Vec4< Element_t > &  theDec) [inline]
template<typename Element_t >
NCollection_Vec4 NCollection_Vec4< Element_t >::operator/ ( const Element_t  theInvFactor) [inline]
template<typename Element_t >
NCollection_Vec4& NCollection_Vec4< Element_t >::operator/= ( const Element_t  theInvFactor) [inline]
template<>
NCollection_Vec4< float > & NCollection_Vec4< float >::operator/= ( const float  theInvFactor) [inline]
template<>
NCollection_Vec4< double > & NCollection_Vec4< double >::operator/= ( const double  theInvFactor) [inline]
template<typename Element_t >
const NCollection_Vec4& NCollection_Vec4< Element_t >::operator= ( const NCollection_Vec4< Element_t > &  theVec4) [inline]
template<typename Element_t >
Element_t NCollection_Vec4< Element_t >::r ( ) const [inline]
template<typename Element_t >
Element_t& NCollection_Vec4< Element_t >::r ( ) [inline]
template<typename Element_t >
Element_t NCollection_Vec4< Element_t >::w ( ) const [inline]
template<typename Element_t >
Element_t& NCollection_Vec4< Element_t >::w ( ) [inline]
template<typename Element_t >
Element_t NCollection_Vec4< Element_t >::x ( ) const [inline]
template<typename Element_t >
Element_t& NCollection_Vec4< Element_t >::x ( ) [inline]
template<typename Element_t >
NCollection_Vec2<Element_t>& NCollection_Vec4< Element_t >::xy ( ) [inline]
Returns:
XY-components modifiable vector
template<typename Element_t >
NCollection_Vec3<Element_t>& NCollection_Vec4< Element_t >::xyz ( ) [inline]
Returns:
XYZ-components modifiable vector
template<typename Element_t >
Element_t NCollection_Vec4< Element_t >::y ( ) const [inline]
template<typename Element_t >
Element_t& NCollection_Vec4< Element_t >::y ( ) [inline]
template<typename Element_t >
NCollection_Vec2<Element_t>& NCollection_Vec4< Element_t >::yz ( ) [inline]
Returns:
YZ-components modifiable vector
template<typename Element_t >
NCollection_Vec3<Element_t>& NCollection_Vec4< Element_t >::yzw ( ) [inline]
Returns:
YZW-components modifiable vector
template<typename Element_t >
Element_t NCollection_Vec4< Element_t >::z ( ) const [inline]
template<typename Element_t >
Element_t& NCollection_Vec4< Element_t >::z ( ) [inline]
template<typename Element_t >
NCollection_Vec2<Element_t>& NCollection_Vec4< Element_t >::zw ( ) [inline]
Returns:
YZ-components modifiable vector

Friends And Related Function Documentation

template<typename Element_t >
NCollection_Vec4 operator* ( const NCollection_Vec4< Element_t > &  theLeft,
const NCollection_Vec4< Element_t > &  theRight 
) [friend]
template<typename Element_t >
NCollection_Vec4 operator+ ( const NCollection_Vec4< Element_t > &  theLeft,
const NCollection_Vec4< Element_t > &  theRight 
) [friend]
template<typename Element_t >
NCollection_Vec4 operator- ( const NCollection_Vec4< Element_t > &  theLeft,
const NCollection_Vec4< Element_t > &  theRight 
) [friend]

The documentation for this class was generated from the following file: