Files Class List
IPoint4< TYPE > Class Template Reference

Detailed Description

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

4D integer point class

#include <cyIPoint.h>

Public Member Functions

Constructors
 IPoint4 ()
 
 IPoint4 (const TYPE &_x, const TYPE &_y, const TYPE &_z, const TYPE &_w)
 
 IPoint4 (const IPoint4 &p)
 
 IPoint4 (const TYPE &v)
 
 IPoint4 (const IPoint3< TYPE > &p, TYPE _w=0)
 
 IPoint4 (const IPoint2< TYPE > &p, TYPE _z=0, TYPE _w=0)
 
template<typename T >
 IPoint4 (const IPoint4< T > &p)
 
template<typename T >
 IPoint4 (const IPoint3< T > &p, TYPE _w=0)
 
template<typename T >
 IPoint4 (const IPoint2< T > &p, TYPE _z=0, TYPE _w=0)
 
template<int M>
 IPoint4 (const IPoint< TYPE, M > &p)
 
template<typename T , int M>
 IPoint4 (const IPoint< T, M > &p)
 
template<typename P >
 IPoint4 (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, const TYPE &_w=0)
 
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
IPoint4 operator- () const
 
Binary operators
IPoint4 operator+ (const IPoint4 &p) const
 
IPoint4 operator- (const IPoint4 &p) const
 
IPoint4 operator* (const IPoint4 &p) const
 
IPoint4 operator/ (const IPoint4 &p) const
 
IPoint4 operator+ (const TYPE &v) const
 
IPoint4 operator- (const TYPE &v) const
 
IPoint4 operator* (const TYPE &v) const
 
IPoint4 operator/ (const TYPE &v) const
 
Assignment operators
const IPoint4operator= (const IPoint4 &p)
 
const IPoint4operator+= (const IPoint4 &p)
 
const IPoint4operator-= (const IPoint4 &p)
 
const IPoint4operator*= (const IPoint4 &p)
 
const IPoint4operator/= (const IPoint4 &p)
 
const IPoint4operator+= (const TYPE &v)
 
const IPoint4operator-= (const TYPE &v)
 
const IPoint4operator*= (const TYPE &v)
 
const IPoint4operator/= (const TYPE &v)
 
Bitwise operators
IPoint4 operator<< (const IPoint4 &p) const
 
IPoint4 operator>> (const IPoint4 &p) const
 
IPoint4 operator& (const IPoint4 &p) const
 
IPoint4 operator| (const IPoint4 &p) const
 
IPoint4 operator^ (const IPoint4 &p) const
 
IPoint4 operator<< (const TYPE &v) const
 
IPoint4 operator>> (const TYPE &v) const
 
IPoint4 operator& (const TYPE &v) const
 
IPoint4 operator| (const TYPE &v) const
 
IPoint4 operator^ (const TYPE &v) const
 
Bitwise Assignment operators
const IPoint4operator<<= (const IPoint4 &p)
 
const IPoint4operator>>= (const IPoint4 &p)
 
const IPoint4operator&= (const IPoint4 &p)
 
const IPoint4operator|= (const IPoint4 &p)
 
const IPoint4operator^= (const IPoint4 &p)
 
const IPoint4operator<<= (const TYPE &v)
 
const IPoint4operator>>= (const TYPE &v)
 
const IPoint4operator&= (const TYPE &v)
 
const IPoint4operator|= (const TYPE &v)
 
const IPoint4operator^= (const TYPE &v)
 
Test operators
bool operator== (const IPoint4 &p) const
 
bool operator!= (const IPoint4 &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 IPoint4 &p) const
 
TYPE operator% (const IPoint4 &p) const
 
Conversion Methods
IPoint2< TYPE > XY () const
 
IPoint3< TYPE > XYZ () const
 

Public Attributes

Components of the point
TYPE x
 
TYPE y
 
TYPE z
 
TYPE w
 

Friends

IPoint4 operator+ (const TYPE v, const IPoint4 &p)
 
IPoint4 operator- (const TYPE v, const IPoint4 &p)
 
IPoint4 operator* (const TYPE v, const IPoint4 &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,
const TYPE &  _w = 0 
)

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

Dot product.

§ operator%()

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

Dot product.

Friends And Related Function Documentation

§ operator+

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

Addition with a constant.

§ operator-

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

Subtraction from a constant.

§ operator*

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

Multiplication with a constant.