HDK
|
#include <OP3D_SelectionManager.h>
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) |
Friends | |
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_NonCopyable & | operator= (const UT_NonCopyable &)=delete |
Definition at line 34 of file OP3D_SelectionManager.h.
OP3D_SelectionManager::OP3D_SelectionManager | ( | ) |
OP3D_SelectionManager::~OP3D_SelectionManager | ( | ) |
|
inline |
Definition at line 108 of file OP3D_SelectionManager.h.
|
static |
|
static |
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.
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 |
|
inline |
Definition at line 112 of file OP3D_SelectionManager.h.
bool OP3D_SelectionManager::load | ( | UT_JSONParser & | p | ) |
|
inline |
Definition at line 115 of file OP3D_SelectionManager.h.
|
inline |
Definition at line 113 of file OP3D_SelectionManager.h.
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.
|
friend |
Definition at line 127 of file OP3D_SelectionManager.h.