SCV  4.2.1
Simple Components for Visual
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
scv::MatrixTemplate< T > Class Template Reference

A generic object matrix with basic functions. More...

#include <MatrixTemplate.h>

Public Member Functions

virtual ~MatrixTemplate (void)
 
 MatrixTemplate (void)
 Default Constructor.
 
 MatrixTemplate (unsigned int width, unsigned int height)
 Constructor.
 
 MatrixTemplate (unsigned int width, unsigned int height, const T &rhs)
 Constructor.
 
 MatrixTemplate (const MatrixTemplate &rhs)
 Copy Constructor.
 
MatrixTemplateoperator= (const MatrixTemplate &rhs)
 Operator "Basic Assignment".
 
T & operator() (unsigned int l, unsigned int c)
 Operator "Function Call".
 
bool operator== (const MatrixTemplate< T > &rhs) const
 Operator "Equal To".
 
int getWidth (void) const
 Gets the width of the matrix.
 
int getHeight (void) const
 Gets the height of the matrix.
 
T & get (unsigned int l, unsigned int c)
 Gets one element of the matrix by reference.
 
std::vector< T > & getData (void)
 Gets the data vector of the matrix by reference;.
 
void set (const scv::Point &p, T rhs)
 Sets a new object to a specified position of the matrix.
 
void set (unsigned int l, unsigned int c, T rhs)
 Sets a new object to a specified position of the matrix.
 
bool isValid (const scv::Point &p)
 Gets a boolean that specifies if the input position of the matrix is valid.
 
bool isValid (unsigned int l, unsigned int c)
 Gets a boolean that specifies if the input position of the matrix is valid.
 
void resize (unsigned int l, unsigned int c)
 Resize the matrix.
 

Protected Attributes

unsigned int _width
 
unsigned int _height
 
std::vector< T > _data
 

Detailed Description

template<typename T>
class scv::MatrixTemplate< T >

A generic object matrix with basic functions.

Constructor & Destructor Documentation

template<typename T>
virtual scv::MatrixTemplate< T >::~MatrixTemplate ( void  )
inlinevirtual
template<typename T>
scv::MatrixTemplate< T >::MatrixTemplate ( void  )
inline

Default Constructor.

template<typename T>
scv::MatrixTemplate< T >::MatrixTemplate ( unsigned int  width,
unsigned int  height 
)
inline

Constructor.

Parameters
widthWidth of the matrix.
heightHeight of the matrix.
template<typename T>
scv::MatrixTemplate< T >::MatrixTemplate ( unsigned int  width,
unsigned int  height,
const T &  rhs 
)
inline

Constructor.

Parameters
widthWidth of the matrix.
heightHeight of the matrix.
rhsThe initialization value of the matrix.
template<typename T>
scv::MatrixTemplate< T >::MatrixTemplate ( const MatrixTemplate< T > &  rhs)
inline

Copy Constructor.

Member Function Documentation

template<typename T>
T& scv::MatrixTemplate< T >::get ( unsigned int  l,
unsigned int  c 
)
inline

Gets one element of the matrix by reference.

Parameters
lLine
cColumn
template<typename T>
std::vector<T>& scv::MatrixTemplate< T >::getData ( void  )
inline

Gets the data vector of the matrix by reference;.

template<typename T>
int scv::MatrixTemplate< T >::getHeight ( void  ) const
inline

Gets the height of the matrix.

template<typename T>
int scv::MatrixTemplate< T >::getWidth ( void  ) const
inline

Gets the width of the matrix.

template<typename T>
bool scv::MatrixTemplate< T >::isValid ( const scv::Point p)
inline

Gets a boolean that specifies if the input position of the matrix is valid.

template<typename T>
bool scv::MatrixTemplate< T >::isValid ( unsigned int  l,
unsigned int  c 
)
inline

Gets a boolean that specifies if the input position of the matrix is valid.

template<typename T>
T& scv::MatrixTemplate< T >::operator() ( unsigned int  l,
unsigned int  c 
)
inline

Operator "Function Call".

template<typename T>
MatrixTemplate& scv::MatrixTemplate< T >::operator= ( const MatrixTemplate< T > &  rhs)
inline

Operator "Basic Assignment".

template<typename T>
bool scv::MatrixTemplate< T >::operator== ( const MatrixTemplate< T > &  rhs) const
inline

Operator "Equal To".

template<typename T>
void scv::MatrixTemplate< T >::resize ( unsigned int  l,
unsigned int  c 
)
inline

Resize the matrix.

Parameters
lNew number of lines.
cNew number of columns.
template<typename T>
void scv::MatrixTemplate< T >::set ( const scv::Point p,
rhs 
)
inline

Sets a new object to a specified position of the matrix.

template<typename T>
void scv::MatrixTemplate< T >::set ( unsigned int  l,
unsigned int  c,
rhs 
)
inline

Sets a new object to a specified position of the matrix.

Member Data Documentation

template<typename T>
std::vector<T> scv::MatrixTemplate< T >::_data
protected
template<typename T>
unsigned int scv::MatrixTemplate< T >::_height
protected
template<typename T>
unsigned int scv::MatrixTemplate< T >::_width
protected

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