The AnnotationOperator class defines an operator which allows the user to insert annotations. More...
#include <sprk_ops.h>
Classes | |
class | AnnotationInsertedEvent |
An event injected every time a new annotation is inserted. More... | |
class | KeyboardHiddenEventHandler |
Public Types | |
enum | Priority { Priority::Low, Priority::Default, Priority::High } |
Public Member Functions | |
AnnotationOperator (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 are inserting or editing an annotation, they will be able to reposition it by dragging the mouse while holding down the trigger button specified in the operator constructor (defaults to Left mouse button) 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 | 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... | |
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 | OnKeyDown (KeyboardState const &in_state) override |
This function is called whenever HPS receives a KeyboardState event that signals a button was pressed. More... | |
virtual bool | OnTextInput (HPS::UTF8 const &in_text) override |
This function is called whenever HPS receives a TextInput event that signals a text string was received. More... | |
void | SetBackgroundShape (const char *in_shape) |
This function sets the shape which will be use for the annotation background. More... | |
UTF8 | GetBackgroundShape () const |
This function returns the name of the shape definition currently used to draw the annotation background 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 | OnMouseUp (MouseState const &in_state) |
This function is called whenever HPS receives a MouseEvent that signals a mouse 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 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 | OnKeyUp (KeyboardState const &in_state) |
This function is called whenever HPS receives a KeyboardEvent that signals a key was released. 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 Member Functions | |
void | AddAnnotationUserData () |
void | StartNewNote () |
bool | InputDown (WindowKey const &window_key, Point const &location, KeyPath &event_path) |
bool | InputMove (Point const &location, KeyPath &event_path) |
void | CenterCamera (Point const &camera_center) |
void | ResetCamera () |
The AnnotationOperator class defines an operator which allows the user to insert annotations.
Annotations are text geometries with leader lines and a background. This Operator works for both mouse- and touch-driven devices.
To operate this operator on a mouse-driven device: Click on a piece of geometry and drag the mouse to position an annotation. Start typing to change the annotation text. Once an annotation has been inserted it can be repositioned, and its text can be changed after clicking on it.
To operate this operator on a touch-driven device: Tap on a piece of geometry and drag your finger to position an annotation. Start typing to change the annotation text. Once an annotation has been inserted, tap on it to edit the text. Drag a previously inserted annotation around to reposition it.
An event of type AnnotationInsertedEvent is injected when new annotations are added to the scene.
|
stronginherited |
HPS::AnnotationOperator::AnnotationOperator | ( | MouseButtons | in_mouse_trigger = MouseButtons::ButtonLeft() , |
ModifierKeys | in_modifier_trigger = ModifierKeys() |
||
) |
|
private |
|
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 |
|
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 |
UTF8 HPS::AnnotationOperator::GetBackgroundShape | ( | ) | const |
This function returns the name of the shape definition currently used to draw the annotation background by this operator.
|
inherited |
Returns a unique identifier that is shared by all objects of the same class.
|
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 |
Gets the modifier trigger associated with this operator.
|
inlineinherited |
Gets the mouse trigger associated with this operator.
|
inlineoverridevirtual |
Returns the name of the operator.
Reimplemented from HPS::Operator.
|
inherited |
|
private |
|
inlinevirtualinherited |
Returns true if the MouseButtons and ModifierKeys are active.
Reimplemented in HPS::SimpleWalkOperator.
|
inlinevirtualinherited |
|
overridevirtual |
This function is called whenever HPS receives a KeyboardState event that signals a button was pressed.
This function is used to edit the text of annotations
in_state | A KeyboardState object describing the current keyboard state. |
Reimplemented from HPS::Operator.
|
inlinevirtualinherited |
This function is called whenever HPS receives a KeyboardEvent that signals a key was released.
in_state | A KeyboardState object describing the current keyboard state. |
Reimplemented in HPS::SimpleWalkOperator, and HPS::FlyOperator.
|
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.
|
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.
|
overridevirtual |
This function is called whenever HPS receives a MouseEvent that signals a mouse button was pressed.
If the user clicks on a piece of geometry other than an existing annotation, a new annotation will be inserted. If the user clicks on an already inserted annotation, that annotation will become editable (it can be repositioned, and its text can be changed). The user can click on the background to stop editing an annotation.
in_state | A MouseState object describing the current mouse state. |
Reimplemented from HPS::Operator.
|
inlinevirtualinherited |
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 in HPS::SimpleWalkOperator.
|
inlinevirtualinherited |
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 in HPS::SimpleWalkOperator.
|
overridevirtual |
This function is called whenever HPS receives a MouseEvent that signals the mouse moved When users are inserting or editing an annotation, they will be able to reposition it by dragging the mouse while holding down the trigger button specified in the operator constructor (defaults to Left mouse button)
in_state | A MouseState object describing the current mouse state. |
Reimplemented from HPS::Operator.
|
inlinevirtualinherited |
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 in HPS::Exchange::MeasurementOperator, HPS::NavigationCubeOperator, HPS::AxisTriadOperator, HPS::HandlesOperator, HPS::MarkupOperator, HPS::CuttingSectionOperator, HPS::SimpleWalkOperator, HPS::FlyOperator, HPS::TurntableOperator, HPS::HighlightAreaOperator, HPS::SelectAreaOperator, HPS::ZoomBoxOperator, HPS::ConstructRectangleOperator, HPS::ZoomOperator, HPS::RelativeOrbitOperator, HPS::OrbitOperator, HPS::PanOperator, and HPS::PanOrbitZoomOperator.
|
inlinevirtualinherited |
This function is called whenever HPS receives a MouseEvent that signals the mouse wheel was scrolled.
in_state | A MouseState object describing the current mouse state. |
Reimplemented in HPS::SimpleWalkOperator, HPS::FlyOperator, HPS::TurntableOperator, and HPS::MouseWheelOperator.
|
overridevirtual |
This function is called whenever HPS receives a TextInput event that signals a text string was received.
This function is used to edit the text of annotations from a mobile device.
in_text | The text string received. |
Reimplemented from HPS::Operator.
|
inlinevirtualinherited |
This function is called whenever HPS receives a TimerTickEvent.
in_event | A TimerTickEvent object describing the current event state. |
Reimplemented in HPS::CuttingSectionOperator, HPS::SimpleWalkOperator, HPS::WalkOperator, and HPS::FlyOperator.
|
overridevirtual |
This function is called whenever HPS receives a TouchEvent that signals the device was touched.
If the user taps a piece of geometry other than an existing annotation, a new annotation will be inserted. If the user taps an already inserted annotation, that annotation will become editable (it can be repositioned, and its text can be changed). The user can tap on the background to stop editing an annotation.
in_state | A TouchState object describing the current touch state. |
Reimplemented from HPS::Operator.
|
overridevirtual |
This function is called whenever HPS receives a TouchEvent that signals a point of contact has moved.
When users are inserting or editing an annotation, they will be able to reposition it by tapping it and dragging their finger
in_state | A TouchState object describing the current touch state. |
Reimplemented from HPS::Operator.
|
overridevirtual |
This function is called whenever HPS receives a TouchEvent that signals a point of contact has been released.
in_state | A TouchState object describing the current touch state. |
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.
|
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.
|
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 |
void HPS::AnnotationOperator::SetBackgroundShape | ( | const char * | in_shape | ) |
This function sets the shape which will be use for the annotation background.
The shape name provided has to match the name of a shape defined in a portfolio accessible by the view attached to this operator, or to a segment above that. This setting influences all shapes inserted by this operator after it is called, it does not change the shape of annotations already inserted by this operator. By default a rectangle shape ('box') is used.
in_shape | The name of the shape definition used when inserting annotations. |
|
inlineinherited |
Sets the modifier trigger associated with this operator.
in_modifiers | The modifier keys that are used to trigger this operator. |
|
inlineinherited |
Sets the mouse trigger for this operator.
|
private |
|
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.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
protectedinherited |
|
protectedinherited |
|
private |
|
private |
|
private |
|
staticinherited |
|
private |
|
private |
|
private |
|
private |