OpFillNudge Class Reference

The underlying nudge op that does a nudge on the selected points in a path. More...

#include <fillndge.h>

Inheritance diagram for OpFillNudge:

Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

double GetXPixelDisplacement ()
double GetYPixelDisplacement ()
virtual void Do (OpDescriptor *pOpDesc)
 The path nudge op's Do() function.
void GetOpName (String_256 *OpName)
 The GetOpName fn is overridden so that we return back a description appropriate to the type of attribute that the operation applies.

Static Public Member Functions

static BOOL Init ()
 Declares a preference that allows you to clear memory in delete().
static OpState GetState (String_256 *, OpDescriptor *)
static double GetXNudgeDisplacement ()
static double GetYNudgeDisplacement ()
static void NudgeColours (BOOL)
 Sets whether a nudge will nudge colour or transparency fills.

Protected Attributes

UINT32 NudgeUndoIDS

Static Protected Attributes

static double X_NudgeFactor
static double Y_NudgeFactor = 0

Private Member Functions

 CC_DECLARE_DYNCREATE (OpFillNudge)

Private Attributes

BOOL IsPixelNudgeClass
double PixelNudge

Static Private Attributes

static MILLIPOINT NudgeStep
static BOOL NudgeCols

Detailed Description

The underlying nudge op that does a nudge on the selected points in a path.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/3/95
See also:
class OpNudge

Definition at line 119 of file fillndge.h.


Member Function Documentation

OpFillNudge::CC_DECLARE_DYNCREATE OpFillNudge   )  [private]
 

void OpFillNudge::Do OpDescriptor pOpDesc  )  [virtual]
 

The path nudge op's Do() function.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/3/95
Parameters:
pOpDesc = ptr to the op descriptor [INPUTS]
See also:
OpNudge::Do()

Reimplemented from Operation.

Definition at line 243 of file fillndge.cpp.

00244 {
00245 
00246     //  Get scaled pixel size 
00247     FIXED16 ScaledPixelWidth, ScaledPixelHeight;
00248     GetWorkingView()->GetScaledPixelSize(&ScaledPixelWidth, &ScaledPixelHeight) ;
00249     PixelNudge=ScaledPixelWidth.MakeDouble() ;
00250 
00251     // Determine the nudge factors based on the OpDescriptor used to invoke the nudge operation
00252     String OpToken = pOpDesc->Token; 
00253 
00254     if      (OpToken == String(OPTOKEN_NUDGEUPPIXEL1))      { IsPixelNudgeClass = TRUE; }
00255     else if (OpToken == String(OPTOKEN_NUDGEUPPIXEL10))     { IsPixelNudgeClass = TRUE; }
00256 
00257     else if (OpToken == String(OPTOKEN_NUDGEDOWNPIXEL1))    { IsPixelNudgeClass = TRUE; }
00258     else if (OpToken == String(OPTOKEN_NUDGEDOWNPIXEL10))   { IsPixelNudgeClass = TRUE; }
00259 
00260     else if (OpToken == String(OPTOKEN_NUDGELEFTPIXEL1))    { IsPixelNudgeClass = TRUE; }
00261     else if (OpToken == String(OPTOKEN_NUDGELEFTPIXEL10))   { IsPixelNudgeClass = TRUE; }
00262 
00263     else if (OpToken == String(OPTOKEN_NUDGERIGHTPIXEL1))   { IsPixelNudgeClass = TRUE; }
00264     else if (OpToken == String(OPTOKEN_NUDGERIGHTPIXEL10))  { IsPixelNudgeClass = TRUE; }
00265 
00266     else if (OpToken == String(OPTOKEN_NUDGEUP1))           { IsPixelNudgeClass = FALSE; }
00267     else if (OpToken == String(OPTOKEN_NUDGEUP5))           { IsPixelNudgeClass = FALSE; }
00268     else if (OpToken == String(OPTOKEN_NUDGEUP10))          { IsPixelNudgeClass = FALSE; }
00269     else if (OpToken == String(OPTOKEN_NUDGEUPFIFTH))       { IsPixelNudgeClass = FALSE; }
00270 
00271     else if (OpToken == String(OPTOKEN_NUDGEDOWN1))         { IsPixelNudgeClass = FALSE; }
00272     else if (OpToken == String(OPTOKEN_NUDGEDOWN5))         { IsPixelNudgeClass = FALSE; }
00273     else if (OpToken == String(OPTOKEN_NUDGEDOWN10))        { IsPixelNudgeClass = FALSE; }
00274     else if (OpToken == String(OPTOKEN_NUDGEDOWNFIFTH))     { IsPixelNudgeClass = FALSE; }
00275 
00276     else if (OpToken == String(OPTOKEN_NUDGELEFT1))         { IsPixelNudgeClass = FALSE; }
00277     else if (OpToken == String(OPTOKEN_NUDGELEFT5))         { IsPixelNudgeClass = FALSE; }
00278     else if (OpToken == String(OPTOKEN_NUDGELEFT10))        { IsPixelNudgeClass = FALSE; }
00279     else if (OpToken == String(OPTOKEN_NUDGELEFTFIFTH))     { IsPixelNudgeClass = FALSE; }
00280 
00281     else if (OpToken == String(OPTOKEN_NUDGERIGHT1))        { IsPixelNudgeClass = FALSE; }
00282     else if (OpToken == String(OPTOKEN_NUDGERIGHT5))        { IsPixelNudgeClass = FALSE; }
00283     else if (OpToken == String(OPTOKEN_NUDGERIGHT10))       { IsPixelNudgeClass = FALSE; }
00284     else if (OpToken == String(OPTOKEN_NUDGERIGHTFIFTH))    { IsPixelNudgeClass = FALSE; }
00285 
00286     // Setup the Offset DocCoord to contain the X and Y translation values  
00287     DocCoord Offset;
00288 
00289     if (IsPixelNudgeClass)
00290     {
00291         Offset.x=(INT32)GetXPixelDisplacement();
00292         Offset.y=(INT32)GetYPixelDisplacement();
00293     }
00294     else if (!IsPixelNudgeClass)
00295     {
00296         //TypeCast from double to INT32
00297         Offset.x=(INT32) GetXNudgeDisplacement();
00298         Offset.y=(INT32) GetYNudgeDisplacement();
00299     }
00300 
00301     if (AttrFillGeometry::SelectionCount == 0)
00302     {
00303             // Nothing to Nudge !!
00304         FailAndExecute();
00305         End();
00306         return;
00307     }
00308 
00309     FillGeometryNudger* FillNudger = new FillGeometryNudger();
00310 
00311     if (FillNudger == NULL)
00312     {
00313         FailAndExecute();
00314         End();
00315         return;
00316     }
00317 
00318     FillNudger->MutateColourFills(NudgeCols);
00319     FillNudger->SetNudgeDistance(Offset.x, Offset.y);
00320 
00321     AttributeManager::AttributeSelected(NULL, FillNudger);
00322 
00323     LastNudgeType   = NULL;
00324     LastNudgeStart  = DocCoord(0,0);
00325     LastNudgeEnd    = DocCoord(0,0);
00326     LastNudgeEnd2   = DocCoord(0,0);
00327     
00328     End();
00329 }

void OpFillNudge::GetOpName String_256 OpName  )  [virtual]
 

The GetOpName fn is overridden so that we return back a description appropriate to the type of attribute that the operation applies.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/3/95
Parameters:
The undo string for the operation [OUTPUTS]
See also:
OpNudge::GetOpName()

Reimplemented from Operation.

Definition at line 344 of file fillndge.cpp.

00345 { 
00346     *OpName = String_256(NudgeUndoIDS);
00347 }  

static OpState OpFillNudge::GetState String_256 ,
OpDescriptor
[static]
 

static double OpFillNudge::GetXNudgeDisplacement  )  [inline, static]
 

Definition at line 132 of file fillndge.h.

00132 { return NudgeStep * X_NudgeFactor; }

double OpFillNudge::GetXPixelDisplacement  )  [inline]
 

Definition at line 134 of file fillndge.h.

00134 { return PixelNudge * X_NudgeFactor;}

static double OpFillNudge::GetYNudgeDisplacement  )  [inline, static]
 

Definition at line 133 of file fillndge.h.

00133 { return NudgeStep * Y_NudgeFactor; }

double OpFillNudge::GetYPixelDisplacement  )  [inline]
 

Definition at line 135 of file fillndge.h.

00135 { return PixelNudge * Y_NudgeFactor;}

static BOOL OpFillNudge::Init void   )  [static]
 

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.

void OpFillNudge::NudgeColours BOOL  cols  )  [static]
 

Sets whether a nudge will nudge colour or transparency fills.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/3/94

Definition at line 140 of file fillndge.cpp.

00141 {
00142     NudgeCols = cols;
00143 }


Member Data Documentation

BOOL OpFillNudge::IsPixelNudgeClass [private]
 

Definition at line 158 of file fillndge.h.

BOOL OpFillNudge::NudgeCols [static, private]
 

Definition at line 157 of file fillndge.h.

MILLIPOINT OpFillNudge::NudgeStep [static, private]
 

Definition at line 156 of file fillndge.h.

UINT32 OpFillNudge::NudgeUndoIDS [protected]
 

Definition at line 153 of file fillndge.h.

double OpFillNudge::PixelNudge [private]
 

Definition at line 159 of file fillndge.h.

double OpFillNudge::X_NudgeFactor [static, protected]
 

Definition at line 150 of file fillndge.h.

double OpFillNudge::Y_NudgeFactor = 0 [static, protected]
 

Definition at line 151 of file fillndge.h.


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