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

Allow the user to change the cropping region by dragging it in the fast preview. More...

#include <PreviewCropTool.h>

Inheritance diagram for PreviewCropTool:
Inheritance graph

Public Member Functions

 PreviewCropTool (PreviewToolHelper *helper)
 
void Activate ()
 Switch on a tool. More...
 
void ReallyAfterDrawImagesEvent ()
 Draw (using OpenGL) the overlays, e.g. crop highlights, guides. More...
 
void MouseMoveEvent (double x, double y, wxMouseEvent &e)
 Notify when the mouse pointer has moved over the panorama preview. More...
 
void MouseButtonEvent (wxMouseEvent &e)
 Notify of a mouse button press on the panorama preview. More...
 
- Public Member Functions inherited from PreviewTool
 PreviewTool (PreviewToolHelper *helper)
 
virtual ~PreviewTool ()
 
- Public Member Functions inherited from Tool
 Tool (ToolHelper *helper)
 Construct keeping a pointer to a PreviewToolHelper. More...
 
virtual ~Tool ()
 
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 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 ()
 

Private Attributes

bool moving_left
 
bool moving_right
 
bool moving_top
 
bool moving_bottom
 
bool mouse_down
 
double top
 
double bottom
 
double left
 
double right
 
double start_drag_x
 
double start_drag_y
 
HuginBase::PanoramaOptions start_drag_options
 
HuginBase::PanoramaOptions opts
 
vigra::Rect2D new_roi
 

Additional Inherited Members

- Protected Attributes inherited from Tool
ToolHelperhelper
 The PreviewToolHelper that uses the same preview window and panorama as the tool should. More...
 

Detailed Description

Allow the user to change the cropping region by dragging it in the fast preview.

Definition at line 31 of file PreviewCropTool.h.

Constructor & Destructor Documentation

PreviewCropTool::PreviewCropTool ( PreviewToolHelper helper)
explicit

Definition at line 41 of file PreviewCropTool.cpp.

Member Function Documentation

void PreviewCropTool::Activate ( )
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.

Implements Tool.

Definition at line 47 of file PreviewCropTool.cpp.

References Tool::helper, mouse_down, ToolHelper::MOUSE_MOVE, ToolHelper::MOUSE_PRESS, moving_bottom, moving_left, moving_right, moving_top, ToolHelper::NotifyMe(), ToolHelper::REALLY_DRAW_OVER_IMAGES, and ToolHelper::SetStatusMessage().

void PreviewCropTool::MouseButtonEvent ( wxMouseEvent &  e)
virtual
void PreviewCropTool::MouseMoveEvent ( double  x,
double  y,
wxMouseEvent &  e 
)
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
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 from Tool.

Definition at line 119 of file PreviewCropTool.cpp.

References bottom, VisualizationState::ForceRequireRedraw(), HuginBase::PanoramaOptions::getROI(), VisualizationState::getViewState(), ToolHelper::GetVisualizationStatePtr(), Tool::helper, left, mouse_down, moving_bottom, moving_left, moving_right, moving_top, new_roi, opts, VisualizationState::Redraw(), right, ViewState::SetOptions(), HuginBase::PanoramaOptions::setROI(), start_drag_options, start_drag_x, start_drag_y, and top.

void PreviewCropTool::ReallyAfterDrawImagesEvent ( )
virtual

Member Data Documentation

double PreviewCropTool::bottom
private

Definition at line 41 of file PreviewCropTool.h.

Referenced by MouseButtonEvent(), MouseMoveEvent(), and ReallyAfterDrawImagesEvent().

double PreviewCropTool::left
private

Definition at line 41 of file PreviewCropTool.h.

Referenced by MouseButtonEvent(), MouseMoveEvent(), and ReallyAfterDrawImagesEvent().

bool PreviewCropTool::mouse_down
private
bool PreviewCropTool::moving_bottom
private
bool PreviewCropTool::moving_left
private
bool PreviewCropTool::moving_right
private
bool PreviewCropTool::moving_top
private
vigra::Rect2D PreviewCropTool::new_roi
private

Definition at line 45 of file PreviewCropTool.h.

Referenced by MouseButtonEvent(), MouseMoveEvent(), and ReallyAfterDrawImagesEvent().

HuginBase::PanoramaOptions PreviewCropTool::opts
private

Definition at line 43 of file PreviewCropTool.h.

Referenced by MouseButtonEvent(), MouseMoveEvent(), and ReallyAfterDrawImagesEvent().

double PreviewCropTool::right
private

Definition at line 41 of file PreviewCropTool.h.

Referenced by MouseButtonEvent(), MouseMoveEvent(), and ReallyAfterDrawImagesEvent().

HuginBase::PanoramaOptions PreviewCropTool::start_drag_options
private

Definition at line 43 of file PreviewCropTool.h.

Referenced by MouseButtonEvent(), and MouseMoveEvent().

double PreviewCropTool::start_drag_x
private

Definition at line 42 of file PreviewCropTool.h.

Referenced by MouseButtonEvent(), and MouseMoveEvent().

double PreviewCropTool::start_drag_y
private

Definition at line 42 of file PreviewCropTool.h.

Referenced by MouseButtonEvent(), and MouseMoveEvent().

double PreviewCropTool::top
private

Definition at line 41 of file PreviewCropTool.h.

Referenced by MouseButtonEvent(), MouseMoveEvent(), and ReallyAfterDrawImagesEvent().


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