DrawKit
Vector and illustration framework for Mac OS X
Public Member Functions | Static Public Member Functions | Friends | List of all members
Geom::Point Class Reference

Cartesian point. More...

Public Member Functions

 Point ()
 
 Point (Coord x, Coord y)
 
 Point (Point const &p)
 
Point ccw () const
 Return a point like this point but rotated -90 degrees. More...
 
Point cw () const
 Return a point like this point but rotated +90 degrees. More...
 
void normalize ()
 
Pointoperator*= (double const s)
 
Pointoperator*= (Matrix const &m)
 
Pointoperator+= (Point const &o)
 
Pointoperator-= (Point const &o)
 
Pointoperator/= (double const s)
 
Pointoperator= (Point const &p)
 
int operator== (const Point &in_pnt)
 
Coord operator[] (unsigned i) const
 
Coordoperator[] (unsigned i)
 
Coord operator[] (Dim2 d) const throw ()
 
Coordoperator[] (Dim2 d) throw ()
 
void round (int places=0)
 A function to lower the precision of the point. More...
 

Static Public Member Functions

static Point polar (Coord angle, Coord radius)
 

Friends

std::ostream & operator<< (std::ostream &out_file, const Geom::Point &in_pnt)
 A function to print out the Point. More...
 

Detailed Description

Cartesian point.

Constructor & Destructor Documentation

Geom::Point::Point ( )
Geom::Point::Point ( Coord  x,
Coord  y 
)
Geom::Point::Point ( Point const &  p)

Member Function Documentation

Point Geom::Point::ccw ( ) const

Return a point like this point but rotated -90 degrees.

(If the y axis grows downwards and the x axis grows to the right, then this is 90 degrees counter-clockwise.)

Point Geom::Point::cw ( ) const

Return a point like this point but rotated +90 degrees.

(If the y axis grows downwards and the x axis grows to the right, then this is 90 degrees clockwise.)

void Geom::Point::normalize ( )
Point& Geom::Point::operator*= ( double const  s)
Point& Geom::Point::operator*= ( Matrix const &  m)
Point& Geom::Point::operator+= ( Point const &  o)
Point& Geom::Point::operator-= ( Point const &  o)
Point& Geom::Point::operator/= ( double const  s)
Point& Geom::Point::operator= ( Point const &  p)
int Geom::Point::operator== ( const Point in_pnt)
Coord Geom::Point::operator[] ( unsigned  i) const
Coord& Geom::Point::operator[] ( unsigned  i)
Coord Geom::Point::operator[] ( Dim2  d) const
throw (
)
Coord& Geom::Point::operator[] ( Dim2  d)
throw (
)
static Point Geom::Point::polar ( Coord  angle,
Coord  radius 
)
static
void Geom::Point::round ( int  places = 0)

A function to lower the precision of the point.

Parameters
placesThe number of decimal places that should be in the final number.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out_file,
const Geom::Point in_pnt 
)
friend

A function to print out the Point.

It just prints out the coords on the given output stream