Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
Tool Class Referenceabstract

#include <Tool.h>

Inheritance diagram for Tool:
Inheritance graph

Public Member Functions

 Tool (ToolHelper *helper)
 Construct keeping a pointer to a PreviewToolHelper. More...
 
virtual ~Tool ()
 
virtual void Activate ()=0
 Switch on a tool. More...
 
virtual void MouseMoveEvent (double x, double y, wxMouseEvent &e)
 Notify when the mouse pointer has moved over the panorama preview. More...
 
virtual void MouseButtonEvent (wxMouseEvent &e)
 Notify of a mouse button press on the panorama preview. More...
 
virtual void MouseWheelEvent (wxMouseEvent &e)
 Notify of a mouse wheel event on the panorama preview. More...
 
virtual void ImagesUnderMouseChangedEvent ()
 Notify when the images directly underneath the mouse pointer have changed. More...
 
virtual void KeypressEvent (int keycode, int modifiers, bool pressed)
 Notify of a Keypress event. More...
 
virtual void BeforeDrawImagesEvent ()
 Draw using OpenGL anything the tool requires underneath the images. More...
 
virtual void AfterDrawImagesEvent ()
 Draw (using OpenGL) images above the others. More...
 
virtual void ReallyAfterDrawImagesEvent ()
 Draw (using OpenGL) the overlays, e.g. crop highlights, guides. More...
 
virtual bool BeforeDrawImageEvent (unsigned int image)
 Draw what the tool requires just before a given image is drawn. More...
 
virtual void AfterDrawImageEvent (unsigned int image)
 Notification called just after the image was drawn normally. More...
 
virtual void MarkDirty ()
 

Protected Attributes

ToolHelperhelper
 The PreviewToolHelper that uses the same preview window and panorama as the tool should. More...
 

Detailed Description

Definition at line 42 of file Tool.h.

Constructor & Destructor Documentation

Tool::Tool ( ToolHelper helper)
explicit

Construct keeping a pointer to a PreviewToolHelper.

Child classes should use this to ensure helper is set.

Definition at line 29 of file Tool.cpp.

References helper.

Tool::~Tool ( )
virtual

Definition at line 34 of file Tool.cpp.

Member Function Documentation

virtual void Tool::Activate ( )
pure virtual

Switch on a tool.

Inherited classes also register events they want to respond to with the PreviewToolHelper. As events are lost when the tool is deactivated without notification to the PreviewTool, things from the last activation can be cleaned up here too.

Implemented in PlaneOverviewOutlinesTool, PanosphereOverviewOutlinesTool, PlaneOverviewCameraTool, PanosphereOverviewProjectionGridTool, PreviewLayoutLinesTool, PreviewIdentifyTool, DragTool, PreviewProjectionGridTool, PreviewGuideTool, PreviewControlPointTool, PreviewEditCPTool, PreviewDifferenceTool, PanosphereOverviewCameraTool, PreviewColorPickerTool, PreviewCameraTool, PreviewCropTool, PreviewPanoMaskTool, and PanosphereSphereTool.

Referenced by ToolHelper::ActivateTool().

virtual void Tool::AfterDrawImageEvent ( unsigned int  image)
inlinevirtual

Notification called just after the image was drawn normally.

Definition at line 100 of file Tool.h.

virtual void Tool::AfterDrawImagesEvent ( )
inlinevirtual

Draw (using OpenGL) images above the others.

Reimplemented in PlaneOverviewOutlinesTool, PreviewLayoutLinesTool, PreviewIdentifyTool, PreviewProjectionGridTool, PreviewControlPointTool, and PreviewDifferenceTool.

Definition at line 88 of file Tool.h.

virtual bool Tool::BeforeDrawImageEvent ( unsigned int  image)
inlinevirtual

Draw what the tool requires just before a given image is drawn.

This can be used to modify how the images are drawn, prevent drawing of the image, or change the order of the image drawing (with another event to draw the image when it is needed).

Returns
false if the tool does not want the image drawn normally, or true when the image should be drawn normally.

Reimplemented in PreviewLayoutLinesTool, PreviewIdentifyTool, and PreviewDifferenceTool.

Definition at line 98 of file Tool.h.

virtual void Tool::BeforeDrawImagesEvent ( )
inlinevirtual

Draw using OpenGL anything the tool requires underneath the images.

Reimplemented in PreviewLayoutLinesTool, PreviewProjectionGridTool, PreviewDifferenceTool, and PreviewPanoMaskTool.

Definition at line 86 of file Tool.h.

virtual void Tool::ImagesUnderMouseChangedEvent ( )
inlinevirtual

Notify when the images directly underneath the mouse pointer have changed.

It is monitored by the PreviewToolHelper.

Reimplemented in PreviewIdentifyTool, and PreviewDifferenceTool.

Definition at line 80 of file Tool.h.

virtual void Tool::KeypressEvent ( int  keycode,
int  modifiers,
bool  pressed 
)
inlinevirtual

Notify of a Keypress event.

Currently unused as the preview cannot get keyboard input focus.

Reimplemented in PlaneOverviewCameraTool, and PanosphereOverviewCameraTool.

Definition at line 84 of file Tool.h.

virtual void Tool::MarkDirty ( )
inlinevirtual

Reimplemented in PlaneOverviewOutlinesTool, and PanosphereOverviewOutlinesTool.

Definition at line 102 of file Tool.h.

virtual void Tool::MouseButtonEvent ( wxMouseEvent &  e)
inlinevirtual

Notify of a mouse button press on the panorama preview.

Parameters
eThe event created by wxWidgets.

Reimplemented in PlaneOverviewCameraTool, PreviewLayoutLinesTool, PreviewIdentifyTool, DragTool, PreviewEditCPTool, PanosphereOverviewCameraTool, PreviewCameraTool, PreviewColorPickerTool, and PreviewCropTool.

Definition at line 72 of file Tool.h.

virtual void Tool::MouseMoveEvent ( double  x,
double  y,
wxMouseEvent &  e 
)
inlinevirtual

Notify when the mouse pointer has moved over the panorama preview.

The coordinates are in the space of the panorama output at full size, with no output cropping.

Parameters
xThe horizontal position of the mouse pointer in panorama pixels.
yThe vertical position of the mouse pointer in panorama pixels.
eThe event created by wxWidgets.

Reimplemented in PlaneOverviewCameraTool, PreviewIdentifyTool, PreviewLayoutLinesTool, DragTool, PreviewEditCPTool, PreviewCameraTool, PanosphereOverviewCameraTool, and PreviewCropTool.

Definition at line 68 of file Tool.h.

virtual void Tool::MouseWheelEvent ( wxMouseEvent &  e)
inlinevirtual

Notify of a mouse wheel event on the panorama preview.

Parameters
eThe event created by wxWidgets.

Reimplemented in PlaneOverviewCameraTool, PanosphereOverviewCameraTool, and PreviewCameraTool.

Definition at line 76 of file Tool.h.

virtual void Tool::ReallyAfterDrawImagesEvent ( )
inlinevirtual

Draw (using OpenGL) the overlays, e.g. crop highlights, guides.

Reimplemented in OverviewDragTool, PreviewDragTool, DragTool, PreviewGuideTool, PreviewEditCPTool, PreviewPanoMaskTool, and PreviewCropTool.

Definition at line 90 of file Tool.h.

Member Data Documentation

ToolHelper* Tool::helper
protected

The PreviewToolHelper that uses the same preview window and panorama as the tool should.

Definition at line 102 of file Tool.h.

Referenced by PanosphereSphereTool::Activate(), PreviewCropTool::Activate(), PreviewPanoMaskTool::Activate(), PreviewCameraTool::Activate(), PreviewColorPickerTool::Activate(), PanosphereOverviewCameraTool::Activate(), PreviewDifferenceTool::Activate(), PreviewEditCPTool::Activate(), PreviewControlPointTool::Activate(), PreviewGuideTool::Activate(), PreviewProjectionGridTool::Activate(), DragTool::Activate(), PreviewIdentifyTool::Activate(), PreviewLayoutLinesTool::Activate(), PanosphereOverviewProjectionGridTool::Activate(), PlaneOverviewCameraTool::Activate(), PanosphereOverviewOutlinesTool::Activate(), PlaneOverviewOutlinesTool::Activate(), PreviewEditCPTool::AddLineCP(), PanosphereOverviewProjectionGridTool::AfterDrawImagesBackEvent(), PreviewDifferenceTool::AfterDrawImagesEvent(), PreviewControlPointTool::AfterDrawImagesEvent(), PreviewProjectionGridTool::AfterDrawImagesEvent(), PreviewIdentifyTool::AfterDrawImagesEvent(), PreviewLayoutLinesTool::AfterDrawImagesEvent(), PanosphereOverviewProjectionGridTool::AfterDrawImagesFrontEvent(), PreviewLayoutLinesTool::BeforeDrawImageEvent(), PanosphereSphereTool::BeforeDrawImagesBackEvent(), PreviewDifferenceTool::BeforeDrawImagesEvent(), PreviewLayoutLinesTool::BeforeDrawImagesEvent(), PreviewColorPickerTool::CalcCorrection(), PreviewColorPickerTool::CalcCorrectionForImage(), PanosphereOverviewCameraTool::ChangeFOV(), PanosphereOverviewCameraTool::ChangeZoomLevel(), PreviewCameraTool::ChangeZoomLevel(), PlaneOverviewCameraTool::ChangeZoomLevel(), PreviewProjectionGridTool::createMesh(), PanosphereOverviewOutlinesTool::drawBackground(), PreviewLayoutLinesTool::drawIdentificationBorder(), PreviewEditCPTool::FindCPInRect(), PreviewIdentifyTool::ForceRedraw(), PreviewEditCPTool::GetSelectedROI(), PreviewDifferenceTool::ImagesUnderMouseChangedEvent(), PreviewIdentifyTool::ImagesUnderMouseChangedEvent(), PreviewControlPointTool::MakeTransforms(), PreviewCropTool::MouseButtonEvent(), PreviewColorPickerTool::MouseButtonEvent(), PreviewCameraTool::MouseButtonEvent(), PanosphereOverviewCameraTool::MouseButtonEvent(), PreviewEditCPTool::MouseButtonEvent(), DragTool::MouseButtonEvent(), PreviewIdentifyTool::MouseButtonEvent(), PlaneOverviewCameraTool::MouseButtonEvent(), PreviewCropTool::MouseMoveEvent(), PanosphereOverviewCameraTool::MouseMoveEvent(), PreviewCameraTool::MouseMoveEvent(), PreviewEditCPTool::MouseMoveEvent(), DragTool::MouseMoveEvent(), PreviewLayoutLinesTool::MouseMoveEvent(), PlaneOverviewCameraTool::MouseMoveEvent(), PreviewCameraTool::MouseWheelEvent(), PanosphereOverviewCameraTool::MouseWheelEvent(), PreviewCropTool::ReallyAfterDrawImagesEvent(), PreviewPanoMaskTool::ReallyAfterDrawImagesEvent(), PreviewGuideTool::ReallyAfterDrawImagesEvent(), PreviewDragTool::ReallyAfterDrawImagesEvent(), PreviewIdentifyTool::setConstantOn(), PreviewGuideTool::SetGuideStyle(), PreviewIdentifyTool::ShowImageNumber(), PreviewIdentifyTool::StopShowingImages(), PreviewIdentifyTool::StopUpdating(), Tool(), PreviewCameraTool::UpdateCenter(), PreviewLayoutLinesTool::updateImageCentres(), PreviewLayoutLinesTool::updateLineInformation(), PreviewIdentifyTool::UpdateWithNewImageSet(), and PreviewLayoutLinesTool::~PreviewLayoutLinesTool().


The documentation for this class was generated from the following files: