#include <MRMoveObjectByMouseImpl.h>
Public Member Functions | |
| MoveObjectByMouseImpl ()=default | |
| virtual | ~MoveObjectByMouseImpl ()=default |
| int | minDistance () const |
| void | setMinDistance (int minDistance) |
| MRVIEWER_API void | onDrawDialog () const |
| MRVIEWER_API bool | onMouseDown (MouseButton button, int modifiers) |
| MRVIEWER_API bool | onMouseMove (int x, int y) |
| MRVIEWER_API bool | onMouseUp (MouseButton button, int modifiers) |
| MRVIEWER_API bool | isMoving () const |
| MRVIEWER_API void | cancel () |
| void | enableHistory (bool history) |
| enables or disables adding history to viewer history store by this tool | |
| bool | isHistoryEnabled () const |
| returns true if appending history to viewer history store is enabled in this tool | |
Protected Types | |
| enum class | TransformMode { TransformMode::None , TransformMode::Translation , TransformMode::Rotation , TransformMode::UniformScale , TransformMode::NonUniformScale } |
| Transformation mode. More... | |
Protected Member Functions | |
| virtual MRVIEWER_API ObjAndPick | pickObjects_ (std::vector< std::shared_ptr< Object > > &objects, int modifiers) const |
| virtual MRVIEWER_API TransformMode | modeFromPickModifiers_ (int modifiers) const |
| Helper function to determine TransformMode based on modifiers. | |
| virtual MRVIEWER_API TransformMode | modeFromPick_ (MouseButton button, int modifiers) const |
this function is called from onMouseDown to verify if pick should proceed, if None is returned - onMouseDown is canceled | |
| virtual MRVIEWER_API void | setStartPoint_ (const ObjAndPick &pick, Vector3f &startPoint) const |
startPoint - a point under cursor for transform calculation, can be the picked point or else (world coordinates) | |
| virtual MRVIEWER_API void | setCenterPoint_ (const std::vector< std::shared_ptr< Object > > &objects, Vector3f ¢erPoint) const |
centerPoint - a point that will be used as center of rotation/scaling in world space | |
| virtual MRVIEWER_API Plane3f | calcControlPlane_ (const Viewport &vp, const Vector3f &viewportCenterPoint, const Vector3f &xfCenterPoint) const |
| MRVIEWER_API Box3f | getBbox_ (const std::vector< std::shared_ptr< Object > > &objects) const |
Protected Attributes | |
| float | deadZonePixelRadius_ { 20.0f } |
| AffineXf3f | currentXf_ |
Helper class to incorporate basic object transformation feature into plugins User can move objects by dragging them, rotate by dragging with Ctrl key; scaling is disabled by default To use, create class instance and call its event handlers For extra features, override the pick_ method