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::Vector2< T_Scalar > Class Template Reference

The Vector2 class is a template class that implements a generic 2 components vector, see also vl::fvec2, vl::dvec2, vl::uvec2, vl::ivec2, vl::svec2, vl::usvec2, vl::bvec2, vl::ubvec2. More...

#include <Vector2.hpp>

List of all members.

Public Types

typedef T_Scalar scalar_type

Public Member Functions

 Vector2 (const Vector2 &other)
 Vector2 ()
template<class T >
 Vector2 (const T &other)
 Vector2 (T_Scalar x, T_Scalar y)
T_Scalar * ptr ()
const T_Scalar * ptr () const
const T_Scalar & x () const
const T_Scalar & y () const
T_Scalar & x ()
T_Scalar & y ()
const T_Scalar & r () const
const T_Scalar & g () const
T_Scalar & r ()
T_Scalar & g ()
const T_Scalar & s () const
const T_Scalar & t () const
T_Scalar & s ()
T_Scalar & t ()
Vector2 operator+ (const Vector2 &other) const
Vector2 operator- (const Vector2 &other) const
Vector2 operator* (const Vector2 &other) const
Vector2 operator/ (const Vector2 &other) const
Vector2 operator+ (T_Scalar val) const
Vector2 operator- (T_Scalar val) const
Vector2 operator* (T_Scalar val) const
Vector2 operator/ (T_Scalar val) const
Vector2 operator- () const
Vector2operator+= (const Vector2 &other)
Vector2operator-= (const Vector2 &other)
Vector2operator*= (const Vector2 &other)
Vector2operator/= (const Vector2 &other)
Vector2operator+= (T_Scalar val)
Vector2operator-= (T_Scalar val)
Vector2operator*= (T_Scalar val)
Vector2operator/= (T_Scalar val)
Vector2operator= (const Vector2 &other)
Vector2operator= (T_Scalar val)
bool operator== (const Vector2 &other) const
bool operator!= (const Vector2 &other) const
bool operator< (const Vector2 &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 Vector2normalize (T_Scalar *len=NULL)
template<>
half length () const
template<>
half lengthSquared () const

Static Public Attributes

static const int scalar_count = 2

Protected Attributes

T_Scalar mScalar [scalar_count]

Detailed Description

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

The Vector2 class is a template class that implements a generic 2 components vector, see also vl::fvec2, vl::dvec2, vl::uvec2, vl::ivec2, vl::svec2, vl::usvec2, vl::bvec2, vl::ubvec2.

See also:
Vector4, Vector3, Matrix4, Matrix3, Matrix2

Definition at line 97 of file Vector2.hpp.


Member Typedef Documentation

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

Definition at line 100 of file Vector2.hpp.


Constructor & Destructor Documentation

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

Definition at line 102 of file Vector2.hpp.

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

Definition at line 106 of file Vector2.hpp.

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

Definition at line 112 of file Vector2.hpp.


Member Function Documentation

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

Definition at line 119 of file Vector2.hpp.

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

Definition at line 121 of file Vector2.hpp.

Referenced by vl::abs(), vl::acos(), vl::acosh(), vl::RectF::addPoint(), vl::all(), vl::any(), vl::asin(), vl::asinh(), vl::atan(), vl::atanh(), vl::ceil(), vl::Geometry::computeTangentSpace(), vl::Image::copySubImage(), vl::cos(), vl::cosh(), vl::degrees(), vl::dot(), vl::GhostCameraManipulator::enableEvent(), vl::equal(), vl::exp(), vl::exp2(), vl::floor(), vl::Matrix3< T_Scalar >::getScaling(), vl::Matrix3< T_Scalar >::getT(), vl::Matrix3< T_Scalar >::getTranslation(), vl::Matrix3< T_Scalar >::getX(), vl::Matrix3< T_Scalar >::getY(), vl::greaterThan(), vl::greaterThanEqual(), vl::inversesqrt(), vl::isinf(), vl::isnan(), vl::Vector2< int >::isNull(), vl::Vector2< int >::length(), vl::Vector2< int >::lengthSquared(), vl::lessThan(), vl::lessThanEqual(), vl::log(), vl::log10(), vl::log2(), vl::max(), vl::min(), vl::mix(), vl::modf(), vl::TrackballManipulator::mouseDownEvent(), vl::FlatManipulator::mouseDownEvent(), vl::TrackballManipulator::mouseMoveEvent(), vl::GhostCameraManipulator::mouseMoveEvent(), vl::FlatManipulator::mouseMoveEvent(), vl::notEqual(), vl::Vector2< int >::operator*(), vl::operator*(), vl::Vector2< int >::operator+(), vl::Vector2< int >::operator-(), vl::Vector2< int >::operator/(), vl::Vector2< int >::operator<(), vl::Vector2< int >::operator=(), vl::Vector2< int >::operator==(), vl::pow(), vl::radians(), vl::Text::rawboundingRect(), vl::CoreText::rawboundingRect(), vl::DrawPixels::render_Implementation(), vl::Text::renderText(), vl::CoreText::renderText(), vl::round(), vl::roundEven(), vl::Matrix3< T_Scalar >::scale(), vl::Matrix3< T_Scalar >::setT(), vl::Matrix3< T_Scalar >::setX(), vl::Matrix3< T_Scalar >::setY(), vl::sign(), vl::sin(), vl::sinh(), vl::smoothstep(), vl::sqrt(), vl::step(), vl::tan(), vl::tanh(), vl::TrackballManipulator::trackballRotation(), vl::trunc(), vl::Vector2< int >::Vector2(), vl::Vector3< int >::Vector3(), vl::Vector4< unsigned int >::Vector4(), and vl::vlx_toValue().

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

Definition at line 122 of file Vector2.hpp.

Referenced by vl::abs(), vl::acos(), vl::acosh(), vl::RectF::addPoint(), vl::all(), vl::any(), vl::asin(), vl::asinh(), vl::atan(), vl::atanh(), vl::ceil(), vl::Geometry::computeTangentSpace(), vl::Image::copySubImage(), vl::cos(), vl::cosh(), vl::degrees(), vl::dot(), vl::equal(), vl::exp(), vl::exp2(), vl::floor(), vl::Matrix3< T_Scalar >::getScaling(), vl::Matrix3< T_Scalar >::getT(), vl::Matrix3< T_Scalar >::getTranslation(), vl::Matrix3< T_Scalar >::getX(), vl::Matrix3< T_Scalar >::getY(), vl::greaterThan(), vl::greaterThanEqual(), vl::inversesqrt(), vl::isinf(), vl::isnan(), vl::Vector2< int >::isNull(), vl::Vector2< int >::length(), vl::Vector2< int >::lengthSquared(), vl::lessThan(), vl::lessThanEqual(), vl::log(), vl::log10(), vl::log2(), vl::max(), vl::min(), vl::mix(), vl::modf(), vl::TrackballManipulator::mouseDownEvent(), vl::FlatManipulator::mouseDownEvent(), vl::TrackballManipulator::mouseMoveEvent(), vl::FlatManipulator::mouseMoveEvent(), vl::notEqual(), vl::Vector2< int >::operator*(), vl::operator*(), vl::Vector2< int >::operator+(), vl::Vector2< int >::operator-(), vl::Vector2< int >::operator/(), vl::Vector2< int >::operator<(), vl::Vector2< int >::operator=(), vl::Vector2< int >::operator==(), vl::pow(), vl::radians(), vl::Text::rawboundingRect(), vl::CoreText::rawboundingRect(), vl::DrawPixels::render_Implementation(), vl::Text::renderText(), vl::CoreText::renderText(), vl::round(), vl::roundEven(), vl::Matrix3< T_Scalar >::scale(), vl::Matrix3< T_Scalar >::setT(), vl::Matrix3< T_Scalar >::setX(), vl::Matrix3< T_Scalar >::setY(), vl::sign(), vl::sin(), vl::sinh(), vl::smoothstep(), vl::sqrt(), vl::step(), vl::tan(), vl::tanh(), vl::TrackballManipulator::trackballRotation(), vl::trunc(), vl::Vector2< int >::Vector2(), vl::Vector3< int >::Vector3(), vl::Vector4< unsigned int >::Vector4(), and vl::vlx_toValue().

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

Definition at line 124 of file Vector2.hpp.

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

Definition at line 125 of file Vector2.hpp.

template<typename T_Scalar>
const T_Scalar& vl::Vector2< T_Scalar >::r (  ) const [inline]

Definition at line 127 of file Vector2.hpp.

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

Definition at line 128 of file Vector2.hpp.

template<typename T_Scalar>
T_Scalar& vl::Vector2< T_Scalar >::r (  ) [inline]

Definition at line 130 of file Vector2.hpp.

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

Definition at line 131 of file Vector2.hpp.

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

Definition at line 136 of file Vector2.hpp.

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

Definition at line 137 of file Vector2.hpp.

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

Definition at line 139 of file Vector2.hpp.

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

Definition at line 143 of file Vector2.hpp.

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

Definition at line 147 of file Vector2.hpp.

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

Definition at line 151 of file Vector2.hpp.

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

Definition at line 155 of file Vector2.hpp.

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

Definition at line 159 of file Vector2.hpp.

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

Definition at line 163 of file Vector2.hpp.

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

Definition at line 167 of file Vector2.hpp.

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

Definition at line 171 of file Vector2.hpp.

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

Definition at line 175 of file Vector2.hpp.

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

Definition at line 180 of file Vector2.hpp.

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

Definition at line 185 of file Vector2.hpp.

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

Definition at line 190 of file Vector2.hpp.

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

Definition at line 195 of file Vector2.hpp.

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

Definition at line 200 of file Vector2.hpp.

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

Definition at line 205 of file Vector2.hpp.

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

Definition at line 210 of file Vector2.hpp.

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

Definition at line 215 of file Vector2.hpp.

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

Definition at line 221 of file Vector2.hpp.

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

Definition at line 226 of file Vector2.hpp.

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

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

Definition at line 230 of file Vector2.hpp.

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

Definition at line 234 of file Vector2.hpp.

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

Definition at line 241 of file Vector2.hpp.

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

Definition at line 242 of file Vector2.hpp.

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

Definition at line 243 of file Vector2.hpp.

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

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

Definition at line 244 of file Vector2.hpp.

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

Definition at line 245 of file Vector2.hpp.

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

Definition at line 246 of file Vector2.hpp.

Referenced by vl::normalize().

template<>
half vl::Vector2< half >::length (  ) const [inline]

Definition at line 608 of file half.hpp.

References vl::sqrt().

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

Definition at line 609 of file half.hpp.


Member Data Documentation

template<typename T_Scalar>
const int vl::Vector2< T_Scalar >::scalar_count = 2 [static]

Definition at line 101 of file Vector2.hpp.

template<typename T_Scalar>
T_Scalar vl::Vector2< 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.