Hoops Visualize HPS  version 2018-SP2
Hoops Visualize HPS 3D Rendering Engine
Looking for a senior C++ dev?
I'm looking for work. Hire me!
HPS::HandlesOperator Class Reference

The HandlesOperator class defines an operator which allows the user to move geometry. More...

#include <sprk_ops.h>

Inheritance diagram for HPS::HandlesOperator:
Collaboration diagram for HPS::HandlesOperator:

Classes

class  GeometryTransformedEvent
 

Public Types

enum  HandleType {
  HandleType::Rotation,
  HandleType::AxisTranslation,
  HandleType::PlaneTranslation,
  HandleType::CenterPoint
}
 
enum  Priority {
  Priority::Low,
  Priority::Default,
  Priority::High
}
 

Public Member Functions

 HandlesOperator (MouseButtons in_mouse_trigger=MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger=ModifierKeys())
 
virtual HPS::UTF8 GetName () const override
 Returns the name of the operator. More...
 
virtual void OnViewAttached () override
 This function is called whenever a view is attached to this operator. More...
 
virtual void OnViewDetached () override
 This function is called whenever a view is detached from this operator. More...
 
virtual bool OnMouseDown (MouseState const &in_state) override
 This function is called whenever HPS receives a MouseEvent that signals a mouse button was pressed. More...
 
virtual bool OnMouseMove (MouseState const &in_state) override
 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. More...
 
virtual bool OnMouseUp (MouseState const &in_state) override
 This function is called whenever HPS receives a MouseEvent that signals a mouse button was released. More...
 
virtual bool OnTouchDown (TouchState const &in_state) override
 This function is called whenever HPS receives a TouchEvent that signals the device was touched. More...
 
virtual bool OnTouchMove (TouchState const &in_state) override
 This function is called whenever HPS receives a TouchEvent that signals a point of contact has moved. More...
 
virtual bool OnTouchUp (TouchState const &in_state) override
 This function is called whenever HPS receives a TouchEvent that signals a point of contact has been released. More...
 
void SetHandlesColors (MaterialKitArray const &in_colors)
 This function is used to provide a set of colors which will be applied to the handles. More...
 
MaterialKitArray GetHandlesColors () const
 This function returns the materials used to color the handles. More...
 
void SetHighlightColor (RGBAColor const &in_highlight_color)
 Sets the highlight color used when the user mouses over the handles. More...
 
RGBAColor GetHighlightColor () const
 Returns the color used to highlight the handles then the user mouses over them. More...
 
void 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. More...
 
void 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. More...
 
void 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. More...
 
void GetHandlesAppearance (float &out_length, float &out_radius, size_t &out_handles_points) const
 Returns the parameters used to decide the appearance of the handles. More...
 
void GetRotationHandleAppearance (float &out_offset, float &out_angle, float &out_tip_size) const
 Returns the parameters used to decide the appearance of the rotation handles. More...
 
void 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. More...
 
void SetTrailingGeometry (bool in_state)
 Whether to draw trailing geometry when using the handles. More...
 
bool GetTrailingGeometry () const
 Whether trailing geometry will be drawn when using the handles. More...
 
void AddHandles (HandleType handle_type)
 Add a type of handle to those displayed by this operator. More...
 
void RemoveHandles (HandleType handle_type)
 Remove a type of handle from those displayed by this operator. More...
 
HPS::Type ObjectType () const
 
virtual void Assign (Operator const &in_that)
 Assigns the parameter in_that to this operator, resulting in a clone. More...
 
virtual bool Equals (Operator const &in_that) const
 Tests this operator for equality against the parameter in_that. More...
 
virtual bool operator!= (Operator const &in_that) const
 Tests this operator for non-equality against the parameter in_that. More...
 
virtual bool operator== (Operator const &in_that) const
 Tests this operator for equality against the parameter in_that. More...
 
void DetachView ()
 Detaches the Operator from the View it was previously attached to. More...
 
View GetAttachedView () const
 Returns the View the Operator is currently attached to. More...
 
virtual bool OnMouseWheel (MouseState const &in_state)
 This function is called whenever HPS receives a MouseEvent that signals the mouse wheel was scrolled. More...
 
virtual bool OnMouseEnter (MouseState const &in_state)
 This function is called whenever HPS receives a MouseEvent that signals the mouse entered the window. More...
 
virtual bool OnMouseLeave (MouseState const &in_state)
 This function is called whenever HPS receives a MouseEvent that signals the mouse left the window. More...
 
virtual bool OnKeyDown (KeyboardState const &in_state)
 This function is called whenever HPS receives a KeyboardEvent that signals a key was pressed. More...
 
virtual bool OnKeyUp (KeyboardState const &in_state)
 This function is called whenever HPS receives a KeyboardEvent that signals a key was released. More...
 
virtual bool OnTextInput (HPS::UTF8 const &in_text)
 This function is called whenever HPS receives a TextInputEvent that signals text was entered. More...
 
virtual bool OnTimerTick (HPS::TimerTickEvent const &in_event)
 This function is called whenever HPS receives a TimerTickEvent. More...
 
virtual void OnModelAttached ()
 This function is called whenever a model is attached to the view that is attached to this operator. More...
 
virtual void OnModelDetached ()
 This function is called whenever a model is detached from the view that is attached to this operator. More...
 
void SetMouseTrigger (MouseButtons in_buttons)
 Sets the mouse trigger for this operator. More...
 
MouseButtons GetMouseTrigger () const
 Gets the mouse trigger associated with this operator. More...
 
void SetModifierTrigger (ModifierKeys in_modifiers)
 Sets the modifier trigger associated with this operator. More...
 
ModifierKeys GetModifierTrigger () const
 Gets the modifier trigger associated with this operator. More...
 
virtual bool IsMouseTriggered (MouseState const &in_state)
 Returns true if the MouseButtons and ModifierKeys are active. More...
 
virtual HPS::Type Type () const
 This function returns the true type of the underlying object. More...
 
virtual bool Empty () const
 Indicates whether this object has any values set on it. More...
 
virtual void Reset ()
 Resets this object to its initial, uninitialized state. More...
 
bool HasType (HPS::Type in_mask) const
 This function indicates whether this Object has the given Type mask. More...
 
intptr_t GetClassID () const
 Returns a unique identifier that is shared by all objects of the same class. More...
 
intptr_t GetInstanceID () const
 Returns an identifier that can be used to identify which instance of a class an object is. More...
 

Static Public Member Functions

template<typename T >
static intptr_t ClassID ()
 Unique identifier for this class. More...
 

Static Public Attributes

static const HPS::Type staticType = HPS::Type::Operator
 

Protected Attributes

HPS::MouseButtons mouse_trigger
 
HPS::ModifierKeys modifier_trigger
 

Private Types

enum  Movement {
  Movement::None,
  Movement::Translation,
  Movement::Rotation,
  Movement::PlaneTranslation,
  Movement::ViewPlaneTranslation
}
 
enum  InternalHandleType : size_t {
  rotation = 0,
  axis_translation,
  plane_translation,
  center_point_translation,
  last = center_point_translation
}
 

Private Member Functions

bool InputDown (size_t in_click_count, WindowKey const &in_window, KeyArray const &in_event_path, Point const &in_location)
 
bool InputMove (KeyPath const &in_path, Point const &in_location)
 
void InputUp (Point const &in_location)
 
void InsertHandles ()
 
void InsertRotationHandles ()
 
void InsertAxisTranslationHandles ()
 
void InsertPlaneTranslationHandles ()
 
void InsertCenterPoint ()
 
void RemoveHandles ()
 
bool HighlightHandles (WindowKey &in_window, KeyArray const &in_event_path, Point const &in_location)
 
void ReferenceGeometry (KeyPath const &in_path)
 
void CommitChanges ()
 

Private Attributes

CanvasArray canvases
 
View last_attached_view
 
TouchID tracked_touch_id
 
SegmentKey handles
 
SegmentKey handles_segment
 
SegmentKey handles_geometry
 
SegmentKey center_sphere
 
SegmentKey reference_segment
 
SegmentKey segment_to_move
 
SegmentKey temporary_segment_to_move
 
SegmentKey handles_trail
 
KeyPath path_to_segment_to_move
 
KeyPath complete_referenced_path
 
std::vector< bool > requested_handle_type
 
std::vector< bool > current_handle_type
 
WorldPoint handles_origin_point
 
WorldPoint movement_start_point
 
Point input_down_position
 
Camera::Projection camera_projection
 
SelectionOptionsKit geometry_selection_options
 
SelectionOptionsKit handles_selection_options
 
HighlightOptionsKit hide_highlight_options
 
HighlightOptionsKit partial_transparency_options
 
HighlightOptionsKit highlight_options
 
SegmentKey style_segment
 
SegmentKey transparency_style_segment
 
UTF8 style_name
 
bool something_is_highlighted
 
MaterialKitArray handles_colors
 
RGBAColor highlight_color
 
Key highlighted_handle
 
bool are_handles_on
 
bool remove_handles
 
Movement move_geometry
 
Movement previous_movement
 
Vector movement_direction
 
Plane movement_plane
 
Vector base_vector
 
float handles_length
 
float handles_radius
 
float arc_offset
 
float arc_angle
 
size_t arc_points
 
float tip_size
 
float plane_offset
 
float plane_length
 
float center_radius
 
CylinderKey x
 
CylinderKey y
 
CylinderKey z
 
CylinderKey arc_x
 
CylinderKey arc_y
 
CylinderKey arc_z
 
ShellKey xy
 
ShellKey xz
 
ShellKey yz
 
SphereKey center
 
bool display_trailing_geometry
 
Point trailing_line_start
 
Point trailing_circle_start
 
Point trailing_circle_center
 
Vector trailing_rotation
 
MarkerKey trail_marker
 
LineKey trailing_line
 
CircularArcKey trailing_circle
 
float rotation_direction
 

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 Enumeration Documentation

◆ HandleType

Enumerator
Rotation 
AxisTranslation 
PlaneTranslation 
CenterPoint 

◆ InternalHandleType

Enumerator
rotation 
axis_translation 
plane_translation 
center_point_translation 
last 

◆ Movement

enum HPS::HandlesOperator::Movement
strongprivate
Enumerator
None 
Translation 
Rotation 
PlaneTranslation 
ViewPlaneTranslation 

◆ Priority

enum HPS::Operator::Priority
stronginherited
Enumerator
Low 
Default 
High 

Constructor & Destructor Documentation

◆ HandlesOperator()

HPS::HandlesOperator::HandlesOperator ( MouseButtons  in_mouse_trigger = MouseButtons::ButtonLeft(),
ModifierKeys  in_modifier_trigger = ModifierKeys() 
)

Member Function Documentation

◆ AddHandles()

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_typeThe type of handle to be added to those displayed.

◆ Assign()

virtual void HPS::Operator::Assign ( Operator const &  in_that)
virtualinherited

Assigns the parameter in_that to this operator, resulting in a clone.

◆ ClassID()

template<typename T >
static intptr_t HPS::Object::ClassID ( )
inlinestaticinherited

Unique identifier for this class.

Note: this method uses construction of static objects. If used in a constructor, it should be used in the body not the initializer list.

◆ CommitChanges()

void HPS::HandlesOperator::CommitChanges ( )
private

◆ DetachView()

void HPS::Operator::DetachView ( )
inherited

Detaches the Operator from the View it was previously attached to.

◆ Empty()

virtual bool HPS::Object::Empty ( ) const
inlinevirtualinherited

Indicates whether this object has any values set on it.

Returns
true if no values are set on this object, false otherwise.

Reimplemented in HPS::STL::ImportResultsKit, HPS::STL::ImportOptionsKit, HPS::OBJ::ImportResultsKit, HPS::OBJ::ImportOptionsKit, HPS::Hardcopy::File::ExportOptionsKit, HPS::Stream::ExportOptionsKit, HPS::Stream::ImportResultsKit, HPS::Stream::ImportOptionsKit, HPS::PointCloud::ImportOptionsKit, HPS::PointCloud::ImportResultsKit, HPS::UpdateOptionsKit, HPS::HighlightSearchOptionsKit, HPS::HighlightOptionsKit, HPS::SelectionOptionsKit, HPS::SearchOptionsKit, HPS::CutGeometryGatheringOptionsKit, HPS::ShapeKit, HPS::ShaderKit, HPS::Shader::ImportOptionsKit, HPS::ImageKit, HPS::Image::ImportOptionsKit, HPS::Image::ExportOptionsKit, HPS::TextureOptionsKit, HPS::LinePatternKit, HPS::LinePatternParallelKit, HPS::LinePatternOptionsKit, HPS::GlyphKit, HPS::ApplicationWindowOptionsKit, HPS::OffScreenWindowOptionsKit, HPS::StandAloneWindowOptionsKit, HPS::GridKit, HPS::PolygonKit, HPS::MeshKit, HPS::ShellKit, HPS::ShellRelationResultsKit, HPS::ShellRelationOptionsKit, HPS::ShellOptimizationOptionsKit, HPS::TextKit, HPS::EllipticalArcKit, HPS::EllipseKit, HPS::TrimKit, HPS::NURBSSurfaceKit, HPS::NURBSCurveKit, HPS::SpotlightKit, HPS::InfiniteLineKit, HPS::CuttingSectionKit, HPS::CircularWedgeKit, HPS::CircularArcKit, HPS::CircleKit, HPS::SphereKit, HPS::CylinderKit, HPS::DistantLightKit, HPS::MarkerKit, HPS::LineKit, HPS::AttributeLockKit, HPS::FontInfoState, HPS::WindowInfoKit, HPS::DebuggingKit, HPS::SubwindowKit, HPS::ContourLineKit, HPS::VisualEffectsKit, HPS::TransformMaskKit, HPS::PostProcessEffectsKit, HPS::DrawingAttributeKit, HPS::HiddenLineAttributeKit, HPS::PerformanceKit, HPS::NURBSSurfaceAttributeKit, HPS::MaterialKit, HPS::MaterialMappingKit, HPS::MatrixKit, HPS::CurveAttributeKit, HPS::EdgeAttributeKit, HPS::LineAttributeKit, HPS::TextAttributeKit, HPS::CuttingSectionAttributeKit, HPS::CylinderAttributeKit, HPS::LightingAttributeKit, HPS::SphereAttributeKit, HPS::MarkerAttributeKit, HPS::CullingKit, HPS::ColorInterpolationKit, HPS::TransparencyKit, HPS::SelectabilityKit, HPS::CameraKit, HPS::VisibilityKit, HPS::BoundingKit, HPS::SegmentOptimizationOptionsKit, HPS::Publish::ExportOptionsKit, HPS::Publish::TextFieldKit, HPS::Publish::SignatureFieldKit, HPS::Publish::DropDownListKit, HPS::Exchange::TessellationOptionsKit, HPS::Publish::ListBoxKit, HPS::Exchange::ExportSTEPOptionsKit, HPS::Exchange::ExportParasolidOptionsKit, HPS::Publish::RadioButtonKit, HPS::Exchange::ExportIGESOptionsKit, HPS::Exchange::ExportXMLOptionsKit, HPS::Publish::CheckBoxKit, HPS::Exchange::ExportU3DOptionsKit, HPS::Exchange::ExportSTLOptionsKit, HPS::Publish::ButtonKit, HPS::Exchange::ExportPRCOptionsKit, HPS::Publish::LinkKit, HPS::Exchange::ExportJTOptionsKit, HPS::Publish::SlideTableKit, HPS::Exchange::ExportACISOptionsKit, HPS::Publish::TableKit, HPS::Exchange::Export3MFOptionsKit, HPS::Publish::ImageKit, HPS::Publish::TextKit, HPS::Exchange::ModelFileImportOptionsKit, HPS::Publish::ViewKit, HPS::Exchange::TranslationOptionsKit, HPS::Publish::ArtworkKit, HPS::Publish::AnnotationKit, HPS::ComponentPath, HPS::Exchange::ImportOptionsKit, HPS::Parasolid::ExportOptionsKit, HPS::Exchange::NURBSConversionOptionsKit, HPS::Parasolid::LineTessellationKit, HPS::Exchange::Configuration, HPS::Publish::PageKit, HPS::Parasolid::FacetTessellationKit, HPS::Publish::DocumentKit, HPS::Parasolid::ImportOptionsKit, HPS::DWG::ImportOptionsKit, HPS::OOC::ImportOptionsKit, HPS::Sketchup::ImportOptionsKit, and HPS::Sketchup::ImportResultsKit.

◆ Equals()

virtual bool HPS::Operator::Equals ( Operator const &  in_that) const
virtualinherited

Tests this operator for equality against the parameter in_that.

Same as Operator::operator==

◆ GetAttachedView()

View HPS::Operator::GetAttachedView ( ) const
inherited

Returns the View the Operator is currently attached to.

◆ GetClassID()

intptr_t HPS::Object::GetClassID ( ) const
inherited

Returns a unique identifier that is shared by all objects of the same class.

Returns
A unique value shared by all objects of the same class.

◆ GetHandlesAppearance()

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_lengthThe length of the handles, specified as a percentage of the view containing it.
out_radiusThe radius of the handles, specified as a percentage of the view containing it.
out_handles_pointsThe number of points used to draw the handles. A higher number will yield a smoother appearance.

◆ GetHandlesColors()

MaterialKitArray HPS::HandlesOperator::GetHandlesColors ( ) const
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

◆ GetHighlightColor()

RGBAColor HPS::HandlesOperator::GetHighlightColor ( ) const
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.

◆ GetInstanceID()

intptr_t HPS::Object::GetInstanceID ( ) const
inherited

Returns an identifier that can be used to identify which instance of a class an object is.

Different keys and controls will return the same value if they are backed by the same database resource.

Returns
A value unique to an instance of an object and all objects that are backed by the same database resource.

◆ GetModifierTrigger()

ModifierKeys HPS::Operator::GetModifierTrigger ( ) const
inlineinherited

Gets the modifier trigger associated with this operator.

◆ GetMouseTrigger()

MouseButtons HPS::Operator::GetMouseTrigger ( ) const
inlineinherited

Gets the mouse trigger associated with this operator.

◆ GetName()

virtual HPS::UTF8 HPS::HandlesOperator::GetName ( ) const
inlineoverridevirtual

Returns the name of the operator.

Reimplemented from HPS::Operator.

◆ GetPlaneTranslationAppearance()

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_offsetThe distance between the axis translation handle and the start of the plane translation handle, specified as a percentage of handle length.
out_plane_lengthThe size of plane translation handles, specified as a percentage of handle length.
out_center_radiusThe radius of the sphere at the center of the handles, specified as a percentage of handle length.

◆ GetRotationHandleAppearance()

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_offsetThe distance between the end of a translation handle and the rotation handle associated with it, specified as a percentage of handle length.
out_angleThe angle formed by the rotation handles, specified in degrees.
out_tip_sizeThe size of the tip at the end of the handles, specified as a percentage of handle length.

◆ GetTrailingGeometry()

bool HPS::HandlesOperator::GetTrailingGeometry ( ) const
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.

◆ HasType()

bool HPS::Object::HasType ( HPS::Type  in_mask) const
inherited

This function indicates whether this Object has the given Type mask.

Parameters
in_maskThe Type mask to check against this Object.
Returns
true if this Object has the given Type mask, false otherwise.

◆ HighlightHandles()

bool HPS::HandlesOperator::HighlightHandles ( WindowKey in_window,
KeyArray const &  in_event_path,
Point const &  in_location 
)
private

◆ InputDown()

bool HPS::HandlesOperator::InputDown ( size_t  in_click_count,
WindowKey const &  in_window,
KeyArray const &  in_event_path,
Point const &  in_location 
)
private

◆ InputMove()

bool HPS::HandlesOperator::InputMove ( KeyPath const &  in_path,
Point const &  in_location 
)
private

◆ InputUp()

void HPS::HandlesOperator::InputUp ( Point const &  in_location)
private

◆ InsertAxisTranslationHandles()

void HPS::HandlesOperator::InsertAxisTranslationHandles ( )
private

◆ InsertCenterPoint()

void HPS::HandlesOperator::InsertCenterPoint ( )
private

◆ InsertHandles()

void HPS::HandlesOperator::InsertHandles ( )
private

◆ InsertPlaneTranslationHandles()

void HPS::HandlesOperator::InsertPlaneTranslationHandles ( )
private

◆ InsertRotationHandles()

void HPS::HandlesOperator::InsertRotationHandles ( )
private

◆ IsMouseTriggered()

virtual bool HPS::Operator::IsMouseTriggered ( MouseState const &  in_state)
inlinevirtualinherited

Returns true if the MouseButtons and ModifierKeys are active.

Reimplemented in HPS::SimpleWalkOperator.

Here is the call graph for this function:

◆ ObjectType()

HPS::Type HPS::Operator::ObjectType ( ) const
inlinevirtualinherited

Reimplemented from HPS::Object.

Here is the call graph for this function:

◆ OnKeyDown()

virtual bool HPS::Operator::OnKeyDown ( KeyboardState const &  in_state)
inlinevirtualinherited

This function is called whenever HPS receives a KeyboardEvent that signals a key was pressed.

Parameters
in_stateA KeyboardState object describing the current keyboard state.
Returns
true if the input event was handled, false otherwise.

Reimplemented in HPS::Exchange::MeasurementOperator, HPS::AnnotationOperator, HPS::MarkupOperator, HPS::SimpleWalkOperator, and HPS::FlyOperator.

◆ OnKeyUp()

virtual bool HPS::Operator::OnKeyUp ( KeyboardState const &  in_state)
inlinevirtualinherited

This function is called whenever HPS receives a KeyboardEvent that signals a key was released.

Parameters
in_stateA KeyboardState object describing the current keyboard state.
Returns
true if the input event was handled, false otherwise.

Reimplemented in HPS::SimpleWalkOperator, and HPS::FlyOperator.

◆ OnModelAttached()

virtual void HPS::Operator::OnModelAttached ( )
inlinevirtualinherited

This function is called whenever a model is attached to the view that is attached to this operator.

If no view is attached to this operator, this function will not be called.

Reimplemented in HPS::NavigationCubeOperator, HPS::CuttingSectionOperator, HPS::SimpleWalkOperator, HPS::WalkOperator, HPS::FlyOperator, and HPS::MouseWheelOperator.

◆ OnModelDetached()

virtual void HPS::Operator::OnModelDetached ( )
inlinevirtualinherited

This function is called whenever a model is detached from the view that is attached to this operator.

If no view is attached to this operator, this function will not be called.

◆ OnMouseDown()

virtual bool HPS::HandlesOperator::OnMouseDown ( MouseState const &  in_state)
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_stateA MouseState object describing the current mouse state.
Returns
true if the input event was handled, false otherwise.

Reimplemented from HPS::Operator.

◆ OnMouseEnter()

virtual bool HPS::Operator::OnMouseEnter ( MouseState const &  in_state)
inlinevirtualinherited

This function is called whenever HPS receives a MouseEvent that signals the mouse entered the window.

Parameters
in_stateA MouseState object describing the current mouse state.
Returns
true if the input event was handled, false otherwise.

Reimplemented in HPS::SimpleWalkOperator.

◆ OnMouseLeave()

virtual bool HPS::Operator::OnMouseLeave ( MouseState const &  in_state)
inlinevirtualinherited

This function is called whenever HPS receives a MouseEvent that signals the mouse left the window.

Parameters
in_stateA MouseState object describing the current mouse state.
Returns
true if the input event was handled, false otherwise.

Reimplemented in HPS::SimpleWalkOperator.

◆ OnMouseMove()

virtual bool HPS::HandlesOperator::OnMouseMove ( MouseState const &  in_state)
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_stateA MouseState object describing the current mouse state.
Returns
true if the input event was handled, false otherwise.

Reimplemented from HPS::Operator.

◆ OnMouseUp()

virtual bool HPS::HandlesOperator::OnMouseUp ( MouseState const &  in_state)
overridevirtual

This function is called whenever HPS receives a MouseEvent that signals a mouse button was released.

Parameters
in_stateA MouseState object describing the current mouse state.
Returns
true if the input event was handled, false otherwise.

Reimplemented from HPS::Operator.

◆ OnMouseWheel()

virtual bool HPS::Operator::OnMouseWheel ( MouseState const &  in_state)
inlinevirtualinherited

This function is called whenever HPS receives a MouseEvent that signals the mouse wheel was scrolled.

Parameters
in_stateA MouseState object describing the current mouse state.
Returns
true if the input event was handled, false otherwise.

Reimplemented in HPS::SimpleWalkOperator, HPS::FlyOperator, HPS::TurntableOperator, and HPS::MouseWheelOperator.

◆ OnTextInput()

virtual bool HPS::Operator::OnTextInput ( HPS::UTF8 const &  in_text)
inlinevirtualinherited

This function is called whenever HPS receives a TextInputEvent that signals text was entered.

Parameters
in_textThe text entered.
Returns
true if the input event was handled, false otherwise.

Reimplemented in HPS::AnnotationOperator, and HPS::MarkupOperator.

◆ OnTimerTick()

virtual bool HPS::Operator::OnTimerTick ( HPS::TimerTickEvent const &  in_event)
inlinevirtualinherited

This function is called whenever HPS receives a TimerTickEvent.

Parameters
in_eventA TimerTickEvent object describing the current event state.
Returns
true if the input event was handled, false otherwise.

Reimplemented in HPS::CuttingSectionOperator, HPS::SimpleWalkOperator, HPS::WalkOperator, and HPS::FlyOperator.

◆ OnTouchDown()

virtual bool HPS::HandlesOperator::OnTouchDown ( TouchState const &  in_state)
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_stateA TouchState object describing the current touch state.
Returns
true if the input event was handled, false otherwise.

Reimplemented from HPS::Operator.

◆ OnTouchMove()

virtual bool HPS::HandlesOperator::OnTouchMove ( TouchState const &  in_state)
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_stateA TouchState object describing the current touch state.
Returns
true if the input event was handled, false otherwise.

Reimplemented from HPS::Operator.

◆ OnTouchUp()

virtual bool HPS::HandlesOperator::OnTouchUp ( TouchState const &  in_state)
overridevirtual

This function is called whenever HPS receives a TouchEvent that signals a point of contact has been released.

Parameters
in_stateA TouchState object describing the current touch state.
Returns
true if the input event was handled, false otherwise.

Reimplemented from HPS::Operator.

◆ OnViewAttached()

virtual void HPS::HandlesOperator::OnViewAttached ( )
overridevirtual

This function is called whenever a view is attached to this operator.

Reimplemented from HPS::Operator.

◆ OnViewDetached()

virtual void HPS::HandlesOperator::OnViewDetached ( )
overridevirtual

This function is called whenever a view is detached from this operator.

Reimplemented from HPS::Operator.

◆ operator!=()

virtual bool HPS::Operator::operator!= ( Operator const &  in_that) const
virtualinherited

Tests this operator for non-equality against the parameter in_that.

◆ operator==()

virtual bool HPS::Operator::operator== ( Operator const &  in_that) const
virtualinherited

Tests this operator for equality against the parameter in_that.

Same as Operator::Equals.

◆ ReferenceGeometry()

void HPS::HandlesOperator::ReferenceGeometry ( KeyPath const &  in_path)
private

◆ RemoveHandles() [1/2]

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_typeThe type of handle to be removed from those displayed.

◆ RemoveHandles() [2/2]

void HPS::HandlesOperator::RemoveHandles ( )
private

◆ Reset()

◆ SetHandlesAppearance()

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_lengthThe length of the handles, specified as a percentage of the view containing it. Valid range is (0, 1].
in_radiusThe radius of the handles, specified as a percentage of the view containing it. Valid range is (0, 1].
in_handles_pointsThe number of points used to draw the handles. A higher number will yield a smoother appearance. Valid range is > 0.

◆ SetHandlesColors()

void HPS::HandlesOperator::SetHandlesColors ( MaterialKitArray const &  in_colors)
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_colorsAn array of materials to be applied to the handles.

◆ SetHighlightColor()

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_colorThe color used to highlight handles when the user mouses over them.

◆ SetModifierTrigger()

void HPS::Operator::SetModifierTrigger ( ModifierKeys  in_modifiers)
inlineinherited

Sets the modifier trigger associated with this operator.

Parameters
in_modifiersThe modifier keys that are used to trigger this operator.

◆ SetMouseTrigger()

void HPS::Operator::SetMouseTrigger ( MouseButtons  in_buttons)
inlineinherited

Sets the mouse trigger for this operator.

◆ SetPlaneTranslationAppearance()

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_offsetThe distance between the axis translation handle and the start of the plane translation handle, specified as a percentage of handle length.
in_plane_lengthThe size of plane translation handles, specified as a percentage of handle length.
in_center_radiusThe radius of the sphere at the center of the handles, specified as a percentage of handle length.

◆ SetRotationHandleAppearance()

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_offsetThe 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_angleThe angle formed by the rotation handles, specified in degrees. Valid range is > 0
in_tip_sizeThe size of the tip at the end of the handles, specified as a percentage of the handle length. Valid range is [0, 1].

◆ SetTrailingGeometry()

void HPS::HandlesOperator::SetTrailingGeometry ( bool  in_state)
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_stateWhether to draw trailing geometry when using the handles.

◆ Type()

Member Data Documentation

◆ arc_angle

float HPS::HandlesOperator::arc_angle
private

◆ arc_offset

float HPS::HandlesOperator::arc_offset
private

◆ arc_points

size_t HPS::HandlesOperator::arc_points
private

◆ arc_x

CylinderKey HPS::HandlesOperator::arc_x
private

◆ arc_y

CylinderKey HPS::HandlesOperator::arc_y
private

◆ arc_z

CylinderKey HPS::HandlesOperator::arc_z
private

◆ are_handles_on

bool HPS::HandlesOperator::are_handles_on
private

◆ base_vector

Vector HPS::HandlesOperator::base_vector
private

◆ camera_projection

Camera::Projection HPS::HandlesOperator::camera_projection
private

◆ canvases

CanvasArray HPS::HandlesOperator::canvases
private

◆ center

SphereKey HPS::HandlesOperator::center
private

◆ center_radius

float HPS::HandlesOperator::center_radius
private

◆ center_sphere

SegmentKey HPS::HandlesOperator::center_sphere
private

◆ complete_referenced_path

KeyPath HPS::HandlesOperator::complete_referenced_path
private

◆ current_handle_type

std::vector<bool> HPS::HandlesOperator::current_handle_type
private

◆ display_trailing_geometry

bool HPS::HandlesOperator::display_trailing_geometry
private

◆ geometry_selection_options

SelectionOptionsKit HPS::HandlesOperator::geometry_selection_options
private

◆ handles

SegmentKey HPS::HandlesOperator::handles
private

◆ handles_colors

MaterialKitArray HPS::HandlesOperator::handles_colors
private

◆ handles_geometry

SegmentKey HPS::HandlesOperator::handles_geometry
private

◆ handles_length

float HPS::HandlesOperator::handles_length
private

◆ handles_origin_point

WorldPoint HPS::HandlesOperator::handles_origin_point
private

◆ handles_radius

float HPS::HandlesOperator::handles_radius
private

◆ handles_segment

SegmentKey HPS::HandlesOperator::handles_segment
private

◆ handles_selection_options

SelectionOptionsKit HPS::HandlesOperator::handles_selection_options
private

◆ handles_trail

SegmentKey HPS::HandlesOperator::handles_trail
private

◆ hide_highlight_options

HighlightOptionsKit HPS::HandlesOperator::hide_highlight_options
private

◆ highlight_color

RGBAColor HPS::HandlesOperator::highlight_color
private

◆ highlight_options

HighlightOptionsKit HPS::HandlesOperator::highlight_options
private

◆ highlighted_handle

Key HPS::HandlesOperator::highlighted_handle
private

◆ input_down_position

Point HPS::HandlesOperator::input_down_position
private

◆ last_attached_view

View HPS::HandlesOperator::last_attached_view
private

◆ modifier_trigger

HPS::ModifierKeys HPS::Operator::modifier_trigger
protectedinherited

◆ mouse_trigger

HPS::MouseButtons HPS::Operator::mouse_trigger
protectedinherited

◆ move_geometry

Movement HPS::HandlesOperator::move_geometry
private

◆ movement_direction

Vector HPS::HandlesOperator::movement_direction
private

◆ movement_plane

Plane HPS::HandlesOperator::movement_plane
private

◆ movement_start_point

WorldPoint HPS::HandlesOperator::movement_start_point
private

◆ partial_transparency_options

HighlightOptionsKit HPS::HandlesOperator::partial_transparency_options
private

◆ path_to_segment_to_move

KeyPath HPS::HandlesOperator::path_to_segment_to_move
private

◆ plane_length

float HPS::HandlesOperator::plane_length
private

◆ plane_offset

float HPS::HandlesOperator::plane_offset
private

◆ previous_movement

Movement HPS::HandlesOperator::previous_movement
private

◆ reference_segment

SegmentKey HPS::HandlesOperator::reference_segment
private

◆ remove_handles

bool HPS::HandlesOperator::remove_handles
private

◆ requested_handle_type

std::vector<bool> HPS::HandlesOperator::requested_handle_type
private

◆ rotation_direction

float HPS::HandlesOperator::rotation_direction
private

◆ segment_to_move

SegmentKey HPS::HandlesOperator::segment_to_move
private

◆ something_is_highlighted

bool HPS::HandlesOperator::something_is_highlighted
private

◆ staticType

const HPS::Type HPS::Operator::staticType = HPS::Type::Operator
staticinherited

◆ style_name

UTF8 HPS::HandlesOperator::style_name
private

◆ style_segment

SegmentKey HPS::HandlesOperator::style_segment
private

◆ temporary_segment_to_move

SegmentKey HPS::HandlesOperator::temporary_segment_to_move
private

◆ tip_size

float HPS::HandlesOperator::tip_size
private

◆ tracked_touch_id

TouchID HPS::HandlesOperator::tracked_touch_id
private

◆ trail_marker

MarkerKey HPS::HandlesOperator::trail_marker
private

◆ trailing_circle

CircularArcKey HPS::HandlesOperator::trailing_circle
private

◆ trailing_circle_center

Point HPS::HandlesOperator::trailing_circle_center
private

◆ trailing_circle_start

Point HPS::HandlesOperator::trailing_circle_start
private

◆ trailing_line

LineKey HPS::HandlesOperator::trailing_line
private

◆ trailing_line_start

Point HPS::HandlesOperator::trailing_line_start
private

◆ trailing_rotation

Vector HPS::HandlesOperator::trailing_rotation
private

◆ transparency_style_segment

SegmentKey HPS::HandlesOperator::transparency_style_segment
private

◆ x

CylinderKey HPS::HandlesOperator::x
private

◆ xy

ShellKey HPS::HandlesOperator::xy
private

◆ xz

ShellKey HPS::HandlesOperator::xz
private

◆ y

CylinderKey HPS::HandlesOperator::y
private

◆ yz

ShellKey HPS::HandlesOperator::yz
private

◆ z

CylinderKey HPS::HandlesOperator::z
private

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