OpChangeBlend Class Reference

This changes aspects of all selected blends. More...

#include <blndtool.h>

Inheritance diagram for OpChangeBlend:

SelOperation UndoableOperation Operation MessageHandler ListItem CCObject SimpleCCObject OpBlendAntialias OpBlendOneToOne OpBlendTangential List of all members.

Public Member Functions

 OpChangeBlend ()
 ~OpChangeBlend ()
virtual void DoWithParam (OpDescriptor *, OpParam *pOpParam)
 This changes the flag specified in FlagType (given in pOpParam->Param1) in all the selected blend objects to have the same as state of pOpParam->Param2.
virtual void GetOpName (String_256 *OpName)
 The GetOpName fn is overridden so that we return back a description appropriate to the type of attribute that the operation applies.
ChangeBlendType GetChangeType ()

Static Public Member Functions

static BOOL Declare ()
 Adds the operation to the list of all known operations.
static OpState GetState (String_256 *Description, OpDescriptor *)
 Find out the state of the operation at the specific time.

Private Member Functions

 CC_DECLARE_DYNCREATE (OpChangeBlend)

Private Attributes

ChangeBlendType ChangeType

Detailed Description

This changes aspects of all selected blends.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/12/94

Definition at line 804 of file blndtool.h.


Constructor & Destructor Documentation

OpChangeBlend::OpChangeBlend  )  [inline]
 

Definition at line 810 of file blndtool.h.

OpChangeBlend::~OpChangeBlend  )  [inline]
 

Definition at line 812 of file blndtool.h.

00812 {}


Member Function Documentation

OpChangeBlend::CC_DECLARE_DYNCREATE OpChangeBlend   )  [private]
 

BOOL OpChangeBlend::Declare  )  [static]
 

Adds the operation to the list of all known operations.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/12/94
Returns:
TRUE if all went OK, FALSE otherwise

Reimplemented in OpBlendOneToOne, OpBlendAntialias, and OpBlendTangential.

Definition at line 7328 of file blndtool.cpp.

07329 {
07330     return (RegisterOpDescriptor(
07331                                 0, 
07332                                 0,
07333                                 CC_RUNTIME_CLASS(OpChangeBlend), 
07334                                 OPTOKEN_CHANGEBLEND,
07335                                 OpChangeBlend::GetState,
07336                                 0,  /* help ID */
07337                                 0,  /* bubble ID */
07338                                 0   /* bitmap ID */
07339                                 ));
07340 }

void OpChangeBlend::DoWithParam OpDescriptor ,
OpParam pOpParam
[virtual]
 

This changes the flag specified in FlagType (given in pOpParam->Param1) in all the selected blend objects to have the same as state of pOpParam->Param2.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/12/94
Returns:
-

Reimplemented from Operation.

Definition at line 7220 of file blndtool.cpp.

07221 {
07222     ERROR3IF(pOpParam == NULL,"NULL OpParam ptr");
07223     if (pOpParam == NULL) return;
07224 
07225     ChangeBlendOpParam* pChangeParam = (ChangeBlendOpParam*)pOpParam;
07226 
07227     List NodeList;
07228     BevelTools::BuildListOfSelectedNodes(&NodeList, CC_RUNTIME_CLASS(NodeRenderableInk));
07229 
07230     BOOL ok = !NodeList.IsEmpty();
07231     if (ok) ok = DoStartSelOp(FALSE,FALSE);
07232 
07233     NodeListItem * pItem = NULL;
07234 
07235     if (ok)
07236     {
07237         pItem = (NodeListItem *)NodeList.GetHead();
07238 
07239         Node* pSelNode = NULL;
07240 
07241         if (pItem)
07242         {
07243             pSelNode = pItem->pNode;
07244         }
07245 
07246         while (pSelNode != NULL && ok)
07247         {
07248             Node* pNode = pSelNode;
07249 
07250             pItem = (NodeListItem *)NodeList.GetNext(pItem);
07251 
07252             if (pItem)
07253             {
07254                 pSelNode = pItem->pNode;
07255             }
07256             else
07257             {
07258                 pSelNode = NULL;
07259             }
07260 
07261             if (pNode->IS_KIND_OF(NodeBlend))
07262             {
07263                 // We now have a selected blend node so:
07264                 //  Invalidate the node's region
07265                 //  Store the current state of blend flag in an undo actiom
07266                 //  Change the flag to the setting in Param2
07267 
07268                 ChangeBlendAction* pAction;
07269                 NodeBlend* pNodeBlend = (NodeBlend*)pNode;
07270 
07271                 // Ask the node if it's ok to do the op
07272                 ObjChangeFlags cFlags;
07273                 // Ilan 7/5/00
07274                 // Ensure AllowOp passes messages on to children in compound (so geom linked attrs informed)
07275                 cFlags.TransformNode = TRUE;
07276                 ObjChangeParam ObjChange(OBJCHANGE_STARTING,cFlags,NULL,this);
07277                 ok = pNodeBlend->AllowOp(&ObjChange);
07278 
07279                 // invalidate the blend's region
07280                 if (ok) ok = DoInvalidateNodeRegion(pNodeBlend,TRUE,FALSE);
07281                 if (ok) ok = (InvalidateBoundsAction::Init(this,&UndoActions,pNodeBlend,TRUE) != AC_FAIL);
07282 
07283                 // change the blend in an undoable way
07284                 if (ok) ok = ChangeBlendAction::Init(this,&UndoActions,pNodeBlend,pChangeParam,&pAction) != AC_FAIL;
07285 
07286                 if (ok && pChangeParam->ChangeType == CHANGEBLEND_TANGENTIAL)
07287                 {
07288                     ok = pNodeBlend->TransformBlendEndObjects(this);
07289                     // invalidate the blend's region again after transfrom
07290                     if (ok) ok = DoInvalidateNodeRegion(pNodeBlend,TRUE,FALSE);
07291                     if (ok) ok = (InvalidateBoundsAction::Init(this,&UndoActions,pNodeBlend,TRUE) != AC_FAIL);
07292                 }
07293             }
07294             
07295         }
07296     }
07297 
07298     // de-allocate the contents of NodeList.
07299     NodeList.DeleteAll();
07300 
07301     if (ok) 
07302     {
07303         // Inform the effected parents of the change
07304         ObjChangeFlags cFlags;
07305         ObjChangeParam ObjChange(OBJCHANGE_FINISHED,cFlags,NULL,this);
07306         UpdateChangedNodes(&ObjChange);
07307 
07308         // Note the way the selected blends were changed
07309         ChangeType = pChangeParam->ChangeType;
07310     }
07311     else
07312         FailAndExecute();
07313 
07314     End();
07315 }

ChangeBlendType OpChangeBlend::GetChangeType  )  [inline]
 

Definition at line 822 of file blndtool.h.

00822 { return (ChangeType); }    // required for undo/redo

void OpChangeBlend::GetOpName String_256 OpName  )  [virtual]
 

The GetOpName fn is overridden so that we return back a description appropriate to the type of attribute that the operation applies.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/12/94
Parameters:
- [INPUTS]
The undo string for the operation [OUTPUTS]
Returns:

Errors: -

See also:
-

Reimplemented from Operation.

Definition at line 7411 of file blndtool.cpp.

07412 { 
07413     UINT32 IDS = _R(IDS_MARKN_EMPTY);
07414 
07415     switch (ChangeType)
07416     {
07417         case CHANGEBLEND_ONETOONE:          IDS = _R(IDS_ONETOONE_UNDO);        break;
07418         case CHANGEBLEND_ANTIALIAS:         IDS = _R(IDS_BLENDANTIALIAS_UNDO);  break;
07419         case CHANGEBLEND_COLOURBLENDTYPE:   IDS = _R(IDS_COLOURBLENDTYPE_UNDO); break;
07420         case CHANGEBLEND_TANGENTIAL:        IDS = _R(IDS_TANGENTIAL_UNDO);      break;
07421         case CHANGEBLEND_OBJECTPROFILE:     IDS = _R(IDS_POSITIONPROFILE_UNDO); break;
07422         case CHANGEBLEND_ATTRPROFILE:       IDS = _R(IDS_ATTRPROFILE_UNDO);     break;
07423         default: ERROR3_PF(("Unknown flag type (%d)",ChangeType));  break;
07424     }
07425 
07426     *OpName = String_256(IDS);
07427 }  

OpState OpChangeBlend::GetState String_256 Description,
OpDescriptor
[static]
 

Find out the state of the operation at the specific time.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/12/94
Parameters:
Description - GetState fills this string with an approriate description [OUTPUTS] of the current state of the operation
Returns:
The state of the operation, so that menu items (ticks and greying) can be done properly

Reimplemented in OpBlendOneToOne, OpBlendAntialias, and OpBlendTangential.

Definition at line 7357 of file blndtool.cpp.

07358 {
07359     OpState State(FALSE,TRUE); // It's not ticked, but it is greyed by default
07360     
07361     // DMc - to test for bevels & contours
07362     // are there any contour nodes in the selection
07363     List NodeList;
07364     BevelTools::BuildListOfSelectedNodes(&NodeList, CC_RUNTIME_CLASS(NodeBlend));
07365 
07366     if (!NodeList.IsEmpty())
07367     {
07368         State.Greyed = FALSE;
07369     }
07370 
07371     NodeList.DeleteAll();   
07372 
07373     // DY awful hack to allow us to call this op from the bezier tool 
07374     // when we wish to edit the path of a blend on a path.
07375     Range * pSel = GetApplication()->FindSelection();
07376 
07377     if (pSel)
07378     {
07379         Node* pNode = pSel->FindFirst();
07380         if (pNode->IS_KIND_OF(NodeBlendPath))
07381         {
07382             State.Greyed = FALSE;
07383         }
07384     }
07385 
07386     if (State.Greyed)
07387         *Description = String_256(_R(IDS_REMOVEBLEND_GREYED));
07388     else
07389         *Description = String_256(_R(IDS_BLENDSTEPS));
07390 
07391     return State;
07392 
07393 }


Member Data Documentation

ChangeBlendType OpChangeBlend::ChangeType [private]
 

Definition at line 825 of file blndtool.h.


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