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_Vec3< Element_t > Class Template Reference

Generic 3-components vector. To be used as RGB color pixel or XYZ 3D-point. The main target for this class - to handle raw low-level arrays (from/to graphic driver etc.).

#include <NCollection_Vec3.hxx>

Public Member Functions

 NCollection_Vec3 ()
 Empty constructor. Construct the zero vector.
 NCollection_Vec3 (Element_t theValue)
 Initialize ALL components of vector within specified value.
 NCollection_Vec3 (const Element_t theX, const Element_t theY, const Element_t theZ)
 Per-component constructor.
 NCollection_Vec3 (const NCollection_Vec2< Element_t > &theVec2)
 Constructor from 2-components vector.
 NCollection_Vec3 (const NCollection_Vec3 &theVec3)
 Copy constructor.
const NCollection_Vec3operator= (const NCollection_Vec3 &theVec3)
 Assignment operator.
Element_t x () const
 Alias to 1st component as X coordinate in XYZ.
Element_t r () const
 Alias to 1st component as RED channel in RGB.
Element_t y () const
 Alias to 2nd component as Y coordinate in XYZ.
Element_t g () const
 Alias to 2nd component as GREEN channel in RGB.
Element_t z () const
 Alias to 3rd component as Z coordinate in XYZ.
Element_t b () const
 Alias to 3rd component as BLUE channel in RGB.
 NCOLLECTION_VEC_COMPONENTS_2D (x, y)
 NCOLLECTION_VEC_COMPONENTS_2D (x, z)
 NCOLLECTION_VEC_COMPONENTS_2D (y, z)
 NCOLLECTION_VEC_COMPONENTS_3D (x, y, z)
Element_t & x ()
 Alias to 1st component as X coordinate in XYZ.
Element_t & r ()
 Alias to 1st component as RED channel in RGB.
Element_t & y ()
 Alias to 2nd component as Y coordinate in XYZ.
Element_t & g ()
 Alias to 2nd component as GREEN channel in RGB.
Element_t & z ()
 Alias to 3rd component as Z coordinate in XYZ.
Element_t & b ()
 Alias to 3rd component as BLUE channel in RGB.
NCollection_Vec2< Element_t > & xy ()
NCollection_Vec2< Element_t > & yz ()
const Element_t * GetData () const
 Raw access to the data (for OpenGL exchange).
 operator const Element_t * () const
 operator Element_t * ()
NCollection_Vec3operator+= (const NCollection_Vec3 &theAdd)
 Compute per-component summary.
NCollection_Vec3 operator- () const
 Unary -.
NCollection_Vec3operator-= (const NCollection_Vec3 &theDec)
 Compute per-component subtraction.
void Multiply (const Element_t theFactor)
 Compute per-component multiplication by scale factor.
NCollection_Vec3operator*= (const NCollection_Vec3 &theRight)
 Compute per-component multiplication.
NCollection_Vec3operator*= (const Element_t theFactor)
 Compute per-component multiplication by scale factor.
NCollection_Vec3 operator* (const Element_t theFactor) const
 Compute per-component multiplication by scale factor.
NCollection_Vec3 Multiplied (const Element_t theFactor) const
 Compute per-component multiplication by scale factor.
NCollection_Vec3operator/= (const Element_t theInvFactor)
 Compute per-component division by scale factor.
NCollection_Vec3 operator/ (const Element_t theInvFactor)
 Compute per-component division by scale factor.
Element_t Dot (const NCollection_Vec3 &theOther) const
 Computes the dot product.
Element_t Modulus () const
 Computes the vector modulus (magnitude, length).
Element_t SquareModulus () const
 Computes the square of vector modulus (magnitude, length). This method may be used for performance tricks.
void Normalize ()
 Normalize the vector.
NCollection_Vec3 Normalized () const
 Normalize the vector.
template<>
NCollection_Vec3< float > & operator/= (const float theInvFactor)
template<>
NCollection_Vec3< double > & operator/= (const double theInvFactor)

Static Public Member Functions

static int Length ()
 Returns the number of components.
static NCollection_Vec3 Cross (const NCollection_Vec3 &theVec1, const NCollection_Vec3 &theVec2)
 Computes the cross product.
static NCollection_Vec3 GetLERP (const NCollection_Vec3 &theFrom, const NCollection_Vec3 &theTo, const Element_t theT)
 Compute linear interpolation between to vectors.
static NCollection_Vec3 DX ()
 Constuct DX unit vector.
static NCollection_Vec3 DY ()
 Constuct DY unit vector.
static NCollection_Vec3 DZ ()
 Constuct DZ unit vector.

Friends

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

template<typename Element_t>
class NCollection_Vec3< Element_t >


Constructor & Destructor Documentation

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

Member Function Documentation

template<typename Element_t >
Element_t NCollection_Vec3< Element_t >::b ( ) const [inline]
template<typename Element_t >
Element_t& NCollection_Vec3< Element_t >::b ( ) [inline]
template<typename Element_t >
static NCollection_Vec3 NCollection_Vec3< Element_t >::Cross ( const NCollection_Vec3< Element_t > &  theVec1,
const NCollection_Vec3< Element_t > &  theVec2 
) [inline, static]
template<typename Element_t >
Element_t NCollection_Vec3< Element_t >::Dot ( const NCollection_Vec3< Element_t > &  theOther) const [inline]
template<typename Element_t >
static NCollection_Vec3 NCollection_Vec3< Element_t >::DX ( ) [inline, static]
template<typename Element_t >
static NCollection_Vec3 NCollection_Vec3< Element_t >::DY ( ) [inline, static]
template<typename Element_t >
static NCollection_Vec3 NCollection_Vec3< Element_t >::DZ ( ) [inline, static]
template<typename Element_t >
Element_t NCollection_Vec3< Element_t >::g ( ) const [inline]
template<typename Element_t >
Element_t& NCollection_Vec3< Element_t >::g ( ) [inline]
template<typename Element_t >
const Element_t* NCollection_Vec3< Element_t >::GetData ( ) const [inline]
template<typename Element_t >
static NCollection_Vec3 NCollection_Vec3< Element_t >::GetLERP ( const NCollection_Vec3< Element_t > &  theFrom,
const NCollection_Vec3< Element_t > &  theTo,
const Element_t  theT 
) [inline, static]
Parameters:
theT- interpolation coefficient 0..1;
Returns:
interpolation result.
template<typename Element_t >
static int NCollection_Vec3< Element_t >::Length ( void  ) [inline, static]
template<typename Element_t >
Element_t NCollection_Vec3< Element_t >::Modulus ( ) const [inline]
template<typename Element_t >
NCollection_Vec3 NCollection_Vec3< Element_t >::Multiplied ( const Element_t  theFactor) const [inline]
template<typename Element_t >
void NCollection_Vec3< Element_t >::Multiply ( const Element_t  theFactor) [inline]
template<typename Element_t >
NCollection_Vec3< Element_t >::NCOLLECTION_VEC_COMPONENTS_2D ( x  ,
y   
)
Returns:
2 components by their names in specified order (in GLSL-style)
template<typename Element_t >
NCollection_Vec3< Element_t >::NCOLLECTION_VEC_COMPONENTS_2D ( x  ,
z   
)
template<typename Element_t >
NCollection_Vec3< Element_t >::NCOLLECTION_VEC_COMPONENTS_2D ( y  ,
z   
)
template<typename Element_t >
NCollection_Vec3< Element_t >::NCOLLECTION_VEC_COMPONENTS_3D ( x  ,
y  ,
z   
)
Returns:
3 components by their names in specified order (in GLSL-style)
template<typename Element_t >
void NCollection_Vec3< Element_t >::Normalize ( ) [inline]
template<typename Element_t >
NCollection_Vec3 NCollection_Vec3< Element_t >::Normalized ( ) const [inline]
template<typename Element_t >
NCollection_Vec3< Element_t >::operator const Element_t * ( ) const [inline]
template<typename Element_t >
NCollection_Vec3< Element_t >::operator Element_t * ( ) [inline]
template<typename Element_t >
NCollection_Vec3 NCollection_Vec3< Element_t >::operator* ( const Element_t  theFactor) const [inline]
template<typename Element_t >
NCollection_Vec3& NCollection_Vec3< Element_t >::operator*= ( const NCollection_Vec3< Element_t > &  theRight) [inline]
template<typename Element_t >
NCollection_Vec3& NCollection_Vec3< Element_t >::operator*= ( const Element_t  theFactor) [inline]
template<typename Element_t >
NCollection_Vec3& NCollection_Vec3< Element_t >::operator+= ( const NCollection_Vec3< Element_t > &  theAdd) [inline]
template<typename Element_t >
NCollection_Vec3 NCollection_Vec3< Element_t >::operator- ( ) const [inline]
template<typename Element_t >
NCollection_Vec3& NCollection_Vec3< Element_t >::operator-= ( const NCollection_Vec3< Element_t > &  theDec) [inline]
template<typename Element_t >
NCollection_Vec3 NCollection_Vec3< Element_t >::operator/ ( const Element_t  theInvFactor) [inline]
template<typename Element_t >
NCollection_Vec3& NCollection_Vec3< Element_t >::operator/= ( const Element_t  theInvFactor) [inline]
template<>
NCollection_Vec3< float > & NCollection_Vec3< float >::operator/= ( const float  theInvFactor) [inline]
template<>
NCollection_Vec3< double > & NCollection_Vec3< double >::operator/= ( const double  theInvFactor) [inline]
template<typename Element_t >
const NCollection_Vec3& NCollection_Vec3< Element_t >::operator= ( const NCollection_Vec3< Element_t > &  theVec3) [inline]
template<typename Element_t >
Element_t NCollection_Vec3< Element_t >::r ( ) const [inline]
template<typename Element_t >
Element_t& NCollection_Vec3< Element_t >::r ( ) [inline]
template<typename Element_t >
Element_t NCollection_Vec3< Element_t >::SquareModulus ( ) const [inline]
template<typename Element_t >
Element_t NCollection_Vec3< Element_t >::x ( ) const [inline]
template<typename Element_t >
Element_t& NCollection_Vec3< Element_t >::x ( ) [inline]
template<typename Element_t >
NCollection_Vec2<Element_t>& NCollection_Vec3< Element_t >::xy ( ) [inline]
Returns:
XY-components modifiable vector
template<typename Element_t >
Element_t NCollection_Vec3< Element_t >::y ( ) const [inline]
template<typename Element_t >
Element_t& NCollection_Vec3< Element_t >::y ( ) [inline]
template<typename Element_t >
NCollection_Vec2<Element_t>& NCollection_Vec3< Element_t >::yz ( ) [inline]
Returns:
YZ-components modifiable vector
template<typename Element_t >
Element_t NCollection_Vec3< Element_t >::z ( ) const [inline]
template<typename Element_t >
Element_t& NCollection_Vec3< Element_t >::z ( ) [inline]

Friends And Related Function Documentation

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

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