Hugin trunk 0.1
Loading...
Searching...
No Matches
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.
 
virtual ~Tool ()
 
virtual void Activate ()=0
 Switch on a tool.
 
virtual void Deactivate ()
 Switch off 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.
 
virtual void MarkDirty ()
 

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::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, and threshold().

◆ ~Tool()

Tool::~Tool ( )
virtual

Definition at line 34 of file Tool.cpp.

Member Function Documentation

◆ Activate()

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, PanosphereSphereTool, PreviewCameraTool, PreviewControlPointTool, PreviewCropTool, PreviewDifferenceTool, PreviewGuideTool, PreviewIdentifyTool, PreviewLayoutLinesTool, PreviewPanoMaskTool, PreviewProjectionGridTool, PanosphereOverviewProjectionGridTool, PanosphereOverviewOutlinesTool, PlaneOverviewOutlinesTool, PreviewColorPickerTool, and PreviewEditCPTool.

◆ AfterDrawImageEvent()

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

Notification called just after the image was drawn normally.

Definition at line 102 of file Tool.h.

◆ AfterDrawImagesEvent()

virtual void Tool::AfterDrawImagesEvent ( )
inlinevirtual

Draw (using OpenGL) images above the others.

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

Definition at line 90 of file Tool.h.

◆ BeforeDrawImageEvent()

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

Definition at line 100 of file Tool.h.

◆ BeforeDrawImagesEvent()

virtual void Tool::BeforeDrawImagesEvent ( )
inlinevirtual

Draw using OpenGL anything the tool requires underneath the images.

Reimplemented in PreviewDifferenceTool, PreviewLayoutLinesTool, PreviewPanoMaskTool, and PreviewProjectionGridTool.

Definition at line 88 of file Tool.h.

◆ Deactivate()

virtual void Tool::Deactivate ( )
inlinevirtual

Switch off a tool.

Deactivation of all notifications is done automatically, it is not needed in these function.

Reimplemented in PreviewColorPickerTool, and PreviewEditCPTool.

Definition at line 61 of file Tool.h.

◆ ImagesUnderMouseChangedEvent()

virtual void Tool::ImagesUnderMouseChangedEvent ( )
inlinevirtual

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

◆ KeypressEvent()

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 PanosphereOverviewCameraTool, and PlaneOverviewCameraTool.

Definition at line 86 of file Tool.h.

◆ MarkDirty()

virtual void Tool::MarkDirty ( )
inlinevirtual

Reimplemented in PanosphereOverviewOutlinesTool, and PlaneOverviewOutlinesTool.

Definition at line 104 of file Tool.h.

◆ MouseButtonEvent()

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 DragTool, PanosphereOverviewCameraTool, PlaneOverviewCameraTool, PreviewCameraTool, PreviewCropTool, PreviewIdentifyTool, PreviewLayoutLinesTool, PreviewColorPickerTool, and PreviewEditCPTool.

Definition at line 74 of file Tool.h.

◆ MouseMoveEvent()

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 DragTool, PanosphereOverviewCameraTool, PlaneOverviewCameraTool, PreviewCameraTool, PreviewCropTool, PreviewIdentifyTool, PreviewLayoutLinesTool, and PreviewEditCPTool.

Definition at line 70 of file Tool.h.

◆ MouseWheelEvent()

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 PanosphereOverviewCameraTool, PlaneOverviewCameraTool, and PreviewCameraTool.

Definition at line 78 of file Tool.h.

◆ ReallyAfterDrawImagesEvent()

virtual void Tool::ReallyAfterDrawImagesEvent ( )
inlinevirtual

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

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

Definition at line 92 of file Tool.h.

Member Data Documentation

◆ helper

ToolHelper* Tool::helper
protected

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

Definition at line 109 of file Tool.h.

Referenced by DragTool::Activate(), PanosphereOverviewCameraTool::Activate(), PlaneOverviewCameraTool::Activate(), PanosphereSphereTool::Activate(), PreviewCameraTool::Activate(), PreviewControlPointTool::Activate(), PreviewCropTool::Activate(), PreviewDifferenceTool::Activate(), PreviewGuideTool::Activate(), PreviewIdentifyTool::Activate(), PreviewLayoutLinesTool::Activate(), PreviewPanoMaskTool::Activate(), PreviewProjectionGridTool::Activate(), PanosphereOverviewProjectionGridTool::Activate(), PanosphereOverviewOutlinesTool::Activate(), PlaneOverviewOutlinesTool::Activate(), PreviewColorPickerTool::Activate(), PreviewEditCPTool::Activate(), PreviewEditCPTool::AddLineCP(), PanosphereOverviewProjectionGridTool::AfterDrawImagesBackEvent(), PreviewControlPointTool::AfterDrawImagesEvent(), PreviewDifferenceTool::AfterDrawImagesEvent(), PreviewIdentifyTool::AfterDrawImagesEvent(), PreviewLayoutLinesTool::AfterDrawImagesEvent(), PreviewProjectionGridTool::AfterDrawImagesEvent(), PanosphereOverviewProjectionGridTool::AfterDrawImagesFrontEvent(), PreviewLayoutLinesTool::BeforeDrawImageEvent(), PanosphereSphereTool::BeforeDrawImagesBackEvent(), PreviewDifferenceTool::BeforeDrawImagesEvent(), PreviewLayoutLinesTool::BeforeDrawImagesEvent(), PreviewColorPickerTool::CalcCorrection(), PreviewColorPickerTool::CalcCorrectionForImage(), PanosphereOverviewCameraTool::ChangeFOV(), PreviewCameraTool::ChangeZoomLevel(), PanosphereOverviewCameraTool::ChangeZoomLevel(), PlaneOverviewCameraTool::ChangeZoomLevel(), PreviewProjectionGridTool::createMesh(), PreviewColorPickerTool::Deactivate(), PreviewEditCPTool::Deactivate(), PanosphereOverviewOutlinesTool::drawBackground(), PreviewLayoutLinesTool::drawIdentificationBorder(), PreviewEditCPTool::FindCPInRect(), PreviewIdentifyTool::ForceRedraw(), PreviewEditCPTool::GetSelectedROI(), PreviewDifferenceTool::ImagesUnderMouseChangedEvent(), PreviewIdentifyTool::ImagesUnderMouseChangedEvent(), PreviewControlPointTool::MakeTransforms(), DragTool::MouseButtonEvent(), PanosphereOverviewCameraTool::MouseButtonEvent(), PlaneOverviewCameraTool::MouseButtonEvent(), PreviewCameraTool::MouseButtonEvent(), PreviewCropTool::MouseButtonEvent(), PreviewIdentifyTool::MouseButtonEvent(), PreviewColorPickerTool::MouseButtonEvent(), PreviewEditCPTool::MouseButtonEvent(), DragTool::MouseMoveEvent(), PanosphereOverviewCameraTool::MouseMoveEvent(), PlaneOverviewCameraTool::MouseMoveEvent(), PreviewCameraTool::MouseMoveEvent(), PreviewCropTool::MouseMoveEvent(), PreviewLayoutLinesTool::MouseMoveEvent(), PreviewEditCPTool::MouseMoveEvent(), PanosphereOverviewCameraTool::MouseWheelEvent(), PreviewCameraTool::MouseWheelEvent(), PreviewControlPointTool::PreviewControlPointTool(), PreviewLayoutLinesTool::PreviewLayoutLinesTool(), PreviewDragTool::ReallyAfterDrawImagesEvent(), PreviewCropTool::ReallyAfterDrawImagesEvent(), PreviewGuideTool::ReallyAfterDrawImagesEvent(), PreviewPanoMaskTool::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: