Files Class List
IPoint< TYPE, N > Class Template Reference

Detailed Description

template<typename TYPE, int N>
class cy::IPoint< TYPE, N >

A general class for N-dimensional integer points.

#include <cyIPoint.h>

Public Member Functions

Constructors
 IPoint ()
 
 IPoint (const IPoint &p)
 
 IPoint (const TYPE *p)
 
 IPoint (const TYPE &v)
 
template<typename T >
 IPoint (const IPoint< T, N > &p)
 
template<int M>
 IPoint (const IPoint< TYPE, M > &p)
 
template<typename T , int M>
 IPoint (const IPoint< T, M > &p)
 
 IPoint (const IPoint2< TYPE > &p)
 
 IPoint (const IPoint3< TYPE > &p)
 
 IPoint (const IPoint4< TYPE > &p)
 
template<typename T >
 IPoint (const IPoint2< T > &p)
 
template<typename T >
 IPoint (const IPoint3< T > &p)
 
template<typename T >
 IPoint (const IPoint4< T > &p)
 
template<typename P >
 IPoint (const P &p)
 
Set & Get value methods
void Zero ()
 
void Get (TYPE *p) const
 
void Set (const TYPE *p)
 
void Set (const TYPE &v)
 
template<int M>
void CopyData (TYPE *p)
 
template<typename T , int M>
void ConvertData (T *p)
 
General methods
TYPE Sum () const
 
bool IsZero () const
 
TYPE Min () const
 
TYPE Max () const
 
int MinID () const
 
int MaxID () const
 
Limit methods
void Clamp (const TYPE &minValue, const TYPE &maxValue)
 
void ClampMin (const TYPE &v)
 
void ClampMax (const TYPE &v)
 
void Abs ()
 
Unary operators
IPoint operator- () const
 
Binary operators
IPoint operator+ (const IPoint &p) const
 
IPoint operator- (const IPoint &p) const
 
IPoint operator* (const IPoint &p) const
 
IPoint operator/ (const IPoint &p) const
 
IPoint operator+ (const TYPE &v) const
 
IPoint operator- (const TYPE &v) const
 
IPoint operator* (const TYPE &v) const
 
IPoint operator/ (const TYPE &v) const
 
Assignment operators
const IPointoperator= (const IPoint &p)
 
const IPointoperator+= (const IPoint &p)
 
const IPointoperator-= (const IPoint &p)
 
const IPointoperator*= (const IPoint &p)
 
const IPointoperator/= (const IPoint &p)
 
const IPointoperator+= (const TYPE v)
 
const IPointoperator-= (const TYPE v)
 
const IPointoperator*= (const TYPE v)
 
const IPointoperator/= (const TYPE v)
 
Bitwise operators
IPoint operator<< (const IPoint &p) const
 
IPoint operator>> (const IPoint &p) const
 
IPoint operator& (const IPoint &p) const
 
IPoint operator| (const IPoint &p) const
 
IPoint operator^ (const IPoint &p) const
 
IPoint operator<< (const TYPE &v) const
 
IPoint operator>> (const TYPE &v) const
 
IPoint operator& (const TYPE &v) const
 
IPoint operator| (const TYPE &v) const
 
IPoint operator^ (const TYPE &v) const
 
Bitwise Assignment operators
const IPointoperator<<= (const IPoint &p)
 
const IPointoperator>>= (const IPoint &p)
 
const IPointoperator&= (const IPoint &p)
 
const IPointoperator|= (const IPoint &p)
 
const IPointoperator^= (const IPoint &p)
 
const IPointoperator<<= (const TYPE &v)
 
const IPointoperator>>= (const TYPE &v)
 
const IPointoperator&= (const TYPE &v)
 
const IPointoperator|= (const TYPE &v)
 
const IPointoperator^= (const TYPE &v)
 
Test operators
bool operator== (const IPoint &p) const
 
bool operator!= (const IPoint &p) const
 
Access operators
TYPE & operator[] (int i)
 
TYPE operator[] (int i) const
 
Dot product
TYPE Dot (const IPoint &p) const
 
TYPE operator% (const IPoint &p) const
 

Public Attributes

Components of the point
TYPE data [N]
 

Friends

IPoint operator+ (const TYPE v, const IPoint &p)
 
IPoint operator- (const TYPE v, const IPoint &p)
 
IPoint operator* (const TYPE v, const IPoint &p)
 

Member Function Documentation

§ Zero()

void Zero ( )

Sets the coordinates as zero.

§ Get()

void Get ( TYPE *  p) const

Puts the coordinate values into the array.

§ Set() [1/2]

void Set ( const TYPE *  p)

Sets the coordinates using the values in the given array.

§ Set() [2/2]

void Set ( const TYPE &  v)

Sets all coordinates using the given value.

§ CopyData()

void CopyData ( TYPE *  p)

Sets the coordinates as zero.

§ ConvertData()

void ConvertData ( T *  p)

Sets the coordinates as zero.

§ Sum()

TYPE Sum ( ) const

Returns the sum of its components.

§ IsZero()

bool IsZero ( ) const

Returns true if all components are exactly zero.

§ Min()

TYPE Min ( ) const

Returns the sum of its components.

§ Max()

TYPE Max ( ) const

Returns the sum of its components.

§ MinID()

int MinID ( ) const

Returns the sum of its components.

§ MaxID()

int MaxID ( ) const

Returns the sum of its components.

§ Clamp()

void Clamp ( const TYPE &  minValue,
const TYPE &  maxValue 
)

Converts all negative components to positive values.

§ ClampMin()

void ClampMin ( const TYPE &  v)

Converts all negative components to positive values.

§ ClampMax()

void ClampMax ( const TYPE &  v)

Converts all negative components to positive values.

§ Abs()

void Abs ( )

Converts all negative components to positive values.

§ Dot()

TYPE Dot ( const IPoint< TYPE, N > &  p) const

Dot product.

§ operator%()

TYPE operator% ( const IPoint< TYPE, N > &  p) const

Dot product operator.

Friends And Related Function Documentation

§ operator+

IPoint operator+ ( const TYPE  v,
const IPoint< TYPE, N > &  p 
)
friend

Addition with a constant.

§ operator-

IPoint operator- ( const TYPE  v,
const IPoint< TYPE, N > &  p 
)
friend

Subtraction from a constant.

§ operator*

IPoint operator* ( const TYPE  v,
const IPoint< TYPE, N > &  p 
)
friend

Multiplication with a constant.