Files Class List
IPoint3< TYPE > Class Template Reference

Detailed Description

template<typename TYPE>
class cy::IPoint3< TYPE >

3D integer point class

#include <cyIPoint.h>

Public Member Functions

Constructors
 IPoint3 ()
 
 IPoint3 (const TYPE &_x, const TYPE &_y, const TYPE &_z)
 
 IPoint3 (const IPoint3 &p)
 
 IPoint3 (const TYPE &v)
 
 IPoint3 (const IPoint2< TYPE > &p, TYPE _z=0)
 
 IPoint3 (const IPoint4< TYPE > &p)
 
template<typename T >
 IPoint3 (const IPoint3< T > &p)
 
template<typename T >
 IPoint3 (const IPoint2< T > &p, TYPE _z=0)
 
template<typename T >
 IPoint3 (const IPoint4< T > &p)
 
template<int M>
 IPoint3 (const IPoint< TYPE, M > &p)
 
template<typename T , int M>
 IPoint3 (const IPoint< T, M > &p)
 
template<typename P >
 IPoint3 (const P &p)
 
Set & Get value methods
void Zero ()
 
void Get (TYPE *p) const
 
void Set (const TYPE *p)
 
void Set (const TYPE &v)
 
void Set (const TYPE &_x, const TYPE &_y, const TYPE &_z)
 
Length and Normalize 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
IPoint3 operator- () const
 
Binary operators
IPoint3 operator+ (const IPoint3 &p) const
 
IPoint3 operator- (const IPoint3 &p) const
 
IPoint3 operator* (const IPoint3 &p) const
 
IPoint3 operator/ (const IPoint3 &p) const
 
IPoint3 operator+ (const TYPE &v) const
 
IPoint3 operator- (const TYPE &v) const
 
IPoint3 operator* (const TYPE &v) const
 
IPoint3 operator/ (const TYPE &v) const
 
Assignment operators
const IPoint3operator= (const IPoint3 &p)
 
const IPoint3operator+= (const IPoint3 &p)
 
const IPoint3operator-= (const IPoint3 &p)
 
const IPoint3operator*= (const IPoint3 &p)
 
const IPoint3operator/= (const IPoint3 &p)
 
const IPoint3operator+= (const TYPE &v)
 
const IPoint3operator-= (const TYPE &v)
 
const IPoint3operator*= (const TYPE &v)
 
const IPoint3operator/= (const TYPE &v)
 
Bitwise operators
IPoint3 operator<< (const IPoint3 &p) const
 
IPoint3 operator>> (const IPoint3 &p) const
 
IPoint3 operator& (const IPoint3 &p) const
 
IPoint3 operator| (const IPoint3 &p) const
 
IPoint3 operator^ (const IPoint3 &p) const
 
IPoint3 operator<< (const TYPE &v) const
 
IPoint3 operator>> (const TYPE &v) const
 
IPoint3 operator& (const TYPE &v) const
 
IPoint3 operator| (const TYPE &v) const
 
IPoint3 operator^ (const TYPE &v) const
 
Bitwise Assignment operators
const IPoint3operator<<= (const IPoint3 &p)
 
const IPoint3operator>>= (const IPoint3 &p)
 
const IPoint3operator&= (const IPoint3 &p)
 
const IPoint3operator|= (const IPoint3 &p)
 
const IPoint3operator^= (const IPoint3 &p)
 
const IPoint3operator<<= (const TYPE &v)
 
const IPoint3operator>>= (const TYPE &v)
 
const IPoint3operator&= (const TYPE &v)
 
const IPoint3operator|= (const TYPE &v)
 
const IPoint3operator^= (const TYPE &v)
 
Test operators
bool operator== (const IPoint3 &p) const
 
bool operator!= (const IPoint3 &p) const
 
Access operators
TYPE & operator[] (int i)
 
const TYPE & operator[] (int i) const
 
TYPE & Element (int i)
 
const TYPE & Element (int i) const
 
TYPE * Data ()
 
const TYPE * Data () const
 
Cross product and dot product
TYPE Dot (const IPoint3 &p) const
 
TYPE operator% (const IPoint3 &p) const
 
Conversion Methods
IPoint2< TYPE > XY () const
 

Public Attributes

Components of the point
TYPE x
 
TYPE y
 
TYPE z
 

Friends

IPoint3 operator+ (const TYPE v, const IPoint3 &p)
 
IPoint3 operator- (const TYPE v, const IPoint3 &p)
 
IPoint3 operator* (const TYPE v, const IPoint3 &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/3]

void Set ( const TYPE *  p)

Sets the coordinates using the values in the given array.

§ Set() [2/3]

void Set ( const TYPE &  v)

Sets all coordinates using the given value.

§ Set() [3/3]

void Set ( const TYPE &  _x,
const TYPE &  _y,
const TYPE &  _z 
)

Sets the coordinates using the given values.

§ 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 IPoint3< TYPE > &  p) const

Dot product.

§ operator%()

TYPE operator% ( const IPoint3< TYPE > &  p) const

Dot product.

Friends And Related Function Documentation

§ operator+

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

Addition with a constant.

§ operator-

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

Subtraction from a constant.

§ operator*

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

Multiplication with a constant.