# Visualization Library

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

[Home] [Tutorials] [All Classes] [Grouped Classes]

# vl::Vector4< scalar_type > 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 Member Functions

| Vector4 (const Vector4 &other)
| Vector4 ()
template<class T >
| Vector4 (const T &other)
| Vector4 (scalar_type x, scalar_type y, scalar_type z, scalar_type w)
| Vector4 (const Vector3< scalar_type > &v, scalar_type w)
| Vector4 (const Vector2< scalar_type > &u, const Vector2< scalar_type > &v)
scalar_type * | ptr ()
const scalar_type * | ptr () const
const scalar_type & | x () const
const scalar_type & | y () const
const scalar_type & | z () const
const scalar_type & | w () const
scalar_type & | x ()
scalar_type & | y ()
scalar_type & | z ()
scalar_type & | w ()
const scalar_type & | r () const
const scalar_type & | g () const
const scalar_type & | b () const
const scalar_type & | a () const
scalar_type & | r ()
scalar_type & | g ()
scalar_type & | b ()
scalar_type & | a ()
const scalar_type & | s () const
const scalar_type & | t () const
const scalar_type & | p () const
const scalar_type & | q () const
scalar_type & | s ()
scalar_type & | t ()
scalar_type & | p ()
scalar_type & | q ()
Vector3< scalar_type > | xyz () const
Vector3< scalar_type > | rgb () const
Vector3< scalar_type > | stp () const
Vector2< scalar_type > | xy () const
Vector2< scalar_type > | rg () const
Vector2< scalar_type > | 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+ (scalar_type val) const
Vector4 | operator- (scalar_type val) const
Vector4 | operator* (scalar_type val) const
Vector4 | operator/ (scalar_type val) const
Vector4 | operator- () const
Vector4 & | operator+= (const Vector4 &other)
Vector4 & | operator-= (const Vector4 &other)
Vector4 & | operator*= (const Vector4 &other)
Vector4 & | operator/= (const Vector4 &other)
Vector4 & | operator+= (scalar_type val)
Vector4 & | operator-= (scalar_type val)
Vector4 & | operator*= (scalar_type val)
Vector4 & | operator/= (scalar_type val)
Vector4 & | operator= (const Vector4 &other)
Vector4 & | operator= (scalar_type val)
bool | operator== (const Vector4 &other) const
bool | operator!= (const Vector4 &other) const
bool | operator< (const Vector4 &other) const
scalar_type & | operator[] (unsigned i)
const scalar_type & | operator[] (unsigned i) const
scalar_type | length () const
scalar_type | lengthSquared () const
bool | isNull () const
const Vector4 & | normalize ()

## Static Public Attributes

static const int | scalar_count = 4

## Protected Attributes

scalar_type | mScalar [scalar_count]

## Detailed Description

### template<typename scalar_type>
class vl::Vector4< scalar_type >

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

## Constructor & Destructor Documentation

template<typename scalar_type>

vl::Vector4< scalar_type >::Vector4 | ( | const Vector4< scalar_type > & | other | ) | `[inline]`

template<typename scalar_type>

vl::Vector4< scalar_type >::Vector4 | ( |  | ) | `[inline]`

template<typename scalar_type>
template<class T >

vl::Vector4< scalar_type >::Vector4 | ( | const T & | other | ) | `[inline, explicit]`

template<typename scalar_type>

vl::Vector4< scalar_type >::Vector4 | ( | scalar_type | x,
|  | scalar_type | y,
|  | scalar_type | z,
|  | scalar_type | w |
| ) |  |  | `[inline, explicit]`

template<typename scalar_type>

vl::Vector4< scalar_type >::Vector4 | ( | const Vector3< scalar_type > & | v,
|  | scalar_type | w |
| ) |  |  | `[inline, explicit]`

template<typename scalar_type>

vl::Vector4< scalar_type >::Vector4 | ( | const Vector2< scalar_type > & | u,
|  | const Vector2< scalar_type > & | v |
| ) |  |  | `[inline, explicit]`

## Member Function Documentation

template<typename scalar_type>

scalar_type* vl::Vector4< scalar_type >::ptr | ( |  | ) | `[inline]`

template<typename scalar_type>

const scalar_type* vl::Vector4< scalar_type >::ptr | ( |  | ) | const`[inline]`

template<typename scalar_type>

const scalar_type& vl::Vector4< scalar_type >::x | ( |  | ) | const`[inline]`

template<typename scalar_type>

const scalar_type& vl::Vector4< scalar_type >::y | ( |  | ) | const`[inline]`

template<typename scalar_type>

const scalar_type& vl::Vector4< scalar_type >::z | ( |  | ) | const`[inline]`

template<typename scalar_type>

const scalar_type& vl::Vector4< scalar_type >::w | ( |  | ) | const`[inline]`

template<typename scalar_type>

scalar_type& vl::Vector4< scalar_type >::x | ( |  | ) | `[inline]`

template<typename scalar_type>

scalar_type& vl::Vector4< scalar_type >::y | ( |  | ) | `[inline]`

template<typename scalar_type>

scalar_type& vl::Vector4< scalar_type >::z | ( |  | ) | `[inline]`

template<typename scalar_type>

scalar_type& vl::Vector4< scalar_type >::w | ( |  | ) | `[inline]`

template<typename scalar_type>

const scalar_type& vl::Vector4< scalar_type >::r | ( |  | ) | const`[inline]`

template<typename scalar_type>

const scalar_type& vl::Vector4< scalar_type >::g | ( |  | ) | const`[inline]`

template<typename scalar_type>

const scalar_type& vl::Vector4< scalar_type >::b | ( |  | ) | const`[inline]`

template<typename scalar_type>

const scalar_type& vl::Vector4< scalar_type >::a | ( |  | ) | const`[inline]`

template<typename scalar_type>

scalar_type& vl::Vector4< scalar_type >::r | ( |  | ) | `[inline]`

template<typename scalar_type>

scalar_type& vl::Vector4< scalar_type >::g | ( |  | ) | `[inline]`

template<typename scalar_type>

scalar_type& vl::Vector4< scalar_type >::b | ( |  | ) | `[inline]`

template<typename scalar_type>

scalar_type& vl::Vector4< scalar_type >::a | ( |  | ) | `[inline]`

template<typename scalar_type>

const scalar_type& vl::Vector4< scalar_type >::s | ( |  | ) | const`[inline]`

template<typename scalar_type>

const scalar_type& vl::Vector4< scalar_type >::t | ( |  | ) | const`[inline]`

template<typename scalar_type>

const scalar_type& vl::Vector4< scalar_type >::p | ( |  | ) | const`[inline]`

template<typename scalar_type>

const scalar_type& vl::Vector4< scalar_type >::q | ( |  | ) | const`[inline]`

template<typename scalar_type>

scalar_type& vl::Vector4< scalar_type >::s | ( |  | ) | `[inline]`

template<typename scalar_type>

scalar_type& vl::Vector4< scalar_type >::t | ( |  | ) | `[inline]`

template<typename scalar_type>

scalar_type& vl::Vector4< scalar_type >::p | ( |  | ) | `[inline]`

template<typename scalar_type>

scalar_type& vl::Vector4< scalar_type >::q | ( |  | ) | `[inline]`

template<typename scalar_type>

Vector3<scalar_type> vl::Vector4< scalar_type >::xyz | ( |  | ) | const`[inline]`

template<typename scalar_type>

Vector3<scalar_type> vl::Vector4< scalar_type >::rgb | ( |  | ) | const`[inline]`

template<typename scalar_type>

Vector3<scalar_type> vl::Vector4< scalar_type >::stp | ( |  | ) | const`[inline]`

template<typename scalar_type>

Vector2<scalar_type> vl::Vector4< scalar_type >::xy | ( |  | ) | const`[inline]`

template<typename scalar_type>

Vector2<scalar_type> vl::Vector4< scalar_type >::rg | ( |  | ) | const`[inline]`

template<typename scalar_type>

Vector2<scalar_type> vl::Vector4< scalar_type >::st | ( |  | ) | const`[inline]`

template<typename scalar_type>

Vector4 vl::Vector4< scalar_type >::operator+ | ( | const Vector4< scalar_type > & | other | ) | const`[inline]`

template<typename scalar_type>

Vector4 vl::Vector4< scalar_type >::operator- | ( | const Vector4< scalar_type > & | other | ) | const`[inline]`

template<typename scalar_type>

Vector4 vl::Vector4< scalar_type >::operator* | ( | const Vector4< scalar_type > & | other | ) | const`[inline]`

template<typename scalar_type>

Vector4 vl::Vector4< scalar_type >::operator/ | ( | const Vector4< scalar_type > & | other | ) | const`[inline]`

template<typename scalar_type>

Vector4 vl::Vector4< scalar_type >::operator+ | ( | scalar_type | val | ) | const`[inline]`

template<typename scalar_type>

Vector4 vl::Vector4< scalar_type >::operator- | ( | scalar_type | val | ) | const`[inline]`

template<typename scalar_type>

Vector4 vl::Vector4< scalar_type >::operator* | ( | scalar_type | val | ) | const`[inline]`

template<typename scalar_type>

Vector4 vl::Vector4< scalar_type >::operator/ | ( | scalar_type | val | ) | const`[inline]`

template<typename scalar_type>

Vector4 vl::Vector4< scalar_type >::operator- | ( |  | ) | const`[inline]`

template<typename scalar_type>

Vector4& vl::Vector4< scalar_type >::operator+= | ( | const Vector4< scalar_type > & | other | ) | `[inline]`

template<typename scalar_type>

Vector4& vl::Vector4< scalar_type >::operator-= | ( | const Vector4< scalar_type > & | other | ) | `[inline]`

template<typename scalar_type>

Vector4& vl::Vector4< scalar_type >::operator*= | ( | const Vector4< scalar_type > & | other | ) | `[inline]`

template<typename scalar_type>

Vector4& vl::Vector4< scalar_type >::operator/= | ( | const Vector4< scalar_type > & | other | ) | `[inline]`

template<typename scalar_type>

Vector4& vl::Vector4< scalar_type >::operator+= | ( | scalar_type | val | ) | `[inline]`

template<typename scalar_type>

Vector4& vl::Vector4< scalar_type >::operator-= | ( | scalar_type | val | ) | `[inline]`

template<typename scalar_type>

Vector4& vl::Vector4< scalar_type >::operator*= | ( | scalar_type | val | ) | `[inline]`

template<typename scalar_type>

Vector4& vl::Vector4< scalar_type >::operator/= | ( | scalar_type | val | ) | `[inline]`

template<typename scalar_type>

Vector4& vl::Vector4< scalar_type >::operator= | ( | const Vector4< scalar_type > & | other | ) | `[inline]`

template<typename scalar_type>

Vector4& vl::Vector4< scalar_type >::operator= | ( | scalar_type | val | ) | `[inline]`

template<typename scalar_type>

bool vl::Vector4< scalar_type >::operator== | ( | const Vector4< scalar_type > & | other | ) | const`[inline]`

template<typename scalar_type>

bool vl::Vector4< scalar_type >::operator!= | ( | const Vector4< scalar_type > & | other | ) | const`[inline]`

template<typename scalar_type>

bool vl::Vector4< scalar_type >::operator< | ( | const Vector4< scalar_type > & | other | ) | const`[inline]`

template<typename scalar_type>

scalar_type& vl::Vector4< scalar_type >::operator[] | ( | unsigned | i | ) | `[inline]`

template<typename scalar_type>

const scalar_type& vl::Vector4< scalar_type >::operator[] | ( | unsigned | i | ) | const`[inline]`

template<typename scalar_type>

scalar_type vl::Vector4< scalar_type >::length | ( |  | ) | const`[inline]`

template<typename scalar_type>

scalar_type vl::Vector4< scalar_type >::lengthSquared | ( |  | ) | const`[inline]`

template<typename scalar_type>

bool vl::Vector4< scalar_type >::isNull | ( |  | ) | const`[inline]`

template<typename scalar_type>

const Vector4& vl::Vector4< scalar_type >::normalize | ( |  | ) | `[inline]`

## Member Data Documentation

template<typename scalar_type>

const int vl::Vector4< scalar_type >::scalar_count = 4`[static]`

template<typename scalar_type>

scalar_type vl::Vector4< scalar_type >::mScalar[scalar_count]`[protected]`

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

- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/Vector4.hpp

Visualization Library v2009.07 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Mon Aug 10 21:41:45 2009.
Permission is granted to use this page to write and publish articles regarding Visualization Library.