InvalidateRegionAction Class Reference

When executed this action will Force a redraw of the bounding rectangles of each node in a range. More...

#include <ops.h>

Inheritance diagram for InvalidateRegionAction:

Action ListItem CCObject SimpleCCObject InvalidateRegionIfBgRedrawAction List of all members.

Public Member Functions

 InvalidateRegionAction ()
 InvalidateRegionAction constructor.
virtual ActionCode Execute ()
 Executes the InvalidateRegionAction which invalidates a region which is the union of the bounding rectangles of each node in the range. When the includeBlobs flag is TRUE the region which gets invalidated includes the objects blobs.

Static Public Member Functions

static ActionCode Init (Operation *const pOp, ActionList *pActionList, Range nodeRange, Spread *pSpread, BOOL includeBlobs, Action **NewAction)
 To check that there is sufficient room for the action in the operation history, and if there is, then to add the action to the operations action list.

Protected Attributes

Range NodeRange
BOOL IncludeBlobs:1
SpreadpSpread

Detailed Description

When executed this action will Force a redraw of the bounding rectangles of each node in a range.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/9/93
See also:
-

Definition at line 763 of file ops.h.


Constructor & Destructor Documentation

InvalidateRegionAction::InvalidateRegionAction  ) 
 

InvalidateRegionAction constructor.

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

Errors: -

See also:
-

Definition at line 2742 of file ops.cpp.

02743 {
02744 } 


Member Function Documentation

ActionCode InvalidateRegionAction::Execute  )  [virtual]
 

Executes the InvalidateRegionAction which invalidates a region which is the union of the bounding rectangles of each node in the range. When the includeBlobs flag is TRUE the region which gets invalidated includes the objects blobs.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/8/93
Parameters:
- [INPUTS]
ActionCode indicating if the action was successfully executed or not [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from Action.

Reimplemented in InvalidateRegionIfBgRedrawAction.

Definition at line 2766 of file ops.cpp.

02767 {
02768     InvalidateRegionAction* InvRgnAct;  
02769     ActionCode ActCode;  
02770     // Attempt to initialise the action    
02771     if ((ActCode = InvalidateRegionAction::Init(pOperation,                    
02772                                                 pOppositeActLst,  
02773                                                 NodeRange,
02774                                                 pSpread, 
02775                                                 IncludeBlobs, 
02776                                                 (Action**)(&InvRgnAct))) != AC_FAIL) 
02777         
02778                 
02779     {   
02780         // The action was successfully initialised   
02781 
02782         // Invalidate each nodes bounds 
02783     
02784         Document* pDocument = pOperation->GetWorkingDoc();
02785         ENSURE(pDocument != 0, "There was no current document in InvalidateRegionAction" );
02786         
02787         if (pDocument != NULL)
02788         {
02789             BOOL bOldPTP = NodeRange.SetPromoteToParent(TRUE);
02790             NodeRenderableInk* CurrentNode = (NodeRenderableInk*)NodeRange.FindFirst();
02791 
02792             DocRect InvalidRgn; 
02793         
02794             while (CurrentNode != NULL)
02795             {
02796                 if (CurrentNode->IsAnObject() || CurrentNode->IsPaper())
02797                 {
02798                     // Find the region to invalidate
02799                     InvalidRgn = (IncludeBlobs ? 
02800                                     (((NodeRenderableInk*)CurrentNode)->GetUnionBlobBoundingRect()):
02801                                     (((NodeRenderableInk*)CurrentNode)->GetBoundingRect())
02802                                  ); 
02803 
02804                     pDocument->ForceRedraw(pSpread, InvalidRgn, TRUE, CurrentNode);
02805                 }
02806                 CurrentNode = (NodeRenderableInk*)NodeRange.FindNext(CurrentNode); 
02807             }
02808 
02809             NodeRange.SetPromoteToParent(bOldPTP);
02810         }
02811 
02812     }
02813     return ActCode;
02814 }   

ActionCode InvalidateRegionAction::Init Operation *const   pOp,
ActionList pActionList,
Range  nodeRange,
Spread pSpread,
BOOL  includeBlobs,
Action **  NewAction
[static]
 

To check that there is sufficient room for the action in the operation history, and if there is, then to add the action to the operations action list.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/9/93
Parameters:
pOp,: The operation to which the action should be added [INPUTS]
pActionList: The action list in the operation object

NodeRange: The range of nodes to be invalidated

pSpread: The ranges spread

IncludeBlobs: When TRUE invalidate the blob bounding rectangles of the nodes in the range.

Parameters:
NewAction,: A pointer to the action if it could be allocated. [OUTPUTS]
Returns:
AC_FAIL: There was not enough room in the operation history for the action and the user did not wish to continue. Usually End() should be called in this situation.
AC_NORECORD: There was not enough room in the operation history for the action, but the user requested that he wished to continue without undo.

AC_OK : The action was successfully initialised and added to the operation.

The function calls the Action::Init function passing the runtime class of an InvalidateRegionAction. If successful it records the NodeTag.

Returns:
Errors: -
See also:
Action::Init

Reimplemented in InvalidateRegionIfBgRedrawAction.

Definition at line 2865 of file ops.cpp.

02871 {       
02872     ActionCode Ac = (Action::Init(pOp,
02873                                   pActionList,
02874                                   sizeof(InvalidateRegionAction), 
02875                                   CC_RUNTIME_CLASS(InvalidateRegionAction), 
02876                                   NewAction));
02877     if (*NewAction != NULL)
02878     {
02879         ((InvalidateRegionAction*)(*NewAction))->NodeRange = nodeRange;
02880         ((InvalidateRegionAction*)(*NewAction))->IncludeBlobs = includeBlobs;
02881         ((InvalidateRegionAction*)(*NewAction))->pSpread = pSpread; 
02882     }
02883     return (Ac); 
02884 } 


Member Data Documentation

BOOL InvalidateRegionAction::IncludeBlobs [protected]
 

Definition at line 779 of file ops.h.

Range InvalidateRegionAction::NodeRange [protected]
 

Definition at line 778 of file ops.h.

Spread* InvalidateRegionAction::pSpread [protected]
 

Definition at line 780 of file ops.h.


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