All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OP3D_SelectionManager Class Reference

#include <OP3D_SelectionManager.h>

+ Inheritance diagram for OP3D_SelectionManager:

Public Member Functions

 OP3D_SelectionManager ()
 ~OP3D_SelectionManager ()
OP3D_SelectionCacheHandle getUserSelectionCache (ComponentScopeKey scope)
OP3D_SelectionCacheHandle getOrCreateUserSelectionCache (ComponentScopeKey scope)
int64 getUserSelectionCacheTotalMem () const
 Return the total memory used by the user selection caches in bytes. More...
int64 reduceUserSelectionCacheMem (int64 amount)
void setSopSelectionStashed (bool v)
 Flag enabled when geometry selection is set by the select state. More...
bool getSopSelectionStashed ()
void setObjSelection (const UT_IntArray &nodes)
 Node IDs of most recent object selection. More...
void getObjSelection (UT_IntArray &nodes)
 ComponentScopeKey ()
bool isValid () const
bool operator== (const ComponentScopeKey &src) const
bool operator!= (const ComponentScopeKey &src) const
bool save (UT_JSONWriter &w) const
bool load (UT_JSONParser &p)

Static Public Member Functions

static ComponentScopeKey getComponentSelectionScope (OP_Node *node)
static ComponentScopeKey getComponentSelectionScopeOfChildren (OP_Node *node)
static bool isObject (const ComponentScopeKey &scope)


class OP3D_SelectionManager

Additional Inherited Members

- Protected Member Functions inherited from UT_NonCopyableNS::UT_NonCopyable
 UT_NonCopyable ()=default
 ~UT_NonCopyable ()=default
 UT_NonCopyable (const UT_NonCopyable &)=delete
UT_NonCopyableoperator= (const UT_NonCopyable &)=delete

Detailed Description

Definition at line 34 of file OP3D_SelectionManager.h.

Constructor & Destructor Documentation

OP3D_SelectionManager::OP3D_SelectionManager ( )
OP3D_SelectionManager::~OP3D_SelectionManager ( )

Member Function Documentation

OP3D_SelectionManager::ComponentScopeKey ( )

Definition at line 108 of file OP3D_SelectionManager.h.

static ComponentScopeKey OP3D_SelectionManager::getComponentSelectionScope ( OP_Node node)
static ComponentScopeKey OP3D_SelectionManager::getComponentSelectionScopeOfChildren ( OP_Node node)
void OP3D_SelectionManager::getObjSelection ( UT_IntArray nodes)
OP3D_SelectionCacheHandle OP3D_SelectionManager::getOrCreateUserSelectionCache ( ComponentScopeKey  scope)
bool OP3D_SelectionManager::getSopSelectionStashed ( )
OP3D_SelectionCacheHandle OP3D_SelectionManager::getUserSelectionCache ( ComponentScopeKey  scope)

Component selectors (OP3D_InputSelector) can be divided into two categories based on the lifetime of the temporary selections they 1. Selectors that save their temporary selections on exit. These selections persist until they are consumed (either by the next selector or by a state explicitly consuming them to perform an operation) or explicitly cleared.

  1. Selectors with completely local temporary selections. These selections cease to exist with the selectors that created them and generally do not intefere with any other selections (saved or live).

Component selectors of the second type cannot interfere with any other selector, but selectors of the first type, by far the more common, require careful synchronization and storage when multiple instances are active simultaneously (each, of course, in a different viewer) or for successive instances to pass selections between them. We choose to use an independent selection manager (and hence set of caches) for each viewer, sidestepping the first issue entirely. To address the passing of selections from one selector to the next, we implement a set of caches.

The first simplifying decision we make for selectors that save their temporary selections on exit is to distinguish these saved selections by the network (abstracted to a ComponentScopeKey) at which they are made. Selections made at /obj/A will generally not intefere with ones made at /obj/B, even if the selectors allow selecting from other objects (and connecting them with Object Merge SOPs). This is made possible by each OP3D_SelectionCache being able to store selections for nodes external to that scope.

int64 OP3D_SelectionManager::getUserSelectionCacheTotalMem ( ) const

Return the total memory used by the user selection caches in bytes.

static bool OP3D_SelectionManager::isObject ( const ComponentScopeKey scope)
bool OP3D_SelectionManager::isValid ( ) const

Definition at line 112 of file OP3D_SelectionManager.h.

bool OP3D_SelectionManager::load ( UT_JSONParser p)

Definition at line 115 of file OP3D_SelectionManager.h.

bool OP3D_SelectionManager::operator== ( const ComponentScopeKey src) const

Definition at line 113 of file OP3D_SelectionManager.h.

int64 OP3D_SelectionManager::reduceUserSelectionCacheMem ( int64  amount)

Attempt to reduce the memory used by the user selection caches by a specified amount, returning the actual number of bytes freed.

bool OP3D_SelectionManager::save ( UT_JSONWriter w) const
void OP3D_SelectionManager::setObjSelection ( const UT_IntArray nodes)

Node IDs of most recent object selection.

void OP3D_SelectionManager::setSopSelectionStashed ( bool  v)

Flag enabled when geometry selection is set by the select state.

Friends And Related Function Documentation

Definition at line 127 of file OP3D_SelectionManager.h.

The documentation for this class was generated from the following file: