ChangeContourObjectProfileAction Class Reference

An action which undoes the modification of a path's filled bit (or redoes it) It can also be used to undo the IsStroked flag as well. More...

#include <opcntr.h>

Inheritance diagram for ChangeContourObjectProfileAction:

Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 ChangeContourObjectProfileAction ()
 Constructor for the action.
 ~ChangeContourObjectProfileAction ()
virtual ActionCode Execute ()
 Executes the action. This will reset the num blend steps in pThisNodeBlend to OldNumSteps, after creating another action to record the current num steps of pThisNodeBlend.

Static Public Member Functions

static ActionCode Init (Operation *pOp, ActionList *pActionList, NodeContourController *pThisNodeContour, CProfileBiasGain Profile, ChangeContourObjectProfileAction **NewAction)
 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 ChangeObjectProfileWithNoUndo (CProfileBiasGain &Profile)
 When applying contour (object) 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 OpChangeContourObjectProfile::DoWithParam ()). This function is ONLY called from within ContourInfoBarOp::ChangeProfile () - after OpChangeContourObjectProfile::DoWithParam () has been called.

Protected Attributes

NodeContourControllerm_pNode
CProfileBiasGain m_Profile

Detailed Description

An action which undoes the modification of a path's filled bit (or redoes it) It can also be used to undo the IsStroked flag as well.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/11/94
See also:
-

Definition at line 716 of file opcntr.h.


Constructor & Destructor Documentation

ChangeContourObjectProfileAction::ChangeContourObjectProfileAction  ) 
 

Constructor for the action.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/11/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 3395 of file opcntr.cpp.

03396 {
03397     m_pNode = NULL;
03398 }

ChangeContourObjectProfileAction::~ChangeContourObjectProfileAction  ) 
 

Definition at line 3567 of file opcntr.cpp.

03568 {
03569 }


Member Function Documentation

void ChangeContourObjectProfileAction::ChangeObjectProfileWithNoUndo CProfileBiasGain Profile  )  [static]
 

When applying contour (object) 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 OpChangeContourObjectProfile::DoWithParam ()). This function is ONLY called from within ContourInfoBarOp::ChangeProfile () - after OpChangeContourObjectProfile::DoWithParam () has been called.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/2/2000
Parameters:
Profile - the profile that is to be applied directly (i.e. applied with no undo) [INPUTS]
Returns:
Errors: -
See also:
SoftShadowInfoBarOp::ChangeProfile (), OpChangeContourObjectProfile::DoWithParam ().

Definition at line 3484 of file opcntr.cpp.

03485 {
03486     BeginSlowJob(-1, TRUE);
03487     
03488     List NodeList;
03489     BevelTools::BuildListOfSelectedNodes(&NodeList, CC_RUNTIME_CLASS(NodeContourController));
03490 
03491     NodeListItem * pItem = (NodeListItem *)NodeList.GetHead();
03492 
03493     NodeContourController * pController = NULL;
03494 
03495 //  Node * pParent = NULL;
03496 
03497 //  ChangeContourObjectProfileAction * pAction= NULL;
03498 
03499     Document * pDoc = Document::GetCurrent();
03500 
03501     while (pItem)
03502     {
03503         pController = (NodeContourController *)pItem->pNode;
03504 
03505         // change the profile & regen
03506         pController->SetObjectProfile(Profile);
03507         pController->RegenerateNode(NULL, FALSE);
03508     
03509         // redraw the contour
03510         if (pDoc)
03511         {
03512             pDoc->ForceRedraw(pController->FindParentSpread(), 
03513                 pController->GetBoundingRect(), FALSE, pController);
03514         }
03515     
03516         pItem = (NodeListItem *)NodeList.GetNext(pItem);
03517     }
03518 
03519     NodeList.DeleteAll();
03520 
03521     EndSlowJob ();
03522 
03523     if (pDoc->GetOpHistory ().CanRedo ())
03524     {
03525         // then we need to clear out the redo information - since we are now 'before' it ....
03526         pDoc->GetOpHistory ().DeleteRedoableOps ();
03527 
03528         // and update the state of things ....
03529         DialogBarOp::SetSystemStateChanged();
03530         DialogBarOp::UpdateStateOfAllBars();
03531     }
03532 }

ActionCode ChangeContourObjectProfileAction::Execute  )  [virtual]
 

Executes the action. This will reset the num blend steps in pThisNodeBlend to OldNumSteps, after creating another action to record the current num steps of pThisNodeBlend.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/11/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
ActionCode, one of AC_OK, AC_NO_RECORD or AC_FAIL

Errors: -

See also:
Action::Init()

Reimplemented from Action.

Definition at line 3550 of file opcntr.cpp.

03551 {
03552     ChangeContourObjectProfileAction * pAction = NULL;
03553     
03554     ActionCode Act = ChangeContourObjectProfileAction::Init(    pOperation, 
03555                                         pOppositeActLst,
03556                                         m_pNode,
03557                                         m_Profile,
03558                                         &pAction);
03559     if (Act != AC_FAIL)
03560     {
03561         
03562     }
03563 
03564     return Act;
03565 }

ActionCode ChangeContourObjectProfileAction::Init Operation pOp,
ActionList pActionList,
NodeContourController pThisNodeContour,
CProfileBiasGain  Profile,
ChangeContourObjectProfileAction **  NewAction
[static]
 

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.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/11/94
Parameters:
pOp = ptr to the operation to which this action belongs [INPUTS] pActionList = ptr to action list to which this action should be added pThisNodeBlend = ptr to NodeBlend to change NumSteps = Num steps to applied to pThisNodeBlend
ppNewAction = ptr to a ptr to an action, allowing the function to return [OUTPUTS] a pointer to the created action
Returns:
ActionCode, one of AC_OK, AC_NO_RECORD or AC_FAIL

Errors: -

See also:
Action::Init()

Definition at line 3432 of file opcntr.cpp.

03437 {
03438     UINT32 ActSize = sizeof(ChangeContourObjectProfileAction);
03439 
03440     ActionCode Ac = Action::Init(pOp,pActionList,ActSize,
03441         CC_RUNTIME_CLASS(ChangeContourObjectProfileAction),(Action**)NewAction);
03442 
03443     Document * pDoc = Document::GetCurrent();
03444 
03445     if (Ac != AC_FAIL)
03446     {
03447         (*NewAction)->m_pNode  = pThisNodeContour;
03448         (*NewAction)->m_Profile = pThisNodeContour->GetObjectProfile();
03449 
03450         // change the profile & regen
03451         pThisNodeContour->SetObjectProfile(Profile);
03452         pThisNodeContour->RegenerateNode(NULL, FALSE);
03453     
03454         // redraw the contour
03455         if (pDoc)
03456         {
03457             pDoc->ForceRedraw(pThisNodeContour->FindParentSpread(), 
03458                 pThisNodeContour->GetBoundingRect(), FALSE, pThisNodeContour);
03459         }
03460     }
03461 
03462     return Ac;
03463 }


Member Data Documentation

NodeContourController* ChangeContourObjectProfileAction::m_pNode [protected]
 

Definition at line 733 of file opcntr.h.

CProfileBiasGain ChangeContourObjectProfileAction::m_Profile [protected]
 

Definition at line 734 of file opcntr.h.


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