- Your Widget Set For OpenGL
Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | Related Pages

ufo::UPoint Class Reference

An abstraction of a two dimensional point (x and y). More...

#include <upoint.hpp>

Inheritance diagram for ufo::UPoint:

ufo::UPointObject List of all members.

Public Member Functions

 UPoint (int x, int y)
int getX () const
void setX (int x)
int getY () const
void setY (int y)
void setLocation (const UPoint &p)
UPoint getLocation () const
void translate (const UPoint &p)
bool isInvalid () const
bool isNull () const
UPointoperator+= (const UPoint &p)
UPointoperator-= (const UPoint &p)
UPointoperator *= (int c)
UPointoperator *= (double c)
UPointoperator/= (int c)
UPointoperator/= (double c)

Public Attributes

int x
int y

Static Public Attributes

UPoint invalid

Friends

std::ostream & operator<< (std::ostream &os, const UPoint &o)

Detailed Description

An abstraction of a two dimensional point (x and y).

This class is not part of the UObject inheritance structure. Use instead UPointObject if you need a point derived from UObject.

Author:
Johannes Schmidt


Member Function Documentation

UPoint ufo::UPoint::getLocation  )  const [inline]
 

Returns a copy. For convenience

bool ufo::UPoint::isInvalid  )  const [inline]
 

Returns:
True if the width and height are equal to invalid
See also:
invalid

bool ufo::UPoint::isNull  )  const [inline]
 

Returns:
True if both, x and y are exactly 0.

UPoint & ufo::UPoint::operator *= double  c  )  [inline]
 

Multiplies c to both x and y coordinate of this point. Truncates the values to integers.

Returns:
Reference to this point.

UPoint & ufo::UPoint::operator *= int  c  )  [inline]
 

Multiplies c to both x and y coordinate of this point.

Returns:
Reference to this point.

UPoint & ufo::UPoint::operator+= const UPoint p  )  [inline]
 

Adds point p to this point

Returns:
Reference to this point.

UPoint & ufo::UPoint::operator-= const UPoint p  )  [inline]
 

Subtracts point p from this point

Returns:
Reference to this point.

UPoint & ufo::UPoint::operator/= double  c  )  [inline]
 

Divides both x and y by c. Truncates the values to integers.

Returns:
Reference to this point.

UPoint & ufo::UPoint::operator/= int  c  )  [inline]
 

Divides both x and y by c. Truncates the values to integers.

Returns:
Reference to this point.

void ufo::UPoint::setLocation const UPoint p  )  [inline]
 

for convenience

void ufo::UPoint::translate const UPoint p  )  [inline]
 

This method is for convenience. It adds p to this point.


The documentation for this class was generated from the following file:
The libUFO Project - written by Johannes Schmidt