#include <filltool.h>
Inheritance diagram for ChangeFillProfileAction:
Public Member Functions | |
ChangeFillProfileAction () | |
Construct an object of this type. | |
~ChangeFillProfileAction () | |
Destruct an object of this type. | |
virtual ActionCode | Execute () |
Executes the action. This will reset the fill profile in m_pNodeFill to its previous one, after creating another action to record the current fill profile of m_pNodeFill in. | |
Static Public Member Functions | |
static ActionCode | Init (Operation *pOp, ActionList *pActionList, AttrFillGeometry *pThisNodeFill, CProfileBiasGain &Profile, ChangeFillProfileAction **NewAction, BOOL bReverse=TRUE, BOOL bCache=FALSE) |
This is the function which creates an instance of this action. If there is no room in the undo buffer (which is determined by the base class Init function called within) the function will either return AC_NO_RECORD which means the operation can continue, but no undo information needs to be stored, or AC_OK which means the operation should continue AND record undo information. If the function returns AC_FAIL, there was not enough memory to record the undo information, and the user has decided not to continue with the operation. | |
static void | ChangeFillProfileWithNoUndo (CProfileBiasGain &Profile) |
When applying fill profiles, we only want to generate one bit of undo information. This function allows us to meet this requirement (the one bit of undo information is generated via OpChangeFillProfile::DoWithParam ()). This function is ONLY called from within GradInfoBarOp::ChangeProfile () - after OpChangeFillProfile::DoWithParam () has been called. | |
Protected Attributes | |
AttrFillGeometry * | m_pNodeFill |
CProfileBiasGain | m_LastProfile |
Definition at line 859 of file filltool.h.
|
Construct an object of this type.
Definition at line 10314 of file filltool.cpp. 10315 { 10316 m_pNodeFill = NULL; 10317 }
|
|
Destruct an object of this type.
Definition at line 10332 of file filltool.cpp.
|
|
When applying fill profiles, we only want to generate one bit of undo information. This function allows us to meet this requirement (the one bit of undo information is generated via OpChangeFillProfile::DoWithParam ()). This function is ONLY called from within GradInfoBarOp::ChangeProfile () - after OpChangeFillProfile::DoWithParam () has been called.
Definition at line 10429 of file filltool.cpp. 10430 { 10431 Document * pDoc = Document::GetCurrent(); 10432 10433 List ShadowList; 10434 // Why does this change ALL profiles - even those deep down in the selection??? 10435 // FillTools::BuildListOfSelectedNodes(&ShadowList, CC_RUNTIME_CLASS(AttrFillGeometry)); 10436 FillTools::GetSelectedAttrList(&ShadowList, CC_RUNTIME_CLASS(AttrFillGeometry), TRUE, FALSE); 10437 10438 NodeListItem * pItem = (NodeListItem *)ShadowList.GetHead(); 10439 10440 CProfileBiasGain OldGain; 10441 10442 while (pItem) 10443 { 10444 if (pItem->pNode) 10445 { 10446 AttrFillGeometry* pThisNodeFill = (AttrFillGeometry *)pItem->pNode; 10447 10448 FillGeometryAttribute* temp = (FillGeometryAttribute*) pThisNodeFill->GetAttributeValue (); 10449 temp->SetProfile(Profile); 10450 10451 NodeRenderableInk* pNode = (NodeRenderableInk*) pThisNodeFill->FindParent (); 10452 Node* pParent = pNode->FindParent (); 10453 10454 // decide the best option for causing a redraw 10455 10456 if (IS_A(pParent, Layer)) // a simple node is selected 10457 { 10458 pDoc->ForceRedraw(pThisNodeFill->FindParentSpread(), 10459 pNode->GetBoundingRect(), FALSE, pNode); 10460 } 10461 else 10462 { 10463 ObjChangeFlags cFlags; 10464 cFlags.Attribute = TRUE; // Needed to make Blends re-calc themselves 10465 10466 ObjChangeParam ObjChange(OBJCHANGE_STARTING,cFlags,NULL,NULL); 10467 10468 /*(AttrFillGeometry *)*/ (pItem->pNode)->AllowOp(&ObjChange); 10469 10470 ObjChange.Define(OBJCHANGE_FINISHED,cFlags,NULL,NULL); 10471 10472 Operation TempOp; 10473 10474 TempOp.UpdateAllChangedNodes(&ObjChange); 10475 } 10476 } 10477 10478 pItem = (NodeListItem *)ShadowList.GetNext(pItem); 10479 } 10480 10481 ShadowList.DeleteAll(); 10482 10483 if (pDoc->GetOpHistory ().CanRedo ()) 10484 { 10485 // then we need to clear out the redo information - since we are now 'before' it .... 10486 pDoc->GetOpHistory ().DeleteRedoableOps (); 10487 10488 // and update the state of things .... 10489 DialogBarOp::SetSystemStateChanged(); 10490 DialogBarOp::UpdateStateOfAllBars(); 10491 } 10492 }
|
|
Executes the action. This will reset the fill profile in m_pNodeFill to its previous one, after creating another action to record the current fill profile of m_pNodeFill in.
Reimplemented from Action. Definition at line 10513 of file filltool.cpp. 10514 { 10515 ActionCode Act; 10516 ChangeFillProfileAction* pAction; 10517 10518 Act = ChangeFillProfileAction::Init( pOperation, 10519 pOppositeActLst, 10520 m_pNodeFill, 10521 m_LastProfile, 10522 &pAction, 10523 TRUE, 10524 FALSE); 10525 10526 return (Act); 10527 }
|
|
This is the function which creates an instance of this action. If there is no room in the undo buffer (which is determined by the base class Init function called within) the function will either return AC_NO_RECORD which means the operation can continue, but no undo information needs to be stored, or AC_OK which means the operation should continue AND record undo information. If the function returns AC_FAIL, there was not enough memory to record the undo information, and the user has decided not to continue with the operation.
Definition at line 10370 of file filltool.cpp. 10377 { 10378 UINT32 ActSize = sizeof(ChangeFillProfileAction); 10379 10380 ActionCode Ac = Action::Init(pOp,pActionList,ActSize, CC_RUNTIME_CLASS(ChangeFillProfileAction), (Action**)NewAction); 10381 10382 if (Ac != AC_FAIL) 10383 { 10384 Document * pDoc = Document::GetCurrent(); 10385 10386 // reverse the action 10387 if (bReverse) 10388 { 10389 pActionList->RemoveItem(*NewAction); 10390 pActionList->AddHead(*NewAction); 10391 } 10392 10393 (*NewAction)->m_pNodeFill = pThisNodeFill; 10394 FillGeometryAttribute* temp = (FillGeometryAttribute*) pThisNodeFill->GetAttributeValue (); 10395 (*NewAction)->m_LastProfile = temp->GetProfile (); 10396 10397 NodeRenderableInk* pNode = (NodeRenderableInk*) pThisNodeFill->FindParent (); 10398 10399 // set the values, invalidate and regenerate 10400 10401 temp->SetProfile(Profile); 10402 10403 pDoc->ForceRedraw(pThisNodeFill->FindParentSpread(), 10404 pNode->GetBoundingRect(), FALSE, pNode); 10405 } 10406 10407 return Ac; 10408 }
|
|
Definition at line 880 of file filltool.h. |
|
Definition at line 879 of file filltool.h. |