OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    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.). More...

    #include <NCollection_Vec3.hxx>

    Public Member Functions

    constexpr NCollection_Vec3 () noexcept
     Empty constructor. Construct the zero vector.
    constexpr NCollection_Vec3 (Element_t theValue) noexcept
     Initialize ALL components of vector within specified value.
    constexpr NCollection_Vec3 (const Element_t theX, const Element_t theY, const Element_t theZ) noexcept
     Per-component constructor.
    constexpr NCollection_Vec3 (const NCollection_Vec2< Element_t > &theVec2, Element_t theZ=Element_t(0)) noexcept
     Constructor from 2-components vector + optional 3rd value.
    template<typename OtherElement_t>
    constexpr NCollection_Vec3 (const NCollection_Vec3< OtherElement_t > &theOtherVec3) noexcept
     Conversion constructor (explicitly converts some 3-component vector with other element type to a new 3-component vector with the element type Element_t, whose elements are static_cast'ed corresponding elements of theOtherVec3 vector).
    constexpr void SetValues (const Element_t theX, const Element_t theY, const Element_t theZ) noexcept
     Assign new values to the vector.
    constexpr void SetValues (const NCollection_Vec2< Element_t > &theVec2, Element_t theZ) noexcept
     Assign new values to the vector.
    constexpr Element_t x () const noexcept
     Alias to 1st component as X coordinate in XYZ.
    constexpr Element_t r () const noexcept
     Alias to 1st component as RED channel in RGB.
    constexpr Element_t y () const noexcept
     Alias to 2nd component as Y coordinate in XYZ.
    constexpr Element_t g () const noexcept
     Alias to 2nd component as GREEN channel in RGB.
    constexpr Element_t z () const noexcept
     Alias to 3rd component as Z coordinate in XYZ.
    constexpr Element_t b () const noexcept
     Alias to 3rd component as BLUE channel in RGB.
    constexpr Element_t & x () noexcept
     Alias to 1st component as X coordinate in XYZ.
    constexpr Element_t & r () noexcept
     Alias to 1st component as RED channel in RGB.
    constexpr Element_t & y () noexcept
     Alias to 2nd component as Y coordinate in XYZ.
    constexpr Element_t & g () noexcept
     Alias to 2nd component as GREEN channel in RGB.
    constexpr Element_t & z () noexcept
     Alias to 3rd component as Z coordinate in XYZ.
    constexpr Element_t & b () noexcept
     Alias to 3rd component as BLUE channel in RGB.
    constexpr bool IsEqual (const NCollection_Vec3 &theOther) const noexcept
     Check this vector with another vector for equality (without tolerance!).
    constexpr bool operator== (const NCollection_Vec3 &theOther) const noexcept
     Check this vector with another vector for equality (without tolerance!).
    constexpr bool operator!= (const NCollection_Vec3 &theOther) const noexcept
     Check this vector with another vector for non-equality (without tolerance!).
    constexpr const Element_t * GetData () const noexcept
     Raw access to the data (for OpenGL exchange).
    constexpr Element_t * ChangeData () noexcept
    constexpr operator const Element_t * () const noexcept
    constexpr operator Element_t * () noexcept
    constexpr NCollection_Vec3 & operator+= (const NCollection_Vec3 &theAdd) noexcept
     Compute per-component summary.
    constexpr NCollection_Vec3 operator- () const noexcept
     Unary -.
    constexpr NCollection_Vec3 & operator-= (const NCollection_Vec3 &theDec) noexcept
     Compute per-component subtraction.
    constexpr void Multiply (const Element_t theFactor) noexcept
     Compute per-component multiplication by scale factor.
    constexpr NCollection_Vec3 & operator*= (const NCollection_Vec3 &theRight) noexcept
     Compute per-component multiplication.
    constexpr NCollection_Vec3 & operator*= (const Element_t theFactor) noexcept
     Compute per-component multiplication by scale factor.
    constexpr NCollection_Vec3 operator* (const Element_t theFactor) const noexcept
     Compute per-component multiplication by scale factor.
    constexpr NCollection_Vec3 Multiplied (const Element_t theFactor) const noexcept
     Compute per-component multiplication by scale factor.
    constexpr NCollection_Vec3 cwiseMin (const NCollection_Vec3 &theVec) const noexcept
     Compute component-wise minimum of two vectors.
    constexpr NCollection_Vec3 cwiseMax (const NCollection_Vec3 &theVec) const noexcept
     Compute component-wise maximum of two vectors.
    NCollection_Vec3 cwiseAbs () const noexcept
     Compute component-wise modulus of the vector.
    constexpr Element_t maxComp () const noexcept
     Compute maximum component of the vector.
    constexpr Element_t minComp () const noexcept
     Compute minimum component of the vector.
    constexpr NCollection_Vec3 & operator/= (const Element_t theInvFactor)
     Compute per-component division by scale factor.
    constexpr NCollection_Vec3 & operator/= (const NCollection_Vec3 &theRight)
     Compute per-component division.
    constexpr NCollection_Vec3 operator/ (const Element_t theInvFactor) const
     Compute per-component division by scale factor.
    constexpr Element_t Dot (const NCollection_Vec3 &theOther) const noexcept
     Computes the dot product.
    Element_t Modulus () const noexcept
     Computes the vector modulus (magnitude, length).
    constexpr Element_t SquareModulus () const noexcept
     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.
    void DumpJson (Standard_OStream &theOStream, int theDepth=-1) const
     Dumps the content of me into the stream.
    constexpr NCollection_Vec3< float > & operator/= (const float theInvFactor)
     Optimized concretization for float type.
    constexpr NCollection_Vec3< double > & operator/= (const double theInvFactor)
     Optimized concretization for double type.

    Static Public Member Functions

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

    Detailed Description

    template<typename Element_t>
    class NCollection_Vec3< Element_t >

    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.).

    Constructor & Destructor Documentation

    ◆ NCollection_Vec3() [1/5]

    template<typename Element_t>
    NCollection_Vec3< Element_t >::NCollection_Vec3 ( )
    inlineconstexprnoexcept

    Empty constructor. Construct the zero vector.

    ◆ NCollection_Vec3() [2/5]

    template<typename Element_t>
    NCollection_Vec3< Element_t >::NCollection_Vec3 ( Element_t theValue)
    inlineexplicitconstexprnoexcept

    Initialize ALL components of vector within specified value.

    ◆ NCollection_Vec3() [3/5]

    template<typename Element_t>
    NCollection_Vec3< Element_t >::NCollection_Vec3 ( const Element_t theX,
    const Element_t theY,
    const Element_t theZ )
    inlineexplicitconstexprnoexcept

    Per-component constructor.

    ◆ NCollection_Vec3() [4/5]

    template<typename Element_t>
    NCollection_Vec3< Element_t >::NCollection_Vec3 ( const NCollection_Vec2< Element_t > & theVec2,
    Element_t theZ = Element_t(0) )
    inlineexplicitconstexprnoexcept

    Constructor from 2-components vector + optional 3rd value.

    ◆ NCollection_Vec3() [5/5]

    template<typename Element_t>
    template<typename OtherElement_t>
    NCollection_Vec3< Element_t >::NCollection_Vec3 ( const NCollection_Vec3< OtherElement_t > & theOtherVec3)
    inlineexplicitconstexprnoexcept

    Conversion constructor (explicitly converts some 3-component vector with other element type to a new 3-component vector with the element type Element_t, whose elements are static_cast'ed corresponding elements of theOtherVec3 vector).

    Template Parameters
    OtherElement_tthe element type of the other 3-component vector theOtherVec3
    Parameters
    theOtherVec3the 3-component vector that needs to be converted

    Member Function Documentation

    ◆ b() [1/2]

    template<typename Element_t>
    Element_t NCollection_Vec3< Element_t >::b ( ) const
    inlineconstexprnoexcept

    Alias to 3rd component as BLUE channel in RGB.

    ◆ b() [2/2]

    template<typename Element_t>
    Element_t & NCollection_Vec3< Element_t >::b ( )
    inlineconstexprnoexcept

    Alias to 3rd component as BLUE channel in RGB.

    ◆ ChangeData()

    template<typename Element_t>
    Element_t * NCollection_Vec3< Element_t >::ChangeData ( )
    inlineconstexprnoexcept

    ◆ Cross()

    template<typename Element_t>
    constexpr NCollection_Vec3 NCollection_Vec3< Element_t >::Cross ( const NCollection_Vec3< Element_t > & theVec1,
    const NCollection_Vec3< Element_t > & theVec2 )
    inlinestaticconstexprnoexcept

    Computes the cross product.

    ◆ cwiseAbs()

    template<typename Element_t>
    NCollection_Vec3 NCollection_Vec3< Element_t >::cwiseAbs ( ) const
    inlinenoexcept

    Compute component-wise modulus of the vector.

    ◆ cwiseMax()

    template<typename Element_t>
    NCollection_Vec3 NCollection_Vec3< Element_t >::cwiseMax ( const NCollection_Vec3< Element_t > & theVec) const
    inlineconstexprnoexcept

    Compute component-wise maximum of two vectors.

    ◆ cwiseMin()

    template<typename Element_t>
    NCollection_Vec3 NCollection_Vec3< Element_t >::cwiseMin ( const NCollection_Vec3< Element_t > & theVec) const
    inlineconstexprnoexcept

    Compute component-wise minimum of two vectors.

    ◆ Dot()

    template<typename Element_t>
    Element_t NCollection_Vec3< Element_t >::Dot ( const NCollection_Vec3< Element_t > & theOther) const
    inlineconstexprnoexcept

    Computes the dot product.

    ◆ DumpJson()

    template<typename Element_t>
    void NCollection_Vec3< Element_t >::DumpJson ( Standard_OStream & theOStream,
    int theDepth = -1 ) const
    inline

    Dumps the content of me into the stream.

    ◆ DX()

    template<typename Element_t>
    constexpr NCollection_Vec3 NCollection_Vec3< Element_t >::DX ( )
    inlinestaticconstexprnoexcept

    Construct DX unit vector.

    ◆ DY()

    template<typename Element_t>
    constexpr NCollection_Vec3 NCollection_Vec3< Element_t >::DY ( )
    inlinestaticconstexprnoexcept

    Construct DY unit vector.

    ◆ DZ()

    template<typename Element_t>
    constexpr NCollection_Vec3 NCollection_Vec3< Element_t >::DZ ( )
    inlinestaticconstexprnoexcept

    Construct DZ unit vector.

    ◆ g() [1/2]

    template<typename Element_t>
    Element_t NCollection_Vec3< Element_t >::g ( ) const
    inlineconstexprnoexcept

    Alias to 2nd component as GREEN channel in RGB.

    ◆ g() [2/2]

    template<typename Element_t>
    Element_t & NCollection_Vec3< Element_t >::g ( )
    inlineconstexprnoexcept

    Alias to 2nd component as GREEN channel in RGB.

    ◆ GetData()

    template<typename Element_t>
    const Element_t * NCollection_Vec3< Element_t >::GetData ( ) const
    inlineconstexprnoexcept

    Raw access to the data (for OpenGL exchange).

    ◆ GetLERP()

    template<typename Element_t>
    constexpr NCollection_Vec3 NCollection_Vec3< Element_t >::GetLERP ( const NCollection_Vec3< Element_t > & theFrom,
    const NCollection_Vec3< Element_t > & theTo,
    const Element_t theT )
    inlinestaticconstexprnoexcept

    Compute linear interpolation between to vectors.

    Parameters
    theT- interpolation coefficient 0..1;
    Returns
    interpolation result.

    ◆ IsEqual()

    template<typename Element_t>
    bool NCollection_Vec3< Element_t >::IsEqual ( const NCollection_Vec3< Element_t > & theOther) const
    inlineconstexprnoexcept

    Check this vector with another vector for equality (without tolerance!).

    ◆ Length()

    template<typename Element_t>
    constexpr int NCollection_Vec3< Element_t >::Length ( )
    inlinestaticconstexprnoexcept

    Returns the number of components.

    ◆ maxComp()

    template<typename Element_t>
    Element_t NCollection_Vec3< Element_t >::maxComp ( ) const
    inlineconstexprnoexcept

    Compute maximum component of the vector.

    ◆ minComp()

    template<typename Element_t>
    Element_t NCollection_Vec3< Element_t >::minComp ( ) const
    inlineconstexprnoexcept

    Compute minimum component of the vector.

    ◆ Modulus()

    template<typename Element_t>
    Element_t NCollection_Vec3< Element_t >::Modulus ( ) const
    inlinenoexcept

    Computes the vector modulus (magnitude, length).

    ◆ Multiplied()

    template<typename Element_t>
    NCollection_Vec3 NCollection_Vec3< Element_t >::Multiplied ( const Element_t theFactor) const
    inlineconstexprnoexcept

    Compute per-component multiplication by scale factor.

    ◆ Multiply()

    template<typename Element_t>
    void NCollection_Vec3< Element_t >::Multiply ( const Element_t theFactor)
    inlineconstexprnoexcept

    Compute per-component multiplication by scale factor.

    ◆ Normalize()

    template<typename Element_t>
    void NCollection_Vec3< Element_t >::Normalize ( )
    inline

    Normalize the vector.

    ◆ Normalized()

    template<typename Element_t>
    NCollection_Vec3 NCollection_Vec3< Element_t >::Normalized ( ) const
    inline

    Normalize the vector.

    ◆ operator const Element_t *()

    template<typename Element_t>
    NCollection_Vec3< Element_t >::operator const Element_t * ( ) const
    inlineconstexprnoexcept

    ◆ operator Element_t *()

    template<typename Element_t>
    NCollection_Vec3< Element_t >::operator Element_t * ( )
    inlineconstexprnoexcept

    ◆ operator!=()

    template<typename Element_t>
    bool NCollection_Vec3< Element_t >::operator!= ( const NCollection_Vec3< Element_t > & theOther) const
    inlineconstexprnoexcept

    Check this vector with another vector for non-equality (without tolerance!).

    ◆ operator*()

    template<typename Element_t>
    NCollection_Vec3 NCollection_Vec3< Element_t >::operator* ( const Element_t theFactor) const
    inlineconstexprnoexcept

    Compute per-component multiplication by scale factor.

    ◆ operator*=() [1/2]

    template<typename Element_t>
    NCollection_Vec3 & NCollection_Vec3< Element_t >::operator*= ( const Element_t theFactor)
    inlineconstexprnoexcept

    Compute per-component multiplication by scale factor.

    ◆ operator*=() [2/2]

    template<typename Element_t>
    NCollection_Vec3 & NCollection_Vec3< Element_t >::operator*= ( const NCollection_Vec3< Element_t > & theRight)
    inlineconstexprnoexcept

    Compute per-component multiplication.

    ◆ operator+=()

    template<typename Element_t>
    NCollection_Vec3 & NCollection_Vec3< Element_t >::operator+= ( const NCollection_Vec3< Element_t > & theAdd)
    inlineconstexprnoexcept

    Compute per-component summary.

    ◆ operator-()

    template<typename Element_t>
    NCollection_Vec3 NCollection_Vec3< Element_t >::operator- ( ) const
    inlineconstexprnoexcept

    Unary -.

    ◆ operator-=()

    template<typename Element_t>
    NCollection_Vec3 & NCollection_Vec3< Element_t >::operator-= ( const NCollection_Vec3< Element_t > & theDec)
    inlineconstexprnoexcept

    Compute per-component subtraction.

    ◆ operator/()

    template<typename Element_t>
    NCollection_Vec3 NCollection_Vec3< Element_t >::operator/ ( const Element_t theInvFactor) const
    inlineconstexpr

    Compute per-component division by scale factor.

    ◆ operator/=() [1/4]

    NCollection_Vec3< double > & NCollection_Vec3< double >::operator/= ( const double theInvFactor)
    inlineconstexpr

    Optimized concretization for double type.

    ◆ operator/=() [2/4]

    template<typename Element_t>
    NCollection_Vec3 & NCollection_Vec3< Element_t >::operator/= ( const Element_t theInvFactor)
    inlineconstexpr

    Compute per-component division by scale factor.

    ◆ operator/=() [3/4]

    NCollection_Vec3< float > & NCollection_Vec3< float >::operator/= ( const float theInvFactor)
    inlineconstexpr

    Optimized concretization for float type.

    ◆ operator/=() [4/4]

    template<typename Element_t>
    NCollection_Vec3 & NCollection_Vec3< Element_t >::operator/= ( const NCollection_Vec3< Element_t > & theRight)
    inlineconstexpr

    Compute per-component division.

    ◆ operator==()

    template<typename Element_t>
    bool NCollection_Vec3< Element_t >::operator== ( const NCollection_Vec3< Element_t > & theOther) const
    inlineconstexprnoexcept

    Check this vector with another vector for equality (without tolerance!).

    ◆ r() [1/2]

    template<typename Element_t>
    Element_t NCollection_Vec3< Element_t >::r ( ) const
    inlineconstexprnoexcept

    Alias to 1st component as RED channel in RGB.

    ◆ r() [2/2]

    template<typename Element_t>
    Element_t & NCollection_Vec3< Element_t >::r ( )
    inlineconstexprnoexcept

    Alias to 1st component as RED channel in RGB.

    ◆ SetValues() [1/2]

    template<typename Element_t>
    void NCollection_Vec3< Element_t >::SetValues ( const Element_t theX,
    const Element_t theY,
    const Element_t theZ )
    inlineconstexprnoexcept

    Assign new values to the vector.

    ◆ SetValues() [2/2]

    template<typename Element_t>
    void NCollection_Vec3< Element_t >::SetValues ( const NCollection_Vec2< Element_t > & theVec2,
    Element_t theZ )
    inlineconstexprnoexcept

    Assign new values to the vector.

    ◆ SquareModulus()

    template<typename Element_t>
    Element_t NCollection_Vec3< Element_t >::SquareModulus ( ) const
    inlineconstexprnoexcept

    Computes the square of vector modulus (magnitude, length). This method may be used for performance tricks.

    ◆ x() [1/2]

    template<typename Element_t>
    Element_t NCollection_Vec3< Element_t >::x ( ) const
    inlineconstexprnoexcept

    Alias to 1st component as X coordinate in XYZ.

    ◆ x() [2/2]

    template<typename Element_t>
    Element_t & NCollection_Vec3< Element_t >::x ( )
    inlineconstexprnoexcept

    Alias to 1st component as X coordinate in XYZ.

    Returns
    2 components by their names in specified order (in GLSL-style)
    3 components by their names in specified order (in GLSL-style)

    ◆ y() [1/2]

    template<typename Element_t>
    Element_t NCollection_Vec3< Element_t >::y ( ) const
    inlineconstexprnoexcept

    Alias to 2nd component as Y coordinate in XYZ.

    ◆ y() [2/2]

    template<typename Element_t>
    Element_t & NCollection_Vec3< Element_t >::y ( )
    inlineconstexprnoexcept

    Alias to 2nd component as Y coordinate in XYZ.

    ◆ z() [1/2]

    template<typename Element_t>
    Element_t NCollection_Vec3< Element_t >::z ( ) const
    inlineconstexprnoexcept

    Alias to 3rd component as Z coordinate in XYZ.

    ◆ z() [2/2]

    template<typename Element_t>
    Element_t & NCollection_Vec3< Element_t >::z ( )
    inlineconstexprnoexcept

    Alias to 3rd component as Z coordinate in XYZ.


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