Public Attributes

decPoint Class Reference

2 Component Integer Point. More...

#include <decPoint.h>

List of all members.

Public Member Functions

Constructors and Destructors
 decPoint ()
 Creates a new point initialized to ( 0,0 ).
 decPoint (int nx, int ny)
 Creates a new point with the given values.
 decPoint (const decPoint &p)
 Creates a new point with the values of another point.
Management
float Length () const
 Retrieves the length of the point.
void SetZero ()
 Sets all components to 0.
void Set (int nx, int ny)
 Sets the components to the given values.
Operators
decPoint operator- () const
 Retrieves the negation of this point.
decPointoperator= (const decPoint &p)
 Sets the components of this point to the values of another one.
decPointoperator+= (const decPoint &p)
 Adds the components of another point to this one.
decPointoperator-= (const decPoint &p)
 Subtracts the components of another point from this point.
decPointoperator*= (float k)
 Multiplies the components of this point with a value k.
decPointoperator/= (float k)
 Divides the components of this point by a value k.
decPoint operator+ (const decPoint &p) const
 Retrieves a new point with the sum of this point with another one.
decPoint operator- (const decPoint &p) const
 Retrieves a new point with the difference of this point to another one.
decPoint operator* (float k) const
 Retrieves a new point with this point scaled by k.
int operator* (const decPoint &p) const
 Calculates the dot product of this point with another one.
decPoint operator/ (float k) const
 Retrieves a new point with this point divided by k.
bool operator== (const decPoint &p) const
 Determines if this point is component wise equal to another point.
bool operator!= (const decPoint &p) const
 Determines if this point is component wise not equal to another point.
bool operator< (const decPoint &p) const
 Determines if all the components of this point are less then the components of another one.
bool operator> (const decPoint &p) const
 Determines if all the components of this point are greater then the components of another one.
bool operator<= (const decPoint &p) const
 Determines if all the components of this point are less then or equal to the components of another one.
bool operator>= (const decPoint &p) const
 Determines if all the components of this point are greater then or equal to the components of another one.

Public Attributes

int x
 X Component of point.
int y
 Y Component of point.

Detailed Description

2 Component Integer Point.

Author:
Plüss Roland
Version:
1.0
Date:
2008

Constructor & Destructor Documentation

decPoint::decPoint (  ) [inline]

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

References x, and y.

Referenced by operator*(), operator+(), operator-(), and operator/().

decPoint::decPoint ( int  nx,
int  ny 
) [inline]

Creates a new point with the given values.

References x, and y.

decPoint::decPoint ( const decPoint p ) [inline]

Creates a new point with the values of another point.

References x, and y.


Member Function Documentation

float decPoint::Length (  ) const

Retrieves the length of the point.

bool decPoint::operator!= ( const decPoint p ) const [inline]

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

References x, and y.

decPoint decPoint::operator* ( float  k ) const [inline]

Retrieves a new point with this point scaled by k.

References decPoint(), x, and y.

int decPoint::operator* ( const decPoint p ) const [inline]

Calculates the dot product of this point with another one.

References x, and y.

decPoint& decPoint::operator*= ( float  k ) [inline]

Multiplies the components of this point with a value k.

References x, and y.

decPoint decPoint::operator+ ( const decPoint p ) const [inline]

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

References decPoint(), x, and y.

decPoint& decPoint::operator+= ( const decPoint p ) [inline]

Adds the components of another point to this one.

References x, and y.

decPoint decPoint::operator- (  ) const [inline]

Retrieves the negation of this point.

References decPoint(), x, and y.

decPoint decPoint::operator- ( const decPoint p ) const [inline]

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

References decPoint(), x, and y.

decPoint& decPoint::operator-= ( const decPoint p ) [inline]

Subtracts the components of another point from this point.

References x, and y.

decPoint decPoint::operator/ ( float  k ) const [inline]

Retrieves a new point with this point divided by k.

If k is 0 an exception is thrown.

References decPoint(), THROW, x, and y.

decPoint& decPoint::operator/= ( float  k ) [inline]

Divides the components of this point by a value k.

If the value k is 0 an exception is thrown.

References THROW, x, and y.

bool decPoint::operator< ( const decPoint p ) const [inline]

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

References x, and y.

bool decPoint::operator<= ( const decPoint p ) const [inline]

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

References x, and y.

decPoint& decPoint::operator= ( const decPoint p ) [inline]

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

References x, and y.

bool decPoint::operator== ( const decPoint p ) const [inline]

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

References x, and y.

bool decPoint::operator> ( const decPoint p ) const [inline]

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

References x, and y.

bool decPoint::operator>= ( const decPoint p ) const [inline]

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

References x, and y.

void decPoint::Set ( int  nx,
int  ny 
) [inline]

Sets the components to the given values.

References x, and y.

void decPoint::SetZero (  ) [inline]

Sets all components to 0.

References x, and y.


Member Data Documentation


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