Open CASCADE Technology 6.6.0
Public Member Functions | Static Public Member Functions | Friends
NCollection_Vec2< Element_t > Class Template Reference

Defines the 2D-vector template. The main target for this class - to handle raw low-level arrays (from/to graphic driver etc.).

#include <NCollection_Vec2.hxx>

Public Member Functions

 NCollection_Vec2 ()
 Empty constructor. Construct the zero vector.
 NCollection_Vec2 (const Element_t theXY)
 Initialize ALL components of vector within specified value.
 NCollection_Vec2 (const Element_t theX, const Element_t theY)
 Per-component constructor.
 NCollection_Vec2 (const NCollection_Vec2 &theVec2)
 Copy constructor.
const NCollection_Vec2operator= (const NCollection_Vec2 &theVec2)
 Assignment operator.
Element_t x () const
 Alias to 1st component as X coordinate in XY.
Element_t y () const
 Alias to 2nd component as Y coordinate in XY.
 NCOLLECTION_VEC_COMPONENTS_2D (x, y)
Element_t & x ()
 Alias to 1st component as X coordinate in XY.
Element_t & y ()
 Alias to 2nd component as Y coordinate in XY.
const Element_t * GetData () const
 Raw access to the data (to simplify OpenGL exchange).
 operator const Element_t * () const
 operator Element_t * ()
NCollection_Vec2operator+= (const NCollection_Vec2 &theAdd)
 Compute per-component summary.
NCollection_Vec2operator-= (const NCollection_Vec2 &theDec)
 Compute per-component subtraction.
NCollection_Vec2 operator- () const
 Unary -.
NCollection_Vec2operator*= (const NCollection_Vec2 &theRight)
 Compute per-component multiplication.
void Multiply (const Element_t theFactor)
 Compute per-component multiplication by scale factor.
NCollection_Vec2 Multiplied (const Element_t theFactor) const
 Compute per-component multiplication by scale factor.
NCollection_Vec2operator*= (const Element_t theFactor)
 Compute per-component multiplication by scale factor.
NCollection_Vec2operator/= (const Element_t theInvFactor)
 Compute per-component division by scale factor.
NCollection_Vec2 operator* (const Element_t theFactor) const
 Compute per-component multiplication by scale factor.
NCollection_Vec2 operator/ (const Element_t theInvFactor) const
 Compute per-component division by scale factor.
Element_t Dot (const NCollection_Vec2 &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.

Static Public Member Functions

static int Length ()
 Returns the number of components.
static NCollection_Vec2 DX ()
 Constuct DX unit vector.
static NCollection_Vec2 DY ()
 Constuct DY unit vector.

Friends

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

template<typename Element_t>
class NCollection_Vec2< Element_t >


Constructor & Destructor Documentation

template<typename Element_t>
NCollection_Vec2< Element_t >::NCollection_Vec2 ( ) [inline]
template<typename Element_t>
NCollection_Vec2< Element_t >::NCollection_Vec2 ( const Element_t  theXY) [inline, explicit]
template<typename Element_t>
NCollection_Vec2< Element_t >::NCollection_Vec2 ( const Element_t  theX,
const Element_t  theY 
) [inline, explicit]
template<typename Element_t>
NCollection_Vec2< Element_t >::NCollection_Vec2 ( const NCollection_Vec2< Element_t > &  theVec2) [inline]

Member Function Documentation

template<typename Element_t>
Element_t NCollection_Vec2< Element_t >::Dot ( const NCollection_Vec2< Element_t > &  theOther) const [inline]
template<typename Element_t>
static NCollection_Vec2 NCollection_Vec2< Element_t >::DX ( ) [inline, static]
template<typename Element_t>
static NCollection_Vec2 NCollection_Vec2< Element_t >::DY ( ) [inline, static]
template<typename Element_t>
const Element_t* NCollection_Vec2< Element_t >::GetData ( ) const [inline]
template<typename Element_t>
static int NCollection_Vec2< Element_t >::Length ( void  ) [inline, static]
template<typename Element_t>
Element_t NCollection_Vec2< Element_t >::Modulus ( ) const [inline]
template<typename Element_t>
NCollection_Vec2 NCollection_Vec2< Element_t >::Multiplied ( const Element_t  theFactor) const [inline]
template<typename Element_t>
void NCollection_Vec2< Element_t >::Multiply ( const Element_t  theFactor) [inline]
template<typename Element_t>
NCollection_Vec2< 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_Vec2< Element_t >::operator const Element_t * ( ) const [inline]
template<typename Element_t>
NCollection_Vec2< Element_t >::operator Element_t * ( ) [inline]
template<typename Element_t>
NCollection_Vec2 NCollection_Vec2< Element_t >::operator* ( const Element_t  theFactor) const [inline]
template<typename Element_t>
NCollection_Vec2& NCollection_Vec2< Element_t >::operator*= ( const Element_t  theFactor) [inline]
template<typename Element_t>
NCollection_Vec2& NCollection_Vec2< Element_t >::operator*= ( const NCollection_Vec2< Element_t > &  theRight) [inline]
template<typename Element_t>
NCollection_Vec2& NCollection_Vec2< Element_t >::operator+= ( const NCollection_Vec2< Element_t > &  theAdd) [inline]
template<typename Element_t>
NCollection_Vec2 NCollection_Vec2< Element_t >::operator- ( ) const [inline]
template<typename Element_t>
NCollection_Vec2& NCollection_Vec2< Element_t >::operator-= ( const NCollection_Vec2< Element_t > &  theDec) [inline]
template<typename Element_t>
NCollection_Vec2 NCollection_Vec2< Element_t >::operator/ ( const Element_t  theInvFactor) const [inline]
template<typename Element_t>
NCollection_Vec2& NCollection_Vec2< Element_t >::operator/= ( const Element_t  theInvFactor) [inline]
template<typename Element_t>
const NCollection_Vec2& NCollection_Vec2< Element_t >::operator= ( const NCollection_Vec2< Element_t > &  theVec2) [inline]
template<typename Element_t>
Element_t NCollection_Vec2< Element_t >::SquareModulus ( ) const [inline]
template<typename Element_t>
Element_t NCollection_Vec2< Element_t >::x ( ) const [inline]
template<typename Element_t>
Element_t& NCollection_Vec2< Element_t >::x ( ) [inline]
template<typename Element_t>
Element_t NCollection_Vec2< Element_t >::y ( ) const [inline]
template<typename Element_t>
Element_t& NCollection_Vec2< Element_t >::y ( ) [inline]

Friends And Related Function Documentation

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

The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines