TraceBoundaryPoint Class Reference

Implements the TraceRegion class. More...

#include <tracergn.h>

Inheritance diagram for TraceBoundaryPoint:

SimpleCCObject List of all members.

Private Member Functions

void translate (const TraceBoundaryPoint &that)
 TraceBoundaryPoint (double x1, double y1)
 TraceBoundaryPoint ()
 TraceBoundaryPoint (const TraceBoundaryPoint &that)
TraceBoundaryPointoperator= (const TraceBoundaryPoint &that)
void operator= (const DocCoord &Other)
BOOL operator== (const TraceBoundaryPoint &input) const
BOOL operator!= (const TraceBoundaryPoint &input) const
void RotateDirection (const TraceBoundaryPoint &rotation)
 urmm.. rotation of trace boundary points to conform to a particular direction
void Init ()
 Declares a preference that allows you to clear memory in delete().
void Init (INT32 x1, INT32 y1)
double SquaredLength ()
double Length ()
double Dot (const TraceBoundaryPoint &Other)
TraceBoundaryPoint SetLength (double NewLen)
 Scales the TraceBoundaryPoint vector to by the specified length.
TraceBoundaryPoint operator- ()
 Unary Minus for a TraceBoundaryPoint (Vector).
TraceBoundaryPoint operator * (double Factor)
 TraceBoundaryPoint Multiply function. This will multiply the vector by a constant Factor. The result is returned.
TraceBoundaryPoint operator/ (double Factor)
 TraceBoundaryPoint Multiply function. This will divide the vector by a constant Factor. The result is returned.

Private Attributes

double x
double y

Friends

class TraceRegion
TraceBoundaryPoint operator+ (const TraceBoundaryPoint &Point1, const TraceBoundaryPoint &Point2)
 Adds two TraceBoundaryPoint vectors together. This function is a Friend of the TraceBoundaryPoint class.
TraceBoundaryPoint operator- (const TraceBoundaryPoint &Point1, const TraceBoundaryPoint &Point2)
 Subtracts the two TraceBoundaryPoint vectors. This function is a Friend of the TraceBoundaryPoint class.

Detailed Description

Implements the TraceRegion class.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/11/1994
This is an exceedingly simple class used to store the coordinates of boundary points on the trace

Definition at line 126 of file tracergn.h.


Constructor & Destructor Documentation

TraceBoundaryPoint::TraceBoundaryPoint double  x1,
double  y1
[inline, private]
 

Definition at line 132 of file tracergn.h.

00132 { x=x1; y=y1; };

TraceBoundaryPoint::TraceBoundaryPoint  )  [inline, private]
 

Definition at line 133 of file tracergn.h.

00133 {};

TraceBoundaryPoint::TraceBoundaryPoint const TraceBoundaryPoint that  )  [inline, private]
 

Definition at line 134 of file tracergn.h.

00134 {x=that.x; y=that.y;};


Member Function Documentation

double TraceBoundaryPoint::Dot const TraceBoundaryPoint Other  )  [inline, private]
 

Definition at line 147 of file tracergn.h.

00147 { return (Other.x*x + Other.y*y); }

void TraceBoundaryPoint::Init INT32  x1,
INT32  y1
[inline, private]
 

Definition at line 144 of file tracergn.h.

00144 { x=x1; y=y1; };

void TraceBoundaryPoint::Init void   )  [inline, private]
 

Declares a preference that allows you to clear memory in delete().

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/94
Returns:
TRUE if it worked OK, FALSE if not

Reimplemented from SimpleCCObject.

Definition at line 143 of file tracergn.h.

00143 {x=0; y=0;}

double TraceBoundaryPoint::Length  )  [inline, private]
 

Definition at line 146 of file tracergn.h.

00146 { return sqrt(x*x + y*y); }

TraceBoundaryPoint TraceBoundaryPoint::operator * double  Factor  )  [inline, private]
 

TraceBoundaryPoint Multiply function. This will multiply the vector by a constant Factor. The result is returned.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com> & Alex
Date:
02/03/94
Parameters:
Factor - the amount to scale the vector by [INPUTS]
Returns:
TraceBoundaryPoint - this vector multiplied by the Factor

Definition at line 207 of file tracergn.h.

00208 {
00209     TraceBoundaryPoint Result;
00210 
00211     // Scale the vector by the factor
00212     Result.x = (x*Factor);
00213     Result.y = (y*Factor);
00214 
00215     // and return it
00216     return Result;
00217 }

BOOL TraceBoundaryPoint::operator!= const TraceBoundaryPoint input  )  const [inline, private]
 

Definition at line 139 of file tracergn.h.

00139 { return ((input.x != x) || (input.y != y));};

TraceBoundaryPoint TraceBoundaryPoint::operator-  )  [inline, private]
 

Unary Minus for a TraceBoundaryPoint (Vector).

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com> & Alex
Date:
02/03/94
Returns:
A TraceBoundaryPoint that is the negative of this

Definition at line 180 of file tracergn.h.

00181 {
00182     TraceBoundaryPoint Result;
00183 
00184     // negate the vector
00185     Result.x = -x;
00186     Result.y = -y;
00187 
00188     // and return it
00189     return Result;
00190 }

TraceBoundaryPoint TraceBoundaryPoint::operator/ double  Factor  )  [inline, private]
 

TraceBoundaryPoint Multiply function. This will divide the vector by a constant Factor. The result is returned.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com> & Alex
Date:
02/03/94
Parameters:
Factor - the amount to scale the vector by [INPUTS]
Returns:
TraceBoundaryPoint - this vector divided by the Factor

Definition at line 233 of file tracergn.h.

00234 {
00235     TraceBoundaryPoint Result;
00236 
00237     // Scale the vector by the factor
00238     Result.x = (x/Factor);
00239     Result.y = (y/Factor);
00240 
00241     // and return it
00242     return Result;
00243 }

void TraceBoundaryPoint::operator= const DocCoord Other  )  [inline, private]
 

Definition at line 137 of file tracergn.h.

00137 { x=Other.x; y=Other.y; };

TraceBoundaryPoint& TraceBoundaryPoint::operator= const TraceBoundaryPoint that  )  [inline, private]
 

Definition at line 135 of file tracergn.h.

00135 {x=that.x; y=that.y; return *this;};

BOOL TraceBoundaryPoint::operator== const TraceBoundaryPoint input  )  const [inline, private]
 

Definition at line 138 of file tracergn.h.

00138 { return ((input.x == x) && (input.y == y)); };

void TraceBoundaryPoint::RotateDirection const TraceBoundaryPoint rotation  )  [private]
 

urmm.. rotation of trace boundary points to conform to a particular direction

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/11/94
Parameters:
rotation = amount to rotate by [INPUTS]
point is rotated [OUTPUTS]
Returns:
none

Errors: None Scope: Public

See also:
-
This rotates an trace boundary point which is assumed to have an eastern direction to that specified

Definition at line 444 of file tracergn.cpp.

00445 {
00446 
00447 
00448     TraceBoundaryPoint temp;
00449     temp = *this;
00450 //
00451 // Parallelogram is (r.x, r.y) & (-r.y, r.x)
00452 //
00453 // (  r.x -r.y ) ( t.x )
00454 // (  r.y  r.x ) ( t.y )
00455 
00456     x = (temp.x * ((INT32)(rotation.x)>>8)) - (temp.y * ((INT32)(rotation.y)>>8));
00457     y = (temp.x * ((INT32)(rotation.y)>>8)) + (temp.y * ((INT32)(rotation.x)>>8));
00458 }

TraceBoundaryPoint TraceBoundaryPoint::SetLength double  NewLen  )  [private]
 

Scales the TraceBoundaryPoint vector to by the specified length.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
02/03/94
Parameters:
NewLen - The length you want the vector to be [INPUTS]
Returns:
TraceBoundaryPoint - the new vector that points in the same direction as this vector, only of magnitude NewLen

Definition at line 473 of file tracergn.cpp.

00474 {
00475     TraceBoundaryPoint Result(x, y);
00476 
00477     double Len = Length();
00478     if (Len != 0.0)
00479     {
00480         Result.x *= (NewLen / Len);
00481         Result.y *= (NewLen / Len);
00482     }
00483 
00484     return Result;
00485 }

double TraceBoundaryPoint::SquaredLength  )  [inline, private]
 

Definition at line 145 of file tracergn.h.

00145 { return (x*x + y*y); }

void TraceBoundaryPoint::translate const TraceBoundaryPoint that  )  [inline, private]
 

Definition at line 300 of file tracergn.h.

00300 { x+=that.x; y+=that.y;}


Friends And Related Function Documentation

TraceBoundaryPoint operator+ const TraceBoundaryPoint Point1,
const TraceBoundaryPoint Point2
[friend]
 

Adds two TraceBoundaryPoint vectors together. This function is a Friend of the TraceBoundaryPoint class.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com> & Alex
Date:
02/03/94
Parameters:
Point1 - The first TraceBoundaryPoint Vector [INPUTS] Point2 - The Second TraceBoundaryPoint vector
Returns:
TraceBoundaryPoint - the TraceBoundaryPoint vector that is a combination of Point1 and Point2

Definition at line 260 of file tracergn.h.

00261 {
00262     TraceBoundaryPoint Result;
00263 
00264     // Add the two vector together
00265     Result.x = Point1.x + Point2.x;
00266     Result.y = Point1.y + Point2.y;
00267 
00268     // return the result
00269     return Result;
00270 }

TraceBoundaryPoint operator- const TraceBoundaryPoint Point1,
const TraceBoundaryPoint Point2
[friend]
 

Subtracts the two TraceBoundaryPoint vectors. This function is a Friend of the TraceBoundaryPoint class.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com> & Alex
Date:
02/03/94
Parameters:
Point1 - The first TraceBoundaryPoint Vector [INPUTS] Point2 - The Second TraceBoundaryPoint vector
Returns:
TraceBoundaryPoint - the TraceBoundaryPoint vector that is the first vector minus the second vector

Definition at line 288 of file tracergn.h.

00289 {
00290     TraceBoundaryPoint Result;
00291 
00292     // Subtract the two vector from each other
00293     Result.x = Point1.x - Point2.x;
00294     Result.y = Point1.y - Point2.y;
00295 
00296     // return the result
00297     return Result;
00298 }

friend class TraceRegion [friend]
 

Definition at line 128 of file tracergn.h.


Member Data Documentation

double TraceBoundaryPoint::x [private]
 

Definition at line 162 of file tracergn.h.

double TraceBoundaryPoint::y [private]
 

Definition at line 163 of file tracergn.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:02:01 2007 for Camelot by  doxygen 1.4.4