FitPoint Class Reference

This class is really a vector class that is used by the curve fitting functions. It is also used as a coordinate class in the curve fitting functions, but these are really regarded as vectors from the origin. It has the following public member variables :- MonoOn double x; - The X coord of the vector MonoOff MonoOn double y; - The Y Coord of the vecotr MonoOff. More...

#include <fitcurve.h>

List of all members.

Public Member Functions

 FitPoint ()
 FitPoint (double cx, double cy)
 FitPoint (DocCoord coord)
 FitPoint (const FitPoint &Other)
 ~FitPoint ()
void operator= (const FitPoint &Other)
void operator= (const DocCoord &Other)
FitPoint SetLength (double NewLen)
 Scales the FitPoint vector to by the specified length.
FitPoint operator- ()
 Unary Minus for a FitPoint (Vector).
FitPoint operator * (double Factor)
 FitPoint Multiply function. This will multiply the vector by a constant Factor. The result is returned.
double SquaredLength ()
double Length ()
double Dot (const FitPoint &Other)
void Dump ()
 Dumps the values of the FitPoint class to the TRACE output.

Public Attributes

double x
double y

Private Member Functions

 CC_DECLARE_MEMDUMP (FitPoint)

Friends

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


Detailed Description

This class is really a vector class that is used by the curve fitting functions. It is also used as a coordinate class in the curve fitting functions, but these are really regarded as vectors from the origin. It has the following public member variables :- MonoOn double x; - The X coord of the vector MonoOff MonoOn double y; - The Y Coord of the vecotr MonoOff.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
02/03/94

Definition at line 121 of file fitcurve.h.


Constructor & Destructor Documentation

FitPoint::FitPoint  )  [inline]
 

Definition at line 128 of file fitcurve.h.

00128 {}

FitPoint::FitPoint double  cx,
double  cy
[inline]
 

Definition at line 129 of file fitcurve.h.

00129 { x=cx; y=cy;}

FitPoint::FitPoint DocCoord  coord  )  [inline]
 

Definition at line 130 of file fitcurve.h.

00130 { x=coord.x; y=coord.y; }

FitPoint::FitPoint const FitPoint Other  )  [inline]
 

Definition at line 131 of file fitcurve.h.

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

FitPoint::~FitPoint  )  [inline]
 

Definition at line 134 of file fitcurve.h.

00134 {}


Member Function Documentation

FitPoint::CC_DECLARE_MEMDUMP FitPoint   )  [private]
 

double FitPoint::Dot const FitPoint Other  )  [inline]
 

Definition at line 156 of file fitcurve.h.

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

void FitPoint::Dump  ) 
 

Dumps the values of the FitPoint class to the TRACE output.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
02/03/94

Definition at line 274 of file fitcurve.cpp.

00275 {
00276     TRACEALL( _T("FitPoint Object (%7.2f, %7.2f)\n"), x, y );
00277 }

double FitPoint::Length  )  [inline]
 

Definition at line 155 of file fitcurve.h.

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

FitPoint FitPoint::operator * double  Factor  ) 
 

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

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

Definition at line 166 of file fitcurve.cpp.

00167 {
00168     FitPoint Result;
00169 
00170     // Scale the vector by the factor
00171     Result.x = x*Factor;
00172     Result.y = y*Factor;
00173 
00174     // and return it
00175     return Result;
00176 }

FitPoint FitPoint::operator-  ) 
 

Unary Minus for a FitPoint (Vector).

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

Definition at line 139 of file fitcurve.cpp.

00140 {
00141     FitPoint Result;
00142 
00143     // negate the vector
00144     Result.x = -x;
00145     Result.y = -y;
00146 
00147     // and return it
00148     return Result;
00149 }

void FitPoint::operator= const DocCoord Other  )  [inline]
 

Definition at line 138 of file fitcurve.h.

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

void FitPoint::operator= const FitPoint Other  )  [inline]
 

Definition at line 137 of file fitcurve.h.

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

FitPoint FitPoint::SetLength double  NewLen  ) 
 

Scales the FitPoint 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:
FitPoint - the new vector that points in the same direction as this vector, only of magnitude NewLen

Definition at line 192 of file fitcurve.cpp.

00193 {
00194     FitPoint Result(x, y);
00195 
00196     double Len = Length();
00197     if (Len != 0.0)
00198     {
00199         Len = NewLen/Len ;
00200         Result.x *= Len;
00201         Result.y *= Len;
00202     }
00203 
00204     return Result;
00205 }

double FitPoint::SquaredLength  )  [inline]
 

Definition at line 154 of file fitcurve.h.

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


Friends And Related Function Documentation

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

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

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

Definition at line 222 of file fitcurve.cpp.

00223 {
00224     FitPoint Result;
00225 
00226     // Add the two vector together
00227     Result.x = Point1.x + Point2.x;
00228     Result.y = Point1.y + Point2.y;
00229 
00230     // return the result
00231     return Result;
00232 }

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

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

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

Definition at line 250 of file fitcurve.cpp.

00251 {
00252     FitPoint Result;
00253 
00254     // Subtract the two vector from each other
00255     Result.x = Point1.x - Point2.x;
00256     Result.y = Point1.y - Point2.y;
00257 
00258     // return the result
00259     return Result;
00260 }


Member Data Documentation

double FitPoint::x
 

Definition at line 162 of file fitcurve.h.

double FitPoint::y
 

Definition at line 163 of file fitcurve.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:54:19 2007 for Camelot by  doxygen 1.4.4