class Point2D

This class is designed to handle a point in 2D

Inheritance:


Public Fields

[more]double x
x coordinate
[more]double y
y coordinate

Public Methods

[more] Lots of Constructors
[more]virtual ~Point2D()
destructor
[more] reset functions
[more]virtual void saveXFile(XFile* file)
save the 2D point into an XFile
[more]virtual void loadXFile(XFile* file)
load a 2D point from an XFile
[more]virtual const char* sprint()
return the point into a string
[more]virtual void draw(Image* image, Color color)
draw the point onto an image
[more]int operator==(Point2D)
equality
[more]int operator!=(Point2D)
difference
[more] Point2D and Vector2D operations
[more] collinearity conditions
[more]double isLeft(Point2D, Point2D)
tests if the point is Left|On|Right of an infinite line
[more]double Area(Point2D, Point2D)
computes the surface of the triangle
[more]sPoint2D get()
return the 2D point
[more]void fixI()
fix xy coordinates to integer values


Inherited from geomObject:

Public Fields

obool verbose

Public Methods

ovirtual void xdraw(Display* pDisplay_, Pixmap pixmap_, GC gc_, unsigned long color_, int line_width_ = 1, int line_style_ = LineSolid, bool fill_ = false, int fill_style_ = FillSolid)


Documentation

This class is designed to handle a point in 2D

odouble x
x coordinate

odouble y
y coordinate

o Lots of Constructors

o Point2D()

o Point2D(int a)

o Point2D(double a)

o Point2D(int a, int b)

o Point2D(double a, double b)

o Point2D(sPoint2D p)

o Point2D(sPoint2D* p)

ovirtual ~Point2D()
destructor

o reset functions

ovoid reset(int a, int b)

ovoid reset(double a, double b)

ovoid reset(sPoint2D p)

ovirtual void saveXFile(XFile* file)
save the 2D point into an XFile

ovirtual void loadXFile(XFile* file)
load a 2D point from an XFile

ovirtual const char* sprint()
return the point into a string

ovirtual void draw(Image* image, Color color)
draw the point onto an image

oint operator==(Point2D)
equality

oint operator!=(Point2D)
difference

o Point2D and Vector2D operations
These operations are not always valid.

oVector2D operator-(Point2D)
Vector difference

oPoint2D operator+(Vector2D)
Vector translate +

oPoint2D operator-(Vector2D)
Vector translate -

oPoint2D& operator+=(Vector2D)
Vector inc translate

oPoint2D& operator-=(Vector2D)
Vector dec translate

o collinearity conditions

obool isOnLine(Point2D, Point2D, char)
is On line (char= flag)

obool isOnLine(Point2D, Point2D)
is On line (flag= all)

obool isBefore(Point2D, Point2D)
is On line (flag= before)

obool isBetween(Point2D, Point2D)
is On line (flag= between)

obool isAfter(Point2D, Point2D)
is On line (flag= after)

obool isOnRay(Point2D, Point2D)
is On line (flag= between|after)

odouble isLeft(Point2D, Point2D)
tests if the point is Left|On|Right of an infinite line

odouble Area(Point2D, Point2D)
computes the surface of the triangle

osPoint2D get()
return the 2D point

ovoid fixI()
fix xy coordinates to integer values


Direct child classes:
Vector2D
Point3D
Author:
Sebastien Marcel (marcel@idiap.ch) Dan Sunday (http://www.softsurfer.com/)
Version:
2.0 Wed 28 Jun 2006 05:19:31 PM CEST
Since:
1.0

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.