#include <opcntr.h>
Inheritance diagram for OpChangeContourSteps:
Public Member Functions | |
OpChangeContourSteps () | |
~OpChangeContourSteps () | |
virtual void | DoWithParam (OpDescriptor *, OpParam *pOpParam) |
This changes all the selected blend objects to have pOpParam->Param1 number of steps. | |
virtual 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. | |
virtual BOOL | MayChangeNodeBounds () const |
Static Public Member Functions | |
static BOOL | Declare () |
Adds the operation to the list of all known operations. | |
static OpState | GetState (String_256 *Description, OpDescriptor *) |
Find out the state of the operation at the specific time. | |
Private Member Functions | |
CC_DECLARE_DYNCREATE (OpChangeContourSteps) |
Definition at line 466 of file opcntr.h.
|
Definition at line 472 of file opcntr.h.
|
|
Definition at line 473 of file opcntr.h.
|
|
|
|
Adds the operation to the list of all known operations.
Definition at line 2538 of file opcntr.cpp. 02539 { 02540 return (RegisterOpDescriptor( 02541 0, 02542 0, 02543 CC_RUNTIME_CLASS(OpChangeContourSteps), 02544 OPTOKEN_CHANGECONTOURSTEPS, 02545 OpChangeContourSteps::GetState, 02546 0, /* help ID */ 02547 0, /* bubble ID */ 02548 0 /* bitmap ID */ 02549 )); 02550 }
|
|
This changes all the selected blend objects to have pOpParam->Param1 number of steps.
Reimplemented from Operation. Definition at line 2436 of file opcntr.cpp. 02437 { 02438 ERROR3IF(pOpParam == NULL,"NULL OpParam ptr"); 02439 if (pOpParam == NULL) return; 02440 02441 List NodeList; 02442 BevelTools::BuildListOfSelectedNodes(&NodeList, CC_RUNTIME_CLASS(NodeRenderableInk)); 02443 02444 NodeListItem *pItem = NULL; 02445 02446 BOOL ok = !NodeList.IsEmpty(); 02447 02448 if (ok) ok = DoStartSelOp(FALSE,FALSE); 02449 02450 if (ok) 02451 { 02452 // The new number of steps is in pOpParam->Param1 of the 02453 UINT32 NewNumSteps = UINT32(pOpParam->Param1); 02454 pItem = (NodeListItem *)NodeList.GetHead(); 02455 02456 Node* pSelNode = NULL; 02457 02458 if (pItem) 02459 { 02460 pSelNode = pItem->pNode; 02461 } 02462 02463 while (pSelNode != NULL && ok) 02464 { 02465 Node* pNode = pSelNode; 02466 02467 pItem = (NodeListItem *)NodeList.GetNext(pItem); 02468 02469 if (pItem) 02470 { 02471 pSelNode = pItem->pNode; 02472 } 02473 else 02474 { 02475 pSelNode = NULL; 02476 } 02477 02478 if (pNode->IS_KIND_OF(NodeContourController)) 02479 { 02480 // We now have a selected blend node so: 02481 // Invalidate the node's region 02482 // Store the current number of blend steps in an undo actiom 02483 // Change the number of steps to NewNumSteps 02484 02485 NodeRenderableInk * pInk = (NodeRenderableInk *)pNode; 02486 02487 UINT32 NumSteps = 0; 02488 double DistanceEntered = 0.0; 02489 NumSteps = ((NodeContourController *)pNode)->GetNumberOfSteps(); 02490 DistanceEntered = 0.0; 02491 02492 ChangeContourStepsAction* pAction; 02493 02494 // Ask the node if it's ok to do the op 02495 ObjChangeFlags cFlags; 02496 ObjChangeParam ObjChange(OBJCHANGE_STARTING,cFlags,NULL,this); 02497 ok = pInk->AllowOp(&ObjChange); 02498 02499 if (ok) ok = DoInvalidateNodeRegion(pInk,TRUE,FALSE); 02500 if (ok) ok = (InvalidateBoundsAction::Init(this,&UndoActions,pInk,TRUE) != AC_FAIL); 02501 if (ok) ok = ChangeContourStepsAction::Init(this,&UndoActions,pInk,NumSteps, DistanceEntered, &pAction) != AC_FAIL; 02502 02503 if (ok) 02504 { 02505 ((NodeContourController *)pNode)->SetNumberOfSteps(NewNumSteps); 02506 pNode->RegenerateNode(NULL, FALSE); 02507 } 02508 02509 if (ok) ok = DoInvalidateNodeRegion(pInk,TRUE,FALSE); 02510 if (ok) ok = (InvalidateBoundsAction::Init(this,&UndoActions,pInk,TRUE) != AC_FAIL); 02511 } 02512 } 02513 } 02514 02515 NodeList.DeleteAll(); 02516 02517 if (ok) 02518 { 02519 02520 } 02521 else 02522 FailAndExecute(); 02523 02524 End(); 02525 }
|
|
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 2607 of file opcntr.cpp. 02608 { 02609 *OpName = String_256(_R(IDS_CONTOURSTEPS_UNDO)); 02610 }
|
|
Find out the state of the operation at the specific time.
Definition at line 2567 of file opcntr.cpp. 02568 { 02569 OpState State(FALSE,TRUE); // It's not ticked, but it is greyed by default 02570 02571 // DMc - to test for bevels & contours 02572 // are there any contour nodes in the selection 02573 List NodeList; 02574 BevelTools::BuildListOfSelectedNodes(&NodeList, CC_RUNTIME_CLASS(NodeContourController)); 02575 02576 if (!NodeList.IsEmpty()) 02577 { 02578 State.Greyed = FALSE; 02579 } 02580 02581 NodeList.DeleteAll(); 02582 02583 if (State.Greyed) 02584 *Description = String_256(_R(IDS_CONTOURSTEPS)); 02585 else 02586 *Description = String_256(_R(IDS_CONTOURSTEPS)); 02587 02588 return State; 02589 }
|
|
Reimplemented from SelOperation. Definition at line 484 of file opcntr.h. 00484 { return FALSE; }
|