Emergency 2017 Dokumentation  v3.0.1
qsf::editor::NodeSelectionManager Class Reference

QSF editor node selection manager class. More...

#include <NodeSelectionManager.h>

Public Types

typedef boost::container::flat_set< unsigned int > IdSet
 Node ID set. More...
 
- Public Types inherited from qsf::SelectionManagerTemplate< unsigned int >
typedef boost::container::flat_set< unsigned int > IdSet
 
- Public Types inherited from qsf::Object
enum  PropertyOverrideState { PROPERTY_INVALID, PROPERTY_DEFAULT, PROPERTY_OVERRIDE, PROPERTY_REMOVED }
 
enum  SerializationMethod { SERIALIZE_FLAT, SERIALIZE_COMPLETE, SERIALIZE_DIFFERENTIAL, SERIALIZE_IGNORE_UNKNOWN }
 
enum  SerializationMode { MODE_MINIMAL, MODE_COMPATIBLE }
 

Signals

void change (unsigned int id)
 Qt signal emitted after an selection change has occurred. More...
 

Public Member Functions

 NodeSelectionManager (qsf::SelectionSystem *selectionSystem)
 Constructor. More...
 
virtual ~NodeSelectionManager ()
 Destructor. More...
 
bool isNodeSelectionMarkerEnabled () const
 Return whether or not the node selection marker is enabled. More...
 
void setNodeSelectionMarkerEnabled (bool nodeSelectionMarkerEnabled)
 Set whether or not the node selection marker is enabled. More...
 
NodesComponentgetNodesComponent () const
 Return the used nodes component instance. More...
 
glm::vec3 getCurrentNodePosition () const
 Return the local space position of the current node. More...
 
unsigned int getSelectedId () const
 Return the first selected ID. More...
 
const IdSetgetSelectedIdSet () const
 Return whole selection as set of IDs. More...
 
size_t getSelectionSize () const
 Return the number of currently selected IDs. More...
 
bool isIdSelected (unsigned int id) const
 Check whether or not the given ID is currently selected. More...
 
unsigned int getCurrentId () const
 Return the current ID. More...
 
- Public Member Functions inherited from qsf::SelectionManagerTemplate< unsigned int >
 SelectionManagerTemplate ()
 Default constructor. More...
 
virtual ~SelectionManagerTemplate ()
 Destructor. More...
 
unsigned int getSelectedId () const
 Return the first selected ID. More...
 
const IdSetgetSelectedIdSet () const
 Return whole selection as set of IDs. More...
 
size_t getSelectionSize () const
 Return the number of currently selected IDs. More...
 
bool isIdSelected (unsigned int id) const
 Check whether or not the given ID is currently selected. More...
 
void clearSelection ()
 Clear the current selection. More...
 
void setSelectionById (unsigned int id)
 Set the current selection by using an ID. More...
 
void setSelectionByIdSet (const IdSet &idSet)
 Set the current selection by using an ID set. More...
 
void addIdToSelection (unsigned int id)
 Add an ID to the current selection. More...
 
void addIdSetToSelection (const IdSet &idSet)
 Add multiple IDs to the current selection. More...
 
void removeIdFromSelection (unsigned int id)
 Remove an ID from the current selection. More...
 
void removeIdSetFromSelection (const IdSet &idSet)
 Remove multiple IDs from the current selection. More...
 
unsigned int getCurrentId () const
 Return the current ID (the focus of attention) More...
 
void setCurrentId (unsigned int id)
 Set the current ID (the focus of attention) More...
 
- Public Member Functions inherited from qsf::SelectionManager
virtual ~SelectionManager ()
 Destructor. More...
 
- Public Member Functions inherited from qsf::Pluginable< SelectionSystem >
virtual ~Pluginable ()
 Destructor. More...
 
SelectionSystemgetManager () const
 Return the pluginable manager this pluginable is in. More...
 
- Public Member Functions inherited from qsf::PluginableBase
virtual ~PluginableBase ()
 Destructor. More...
 
template<typename T >
T & getPluginableManager () const
 Return the pluginable manager this pluginable is in. More...
 
- Public Member Functions inherited from qsf::Object
virtual ~Object ()
 Destructor. More...
 
const camp::Class & getCampClass () const
 Return the CAMP class. More...
 
int getPropertyIndexById (const StringHash &propertyId) const
 Return the CAMP property index by using the unique class property ID. More...
 
uint32 getPropertyIdByIndex (int index) const
 Return the unique class property ID with the given index. More...
 
std::string getPropertyNameById (const StringHash &propertyId) const
 Return the CAMP property name by using the unique class property ID. More...
 
const camp::Property * getCampPropertyById (const StringHash &propertyId) const
 Return the CAMP property by using the unique class property ID. More...
 
void setPropertyValuesByString (const std::string &values)
 Set CAMP reflection property values by using a given string. More...
 
void setPropertiesToDefaultValues ()
 Set all CAMP reflection system properties to their default values. More...
 
void serializeToBoostPTree (boost::property_tree::ptree &pTree, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL) const
 
void serializeToBoostPTree (boost::property_tree::ptree &pTree, const camp::Class &campClass, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL) const
 
bool deserializeFromBoostPTree (const boost::property_tree::ptree &pTree, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL)
 
bool deserializeFromBoostPTree (const boost::property_tree::ptree &pTree, const camp::Class &campClass, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL)
 
void serializeToBinarySerializer (BinarySerializer &serializer, SerializationMode mode=MODE_MINIMAL, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL) const
 
void deserializeFromBinarySerializer (BinarySerializer &serializer, SerializationMode mode=MODE_MINIMAL, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL, bool setOverrideState=true)
 
virtual camp::Value getPropertyDefaultValue (const StringHash &propertyId) const
 
virtual PropertyOverrideState getPropertyOverrideState (const StringHash &propertyId) const
 
virtual bool setPropertyOverrideState (const StringHash &propertyId, PropertyOverrideState overrideState)
 
virtual void onPreDeserialize ()
 Called right before the object is deserialized using any of the above methods. Default implementation is empty. More...
 
virtual void onPostDeserialize ()
 Called right after the object was deserialized using any of the above methods. Default implementation is empty. More...
 
virtual ScriptgetAssociatedScript () const
 Return the script instance associated with this object instance. More...
 

Static Public Attributes

static const uint32 PLUGINABLE_ID
 "qsf::editor::NodeSelectionManager" unique pluginable selection manager ID More...
 

Protected Member Functions

virtual void onCurrentChange (unsigned int id) override
 This method is called whenever the current ID has been changed. More...
 
- Protected Member Functions inherited from qsf::SelectionManagerTemplate< unsigned int >
 SelectionManagerTemplate (SelectionSystem *selectionSystem)
 Constructor. More...
 
virtual bool isSelectionValid (unsigned int id) const
 Check whether or not the given selection is valid. More...
 
virtual void onSelect (unsigned int id)
 This method is called whenever there's a newly selected ID. More...
 
virtual void onDeselect (unsigned int id)
 This method is called whenever a previously selected ID is selected no more. More...
 
- Protected Member Functions inherited from qsf::SelectionManager
 SelectionManager ()
 Default constructor. More...
 
 SelectionManager (SelectionSystem *selectionSystem)
 Constructor. More...
 
- Protected Member Functions inherited from qsf::Pluginable< SelectionSystem >
 Pluginable (SelectionSystem *pluginableManager)
 Constructor. More...
 
- Protected Member Functions inherited from qsf::PluginableBase
 PluginableBase (PluginableManager *pluginableManager)
 Constructor. More...
 
- Protected Member Functions inherited from qsf::Object
 Object ()
 Default constructor. More...
 

Friends

template<typename T >
class camp::ClassBuilder
 
class SelectNodeOperation
 
class NodeSelectionMarkerManager
 
class AddNodesToSelectionOperation
 
class RemoveNodesFromSelectionOperation
 

Additional Inherited Members

- Public Attributes inherited from qsf::SelectionManagerTemplate< unsigned int >
boost::signals2::signal< void(unsigned int)> Selected
 This Boost signal is emitted once for each ID selected. More...
 
boost::signals2::signal< void(unsigned int)> Deselected
 This Boost signal is emitted once for each ID deselected. More...
 

Detailed Description

QSF editor node selection manager class.

Note
  • The currently selected nodes can only be changed by using the "qsf::editor::SelectNodeOperation", "qsf::editor::AddNodesToSelectionOperation" and "qsf::editor::RemoveNodesFromSelectionOperation" operations
  • We need to inherit from qsf::EntitySelectionManager publically otherwise compiler error: qsf/plugin/pluginable/PluginableManager-inl.h:38:61: error: ‘qsf::PluginableBase’ is an inaccessible base of ‘qsf::editor::NodeSelectionManager’ due private inheritance the information of that base class gets "lost" for the outer world
Todo:
  • TODO(co) Add support for visual highlighting

Definition at line 63 of file NodeSelectionManager.h.

Member Typedef Documentation

typedef boost::container::flat_set<unsigned int> qsf::editor::NodeSelectionManager::IdSet

Node ID set.

Definition at line 91 of file NodeSelectionManager.h.

Constructor & Destructor Documentation

qsf::editor::NodeSelectionManager::NodeSelectionManager ( qsf::SelectionSystem selectionSystem)
explicit

Constructor.

Parameters
[in]selectionSystemThe QSF selection system this selection manager instance is in, no null pointer allowed (the CAMP reflection system does not like references in constructors, so we have to use a pointer instead)
virtual qsf::editor::NodeSelectionManager::~NodeSelectionManager ( )
virtual

Destructor.

Member Function Documentation

void qsf::editor::NodeSelectionManager::change ( unsigned int  id)
signal

Qt signal emitted after an selection change has occurred.

Parameters
[in]idThe ID of the new selected node, "qsf::getUninitialized<unsigned int>()" is there's no current ID
unsigned int qsf::editor::NodeSelectionManager::getCurrentId ( ) const

Return the current ID.

Returns
The current ID, "qsf::getUninitialized<unsigned int>()" is there's no current ID
Remarks
Usually the current ID is equal to the last selected ID. It's possible to explicitly set this current ID, although it's recommended to not do so if it can be avoided. Do also don't use the information about the current ID if you don't have to and use the general selected ID set whenever possible.
glm::vec3 qsf::editor::NodeSelectionManager::getCurrentNodePosition ( ) const

Return the local space position of the current node.

Returns
The local space position of the current node, null position on error
NodesComponent* qsf::editor::NodeSelectionManager::getNodesComponent ( ) const

Return the used nodes component instance.

Returns
The used nodes component instance, null pointer on error, do not destroy the instance
unsigned int qsf::editor::NodeSelectionManager::getSelectedId ( ) const

Return the first selected ID.

Returns
The selected ID, in case of multiple selected IDs the first one will be returned
const IdSet& qsf::editor::NodeSelectionManager::getSelectedIdSet ( ) const

Return whole selection as set of IDs.

Returns
Whole selection as set of IDs, do not destroy the instance
size_t qsf::editor::NodeSelectionManager::getSelectionSize ( ) const

Return the number of currently selected IDs.

Returns
The number of currently selected IDs
bool qsf::editor::NodeSelectionManager::isIdSelected ( unsigned int  id) const

Check whether or not the given ID is currently selected.

Returns
"true" in case the given ID is currently selected, else "false"
bool qsf::editor::NodeSelectionManager::isNodeSelectionMarkerEnabled ( ) const

Return whether or not the node selection marker is enabled.

Returns
"true" if the node selection marker is enabled, else "false"
virtual void qsf::editor::NodeSelectionManager::onCurrentChange ( unsigned int  id)
overrideprotectedvirtual

This method is called whenever the current ID has been changed.

Parameters
[in]idThe new current ID
Note
  • The default implementation is empty

Reimplemented from qsf::SelectionManagerTemplate< unsigned int >.

void qsf::editor::NodeSelectionManager::setNodeSelectionMarkerEnabled ( bool  nodeSelectionMarkerEnabled)

Set whether or not the node selection marker is enabled.

Parameters
[in]nodeSelectionMarkerEnabled"true" if the node selection marker is enabled, else "false"

Friends And Related Function Documentation

friend class AddNodesToSelectionOperation
friend

Definition at line 81 of file NodeSelectionManager.h.

template<typename T >
friend class camp::ClassBuilder
friend

Definition at line 78 of file NodeSelectionManager.h.

friend class NodeSelectionMarkerManager
friend

Definition at line 80 of file NodeSelectionManager.h.

friend class RemoveNodesFromSelectionOperation
friend

Definition at line 82 of file NodeSelectionManager.h.

friend class SelectNodeOperation
friend

Definition at line 79 of file NodeSelectionManager.h.

Member Data Documentation

const uint32 qsf::editor::NodeSelectionManager::PLUGINABLE_ID
static

"qsf::editor::NodeSelectionManager" unique pluginable selection manager ID

Definition at line 89 of file NodeSelectionManager.h.


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