OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ViewerObjectSelectionHandler.h
Go to the documentation of this file.
1#pragma once
2
3#include <osgGA/GUIEventHandler>
4
5class Model;
6class Viewer;
7
8namespace osgViewer
9{
10 class Viewer;
11}
12
13class ViewerObjectSelectionHandler : public osgGA::GUIEventHandler {
14public:
16 virtual bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa) override;
17 void setModel(Model *m) { model = m; };
18 void setActive(bool a) { active = a; };
19
20private:
21 enum projectionType {IN_PLANE, HEIGHT};
22
23 void processRubberbandUpdate(osgViewer::Viewer *viewer, float mouseX, float mouseY, enum projectionType pType, const osg::Vec3 &n, const osg::Vec3 &p);
24 void getWorldRay(osgViewer::Viewer *viewer, float mouseX, float mouseY, osg::Vec3 &rayStart, osg::Vec3 &rayEnd);
25 bool intersectLinePlane(const osg::Vec3 &n, const osg::Vec3 &p, const osg::Vec3 &l1, const osg::Vec3 &l2, osg::Vec3 &ip);
26 osgUtil::Intersector *createIntersector(osgUtil::Intersector::CoordinateFrame cf, double x, double y);
27
28 Model *model;
29 bool active;
30 Viewer * creator;
31 osg::Vec3 lastPointInPlane;
32};
Mesh m
Definition SelfIntersectionCheck.cpp:26
std::string ip
Definition dllmain.cpp:89
The Model class is the main interface to the model. There may be multiple instances of this class....
Definition Model.h:94
Simple 3D viewer.
Definition Viewer.h:41
Definition ViewerObjectSelectionHandler.h:13
virtual bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa) override
Definition ViewerObjectSelectionHandler.cpp:58
void setActive(bool a)
Definition ViewerObjectSelectionHandler.h:18
ViewerObjectSelectionHandler(Viewer *_creator)
Definition ViewerObjectSelectionHandler.h:15
void setModel(Model *m)
Definition ViewerObjectSelectionHandler.h:17
Definition Viewer.h:30