UpdateBrushAction Class Reference

An action which signals to a brush attribute that its ink node hsa changed. It is appropriate to call this action when serious adjustments have been made to the timestamping points list of the attrbrushtype, for instance adding or removing subsets of the list. It is not appropriate to call it when the coordinates of the path have changed but you do not wish to add or remove any points from the list. More...

#include <opdrbrsh.h>

Inheritance diagram for UpdateBrushAction:

Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

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

Static Public Member Functions

static ActionCode Init (Operation *pOp, ActionList *pActionList, NodePath *pNodePath, UpdateBrushAction **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.

Public Attributes

NodePathm_pNodePath

Detailed Description

An action which signals to a brush attribute that its ink node hsa changed. It is appropriate to call this action when serious adjustments have been made to the timestamping points list of the attrbrushtype, for instance adding or removing subsets of the list. It is not appropriate to call it when the coordinates of the path have changed but you do not wish to add or remove any points from the list.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/3/2000
See also:
-

Definition at line 667 of file opdrbrsh.h.


Constructor & Destructor Documentation

UpdateBrushAction::UpdateBrushAction  ) 
 

Constructor for the action.

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

Errors: -

See also:
-

Definition at line 5491 of file opdrbrsh.cpp.

05492 {
05493     m_pNodePath = NULL;
05494 }

UpdateBrushAction::~UpdateBrushAction  ) 
 

destructor for the action

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

Errors: -

See also:
-

Definition at line 5513 of file opdrbrsh.cpp.

05514 {
05515 
05516 }


Member Function Documentation

ActionCode UpdateBrushAction::Execute  )  [virtual]
 

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

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
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 5604 of file opdrbrsh.cpp.

05605 {
05606     ActionCode Act;
05607     UpdateBrushAction* pAction;
05608     Act = UpdateBrushAction::Init(pOperation,pOppositeActLst, m_pNodePath, &pAction);
05609 
05610     return Act;
05611 }

ActionCode UpdateBrushAction::Init Operation pOp,
ActionList pActionList,
NodePath pNodePath,
UpdateBrushAction **  ppNewAction
[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:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
pOp = ptr to the operation to which this action belongs [INPUTS] pActionList = ptr to action list to which this action should be added pNewPoints - the points to add to the list StartDistance - the distance to start adding the points
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
This function actually changes the blend node in a way specified in pChangeParam
Returns:
Errors: -
See also:
Action::Init()

Definition at line 5550 of file opdrbrsh.cpp.

05552 {
05553     ERROR2IF(pNodePath == NULL, AC_FAIL, "Nodepath is NULL");
05554 
05555     // Change here now that our attributes are being factored again - we can't rely on pAttrBrush
05556     // not having been deleted so get a new one each time
05557 
05558     AttrBrushType* pBrush = NULL;
05559     pNodePath->FindAppliedAttribute(CC_RUNTIME_CLASS(AttrBrushType), (NodeAttribute**)&pBrush);
05560     if (pBrush == NULL)
05561         return AC_OK;
05562 
05563     // just check that our brush isn't a default
05564     if (pBrush->GetBrushHandle() == BrushHandle_NoBrush)
05565         return AC_OK;
05566     // Get the attribute value, just to make sure
05567     BrushAttrValue* pVal = (BrushAttrValue*)pBrush->GetAttributeValue();
05568     if (pVal == NULL)
05569         return AC_FAIL;
05570 
05571     // make the new action
05572     UINT32 ActSize = sizeof(UpdateBrushAction);
05573     UpdateBrushAction* pNewAction;
05574     ActionCode Ac = Action::Init(pOp,pActionList,ActSize,CC_RUNTIME_CLASS(UpdateBrushAction),(Action**)&pNewAction);
05575     *ppNewAction = pNewAction;
05576 
05577     // all we really do is ask the brush to update itself
05578     if (Ac != AC_FAIL)
05579         pBrush->NodePathUpdated(&(pNodePath->InkPath));
05580 
05581     pNewAction->m_pNodePath = pNodePath;
05582 
05583     return Ac;
05584 }


Member Data Documentation

NodePath* UpdateBrushAction::m_pNodePath
 

Definition at line 682 of file opdrbrsh.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:02:43 2007 for Camelot by  doxygen 1.4.4