Workspace 6.21.5
Public Member Functions | List of all members
MouseControlBinding Class Reference

Mouse control binding.

#include <Rendering/SceneInteraction/mousecontrolbinding.h>

Inheritance diagram for MouseControlBinding:
[legend]

Public Member Functions

 MouseControlBinding ()
 
 MouseControlBinding (CameraInteractionsFactory::InteractionType type, Qt::KeyboardModifiers modifierKeys, Qt::MouseButtons mouseButtons)
 
bool canSerialize () const override
 
Qt::MouseButtons getButtons () const
 
Qt::KeyboardModifiers getModifiers () const
 
CameraInteractionsFactory::InteractionType getType () const
 
bool load (const DataExecution::SerializedItem &item) override
 
bool matches (const QMouseEvent &event) const
 
bool matches (const QWheelEvent &event) const
 
bool save (DataExecution::SerializedItem &item) const override
 
void setButtons (Qt::MouseButtons buttons)
 
void setModifiers (Qt::KeyboardModifiers modifiers)
 
void setType (CameraInteractionsFactory::InteractionType type)
 
- Public Member Functions inherited from Serialize
virtual ~Serialize ()=default
 
virtual bool canSerialize () const =0
 
virtual bool load (const SerializedItem &item)=0
 
virtual bool save (SerializedItem &item) const =0
 

Constructor & Destructor Documentation

◆ MouseControlBinding() [1/2]

MouseControlBinding ( )
inline

◆ MouseControlBinding() [2/2]

MouseControlBinding ( CameraInteractionsFactory::InteractionType  type,
Qt::KeyboardModifiers  modifierKeys,
Qt::MouseButtons  mouseButtons 
)
inline

Member Function Documentation

◆ canSerialize()

bool canSerialize ( ) const
overridevirtual
Returns
True if this object can be serialized.

For objects that can be serialized, the save and load functions will be used to do the serialization. If this function returns false, both load() and save() must also return false.

Implements Serialize.

◆ getButtons()

Qt::MouseButtons getButtons ( ) const
inline

◆ getModifiers()

Qt::KeyboardModifiers getModifiers ( ) const
inline

◆ getType()

◆ load()

bool load ( const DataExecution::SerializedItem item)
overridevirtual
Parameters
itemSupplies the state to be loaded into this object.

This function will load the state of this object from item. For many object types, this is most easily implemented in terms of the object's input operator (>>).

It would be reasonable for subclass implementations to assume that the data provided in item is in the same form as would have been saved from a call to save.

Returns
If the state of the object could not be loaded, the function returns false. A return value of true implies that the object state was successfully loaded. If canSerialize() returns false, this function must do nothing except return false as well.

Implements Serialize.

◆ matches() [1/2]

bool matches ( const QMouseEvent &  event) const
Parameters
event
Returns
true if the mouse event's button and keyboard modifiers match binding.

◆ matches() [2/2]

bool matches ( const QWheelEvent &  event) const
Parameters
event
Returns
true if the mouse event's button and keyboard modifiers match binding.

◆ save()

bool save ( DataExecution::SerializedItem item) const
overridevirtual
Parameters
itemWhere to save the state of this object.

This function will serialise the object by saving it to item. For most object types, this is most easily implemented in terms of the object's output operator (<<).

It is allowable for an object to only serialize part of itself. This would be useful if the data it represents has a set of defaults and only those values different to the defaults need to be serialized. Such an implementation then needs to be careful how it handles the complimentary load member function.

Returns
If an object could not be serialised or if the underlying object type does not support serialisation, this function should return false. A return value of true implies that the object was successfully saved to item. If canSerialize() returns false, this function must do nothing except return false as well.

Implements Serialize.

◆ setButtons()

void setButtons ( Qt::MouseButtons  buttons)
inline

◆ setModifiers()

void setModifiers ( Qt::KeyboardModifiers  modifiers)
inline

◆ setType()

void setType ( CameraInteractionsFactory::InteractionType  type)
inline