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 "hugin_utils/utils.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     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) {}
00101 protected:
00105     ToolHelper *helper;
00106 };
00107 
00108 
00109 class PreviewTool : public Tool
00110 {
00111 public:
00112     PreviewTool(PreviewToolHelper* helper);
00113     virtual ~PreviewTool();
00114 
00115 };
00116 
00117 class OverviewTool : public Tool
00118 {
00119 public:
00120 
00121     OverviewTool(OverviewToolHelper* helper);
00122     virtual ~OverviewTool();
00123 
00124 };
00125 
00126 class PanosphereOverviewTool : public OverviewTool
00127 {
00128 public:
00129 
00130     PanosphereOverviewTool(PanosphereOverviewToolHelper* helper);
00131     virtual ~PanosphereOverviewTool();
00132 
00134     virtual void BeforeDrawImagesBackEvent() {}
00136     virtual void AfterDrawImagesBackEvent() {}
00137 
00139     virtual void BeforeDrawImagesFrontEvent() {}
00141     virtual void AfterDrawImagesFrontEvent() {}
00142     
00143 };
00144 
00145 class PlaneOverviewTool : public OverviewTool
00146 {
00147 public:
00148 
00149     PlaneOverviewTool(PlaneOverviewToolHelper* helper);
00150     virtual ~PlaneOverviewTool();
00151 
00152 };
00153 
00154 
00155 #endif
00156 

Generated on Thu Apr 24 01:25:35 2014 for Hugintrunk by  doxygen 1.3.9.1