Visualization Library v1.0.3

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

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>

List of all members.

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

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

Definition at line 47 of file Vector4.hpp.


Constructor & Destructor Documentation

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

Definition at line 49 of file Vector4.hpp.

template<typename T_Scalar>
vl::Vector4< T_Scalar >::Vector4 (  ) [inline]
template<typename T_Scalar>
template<class T >
vl::Vector4< T_Scalar >::Vector4 ( const T &  other ) [inline, explicit]

Definition at line 53 of file Vector4.hpp.

template<typename T_Scalar>
vl::Vector4< T_Scalar >::Vector4 ( T_Scalar  x,
T_Scalar  y,
T_Scalar  z,
T_Scalar  w 
) [inline, explicit]

Definition at line 61 of file Vector4.hpp.

template<typename T_Scalar>
vl::Vector4< T_Scalar >::Vector4 ( const Vector3< T_Scalar > &  v,
T_Scalar  w 
) [inline, explicit]

Definition at line 69 of file Vector4.hpp.

template<typename T_Scalar>
vl::Vector4< T_Scalar >::Vector4 ( const Vector2< T_Scalar > &  u,
const Vector2< T_Scalar > &  v 
) [inline, explicit]

Definition at line 77 of file Vector4.hpp.


Member Function Documentation

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

Definition at line 86 of file Vector4.hpp.

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

Definition at line 88 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::Vector4< unsigned int >::operator=(), vl::Quaternion< T_Scalar >::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(), vl::vlx_toValue(), vl::Vector4< unsigned int >::xy(), and vl::Vector4< unsigned int >::xyz().

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

Definition at line 89 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::Vector4< unsigned int >::operator=(), vl::Quaternion< T_Scalar >::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(), vl::vlx_toValue(), vl::Vector4< unsigned int >::xy(), and vl::Vector4< unsigned int >::xyz().

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

Definition at line 90 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::Vector4< unsigned int >::operator=(), vl::Quaternion< T_Scalar >::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(), vl::vlx_toValue(), and vl::Vector4< unsigned int >::xyz().

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

Definition at line 93 of file Vector4.hpp.

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

Definition at line 94 of file Vector4.hpp.

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

Definition at line 95 of file Vector4.hpp.

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

Definition at line 96 of file Vector4.hpp.

template<typename T_Scalar>
const T_Scalar& vl::Vector4< T_Scalar >::r (  ) const [inline]
template<typename T_Scalar>
const T_Scalar& vl::Vector4< T_Scalar >::g (  ) const [inline]
template<typename T_Scalar>
const T_Scalar& vl::Vector4< T_Scalar >::b (  ) const [inline]
template<typename T_Scalar>
const T_Scalar& vl::Vector4< T_Scalar >::a (  ) const [inline]
template<typename T_Scalar>
T_Scalar& vl::Vector4< T_Scalar >::r (  ) [inline]

Definition at line 103 of file Vector4.hpp.

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

Definition at line 104 of file Vector4.hpp.

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

Definition at line 105 of file Vector4.hpp.

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

Definition at line 106 of file Vector4.hpp.

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

Definition at line 108 of file Vector4.hpp.

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

Definition at line 109 of file Vector4.hpp.

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

Definition at line 110 of file Vector4.hpp.

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

Definition at line 111 of file Vector4.hpp.

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

Definition at line 113 of file Vector4.hpp.

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

Definition at line 114 of file Vector4.hpp.

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

Definition at line 115 of file Vector4.hpp.

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

Definition at line 116 of file Vector4.hpp.

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

Definition at line 119 of file Vector4.hpp.

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

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

Definition at line 120 of file Vector4.hpp.

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

Definition at line 122 of file Vector4.hpp.

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

Definition at line 123 of file Vector4.hpp.

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

Definition at line 124 of file Vector4.hpp.

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

Definition at line 126 of file Vector4.hpp.

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

Definition at line 130 of file Vector4.hpp.

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

Definition at line 134 of file Vector4.hpp.

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

Definition at line 138 of file Vector4.hpp.

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

Definition at line 142 of file Vector4.hpp.

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

Definition at line 146 of file Vector4.hpp.

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

Definition at line 150 of file Vector4.hpp.

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

Definition at line 154 of file Vector4.hpp.

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

Definition at line 158 of file Vector4.hpp.

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

Definition at line 162 of file Vector4.hpp.

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

Definition at line 167 of file Vector4.hpp.

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

Definition at line 172 of file Vector4.hpp.

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

Definition at line 177 of file Vector4.hpp.

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

Definition at line 182 of file Vector4.hpp.

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

Definition at line 187 of file Vector4.hpp.

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

Definition at line 192 of file Vector4.hpp.

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

Definition at line 197 of file Vector4.hpp.

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

Definition at line 202 of file Vector4.hpp.

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

Definition at line 210 of file Vector4.hpp.

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

Definition at line 215 of file Vector4.hpp.

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

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

Definition at line 219 of file Vector4.hpp.

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

Definition at line 223 of file Vector4.hpp.

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

Definition at line 236 of file Vector4.hpp.

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

Definition at line 237 of file Vector4.hpp.

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

Definition at line 238 of file Vector4.hpp.

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

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

Definition at line 239 of file Vector4.hpp.

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

Definition at line 240 of file Vector4.hpp.

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

Definition at line 602 of file half.hpp.

References vl::sqrt().

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

Definition at line 603 of file half.hpp.


Member Data Documentation

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

Definition at line 48 of file Vector4.hpp.

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

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

Visualization Library v1.0.3 Reference Documentation
Copyright Michele Bosi. All rights reserved.
Updated on Tue Feb 7 2017 00:55:08.
Permission is granted to use this page to write and publish articles regarding Visualization Library.