#include <sprk_ops.h>

Classes | |
class | GeometryTransformedEvent |
Public Types | |
enum | HandleType { Rotation, AxisTranslation, PlaneTranslation, CenterPoint } |
![]() | |
enum | Priority { Low, Default, High } |
Public Member Functions | |
void | AddHandles (HandleType handle_type) |
void | GetHandlesAppearance (float &out_length, float &out_radius, size_t &out_handles_points) const |
MaterialKitArray | GetHandlesColors () const |
RGBAColor | GetHighlightColor () const |
virtual HPS::UTF8 | GetName () const override |
void | GetPlaneTranslationAppearance (float &out_plane_offset, float &out_plane_length, float &out_center_radius) const |
void | GetRotationHandleAppearance (float &out_offset, float &out_angle, float &out_tip_size) const |
bool | GetTrailingGeometry () const |
HandlesOperator (MouseButtons in_mouse_trigger=MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger=ModifierKeys()) | |
virtual bool | OnMouseDown (MouseState const &in_state) override |
virtual bool | OnMouseMove (MouseState const &in_state) override |
virtual bool | OnMouseUp (MouseState const &in_state) override |
virtual bool | OnTouchDown (TouchState const &in_state) override |
virtual bool | OnTouchMove (TouchState const &in_state) override |
virtual bool | OnTouchUp (TouchState const &in_state) override |
virtual void | OnViewAttached () override |
virtual void | OnViewDetached () override |
void | RemoveHandles (HandleType handle_type) |
void | SetHandlesAppearance (float in_length=0.16f, float in_radius=0.005f, size_t in_handles_points=30) |
void | SetHandlesColors (MaterialKitArray const &in_colors) |
void | SetHighlightColor (RGBAColor const &in_highlight_color) |
void | SetPlaneTranslationAppearance (float in_plane_offset=0.2f, float in_plane_length=0.6f, float in_center_radius=0.2f) |
void | SetRotationHandleAppearance (float in_offset=0.045f, float in_angle=25.0f, float in_tip_size=0.15f) |
void | SetTrailingGeometry (bool in_state) |
![]() | |
virtual void | Assign (Operator const &in_that) |
void | DetachView () |
virtual bool | Equals (Operator const &in_that) const |
View | GetAttachedView () const |
ModifierKeys | GetModifierTrigger () const |
MouseButtons | GetMouseTrigger () const |
virtual bool | IsMouseTriggered (MouseState const &in_state) |
HPS::Type | ObjectType () const |
virtual bool | OnKeyDown (KeyboardState const &in_state) |
virtual bool | OnKeyUp (KeyboardState const &in_state) |
virtual void | OnModelAttached () |
virtual void | OnModelDetached () |
virtual bool | OnMouseEnter (MouseState const &in_state) |
virtual bool | OnMouseLeave (MouseState const &in_state) |
virtual bool | OnMouseWheel (MouseState const &in_state) |
virtual bool | OnTextInput (HPS::UTF8 const &in_text) |
virtual bool | OnTimerTick (HPS::TimerTickEvent const &in_event) |
Operator (MouseButtons in_mouse_trigger=MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger=ModifierKeys()) | |
Operator (Operator const &in_that) | |
virtual bool | operator!= (Operator const &in_that) const |
virtual Operator & | operator= (Operator const &in_that) |
virtual bool | operator== (Operator const &in_that) const |
void | SetModifierTrigger (ModifierKeys in_modifiers) |
void | SetMouseTrigger (MouseButtons in_buttons) |
![]() | |
Sprocket (Sprocket &&in_that) | |
![]() | |
virtual bool | Empty () const |
intptr_t | GetClassID () const |
intptr_t | GetInstanceID () const |
bool | HasType (HPS::Type in_mask) const |
Object (Object const &that) | |
Object (Object &&in_that) | |
Object & | operator= (Object const &other_object) |
Object & | operator= (Object &&in_that) |
virtual void | Reset () |
virtual HPS::Type | Type () const |
Additional Inherited Members | |
![]() | |
template<typename T > | |
static intptr_t | ClassID () |
![]() | |
static const HPS::Type | staticType = HPS::Type::Operator |
![]() | |
static const HPS::Type | staticType = HPS::Type::None |
![]() | |
HPS::ModifierKeys | modifier_trigger |
HPS::MouseButtons | mouse_trigger |
Detailed Description
The HandlesOperator class defines an operator which allows the user to move geometry. This Operator works for both mouse- and touch-driven devices.
To operate this operator on a mouse-driven device: Double click on a piece of geometry to activate the handles Click and drag the handles to move the selected geometry Click on the background to dismiss the handles
To operate this operator on a touch-driven device: Double tap on a piece of geometry to activate the handles Tap and drag the handles to move the selected geometry Tap on the background to dismiss the handles
This operator works on the segment containing the geometry selected. An event of type GeometryTransformedEvent in injected after the handles are dismissed, containing the information on which segment was affected and what transform was applied to it.
Member Function Documentation
void HPS::HandlesOperator::AddHandles | ( | HandleType | handle_type | ) |
Add a type of handle to those displayed by this operator. Changes take place the next time handles are inserted, by either double clicking or double tapping on geometry.
- Parameters
-
handle_type The type of handle to be added to those displayed.
void HPS::HandlesOperator::GetHandlesAppearance | ( | float & | out_length, |
float & | out_radius, | ||
size_t & | out_handles_points | ||
) | const |
Returns the parameters used to decide the appearance of the handles.
- Parameters
-
out_length The length of the handles, specified as a percentage of the view containing it. out_radius The radius of the handles, specified as a percentage of the view containing it. out_handles_points The number of points used to draw the handles. A higher number will yield a smoother appearance.
|
inline |
This function returns the materials used to color the handles. Only the diffuse color field of the materials is guaranteed to have a value. The materials are used as follows:
Entry 0 - translation handle in the x direction Entry 1 - translation handle in the y direction Entry 2 - translation handle in the z direction Entry 3 - rotation handle in the x direction Entry 4 - rotation handle in the y direction Entry 5 - rotation handle in the z direction Entry 6 - xz plane translation Entry 7 - xy plane translation Entry 8 - yz plane translation Entry 9 - center-sphere
- Returns
- An array of materials associated with the handles
|
inline |
Returns the color used to highlight the handles then the user mouses over them.
- Returns
- the color used to highlight the handles then the user mouses over them.
|
inlineoverridevirtual |
Returns the name of the operator.
Reimplemented from HPS::Operator.
void HPS::HandlesOperator::GetPlaneTranslationAppearance | ( | float & | out_plane_offset, |
float & | out_plane_length, | ||
float & | out_center_radius | ||
) | const |
Returns the parameters used to decide the appearance of the rotation handles.
- Parameters
-
out_plane_offset The distance between the axis translation handle and the start of the plane translation handle, specified as a percentage of handle length. out_plane_length The size of plane translation handles, specified as a percentage of handle length. out_center_radius The radius of the sphere at the center of the handles, specified as a percentage of handle length.
void HPS::HandlesOperator::GetRotationHandleAppearance | ( | float & | out_offset, |
float & | out_angle, | ||
float & | out_tip_size | ||
) | const |
Returns the parameters used to decide the appearance of the rotation handles.
- Parameters
-
out_offset The distance between the end of a translation handle and the rotation handle associated with it, specified as a percentage of handle length. out_angle The angle formed by the rotation handles, specified in degrees. out_tip_size The size of the tip at the end of the handles, specified as a percentage of handle length.
|
inline |
Whether trailing geometry will be drawn when using the handles. Trailing geometry is geometry which shows you the path of the last movement operation you performed through the handles.
- Returns
- true if trailing geometry will be drawn, false otherwise.
|
overridevirtual |
This function is called whenever HPS receives a MouseEvent that signals a mouse button was pressed. If the user double clicks on a piece of geometry, handles will be inserted there. If the user clicks on a handle, the segment containing that handle will be translated or rotated appropriately. The user can click on the background to remove the handles.
- Parameters
-
in_state A MouseState object describing the current mouse state.
- Returns
- true if the input event was handled, false otherwise.
Reimplemented from HPS::Operator.
|
overridevirtual |
This function is called whenever HPS receives a MouseEvent that signals the mouse moved When users click and drag a handle, the associated geometry will be translated or rotated as appropriate.
- Parameters
-
in_state A MouseState object describing the current mouse state.
- Returns
- true if the input event was handled, false otherwise.
Reimplemented from HPS::Operator.
|
overridevirtual |
This function is called whenever HPS receives a MouseEvent that signals a mouse button was released
- Parameters
-
in_state A MouseState object describing the current mouse state.
- Returns
- true if the input event was handled, false otherwise.
Reimplemented from HPS::Operator.
|
overridevirtual |
This function is called whenever HPS receives a TouchEvent that signals the device was touched. If the user double taps a piece of geometry, handles will be inserted there. If the user taps on a handle, the segment containing that handle will be translated or rotated appropriately. The user can tap on the background to remove the handles.
- Parameters
-
in_state A TouchState object describing the current touch state.
- Returns
- true if the input event was handled, false otherwise.
Reimplemented from HPS::Operator.
|
overridevirtual |
This function is called whenever HPS receives a TouchEvent that signals a point of contact has moved. When users click and drag a handle, the associated geometry will be translated or rotated as appropriate.
- Parameters
-
in_state A TouchState object describing the current touch state.
- Returns
- true if the input event was handled, false otherwise.
Reimplemented from HPS::Operator.
|
overridevirtual |
This function is called whenever HPS receives a TouchEvent that signals a point of contact has been released.
- Parameters
-
in_state A TouchState object describing the current touch state.
- Returns
- true if the input event was handled, false otherwise.
Reimplemented from HPS::Operator.
|
overridevirtual |
This function is called whenever a view is attached to this operator.
Reimplemented from HPS::Operator.
|
overridevirtual |
This function is called whenever a view is detached from this operator.
Reimplemented from HPS::Operator.
void HPS::HandlesOperator::RemoveHandles | ( | HandleType | handle_type | ) |
Remove a type of handle from those displayed by this operator. Changes take place the next time handles are inserted, by either double clicking or double tapping on geometry.
- Parameters
-
handle_type The type of handle to be removed from those displayed.
void HPS::HandlesOperator::SetHandlesAppearance | ( | float | in_length = 0.16f , |
float | in_radius = 0.005f , |
||
size_t | in_handles_points = 30 |
||
) |
This function can be used to modify the appearance of handles. Changes will take effect the next time handles are inserted.
- Parameters
-
in_length The length of the handles, specified as a percentage of the view containing it. Valid range is (0, 1]. in_radius The radius of the handles, specified as a percentage of the view containing it. Valid range is (0, 1]. in_handles_points The number of points used to draw the handles. A higher number will yield a smoother appearance. Valid range is > 0.
|
inline |
This function is used to provide a set of colors which will be applied to the handles. The changes will take effect the next time the handles are inserted. The materials need to contain a diffuse color, and will be applied as follows: Entry 0 - translation handle in the x direction Entry 1 - translation handle in the y direction Entry 2 - translation handle in the z direction Entry 3 - rotation handle in the x direction Entry 4 - rotation handle in the y direction Entry 5 - rotation handle in the z direction Entry 6 - xz plane translation Entry 7 - xy plane translation Entry 8 - yz plane translation Entry 9 - center-sphere
- Parameters
-
in_colors An array of materials to be applied to the handles.
void HPS::HandlesOperator::SetHighlightColor | ( | RGBAColor const & | in_highlight_color | ) |
Sets the highlight color used when the user mouses over the handles. The default value for the highlight color is RGBAColor(1.0f, 0.55f, 0.0f)
- Parameters
-
in_highlight_color The color used to highlight handles when the user mouses over them.
void HPS::HandlesOperator::SetPlaneTranslationAppearance | ( | float | in_plane_offset = 0.2f , |
float | in_plane_length = 0.6f , |
||
float | in_center_radius = 0.2f |
||
) |
This function can be used to modify the appearance of the handles used to perform plane-translation. Changes will take effect the next time handles are inserted.
- Parameters
-
in_plane_offset The distance between the axis translation handle and the start of the plane translation handle, specified as a percentage of handle length. in_plane_length The size of plane translation handles, specified as a percentage of handle length. in_center_radius The radius of the sphere at the center of the handles, specified as a percentage of handle length.
void HPS::HandlesOperator::SetRotationHandleAppearance | ( | float | in_offset = 0.045f , |
float | in_angle = 25.0f , |
||
float | in_tip_size = 0.15f |
||
) |
This function can be used to modify the appearance of handles used to perform rotations. Changes will take effect the next time handles are inserted.
- Parameters
-
in_offset The distance between the end of a translation handle and the start of then rotation handle associated with it, specified as a percentage of handle length. Valid range is (0, 1]. in_angle The angle formed by the rotation handles, specified in degrees. Valid range is > 0 in_tip_size The size of the tip at the end of the handles, specified as a percentage of the handle length. Valid range is [0, 1].
|
inline |
Whether to draw trailing geometry when using the handles. Trailing geometry is geometry which shows you the path of the last movement operation you performed through the handles.
- Parameters
-
in_state Whether to draw trailing geometry when using the handles.
The documentation for this class was generated from the following file:
- include/sprk_ops.h