ChangeContourAttributeProfileAction 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 ChangeContourAttributeProfileAction:

Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 ChangeContourAttributeProfileAction ()
 Constructor for the action.
 ~ChangeContourAttributeProfileAction ()
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, ChangeContourAttributeProfileAction **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 ChangeAttributeProfileWithNoUndo (CProfileBiasGain &Profile)
 When applying contour (attribute) 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 OpChangeContourAttributeProfile::DoWithParam ()). This function is ONLY called from within ContourInfoBarOp::ChangeProfile () - after OpChangeContourAttributeProfile::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 597 of file opcntr.h.


Constructor & Destructor Documentation

ChangeContourAttributeProfileAction::ChangeContourAttributeProfileAction  ) 
 

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 3055 of file opcntr.cpp.

03056 {
03057     m_pNode = NULL;
03058 }

ChangeContourAttributeProfileAction::~ChangeContourAttributeProfileAction  ) 
 

Definition at line 3227 of file opcntr.cpp.

03228 {
03229 }


Member Function Documentation

void ChangeContourAttributeProfileAction::ChangeAttributeProfileWithNoUndo CProfileBiasGain Profile  )  [static]
 

When applying contour (attribute) 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 OpChangeContourAttributeProfile::DoWithParam ()). This function is ONLY called from within ContourInfoBarOp::ChangeProfile () - after OpChangeContourAttributeProfile::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 (), OpChangeContourAttributeProfile::DoWithParam ().

Definition at line 3144 of file opcntr.cpp.

03145 {
03146     BeginSlowJob(-1, TRUE);
03147     
03148     List NodeList;
03149     BevelTools::BuildListOfSelectedNodes(&NodeList, CC_RUNTIME_CLASS(NodeContourController));
03150 
03151     NodeListItem * pItem = (NodeListItem *)NodeList.GetHead();
03152 
03153     NodeContourController * pController = NULL;
03154 
03155 //  Node * pParent = NULL;
03156 
03157 //  ChangeContourObjectProfileAction * pAction= NULL;
03158 
03159     Document * pDoc = Document::GetCurrent();
03160 
03161     while (pItem)
03162     {
03163         pController = (NodeContourController *)pItem->pNode;
03164 
03165         // change the profile & regen
03166         pController->SetAttrProfile(Profile);
03167         pController->RegenerateNode(NULL, FALSE);
03168     
03169         // redraw the contour
03170         if (pDoc)
03171         {
03172             pDoc->ForceRedraw(pController->FindParentSpread(), 
03173                 pController->GetBoundingRect(), FALSE, pController);
03174         }
03175     
03176         pItem = (NodeListItem *)NodeList.GetNext(pItem);
03177     }
03178 
03179     NodeList.DeleteAll();
03180 
03181     EndSlowJob ();
03182 
03183     if (pDoc->GetOpHistory ().CanRedo ())
03184     {
03185         // then we need to clear out the redo information - since we are now 'before' it ....
03186         pDoc->GetOpHistory ().DeleteRedoableOps ();
03187 
03188         // and update the state of things ....
03189         DialogBarOp::SetSystemStateChanged();
03190         DialogBarOp::UpdateStateOfAllBars();
03191     }
03192 }

ActionCode ChangeContourAttributeProfileAction::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 3210 of file opcntr.cpp.

03211 {
03212     ChangeContourAttributeProfileAction * pAction = NULL;
03213     
03214     ActionCode Act = ChangeContourAttributeProfileAction::Init( pOperation, 
03215                                         pOppositeActLst,
03216                                         m_pNode,
03217                                         m_Profile,
03218                                         &pAction);
03219     if (Act != AC_FAIL)
03220     {
03221         
03222     }
03223 
03224     return Act;
03225 }

ActionCode ChangeContourAttributeProfileAction::Init Operation pOp,
ActionList pActionList,
NodeContourController pThisNodeContour,
CProfileBiasGain  Profile,
ChangeContourAttributeProfileAction **  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 3092 of file opcntr.cpp.

03097 {
03098     UINT32 ActSize = sizeof(ChangeContourAttributeProfileAction);
03099 
03100     ActionCode Ac = Action::Init(pOp,pActionList,ActSize,
03101         CC_RUNTIME_CLASS(ChangeContourAttributeProfileAction),(Action**)NewAction);
03102 
03103     Document * pDoc = Document::GetCurrent();
03104 
03105     if (Ac != AC_FAIL)
03106     {
03107         (*NewAction)->m_pNode  = pThisNodeContour;
03108         (*NewAction)->m_Profile = pThisNodeContour->GetAttrProfile();
03109 
03110         // change the profile & regen
03111         pThisNodeContour->SetAttrProfile(Profile);
03112         pThisNodeContour->RegenerateNode(NULL, FALSE);
03113     
03114         // redraw the contour
03115         if (pDoc)
03116         {
03117             pDoc->ForceRedraw(pThisNodeContour->FindParentSpread(), 
03118                 pThisNodeContour->GetBoundingRect(), FALSE, pThisNodeContour);
03119         }
03120     }
03121 
03122     return Ac;
03123 }


Member Data Documentation

NodeContourController* ChangeContourAttributeProfileAction::m_pNode [protected]
 

Definition at line 614 of file opcntr.h.

CProfileBiasGain ChangeContourAttributeProfileAction::m_Profile [protected]
 

Definition at line 615 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