VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends
makVrf::DtSelectionGroupManager Class Reference

The DtSelectionGroupManager class is the interface to be used when creating selection group. More...

Inheritance diagram for makVrf::DtSelectionGroupManager:
Inheritance graph
[legend]

Public Types

typedef std::set< std::string > GroupItems
typedef std::map< std::string,
GroupItems
SelectionGroups

Public Member Functions

 DtSelectionGroupManager (makVrv::DtDe &de)
 CTOR.
virtual ~DtSelectionGroupManager ()
 DTOR.
virtual void createSelectionGroup (const std::string &)
 Create a new selection group. If named selection group alread exists will do nothing.
virtual void createSelectionGroupFromCurrentSelection (const std::string &groupName, bool select=false)
 Creates a selection group from the current selection as found in the DtVrfSelectionHandler selected names.
virtual void clearSelectionGroup (const std::string &)
 Clears a selection group of all items.
virtual void removeSelectionGroup (const std::string &)
 Deletes the selection groupd.
virtual bool hasSelectionGroup (const std::string &) const
 Returns true if there is a named selection group.
virtual void renameSelectionGroup (const std::string &from, const std::string &to)
 Renames a selection group.
virtual void addItemToSelectionGroup (const std::string &, const std::string &name)
 Adds a new item to a selection group.
virtual bool atLeastOneItemNotInSelectionGroup (const std::string &, const GroupItems &names) const
 Returns true if at least one of the supplied items is not in the selection group.
virtual bool atLeastOneItemNotInSelectionGroup (const std::string &, const std::vector< std::string > &names) const
virtual bool anyItemsInSelectionGroup (const std::string &, const GroupItems &names) const
 Returns true if any of the items are in the specified group.
virtual bool anyItemsInSelectionGroup (const std::string &, const std::vector< std::string > &names) const
virtual void addItemsToSelectionGroup (const std::string &, const GroupItems &names)
 Adds new items to a selection group.
virtual void addItemsToSelectionGroup (const std::string &, const std::vector< std::string > &names)
virtual bool itemInAnySelectionGroup (const std::string &) const
 Returns true if the named item is in any selection group.
virtual void removeItemFromSelectionGroup (const std::string &, const std::string &name)
 Removes an item vrom a selection group.
virtual void removeItemsFromSelectionGroup (const std::string &, const GroupItems &names)
 Removes items vrom a selection group.
virtual void removeItemsFromSelectionGroup (const std::string &, const std::vector< std::string > &names)
virtual const SelectionGroupsselectionGroups () const
 Returns the current list of selection groups.
virtual makVrv::DtUniqueID markingTextToId (const std::string &markingText) const
 Given the marking text return the id.
virtual bool load (const std::string &)
 Loads and replaces the current selection group set.
virtual bool save (const std::string &)
 Saves out the current selection group set.
virtual void removeAll ()
 Removes all selection groups.
virtual GroupItems itemsInSelectionGroup (const std::string &) const
 Returns all the items in a particular selection group.
virtual bool itemIsInSelectionGroup (const std::string &group, const std::string &item) const
 Returns true if the names item is in the supplied selection group.
virtual void selectItemsInSelectionGroup (const std::string &)
 Selects all the items in the specified selection group that are in the simulation.
virtual const std::string & selectedSelectionGroup () const
 Returns the currently selected selection group.
virtual void slot_elementAttributeChangeRequested (makVrv::DtUniqueID id, makVrv::DtUniqueID parentId, DtBoost::shared_ptr< const makVrv::DtElementAttribute > atr)
 Called when an element attribute has changed.
virtual void addNamesToInternalMaps (const GroupItems &)
 Adds names to internal maps.
virtual void removeNamesFromInternalMaps (const GroupItems &)
 Removes names from internal maps if no longer in any selection group.
virtual void renameItemInAllSelectionGroups (const std::string &from, const std::string &to)
 Renames the item in all selection groups from the from item to the to item. If renamed a signal is emitted with the renamed item.
virtual void slot_onAttributesChanged (const makVrv::DtElementData::EntryAttributesList &signalList)
 Called with attribute changes. See if one is a name change for something that is in a selection group.
virtual void handleAttribute (makVrv::DtUniqueID id, const makVrv::DtElementAttribute *atr)
 See if attribute is display name change.
virtual void processCreateSelectionGroup (DtSimMessage *)
 Call back in response receiving creating selection group message.
virtual bool canRenameSelectionGroup (const std::string &) const
 Returns true if the selection group can be renamed.
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor.
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor.

Static Public Member Functions

static DtSelectionGroupManagerinstance (makVrv::DtDe &de)
static void registerInstance (makVrv::DtDe &de, DtSelectionGroupManager *)

Public Attributes

boost::signal< void(std::string)> signal_selectionGroupAdded
boost::signal< void(std::string,
std::string)> 
signal_selectionGroupRenamed
 Signal sent when a selection group is renamed.
boost::signal< void(std::string)> signal_selectionGroupRemoved
 Signal sent when a selection group is removed.
boost::signal< void(std::string)> signal_selectionGroupCleared
 Signal sent when a selection group is cleared of all its items.
boost::signal< void(std::string,
GroupItems)> 
signal_itemsAddedToSelectionGroup
 Signal sent when items are added to a selection group.
boost::signal< void(std::string,
GroupItems)> 
signal_itemsRemovedFromSelectionGroup
 Signal sent when items are removed from a selection group.
boost::signal< void()> signal_loading
 Signal sent before the selection group manager is loaded.
boost::signal< void()> signal_loaded
 Signal sent after the selection group manager is loaded.
boost::signal< void()> signal_selectionGroupsCleared
 Signal sent when the selection group manager is cleared.
boost::signal< void(std::string,
std::string)> 
signal_itemRenamed
 Signal emitted when an item is renamed in a selection group.
boost::signal< void(std::string)> signal_selectionGroupSelected
 Signal emitted when current selection group has changed.

Protected Types

typedef std::map< std::string,
makVrv::DtUniqueID
NameToIdMap
typedef std::map
< makVrv::DtUniqueID,
std::string > 
IdToNameMap

Protected Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 When the class Archive corresponds to an output archive, the & operator is defined similar to <<.

Protected Attributes

makVrv::DtDemyDe
SelectionGroups mySelectionGroups
makVrv::DtSignalConnectionManager myConnectionManager
NameToIdMap myNameToIdMap
IdToNameMap myIdToNameMap
std::string mySelectedSelectionGroup

Friends

class boost::serialization::access

Detailed Description

The DtSelectionGroupManager class is the interface to be used when creating selection group.

Selection groups are collection of named objects that can be used to select a group of objects at a single time

Member Typedef Documentation

typedef std::set<std::string> makVrf::DtSelectionGroupManager::GroupItems
typedef std::map<std::string, makVrv::DtUniqueID> makVrf::DtSelectionGroupManager::NameToIdMap
protected
typedef std::map<makVrv::DtUniqueID, std::string> makVrf::DtSelectionGroupManager::IdToNameMap
protected

Constructor & Destructor Documentation

makVrf::DtSelectionGroupManager::DtSelectionGroupManager ( makVrv::DtDe de)

CTOR.

virtual makVrf::DtSelectionGroupManager::~DtSelectionGroupManager ( )
virtual

DTOR.

Member Function Documentation

static DtSelectionGroupManager& makVrf::DtSelectionGroupManager::instance ( makVrv::DtDe de)
static
static void makVrf::DtSelectionGroupManager::registerInstance ( makVrv::DtDe de,
DtSelectionGroupManager  
)
static
virtual void makVrf::DtSelectionGroupManager::createSelectionGroup ( const std::string &  )
virtual

Create a new selection group. If named selection group alread exists will do nothing.

virtual void makVrf::DtSelectionGroupManager::createSelectionGroupFromCurrentSelection ( const std::string &  groupName,
bool  select = false 
)
virtual

Creates a selection group from the current selection as found in the DtVrfSelectionHandler selected names.

If selection group already exists replaces current contents of selection group If last parameter is true also will select that group

virtual void makVrf::DtSelectionGroupManager::clearSelectionGroup ( const std::string &  )
virtual

Clears a selection group of all items.

virtual void makVrf::DtSelectionGroupManager::removeSelectionGroup ( const std::string &  )
virtual

Deletes the selection groupd.

virtual bool makVrf::DtSelectionGroupManager::hasSelectionGroup ( const std::string &  ) const
virtual

Returns true if there is a named selection group.

virtual void makVrf::DtSelectionGroupManager::renameSelectionGroup ( const std::string &  from,
const std::string &  to 
)
virtual

Renames a selection group.

If the selection group to rename to already exists selection group is not renamed

virtual void makVrf::DtSelectionGroupManager::addItemToSelectionGroup ( const std::string &  ,
const std::string &  name 
)
virtual

Adds a new item to a selection group.

virtual bool makVrf::DtSelectionGroupManager::atLeastOneItemNotInSelectionGroup ( const std::string &  ,
const GroupItems names 
) const
virtual

Returns true if at least one of the supplied items is not in the selection group.

virtual bool makVrf::DtSelectionGroupManager::atLeastOneItemNotInSelectionGroup ( const std::string &  ,
const std::vector< std::string > &  names 
) const
virtual
virtual bool makVrf::DtSelectionGroupManager::anyItemsInSelectionGroup ( const std::string &  ,
const GroupItems names 
) const
virtual

Returns true if any of the items are in the specified group.

virtual bool makVrf::DtSelectionGroupManager::anyItemsInSelectionGroup ( const std::string &  ,
const std::vector< std::string > &  names 
) const
virtual
virtual void makVrf::DtSelectionGroupManager::addItemsToSelectionGroup ( const std::string &  ,
const GroupItems names 
)
virtual

Adds new items to a selection group.

virtual void makVrf::DtSelectionGroupManager::addItemsToSelectionGroup ( const std::string &  ,
const std::vector< std::string > &  names 
)
virtual
virtual bool makVrf::DtSelectionGroupManager::itemInAnySelectionGroup ( const std::string &  ) const
virtual

Returns true if the named item is in any selection group.

virtual void makVrf::DtSelectionGroupManager::removeItemFromSelectionGroup ( const std::string &  ,
const std::string &  name 
)
virtual

Removes an item vrom a selection group.

virtual void makVrf::DtSelectionGroupManager::removeItemsFromSelectionGroup ( const std::string &  ,
const GroupItems names 
)
virtual

Removes items vrom a selection group.

virtual void makVrf::DtSelectionGroupManager::removeItemsFromSelectionGroup ( const std::string &  ,
const std::vector< std::string > &  names 
)
virtual
virtual const SelectionGroups& makVrf::DtSelectionGroupManager::selectionGroups ( ) const
virtual

Returns the current list of selection groups.

virtual makVrv::DtUniqueID makVrf::DtSelectionGroupManager::markingTextToId ( const std::string &  markingText) const
virtual

Given the marking text return the id.

virtual bool makVrf::DtSelectionGroupManager::load ( const std::string &  )
virtual

Loads and replaces the current selection group set.

virtual bool makVrf::DtSelectionGroupManager::save ( const std::string &  )
virtual

Saves out the current selection group set.

virtual void makVrf::DtSelectionGroupManager::removeAll ( )
virtual

Removes all selection groups.

virtual GroupItems makVrf::DtSelectionGroupManager::itemsInSelectionGroup ( const std::string &  ) const
virtual

Returns all the items in a particular selection group.

virtual bool makVrf::DtSelectionGroupManager::itemIsInSelectionGroup ( const std::string &  group,
const std::string &  item 
) const
virtual

Returns true if the names item is in the supplied selection group.

virtual void makVrf::DtSelectionGroupManager::selectItemsInSelectionGroup ( const std::string &  )
virtual

Selects all the items in the specified selection group that are in the simulation.

Emits a signal that this selection group is currently active

virtual const std::string& makVrf::DtSelectionGroupManager::selectedSelectionGroup ( ) const
virtual

Returns the currently selected selection group.

virtual void makVrf::DtSelectionGroupManager::slot_elementAttributeChangeRequested ( makVrv::DtUniqueID  id,
makVrv::DtUniqueID  parentId,
DtBoost::shared_ptr< const makVrv::DtElementAttribute atr 
)
virtual

Called when an element attribute has changed.

See if it is a selection group item, and, if so, change the name in the selection group list

virtual void makVrf::DtSelectionGroupManager::addNamesToInternalMaps ( const GroupItems )
virtual

Adds names to internal maps.

If names are not yet in the simulation, add anyway but have ids be 0. Will not add reverse map (by id) if not in simulation

virtual void makVrf::DtSelectionGroupManager::removeNamesFromInternalMaps ( const GroupItems )
virtual

Removes names from internal maps if no longer in any selection group.

virtual void makVrf::DtSelectionGroupManager::renameItemInAllSelectionGroups ( const std::string &  from,
const std::string &  to 
)
virtual

Renames the item in all selection groups from the from item to the to item. If renamed a signal is emitted with the renamed item.

virtual void makVrf::DtSelectionGroupManager::slot_onAttributesChanged ( const makVrv::DtElementData::EntryAttributesList signalList)
virtual

Called with attribute changes. See if one is a name change for something that is in a selection group.

virtual void makVrf::DtSelectionGroupManager::handleAttribute ( makVrv::DtUniqueID  id,
const makVrv::DtElementAttribute atr 
)
virtual

See if attribute is display name change.

virtual void makVrf::DtSelectionGroupManager::processCreateSelectionGroup ( DtSimMessage )
virtual

Call back in response receiving creating selection group message.

virtual bool makVrf::DtSelectionGroupManager::canRenameSelectionGroup ( const std::string &  ) const
virtual

Returns true if the selection group can be renamed.

By default the "Selection Group <N>" groups cannot be renamed

template<class Archive >
void makVrf::DtSelectionGroupManager::serialize ( Archive &  ar,
const unsigned int  version 
)
inlineprotected

When the class Archive corresponds to an output archive, the & operator is defined similar to <<.

Likewise, when the class Archive is a type of input archive the & operator is defined similar to >>.

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Member Data Documentation

boost::signal<void (std::string)> makVrf::DtSelectionGroupManager::signal_selectionGroupAdded

Signals for selection group manager

Signal sent when a new selection group is added

boost::signal<void (std::string, std::string)> makVrf::DtSelectionGroupManager::signal_selectionGroupRenamed

Signal sent when a selection group is renamed.

boost::signal<void (std::string)> makVrf::DtSelectionGroupManager::signal_selectionGroupRemoved

Signal sent when a selection group is removed.

boost::signal<void (std::string)> makVrf::DtSelectionGroupManager::signal_selectionGroupCleared

Signal sent when a selection group is cleared of all its items.

boost::signal<void (std::string, GroupItems)> makVrf::DtSelectionGroupManager::signal_itemsAddedToSelectionGroup

Signal sent when items are added to a selection group.

boost::signal<void (std::string, GroupItems)> makVrf::DtSelectionGroupManager::signal_itemsRemovedFromSelectionGroup

Signal sent when items are removed from a selection group.

boost::signal<void ()> makVrf::DtSelectionGroupManager::signal_loading

Signal sent before the selection group manager is loaded.

boost::signal<void ()> makVrf::DtSelectionGroupManager::signal_loaded

Signal sent after the selection group manager is loaded.

boost::signal<void ()> makVrf::DtSelectionGroupManager::signal_selectionGroupsCleared

Signal sent when the selection group manager is cleared.

boost::signal<void (std::string, std::string)> makVrf::DtSelectionGroupManager::signal_itemRenamed

Signal emitted when an item is renamed in a selection group.

boost::signal<void (std::string)> makVrf::DtSelectionGroupManager::signal_selectionGroupSelected

Signal emitted when current selection group has changed.

makVrv::DtDe& makVrf::DtSelectionGroupManager::myDe
protected
SelectionGroups makVrf::DtSelectionGroupManager::mySelectionGroups
protected
makVrv::DtSignalConnectionManager makVrf::DtSelectionGroupManager::myConnectionManager
protected
NameToIdMap makVrf::DtSelectionGroupManager::myNameToIdMap
protected
IdToNameMap makVrf::DtSelectionGroupManager::myIdToNameMap
protected
std::string makVrf::DtSelectionGroupManager::mySelectedSelectionGroup
protected

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

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)