TimeStampBrushPoint Class Reference

to store information about brush objects generated by the timestamping method More...

#include <brpress.h>

Inheritance diagram for TimeStampBrushPoint:

BrushPointInfo CPathPointInfo List of all members.

Public Member Functions

 TimeStampBrushPoint ()
 Default Constuctor for TimeStampBrushPoint.
 TimeStampBrushPoint (CPathPointInfo PointInfo)
 Constuctor for TimeStampBrushPoint.
 TimeStampBrushPoint (DocCoord Point, double Tangent, MILLIPOINT Distance)
 Constuctor for TimeStampBrushPoint.
 TimeStampBrushPoint (CPathPointInfo PointInfo, MILLIPOINT Distance)
 Constuctor for TimeStampBrushPoint.
void WorkOutProportion (MILLIPOINT PathLength)
 calculates how far along the path we are and sets the member variable
BOOL WriteNative (CXaraFileRecord *pRecord)
 Writes out a record of this TSBP to the record supplied. Note that because TSBPs are generally part of a larger object they do not have their own tag etc. This function is merely a convenience function.
TimeStampBrushPoint operator= (TimeStampBrushPoint OtherPoint)
 assignment operator

Static Public Member Functions

static INT32 ComparePointInfo (const void *Point1, const void *Point2)
 Compares the two points by their distances, note that they are specified as void* so that I can supply this fn.to qsort.

Public Attributes

MILLIPOINT m_Distance
double m_Proportion

Detailed Description

to store information about brush objects generated by the timestamping method

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/1/97
Notes: This class inherits coordinate and tangent data from CPathPointInfo This is a pretty fast and loose implementation but so it the parent and i didn't write that.

Definition at line 208 of file brpress.h.


Constructor & Destructor Documentation

TimeStampBrushPoint::TimeStampBrushPoint  ) 
 

Default Constuctor for TimeStampBrushPoint.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Parameters:
- [INPUTS]

Definition at line 306 of file brpress.cpp.

00306                                          : BrushPointInfo()
00307 {
00308     m_Distance = -1;
00309     m_Proportion = -1;
00310 }

TimeStampBrushPoint::TimeStampBrushPoint CPathPointInfo  PathInfo  ) 
 

Constuctor for TimeStampBrushPoint.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Parameters:
- [INPUTS]

Definition at line 325 of file brpress.cpp.

00326 {
00327     m_Point = PathInfo.m_Point;
00328     m_Tangent = PathInfo.m_Tangent;
00329     m_Distance = -1;
00330     m_Proportion = -1;
00331 }

TimeStampBrushPoint::TimeStampBrushPoint DocCoord  Point,
double  Tangent,
MILLIPOINT  Distance
 

Constuctor for TimeStampBrushPoint.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Parameters:
- [INPUTS]

Definition at line 366 of file brpress.cpp.

00367 {
00368     m_Point = Point;
00369     m_Tangent = Tangent;
00370     m_Distance = Distance;
00371 }

TimeStampBrushPoint::TimeStampBrushPoint CPathPointInfo  PathInfo,
MILLIPOINT  Distance
 

Constuctor for TimeStampBrushPoint.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Parameters:
- [INPUTS]

Definition at line 345 of file brpress.cpp.

00346 {
00347     m_Point = PathInfo.m_Point;
00348     m_Tangent = PathInfo.m_Tangent;
00349     m_Distance = Distance;
00350     m_Proportion = -1;
00351 }


Member Function Documentation

INT32 TimeStampBrushPoint::ComparePointInfo const void *  Point1,
const void *  Point2
[static]
 

Compares the two points by their distances, note that they are specified as void* so that I can supply this fn.to qsort.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
Point1,Point2- the distances to be compared [INPUTS]
Returns:
-1, if Dist1 < Dist2 0 , if Dist1 == Dist2 1, if Dist1 > Dist2
See also:
-

Definition at line 438 of file brpress.cpp.

00439 {
00440     TimeStampBrushPoint* pPoint1 = (TimeStampBrushPoint*)Point1;
00441     TimeStampBrushPoint* pPoint2 = (TimeStampBrushPoint*)Point2;
00442     
00443     if (pPoint1->m_Distance < pPoint2->m_Distance)
00444         return -1;
00445     if (pPoint1->m_Distance > pPoint2->m_Distance)
00446         return 1;
00447 
00448     return 0;
00449 }

TimeStampBrushPoint TimeStampBrushPoint::operator= TimeStampBrushPoint  Other  ) 
 

assignment operator

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Parameters:
Other - the TSBP to assign [INPUTS]

Definition at line 384 of file brpress.cpp.

00385 {
00386     m_Point = Other.m_Point;
00387     m_Tangent = Other.m_Tangent;
00388     m_Distance = Other.m_Distance;
00389     m_Proportion = Other.m_Proportion;
00390 
00391     return *this;
00392 }

void TimeStampBrushPoint::WorkOutProportion MILLIPOINT  PathLength  ) 
 

calculates how far along the path we are and sets the member variable

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Parameters:
length of the path that this object is on [INPUTS]

Definition at line 406 of file brpress.cpp.

00407 {
00408     if (m_Distance < 0 || m_Distance > PathLength)
00409     {
00410     //  ERROR3("Attempting to calculate proportional distance with invalid data");
00411         TRACEUSER( "Diccon", _T("Invalid distance: %d, Path Length: %d\n"), m_Distance, PathLength );
00412         m_Proportion = 1.0;
00413         return;
00414     }
00415     m_Proportion = (double)((double)m_Distance / (double)PathLength);
00416     //if (m_Proportion < 0)
00417 //  TRACEUSER( "Diccon", _T("Proportion: %f\n"), m_Proportion);
00418 
00419 }

BOOL TimeStampBrushPoint::WriteNative CXaraFileRecord pRecord  ) 
 

Writes out a record of this TSBP to the record supplied. Note that because TSBPs are generally part of a larger object they do not have their own tag etc. This function is merely a convenience function.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Parameters:
pFilter - filter to write to [INPUTS]
Returns:
TRUE if the Node has written out a record to the filter
See also:
AttrBrushType::WritePreChildrenNative; BrushAttrRecordHandler::HandleRecord

Definition at line 469 of file brpress.cpp.

00470 {
00471     ERROR2IF(pRecord == NULL, FALSE, "Record is NULL in TimeStampBrushPoint::WriteNative");
00472     
00473     BOOL ok    = pRecord->WriteCoord(m_Point);
00474     TRACEUSER( "Diccon", _T("Wrote Point %d, %d\n"), m_Point.x, m_Point.y );
00475     if (ok) ok = pRecord->WriteDOUBLE(m_Tangent);
00476     if (ok) ok = pRecord->WriteDOUBLE(m_Proportion);
00477     if (ok) ok = pRecord->WriteINT32(m_Distance);
00478 
00479     return ok;
00480 }


Member Data Documentation

MILLIPOINT TimeStampBrushPoint::m_Distance
 

Definition at line 223 of file brpress.h.

double TimeStampBrushPoint::m_Proportion
 

Definition at line 224 of file brpress.h.


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