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_)


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 Point2D scalar multiplication and divisions
	    Point2D Scalar Operations (convenient but often illegal)
	    using any type of scalar (int, float, or double)
	    are not valid for points in general,
	    unless they are 'affine' as coeffs of 
	    a sum in which all the coeffs add to 1,
	    such as: the sum (a*P + b*Q) with (a+b == 1).
	    
	    The programmer must enforce this (if they want to).
	    
Friends:
Point2D operator*(int, Point2D)
Point2D operator*(double, Point2D)
Point2D operator*(Point2D, int)
Point2D operator*(Point2D, double)
Point2D operator/(Point2D, int)
Point2D operator/(Point2D, double)

o Point2D addition
Point2D addition (also convenient but often illegal) is not valid unless part of an affine sum.

The programmer must enforce this (if they want to).

Friends:
Point2D operator+(Point2D, Point2D)

o Point2D rotation/scale
Friends:
Point2D operator*(Point2D, Matrix2D)

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
Friends:
class Vector2D
class Matrix2D
Author:
Sebastien Marcel (marcel@idiap.ch) Dan Sunday (http://www.softsurfer.com/)
Version:
2.0 Fri 15 Jul 2005 11:35:19 AM CEST
Since:
1.0

Alphabetic index HTML hierarchy of classes or Java



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