OpMakeSegmentsLines Class Reference

This class will change all the selected segments in all selected paths from curves into lines (ignoring segments that are already lines!). More...

#include <pathops.h>

Inheritance diagram for OpMakeSegmentsLines:

OpBaseConvertPathSegment SelOperation UndoableOperation Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 OpMakeSegmentsLines ()
 OpMakeSegmentsLines constructor - does nothing itself.

Static Public Member Functions

static BOOL Init ()
 OpMakeSegmentsLines initialiser method.
static OpState GetState (String_256 *, OpDescriptor *)

Protected Member Functions

virtual INT32 GetProcessPathType ()
virtual INT32 GetPathType ()
BOOL ProcessSegment (NodePath *pPath, INT32 *Index, INT32 PrevIndex)
 Performs the make selected segments into lines operation.

Detailed Description

This class will change all the selected segments in all selected paths from curves into lines (ignoring segments that are already lines!).

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/9/94
See also:
OpMakeSegmentsCurves

Definition at line 157 of file pathops.h.


Constructor & Destructor Documentation

OpMakeSegmentsLines::OpMakeSegmentsLines  ) 
 

OpMakeSegmentsLines constructor - does nothing itself.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/9/94

Definition at line 424 of file pathops.cpp.

00425 {                              
00426 }


Member Function Documentation

virtual INT32 OpMakeSegmentsLines::GetPathType  )  [inline, protected, virtual]
 

Reimplemented from OpBaseConvertPathSegment.

Definition at line 168 of file pathops.h.

00168 {return PT_LINETO;}

virtual INT32 OpMakeSegmentsLines::GetProcessPathType  )  [inline, protected, virtual]
 

Reimplemented from OpBaseConvertPathSegment.

Definition at line 167 of file pathops.h.

00167 {return PT_BEZIERTO;}

OpState OpMakeSegmentsLines::GetState String_256 ,
OpDescriptor
[static]
 

Definition at line 458 of file pathops.cpp.

00459 {
00460     return OpBaseConvertPathSegment::BaseGetState(PT_LINETO);
00461 }

BOOL OpMakeSegmentsLines::Init void   )  [static]
 

OpMakeSegmentsLines initialiser method.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/9/94
Returns:
TRUE if the operation could be successfully initialised FALSE if no more memory could be allocated

Errors: ERROR will be called if there was insufficient memory to allocate the operation.

See also:
-

Reimplemented from SimpleCCObject.

Definition at line 444 of file pathops.cpp.

00445 {
00446     return (RegisterOpDescriptor(   0, 
00447                                     _R(IDS_MAKELINES),
00448                                     CC_RUNTIME_CLASS(OpMakeSegmentsLines), 
00449                                     OPTOKEN_MAKELINESOP,
00450                                     OpMakeSegmentsLines::GetState,
00451                                     0,  /* help ID */
00452                                     _R(IDBBL_MAKELINES),
00453                                     0   /* bitmap ID */));
00454 }               

BOOL OpMakeSegmentsLines::ProcessSegment NodePath pPath,
INT32 *  Index,
INT32  PrevIndex
[protected, virtual]
 

Performs the make selected segments into lines operation.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/8/95
Parameters:
pPath - points to the path to process [INPUTS] Index - index of the PT_BEZIERTO segment to change into lines PrevIndex - index of the previois endpoint (other end of the segment to process)
Index is changed to point to the new index of the end of the segment [OUTPUTS]
Returns:
TRUE/FALSE for success/failure

Errors: -

See also:
OpBaseConvertPathSegment::Do

Reimplemented from OpBaseConvertPathSegment.

Definition at line 479 of file pathops.cpp.

00480 {
00481     // Get the path pointers
00482     PathVerb* Verbs;
00483     PathFlags* Flags;
00484     DocCoord* Coords;
00485     pPath->InkPath.GetPathArrays(&Verbs, &Coords, &Flags);
00486 
00487     // Quick check
00488     ERROR2IF(((Verbs[*Index] & ~PT_CLOSEFIGURE) != PT_BEZIERTO), FALSE, "Unknown segment encountered");
00489     ERROR2IF(((PrevIndex+3) != *Index), FALSE, "Not two points between segment start and end");
00490 
00491 //  BOOL ok = TRUE;
00492 
00493     DocCoord EndCoord = Coords[*Index];
00494     PathFlags EndFlags = Flags[*Index];
00495     PathVerb NewEndVerb = Verbs[*Index];
00496     NewEndVerb = (NewEndVerb == PT_BEZIERTO) ? PT_LINETO : PT_LINETO | PT_CLOSEFIGURE;
00497 
00498     BOOL DoneOK = TRUE;
00499 
00500     // Insert a line segment
00501     if (DoneOK)
00502         DoneOK = DoInsertPathElement(pPath, PrevIndex, EndCoord, EndFlags, NewEndVerb, FALSE);
00503 
00504     // Remove the curve segment
00505     if (DoneOK)
00506         DoneOK = DoDeletePathSection(pPath, PrevIndex+2, 3, FALSE);
00507 
00508     *Index = PrevIndex+1;
00509 
00510     return DoneOK;
00511 }


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