Tool Class Reference

#include <Tool.h>

Inheritance diagram for Tool:

Inheritance graph
[legend]
List of all members.

Public Member Functions

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

Protected Attributes

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

Detailed Description

Definition at line 42 of file Tool.h.


Constructor & Destructor Documentation

Tool::Tool ( ToolHelper helper  ) 

Construct keeping a pointer to a PreviewToolHelper.

Child classes should use this to ensure helper is set.

Definition at line 26 of file Tool.cpp.

References helper.

Tool::~Tool (  )  [virtual]

Definition at line 31 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 DragTool, PanosphereOverviewCameraTool, PlaneOverviewCameraTool, PanosphereOverviewOutlinesTool, PlaneOverviewOutlinesTool, PanosphereSphereTool, PreviewColorPickerTool, PreviewControlPointTool, PreviewCropTool, PreviewDifferenceTool, PreviewGuideTool, PreviewIdentifyTool, PreviewLayoutLinesTool, PreviewPanoMaskTool, PreviewProjectionGridTool, and PanosphereOverviewProjectionGridTool.

Referenced by ToolHelper::ActivateTool().

virtual void Tool::AfterDrawImageEvent ( unsigned int  image  )  [inline, virtual]

Notification called just after the image was drawn normally.

Definition at line 100 of file Tool.h.

virtual void Tool::AfterDrawImagesEvent (  )  [inline, virtual]

Draw (using OpenGL) images above the others.

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

Definition at line 88 of file Tool.h.

virtual bool Tool::BeforeDrawImageEvent ( unsigned int  image  )  [inline, virtual]

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 PreviewDifferenceTool, PreviewIdentifyTool, and PreviewLayoutLinesTool.

Definition at line 98 of file Tool.h.

virtual void Tool::BeforeDrawImagesEvent (  )  [inline, virtual]

Draw using OpenGL anything the tool requires underneath the images.

Reimplemented in PreviewDifferenceTool, PreviewLayoutLinesTool, PreviewPanoMaskTool, and PreviewProjectionGridTool.

Definition at line 86 of file Tool.h.

virtual void Tool::ImagesUnderMouseChangedEvent (  )  [inline, virtual]

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

It is monitored by the PreviewToolHelper.

Reimplemented in PreviewDifferenceTool, and PreviewIdentifyTool.

Definition at line 80 of file Tool.h.

virtual void Tool::KeypressEvent ( int  keycode,
int  modifiers,
bool  pressed 
) [inline, virtual]

Notify of a Keypress event.

Currently unused as the preview cannot get keyboard input focus.

Reimplemented in PanosphereOverviewCameraTool, and PlaneOverviewCameraTool.

Definition at line 84 of file Tool.h.

virtual void Tool::MouseButtonEvent ( wxMouseEvent &  e  )  [inline, virtual]

Notify of a mouse button press on the panorama preview.

Parameters:
e The event created by wxWidgets.

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

Definition at line 72 of file Tool.h.

virtual void Tool::MouseMoveEvent ( double  x,
double  y,
wxMouseEvent &  e 
) [inline, virtual]

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:
x The horizontal position of the mouse pointer in panorama pixels.
y The vertical position of the mouse pointer in panorama pixels.
e The event created by wxWidgets.

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

Definition at line 68 of file Tool.h.

virtual void Tool::MouseWheelEvent ( wxMouseEvent &  e  )  [inline, virtual]

Notify of a mouse wheel event on the panorama preview.

Parameters:
e The event created by wxWidgets.

Reimplemented in PanosphereOverviewCameraTool, and PlaneOverviewCameraTool.

Definition at line 76 of file Tool.h.

virtual void Tool::ReallyAfterDrawImagesEvent (  )  [inline, virtual]

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

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

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 105 of file Tool.h.

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


The documentation for this class was generated from the following files:
Generated on 23 Nov 2014 for Hugintrunk by  doxygen 1.4.7