#include <ngscan.h>
Inheritance diagram for BaseSelectScan:
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. |
Definition at line 124 of file ngscan.h.
|
Definition at line 127 of file ngscan.h. 00127 { TOGGLE = -1, DESELECT, SELECT, SELECT_EXCLUSIVE };
|
|
|
|
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.
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 }
|
|
Helper function for BaseSelectScan derivatives that change the selection state of renderable nodes.
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 }
|
|
Called by BaseSelectScan after the selection is changed. Updates the application's selection range object.
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 }
|
|
Clears the selection first if the new state isn't "toggle" and the gallery ctrl-key isn't down.
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 }
|
|
|
|
|
|
|