00001 #ifndef __InsertObjectController__
00002 #define __InsertObjectController__
00003
00004 #include "IToolController.h"
00005 #include "MainFrame.h"
00006 #include "SceneManager.h"
00007 #include "Terrain.h"
00008 #include "ObjectManipulatorProxy.h"
00009 #include <osgViewer/View>
00010
00011 #include <osgGA/TerrainManipulator>
00012 #include <osg/Quat>
00013 #include <osg/Notify>
00014 #include <osg/io_utils>
00015 #include <osgUtil/LineSegmentIntersector>
00016
00017 using namespace osg;
00018 using namespace osgGA;
00019
00020
00021 class InsertObjectController : public IToolController {
00022 public:
00023 InsertObjectController(MainFrame* mainFrame, osg::Node* model, const char* fileName);
00024
00025 void open();
00026 void close();
00027
00028 void onMouseLeftUp(int x, int y) {}
00029 void onMouseLeftDown(int x, int y);
00030
00031 void onMouseMiddleUp(int x, int y) {}
00032 void onMouseMiddleDown(int x, int y) {}
00033
00034 void onMouseRightUp(int x, int y) {}
00035 void onMouseRightDown(int x, int y) {}
00036
00037 void onMouseMove(int x, int y);
00038 void onMouseWheel(int x, int y, int d) {}
00039
00040 void onKeyDown(int key) {}
00041 void onKeyUp(int key) {}
00042
00043 protected:
00044 MainFrame* _mainFrame;
00045 SceneManager& _sceneManager;
00046 Terrain& _terrain;
00047 ObjectManipulatorProxy* _objectManipulator;
00048
00049 SceneObject* _newSceneObject;
00050 osg::Vec3d _intrPoint;
00051 osg::Vec3d _intrNormal;
00052
00053 osg::Node* _model;
00054 std::string _fileName;
00055 };
00056
00057 #endif