sprk_ops.h
28 (51 + std::hash<float>()(x.red)) * 51 + std::hash<float>()(x.green) * 51 + std::hash<float>()(x.blue));
72 PanOrbitZoomOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
141 PanOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
195 OrbitOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
251 RelativeOrbitOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonMiddle(), ModifierKeys in_modifier_trigger = ModifierKeys());
287 ZoomOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
340 ConstructRectangleOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys(), bool draw_faces = false);
388 ZoomBoxOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
423 SelectAreaOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
443 void SetSelectionOptions(HPS::SelectionOptionsKit const & in_options) { selection_options = in_options; }
451 bool SelectCommon(HPS::WindowKey & in_window, HPS::ModifierKeys in_modifiers = HPS::ModifierKeys());
467 HighlightAreaOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
481 void SetHighlightOptions(HPS::HighlightOptionsKit const & in_options) { highlight_options = in_options; }
520 SelectOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
536 void SetSelectionOptions(HPS::SelectionOptionsKit const & in_options) { selection_options = in_options; }
547 bool SelectCommon(HPS::Point const & in_loc, HPS::WindowKey & in_window, HPS::ModifierKeys in_modifiers = HPS::ModifierKeys());
560 HighlightOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
570 void SetHighlightOptions(HPS::HighlightOptionsKit const & in_options) { highlight_options = in_options; }
596 MouseWheelOperator(ZoomType in_default_type = ZoomType::Accurate, HPS::ModifierKeys in_alternate_type_modifiers = HPS::ModifierKeys::KeyControl());
629 TurntableOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
737 FlyOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonRight(), ModifierKeys in_modifier_trigger = ModifierKeys());
820 /* Keyboard sensitivity affects the speed of movement of action triggered from the keyboard, such as walking forward by pressing W */
822 void SetKeyboardSensitivity(float in_keyboard_sensitivity) { keyboard_sensitivity = in_keyboard_sensitivity; }
824 /* Mouse sensitivity affects the speed of movement of action triggered from the mouse, such as rotating */
826 void SetMouseSensitivity(float in_mouse_sensitivity) { mouse_sensitivity = in_mouse_sensitivity; }
828 /* Left Joystick sensitivity affects the speed of movement of action triggered from the left joystick on touch devices */
830 void SetLeftJoystickSensitivity(float in_left_joystick_sensitivity) { left_joystick_sensitivity = in_left_joystick_sensitivity; }
832 /* Right Joystick sensitivity affects the speed of movement of action triggered from the right joystick on touch devices */
834 void SetRightJoystickSensitivity(float in_right_joystick_sensitivity) { right_joystick_sensitivity = in_right_joystick_sensitivity; }
837 The dead zone is an area around the initial touch down position where the user can move its finger
872 bool MoveWithTouch(HPS::Point & position, HPS::Point & target, HPS::Vector & up, HPS::Vector const & walking_direction);
970 WalkOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonRight(), ModifierKeys in_modifier_trigger = ModifierKeys());
1014 void AdjustWalkingDirection(HPS::Vector const & camera_direction, HPS::Vector const & camera_up);
1044 SimpleWalkOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
1059 virtual bool OnKeyDown(KeyboardState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1063 virtual bool OnKeyUp(KeyboardState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1187 bool Move(HPS::Point const & start, HPS::Point const & current, int directions, HPS::CameraKit & camera, ScaleFactor const & scale);
1283 CuttingSectionOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
1366 void SetPlaneHighlightOptions(HighlightOptionsKit const & in_highlight_options) { highlight_options = in_highlight_options; }
1374 void SetMouseOverHighlighting(bool in_enable_mouse_over_highlighting) { enable_mouse_over_highlighting = in_enable_mouse_over_highlighting; }
1392 bool GetIndicatorVisibility() { return (op_state == OpState::Uninitialized || op_state == OpState::FacePicking) ? true : false; }
1403 /* The operator needs to know the model bounding in order to display cutting sections of the appropriate size.
1404 * The bounding is calculated automatically the first time a section is inserted, and when the operator detects that a Component
1406 * If changes are made to the scene outside of the ones listed above, which should warrant the model bounding to be recalculated for
1407 * purposes of displaying cutting sections, the operator can be asked to do so by calling this function. */
1442 void TranslateCuttingPlane(KeyPath const & in_event_path, WindowPoint const & in_event_location);
1549 MarkupOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
1628 void SetTextAttribute(TextAttributeKit const & in_text_attributes) { current_attributes.text_attributes = in_text_attributes; }
1635 void SetLineAttribute(LineAttributeKit const & in_line_attributes) {current_attributes.line_attributes = in_line_attributes; }
1800 AnnotationOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
1885 AnnotationInsertedEvent(HPS::SegmentKey const & in_text_key, HPS::View const & in_view) : Event()
1959 SelectionOptionsKit annotation_selection_options; //selection options used when trying to select annotations
1962 UTF8 annotation_user_data; //the user data set on annotation geometry to distinguish it from non annotation geometry
1963 UTF8 annotation_shape; //the name of the shape definition used to draw the annotation background
1965 PortfolioKey current_portfolio; //the portfolio used to store the default definitions used by this operator
1976 //touch only flags -- these flags are only relevant when running the operator on a touch enabled device
1979 CameraKit original_camera; //the camera setting as they were just before the annotation text is edited
1980 KeyboardHiddenEventHandler handler; //a handler that takes care of resetting the camera when the software keyboard is hidden
1982 bool always_show_keyboard_on_touch_up; //true if we are just inserting the annotation, false if we are editing a previously inserted one.
2010 HandlesOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
2121 void SetHandlesAppearance(float in_length = 0.16f, float in_radius = 0.005f, size_t in_handles_points = 30);
2128 void SetRotationHandleAppearance(float in_offset = 0.045f, float in_angle = 25.0f, float in_tip_size = 0.15f);
2135 void SetPlaneTranslationAppearance(float in_plane_offset = 0.2f, float in_plane_length = 0.6f, float in_center_radius = 0.2f);
2148 void GetHandlesAppearance(float & out_length, float & out_radius, size_t & out_handles_points) const;
2154 void GetRotationHandleAppearance(float & out_offset, float & out_angle, float & out_tip_size) const;
2160 void GetPlaneTranslationAppearance(float & out_plane_offset, float & out_plane_length, float & out_center_radius) const;
2200 GeometryTransformedEvent(HPS::View const & in_view, HPS::SegmentKey const & in_segment_key, HPS::MatrixKit const & in_transform) : Event()
2264 CanvasArray canvases; //A list of Canvas objects that the View attached to this operator belongs to. This value only gets updated on OnViewAttached.
2269 SegmentKey handles_segment; //segment where the matrices for the handles transformations are accumulated
2274 SegmentKey temporary_segment_to_move; //segment where we accumulate changes while the handles are active
2282 ComponentPath component_path_to_move; //Analogous to path_to_segment_to_move in the case where a CADModel is valid.
2283 Component component_to_move; //Analogous to segment_to_move in the case where a CADModel is valid.
2320 float arc_offset; //Distance between the end of the translation handle and the start of the translation arc. Expressed in percentage of handles_length [0 - 1].
2323 float tip_size; //The size of the tips at the end of the handles, specified as a percentage of the handles length
2324 float plane_offset; //The distance between the axis translation handle and the start of the plane translation handle, specified as a percentage of handles_length.
2325 float plane_length; //The length of the plane translation handle, specified as a percentage of handles_length.
2351 bool InputDown(size_t in_click_count, WindowKey const & in_window, KeyArray const & in_event_path, Point const & in_location);
2361 bool HighlightHandles(WindowKey & in_window, KeyArray const & in_event_path, Point const & in_location);
2366 //copies the accumulated transform from the reference geometry segment back into the original place.
2368 //if a CADModel is associated with this operator, it propagates the changes to the Component and PRC/Parasolid geometry
2426 MeasurementOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
2561 void SetLineMeasurementPosition(LineMeasurementPosition in_position) { line_measurement_position = in_position; }
2564 LineMeasurementPosition GetLineMeasurementPosition() const { return line_measurement_position; }
2567 * When Body is selected, and an Exchange or Parasolid CADModel is associated with this operator,
2568 * the minimum distance between two selected Representation Items (for Exchange) or Bodies (for Parasolid) will be computed.
2569 * If Entity is selected, the distance will be calculated between the topological faces being selected
2571 void SetDistanceMeasurementReference(DistanceMeasurementReference in_reference) { distance_measurement_reference = in_reference; }
2574 DistanceMeasurementReference GetDistanceMeasurementReference() const { return distance_measurement_reference; }
2576 /* An event which will be injected when a measurement is inserted into the scene through this operator.
2577 * Intercepting this event through a class derived from HPS::EventHandler allows for fine control over measurements
2579 * Information about the inserted measurement, such as its type and value is also conveyed through this Event */
2650 bool InputDown(size_t in_click_count, WindowKey const & in_window, KeyArray const & in_event_path, Point const & in_location);
2651 bool InputMove(WindowKey const & in_window, KeyPath const & in_path, Point const & in_location);
2652 void InputUp(WindowKey const & in_window, KeyArray const & in_event_path, Point const & in_location);
2666 TextKey InsertMeasurementText(Point const & text_insertion_point, float measurement, HPS::UTF8 const & suffix_str = HPS::UTF8());
2671 Point ClosestPointOnTriangleToPoint(Point const & p, Point const & a, Point const & b, Point const & c);
2672 double ClosestPointSegmentSegment(Point const & p1, Point const & q1, Point const & p2, Point const & q2, Point & c1, Point & c2);
2674 bool SelectSnappingToVertex(WindowKey const & in_window, Point const & in_location, bool & point_is_snap_point);
2678 Point GetWorldPointFromVertex(size_t in_vertex_index, Key in_owning_geometry, KeyPath const & in_path_to_geometry);
2686 bool MeasurementLabelUnderCursor(WindowKey const & in_window, WindowPoint const & in_location, TextKey & out_text);
2694 TouchID tracked_touch_ID; // for touch events, the ID of the touch that started the measurement insertion
2695 MeasurementType current_measurement_type; // what kind of measurement is currently being inserted
2727 SegmentKey current_measurement_segment; //segment where the current measurement should be inserted
Definition: hps.h:6514
Definition: hps.h:85
MaterialKitArray GetHandlesColors() const
Definition: sprk_ops.h:2105
MeasurementEvent()
Definition: sprk_ops.h:2584
MarkupInsertedEvent(Event const &in_event)
Definition: sprk_ops.h:1669
HPS::Rectangle GetWindowRectangle() const
Definition: sprk_ops.h:359
Definition: sprk.h:1102
std::vector< SegmentKey, Allocator< SegmentKey > > SegmentKeyArray
Array of type HPS::SegmentKey.
Definition: hps.h:6942
An InvalidSpecificationException is thrown when a method is called with non-sensical or contradictory...
Definition: hps.h:6118
Definition: sprk_ops.h:1041
float GetIndicatorScale() const
Definition: sprk_ops.h:1346
Definition: sprk_ops.h:284
std::vector< LineKey, Allocator< LineKey > > LineKeyArray
Array of type HPS::LineKey.
Definition: hps.h:7003
Definition: hps.h:38140
Definition: hps.h:1838
Definition: sprk_ops.h:408
void SetMarkupType(MarkupType in_markup_type)
Definition: sprk_ops.h:1614
std::vector< KeyPath, Allocator< KeyPath > > KeyPathArray
Array of type HPS::KeyPath.
Definition: hps.h:6980
Definition: hps.h:49288
Definition: hps.h:8044
Definition: sprk_ops.h:69
AnnotationInsertedEvent()
Definition: sprk_ops.h:1879
Definition: hps.h:3729
Definition: hps.h:6884
void SetIndicatorScale(float in_scale)
Definition: sprk_ops.h:1350
HPS::SelectionOptionsKit GetSelectionOptions() const
Definition: sprk_ops.h:541
Definition: hps.h:16810
Definition: sprk_ops.h:626
GeometryTransformedEvent(Event const &in_event)
Definition: sprk_ops.h:2211
void SetHandlesColors(MaterialKitArray const &in_colors)
Definition: sprk_ops.h:2088
void SetPlaneHighlightOptions(HighlightOptionsKit const &in_highlight_options)
Definition: sprk_ops.h:1366
Definition: sprk_ops.h:2190
Definition: sprk_ops.h:505
Definition: sprk_ops.h:20
Definition: sprk_ops.h:192
TextAttributeKit GetTextAttributes()
Definition: sprk_ops.h:1625
GeometryTransformedEvent()
Definition: sprk_ops.h:2194
Definition: hps.h:1662
Definition: hps.h:9288
RGBAColor GetHighlightColor() const
Definition: sprk_ops.h:2114
void SetLineAttribute(LineAttributeKit const &in_line_attributes)
Definition: sprk_ops.h:1635
Definition: sprk_ops.h:337
Definition: sprk_ops.h:1649
Definition: sprk_ops.h:690
void SetSelectionOptions(HPS::SelectionOptionsKit const &in_options)
Definition: sprk_ops.h:536
HPS::SelectionOptionsKit GetSelectionOptions() const
Definition: sprk_ops.h:448
Definition: sprk_ops.h:1271
Definition: sprk_ops.h:2007
MeasurementEvent(Event const &in_event)
Definition: sprk_ops.h:2607
Definition: hps.h:49186
Definition: sprk_ops.h:734
Definition: sprk_ops.h:458
virtual HPS::UTF8 GetName() const override
Definition: sprk_ops.h:1803
std::vector< MaterialKit, Allocator< MaterialKit > > MaterialKitArray
Array of type HPS::MaterialKit.
Definition: hps.h:6959
Definition: hps.h:4697
Definition: sprk_ops.h:2423
Definition: sprk_ops.h:1538
AnnotationInsertedEvent(Event const &in_event)
Definition: sprk_ops.h:1895
bool GetIndicatorVisibility()
Definition: sprk_ops.h:1392
Event * Clone() const
Definition: sprk_ops.h:2228
Definition: hps.h:4636
Definition: hps.h:7396
Definition: hps.h:48657
Definition: hps.h:45484
HPS::Rectangle GetInnerWindowRectangle() const
Definition: sprk_ops.h:364
Definition: hps.h:6348
Definition: hps.h:47547
Definition: hps.h:44563
Definition: hps.h:49073
void SetTrailingGeometry(bool in_state)
Definition: sprk_ops.h:2165
Definition: sprk_ops.h:553
Definition: hps.h:16183
HighlightOptionsKit GetPlaneHighlightOptions() const
Definition: sprk_ops.h:1362
Definition: hps.h:15426
bool GetMouseOverHighlighting() const
Definition: sprk_ops.h:1370
Definition: hps.h:45771
Definition: hps.h:48164
bool GetTrailingGeometry() const
Definition: sprk_ops.h:2170
Event * Clone() const
Definition: sprk_ops.h:1911
Definition: hps.h:6598
void SetSelectionOptions(HPS::SelectionOptionsKit const &in_options)
Definition: sprk_ops.h:443
Definition: hps.h:14431
std::vector< HPS::Type, Allocator< HPS::Type > > TypeArray
Array of type HPS::Type.
Definition: hps.h:7001
virtual bool OnKeyDown(KeyboardState const &in_state)
Definition: sprk_ops.h:1059
void SetMouseOverHighlighting(bool in_enable_mouse_over_highlighting)
Definition: sprk_ops.h:1374
Definition: sprk_ops.h:241
LineAttributeKit GetLineAttributes()
Definition: sprk_ops.h:1632
MeasurementType GetMeasurementType() const
Definition: sprk_ops.h:2525
Definition: sprk_ops.h:1875
void SetHighlightOptions(HPS::HighlightOptionsKit const &in_options)
Definition: sprk_ops.h:481
Definition: sprk_ops.h:1797
MaterialMappingKit GetPlaneMaterial() const
Definition: sprk_ops.h:1354
Definition: hps.h:47472
std::vector< Key, Allocator< Key > > KeyArray
Array of type HPS::Key.
Definition: hps.h:6952
DistanceMeasurementReference
Definition: sprk_ops.h:2445
Definition: sprk_ops.h:2580
std::vector< Plane, Allocator< Plane > > PlaneArray
Array of type HPS::Plane.
Definition: hps.h:6935
Definition: sprk_ops.h:583
HPS::HighlightOptionsKit GetHighlightOptions() const
Definition: sprk_ops.h:486
Definition: sprk_ops.h:967
Definition: hps.h:9446
Definition: hps.h:7962
DistanceMeasurementReference GetDistanceMeasurementReference() const
Definition: sprk_ops.h:2574
std::vector< Point, Allocator< Point > > PointArray
Array of type HPS::Point.
Definition: hps.h:6925
HPS::HighlightOptionsKit GetHighlightOptions() const
Definition: sprk_ops.h:575
Definition: hps.h:9675
Definition: hps.h:11377
void SetTextAttribute(TextAttributeKit const &in_text_attributes)
Definition: sprk_ops.h:1628
Definition: hps.h:25090
Definition: hps.h:25452
Definition: sprk.h:3919
void SetLineMeasurementPosition(LineMeasurementPosition in_position)
Definition: sprk_ops.h:2561
Definition: sprk.h:1945
Definition: sprk_ops.h:138
virtual bool OnKeyUp(KeyboardState const &in_state)
Definition: sprk_ops.h:1063
virtual HPS::UTF8 GetName() const override
Definition: sprk_ops.h:2467
std::vector< ShellKey, Allocator< ShellKey > > ShellKeyArray
Array of type HPS::ShellKey.
Definition: hps.h:7002
MarkupInsertedEvent()
Definition: sprk_ops.h:1653
void SetHighlightOptions(HPS::HighlightOptionsKit const &in_options)
Definition: sprk_ops.h:570
LineMeasurementPosition GetLineMeasurementPosition() const
Definition: sprk_ops.h:2564
Definition: sprk_ops.h:385
std::vector< size_t, Allocator< size_t > > SizeTArray
Array of type size_t.
Definition: hps.h:6940