Point Class Reference
[Abstract Data Types]

Point Representation. More...

#include <fpoint.h>

Public Member Functions

 Point (UCoord h=0, UCoord v=0)
 Construct a Point from (h, v).
bool inside (const Rect &rect) const
 Checks if point is inside rect.
double distance (const Point &other) const
 Distance from the other to this point.
double angle (const Point &other) const
 Angle from other to this Point.
double length () const
 Calculate length (absolute value) of vector.
Point projection (const Point &other) const
 Orthogonal vector projection of "this" on "other".
bool isLocated (Direction dir, const Point &from)
Querying and Setting Values.



UCoord getH () const
 Return the X value of this Point.
UCoord getV () const
 Return the Y value of this Point.
void setH (UCoord h)
 Set the X value of this Point.
void setV (UCoord v)
 Set the Y value of this Point.
void offset (UCoord h, UCoord v=0)
 Offset this Point by (x, y).
void offset (const Point &p)
 Offset this Point by Point p.
bool bound (const Rect &rect)
 Set this to the intersection of this and rect.
Operations on Point.



Pointoperator() (UCoord h, UCoord v)
 Reinitialize to given coordinates.
Point operator+ (const Point &p) const
 Return p + this Point as a Point.
Point operator- (const Point &p) const
 Return this Point minus p as a Point.
Point operator/ (int32 n) const
 Return this Point divided by n as a Point (scalar divide).
Point operator* (int32 n) const
 Return this Point times n as a Point (scalar multiply).
Pointoperator+= (const Point &p)
 Add p to this Point.
Pointoperator-= (const Point &p)
 Subtract p from this Point.
Pointoperator*= (int32 n)
 Scalar multiply n times this Point.
Pointoperator/= (int32 n)
 Scalar divide this Point by n.
int32 operator* (const Point &p) const
 Scalar multiply this point with p.
bool operator== (const Point &p) const
 Check if to Points are equal.
bool operator!= (const Point &p) const
 Not equal.
Pointoperator= (const Point &p)
 Assignment.
Point operator- () const
 Reinitialize to given coordinates.

Data Fields

UCoord h
UCoord v

Detailed Description

Point Representation.

See also:
Rect, UCoord

Constructor & Destructor Documentation

Point ( UCoord  h = 0,
UCoord  v = 0 
) [inline]

Construct a Point from (h, v).


Member Function Documentation

UCoord getH (  )  const [inline]

Return the X value of this Point.

UCoord getV (  )  const [inline]

Return the Y value of this Point.

void setH ( UCoord  h  )  [inline]

Set the X value of this Point.

void setV ( UCoord  v  )  [inline]

Set the Y value of this Point.

void offset ( UCoord  h,
UCoord  v = 0 
) [inline]

Offset this Point by (x, y).

void offset ( const Point p  )  [inline]

Offset this Point by Point p.

bool bound ( const Rect rect  ) 

Set this to the intersection of this and rect.

Point & operator() ( UCoord  h,
UCoord  v 
) [inline]

Reinitialize to given coordinates.

Point operator+ ( const Point p  )  const [inline]

Return p + this Point as a Point.

Point operator- ( const Point p  )  const [inline]

Return this Point minus p as a Point.

Point operator/ ( int32  n  )  const [inline]

Return this Point divided by n as a Point (scalar divide).

Point operator* ( int32  n  )  const [inline]

Return this Point times n as a Point (scalar multiply).

Point & operator+= ( const Point p  )  [inline]

Add p to this Point.

Point & operator-= ( const Point p  )  [inline]

Subtract p from this Point.

Point & operator*= ( int32  n  )  [inline]

Scalar multiply n times this Point.

Point & operator/= ( int32  n  )  [inline]

Scalar divide this Point by n.

int32 operator* ( const Point p  )  const [inline]

Scalar multiply this point with p.

bool operator== ( const Point p  )  const [inline]

Check if to Points are equal.

bool operator!= ( const Point p  )  const [inline]

Not equal.

Point & operator= ( const Point p  )  [inline]

Assignment.

Point operator- (  )  const [inline]

Reinitialize to given coordinates.

bool inside ( const Rect rect  )  const

Checks if point is inside rect.

double distance ( const Point other  )  const

Distance from the other to this point.

double angle ( const Point other  )  const

Angle from other to this Point.

double length (  )  const

Calculate length (absolute value) of vector.

Point projection ( const Point other  )  const

Orthogonal vector projection of "this" on "other".

bool isLocated ( Direction  dir,
const Point from 
)

Field Documentation

UCoord h
UCoord v
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Empty

Copyright ©2013 Steinberg Media Technologies GmbH. All Rights Reserved.