12 #include <osgGA/GUIEventHandler> 13 #include <osgGA/GUIEventAdapter> 14 #include <osgGA/GUIActionAdapter> 15 #include <osg/ref_ptr> 16 #include <osg/observer_ptr> 18 #include "../libGUI/GLWidget.h" 23 #include "DraggableWire.h" 24 #include "CamPoseData.h" 25 #include "EditableWire.h" 26 #include "UserScene.h" 27 #include "RootScene.h" 28 #include "StrokeIntersector.h" 29 #include "Entity2DIntersector.h" 30 #include "LineIntersector.h" 31 #include "PolyLineIntersector.h" 32 #include "PointIntersector.h" 33 #include "VirtualPlaneIntersector.h" 34 #include "BookmarkToolIntersector.h" 35 #include "CanvasNormalProjector.h" 52 virtual bool handle(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa);
62 void doSelectEntity(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa);
65 template <
typename T1,
typename T2>
66 void doSelectCanvas(
const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa);
70 void doSketch(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa);
74 void doSketchPolygon(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa);
80 void doDeleteEntity(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa);
83 void doEditCanvas(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa);
86 void doEditCanvasOffset(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa);
89 void doEditCanvasRotate(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa,
90 osg::Vec3f alongAxis, osg::Vec3f rotAxis);
95 void doCanvasClone(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa);
100 void doCanvasSeparate(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa);
103 template <
typename T1,
typename T2>
104 void doEditPhotoPush(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa);
107 void doEditEntitiesMove(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa);
116 void doIdleMouse(
const osgGA::GUIEventAdapter & ea, osgGA::GUIActionAdapter & aa);
119 void doHoverWire(
const osgGA::GUIEventAdapter & ea, osgGA::GUIActionAdapter & aa);
122 void doHoverPoint(
const osgGA::GUIEventAdapter & ea, osgGA::GUIActionAdapter & aa);
125 void doDragPoint(
const osgGA::GUIEventAdapter & ea, osgGA::GUIActionAdapter & aa);
128 void doCameraEye(
const osgGA::GUIEventAdapter & ea, osgGA::GUIActionAdapter & aa);
131 void doCameraCenter(
const osgGA::GUIEventAdapter & ea, osgGA::GUIActionAdapter & aa);
134 void doCameraFocal(
const osgGA::GUIEventAdapter & ea, osgGA::GUIActionAdapter & aa);
146 template <
typename EntityType>
149 return dynamic_cast<EntityType*
>(result.drawable.get());
178 template <
typename T>
193 template <
typename TypeIntersection,
typename TypeIntersector>
194 bool getIntersection(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa,
unsigned int mask,
195 TypeIntersection& resultIntersection);
204 double& u,
double& v);
218 const osg::Vec3f& axis, osg::Vec3f& P);
223 template <
typename TResult,
typename TIntersector>
226 template <
typename TResult,
typename TIntersector>
227 std::tuple<bool, TResult> setSVMMouseMode(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa,
cher::MOUSE_MODE modeDefault);
234 void updateWireGeometry(
const PolyLineIntersector::Intersection& intersection);
235 void updatePointGeometry(
const PointIntersector::Intersection& intersection);
236 void updateDragPointGeometry(
const std::tuple<double, double, bool>& intersection,
const osgGA::GUIEventAdapter& ea);
251 osg::observer_ptr<entity::DraggableWire> m_selection;
252 osg::observer_ptr<entity::EditableWire> m_selection2;
253 osg::observer_ptr<entity::BookmarkTool> m_tool;
256 #endif // EVENTHANDLER entity::Photo * getPhoto(const osgUtil::LineSegmentIntersector::Intersection &result)
Definition: EventHandler.cpp:1049
int getSelectedPoint(const PointIntersector::Intersection &result)
Definition: EventHandler.cpp:1089
cher::MOUSE_MODE getMouseModeFromEvent(cher::MOUSE_MODE mode, const osgGA::GUIEventAdapter &ea)
Definition: EventHandler.cpp:1095
entity::BookmarkTool * getBookmarkTool(const PolyLineIntersector::Intersection &result)
Definition: EventHandler.cpp:1068
void doEditEntitiesRotate(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Definition: EventHandler.cpp:713
bool getIntersection(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa, unsigned int mask, TypeIntersection &resultIntersection)
Definition: EventHandler.cpp:1445
An OpenSceneGraph events that were passed from Qt's interface - GLWidget. Event handler is where all ...
Definition: EventHandler.h:47
void doEditPhotoPush(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Definition: EventHandler.cpp:1412
void doDeleteEntity(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Definition: EventHandler.cpp:386
void doSketch(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Definition: EventHandler.cpp:260
void doEditCanvas(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Definition: EventHandler.cpp:429
osg::observer_ptr< RootScene > m_scene
Definition: EventHandler.h:249
virtual bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Definition: EventHandler.cpp:28
cher::MOUSE_MODE getMouseModeFromName(const T &result, cher::MOUSE_MODE mode_default) const
Definition: EventHandler.cpp:1102
void doPhotoScaleModelPlane(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Definition: EventHandler.cpp:927
entity::Canvas * getCanvas(const osgUtil::LineSegmentIntersector::Intersection &result)
Definition: EventHandler.cpp:1038
void doHoverPoint(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Definition: EventHandler.cpp:810
EVENT
Definition: Settings.h:160
bool getRaytracePlaneIntersection(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa, const osg::Vec3f &axis, osg::Vec3f &P)
Definition: EventHandler.cpp:1163
Geometry class that defined strokes entered by a user. The creation and usage of this class must be f...
Definition: Stroke.h:62
bool getRaytraceCanvasIntersection(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa, double &u, double &v)
Definition: EventHandler.cpp:1134
Contains all the entities that will appear on the scene: both user scene and utility entities (i...
Definition: RootScene.h:46
GLWidget * m_glWidget
Definition: EventHandler.h:247
void doCanvasSeparate(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Definition: EventHandler.cpp:587
entity::Polygon * getPolygon(const osgUtil::LineSegmentIntersector::Intersection &result)
Definition: EventHandler.cpp:1054
Geometry class that defines opacity polygons drawn by a user. The creation and usage of this class mu...
Definition: Polygon.h:47
MOUSE_MODE
Definition: Settings.h:97
void doHoverWire(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Definition: EventHandler.cpp:794
void doEditEntitiesScale(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Definition: EventHandler.cpp:665
void doCameraCenter(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Definition: EventHandler.cpp:865
A scene graph class that contains all the geometric entities of entity::SVMData.
Definition: DraggableWire.h:20
void doCanvasClone(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Definition: EventHandler.cpp:558
void doEditEntitiesMove(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Definition: EventHandler.cpp:617
Settings is a configuration variables file for Cherish: enums, consts, defaults. Contains settings su...
void doEditCanvasOffset(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Definition: EventHandler.cpp:442
void doCameraEye(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Definition: EventHandler.cpp:838
void doSelectEntity(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Definition: EventHandler.cpp:1338
Definition: Entity2DIntersector.h:15
entity::Stroke * getStroke(const StrokeIntersector::Intersection &result)
Definition: EventHandler.cpp:1033
void doDragPoint(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Definition: EventHandler.cpp:823
void doSketchLineSegment(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Definition: EventHandler.cpp:328
void doSelectCanvas(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Definition: EventHandler.cpp:1426
cher::MOUSE_MODE m_mode
Definition: EventHandler.h:248
void setDrawableColorFromMode(osg::Drawable *draw)
Definition: EventHandler.cpp:1209
void doPhotoScaleBookmark(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Definition: EventHandler.cpp:951
Quad that uses texture to represent a 2D photo in 3D space.
Definition: Photo.h:22
void doCameraFocal(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Definition: EventHandler.cpp:892
bool setCanvasMouseMode(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa, cher::MOUSE_MODE modeDefault, bool selected=true)
Definition: EventHandler.cpp:1183
entity::DraggableWire * getDraggableWire(const PolyLineIntersector::Intersection &result)
Definition: EventHandler.cpp:1059
void doSketchPolygon(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Definition: EventHandler.cpp:290
void doEraseStroke(entity::Stroke *stroke, int first, int last, cher::EVENT event=cher::EVENT_DRAGGED)
Definition: EventHandler.cpp:250
bool getRaytraceNormalProjection(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa, osg::Vec3f &XC)
Definition: EventHandler.cpp:1150
void finishAll()
Definition: EventHandler.cpp:1296