Drag[en]gine Game Engine  1.0
decPoint Class Reference

2 Component Integer Point. More...

#include <decPoint.h>

Public Member Functions

Constructors and Destructors
 decPoint ()
 
 decPoint (int nx, int ny)
 
 decPoint (const decPoint &p)
 
 decPoint (const decVector2 &v)
 
Management
float Length () const
 
void SetZero ()
 
void Set (int nx, int ny)
 
decPoint Absolute () const
 Retrieves absolute point. More...
 
void SetSmallest (const decPoint &p)
 Set each component to the smallest value of this point and another point. More...
 
decPoint Smallest (const decPoint &p) const
 Retrieve point with each component set to the smallest value of this point and another point. More...
 
void SetLargest (const decPoint &p)
 Set each component to the largest value of this point and another point. More...
 
decPoint Largest (const decPoint &p) const
 Retrieve point with each component set to the largest value of this point and another point. More...
 
void SetClamped (const decPoint &minValue, const decPoint &maxValue)
 Clamp each component to the provided range. More...
 
decPoint Clamped (const decPoint &minValue, const decPoint &maxValue) const
 Retrieves point with each component clamped to the provided range. More...
 
Operators
decPoint operator- () const
 
decPointoperator= (const decPoint &p)
 
decPointoperator+= (const decPoint &p)
 
decPointoperator-= (const decPoint &p)
 
decPointoperator*= (int k)
 
decPointoperator/= (int k)
 
decPoint operator+ (const decPoint &p) const
 
decPoint operator- (const decPoint &p) const
 
decPoint operator* (int k) const
 
int operator* (const decPoint &p) const
 
decPoint operator/ (int k) const
 
bool operator== (const decPoint &p) const
 
bool operator!= (const decPoint &p) const
 
bool operator< (const decPoint &p) const
 
bool operator> (const decPoint &p) const
 
bool operator<= (const decPoint &p) const
 
bool operator>= (const decPoint &p) const
 

Public Attributes

int x
 
int y
 

Detailed Description

2 Component Integer Point.

Author
Pl├╝ss Roland
Version
1.0
Date
2014

Constructor & Destructor Documentation

◆ decPoint() [1/4]

decPoint::decPoint ( )

Creates a new point initialized to ( 0,0 ).

◆ decPoint() [2/4]

decPoint::decPoint ( int  nx,
int  ny 
)

Creates a new point with the given values.

◆ decPoint() [3/4]

decPoint::decPoint ( const decPoint p)

Creates a new point with the values of another point.

◆ decPoint() [4/4]

decPoint::decPoint ( const decVector2 v)

Creates a new point from a vector. Fractional parts of all components are discarded.

Member Function Documentation

◆ Absolute()

decPoint decPoint::Absolute ( ) const

Retrieves absolute point.

◆ Clamped()

decPoint decPoint::Clamped ( const decPoint minValue,
const decPoint maxValue 
) const

Retrieves point with each component clamped to the provided range.

◆ Largest()

decPoint decPoint::Largest ( const decPoint p) const

Retrieve point with each component set to the largest value of this point and another point.

◆ Length()

float decPoint::Length ( ) const

Retrieves the length of the point.

◆ operator!=()

bool decPoint::operator!= ( const decPoint p) const

Determines if this point is component wise not equal to another point.

◆ operator*() [1/2]

decPoint decPoint::operator* ( int  k) const

Retrieves a new point with this point scaled by k.

◆ operator*() [2/2]

int decPoint::operator* ( const decPoint p) const

Calculates the dot product of this point with another one.

◆ operator*=()

decPoint& decPoint::operator*= ( int  k)

Multiplies the components of this point with a value k.

◆ operator+()

decPoint decPoint::operator+ ( const decPoint p) const

Retrieves a new point with the sum of this point with another one.

◆ operator+=()

decPoint& decPoint::operator+= ( const decPoint p)

Adds the components of another point to this one.

◆ operator-() [1/2]

decPoint decPoint::operator- ( ) const

Retrieves the negation of this point.

◆ operator-() [2/2]

decPoint decPoint::operator- ( const decPoint p) const

Retrieves a new point with the difference of this point to another one.

◆ operator-=()

decPoint& decPoint::operator-= ( const decPoint p)

Subtracts the components of another point from this point.

◆ operator/()

decPoint decPoint::operator/ ( int  k) const

Retrieves a new point with this point divided by k. If k is 0 an exception is thrown.

◆ operator/=()

decPoint& decPoint::operator/= ( int  k)

Divides the components of this point by a value k. If the value k is 0 an exception is thrown.

◆ operator<()

bool decPoint::operator< ( const decPoint p) const

Determines if all the components of this point are less then the components of another one.

◆ operator<=()

bool decPoint::operator<= ( const decPoint p) const

Determines if all the components of this point are less then or equal to the components of another one.

◆ operator=()

decPoint& decPoint::operator= ( const decPoint p)

Sets the components of this point to the values of another one.

◆ operator==()

bool decPoint::operator== ( const decPoint p) const

Determines if this point is component wise equal to another point.

◆ operator>()

bool decPoint::operator> ( const decPoint p) const

Determines if all the components of this point are greater then the components of another one.

◆ operator>=()

bool decPoint::operator>= ( const decPoint p) const

Determines if all the components of this point are greater then or equal to the components of another one.

◆ Set()

void decPoint::Set ( int  nx,
int  ny 
)

Sets the components to the given values.

◆ SetClamped()

void decPoint::SetClamped ( const decPoint minValue,
const decPoint maxValue 
)

Clamp each component to the provided range.

◆ SetLargest()

void decPoint::SetLargest ( const decPoint p)

Set each component to the largest value of this point and another point.

◆ SetSmallest()

void decPoint::SetSmallest ( const decPoint p)

Set each component to the smallest value of this point and another point.

◆ SetZero()

void decPoint::SetZero ( )

Sets all components to 0.

◆ Smallest()

decPoint decPoint::Smallest ( const decPoint p) const

Retrieve point with each component set to the smallest value of this point and another point.

Member Data Documentation

◆ x

int decPoint::x

X Component of point.

Referenced by decBoundary::MapPoint().

◆ y

int decPoint::y

Y Component of point.

Referenced by decBoundary::MapPoint().


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