OpChangeContourWidth Class Reference

Forces a regeneration of the bevel in all nodes in the list Used by NodeBevelcontroller::OnChildChange to force redraws in undos/redos. More...

#include <opcntr.h>

Inheritance diagram for OpChangeContourWidth:

UndoableOperation Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 OpChangeContourWidth ()
 Constructor.
 ~OpChangeContourWidth ()
 Destructor.
virtual void Do (OpDescriptor *pOpDesc)
 The do function. Applys a Bevel to the selection in the current document.
virtual void DoWithParam (OpDescriptor *pOp, OpParam *pParam)
 Applys a Bevel to the selected node after a mouse click.
void GetOpName (String_256 *pOpName)
 Returns the name of this op.
virtual BOOL MayChangeNodeBounds () const

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 new regular shape at the specific time.

Detailed Description

Forces a regeneration of the bevel in all nodes in the list Used by NodeBevelcontroller::OnChildChange to force redraws in undos/redos.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/3/99

Definition at line 256 of file opcntr.h.


Constructor & Destructor Documentation

OpChangeContourWidth::OpChangeContourWidth  ) 
 

Constructor.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99

Definition at line 1266 of file opcntr.cpp.

01267 {
01268     //TRACEUSER( "MarkH", _T("Just Made a OpChangeContourWidth Class!\n"));
01269 }

OpChangeContourWidth::~OpChangeContourWidth  ) 
 

Destructor.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99

Definition at line 1280 of file opcntr.cpp.

01281 {
01282     //TRACEUSER( "MarkH", _T("Just Killed OpChangeContourWidth Class!!!\n"));
01283 }


Member Function Documentation

BOOL OpChangeContourWidth::Declare  )  [static]
 

Adds the operation to the list of all known operations.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/11/94
Returns:
TRUE if all went OK, False otherwise

Definition at line 1427 of file opcntr.cpp.

01428 {
01429     return (RegisterOpDescriptor(
01430                                 0, 
01431                                 _R(IDS_CHANGECONTOURWIDTHOP),
01432                                 CC_RUNTIME_CLASS(OpChangeContourWidth), 
01433                                 OPTOKEN_CHANGECONTOURWIDTH,
01434                                 OpChangeContourWidth::GetState));
01435 
01436 }

void OpChangeContourWidth::Do OpDescriptor pOpDesc  )  [virtual]
 

The do function. Applys a Bevel to the selection in the current document.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99
Parameters:
pOpDesc - OpDescriptor - unused [INPUTS]
- [OUTPUTS]
Returns:
-

Reimplemented from Operation.

Definition at line 1297 of file opcntr.cpp.

01298 {
01299     End();
01300 }

void OpChangeContourWidth::DoWithParam OpDescriptor pOp,
OpParam pParam
[virtual]
 

Applys a Bevel to the selected node after a mouse click.

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

Reimplemented from Operation.

Definition at line 1314 of file opcntr.cpp.

01315 {
01316     // first, begin the operation
01317     ObjChangeFlags cFlags;
01318     ObjChangeParam ObjChange(OBJCHANGE_STARTING,cFlags,NULL,this);
01319 
01320     String_64 StatusString;
01321     StatusString.Load(_R(IDS_CONTOUR_CREATE_STATUS_STRING));
01322 
01323     BeginSlowJob(-1, TRUE, &StatusString);
01324 
01325     ChangeContourWidthParam * pCCW = (ChangeContourWidthParam *)pParam;
01326 
01327     // fire off an action
01328     ChangeContourWidthAction * pAction = NULL;
01329 
01330     if (ChangeContourWidthAction::Init(this, this->GetUndoActionList(), pCCW->m_pNodes, pCCW->m_Width,
01331         pCCW->m_bKeepDirection, &pAction) != AC_OK)
01332     {
01333         FailAndExecute();
01334         return;
01335     }
01336 
01337     // do the child change messages
01338     NodeListItem * pItem = (NodeListItem *)pCCW->m_pNodes->GetHead();
01339 
01340     Node * pNode = NULL;
01341 
01342     ObjChangeFlags flgs(FALSE, FALSE, FALSE, TRUE);
01343     Node * pContourNode = NULL;
01344     Node * pInsertNode  = NULL;
01345 
01346     BOOL ok = TRUE;
01347 
01348     while (pItem)
01349     {
01350         // move all contour nodes in the list appropriately
01351         if (!pCCW->m_bKeepDirection)
01352         {
01353             pContourNode = pItem->pNode->FindFirstChild(CC_RUNTIME_CLASS(NodeContour));
01354 
01355             if (pContourNode)
01356                 pContourNode->AllowOp(&ObjChange);
01357 
01358             if (pCCW->m_Width < 0)
01359             {
01360                 // outer contour nodes come before the nodes they are contouring
01361                 
01362                 pInsertNode = pItem->pNode->FindFirstChild(CC_RUNTIME_CLASS(NodeRenderableInk));
01363                 
01364                 if (pInsertNode != pContourNode)
01365                 {
01366                     if (ok)
01367                         ok = DoMoveNode(pContourNode, pInsertNode, PREV);
01368                 }
01369             }
01370             else
01371             {
01372                 // inner contour nodes come after the nodes they are contouring
01373                 
01374                 pInsertNode = pItem->pNode->FindLastChild(CC_RUNTIME_CLASS(NodeRenderableInk));
01375                 
01376                 if (pInsertNode != pContourNode)
01377                 {
01378                     if (ok)
01379                         ok = DoMoveNode(pContourNode, pInsertNode, NEXT);
01380                 }
01381             }
01382         }
01383             
01384         pNode = pItem->pNode->FindParent();
01385 
01386         // Ilan 7/5/00
01387         // Inform geom linked attrs of the change. Nb outside the normal AllowOp mechanism
01388         NodeAttribute* pNA = pItem->pNode->FindFirstGeometryLinkedAttr();
01389         while(pNA)
01390         {
01391             pNA->LinkedNodeGeometryHasChanged(this);
01392             pNA = pNA->FindNextGeometryLinkedAttr();
01393         }
01394 
01395         while (pNode)
01396         {
01397             //ObjChangeParam OP(OBJCHANGE_FINISHED, flgs, pNode, this, OBJCHANGE_CALLEDBYOP);
01398 
01399             if (pNode->IsAnObject())
01400             {
01401                 //pNode->OnChildChange(&OP);
01402                 pNode->AllowOp(&ObjChange);
01403             }
01404 
01405             pNode = pNode->FindParent();
01406         }
01407 
01408         pItem = (NodeListItem *)pCCW->m_pNodes->GetNext(pItem);
01409     }
01410 
01411     ObjChange.Define(OBJCHANGE_FINISHED,cFlags,NULL,this);
01412     UpdateChangedNodes(&ObjChange, Document::GetSelectedSpread());
01413 
01414     End();
01415 }

void OpChangeContourWidth::GetOpName String_256 pName  )  [virtual]
 

Returns the name of this op.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/11/99
Parameters:
- [OUTPUTS]
Returns:
The name of the op

Reimplemented from Operation.

Definition at line 1469 of file opcntr.cpp.

01470 {
01471     if (pName)
01472         pName->Load(_R(IDS_CHANGECONTOURWIDTHOPNAME));
01473 }

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

Find out the state of the new regular shape at the specific time.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/11/94
Parameters:
- [OUTPUTS]
Returns:
Ungreyed, Unticked

Definition at line 1451 of file opcntr.cpp.

01452 {
01453     OpState Blobby;
01454     
01455     return Blobby;
01456 }

virtual BOOL OpChangeContourWidth::MayChangeNodeBounds  )  const [inline, virtual]
 

Reimplemented from UndoableOperation.

Definition at line 276 of file opcntr.h.

00276 { return TRUE; }


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