Visualization Library 2.0.0

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
vl::Vector4< T_Scalar > Class Template Reference

The Vector4 class is a template class that implements a generic 4 components vector, see also vl::fvec4, vl::dvec4, vl::uvec4, vl::ivec4, vl::svec4, vl::usvec4, vl::bvec4, vl::ubvec4. More...

#include <Vector4.hpp>

Public Types

typedef T_Scalar scalar_type
 

Public Member Functions

 Vector4 (const Vector4 &other)
 
 Vector4 ()
 
template<class T >
 Vector4 (const T &other)
 
 Vector4 (T_Scalar val)
 
 Vector4 (T_Scalar x, T_Scalar y, T_Scalar z, T_Scalar w)
 
 Vector4 (const Vector3< T_Scalar > &v, T_Scalar w)
 
 Vector4 (const Vector2< T_Scalar > &u, const Vector2< T_Scalar > &v)
 
T_Scalar * ptr ()
 
const T_Scalar * ptr () const
 
const T_Scalar & x () const
 
const T_Scalar & y () const
 
const T_Scalar & z () const
 
const T_Scalar & w () const
 
T_Scalar & x ()
 
T_Scalar & y ()
 
T_Scalar & z ()
 
T_Scalar & w ()
 
const T_Scalar & r () const
 
const T_Scalar & g () const
 
const T_Scalar & b () const
 
const T_Scalar & a () const
 
T_Scalar & r ()
 
T_Scalar & g ()
 
T_Scalar & b ()
 
T_Scalar & a ()
 
const T_Scalar & s () const
 
const T_Scalar & t () const
 
const T_Scalar & p () const
 
const T_Scalar & q () const
 
T_Scalar & s ()
 
T_Scalar & t ()
 
T_Scalar & p ()
 
T_Scalar & q ()
 
Vector3< T_Scalar > xyz () const
 
Vector3< T_Scalar > rgb () const
 
Vector3< T_Scalar > stp () const
 
Vector2< T_Scalar > xy () const
 
Vector2< T_Scalar > rg () const
 
Vector2< T_Scalar > st () const
 
Vector4 operator+ (const Vector4 &other) const
 
Vector4 operator- (const Vector4 &other) const
 
Vector4 operator* (const Vector4 &other) const
 
Vector4 operator/ (const Vector4 &other) const
 
Vector4 operator+ (T_Scalar val) const
 
Vector4 operator- (T_Scalar val) const
 
Vector4 operator* (T_Scalar val) const
 
Vector4 operator/ (T_Scalar val) const
 
Vector4 operator- () const
 
Vector4operator+= (const Vector4 &other)
 
Vector4operator-= (const Vector4 &other)
 
Vector4operator*= (const Vector4 &other)
 
Vector4operator/= (const Vector4 &other)
 
Vector4operator+= (T_Scalar val)
 
Vector4operator-= (T_Scalar val)
 
Vector4operator*= (T_Scalar val)
 
Vector4operator/= (T_Scalar val)
 
Vector4operator= (const Vector4 &other)
 
Vector4operator= (T_Scalar val)
 
bool operator== (const Vector4 &other) const
 
bool operator!= (const Vector4 &other) const
 
bool operator< (const Vector4 &other) const
 
T_Scalar & operator[] (unsigned i)
 
const T_Scalar & operator[] (unsigned i) const
 
T_Scalar length () const
 
T_Scalar lengthSquared () const
 
bool isNull () const
 
const Vector4normalize (T_Scalar *len=NULL)
 
template<>
half length () const
 
template<>
half lengthSquared () const
 

Static Public Attributes

static const int scalar_count = 4
 

Protected Attributes

T_Scalar mScalar [scalar_count]
 

Detailed Description

template<typename T_Scalar>
class vl::Vector4< T_Scalar >

The Vector4 class is a template class that implements a generic 4 components vector, see also vl::fvec4, vl::dvec4, vl::uvec4, vl::ivec4, vl::svec4, vl::usvec4, vl::bvec4, vl::ubvec4.

See also
Vector3, Vector2, Matrix4, Matrix3, Matrix2

Definition at line 44 of file Vector4.hpp.

Member Typedef Documentation

◆ scalar_type

template<typename T_Scalar>
typedef T_Scalar vl::Vector4< T_Scalar >::scalar_type

Definition at line 47 of file Vector4.hpp.

Constructor & Destructor Documentation

◆ Vector4() [1/7]

template<typename T_Scalar>
vl::Vector4< T_Scalar >::Vector4 ( const Vector4< T_Scalar > &  other)
inline

Definition at line 49 of file Vector4.hpp.

◆ Vector4() [2/7]

template<typename T_Scalar>
vl::Vector4< T_Scalar >::Vector4 ( )
inline

◆ Vector4() [3/7]

template<typename T_Scalar>
template<class T >
vl::Vector4< T_Scalar >::Vector4 ( const T &  other)
inlineexplicit

Definition at line 53 of file Vector4.hpp.

◆ Vector4() [4/7]

template<typename T_Scalar>
vl::Vector4< T_Scalar >::Vector4 ( T_Scalar  val)
inlineexplicit

Definition at line 61 of file Vector4.hpp.

◆ Vector4() [5/7]

template<typename T_Scalar>
vl::Vector4< T_Scalar >::Vector4 ( T_Scalar  x,
T_Scalar  y,
T_Scalar  z,
T_Scalar  w 
)
inlineexplicit

Definition at line 74 of file Vector4.hpp.

◆ Vector4() [6/7]

template<typename T_Scalar>
vl::Vector4< T_Scalar >::Vector4 ( const Vector3< T_Scalar > &  v,
T_Scalar  w 
)
inlineexplicit

Definition at line 82 of file Vector4.hpp.

◆ Vector4() [7/7]

template<typename T_Scalar>
vl::Vector4< T_Scalar >::Vector4 ( const Vector2< T_Scalar > &  u,
const Vector2< T_Scalar > &  v 
)
inlineexplicit

Definition at line 90 of file Vector4.hpp.

Member Function Documentation

◆ a() [1/2]

template<typename T_Scalar>
const T_Scalar& vl::Vector4< T_Scalar >::a ( ) const
inline

◆ a() [2/2]

template<typename T_Scalar>
T_Scalar& vl::Vector4< T_Scalar >::a ( )
inline

Definition at line 119 of file Vector4.hpp.

◆ b() [1/2]

template<typename T_Scalar>
const T_Scalar& vl::Vector4< T_Scalar >::b ( ) const
inline

◆ b() [2/2]

template<typename T_Scalar>
T_Scalar& vl::Vector4< T_Scalar >::b ( )
inline

Definition at line 118 of file Vector4.hpp.

◆ g() [1/2]

template<typename T_Scalar>
const T_Scalar& vl::Vector4< T_Scalar >::g ( ) const
inline

◆ g() [2/2]

template<typename T_Scalar>
T_Scalar& vl::Vector4< T_Scalar >::g ( )
inline

Definition at line 117 of file Vector4.hpp.

◆ isNull()

template<typename T_Scalar>
bool vl::Vector4< T_Scalar >::isNull ( ) const
inline

Definition at line 253 of file Vector4.hpp.

◆ length() [1/2]

template<typename T_Scalar>
T_Scalar vl::Vector4< T_Scalar >::length ( ) const
inline

Definition at line 251 of file Vector4.hpp.

Referenced by vl::length(), and vl::Vector4< unsigned int >::normalize().

◆ length() [2/2]

template<>
half vl::Vector4< half >::length ( ) const
inline

Definition at line 602 of file half.hpp.

◆ lengthSquared() [1/2]

template<typename T_Scalar>
T_Scalar vl::Vector4< T_Scalar >::lengthSquared ( ) const
inline

Definition at line 252 of file Vector4.hpp.

◆ lengthSquared() [2/2]

template<>
half vl::Vector4< half >::lengthSquared ( ) const
inline

Definition at line 603 of file half.hpp.

◆ normalize()

template<typename T_Scalar>
const Vector4& vl::Vector4< T_Scalar >::normalize ( T_Scalar *  len = NULL)
inline

◆ operator!=()

template<typename T_Scalar>
bool vl::Vector4< T_Scalar >::operator!= ( const Vector4< T_Scalar > &  other) const
inline

Definition at line 232 of file Vector4.hpp.

◆ operator*() [1/2]

template<typename T_Scalar>
Vector4 vl::Vector4< T_Scalar >::operator* ( const Vector4< T_Scalar > &  other) const
inline

Definition at line 147 of file Vector4.hpp.

◆ operator*() [2/2]

template<typename T_Scalar>
Vector4 vl::Vector4< T_Scalar >::operator* ( T_Scalar  val) const
inline

Definition at line 163 of file Vector4.hpp.

◆ operator*=() [1/2]

template<typename T_Scalar>
Vector4& vl::Vector4< T_Scalar >::operator*= ( const Vector4< T_Scalar > &  other)
inline

Definition at line 185 of file Vector4.hpp.

◆ operator*=() [2/2]

template<typename T_Scalar>
Vector4& vl::Vector4< T_Scalar >::operator*= ( T_Scalar  val)
inline

Definition at line 205 of file Vector4.hpp.

◆ operator+() [1/2]

template<typename T_Scalar>
Vector4 vl::Vector4< T_Scalar >::operator+ ( const Vector4< T_Scalar > &  other) const
inline

Definition at line 139 of file Vector4.hpp.

◆ operator+() [2/2]

template<typename T_Scalar>
Vector4 vl::Vector4< T_Scalar >::operator+ ( T_Scalar  val) const
inline

Definition at line 155 of file Vector4.hpp.

◆ operator+=() [1/2]

template<typename T_Scalar>
Vector4& vl::Vector4< T_Scalar >::operator+= ( const Vector4< T_Scalar > &  other)
inline

Definition at line 175 of file Vector4.hpp.

◆ operator+=() [2/2]

template<typename T_Scalar>
Vector4& vl::Vector4< T_Scalar >::operator+= ( T_Scalar  val)
inline

Definition at line 195 of file Vector4.hpp.

◆ operator-() [1/3]

template<typename T_Scalar>
Vector4 vl::Vector4< T_Scalar >::operator- ( const Vector4< T_Scalar > &  other) const
inline

Definition at line 143 of file Vector4.hpp.

◆ operator-() [2/3]

template<typename T_Scalar>
Vector4 vl::Vector4< T_Scalar >::operator- ( T_Scalar  val) const
inline

Definition at line 159 of file Vector4.hpp.

◆ operator-() [3/3]

template<typename T_Scalar>
Vector4 vl::Vector4< T_Scalar >::operator- ( ) const
inline

Definition at line 171 of file Vector4.hpp.

◆ operator-=() [1/2]

template<typename T_Scalar>
Vector4& vl::Vector4< T_Scalar >::operator-= ( const Vector4< T_Scalar > &  other)
inline

Definition at line 180 of file Vector4.hpp.

◆ operator-=() [2/2]

template<typename T_Scalar>
Vector4& vl::Vector4< T_Scalar >::operator-= ( T_Scalar  val)
inline

Definition at line 200 of file Vector4.hpp.

◆ operator/() [1/2]

template<typename T_Scalar>
Vector4 vl::Vector4< T_Scalar >::operator/ ( const Vector4< T_Scalar > &  other) const
inline

Definition at line 151 of file Vector4.hpp.

◆ operator/() [2/2]

template<typename T_Scalar>
Vector4 vl::Vector4< T_Scalar >::operator/ ( T_Scalar  val) const
inline

Definition at line 167 of file Vector4.hpp.

◆ operator/=() [1/2]

template<typename T_Scalar>
Vector4& vl::Vector4< T_Scalar >::operator/= ( const Vector4< T_Scalar > &  other)
inline

Definition at line 190 of file Vector4.hpp.

◆ operator/=() [2/2]

template<typename T_Scalar>
Vector4& vl::Vector4< T_Scalar >::operator/= ( T_Scalar  val)
inline

Definition at line 210 of file Vector4.hpp.

◆ operator<()

template<typename T_Scalar>
bool vl::Vector4< T_Scalar >::operator< ( const Vector4< T_Scalar > &  other) const
inline

Definition at line 236 of file Vector4.hpp.

◆ operator=() [1/2]

template<typename T_Scalar>
Vector4& vl::Vector4< T_Scalar >::operator= ( const Vector4< T_Scalar > &  other)
inline

Definition at line 215 of file Vector4.hpp.

◆ operator=() [2/2]

template<typename T_Scalar>
Vector4& vl::Vector4< T_Scalar >::operator= ( T_Scalar  val)
inline

Definition at line 223 of file Vector4.hpp.

◆ operator==()

template<typename T_Scalar>
bool vl::Vector4< T_Scalar >::operator== ( const Vector4< T_Scalar > &  other) const
inline

Definition at line 228 of file Vector4.hpp.

Referenced by vl::Vector4< unsigned int >::operator!=().

◆ operator[]() [1/2]

template<typename T_Scalar>
T_Scalar& vl::Vector4< T_Scalar >::operator[] ( unsigned  i)
inline

Definition at line 249 of file Vector4.hpp.

◆ operator[]() [2/2]

template<typename T_Scalar>
const T_Scalar& vl::Vector4< T_Scalar >::operator[] ( unsigned  i) const
inline

Definition at line 250 of file Vector4.hpp.

◆ p() [1/2]

template<typename T_Scalar>
const T_Scalar& vl::Vector4< T_Scalar >::p ( ) const
inline

Definition at line 123 of file Vector4.hpp.

◆ p() [2/2]

template<typename T_Scalar>
T_Scalar& vl::Vector4< T_Scalar >::p ( )
inline

Definition at line 128 of file Vector4.hpp.

◆ ptr() [1/2]

template<typename T_Scalar>
T_Scalar* vl::Vector4< T_Scalar >::ptr ( )
inline

◆ ptr() [2/2]

template<typename T_Scalar>
const T_Scalar* vl::Vector4< T_Scalar >::ptr ( ) const
inline

Definition at line 99 of file Vector4.hpp.

◆ q() [1/2]

template<typename T_Scalar>
const T_Scalar& vl::Vector4< T_Scalar >::q ( ) const
inline

Definition at line 124 of file Vector4.hpp.

◆ q() [2/2]

template<typename T_Scalar>
T_Scalar& vl::Vector4< T_Scalar >::q ( )
inline

Definition at line 129 of file Vector4.hpp.

◆ r() [1/2]

template<typename T_Scalar>
const T_Scalar& vl::Vector4< T_Scalar >::r ( ) const
inline

◆ r() [2/2]

template<typename T_Scalar>
T_Scalar& vl::Vector4< T_Scalar >::r ( )
inline

Definition at line 116 of file Vector4.hpp.

◆ rg()

template<typename T_Scalar>
Vector2<T_Scalar> vl::Vector4< T_Scalar >::rg ( ) const
inline

Definition at line 136 of file Vector4.hpp.

◆ rgb()

template<typename T_Scalar>
Vector3<T_Scalar> vl::Vector4< T_Scalar >::rgb ( ) const
inline

Definition at line 132 of file Vector4.hpp.

Referenced by vl::DaeLoader::setup_vl_Effect().

◆ s() [1/2]

template<typename T_Scalar>
const T_Scalar& vl::Vector4< T_Scalar >::s ( ) const
inline

Definition at line 121 of file Vector4.hpp.

Referenced by vl::VectorGraphics::popScissor().

◆ s() [2/2]

template<typename T_Scalar>
T_Scalar& vl::Vector4< T_Scalar >::s ( )
inline

Definition at line 126 of file Vector4.hpp.

◆ st()

template<typename T_Scalar>
Vector2<T_Scalar> vl::Vector4< T_Scalar >::st ( ) const
inline

Definition at line 137 of file Vector4.hpp.

◆ stp()

template<typename T_Scalar>
Vector3<T_Scalar> vl::Vector4< T_Scalar >::stp ( ) const
inline

Definition at line 133 of file Vector4.hpp.

◆ t() [1/2]

template<typename T_Scalar>
const T_Scalar& vl::Vector4< T_Scalar >::t ( ) const
inline

Definition at line 122 of file Vector4.hpp.

Referenced by vl::VectorGraphics::popScissor().

◆ t() [2/2]

template<typename T_Scalar>
T_Scalar& vl::Vector4< T_Scalar >::t ( )
inline

Definition at line 127 of file Vector4.hpp.

◆ w() [1/2]

template<typename T_Scalar>
const T_Scalar& vl::Vector4< T_Scalar >::w ( ) const
inline

◆ w() [2/2]

template<typename T_Scalar>
T_Scalar& vl::Vector4< T_Scalar >::w ( )
inline

Definition at line 109 of file Vector4.hpp.

◆ x() [1/2]

template<typename T_Scalar>
const T_Scalar& vl::Vector4< T_Scalar >::x ( ) const
inline

Definition at line 101 of file Vector4.hpp.

Referenced by vl::abs(), vl::acos(), vl::acosh(), vl::all(), vl::any(), vl::asin(), vl::asinh(), vl::atan(), vl::atanh(), vl::Text::boundingRectTransformed(), vl::ceil(), vl::cos(), vl::cosh(), vl::degrees(), vl::dot(), vl::equal(), vl::PixelLODEvaluator::evaluate(), vl::exp(), vl::exp2(), vl::floor(), vl::greaterThan(), vl::greaterThanEqual(), vl::inversesqrt(), vl::isinf(), vl::isnan(), vl::Vector4< unsigned int >::isNull(), vl::Vector4< unsigned int >::length(), vl::Vector4< unsigned int >::lengthSquared(), vl::lessThan(), vl::lessThanEqual(), vl::log(), vl::log10(), vl::log2(), vl::max(), vl::min(), vl::mix(), vl::modf(), vl::notEqual(), vl::Vector4< unsigned int >::operator*(), vl::operator*(), vl::Vector4< unsigned int >::operator+(), vl::Vector4< unsigned int >::operator-(), vl::Vector4< unsigned int >::operator/(), vl::Vector4< unsigned int >::operator<(), vl::Quaternion< T_Scalar >::operator=(), vl::Vector4< unsigned int >::operator=(), vl::Vector4< unsigned int >::operator==(), vl::pow(), vl::Camera::project(), vl::Quaternion< T_Scalar >::Quaternion(), vl::radians(), vl::DrawPixels::render_Implementation(), vl::Text::renderText(), vl::Vector4< unsigned int >::rg(), vl::Vector4< unsigned int >::rgb(), vl::round(), vl::roundEven(), vl::sign(), vl::sin(), vl::sinh(), vl::smoothstep(), vl::sqrt(), vl::Vector4< unsigned int >::st(), vl::step(), vl::Vector4< unsigned int >::stp(), vl::tan(), vl::tanh(), vl::trunc(), vl::Camera::unproject(), vl::Vector4< unsigned int >::Vector4(), vlX::vlx_toValue(), vl::Vector4< unsigned int >::xy(), and vl::Vector4< unsigned int >::xyz().

◆ x() [2/2]

template<typename T_Scalar>
T_Scalar& vl::Vector4< T_Scalar >::x ( )
inline

Definition at line 106 of file Vector4.hpp.

◆ xy()

template<typename T_Scalar>
Vector2<T_Scalar> vl::Vector4< T_Scalar >::xy ( ) const
inline

Definition at line 135 of file Vector4.hpp.

◆ xyz()

template<typename T_Scalar>
Vector3<T_Scalar> vl::Vector4< T_Scalar >::xyz ( ) const
inline

◆ y() [1/2]

template<typename T_Scalar>
const T_Scalar& vl::Vector4< T_Scalar >::y ( ) const
inline

Definition at line 102 of file Vector4.hpp.

Referenced by vl::abs(), vl::acos(), vl::acosh(), vl::all(), vl::any(), vl::asin(), vl::asinh(), vl::atan(), vl::atanh(), vl::Text::boundingRectTransformed(), vl::ceil(), vl::cos(), vl::cosh(), vl::degrees(), vl::dot(), vl::equal(), vl::PixelLODEvaluator::evaluate(), vl::exp(), vl::exp2(), vl::floor(), vl::greaterThan(), vl::greaterThanEqual(), vl::inversesqrt(), vl::isinf(), vl::isnan(), vl::Vector4< unsigned int >::isNull(), vl::Vector4< unsigned int >::length(), vl::Vector4< unsigned int >::lengthSquared(), vl::lessThan(), vl::lessThanEqual(), vl::log(), vl::log10(), vl::log2(), vl::max(), vl::min(), vl::mix(), vl::modf(), vl::notEqual(), vl::Vector4< unsigned int >::operator*(), vl::operator*(), vl::Vector4< unsigned int >::operator+(), vl::Vector4< unsigned int >::operator-(), vl::Vector4< unsigned int >::operator/(), vl::Vector4< unsigned int >::operator<(), vl::Quaternion< T_Scalar >::operator=(), vl::Vector4< unsigned int >::operator=(), vl::Vector4< unsigned int >::operator==(), vl::pow(), vl::Camera::project(), vl::Quaternion< T_Scalar >::Quaternion(), vl::radians(), vl::DrawPixels::render_Implementation(), vl::Text::renderText(), vl::Vector4< unsigned int >::rg(), vl::Vector4< unsigned int >::rgb(), vl::round(), vl::roundEven(), vl::sign(), vl::sin(), vl::sinh(), vl::smoothstep(), vl::sqrt(), vl::Vector4< unsigned int >::st(), vl::step(), vl::Vector4< unsigned int >::stp(), vl::tan(), vl::tanh(), vl::trunc(), vl::Camera::unproject(), vl::Vector4< unsigned int >::Vector4(), vlX::vlx_toValue(), vl::Vector4< unsigned int >::xy(), and vl::Vector4< unsigned int >::xyz().

◆ y() [2/2]

template<typename T_Scalar>
T_Scalar& vl::Vector4< T_Scalar >::y ( )
inline

Definition at line 107 of file Vector4.hpp.

◆ z() [1/2]

template<typename T_Scalar>
const T_Scalar& vl::Vector4< T_Scalar >::z ( ) const
inline

Definition at line 103 of file Vector4.hpp.

Referenced by vl::abs(), vl::acos(), vl::acosh(), vl::all(), vl::any(), vl::asin(), vl::asinh(), vl::atan(), vl::atanh(), vl::Text::boundingRectTransformed(), vl::ceil(), vl::cos(), vl::cosh(), vl::degrees(), vl::dot(), vl::equal(), vl::PixelLODEvaluator::evaluate(), vl::exp(), vl::exp2(), vl::floor(), vl::greaterThan(), vl::greaterThanEqual(), vl::inversesqrt(), vl::isinf(), vl::isnan(), vl::Vector4< unsigned int >::isNull(), vl::Vector4< unsigned int >::length(), vl::Vector4< unsigned int >::lengthSquared(), vl::lessThan(), vl::lessThanEqual(), vl::log(), vl::log10(), vl::log2(), vl::max(), vl::min(), vl::mix(), vl::modf(), vl::notEqual(), vl::Vector4< unsigned int >::operator*(), vl::operator*(), vl::Vector4< unsigned int >::operator+(), vl::Vector4< unsigned int >::operator-(), vl::Vector4< unsigned int >::operator/(), vl::Vector4< unsigned int >::operator<(), vl::Quaternion< T_Scalar >::operator=(), vl::Vector4< unsigned int >::operator=(), vl::Vector4< unsigned int >::operator==(), vl::pow(), vl::Camera::project(), vl::Quaternion< T_Scalar >::Quaternion(), vl::radians(), vl::Text::renderText(), vl::Vector4< unsigned int >::rgb(), vl::round(), vl::roundEven(), vl::sign(), vl::sin(), vl::sinh(), vl::smoothstep(), vl::sqrt(), vl::step(), vl::Vector4< unsigned int >::stp(), vl::tan(), vl::tanh(), vl::trunc(), vl::Camera::unproject(), vl::Vector4< unsigned int >::Vector4(), vlX::vlx_toValue(), and vl::Vector4< unsigned int >::xyz().

◆ z() [2/2]

template<typename T_Scalar>
T_Scalar& vl::Vector4< T_Scalar >::z ( )
inline

Definition at line 108 of file Vector4.hpp.

Member Data Documentation

◆ mScalar

template<typename T_Scalar>
T_Scalar vl::Vector4< T_Scalar >::mScalar[scalar_count]
protected

◆ scalar_count

template<typename T_Scalar>
const int vl::Vector4< T_Scalar >::scalar_count = 4
static

Definition at line 48 of file Vector4.hpp.


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