Emergency 20 Dokumentation  4.1.0
Classes | Public Types | Signals | Public Member Functions | List of all members
qsf::editor::GizmoManager Class Reference

Gizmo manager class. More...

#include <GizmoManager.h>

Inheritance diagram for qsf::editor::GizmoManager:
Inheritance graph
Collaboration diagram for qsf::editor::GizmoManager:
Collaboration graph

Public Types

enum  Feature { MOVEMENT_FEATURE = 1<<0, ROTATE_FEATURE = 1<<1, SCALE_FEATURE = 1<<2, LOCAL_FEATURE = 1<<3 }
 Feature set flags. More...
typedef BitFlagSet< uint8, FeatureFeatureBitmask


void change ()
 Qt signal emitted after a gizmo changed occurred. More...
void transformChange (const Transform &transform)
 Qt signal emitted after a gizmo transform changed occurred. More...

Public Member Functions

 GizmoManager ()
 Default constructor. More...
virtual ~GizmoManager ()
 Destructor. More...
const FeatureBitmaskgetFeatureSet () const
void setFeatureSet (const FeatureBitmask &flags)
void resetDefaultTransformationAxes ()
bool isGizmoEnabled () const
void setGizmoEnabled (bool gizmoEnabled)
const TransformgetGizmoTransform ()
void setGizmoTransform (const Transform &transform)
GizmoComponent::TransformationMode getActiveMode () const
void setActiveMode (GizmoComponent::TransformationMode mode)
GizmoComponent::TransformationAxis getActiveAxis () const
void setActiveAxis (GizmoComponent::TransformationAxis axis, const glm::vec3 &initialHitPosition)
void toggleActiveAxis (GizmoComponent::TransformationAxis axis, const glm::vec3 &initialHitPosition)
bool getUseLocalTransformation () const
void setUseLocalTransformation (bool useLocal)
GizmoComponent::TransformationAxis getValidAxis (GizmoComponent::TransformationAxis axis)
 Check if given axis is valid for this gizmo and return default axis if it isn't. More...
void getFollowGroundIgnoreEntityIds (EntitySelectionManager::IdSet &idSet)
 Return the entities to be ignored when performing follow ground. More...
void setFollowGroundIgnoreEntityIds (const EntitySelectionManager::IdSet &ignoreEntityIds)
 Set the entities to be ignored when performing follow ground. More...
void updateAxisHighlighting (QMouseEvent &qMouseEvent, RenderWindow &renderWindow)
 Update the gizmo axis highlighting. More...
bool switchToTransformEditModeIfPossible (QMouseEvent &qMouseEvent, RenderWindow &renderWindow, TransformEditMode &transformEditMode)
void switchToTransformEditMode (TransformEditMode &transformEditMode, GizmoComponent::TransformationAxis selectedAxis, const glm::vec3 &hitPosition, Qt::KeyboardModifiers qtKeyboardModifiers)
void mouseReleaseEvent (QMouseEvent &qMouseEvent, RenderWindow &renderWindow)
void mouseMoveEvent (QMouseEvent &qMouseEvent, RenderWindow &renderWindow)
bool getGridEnabled ()
void setGridEnabled (bool enabled)
float getGridSize ()
void setGridSize (float gridSize)
glm::vec3 snapPositionToGrid (const glm::vec3 &position)

Additional Inherited Members

- Protected Member Functions inherited from qsf::Manager
 Manager ()
 Default constructor. More...
virtual ~Manager ()
 Destructor. More...

Detailed Description

Gizmo manager class.

The gizmo manager manages the helper entity containing the gizmo components. All other editor parts only access the gizmo manager and never the helper entity nor the gizmo components directly.

Member Typedef Documentation

Member Enumeration Documentation

Feature set flags.


Gizmo movement possible.


Gizmo rotation possible.


Gizmo scale possible.


Local transform possible.

Constructor & Destructor Documentation

qsf::editor::GizmoManager::GizmoManager ( )

Default constructor.

virtual qsf::editor::GizmoManager::~GizmoManager ( )


Member Function Documentation

void qsf::editor::GizmoManager::change ( )

Qt signal emitted after a gizmo changed occurred.

  • TODO(co) Review this signal and remove it if possible
GizmoComponent::TransformationAxis qsf::editor::GizmoManager::getActiveAxis ( ) const
GizmoComponent::TransformationMode qsf::editor::GizmoManager::getActiveMode ( ) const
const FeatureBitmask& qsf::editor::GizmoManager::getFeatureSet ( ) const
void qsf::editor::GizmoManager::getFollowGroundIgnoreEntityIds ( EntitySelectionManager::IdSet idSet)

Return the entities to be ignored when performing follow ground.

[out]idSetReceives the entities to be ignored when performing follow ground, set is not cleared before adding new IDs
const Transform& qsf::editor::GizmoManager::getGizmoTransform ( )
bool qsf::editor::GizmoManager::getGridEnabled ( )

Return whether grid is currently enabled

float qsf::editor::GizmoManager::getGridSize ( )

Return current grid size, i.e. distance between thinnest (= primary) lines

bool qsf::editor::GizmoManager::getUseLocalTransformation ( ) const
GizmoComponent::TransformationAxis qsf::editor::GizmoManager::getValidAxis ( GizmoComponent::TransformationAxis  axis)

Check if given axis is valid for this gizmo and return default axis if it isn't.

[in]axisTransformation axis to be checked
The input parameter if it was a valid axis, otherwise the default axis (which is always the case for parameter AXIS_NONE)
bool qsf::editor::GizmoManager::isGizmoEnabled ( ) const
void qsf::editor::GizmoManager::mouseMoveEvent ( QMouseEvent &  qMouseEvent,
RenderWindow renderWindow 
void qsf::editor::GizmoManager::mouseReleaseEvent ( QMouseEvent &  qMouseEvent,
RenderWindow renderWindow 
void qsf::editor::GizmoManager::resetDefaultTransformationAxes ( )
void qsf::editor::GizmoManager::setActiveAxis ( GizmoComponent::TransformationAxis  axis,
const glm::vec3 &  initialHitPosition 
void qsf::editor::GizmoManager::setActiveMode ( GizmoComponent::TransformationMode  mode)
void qsf::editor::GizmoManager::setFeatureSet ( const FeatureBitmask flags)
void qsf::editor::GizmoManager::setFollowGroundIgnoreEntityIds ( const EntitySelectionManager::IdSet ignoreEntityIds)

Set the entities to be ignored when performing follow ground.

[in]ignoreEntityIdsThe given entities will be ignored for the height calculation
void qsf::editor::GizmoManager::setGizmoEnabled ( bool  gizmoEnabled)
void qsf::editor::GizmoManager::setGizmoTransform ( const Transform transform)
void qsf::editor::GizmoManager::setGridEnabled ( bool  enabled)

Set grid state to enabled or disabled

void qsf::editor::GizmoManager::setGridSize ( float  gridSize)

Set grid size, i.e. distance between primary lines

void qsf::editor::GizmoManager::setUseLocalTransformation ( bool  useLocal)
glm::vec3 qsf::editor::GizmoManager::snapPositionToGrid ( const glm::vec3 &  position)

In case the grid is currently enabled, snap the given world space position to the grid

void qsf::editor::GizmoManager::switchToTransformEditMode ( TransformEditMode transformEditMode,
GizmoComponent::TransformationAxis  selectedAxis,
const glm::vec3 &  hitPosition,
Qt::KeyboardModifiers  qtKeyboardModifiers 
bool qsf::editor::GizmoManager::switchToTransformEditModeIfPossible ( QMouseEvent &  qMouseEvent,
RenderWindow renderWindow,
TransformEditMode transformEditMode 
void qsf::editor::GizmoManager::toggleActiveAxis ( GizmoComponent::TransformationAxis  axis,
const glm::vec3 &  initialHitPosition 
void qsf::editor::GizmoManager::transformChange ( const Transform transform)

Qt signal emitted after a gizmo transform changed occurred.

[in]transformThe new transform of the gizmo
void qsf::editor::GizmoManager::updateAxisHighlighting ( QMouseEvent &  qMouseEvent,
RenderWindow renderWindow 

Update the gizmo axis highlighting.

[in]qMouseEventQt mouse event to process
[in]renderWindowRender window to use

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