ChangeBlenderAction Class Reference

An action which changes the blender. More...

#include <blndtool.h>

Inheritance diagram for ChangeBlenderAction:

Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 ChangeBlenderAction ()
 Constructor for the action.
 ~ChangeBlenderAction ()
virtual ActionCode Execute ()
 Executes the action.

Static Public Member Functions

static ActionCode Init (Operation *pOp, ActionList *pActionList, NodeBlender *pNodeBlender, ChangeBlenderOpParam &ChangeParam)
 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.

Protected Attributes

NodeBlenderm_pNodeBlender
ChangeBlenderOpParam m_ChangeParam

Detailed Description

An action which changes the blender.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/3/99
See also:
-

Definition at line 1141 of file blndtool.h.


Constructor & Destructor Documentation

ChangeBlenderAction::ChangeBlenderAction  ) 
 

Constructor for the action.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/5/99

Definition at line 8368 of file blndtool.cpp.

08369 {
08370     m_pNodeBlender = NULL;
08371 }

ChangeBlenderAction::~ChangeBlenderAction  ) 
 

Definition at line 8495 of file blndtool.cpp.

08496 {
08497 }


Member Function Documentation

ActionCode ChangeBlenderAction::Execute  )  [virtual]
 

Executes the action.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/5/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 8485 of file blndtool.cpp.

08486 {
08487     m_ChangeParam.SwapOldAndNew();
08488 
08489     ActionCode Act;
08490     Act = ChangeBlenderAction::Init(pOperation,pOppositeActLst,m_pNodeBlender,m_ChangeParam);
08491 
08492     return Act;
08493 }

ActionCode ChangeBlenderAction::Init Operation pOp,
ActionList pActionList,
NodeBlender pNodeBlender,
ChangeBlenderOpParam ChangeParam
[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:
20/5/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 pNodeBlender = ptr to NodeBlender to change ChangeParam = class that details how the blender should be changed.
- [OUTPUTS]
Returns:
ActionCode, one of AC_OK, AC_NO_RECORD or AC_FAIL
This function actually changes the blender node in a way specified in ChangeParam
Returns:
Errors: -
See also:
Action::Init()

Definition at line 8405 of file blndtool.cpp.

08409 {
08410     ERROR2IF(pNodeBlender == NULL,AC_FAIL,"pNodeBlender is NULL");
08411 
08412     UINT32 ActSize = sizeof(ChangeBlenderAction);
08413 
08414     ChangeBlenderAction* pNewAction;
08415     ActionCode Ac = Action::Init(pOp,pActionList,ActSize,CC_RUNTIME_CLASS(ChangeBlenderAction),(Action**)&pNewAction);
08416 
08417     if (Ac != AC_FAIL && pNewAction != NULL)
08418     {
08419         ChangeBlenderType ChangeType = ChangeParam.m_ChangeType;
08420 
08421         pNewAction->m_pNodeBlender             = pNodeBlender;
08422         pNewAction->m_ChangeParam.m_ChangeType = ChangeType;
08423 
08424         pNewAction->m_ChangeParam.SetOldValues(pNodeBlender);
08425         switch (ChangeType)
08426         {
08427             case CHANGEBLENDER_ANGLESTART:          pNodeBlender->SetAngleStart(ChangeParam.m_NewAngleStart); break;
08428             case CHANGEBLENDER_ANGLEEND:            pNodeBlender->SetAngleEnd(  ChangeParam.m_NewAngleEnd); break;
08429             case CHANGEBLENDER_PATHSTART:           
08430             {
08431                 pNodeBlender->SetProportionOfPathDistStart(ChangeParam.m_NewPathStart); 
08432                 pNodeBlender->SetUninitialised();
08433             }
08434             break;
08435             case CHANGEBLENDER_PATHEND:             
08436             {
08437                 pNodeBlender->SetProportionOfPathDistEnd(ChangeParam.m_NewPathEnd); 
08438                 pNodeBlender->SetUninitialised();
08439             }   
08440             break;
08441             case CHANGEBLENDER_REGEN:
08442             {
08443                 pNodeBlender->SetUninitialised();
08444             }
08445             break;
08446             case CHANGEBLENDER_NBPINDEX:
08447             {
08448                 pNodeBlender->SetNodeBlendPathIndex(ChangeParam.m_NewNodeBlendPathIndex);
08449             }
08450             break;
08451             case CHANGEBLENDER_BLENDONCURVE:
08452             {
08453                 pNodeBlender->SetBlendedOnCurve(ChangeParam.m_NewBlendedOnCurve);
08454             }
08455             break;
08456             case CHANGEBLENDER_SWAPENDS:
08457             {
08458                 pNodeBlender->ReverseEnds();
08459                 pNodeBlender->SetUninitialised();
08460             }
08461             break;  
08462             default : ERROR2(AC_FAIL,"Unknown change blend type"); break;
08463         }
08464         pNewAction->m_ChangeParam.SetNewValues(pNodeBlender);
08465     }
08466 
08467     return Ac;
08468 }


Member Data Documentation

ChangeBlenderOpParam ChangeBlenderAction::m_ChangeParam [protected]
 

Definition at line 1156 of file blndtool.h.

NodeBlender* ChangeBlenderAction::m_pNodeBlender [protected]
 

Definition at line 1155 of file blndtool.h.


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