#include <fillndge.h>
Inheritance diagram for OpFillNudge:
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 |
Definition at line 119 of file fillndge.h.
|
|
|
The path nudge op's Do() function.
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 }
|
|
The GetOpName fn is overridden so that we return back a description appropriate to the type of attribute that the operation applies.
Reimplemented from Operation. Definition at line 344 of file fillndge.cpp. 00345 { 00346 *OpName = String_256(NudgeUndoIDS); 00347 }
|
|
|
|
Definition at line 132 of file fillndge.h. 00132 { return NudgeStep * X_NudgeFactor; }
|
|
Definition at line 134 of file fillndge.h. 00134 { return PixelNudge * X_NudgeFactor;}
|
|
Definition at line 133 of file fillndge.h. 00133 { return NudgeStep * Y_NudgeFactor; }
|
|
Definition at line 135 of file fillndge.h. 00135 { return PixelNudge * Y_NudgeFactor;}
|
|
Declares a preference that allows you to clear memory in delete().
Reimplemented from SimpleCCObject. |
|
Sets whether a nudge will nudge colour or transparency fills.
Definition at line 140 of file fillndge.cpp. 00141 { 00142 NudgeCols = cols; 00143 }
|
|
Definition at line 158 of file fillndge.h. |
|
Definition at line 157 of file fillndge.h. |
|
Definition at line 156 of file fillndge.h. |
|
Definition at line 153 of file fillndge.h. |
|
Definition at line 159 of file fillndge.h. |
|
Definition at line 150 of file fillndge.h. |
|
Definition at line 151 of file fillndge.h. |