BaseSelectScan Class Reference

Base class for scans which select objects which are in the SGNameItem sets. More...

#include <ngscan.h>

Inheritance diagram for BaseSelectScan:

NodeScan SelectScan SelectUnionScan SelectIntersectScan List of all members.

Public Types

enum  Change { TOGGLE = -1, DESELECT, SELECT, SELECT_EXCLUSIVE }

Public Member Functions

 BaseSelectScan (Change eChange, BOOL fQuiet=FALSE)

Protected Member Functions

virtual BOOL OnSelectable (NodeRenderable *pRender)
 Helper function for BaseSelectScan derivatives that change the selection state of renderable nodes.

Protected Attributes

Change m_eChange
BOOL m_fShout
INT32 m_nAffected

Private Member Functions

virtual BOOL Pre ()
 Clears the selection first if the new state isn't "toggle" and the gallery ctrl-key isn't down.
virtual BOOL Do (Node *)
 Called by SelectScan when the 'select' action is executed. Tests the given node for membership of each highlighted set and changes it's selection status accordingly.
virtual BOOL Post ()
 Called by BaseSelectScan after the selection is changed. Updates the application's selection range object.

Detailed Description

Base class for scans which select objects which are in the SGNameItem sets.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/5/99
See also:
SelectScan; SelectUnionScan; SelectIntersectScan

Definition at line 124 of file ngscan.h.


Member Enumeration Documentation

enum BaseSelectScan::Change
 

Enumerator:
TOGGLE 
DESELECT 
SELECT 
SELECT_EXCLUSIVE 

Definition at line 127 of file ngscan.h.


Constructor & Destructor Documentation

BaseSelectScan::BaseSelectScan Change  eChange,
BOOL  fQuiet = FALSE
 


Member Function Documentation

BOOL BaseSelectScan::Do Node pNode  )  [private, virtual]
 

Called by SelectScan when the 'select' action is executed. Tests the given node for membership of each highlighted set and changes it's selection status accordingly.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/5/99
Parameters:
pNode --- the current node in the scan [INPUTS]
Returns:
TRUE, continue scanning.
See also:
BaseSelectScan

Implements NodeScan.

Definition at line 274 of file ngscan.cpp.

00275 {
00276     // Let OnSelectable() control the continuation of the scan.
00277     return pNode->IsNodeRenderableClass() ? OnSelectable((NodeRenderable*) pNode) : TRUE;
00278 }

BOOL BaseSelectScan::OnSelectable NodeRenderable pRender  )  [protected, virtual]
 

Helper function for BaseSelectScan derivatives that change the selection state of renderable nodes.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/5/99
Parameters:
pRender --- the object whose selection state is to be changed [INPUTS]
Returns:
The previous selection state of the object.
pLayer->IsVisible() ||

Reimplemented in SelectScan, SelectUnionScan, and SelectIntersectScan.

Definition at line 190 of file ngscan.cpp.

00191 {
00192     // Check for the effects of the layer containing the object.
00193     Node* pNode = pRender;
00194     while (pNode != 0)
00195     {
00196         if (pNode->IsLayer())
00197         {
00198             // Quit now if the layer is invisible or locked.
00199             Layer* pLayer = (Layer*) pNode;
00200             if ( pLayer->IsLocked()) return FALSE;
00201             break;
00202         }
00203 
00204         pNode = pNode->FindParent();
00205     }
00206 
00207     // Perform the selection change.
00208     BOOL fPrevSel = pRender->IsSelected();
00209     switch (m_eChange)
00210     {
00211     case TOGGLE:
00212         if (fPrevSel)
00213             pRender->DeSelect(m_fShout);
00214         else
00215             pRender->Select(m_fShout);
00216         break;
00217 
00218     case DESELECT:
00219         pRender->DeSelect(m_fShout);
00220         break;
00221 
00222     default:
00223         pRender->Select(m_fShout);
00224         break;
00225     }
00226 
00227     // Keep count of how many we've changed.
00228     ++m_nAffected;
00229     return fPrevSel;
00230 }

BOOL BaseSelectScan::Post  )  [private, virtual]
 

Called by BaseSelectScan after the selection is changed. Updates the application's selection range object.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/5/99
See also:
NodeScan

Reimplemented from NodeScan.

Definition at line 292 of file ngscan.cpp.

00293 {
00294     if (m_nAffected != 0) GetApplication()->FindSelection()->Update(m_fShout);
00295     return TRUE;
00296 }

BOOL BaseSelectScan::Pre  )  [private, virtual]
 

Clears the selection first if the new state isn't "toggle" and the gallery ctrl-key isn't down.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/5/99
Parameters:
pNode --- the current node in the scan [INPUTS]
Returns:
TRUE, continue scanning.
See also:
NodeScan

Reimplemented from NodeScan.

Definition at line 246 of file ngscan.cpp.

00247 {
00248     // If selecting exclusively then clear the selection of all objects first and count
00249     // them towards a call to Update().
00250     if (m_eChange == SELECT_EXCLUSIVE)
00251     {
00252         m_nAffected += (INT32) GetApplication()->FindSelection()->Count();
00253         NodeRenderableInk::DeselectAll(m_fShout, FALSE);
00254     }
00255 
00256     return TRUE;
00257 }


Member Data Documentation

Change BaseSelectScan::m_eChange [protected]
 

Definition at line 133 of file ngscan.h.

BOOL BaseSelectScan::m_fShout [protected]
 

Definition at line 134 of file ngscan.h.

INT32 BaseSelectScan::m_nAffected [protected]
 

Definition at line 135 of file ngscan.h.


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