The SimpleWalkOperator class defines an operator which allows the user to move forward and backwards and rotate while staying snapped to a plane. More...
#include <sprk_ops.h>
Classes | |
class | ScaleFactor |
Public Types | |
enum | Axis { Axis::X, Axis::Y, Axis::Z, Axis::Negative_X, Axis::Negative_Y, Axis::Negative_Z } |
enum | Priority { Priority::Low, Priority::Default, Priority::High } |
Public Member Functions | |
SimpleWalkOperator (MouseButtons in_mouse_trigger=MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger=ModifierKeys()) | |
virtual HPS::UTF8 | GetName () const |
Returns the name of the operator. 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 | OnViewAttached () |
This function is called whenever a view is attached to this operator. More... | |
virtual bool | OnKeyDown (KeyboardState const &in_state) |
This function is called whenever HPS receives a KeyboardState event that signals a button was pressed. More... | |
virtual bool | OnKeyUp (KeyboardState const &in_state) |
This function is called whenever HPS receives a KeyboardState event that signals a button was released. More... | |
virtual bool | OnMouseWheel (MouseState const &in_state) |
This function is called whenever HPS receives a MouseEvent that signals the mouse wheel moved. More... | |
virtual bool | OnMouseDown (MouseState const &in_state) |
This function is called whenever HPS receives a MouseEvent that signals a mouse button was pressed. More... | |
virtual bool | OnMouseMove (MouseState const &in_state) |
This function is called whenever HPS receives a MouseEvent that signals the mouse moved This function rotates the camera in place and moves forward/back if the left mouse button is down. More... | |
virtual bool | OnMouseUp (MouseState const &in_state) |
This function is called whenever HPS receives a MouseEvent that signals a mouse button was released. 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 | OnTouchDown (TouchState const &in_state) |
This function is called whenever HPS receives a TouchEvent that signals the device was touched. More... | |
virtual bool | OnTouchMove (TouchState const &in_state) |
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) |
This function is called whenever HPS receives a TouchEvent that signals a point of contact has been released. More... | |
virtual bool | OnTimerTick (HPS::TimerTickEvent const &in_event) |
This function is called whenever HPS receives a TimerTickEvent This function moves the camera. More... | |
void | SetKeyboardShiftKey (bool in_state) |
This function sets the Shift key state in this operator. More... | |
void | SetKeyboardControlKey (bool in_state) |
This function sets the Control key state in this operator. More... | |
void | SetEnableMiddleMouseButtonDolly (bool in_enable) |
This function enables or disables Camera Dolly operations using the middle mouse button. More... | |
bool | GetEnableMiddleMouseButtonDolly () const |
This function returns the state of Camera Dolly operations using the middle mouse button. More... | |
bool | IsMouseTriggered (MouseState const &in_state) |
This function overrides the base class implementation to additionally inspect in_state for the middle mouse button state if middle mouse button Camera Dollying is enabled. More... | |
void | SetGroundPlane (HPS::Plane const &in_plane) |
HPS::Plane | GetGroundPlane () const |
void | SetWalkerHeight (float height) |
float | GetWalkerHeight () const |
Axis | GetPrimaryUpAxis () const |
Axis | UpdatePrimaryUpAxis (HPS::Vector const &v) |
virtual void | OnViewDetached () |
This function is called whenever a view is detached from this operator. More... | |
void | InvertXAxis () |
void | InvertYAxis () |
bool | IsXAxisInverted () const |
bool | IsYAxisInverted () const |
float | GetKeyboardSensitivity () const |
void | SetKeyboardSensitivity (float in_keyboard_sensitivity) |
float | GetMouseSensitivity () const |
void | SetMouseSensitivity (float in_mouse_sensitivity) |
float | GetLeftJoystickSensitivity () const |
void | SetLeftJoystickSensitivity (float in_left_joystick_sensitivity) |
float | GetRightJoystickSensitivity () const |
void | SetRightJoystickSensitivity (float in_right_joystick_sensitivity) |
float | GetJoystickDeadZone () const |
void | SetJoystickDeadZone (float in_dead_zone) |
float | GetSceneExtents () const |
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 | OnTextInput (HPS::UTF8 const &in_text) |
This function is called whenever HPS receives a TextInputEvent that signals text was entered. 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 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 | |
static Axis | GetPrimaryAxis (HPS::Vector const &v) |
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 Types | |
enum | MovementFlags { no_movement = 0x0000, moving_forward = 0x0001, moving_back = 0x0002, moving_left = 0x0004, moving_right = 0x0008, moving_up = 0x0010, moving_down = 0x0020, roll_left = 0x0040, roll_right = 0x0080, rotating = 0x0100, move_with_touch = 0x0200, rotate_with_touch = 0x0400 } |
Protected Member Functions | |
void | MoveLeft (HPS::Point &position, HPS::Point &target, HPS::Vector &up) |
void | MoveRight (HPS::Point &position, HPS::Point &target, HPS::Vector &up) |
void | MoveUp (HPS::Point &position, HPS::Point &target, HPS::Vector &up) |
void | MoveDown (HPS::Point &position, HPS::Point &target, HPS::Vector &up) |
void | MoveForward (HPS::Point &position, HPS::Point &target, HPS::Vector const &direction) |
void | MoveBack (HPS::Point &position, HPS::Point &target, HPS::Vector const &direction) |
bool | MoveWithTouch (HPS::Point &position, HPS::Point &target, HPS::Vector &up, HPS::Vector const &walking_direction) |
bool | RotateScene (HPS::Point &position, HPS::Point &target) |
bool | RotateWithTouch (HPS::Point &position, HPS::Point &target) |
void | RotateCommon (HPS::Point const &delta, HPS::Point &position, HPS::Point &target) |
Protected Attributes | |
unsigned int | movement_flags |
HPS::MouseButtons | mouse_trigger |
HPS::ModifierKeys | modifier_trigger |
Private Member Functions | |
void | Pan (float in_theta, float in_phi) |
void | Dolly (float in_right, float in_up, float in_forward) |
void | ResetCamera (HPS::CameraKit &camera) const |
float | CalculatePitch (HPS::CameraKit &camera) const |
bool | NotableCameraDifference (HPS::CameraKit const &camera1, HPS::CameraKit const &camera2) |
int | DirectionForward () const |
int | DirectionHorizontal () const |
int | DirectionVertical () const |
int | DirectionRoll () const |
int | DirectionPitch () const |
int | DirectionYaw () const |
bool | Move (HPS::Point const &start, HPS::Point const ¤t, int directions, HPS::CameraKit &camera, ScaleFactor const &scale) |
void | Init () |
The SimpleWalkOperator class defines an operator which allows the user to move forward and backwards and rotate while staying snapped to a plane.
Left-button down and move: | Dollies the camera forward or backward, or Pans the camera left or right based on the mouse movement direction. The movement velocity changes based on how far the mouse is dragged from the starting point. |
Middle-button down and move: | Dollies the camera vertically or horizontally based on the mouse movement direction. The movement velocity changes based on how far the mouse is dragged from the starting point. |
Shift: | With the Shift key down the forward/backward velocity is ten times faster. |
Ctrl: | With the Ctrl key down the forward/backward velocity is ten times slower, and the left/right velocity is 45% slower. |
Mouse wheel: | Pans the camera vertically. This will change the tilt direction that the camera is looking, but does not change the direction of forward/backward movement. |
Shift + mouse wheel: | Increases or decreases the base velocity of Dolly operations. |
Single Finger Drag | Dollies the camera forward or backward, or Pans the camera left or right based on the touch movement direction. The movement velocity changes based on how far the touch is dragged from the starting point. |
Two Finger Drag | Dollies the camera vertically or horizontally based on the touch movement direction. The movement velocity changes based on how far the touch is dragged from the starting point. |
Shift: | With the Shift key down the forward/backward velocity is ten times faster. |
Ctrl: | With the Ctrl key down the forward/backward velocity is ten times slower, and the left/right velocity is 45% slower. |
|
stronginherited |
|
protectedinherited |
|
stronginherited |
HPS::SimpleWalkOperator::SimpleWalkOperator | ( | MouseButtons | in_mouse_trigger = MouseButtons::ButtonLeft() , |
ModifierKeys | in_modifier_trigger = ModifierKeys() |
||
) |
|
virtualinherited |
Assigns the parameter in_that to this operator, resulting in a clone.
|
private |
|
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.
|
inherited |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
private |
|
inlinevirtualinherited |
Indicates whether this object has any values set on it.
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.
|
virtualinherited |
Tests this operator for equality against the parameter in_that.
Same as Operator::operator==
|
inherited |
|
inherited |
Returns a unique identifier that is shared by all objects of the same class.
bool HPS::SimpleWalkOperator::GetEnableMiddleMouseButtonDolly | ( | ) | const |
This function returns the state of Camera Dolly operations using the middle mouse button.
The SimpleWalkOperator has Camera Dolly operations fixed to the middle mouse button by default. To disable this behavior, set this value to false.
|
inlineinherited |
|
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.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Gets the modifier trigger associated with this operator.
|
inlineinherited |
|
inlineinherited |
Gets the mouse trigger associated with this operator.
|
inlinevirtual |
Returns the name of the operator.
Reimplemented from HPS::WalkOperator.
|
staticinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inherited |
|
private |
|
inlineinherited |
|
inlineinherited |
|
virtual |
This function overrides the base class implementation to additionally inspect in_state for the middle mouse button state if middle mouse button Camera Dollying is enabled.
Reimplemented from HPS::Operator.
|
inlineinherited |
|
inlineinherited |
|
private |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
private |
|
inlinevirtualinherited |
|
inlinevirtual |
This function is called whenever HPS receives a KeyboardState event that signals a button was pressed.
This operator does not handle key down events.
Reimplemented from HPS::FlyOperator.
|
inlinevirtual |
This function is called whenever HPS receives a KeyboardState event that signals a button was released.
This operator does not handle key up events.
Reimplemented from HPS::FlyOperator.
|
virtual |
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 from HPS::WalkOperator.
|
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.
|
virtual |
This function is called whenever HPS receives a MouseEvent that signals a mouse button was pressed.
This function starts the operator and computes the position of the starting point.
in_state | A MouseState object describing the current mouse state. |
Reimplemented from HPS::FlyOperator.
|
virtual |
This function is called whenever HPS receives a MouseEvent that signals the mouse entered the window.
in_state | A MouseState object describing the current mouse state. |
Reimplemented from HPS::Operator.
|
virtual |
This function is called whenever HPS receives a MouseEvent that signals the mouse left the window.
in_state | A MouseState object describing the current mouse state. |
Reimplemented from HPS::Operator.
|
virtual |
This function is called whenever HPS receives a MouseEvent that signals the mouse moved This function rotates the camera in place and moves forward/back if the left mouse button is down.
in_state | A MouseState object describing the current mouse state. |
Reimplemented from HPS::FlyOperator.
|
virtual |
This function is called whenever HPS receives a MouseEvent that signals a mouse button was released.
in_state | A MouseState object describing the current mouse state. |
Reimplemented from HPS::FlyOperator.
|
virtual |
This function is called whenever HPS receives a MouseEvent that signals the mouse wheel moved.
in_state | A MouseState object describing the current mouse state. |
Reimplemented from HPS::FlyOperator.
|
inlinevirtualinherited |
This function is called whenever HPS receives a TextInputEvent that signals text was entered.
in_text | The text entered. |
Reimplemented in HPS::AnnotationOperator, and HPS::MarkupOperator.
|
virtual |
This function is called whenever HPS receives a TimerTickEvent This function moves the camera.
in_state | A TimerTickEvent object describing the current timer tick. |
Reimplemented from HPS::WalkOperator.
|
virtual |
This function is called whenever HPS receives a TouchEvent that signals the device was touched.
in_state | A TouchState object describing the current touch state. |
Reimplemented from HPS::FlyOperator.
|
virtual |
This function is called whenever HPS receives a TouchEvent that signals a point of contact has moved.
in_state | A TouchState object describing the current touch state. |
Reimplemented from HPS::FlyOperator.
|
virtual |
This function is called whenever HPS receives a TouchEvent that signals a point of contact has been released.
Reimplemented from HPS::FlyOperator.
|
virtual |
This function is called whenever a view is attached to this operator.
Reimplemented from HPS::WalkOperator.
|
virtualinherited |
This function is called whenever a view is detached from this operator.
Reimplemented from HPS::Operator.
|
virtualinherited |
Tests this operator for non-equality against the parameter in_that.
|
virtualinherited |
Tests this operator for equality against the parameter in_that.
Same as Operator::Equals.
|
private |
|
virtualinherited |
Resets this object to its initial, uninitialized state.
Reimplemented in HPS::EventHandler, HPS::EventDispatcher, HPS::World, HPS::HighlightSearchResults, HPS::HighlightSearchResultsIterator, HPS::SelectionResults, HPS::SelectionResultsIterator, HPS::FontSearchResults, HPS::FontSearchResultsIterator, HPS::SearchResults, and HPS::SearchResultsIterator.
|
private |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
void HPS::SimpleWalkOperator::SetEnableMiddleMouseButtonDolly | ( | bool | in_enable | ) |
This function enables or disables Camera Dolly operations using the middle mouse button.
The SimpleWalkOperator has Camera Dolly operations fixed to the middle mouse button by default. To disable this behavior, set this value to false.
in_state | The new state of middle mouse button dollying. |
|
inlineinherited |
|
inlineinherited |
void HPS::SimpleWalkOperator::SetKeyboardControlKey | ( | bool | in_state | ) |
|
inlineinherited |
void HPS::SimpleWalkOperator::SetKeyboardShiftKey | ( | bool | in_state | ) |
This function sets the Shift key state in this operator.
Call this function from your application to inform the the operator of the Shift key state. The Shift key increases the mouse trigger button forward/backward velocity.
in_state | The new state of the Shift key. |
|
inlineinherited |
|
inlineinherited |
Sets the modifier trigger associated with this operator.
in_modifiers | The modifier keys that are used to trigger this operator. |
|
inlineinherited |
|
inlineinherited |
Sets the mouse trigger for this operator.
|
inlineinherited |
|
inlineinherited |
|
virtualinherited |
This function returns the true type of the underlying object.
This function is useful for finding the type of smart pointer objects that have been cast to more generic types.
Reimplemented in HPS::UpdateOptionsControl, HPS::HighlightControl, HPS::SelectionOptionsControl, HPS::OffScreenWindowOptionsControl, HPS::ApplicationWindowOptionsControl, HPS::StandAloneWindowOptionsControl, HPS::AttributeLockControl, HPS::WindowInfoControl, HPS::DebuggingControl, HPS::SubwindowControl, HPS::ContourLineControl, HPS::VisualEffectsControl, HPS::TransformMaskControl, HPS::PostProcessEffectsControl, HPS::DrawingAttributeControl, HPS::HiddenLineAttributeControl, HPS::PerformanceControl, HPS::NURBSSurfaceAttributeControl, HPS::ConditionControl, HPS::StyleControl, HPS::PortfolioControl, HPS::MaterialMappingControl, HPS::TextureMatrixControl, HPS::ModellingMatrixControl, HPS::CurveAttributeControl, HPS::EdgeAttributeControl, HPS::LineAttributeControl, HPS::TextAttributeControl, HPS::CuttingSectionAttributeControl, HPS::CylinderAttributeControl, HPS::LightingAttributeControl, HPS::SphereAttributeControl, HPS::MarkerAttributeControl, HPS::CullingControl, HPS::ColorInterpolationControl, HPS::TransparencyControl, HPS::SelectabilityControl, HPS::CameraControl, HPS::VisibilityControl, HPS::BoundingControl, HPS::Kit, and HPS::Control.
|
inherited |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
protectedinherited |
|
private |
|
private |
|
private |
|
private |
|
protectedinherited |
|
protectedinherited |
|
private |
|
private |
|
staticinherited |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |