ops.cpp File Reference

(r1785/r1361)

#include "camtypes.h"
#include "ophist.h"

Go to the source code of this file.

Functions

 DECLARE_SOURCE ("$Revision: 1361 $")
 CC_IMPLEMENT_MEMDUMP (ActionList, List) CC_IMPLEMENT_DYNAMIC(OpParam
CCObject CC_IMPLEMENT_DYNCREATE (Operation, MessageHandler) CC_IMPLEMENT_DYNCREATE(Action
CCObject ListItem CC_IMPLEMENT_DYNCREATE (InvalidateRegionAction, Action) CC_IMPLEMENT_DYNCREATE(InvalidateRegionIfBgRedrawAction
CCObject ListItem InvalidateRegionAction CC_IMPLEMENT_DYNCREATE (HideNodeAction, Action) CC_IMPLEMENT_DYNCREATE(ShowNodeAction
CCObject ListItem InvalidateRegionAction
Action 
CC_IMPLEMENT_DYNCREATE (RestoreSelectionsAction, Action) CC_IMPLEMENT_DYNCREATE(SelectDeselectAction
CCObject ListItem InvalidateRegionAction
Action Action 
CC_IMPLEMENT_DYNCREATE (TransformNodeAction, Action) CC_IMPLEMENT_DYNCREATE(UnApplyAction
CCObject ListItem InvalidateRegionAction
Action Action Action 
CC_IMPLEMENT_DYNCREATE (ApplyAction, Action) ActionList
 ActionList constructor.
ActionCode ExtremeTerror (CCRuntimeClass *AttrToHide, Node *pNode, Operation *pOp, ActionList *pOppositeActLst, BOOL TellSubtree, BOOL IncludeSubtreeSize)

Variables

static DocViewpDraggingDocView = 0


Function Documentation

CCObject ListItem InvalidateRegionAction Action Action Action CC_IMPLEMENT_DYNCREATE ApplyAction  ,
Action 
 

ActionList constructor.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/7/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 175 of file ops.cpp.

00190           :     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00191     Created:    6/7/93
00192     Inputs:     -
00193     Outputs:    -
00194     Returns:    -
00195     Purpose:    ActionList constructor
00196     Errors:     -
00197     SeeAlso:    -
00198 
00199 ********************************************************************************************/
00200 
00201 ActionList::ActionList(): List(){}    

CCObject ListItem InvalidateRegionAction Action Action CC_IMPLEMENT_DYNCREATE TransformNodeAction  ,
Action 
 

CCObject ListItem InvalidateRegionAction Action CC_IMPLEMENT_DYNCREATE RestoreSelectionsAction  ,
Action 
 

CCObject ListItem InvalidateRegionAction CC_IMPLEMENT_DYNCREATE HideNodeAction  ,
Action 
 

CCObject ListItem CC_IMPLEMENT_DYNCREATE InvalidateRegionAction  ,
Action 
 

CCObject CC_IMPLEMENT_DYNCREATE Operation  ,
MessageHandler 
 

CC_IMPLEMENT_MEMDUMP ActionList  ,
List 
 

DECLARE_SOURCE "$Revision: 1361 $"   ) 
 

ActionCode ExtremeTerror CCRuntimeClass AttrToHide,
Node pNode,
Operation pOp,
ActionList pOppositeActLst,
BOOL  TellSubtree,
BOOL  IncludeSubtreeSize
 

Definition at line 3081 of file ops.cpp.

03087 {
03088     ShowNodeAction* ShwNodeAct;  
03089     ActionCode ActCode = AC_OK;  
03090 
03091     // Search pNode's subtree, to hide all attributes of AttrToHide type
03092     Node* pSearchNode = pNode->FindFirstDepthFirst();
03093     Node* pNext;
03094     while (pSearchNode)
03095     {
03096         pNext = pSearchNode->FindNextDepthFirst(pNode);
03097 
03098         if (pSearchNode->IsAnAttribute())
03099         {
03100             if (pSearchNode->GetRuntimeClass() == AttrToHide)
03101             {
03102                 Node* pAttrParent = pSearchNode->FindParent();
03103                 ERROR3IF(!pAttrParent, "Attribute has no parent");
03104 //              if (pAttrParent && (!pAttrParent->DiscardsAttributeChildren()))
03105                 if (pAttrParent)
03106                 {
03107                     if (pAttrParent->DiscardsAttributeChildren())
03108                     {
03109                         pSearchNode->CascadeDelete();
03110                         delete pSearchNode;
03111                     }
03112                     else
03113                     {
03114                         // Tell the node it's subtree, we are about to hide it
03115                         if (TellSubtree)
03116                         {
03117                             if (!pSearchNode->HidingNode())
03118                                 return AC_FAIL;
03119                         }
03120 
03121                         // The bounding rect of the parents to the node may well be changing
03122                         if (pSearchNode->GetRuntimeClass() == CC_RUNTIME_CLASS(AttrLineWidth))
03123                         {
03124                             // If the node being hidden is an attribute which will effect the bounds of it's parent
03125                             // bounded object then we must invalidatate the parents bounds
03126                             Node* Parent = pSearchNode->FindParent(); 
03127                             if (Parent != NULL)
03128                             {
03129                                 if(Parent->IsKindOf(CC_RUNTIME_CLASS(NodeRenderableBounded)))
03130                                 { 
03131                                     ((NodeRenderableBounded*)Parent)->InvalidateBoundingRect();     
03132                                 }
03133                             }
03134                         }                 
03135             
03136                         // Attempt to hide the node 
03137 
03138                         NodeHidden* HideNode; 
03139                         ALLOC_WITH_FAIL(HideNode, new NodeHidden(pSearchNode),pOp); 
03140 
03141                         if (HideNode == NULL)
03142                         {
03143                             // We were unable to hide the node so fail 
03144                             return AC_FAIL;         
03145                         }
03146 
03147                         // Attempt to initialise the show node action which will show the node that 
03148                         // we have just hidden. 
03149                         if ((ActCode = ShowNodeAction::Init(pOp,                    
03150                                                             pOppositeActLst,  
03151                                                             HideNode, 
03152                                                             IncludeSubtreeSize, 
03153                                                             ( Action**)(&ShwNodeAct),
03154                                                             TellSubtree)) == AC_FAIL) 
03155                         { 
03156                             // Show the node 
03157                             HideNode->ShowNode();                   
03158                         }   
03159                     
03160                         if (ActCode == AC_FAIL)
03161                             return AC_FAIL;
03162                     }
03163                 }
03164 
03165             }
03166         }
03167         pSearchNode = pNext;
03168     }
03169           
03170     return (ActCode);                        
03171 }


Variable Documentation

DocView* pDraggingDocView = 0 [static]
 

Definition at line 448 of file ops.cpp.


Generated on Sat Nov 10 03:49:18 2007 for Camelot by  doxygen 1.4.4