VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes
makVrv::DtSelectionManager Class Reference

The master window of the scene.

Inheritance diagram for makVrv::DtSelectionManager:
Inheritance graph
[legend]

Public Types

enum  SelectionMode { SelectionModeAll = 0, SelectionModeEntities = 1, SelectionModeTerrain = 2 }
 
enum  SelectionType {
  NoValidSelection, Entity, Prop, BuoyOrBeacon,
  Terrain, Aggregate, Observer, ControlObject,
  OverlayObject, Intervisibility, Feature, Mixed
}
 
enum  SelectionOperation {
  NoOperation = 0, AddToSelection, RemoveFromSelection, MultipleSelection,
  SetSelection, ClearSelection, MaintainSelectionIfSelected
}
 
typedef std::set< DtUniqueIDIdSet
 

Public Member Functions

virtual ~DtSelectionManager ()
 
virtual void performSelectionOperation (SelectionOperation op, const IdSet &ids)
 
virtual void setCurrentSelections (const IdSet &selections)
 
virtual void setCurrentHovered (const DtUniqueID &sceneObjId, bool hovered)
 
virtual const
DtSelectionManager::IdSet
currentSelections () const
 
virtual void addToCurrentSelection (const IdSet &adds)
 
virtual void maintainCurrentSelectionIfSelected (const IdSet &maintain)
 
virtual void removeFromCurrentSelection (const IdSet &removes)
 
virtual void toggleFromCurrentSelection (const IdSet &toggles)
 
virtual void removeFromCurrentSelection (const DtElementData::UniqueIdList &removes)
 
virtual SelectionMode selectionMode () const
 
virtual void setSelectionMode (SelectionMode mode)
 
virtual bool isSelectable (DtUniqueID id) const
 
virtual bool isSelectable (const DtElementEntry *entry) const
 
virtual bool isSelected (DtUniqueID id) const
 
virtual SelectionType selectionType () const
 
virtual bool propSelectionHasNonReplacedProp ()
 
virtual bool propSelectionMajorityTransparent ()
 
virtual void slot_onElementsRemoved (const DtElementData::UniqueIdList &elementIds)
 
virtual void backupCurrentSelection ()
 
virtual bool restoreCurrentSelection ()
 
virtual bool selectionIsVertex (const IdSet &selection)
 
virtual bool objectIsVertex (const DtUniqueID &id)
 
virtual DtUniqueID parentId (const DtUniqueID &id)
 
virtual bool allItemsWantVertexSelection (const IdSet &) const
 
virtual void addWantsVertexSelection (DtElementEntry::ElementType)
 
virtual void removeWantsVertexSelection (DtElementEntry::ElementType)
 
virtual bool wantsVertexSelection (DtElementID) const
 
virtual void addSelectableObjectType (DtElementEntry::ElementType type, SelectionMode=SelectionModeAll)
 
virtual void removeSelectableObjectType (DtElementEntry::ElementType type, SelectionMode)
 
virtual void removeSelectableObjectTypeFromAllModes (DtElementEntry::ElementType type)
 
virtual bool objectTypeSelectable (DtElementEntry::ElementType type, SelectionMode mode) const
 
virtual bool objectTypeSelectable (DtElementEntry::ObjectType type) const
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 
virtual ~DtVirtualBaseClass ()
 

Static Public Member Functions

static DtSelectionManagerinstance (DtDe &de)
 
static SelectionOperation selectionOperationForMouseEvent (const DtMouseEvent &mouseEvent)
 
static bool typeSupportsMultipleSelection (DtElementEntry::ObjectType type, bool vertexSelectsParent)
 

Public Attributes

boost::signalslib::signal
< void(const DtElementID
&entityId, bool hasMouseCursor)> 
signal_elementHasMouseCursorStateChanged
 
boost::signalslib::signal
< void(const IdSet &selected,
const IdSet &deselected,
SelectionType newType,
SelectionType oldType)> 
signal_currentSelectionChanged
 
boost::signalslib::signal
< void(const DtUniqueID &id,
const DtUniqueID &parentId)> 
signal_vertexSelected
 
boost::signalslib::signal
< void(const DtUniqueID &id,
const DtUniqueID &parentId)> 
signal_vertexDeselected
 
boost::signalslib::signal
< void(const IdSet &entityIds,
bool pinAllLabels)> 
signal_infoLabelsArePinned
 
boost::signalslib::signal
< void(const DtUniqueID &)> 
signal_switchEntitySymbolDecorationQuadrant
 
boost::signalslib::signal
< void(const DtUniqueID
&, const DtColorValue &, bool)> 
signal_entityTrackHistoryColorOverride
 
boost::signalslib::signal< void()> signal_selectionModeChanged
 

Protected Types

typedef std::set
< DtElementEntry::ElementType
WantsVertexSelection
 
typedef std::set
< DtElementEntry::ElementType
ElementTypeSet
 
typedef std::unordered_map
< SelectionMode,
ElementTypeSet
SelectionModeMap
 
typedef std::queue< IdSetIdSetQueue
 

Protected Member Functions

 DtSelectionManager (DtDe &de)
 
virtual void addToCurrentSelection (DtUniqueID id)
 
virtual void removeFromCurrentSelection (DtUniqueID id)
 
virtual void announceCurrentSelectionChanged (const IdSet &selected, const IdSet &deselected, SelectionType oldType)
 
virtual void updateSelectionType ()
 
virtual SelectionType elementSelectionType (DtElementEntry *entry) const
 
virtual void convertVertexIdsToParentIds (const IdSet &in, IdSet &out)
 

Protected Attributes

DtDemyDe
 
IdSet myCurrentSelections
 
SelectionMode mySelectionMode
 
bool myIgnoreSelectionChanges
 
bool myIgnoreSelectionModeChanges
 
SelectionType mySelectionType
 
IdSetQueue myBackupSelections
 
WantsVertexSelection myWantsVertexSelection
 
SelectionModeMap mySelectionModeMap
 
DtSignalConnectionManager mySignals
 

Member Typedef Documentation

typedef std::queue<IdSet> makVrv::DtSelectionManager::IdSetQueue
protected

Member Enumeration Documentation

Enumerator
SelectionModeAll 
SelectionModeEntities 
SelectionModeTerrain 

The nature of the current selection.

Enumerator
NoValidSelection 
Entity 
Prop 
BuoyOrBeacon 
Terrain 
Aggregate 
Observer 
ControlObject 
OverlayObject 
Intervisibility 
Feature 
Mixed 

More than one type of object selected.

Enumerator
NoOperation 
AddToSelection 
RemoveFromSelection 
MultipleSelection 
SetSelection 
ClearSelection 
MaintainSelectionIfSelected 

If item is already selected, maintain the current selection, else act as SetSelection This will only be true if all items are currently selected in the supplied set.

Constructor & Destructor Documentation

virtual makVrv::DtSelectionManager::~DtSelectionManager ( )
virtual

DTOR.

makVrv::DtSelectionManager::DtSelectionManager ( DtDe de)
protected

CTOR.

Member Function Documentation

static DtSelectionManager& makVrv::DtSelectionManager::instance ( DtDe de)
static

Get the selection manager instance.

virtual void makVrv::DtSelectionManager::performSelectionOperation ( SelectionOperation  op,
const IdSet ids 
)
virtual

Utility function for specify the operation using a variable.

Reimplemented in makVrf::DtVrfSelectionManager.

virtual void makVrv::DtSelectionManager::setCurrentSelections ( const IdSet selections)
virtual

set the current selection set

Reimplemented in makVrf::DtVrfSelectionManager.

virtual void makVrv::DtSelectionManager::setCurrentHovered ( const DtUniqueID sceneObjId,
bool  hovered 
)
virtual

Announce whether a widget associated with some scene object is being hovered over with the mouse cursor. This function finds the DtElementID of the scene object from its scene object id and emits signal_elementHasMouseCursorStateChanged(elementId, hovered). This function will do nothing if the element ID cannot be determined.

See Also
DtElementData::elementIdFromSceneObjectId(...)
virtual const DtSelectionManager::IdSet& makVrv::DtSelectionManager::currentSelections ( ) const
virtual

get the current selection set

virtual void makVrv::DtSelectionManager::addToCurrentSelection ( const IdSet adds)
virtual

add to the current selection set

virtual void makVrv::DtSelectionManager::maintainCurrentSelectionIfSelected ( const IdSet maintain)
virtual

If item is already selected, maintain the current selection, else act as SetSelection. This will only be true if all items are currently selected in the supplied set.

virtual void makVrv::DtSelectionManager::removeFromCurrentSelection ( const IdSet removes)
virtual

add to the current selection set

virtual void makVrv::DtSelectionManager::toggleFromCurrentSelection ( const IdSet toggles)
virtual

Each id current not selected will be selected and each id already selected will be deselected.

virtual void makVrv::DtSelectionManager::removeFromCurrentSelection ( const DtElementData::UniqueIdList removes)
virtual

add to the current selection set

virtual SelectionMode makVrv::DtSelectionManager::selectionMode ( ) const
virtual

Selection Mode.

virtual void makVrv::DtSelectionManager::setSelectionMode ( SelectionMode  mode)
virtual
virtual bool makVrv::DtSelectionManager::isSelectable ( DtUniqueID  id) const
virtual

Determine an element's selectability Determines, based on the element's type and current selection mode, if the object is selectable. This form needs to look up the element, so it's better to use the form with a DtElementEntry argument if you have it.

virtual bool makVrv::DtSelectionManager::isSelectable ( const DtElementEntry entry) const
virtual

Determine an object's selectability Determines, based on the object's type and current selection mode, if the object is selectable.

virtual bool makVrv::DtSelectionManager::isSelected ( DtUniqueID  id) const
virtual

Check to see if an object is selected.

virtual SelectionType makVrv::DtSelectionManager::selectionType ( ) const
virtual
virtual bool makVrv::DtSelectionManager::propSelectionHasNonReplacedProp ( )
virtual

check to see if any of the selected props are not replaced props

virtual bool makVrv::DtSelectionManager::propSelectionMajorityTransparent ( )
virtual

Is the majority of selected props transparent or opaque; used by toggle transparency selected.

virtual void makVrv::DtSelectionManager::slot_onElementsRemoved ( const DtElementData::UniqueIdList elementIds)
virtual

Called by signal whenever elements are removed.

virtual void makVrv::DtSelectionManager::backupCurrentSelection ( )
virtual

Puts the current selection onto the backup queue.

virtual bool makVrv::DtSelectionManager::restoreCurrentSelection ( )
virtual

Restores a previously backed up selection. If there are no selections backed up, returns false.

virtual bool makVrv::DtSelectionManager::selectionIsVertex ( const IdSet selection)
virtual
virtual bool makVrv::DtSelectionManager::objectIsVertex ( const DtUniqueID id)
virtual
virtual DtUniqueID makVrv::DtSelectionManager::parentId ( const DtUniqueID id)
virtual
virtual bool makVrv::DtSelectionManager::allItemsWantVertexSelection ( const IdSet ) const
virtual

Returns true if the items in the selection set are vertices and the vertices parents all want vertex selection. Element types can be added to vertex selection by calling addWantsVertexSelection(). To remove, call removeWantsVertexSelection()

virtual void makVrv::DtSelectionManager::addWantsVertexSelection ( DtElementEntry::ElementType  )
virtual

Adds an item to the wants to have vertex selection list.

virtual void makVrv::DtSelectionManager::removeWantsVertexSelection ( DtElementEntry::ElementType  )
virtual

Removes an item to the wants to have vertex selection list.

virtual bool makVrv::DtSelectionManager::wantsVertexSelection ( DtElementID  ) const
virtual

Returns true if the object type wants vertex selection.

virtual void makVrv::DtSelectionManager::addSelectableObjectType ( DtElementEntry::ElementType  type,
SelectionMode  = SelectionModeAll 
)
virtual

{@

Manages types that are valid for certain selection modes

virtual void makVrv::DtSelectionManager::removeSelectableObjectType ( DtElementEntry::ElementType  type,
SelectionMode   
)
virtual
virtual void makVrv::DtSelectionManager::removeSelectableObjectTypeFromAllModes ( DtElementEntry::ElementType  type)
virtual
virtual bool makVrv::DtSelectionManager::objectTypeSelectable ( DtElementEntry::ElementType  type,
SelectionMode  mode 
) const
virtual
virtual bool makVrv::DtSelectionManager::objectTypeSelectable ( DtElementEntry::ObjectType  type) const
virtual

Uses current selection mode to see if object type is selectable.

static SelectionOperation makVrv::DtSelectionManager::selectionOperationForMouseEvent ( const DtMouseEvent mouseEvent)
static

Choose the appropriate selection operation based on the mouse event.

static bool makVrv::DtSelectionManager::typeSupportsMultipleSelection ( DtElementEntry::ObjectType  type,
bool  vertexSelectsParent 
)
static

Check to see if an object type supports multiple selection. Since it matters if we're currently selecting our parent with vertices and since this function is static, that must be passed in.

virtual void makVrv::DtSelectionManager::addToCurrentSelection ( DtUniqueID  id)
protectedvirtual

add to the current selection set

virtual void makVrv::DtSelectionManager::removeFromCurrentSelection ( DtUniqueID  id)
protectedvirtual

add to the current selection set

virtual void makVrv::DtSelectionManager::announceCurrentSelectionChanged ( const IdSet selected,
const IdSet deselected,
SelectionType  oldType 
)
protectedvirtual

Announce the selection changes by emitting signals.

virtual void makVrv::DtSelectionManager::updateSelectionType ( )
protectedvirtual
virtual SelectionType makVrv::DtSelectionManager::elementSelectionType ( DtElementEntry entry) const
protectedvirtual

Get the selection type for an element.

Reimplemented in makVrf::DtVrfSelectionManager.

virtual void makVrv::DtSelectionManager::convertVertexIdsToParentIds ( const IdSet in,
IdSet out 
)
protectedvirtual

Member Data Documentation

boost::signalslib::signal<void (const DtElementID& entityId, bool hasMouseCursor)> makVrv::DtSelectionManager::signal_elementHasMouseCursorStateChanged

Emitted when an element's scene object is being hovered over by the mouse cursor.

boost::signalslib::signal<void (const IdSet& selected, const IdSet& deselected, SelectionType newType, SelectionType oldType)> makVrv::DtSelectionManager::signal_currentSelectionChanged

Emited when the current selection changes.

boost::signalslib::signal<void (const DtUniqueID& id, const DtUniqueID& parentId)> makVrv::DtSelectionManager::signal_vertexSelected

Special case: emitted in addition to of currentSelectionChanged when a vertex is selected.

boost::signalslib::signal<void (const DtUniqueID& id, const DtUniqueID& parentId)> makVrv::DtSelectionManager::signal_vertexDeselected

Special case: emitted in addition to currentSelectionChanged when a vertex is deselected.

boost::signalslib::signal<void (const IdSet& entityIds, bool pinAllLabels)> makVrv::DtSelectionManager::signal_infoLabelsArePinned

Emitted when the selected entities have their info pin state toggled Perhaps this signal doesn't belong here...

boost::signalslib::signal<void(const DtUniqueID&)> makVrv::DtSelectionManager::signal_switchEntitySymbolDecorationQuadrant

Emitted when the selected entity has its symbol decoration quadrant switched.

boost::signalslib::signal<void(const DtUniqueID&, const DtColorValue&, bool)> makVrv::DtSelectionManager::signal_entityTrackHistoryColorOverride

Emitted when the selected entity has its track history color changed.

boost::signalslib::signal<void ()> makVrv::DtSelectionManager::signal_selectionModeChanged

Emited when the selection mode changes.

DtDe& makVrv::DtSelectionManager::myDe
protected
IdSet makVrv::DtSelectionManager::myCurrentSelections
protected
SelectionMode makVrv::DtSelectionManager::mySelectionMode
protected
bool makVrv::DtSelectionManager::myIgnoreSelectionChanges
protected

Set when a signal is raised to avoid loops.

bool makVrv::DtSelectionManager::myIgnoreSelectionModeChanges
protected
SelectionType makVrv::DtSelectionManager::mySelectionType
protected
IdSetQueue makVrv::DtSelectionManager::myBackupSelections
protected
WantsVertexSelection makVrv::DtSelectionManager::myWantsVertexSelection
protected
SelectionModeMap makVrv::DtSelectionManager::mySelectionModeMap
protected
DtSignalConnectionManager makVrv::DtSelectionManager::mySignals
protected

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

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)