Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

OLine Class Reference

#include <OLine.hpp>

Inheritance diagram for OLine::

OGraphic List of all members.

Public Methods

OGraphicclone () const
OGraphiccreate () const
 OLine ()
 OLine (OPoint &, OPoint &)
 OLine (int, int, int, int)
 ~OLine ()
int getDX ()
int getDY ()
double getLength ()
double matchLength (OLine &)
bool isOpposite (OLine &)
void move (int, int, int=1)
void movec ()
void reverse ()
OLine getReverse ()
OPoint getMiddle ()
bool isConnected (OLine &)
bool isNear (OLine &)
double getTangent ()
int getOrigin ()
double getDirection ()
double getDAngle (OLine &)
double getAngle (OLine &)
double getNAzimuth ()
double getSAzimuth ()
double getEAzimuth ()
double getWAzimuth ()
bool isParallel (OLine &)
double matchTeta (OLine &)
bool isOrthogonal (OLine &)
bool isColinear (OPoint &)
bool between (OPoint &)
bool belong (OPoint &)
OPoint getIntersection (OLine &)
bool intersect (OLine &)
bool overlap (OLine &)
double euclid (OPoint &)
double euclid (OLine &)
bool operator== (OLine &)
bool operator!= (OLine &)
OLine operator/ (int)
OLine operator * (int)
void gomo (ostream &)
void gomi (istream &)
void svgo (ostream &)
void xmlo (ostream &)
bool isValid ()
void clear ()
void set (OPoint &, OPoint &)
void set (int, int, int, int)
void setBegin (OPoint &)
void setBegin (int, int)
void setEnd (OPoint &)
void setEnd (int, int)
OPoint getBegin ()
OPoint getEnd ()

Protected Attributes

OPoint b
OPoint e

Detailed Description

OLine object
Examples:

PExample.cpp.


Constructor & Destructor Documentation

OLine::OLine  
 

Constructor

OLine::OLine OPoint   b,
OPoint   e
 

Constructor

OLine::OLine int    x1,
int    y1,
int    x2,
int    y2
 

Constructor

OLine::~OLine  
 

Destructor


Member Function Documentation

bool OLine::belong OPoint   p
 

Test with OLine::isColinear() and OLine::between() in these case the point belongs to line object

belong.bmp

bool OLine::between OPoint   p
 

The point is between line's begin and line's end dx1 dx2 are opposite or dy1 dy2 must be opposite This method isn't bijective

between.bmp

void OLine::clear   [inline]
 

Clear the begin;end point

OGraphic * OLine::clone   const [inline, virtual]
 

Clone the line object

Reimplemented from OGraphic.

OGraphic * OLine::create   const [inline, virtual]
 

Create a new line object

Reimplemented from OGraphic.

double OLine::euclid OLine &    l
 

Get Euclidien distance between two line objects, this distance is computed between middle points

double OLine::euclid OPoint   p
 

Get Euclidien distance between the line object and a given point

euclid.bmp

double OLine::getAngle OLine &    l
 

Get angle between the line and a end connected line. This angle is inclued between 0 and 2*pi. example: OLine l1(10,10,20,10); OLine l2(20,10,20,20); OLine l3(20,10,20,0); cout << l1.getAngle(l2); -> pi/2 cout << l1.getAngle(l3); -> 3*pi/2

getAngle.bmp

OPoint OLine::getBegin   [inline]
 

Get the begin point

double OLine::getDAngle OLine &    l2
 

Get direct angle between the line and a end connected line. This direct angle is always lower than pi. example: OLine l1(10,10,20,10); OLine l2(20,10,20,20); OLine l3(20,10,20,0); cout << l1.getDAngle(l2); -> pi/2 cout << l1.getDAngle(l3); -> pi/2

getDAngle.bmp

double OLine::getDirection  
 

Get line's direction in radian, the arctangent of (y2-y1)/(x2-x1)

int OLine::getDX  
 

Get the end(x)-begin(x) delta x

int OLine::getDY  
 

Get the end(y)-begin(y) delta y

double OLine::getEAzimuth  
 

Get East azimuth

OPoint OLine::getEnd   [inline]
 

Get the end point

OPoint OLine::getIntersection OLine &    l
 

Get colinear intersection between two line objects

double OLine::getLength  
 

Get length of line

OPoint OLine::getMiddle  
 

Return the line's middle

double OLine::getNAzimuth  
 

Get North azimuth

azimuth.gif

int OLine::getOrigin  
 

Get origin

OLine OLine::getReverse  
 

Reverse and return a new line (end to begin and begin to end)

double OLine::getSAzimuth  
 

Get South azimuth

double OLine::getTangent  
 

Get tangent of line (y2-y1)/(x2-x1)

double OLine::getWAzimuth  
 

Get Weast azimuth

void OLine::gomi istream &    is [virtual]
 

GOM input

Reimplemented from OGraphic.

void OLine::gomo ostream &    os [virtual]
 

GOM output

Reimplemented from OGraphic.

bool OLine::intersect OLine &    l
 

The lines intersect themself

bool OLine::isColinear OPoint   p
 

Is on test if a point corresponds to line equation y=m*x + p

isColinear.bmp

bool OLine::isConnected OLine &    l
 

Test if lines are connected, they are a same point (begin or end)

bool OLine::isNear OLine &    l
 

Test if lines are near, they are a nearest point (begin or end)

bool OLine::isOpposite OLine &    l
 

The lines are opposite, the line1's begin is near of line2's end and the line1's end is near of line2's begin

bool OLine::isOrthogonal OLine &    l
 

The lines are orthogonal

bool OLine::isParallel OLine &    l
 

The lines are parallel

bool OLine::isValid   [inline]
 

Is valid begin and enb no null

double OLine::matchLength OLine &    l
 

Match length (0 to inf): (lmax - lmin)/lmin if equals return '0', else a distance bijective: l1.matchLength(l2) == l2.matchLength(l1)

double OLine::matchTeta OLine &    l
 

Match Teta (0 to pi/2), Teta is the parallelism gap between two lines: if parallel return '0', else a distance unil '1': Teta/(pi/2) bijective: l1.matchTeta(l2) == l2.matchTeta(l1)

matchTeta.bmp

void OLine::move int    dx,
int    dy,
int    mode = 1
 

Move the line with dx,dy mode 1 move begin and end, 2 begin, 3 end

void OLine::movec  
 

Move the line to center (begin to 0,0)

OLine OLine::operator * int    v
 

* operator

bool OLine::operator!= OLine &    l
 

!= operator

OLine OLine::operator/ int    v
 

/ operator

bool OLine::operator== OLine &    l
 

== operator

bool OLine::overlap OLine &    l
 

The lines overlap

overlap.bmp

void OLine::reverse  
 

Reverse the line (end to begin and begin to end)

void OLine::set int    x1,
int    y1,
int    x2,
int    y2
[inline]
 

Set the x1;y1;x2;y2 begin;end point

void OLine::set OPoint   b,
OPoint   e
[inline]
 

Set the begin;end point

void OLine::setBegin int    x,
int    y
[inline]
 

Set the x;y begin point

void OLine::setBegin OPoint   b [inline]
 

Set the begin point

void OLine::setEnd int    x,
int    y
[inline]
 

Set the x;y end point

void OLine::setEnd OPoint   e [inline]
 

Set the end point

void OLine::svgo ostream &    os [virtual]
 

SVG output

Reimplemented from OGraphic.

void OLine::xmlo ostream &    os [virtual]
 

XML output

Reimplemented from OGraphic.


Member Data Documentation

OPoint OLine::b [protected]
 

OPoint OLine::e [protected]
 


The documentation for this class was generated from the following files:
Generated on Fri Jul 30 19:21:02 2004 for GOMLib by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001