Tool.h

Go to the documentation of this file.
00001 // -*- c-basic-offset: 4 -*-
00002 
00024 #ifndef _PREVIEWTOOL_H
00025 #define _PREVIEWTOOL_H
00026 
00027 #include "base_wx/wxutils.h"
00028 #include <wx/event.h>
00029 
00030 #include "ToolHelper.h"
00031 
00032 /* PreviewTool is an abstract base class for the interactive tools that work
00033  * with the OpenGL accelerated preview. They can respond to the users actions
00034  * over the preview, or changes in the panorama, and can draw extras above,
00035  * below, or instead of the panorama images.
00036  *
00037  * The *Event functions are only called when the Tool requested a notification.
00038  * Tools may do this through an instance of the PreviewToolHelper class which
00039  * is passed by pointer on construction. When a tool is decativated, all the
00040  * notifications it monitors are removed.
00041  */
00042 class Tool
00043 {
00044 public:
00048     explicit Tool(ToolHelper *helper);
00049     
00050     virtual ~Tool();
00051     // Lots of stub functions here. Your tools should override a few of them.
00052     
00059     virtual void Activate() = 0;
00060     
00068     virtual void MouseMoveEvent(double x, double y, wxMouseEvent & e) {}
00072     virtual void MouseButtonEvent(wxMouseEvent &e) {}
00076     virtual void MouseWheelEvent(wxMouseEvent & e) {}
00080     virtual void ImagesUnderMouseChangedEvent() {}
00084     virtual void KeypressEvent(int keycode, int modifiers, bool pressed) {}
00086     virtual void BeforeDrawImagesEvent() {}
00088     virtual void AfterDrawImagesEvent() {}
00090     virtual void ReallyAfterDrawImagesEvent() {}
00098     virtual bool BeforeDrawImageEvent(unsigned int image) {return true;}
00100     virtual void AfterDrawImageEvent(unsigned int image) {}
00102     virtual void MarkDirty() {};
00103 protected:
00107     ToolHelper *helper;
00108 };
00109 
00110 
00111 class PreviewTool : public Tool
00112 {
00113 public:
00114     explicit PreviewTool(PreviewToolHelper* helper);
00115     virtual ~PreviewTool();
00116 
00117 };
00118 
00119 class OverviewTool : public Tool
00120 {
00121 public:
00122 
00123     explicit OverviewTool(OverviewToolHelper* helper);
00124     virtual ~OverviewTool();
00125 
00126 };
00127 
00128 class PanosphereOverviewTool : public OverviewTool
00129 {
00130 public:
00131 
00132     explicit PanosphereOverviewTool(PanosphereOverviewToolHelper* helper);
00133     virtual ~PanosphereOverviewTool();
00134 
00136     virtual void BeforeDrawImagesBackEvent() {}
00138     virtual void AfterDrawImagesBackEvent() {}
00139 
00141     virtual void BeforeDrawImagesFrontEvent() {}
00143     virtual void AfterDrawImagesFrontEvent() {}
00144     
00145 };
00146 
00147 class PlaneOverviewTool : public OverviewTool
00148 {
00149 public:
00150 
00151     explicit PlaneOverviewTool(PlaneOverviewToolHelper* helper);
00152     virtual ~PlaneOverviewTool();
00153 
00154 };
00155 
00156 
00157 #endif
00158 

Generated on 28 Jul 2016 for Hugintrunk by  doxygen 1.4.7