Radium Engine
1.5.20
|
#include <Gui/Viewer/Gizmo/Gizmo.hpp>
Classes | |
class | UiSelectionControler |
Public Types | |
enum | Mode { LOCAL , GLOBAL } |
Public Member Functions | |
Gizmo (Engine::Scene::Component *c, const Core::Transform &worldTo, const Core::Transform &t, Mode mode) | |
void | show (bool on) |
virtual void | updateTransform (Mode mode, const Core::Transform &worldTo, const Core::Transform &t)=0 |
Called every time the underlying transform may have changed. | |
virtual void | selectConstraint (int drawableIndex)=0 |
Called when one of the drawables of the gizmo has been selected. | |
virtual bool | isSelected ()=0 |
return the selection state of the gizmo: true if the gizmo is selected, false if not. | |
virtual void | setInitialState (const Core::Asset::Camera &cam, const Core::Vector2 &initialXY)=0 |
virtual Core::Transform | mouseMove (const Core::Asset::Camera &cam, const Core::Vector2 &nextXY, bool stepped=false, bool whole=false)=0 |
Protected Member Functions | |
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::UiSelectionControler * | getControler (int ro) |
Returns the controler (ShaderParametersProvider) associated to the given gizmo component. | |
Static Protected Member Functions | |
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::RenderTechnique > | makeRenderTechnique (int color) |
Protected Attributes | |
Core::Transform | m_worldTo |
World to local space where the transform lives. | |
Core::Transform | m_transform |
Transform to be edited. | |
Engine::Scene::Component * | m_comp |
Engine Ui component. | |
Mode | m_mode |
local or global. | |
Static Protected Attributes | |
static std::array< std::shared_ptr< Ra::Engine::Data::PlainMaterial >, 3 > | s_material |
Base class for gizmos, i.e. graphic tools to manipulate a transform.
XYZGizmo
which performs all the generic operations (e.g. render object coloring in selectConstraint and mouseMove). Ra::Gui::Gizmo::Gizmo | ( | Engine::Scene::Component * | c, |
const Core::Transform & | worldTo, | ||
const Core::Transform & | t, | ||
Mode | mode ) |
|
protected |
|
staticprotected |
|
staticprotected |
|
protected |
|
pure virtual |
return the selection state of the gizmo: true if the gizmo is selected, false if not.
Implemented in Ra::Gui::RotateGizmo, Ra::Gui::ScaleGizmo, and Ra::Gui::TranslateGizmo.
|
staticprotected |
Generate a the rendertechnique to draw the gizmo using the required color : 0-Red, 1-Green, 2-Blue. The build render technique has a selection-dependent parameter provider for the shader configuration used to draw the gizmo. It is this provider that manage the appeartance changes when the selection state changes on the gizmo.
Definition at line 88 of file Gizmo.cpp.
|
pure virtual |
Called when the mouse movement is recorder with the camera parameters and the current pixel coordinates.
Implemented in Ra::Gui::RotateGizmo, Ra::Gui::ScaleGizmo, and Ra::Gui::TranslateGizmo.
|
inlineprotected |
|
pure virtual |
Called when one of the drawables of the gizmo has been selected.
Implemented in Ra::Gui::RotateGizmo, Ra::Gui::ScaleGizmo, and Ra::Gui::TranslateGizmo.
|
pure virtual |
Called when the gizmo is first clicked, with the camera parameters and the initial pixel coordinates.
Implemented in Ra::Gui::RotateGizmo, Ra::Gui::ScaleGizmo, and Ra::Gui::TranslateGizmo.
|
pure virtual |
Called every time the underlying transform may have changed.
Implemented in Ra::Gui::RotateGizmo, Ra::Gui::ScaleGizmo, and Ra::Gui::TranslateGizmo.
|
protected |
|
protected |
|
protected |
|
staticprotected |