#include <pathproc.h>
Inheritance diagram for ProcessLength:
Public Member Functions | |
ProcessLength (const double flat) | |
Constructor for processlength. | |
BOOL | PathLength (Path *Input, double *Length, INT32 Index=-1) |
Returns an approximation to the length of a path, in 72000 of an inch units. | |
virtual void | OpenElement (PathVerb Verb, INT32 index) |
Called from ProcessPath which is about to open a new path element. | |
virtual BOOL | NewPoint (PathVerb Verb, DocCoord *pCoord) |
virtual BOOL | CloseElement (BOOL ok, PathVerb Verb, INT32 index) |
This function is called after processing all new points on a path element. The path element being a curve or line segment within the path passed to ProcessDistance::PathDistance(). | |
Private Attributes | |
DocCoord | PrevCoord |
double | ElementLength |
double | CurrLength |
INT32 | UserIndex |
Definition at line 211 of file pathproc.h.
|
Constructor for processlength.
Definition at line 653 of file pathproc.cpp. 00653 : ProcessPath(flat) 00654 { 00655 }
|
|
This function is called after processing all new points on a path element. The path element being a curve or line segment within the path passed to ProcessDistance::PathDistance(). BOOL ProcessLength::CloseElement(BOOL done, PathVerb Verb, INT32 index)
Reimplemented from ProcessPath. Definition at line 752 of file pathproc.cpp. 00753 { 00754 if (index>UserIndex) 00755 // terminate scan now 00756 return TRUE; 00757 00758 // continue summing element lengths 00759 CurrLength+=ElementLength; 00760 return FALSE; 00761 }
|
|
Implements ProcessPath. Definition at line 718 of file pathproc.cpp. 00719 { 00720 if (!ProcFirstPoint && Verb==PT_LINETO) 00721 { 00722 double p0 = PrevCoord.x - pCoord->x; 00723 double p1 = PrevCoord.y - pCoord->y; 00724 ElementLength += sqrt((p0*p0)+(p1*p1)); 00725 } 00726 PrevCoord = *pCoord; 00727 return TRUE; 00728 }
|
|
Called from ProcessPath which is about to open a new path element. void ProcessLength::OpenElement(PathVerb Verb, INT32 index)
Reimplemented from ProcessPath. Definition at line 702 of file pathproc.cpp. 00703 { 00704 ElementLength = 0; 00705 }
|
|
Returns an approximation to the length of a path, in 72000 of an inch units.
Definition at line 671 of file pathproc.cpp. 00672 { 00673 ERROR2IF(pSource==NULL, FALSE, "NULL path passed to ProcessLength::PathLength()"); 00674 if (index<0) 00675 index = (pSource->GetNumCoords())+1; 00676 00677 CurrLength = 0; 00678 ElementLength = 0; 00679 UserIndex = index; 00680 00681 ProcessFlags PFlags; 00682 BOOL ok = ProcessPath::Init(pSource); 00683 if (ok) ok = ProcessPath::Process(PFlags); 00684 if (ok) *Length = CurrLength; 00685 00686 return ok; 00687 }
|
|
Definition at line 223 of file pathproc.h. |
|
Definition at line 222 of file pathproc.h. |
|
Definition at line 221 of file pathproc.h. |
|
Definition at line 224 of file pathproc.h. |