InitBlendersAction Class Reference

An action which deinits or reinits a blend. More...

#include <blndtool.h>

Inheritance diagram for InitBlendersAction:

Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 InitBlendersAction ()
 Constructor for the action.
 ~InitBlendersAction ()
virtual ActionCode Execute ()
 Executes the action. This remaps the blend node using the inverse mapping indexes it was initialised with, creating another InitBlendersAction to invert this mapping.

Static Public Member Functions

static ActionCode Init (OpBlendNodes *pOp, ActionList *pActionList, List *pBlenderInfoList, BOOL DeinitState, InitBlendersAction **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.

Protected Attributes

List BlenderInfoList
BOOL Deinit

Detailed Description

An action which deinits or reinits a blend.

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

Definition at line 761 of file blndtool.h.


Constructor & Destructor Documentation

InitBlendersAction::InitBlendersAction  ) 
 

Constructor for the action.

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

Errors: -

See also:
-

Definition at line 7079 of file blndtool.cpp.

07080 {
07081 }

InitBlendersAction::~InitBlendersAction  ) 
 

Definition at line 7197 of file blndtool.cpp.

07198 {
07199     BlenderInfoList.DeleteAll();
07200 }


Member Function Documentation

ActionCode InitBlendersAction::Execute  )  [virtual]
 

Executes the action. This remaps the blend node using the inverse mapping indexes it was initialised with, creating another InitBlendersAction to invert this mapping.

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

07169 {
07170     ActionCode Ac;
07171     InitBlendersAction* pAction;
07172     OpBlendNodes* pOp = (OpBlendNodes*)pOperation;
07173 
07174     // Negate the type of blender initialisation
07175     Deinit = !Deinit;
07176 
07177     Ac = InitBlendersAction::Init(  pOp,
07178                                     pOppositeActLst,
07179                                     &BlenderInfoList,
07180                                     Deinit,
07181                                     &pAction);
07182 
07183     if (Ac != AC_FAIL)
07184     {
07185         if (Deinit)
07186             pOp->DeinitBlenders(BlenderInfoList);
07187         else
07188         {
07189             if (!(pOp->ReinitBlenders(BlenderInfoList)))
07190                 Ac = AC_FAIL;
07191         }
07192     }
07193 
07194     return Ac;
07195 }

ActionCode InitBlendersAction::Init OpBlendNodes pOp,
ActionList pActionList,
List pBlenderInfoList,
BOOL  DeinitState,
InitBlendersAction **  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:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/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 pBlenderInfoList= ptr to a NodeBlend Deinit = TRUE if deinit blend, else reinit
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
If Deinit == TRUE, then undo will reinit the blenders and redo will deinit them again. The reverse happens if Deinit == FALSE;
Returns:
Errors: -
See also:
Action::Init()

Definition at line 7118 of file blndtool.cpp.

07123 {
07124     UINT32 ActSize = sizeof(InitBlendersAction)+(pBlenderInfoList->GetCount()*sizeof(BlenderInfoItem));
07125 
07126     ActionCode Ac = Action::Init(pOp,pActionList,ActSize,CC_RUNTIME_CLASS(InitBlendersAction),(Action**)ppNewAction);
07127     InitBlendersAction* pAction = *ppNewAction;
07128 
07129     if (Ac != AC_FAIL)
07130     {
07131         pAction->Deinit = DeinitState;
07132 
07133         // Copy items from the given list to the new action's list
07134         BlenderInfoItem *pItem = (BlenderInfoItem*)pBlenderInfoList->GetHead();
07135         while (pItem != NULL && Ac != AC_FAIL)
07136         {
07137             BlenderInfoItem* pNewItem = pItem->SimpleCopy();
07138             if (pNewItem != NULL)
07139             {
07140                 pAction->BlenderInfoList.AddTail(pNewItem);
07141                 pItem = (BlenderInfoItem*)pBlenderInfoList->GetNext(pItem);
07142             }
07143             else
07144                 Ac = AC_FAIL;
07145         }
07146     }
07147 
07148     return Ac;
07149 }


Member Data Documentation

List InitBlendersAction::BlenderInfoList [protected]
 

Definition at line 776 of file blndtool.h.

BOOL InitBlendersAction::Deinit [protected]
 

Definition at line 777 of file blndtool.h.


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