Hugin trunk 0.1
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PreviewCameraTool Class Reference

tool for the manipulation of the opengl 'camera' properties It handles zooming in/out of the main preview window More...

#include <PreviewCameraTool.h>

Inheritance diagram for PreviewCameraTool:
Inheritance graph

Public Member Functions

 PreviewCameraTool (PreviewToolHelper *helper)
 
virtual ~PreviewCameraTool ()
 
void Activate ()
 Switch on a tool.
 
void MouseWheelEvent (wxMouseEvent &)
 event for mouse wheel processing
 
void MouseButtonEvent (wxMouseEvent &e)
 event for mouse button processing
 
void MouseMoveEvent (double x, double y, wxMouseEvent &e)
 event for mouse move
 
- 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.
 
virtual ~Tool ()
 
virtual void Deactivate ()
 Switch off a tool.
 
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 ()
 

Private Member Functions

void ChangeZoomLevel (bool zoomIn, const hugin_utils::FDiff2D &scrollPos)
 update zoom level
 
void UpdateCenter (const hugin_utils::FDiff2D &moveDist)
 update center, used for panning
 

Private Attributes

bool m_moving
 flag to indicate that we are moving the view with middle mouse button
 
hugin_utils::FDiff2D m_lastScreenPos
 last screen position during moving , needed for real-time update
 

Additional Inherited Members

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

Detailed Description

tool for the manipulation of the opengl 'camera' properties It handles zooming in/out of the main preview window

Definition at line 34 of file PreviewCameraTool.h.

Constructor & Destructor Documentation

◆ PreviewCameraTool()

PreviewCameraTool::PreviewCameraTool ( PreviewToolHelper helper)
inlineexplicit

Definition at line 37 of file PreviewCameraTool.h.

◆ ~PreviewCameraTool()

virtual PreviewCameraTool::~PreviewCameraTool ( )
inlinevirtual

Definition at line 38 of file PreviewCameraTool.h.

Member Function Documentation

◆ Activate()

void PreviewCameraTool::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 29 of file PreviewCameraTool.cpp.

References Tool::helper, m_moving, ToolHelper::MOUSE_MOVE, ToolHelper::MOUSE_PRESS, ToolHelper::MOUSE_WHEEL, and ToolHelper::NotifyMe().

◆ ChangeZoomLevel()

void PreviewCameraTool::ChangeZoomLevel ( bool  zoomIn,
const hugin_utils::FDiff2D scrollPos 
)
private

◆ MouseButtonEvent()

void PreviewCameraTool::MouseButtonEvent ( wxMouseEvent e)
virtual

event for mouse button processing

Reimplemented from Tool.

Definition at line 80 of file PreviewCameraTool.cpp.

References ToolHelper::GetMouseScreenPosition(), Tool::helper, ToolHelper::IsMouseOverPano(), m_lastScreenPos, m_moving, and UpdateCenter().

◆ MouseMoveEvent()

void PreviewCameraTool::MouseMoveEvent ( double  x,
double  y,
wxMouseEvent e 
)
virtual

event for mouse move

Reimplemented from Tool.

Definition at line 106 of file PreviewCameraTool.cpp.

References ToolHelper::GetMouseScreenPosition(), Tool::helper, ToolHelper::IsMouseOverPano(), m_lastScreenPos, m_moving, threshold(), and UpdateCenter().

◆ MouseWheelEvent()

void PreviewCameraTool::MouseWheelEvent ( wxMouseEvent e)
virtual

event for mouse wheel processing

Reimplemented from Tool.

Definition at line 59 of file PreviewCameraTool.cpp.

References ChangeZoomLevel(), ToolHelper::GetMousePanoPosition(), Tool::helper, and ToolHelper::IsMouseOverPano().

◆ UpdateCenter()

void PreviewCameraTool::UpdateCenter ( const hugin_utils::FDiff2D moveDist)
private

Member Data Documentation

◆ m_lastScreenPos

hugin_utils::FDiff2D PreviewCameraTool::m_lastScreenPos
private

last screen position during moving , needed for real-time update

Definition at line 56 of file PreviewCameraTool.h.

Referenced by MouseButtonEvent(), and MouseMoveEvent().

◆ m_moving

bool PreviewCameraTool::m_moving
private

flag to indicate that we are moving the view with middle mouse button

Definition at line 54 of file PreviewCameraTool.h.

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


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