Public Types | Public Member Functions | List of all members
istd::CIndex2d Class Reference

Index implementation for addressing elements in 2D-space. More...

#include <CIndex2d.h>

Inheritance diagram for istd::CIndex2d:
istd::TIndex< 2 > ibase::CSize

Public Types

typedef TIndex< 2 > BaseClass
 
- Public Types inherited from istd::TIndex< 2 >
enum  
 
typedef int IndexType
 
typedef int * Iterator
 

Public Member Functions

 CIndex2d ()
 
 CIndex2d (int x, int y)
 
 CIndex2d (const TIndex< 2 > &index)
 
 CIndex2d (const QPoint &point)
 
 CIndex2d (const QSize &size)
 
int GetX () const
 
void SetX (int value)
 
int GetY () const
 
void SetY (int value)
 
bool operator< (const CIndex2d &index) const
 
bool operator> (const CIndex2d &index) const
 
bool operator<= (const CIndex2d &index) const
 
bool operator>= (const CIndex2d &index) const
 
 operator QSize () const
 Cast/convert index to QSize object. More...
 
 operator QPoint () const
 Cast/convert index to QPoint object. More...
 
 operator QPointF () const
 Cast/convert index to QPointF object. More...
 
CIndex2doperator= (const TIndex< 2 > &index)
 Assign value from a general defined 2D-index. More...
 
- Public Member Functions inherited from istd::TIndex< 2 >
 TIndex ()
 Default constructor with initialization of member to 0. More...
 
 TIndex (int value)
 Constructor initializing all member to specified value. More...
 
 TIndex (const TIndex &index)
 Copy constructor. More...
 
bool IsValid () const
 Check if this index is valid. More...
 
bool IsZero () const
 Check if this index point at zero element. More...
 
bool IsSizeEmpty () const
 Check if this index interpreted as size is empty. More...
 
void Reset ()
 Reset this object. More...
 
void Clear ()
 Set all components to 0. More...
 
bool IsDimensionsCountFixed () const
 Check, if number dimensions is fixed. More...
 
int GetDimensionsCount () const
 Get number of dimensions of this index. More...
 
bool SetDimensionsCount (int count) const
 Set number of dimensions of this index. More...
 
int GetAt (int index) const
 Get element stored at specified index. More...
 
void SetAt (int index, int value)
 Set element at specified index. More...
 
void SetAllTo (int value)
 Set all components to specified value. More...
 
bool IncreaseAt (int index)
 Increase single component at specified position. More...
 
bool DecreaseAt (int index)
 Decrease single component at specified position. More...
 
bool IsInside (const TIndex &boundaries) const
 Check if index is inside boundaries. More...
 
bool Increase (const TIndex &boundaries)
 Increase this index inside the boundaries. More...
 
bool Decrease (const TIndex &boundaries)
 Decrease this index inside the boundaries. More...
 
int GetProductVolume () const
 Get total number of elements if this index is treated as size. More...
 
int GetIterationIndex (const TIndex &boundaries) const
 Get index of iteration from zero to current index inside some boundaries. More...
 
Iterator Begin () const
 Get begin value of element access iterator. More...
 
Iterator End () const
 Get end value of element access iterator. More...
 
int operator[] (int index) const
 
int & operator[] (int index)
 
bool operator== (const TIndex &index) const
 
bool operator!= (const TIndex &index) const
 
TIndex operator+ (const TIndex &index) const
 
TIndexoperator+= (const TIndex &index)
 
TIndex operator- (const TIndex &index) const
 
TIndexoperator-= (const TIndex &index)
 

Additional Inherited Members

- Static Public Member Functions inherited from istd::TIndex< 2 >
static const TIndex< Dimensions > & GetZero ()
 Get global instance of zero index. More...
 
static const TIndex< Dimensions > & GetInvalid ()
 Get global instance of invalid index. More...
 

Detailed Description

Index implementation for addressing elements in 2D-space.

Definition at line 20 of file CIndex2d.h.

Member Typedef Documentation

Definition at line 23 of file CIndex2d.h.

Constructor & Destructor Documentation

istd::CIndex2d::CIndex2d ( )
inline

Definition at line 65 of file CIndex2d.h.

istd::CIndex2d::CIndex2d ( int  x,
int  y 
)
inline

Definition at line 70 of file CIndex2d.h.

References istd::TIndex< 2 >::SetAt().

istd::CIndex2d::CIndex2d ( const TIndex< 2 > &  index)
inline

Definition at line 77 of file CIndex2d.h.

istd::CIndex2d::CIndex2d ( const QPoint &  point)
inline

Definition at line 82 of file CIndex2d.h.

References istd::TIndex< 2 >::SetAt().

istd::CIndex2d::CIndex2d ( const QSize &  size)
inline

Definition at line 89 of file CIndex2d.h.

References istd::TIndex< 2 >::SetAt().

Member Function Documentation

int istd::CIndex2d::GetX ( ) const
inline
int istd::CIndex2d::GetY ( ) const
inline
istd::CIndex2d::operator QPoint ( ) const
inline

Cast/convert index to QPoint object.

Definition at line 168 of file CIndex2d.h.

istd::CIndex2d::operator QPointF ( ) const
inline

Cast/convert index to QPointF object.

Definition at line 174 of file CIndex2d.h.

istd::CIndex2d::operator QSize ( ) const
inline

Cast/convert index to QSize object.

Definition at line 162 of file CIndex2d.h.

bool istd::CIndex2d::operator< ( const CIndex2d index) const
inline

Definition at line 120 of file CIndex2d.h.

References GetX(), and GetY().

bool istd::CIndex2d::operator<= ( const CIndex2d index) const
inline

Definition at line 142 of file CIndex2d.h.

CIndex2d & istd::CIndex2d::operator= ( const TIndex< 2 > &  index)
inline

Assign value from a general defined 2D-index.

Definition at line 154 of file CIndex2d.h.

bool istd::CIndex2d::operator> ( const CIndex2d index) const
inline

Definition at line 136 of file CIndex2d.h.

bool istd::CIndex2d::operator>= ( const CIndex2d index) const
inline

Definition at line 148 of file CIndex2d.h.

void istd::CIndex2d::SetX ( int  value)
inline

Definition at line 102 of file CIndex2d.h.

References istd::TIndex< 2 >::SetAt().

void istd::CIndex2d::SetY ( int  value)
inline

Definition at line 114 of file CIndex2d.h.

References istd::TIndex< 2 >::SetAt().


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

© 2007-2017 Witold Gantzke and Kirill Lepskiy