#include <GestureNavigationStyle.h>
Classes | |
class | EventQueue |
Public Member Functions | |
GestureNavigationStyle () | |
bool | is2DViewing () const |
const char * | mouseButtons (ViewerMode) override |
void | onRollGesture (int direction) |
Roll gesture is like: press LMB, press RMB, release LMB, release RMB. More... | |
void | onSetRotationCenter (SbVec2s cursor) |
Called by state machine, when set-rotation-center gesture is detected (MMB click, or H key) More... | |
SbBool | processSoEvent_bypass (const SoEvent *const ev) |
calls processSoEvent of NavigationStyle. More... | |
virtual | ~GestureNavigationStyle () override |
Public Member Functions inherited from Gui::UserNavigationStyle | |
virtual const char * | mouseButtons (ViewerMode)=0 |
virtual std::string | userFriendlyName () const |
UserNavigationStyle () | |
~UserNavigationStyle () | |
Public Member Functions inherited from Gui::NavigationStyle | |
void | abortSelection () |
void | boxZoom (const SbBox2s &box) |
SbVec3f | getFocalPoint () const |
OrbitStyle | getOrbitStyle () const |
const std::vector< SbVec2s > & | getPolygon (SelectionRole *role=nullptr) const |
RotationCenterModes | getRotationCenterMode () const |
float | getSensitivity () const |
int | getViewingMode () const |
SbBool | isAnimating () const |
SbBool | isAnimationEnabled () const |
SbBool | isPopupMenuEnabled () const |
SbBool | isResetCursorPosition () const |
SbBool | isSelecting () const |
SbBool | isZoomAtCursor () const |
SbBool | isZoomInverted () const |
void | lookAtPoint (const SbVec3f &) |
NavigationStyle () | |
NavigationStyle & | operator= (const NavigationStyle &ns) |
virtual SbBool | processClickEvent (const SoMouseButtonEvent *const event) |
virtual SbBool | processEvent (const SoEvent *const ev) |
virtual SbBool | processKeyboardEvent (const SoKeyboardEvent *const event) |
virtual SbBool | processMotionEvent (const SoMotion3Event *const ev) |
virtual SbBool | processWheelEvent (const SoMouseWheelEvent *const event) |
void | redraw () |
void | setAnimationEnabled (const SbBool enable) |
void | setCameraOrientation (const SbRotation &rot, SbBool moveTocenter=false) |
void | setOrbitStyle (OrbitStyle style) |
void | setPopupMenuEnabled (const SbBool on) |
void | setResetCursorPosition (SbBool) |
void | setRotationCenter (const SbVec3f &cnt) |
void | setRotationCenterMode (RotationCenterModes) |
void | setSensitivity (float) |
void | setViewer (View3DInventorViewer *) |
void | setViewingMode (const ViewerMode newmode) |
void | setZoomAtCursor (SbBool) |
void | setZoomInverted (SbBool) |
void | setZoomStep (float) |
void | startAnimating (const SbVec3f &axis, float velocity) |
void | startSelection (AbstractMouseSelection *) |
void | startSelection (SelectionMode=Lasso) |
void | stopAnimating () |
void | stopSelection () |
void | updateAnimation () |
virtual void | viewAll () |
void | zoomIn () |
void | zoomOut () |
virtual | ~NavigationStyle () |
Public Member Functions inherited from Base::BaseClass | |
BaseClass () | |
Construction. More... | |
BaseClass (const BaseClass &)=default | |
virtual PyObject * | getPyObject () |
This method returns the Python wrapper for a C++ object. More... | |
virtual Type | getTypeId () const |
bool | isDerivedFrom (const Type type) const |
BaseClass & | operator= (const BaseClass &)=default |
virtual void | setPyObject (PyObject *) |
virtual | ~BaseClass () |
Destruction. More... | |
Protected Member Functions | |
bool | isDraggerUnderCursor (SbVec2s pos) |
SbBool | processSoEvent (const SoEvent *const ev) override |
Protected Member Functions inherited from Gui::NavigationStyle | |
void | addToLog (const SbVec2s pos, const SbTime time) |
void | clearLog () |
void | doRotate (SoCamera *camera, float angle, const SbVec2f &pos) |
SbBool | doSpin () |
void | doZoom (SoCamera *camera, float logzoomfactor, const SbVec2f &pos) |
NavigationStyle::doZoom Zooms in or out by specified factor, keeping the point on screen specified by parameter pos fixed or not according to user preference (NavigationStyle::zoomAtCursor). Ignores invertZoom user preference. More... | |
void | doZoom (SoCamera *camera, int wheeldelta, const SbVec2f &pos) |
void | finalize () |
int | getDelta () const |
int | getInteractiveCount () const |
SbVec3f | getRotationCenter (SbBool *) const |
SbBool | handleEventInForeground (const SoEvent *const e) |
void | initialize () |
void | interactiveCountDec () |
void | interactiveCountInc () |
SbBool | isSeekMode () const |
SbBool | isViewing () const |
SbBool | lookAtPoint (const SbVec2s screenpos) |
void | moveCursorPosition () |
SbVec2f | normalizePixelPos (SbVec2f pixpos) |
SbVec2f | normalizePixelPos (SbVec2s pixpos) |
virtual void | openPopupMenu (const SbVec2s &position) |
void | pan (SoCamera *camera) |
void | panCamera (SoCamera *camera, float vpaspect, const SbPlane &panplane, const SbVec2f &previous, const SbVec2f ¤t) |
void | panToCenter (const SbPlane &pplane, const SbVec2f &currpos) |
virtual SbBool | processSoEvent (const SoEvent *const ev) |
void | reorientCamera (SoCamera *camera, const SbRotation &rot) |
Rotate the camera by the given amount, then reposition it so we're still pointing at the same focal point. More... | |
void | saveCursorPosition (const SoEvent *const ev) |
SbBool | seekToPoint (const SbVec2s screenpos) |
void | seekToPoint (const SbVec3f &scenepos) |
void | setSeekMode (SbBool enable) |
void | setViewing (SbBool) |
void | spin (const SbVec2f &pointerpos) |
Uses the sphere sheet projector to map the mouseposition onto a 3D point and find a rotation from this and the last calculated point. More... | |
void | spin_simplified (SoCamera *cam, SbVec2f curpos, SbVec2f prevpos) |
NavigationStyle::spin_simplified is a simplified version of NavigationStyle::spin(..), which uses less global variables. Doesn't support starting an animated spinning. More... | |
void | syncModifierKeys (const SoEvent *const ev) |
void | syncWithEvent (const SoEvent *const ev) |
void | zoom (SoCamera *camera, float diffvalue) |
Dependent on the camera type this will either shrink or expand the height of the viewport (orthogonal camera) or move the camera closer or further away from the focal point in the scene. More... | |
void | zoomByCursor (const SbVec2f &thispos, const SbVec2f &prevpos) |
Protected Attributes | |
bool | enableGestureTilt = false |
if false, tilting with touchscreen gestures will be disabled More... | |
bool | logging = false |
int | mouseMoveThreshold = 5 |
distance in px to treat as a definite drag (noise gate) More... | |
std::unique_ptr< NaviMachine > | naviMachine |
EventQueue | postponedEvents |
int | rollDir = 0 |
used by roll gesture detection logic, in AwaitingMoveState and AwaitingReleaseState. More... | |
Protected Attributes inherited from Gui::NavigationStyle | |
SbBool | altdown |
SbBool | button1down |
SbBool | button2down |
SbBool | button3down |
SbTime | centerTime |
SbBool | ctrldown |
ViewerMode | currentmode |
SbVec2s | globalPos |
SbBool | invertZoom |
SbVec2f | lastmouseposition |
SbVec2s | localPos |
SbBool | lockrecenter |
struct { | |
short historysize | |
SbVec2s * position | |
short size | |
SbTime * time | |
} | log |
SbBool | menuenabled |
SoMouseButtonEvent | mouseDownConsumedEvent |
SbPlane | panningplane |
SbTime | prevRedrawTime |
SbBool | shiftdown |
View3DInventorViewer * | viewer |
SbBool | zoomAtCursor |
float | zoomStep |
AbstractMouseSelection * | mouseSelection |
std::vector< SbVec2s > | pcPolygon |
SelectionRole | selectedRole |
SbBool | spinanimatingallowed |
int | spinsamplecounter |
SbRotation | spinincrement |
SbRotation | spinRotation |
SbSphereSheetProjector * | spinprojector |
Additional Inherited Members | |
Public Types inherited from Gui::NavigationStyle | |
enum | OrbitStyle { Turntable , Trackball } |
enum class | RotationCenterMode { WindowCenter = 0 , ScenePointAtCursor = 1 , FocalPointAtCursor = 2 , BoundingBoxCenter = 4 } |
enum | SelectionMode { Lasso = 0 , Rectangle = 1 , Rubberband = 2 , BoxZoom = 3 , Clip = 4 } |
enum | ViewerMode { IDLE , INTERACT , ZOOMING , BOXZOOM , PANNING , DRAGGING , SPINNING , SEEK_WAIT_MODE , SEEK_MODE , SELECTION } |
Static Public Member Functions inherited from Gui::UserNavigationStyle | |
static std::map< Base::Type, std::string > | getUserFriendlyNames () |
Static Public Member Functions inherited from Base::BaseClass | |
static void * | create () |
static Type | getClassTypeId () |
static void | init () |
Static Protected Member Functions inherited from Base::BaseClass | |
static void | initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=nullptr) |
Gui::GestureNavigationStyle::GestureNavigationStyle | ( | ) |
|
overridevirtual |
bool Gui::GestureNavigationStyle::is2DViewing | ( | ) | const |
References Gui::View3DInventorViewer::isEditing(), and Gui::NavigationStyle::viewer.
|
protected |
References Gui::NavigationStyle::viewer.
|
overridevirtual |
void Gui::GestureNavigationStyle::onRollGesture | ( | int | direction | ) |
Roll gesture is like: press LMB, press RMB, release LMB, release RMB.
This function is called by state machine whenever it picks up roll gesture.
References Base::Console(), Base::ConsoleSingleton::Error(), App::GetApplication(), ParameterGrp::GetASCII(), App::Application::GetParameterGroupByPath(), Base::Interpreter(), Base::ConsoleSingleton::Log(), logging, Base::PyException::ReportException(), and Base::InterpreterSingleton::runString().
void Gui::GestureNavigationStyle::onSetRotationCenter | ( | SbVec2s | cursor | ) |
Called by state machine, when set-rotation-center gesture is detected (MMB click, or H key)
References Base::Console(), Gui::NavigationStyle::interactiveCountDec(), Base::ConsoleSingleton::Log(), and Gui::NavigationStyle::lookAtPoint().
|
overrideprotectedvirtual |
Reimplemented from Gui::NavigationStyle.
References Gui::NS::Event::ALTDOWN, Gui::NavigationStyle::altdown, Gui::NS::Event::asMouseButtonEvent(), Gui::NS::Event::BUTTON1DOWN, Gui::NavigationStyle::button1down, Gui::NS::Event::BUTTON2DOWN, Gui::NavigationStyle::button2down, Gui::NS::Event::BUTTON3DOWN, Gui::NavigationStyle::button3down, Gui::NS::Event::CTRLDOWN, Gui::NavigationStyle::ctrldown, Gui::NS::Event::flags, Gui::NavigationStyle::handleEventInForeground(), Gui::NS::Event::inventor_event, Gui::NavigationStyle::isAnimating(), Gui::View3DInventorViewer::isEditing(), Gui::NS::Event::isGestureEvent(), Gui::NS::Event::isMouseButtonEvent(), Gui::NS::Event::isRelease(), Gui::NavigationStyle::isSeekMode(), Gui::NavigationStyle::isViewing(), Gui::NS::Event::modifiers, naviMachine, Gui::NavigationStyle::processMotionEvent(), Gui::NavigationStyle::processSoEvent(), Gui::NavigationStyle::setViewing(), Gui::NS::Event::SHIFTDOWN, Gui::NavigationStyle::shiftdown, Gui::NavigationStyle::syncModifierKeys(), and Gui::NavigationStyle::viewer.
SbBool Gui::GestureNavigationStyle::processSoEvent_bypass | ( | const SoEvent *const | ev | ) |
calls processSoEvent of NavigationStyle.
References Gui::NavigationStyle::processSoEvent().
|
protected |
if false, tilting with touchscreen gestures will be disabled
|
protected |
Referenced by onRollGesture(), and Gui::GestureNavigationStyle::EventQueue::post().
|
protected |
distance in px to treat as a definite drag (noise gate)
|
protected |
Referenced by processSoEvent().
|
protected |
|
protected |
used by roll gesture detection logic, in AwaitingMoveState and AwaitingReleaseState.