Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Gui::ScaleGizmo Class Reference

#include <Gui/Viewer/Gizmo/ScaleGizmo.hpp>

+ Inheritance diagram for Ra::Gui::ScaleGizmo:
+ Collaboration diagram for Ra::Gui::ScaleGizmo:

Public Member Functions

 ScaleGizmo (Engine::Scene::Component *c, const Core::Transform &worldTo, const Core::Transform &t, Mode mode)
 
void updateTransform (Gizmo::Mode mode, const Core::Transform &worldTo, const Core::Transform &t) override
 Called every time the underlying transform may have changed.
 
void selectConstraint (int drawableIndex) override
 Called when one of the drawables of the gizmo has been selected.
 
bool isSelected () override
 return the selection state of the gizmo: true if the gizmo is selected, false if not.
 
void setInitialState (const Core::Asset::Camera &cam, const Core::Vector2 &initialXY) override
 
Core::Transform mouseMove (const Core::Asset::Camera &cam, const Core::Vector2 &nextXY, bool stepped, bool whole) override
 
- Public Member Functions inherited from Ra::Gui::Gizmo
 Gizmo (Engine::Scene::Component *c, const Core::Transform &worldTo, const Core::Transform &t, Mode mode)
 
void show (bool on)
 

Additional Inherited Members

- Public Types inherited from Ra::Gui::Gizmo
enum  Mode { LOCAL , GLOBAL }
 
- Protected Member Functions inherited from Ra::Gui::Gizmo
const std::vector< Engine::Rendering::RenderObject * > & ros () const
 read access to the gizmo render objects id
 
void addRenderObject (Engine::Rendering::RenderObject *ro)
 add a render object to display the Gizmo
 
Gizmo::UiSelectionControlergetControler (int ro)
 Returns the controler (ShaderParametersProvider) associated to the given gizmo component.
 
- Static Protected Member Functions inherited from Ra::Gui::Gizmo
static bool findPointOnAxis (const Core::Asset::Camera &cam, const Core::Vector3 &origin, const Core::Vector3 &axis, const Core::Vector2 &pix, Core::Vector3 &pointOut, std::vector< Scalar > &hits)
 Find a mouse-designed point on a 3D axis.
 
static bool findPointOnPlane (const Core::Asset::Camera &cam, const Core::Vector3 &origin, const Core::Vector3 &axis, const Core::Vector2 &pix, Core::Vector3 &pointOut, std::vector< Scalar > &hits)
 Find a mouse-designed point on a 3D plane.
 
static std::shared_ptr< Engine::Rendering::RenderTechniquemakeRenderTechnique (int color)
 
- Protected Attributes inherited from Ra::Gui::Gizmo
Core::Transform m_worldTo
 World to local space where the transform lives.
 
Core::Transform m_transform
 Transform to be edited.
 
Engine::Scene::Componentm_comp
 Engine Ui component.
 
Mode m_mode
 local or global.
 
- Static Protected Attributes inherited from Ra::Gui::Gizmo
static std::array< std::shared_ptr< Ra::Engine::Data::PlainMaterial >, 3 > s_material
 

Detailed Description

A ScaleGizmo manipulates the scaling part of a transformation.

Note
Scaling is always applied in local frame.
Scaling is always strictly positive.

Definition at line 16 of file ScaleGizmo.hpp.

Constructor & Destructor Documentation

◆ ScaleGizmo()

Ra::Gui::ScaleGizmo::ScaleGizmo ( Engine::Scene::Component * c,
const Core::Transform & worldTo,
const Core::Transform & t,
Mode mode )

Definition at line 18 of file ScaleGizmo.cpp.

Member Function Documentation

◆ isSelected()

bool Ra::Gui::ScaleGizmo::isSelected ( )
inlineoverridevirtual

return the selection state of the gizmo: true if the gizmo is selected, false if not.

Implements Ra::Gui::Gizmo.

Definition at line 29 of file ScaleGizmo.hpp.

◆ mouseMove()

Core::Transform Ra::Gui::ScaleGizmo::mouseMove ( const Core::Asset::Camera & cam,
const Core::Vector2 & nextXY,
bool stepped,
bool whole )
overridevirtual

Called when the mouse movement is recorder with the camera parameters and the current pixel coordinates.

Implements Ra::Gui::Gizmo.

Definition at line 135 of file ScaleGizmo.cpp.

+ Here is the call graph for this function:

◆ selectConstraint()

void Ra::Gui::ScaleGizmo::selectConstraint ( int drawableIndex)
overridevirtual

Called when one of the drawables of the gizmo has been selected.

Implements Ra::Gui::Gizmo.

Definition at line 108 of file ScaleGizmo.cpp.

+ Here is the call graph for this function:

◆ setInitialState()

void Ra::Gui::ScaleGizmo::setInitialState ( const Core::Asset::Camera & cam,
const Core::Vector2 & initialXY )
overridevirtual

Called when the gizmo is first clicked, with the camera parameters and the initial pixel coordinates.

Implements Ra::Gui::Gizmo.

Definition at line 222 of file ScaleGizmo.cpp.

◆ updateTransform()

void Ra::Gui::ScaleGizmo::updateTransform ( Gizmo::Mode mode,
const Core::Transform & worldTo,
const Core::Transform & t )
overridevirtual

Called every time the underlying transform may have changed.

Implements Ra::Gui::Gizmo.

Definition at line 86 of file ScaleGizmo.cpp.


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