Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

vlTriple< T > Class Template Reference

This class repesents a datatype which stores 3 entries of the same type. More...

#include <vltriple.h>

Inheritance diagram for vlTriple< T >:

vlColor3< T > vlVector< T > vlColor4< T > vlColorRGB< T > vlNormal< T > vlColorRGBA< T > List of all members.

Public Member Functions

 vlTriple (T const &x=0, T const &y=0, T const &z=0)
 default constructor

 ~vlTriple ()
 default destructor - no virtual.. it adds 4 bytes everytime

x () const
 get value of x

y () const
 get value of y

z () const
 get value of z

T const & xRef () const
 Returns a reference to the vriable x - prefer x() to this.

T const & yRef () const
 Returns a reference to the vriable y - prefer y() to this.

T const & zRef () const
 Returns a reference to the vriable z - prefer z() to this.

template<class S> vlTriple< T > & operator= (vlTriple< S > const &other)
 override for = operator

template<class S> void x (const S &value)
 set value of x

template<class S> void y (const S &value)
 set value of y

template<class S> void z (const S &value)
 set value of z

bool operator== (vlTriple< T > const &other) const
 checks if the two triple are equal

bool operator!= (vlTriple< T > const &other) const
 checks if the two triple are unequal

vlTriple< T > operator+ () const
 multiples triple elements with +1

vlTriple< T > operator- () const
 multiples triple elements with -1

template<class S> vlTriple< T > operator+ (vlTriple< S > const &other) const
 adds another triple to self and returns the sum

vlTriple< T > operator+ (T const &value) const
 adds a const value to self and returns the sum

template<class S> vlTriple< T > operator- (vlTriple< S > const &other) const
 subtracts another triple from self and returns the result

template<class S> vlTriple< T > operator- (S const &value) const
 subtracts a const value from self and returns the result

template<class S> vlTriple< T > & operator+= (vlTriple< S > const &other)
 adds another triple to self

template<class S> vlTriple< T > & operator-= (vlTriple< S > const &other)
 subtracts another triple from self

template<class S> vlTriple< T > operator * (S const &value) const
 multiples self with other and returns the result

template<class S> vlTriple< T > operator/ (S const &value) const
 divides other from self and returns the result

template<class S> void operator *= (S const &value)
 multiples self with other (self changes)

template<class S> void operator/= (S const &value)
 divides other from self (self changes)


Protected Attributes

m_x
 member variables storing the 3 entries in the triple

m_y
 member variables storing the 3 entries in the triple

m_z
 member variables storing the 3 entries in the triple


Friends

std::ostream & operator<< (std::ostream &os, vlTriple< T > const *const v)
 overriding << to enable writing triple to a stream

std::ostream & operator<< (std::ostream &os, vlTriple< T > const &v)
 overriding << to enable writing triple to a stream


Detailed Description

template<class T>
class vlTriple< T >

The entries can be accessed using x(), y() and z() functions.

Author:
Sarang Lakare <sarang@users.sf.net>

Definition at line 42 of file vltriple.h.


Constructor & Destructor Documentation

template<class T>
vlTriple< T >::vlTriple T const &  x = 0,
T const &  y = 0,
T const &  z = 0
 

Parameters:
T data type.
x the x value.
y the y value.
z the z value

Definition at line 199 of file vltriple.h.

References x, y, and z.

Referenced by vlTriple< int16 >::operator *().

template<class T>
vlTriple< T >::~vlTriple  ) 
 

Note that this is not a virtual function. The reason is that a virtual function adds 4 bytes to the size of the class. Thus, a sizeof(vlTriple<char>) would be 7 bytes if it were virtual.

Parameters:
T data type.

Definition at line 217 of file vltriple.h.


Member Function Documentation

template<class T>
template<class S>
vlTriple<T> vlTriple< T >::operator * S const &  value  )  const [inline]
 

Definition at line 142 of file vltriple.h.

template<class T>
template<class S>
void vlTriple< T >::operator *= S const &  value  )  [inline]
 

Definition at line 159 of file vltriple.h.

template<class T>
bool vlTriple< T >::operator!= vlTriple< T > const &  other  )  const [inline]
 

Parameters:
T data type.
other the other triple to compare with.
Returns:
true if the two triples are unequal.

Definition at line 294 of file vltriple.h.

References vlTriple< T >::m_x, vlTriple< T >::m_y, and vlTriple< T >::m_z.

template<class T>
vlTriple<T> vlTriple< T >::operator+ T const &  value  )  const [inline]
 

Reimplemented in vlNormal< T >, and vlNormal< float >.

Definition at line 105 of file vltriple.h.

template<class T>
template<class S>
vlTriple<T> vlTriple< T >::operator+ vlTriple< S > const &  other  )  const [inline]
 

Definition at line 99 of file vltriple.h.

template<class T>
vlTriple< T > vlTriple< T >::operator+  )  const [inline]
 

Parameters:
T data type.
Returns:
another triple with the result.

Definition at line 340 of file vltriple.h.

template<class T>
template<class S>
vlTriple<T>& vlTriple< T >::operator+= vlTriple< S > const &  other  )  [inline]
 

Definition at line 126 of file vltriple.h.

template<class T>
template<class S>
vlTriple<T> vlTriple< T >::operator- S const &  value  )  const [inline]
 

Definition at line 119 of file vltriple.h.

template<class T>
template<class S>
vlTriple<T> vlTriple< T >::operator- vlTriple< S > const &  other  )  const [inline]
 

Definition at line 112 of file vltriple.h.

template<class T>
vlTriple< T > vlTriple< T >::operator-  )  const [inline]
 

Parameters:
T data type
Returns:
another triple with the result.

Reimplemented in vlNormal< T >, and vlNormal< float >.

Definition at line 352 of file vltriple.h.

References vlTriple< T >::m_x, vlTriple< T >::m_y, and vlTriple< T >::m_z.

template<class T>
template<class S>
vlTriple<T>& vlTriple< T >::operator-= vlTriple< S > const &  other  )  [inline]
 

Definition at line 134 of file vltriple.h.

template<class T>
template<class S>
vlTriple<T> vlTriple< T >::operator/ S const &  value  )  const [inline]
 

Definition at line 149 of file vltriple.h.

template<class T>
template<class S>
void vlTriple< T >::operator/= S const &  value  )  [inline]
 

Definition at line 166 of file vltriple.h.

template<class T>
template<class S>
vlTriple< T > & vlTriple< T >::operator= vlTriple< S > const &  other  )  [inline]
 

Parameters:
T data type.
S Data type of the other triple to be copied
other the other triple to copy.
Returns:
pointer to self.

Definition at line 232 of file vltriple.h.

References vlTriple< T >::m_x, vlTriple< T >::m_y, vlTriple< T >::m_z, vlTriple< T >::x(), vlTriple< T >::y(), and vlTriple< T >::z().

template<class T>
bool vlTriple< T >::operator== vlTriple< T > const &  other  )  const [inline]
 

Parameters:
T data type.
other the other triple to compare with.
Returns:
true if the two triples are equal.

Definition at line 248 of file vltriple.h.

References vlTriple< T >::m_x, vlTriple< T >::m_y, and vlTriple< T >::m_z.

template<class T>
template<class S>
void vlTriple< T >::x const S &  value  )  [inline]
 

Reimplemented in vlNormal< T >, and vlNormal< float >.

Definition at line 75 of file vltriple.h.

template<class T>
T vlTriple< T >::x  )  const [inline]
 

Reimplemented in vlNormal< T >, and vlNormal< float >.

Definition at line 52 of file vltriple.h.

Referenced by vlVolIterConst< DataType, LayoutType >::getRelative(), vlVolIterConst< DataType, LayoutType >::getRelativeNBC(), vlVolIterConst< DataType, LayoutType >::moveRelative(), vlTriple< int16 >::operator+(), vlTriple< int16 >::operator+=(), vlTriple< int16 >::operator-(), vlTriple< int16 >::operator-=(), vlTriple< T >::operator=(), vlVolFioSLC::readInfo(), vlVolIter< DataType, LayoutType >::setRelative(), and vlVolIter< DataType, LayoutType >::setRelativeNBC().

template<class T>
T const& vlTriple< T >::xRef  )  const [inline]
 

Definition at line 61 of file vltriple.h.

template<class T>
template<class S>
void vlTriple< T >::y const S &  value  )  [inline]
 

Reimplemented in vlNormal< T >, and vlNormal< float >.

Definition at line 79 of file vltriple.h.

template<class T>
T vlTriple< T >::y  )  const [inline]
 

Reimplemented in vlNormal< T >, and vlNormal< float >.

Definition at line 55 of file vltriple.h.

Referenced by vlVolIterConst< DataType, LayoutType >::getRelative(), vlVolIterConst< DataType, LayoutType >::getRelativeNBC(), vlVolIterConst< DataType, LayoutType >::moveRelative(), vlTriple< int16 >::operator+(), vlTriple< int16 >::operator+=(), vlTriple< int16 >::operator-(), vlTriple< int16 >::operator-=(), vlTriple< T >::operator=(), vlVolFioSLC::readInfo(), vlVolIter< DataType, LayoutType >::setRelative(), and vlVolIter< DataType, LayoutType >::setRelativeNBC().

template<class T>
T const& vlTriple< T >::yRef  )  const [inline]
 

Definition at line 64 of file vltriple.h.

template<class T>
template<class S>
void vlTriple< T >::z const S &  value  )  [inline]
 

Reimplemented in vlNormal< T >, and vlNormal< float >.

Definition at line 83 of file vltriple.h.

template<class T>
T vlTriple< T >::z  )  const [inline]
 

Reimplemented in vlNormal< T >, and vlNormal< float >.

Definition at line 58 of file vltriple.h.

Referenced by vlVolIterConst< DataType, LayoutType >::getRelative(), vlVolIterConst< DataType, LayoutType >::getRelativeNBC(), vlVolIterConst< DataType, LayoutType >::moveRelative(), vlTriple< int16 >::operator+(), vlTriple< int16 >::operator+=(), vlTriple< int16 >::operator-(), vlTriple< int16 >::operator-=(), vlTriple< T >::operator=(), vlVolFioSLC::readInfo(), vlVolIter< DataType, LayoutType >::setRelative(), and vlVolIter< DataType, LayoutType >::setRelativeNBC().

template<class T>
T const& vlTriple< T >::zRef  )  const [inline]
 

Definition at line 67 of file vltriple.h.


Friends And Related Function Documentation

template<class T>
std::ostream& operator<< std::ostream &  os,
vlTriple< T > const &  v
[friend]
 

Definition at line 179 of file vltriple.h.

template<class T>
std::ostream& operator<< std::ostream &  os,
vlTriple< T > const *const  v
[friend]
 

Definition at line 174 of file vltriple.h.


Member Data Documentation

template<class T>
T vlTriple< T >::m_x [protected]
 

Definition at line 185 of file vltriple.h.

Referenced by vlColorRGB< T >::aLUV(), vlVector< T >::clamp(), vlVector< T >::cross(), vlNormal< T >::cross(), vlVector< T >::dot(), vlVector< T >::length(), vlVector< T >::normalize(), vlTriple< int16 >::operator *(), vlNormal< T >::operator *(), vlTriple< int16 >::operator *=(), vlNormal< T >::operator *=(), vlTriple< float >::operator!=(), vlTriple< T >::operator!=(), vlTriple< int16 >::operator+(), vlNormal< T >::operator+(), vlTriple< int16 >::operator+=(), vlNormal< T >::operator+=(), vlTriple< T >::operator-(), vlTriple< int16 >::operator-(), vlNormal< T >::operator-(), vlTriple< int16 >::operator-=(), vlNormal< T >::operator-=(), vlTriple< int16 >::operator/(), vlNormal< T >::operator/(), vlTriple< int16 >::operator/=(), vlNormal< float >::operator/=(), vlNormal< T >::operator/=(), vlTriple< T >::operator=(), vlTriple< float >::operator==(), vlTriple< T >::operator==(), vlColorRGB< T >::r(), vlColorRGB< T >::rRef(), vlVector< T >::scale(), vlColorRGBA< T >::setAlphaLUV(), vlTriple< int16 >::x(), vlNormal< float >::x(), and vlTriple< int16 >::xRef().

template<class T>
T vlTriple< T >::m_y [protected]
 

Definition at line 185 of file vltriple.h.

Referenced by vlColorRGB< T >::aLUV(), vlVector< T >::clamp(), vlVector< T >::cross(), vlNormal< T >::cross(), vlVector< T >::dot(), vlColorRGB< T >::g(), vlColorRGB< T >::gRef(), vlVector< T >::length(), vlVector< T >::normalize(), vlTriple< int16 >::operator *(), vlNormal< T >::operator *(), vlTriple< int16 >::operator *=(), vlNormal< T >::operator *=(), vlTriple< float >::operator!=(), vlTriple< T >::operator!=(), vlTriple< int16 >::operator+(), vlNormal< T >::operator+(), vlTriple< int16 >::operator+=(), vlNormal< T >::operator+=(), vlTriple< T >::operator-(), vlTriple< int16 >::operator-(), vlNormal< T >::operator-(), vlTriple< int16 >::operator-=(), vlNormal< T >::operator-=(), vlTriple< int16 >::operator/(), vlNormal< T >::operator/(), vlTriple< int16 >::operator/=(), vlNormal< float >::operator/=(), vlNormal< T >::operator/=(), vlTriple< T >::operator=(), vlTriple< float >::operator==(), vlTriple< T >::operator==(), vlVector< T >::scale(), vlColorRGBA< T >::setAlphaLUV(), vlTriple< int16 >::y(), vlNormal< float >::y(), and vlTriple< int16 >::yRef().

template<class T>
T vlTriple< T >::m_z [protected]
 

Definition at line 185 of file vltriple.h.

Referenced by vlColorRGB< T >::aLUV(), vlColorRGB< T >::b(), vlColorRGB< T >::bRef(), vlVector< T >::clamp(), vlVector< T >::cross(), vlNormal< T >::cross(), vlVector< T >::dot(), vlVector< T >::length(), vlVector< T >::normalize(), vlTriple< int16 >::operator *(), vlNormal< T >::operator *(), vlTriple< int16 >::operator *=(), vlNormal< T >::operator *=(), vlTriple< float >::operator!=(), vlTriple< T >::operator!=(), vlTriple< int16 >::operator+(), vlNormal< T >::operator+(), vlTriple< int16 >::operator+=(), vlNormal< T >::operator+=(), vlTriple< T >::operator-(), vlTriple< int16 >::operator-(), vlNormal< T >::operator-(), vlTriple< int16 >::operator-=(), vlNormal< T >::operator-=(), vlTriple< int16 >::operator/(), vlNormal< T >::operator/(), vlTriple< int16 >::operator/=(), vlNormal< float >::operator/=(), vlNormal< T >::operator/=(), vlTriple< T >::operator=(), vlTriple< float >::operator==(), vlTriple< T >::operator==(), vlVector< T >::scale(), vlColorRGBA< T >::setAlphaLUV(), vlTriple< int16 >::z(), vlNormal< float >::z(), and vlTriple< int16 >::zRef().


The documentation for this class was generated from the following file:
Generated on Fri Mar 18 11:33:19 2005 for OpenVL by doxygen 1.3.3