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

#include <ToolHelper.h>

Inheritance diagram for ToolHelper:
Inheritance graph

Public Types

enum  Event {
  MOUSE_MOVE, MOUSE_PRESS, KEY_PRESS, DRAW_UNDER_IMAGES,
  DRAW_OVER_IMAGES, IMAGES_UNDER_MOUSE_CHANGE, REALLY_DRAW_OVER_IMAGES, MOUSE_WHEEL,
  MARK_DIRTY
}
 

Public Member Functions

 ToolHelper (HuginBase::Panorama *pano, VisualizationState *visualization_state, GLPreviewFrame *frame)
 
virtual ~ToolHelper ()
 
std::set< Tool * > ActivateTool (Tool *tool)
 
virtual void DeactivateTool (Tool *tool)
 
virtual void MouseMoved (int x, int y, wxMouseEvent &e)
 
void MouseButtonEvent (wxMouseEvent &e)
 
void MouseWheelEvent (wxMouseEvent &e)
 
void KeypressEvent (int keycode, int modifiers, bool pressed)
 
void BeforeDrawImages ()
 
void AfterDrawImages ()
 
void MarkDirty ()
 
bool BeforeDrawImageNumber (unsigned int image)
 
void AfterDrawImageNumber (unsigned int image)
 
void MouseEnter (int x, int y, wxMouseEvent &e)
 
void MouseLeave ()
 
std::set< unsigned int > GetImageNumbersUnderMouse ()
 
hugin_utils::FDiff2D GetMouseScreenPosition ()
 
hugin_utils::FDiff2D GetMousePanoPosition ()
 
VisualizationStateGetVisualizationStatePtr ()
 
ViewStateGetViewStatePtr ()
 
HuginBase::PanoramaGetPanoramaPtr ()
 
void NotifyMe (Event event, Tool *tool)
 
void NotifyMeBeforeDrawing (unsigned int image_nr, Tool *tool)
 
void NotifyMeAfterDrawing (unsigned int image_nr, Tool *tool)
 
void DoNotNotifyMe (Event event, Tool *tool)
 
void DoNotNotifyMeBeforeDrawing (unsigned int image_nr, Tool *tool)
 
void DoNotNotifyMeAfterDrawing (unsigned int image_nr, Tool *tool)
 
void SetStatusMessage (wxString message)
 
bool IsMouseOverPano ()
 
HuginBase::UIntSet GetImagesUnderPos (const hugin_utils::FDiff2D &pos)
 
GLPreviewFrameGetPreviewFrame ()
 

Protected Member Functions

void RemoveTool (Tool *tool, Tool **single)
 
void RemoveTool (Tool *tool, std::set< Tool * > *set)
 
void RemoveTool (Tool *tool, std::vector< std::set< Tool * > > *vector)
 
void RemoveTool (Tool *tool, std::vector< std::set< Tool * > > *vector, unsigned int index)
 
void AddTool (Tool *tool, Tool **single)
 
void AddTool (Tool *tool, std::set< Tool * > *set)
 
void AddTool (Tool *tool, std::vector< std::set< Tool * > > *vector, unsigned int index)
 
void UpdateImagesUnderMouse ()
 
void InvalidateImagesUnderMouse ()
 

Protected Attributes

std::set< Tool * > tools_deactivated
 
HuginBase::Panoramapano
 
VisualizationStatevisualization_state
 
GLPreviewFrameframe
 
double mouse_screen_x
 
double mouse_screen_y
 
double mouse_pano_x
 
double mouse_pano_y
 
std::set< Tool * > mouse_move_notified_tools
 
std::set< Tool * > mouse_button_notified_tools
 
std::set< Tool * > keypress_notified_tools
 
std::set< Tool * > draw_under_notified_tools
 
std::set< Tool * > draw_over_notified_tools
 
std::set< Tool * > really_draw_over_notified_tools
 
std::set< Tool * > images_under_mouse_notified_tools
 
std::set< Tool * > mouse_wheel_notified_tools
 
std::set< Tool * > m_tools_need_dirty_flag
 
std::vector< std::set< Tool * > > image_draw_begin_tools
 
std::vector< std::set< Tool * > > image_draw_end_tools
 
bool images_under_mouse_current
 
bool mouse_over_pano
 
std::set< unsigned int > images_under_mouse
 

Detailed Description

Definition at line 76 of file ToolHelper.h.

Member Enumeration Documentation

Enumerator
MOUSE_MOVE 
MOUSE_PRESS 
KEY_PRESS 
DRAW_UNDER_IMAGES 
DRAW_OVER_IMAGES 
IMAGES_UNDER_MOUSE_CHANGE 
REALLY_DRAW_OVER_IMAGES 
MOUSE_WHEEL 
MARK_DIRTY 

Definition at line 79 of file ToolHelper.h.

Constructor & Destructor Documentation

ToolHelper::ToolHelper ( HuginBase::Panorama pano,
VisualizationState visualization_state,
GLPreviewFrame frame 
)
ToolHelper::~ToolHelper ( )
virtual

Definition at line 49 of file ToolHelper.cpp.

Member Function Documentation

std::set< Tool * > ToolHelper::ActivateTool ( Tool tool)
void ToolHelper::AddTool ( Tool tool,
Tool **  single 
)
protected
void ToolHelper::AddTool ( Tool tool,
std::set< Tool * > *  set 
)
protected

Definition at line 467 of file ToolHelper.cpp.

void ToolHelper::AddTool ( Tool tool,
std::vector< std::set< Tool * > > *  vector,
unsigned int  index 
)
protected

Definition at line 472 of file ToolHelper.cpp.

void ToolHelper::AfterDrawImageNumber ( unsigned int  image)
void ToolHelper::AfterDrawImages ( )
bool ToolHelper::BeforeDrawImageNumber ( unsigned int  image)
void ToolHelper::BeforeDrawImages ( )
void ToolHelper::DeactivateTool ( Tool tool)
virtual
void ToolHelper::DoNotNotifyMe ( Event  event,
Tool tool 
)
void ToolHelper::DoNotNotifyMeAfterDrawing ( unsigned int  image_nr,
Tool tool 
)

Definition at line 403 of file ToolHelper.cpp.

References image_draw_end_tools, and RemoveTool().

void ToolHelper::DoNotNotifyMeBeforeDrawing ( unsigned int  image_nr,
Tool tool 
)
std::set< unsigned int > ToolHelper::GetImageNumbersUnderMouse ( )
HuginBase::UIntSet ToolHelper::GetImagesUnderPos ( const hugin_utils::FDiff2D pos)
hugin_utils::FDiff2D ToolHelper::GetMousePanoPosition ( )
hugin_utils::FDiff2D ToolHelper::GetMouseScreenPosition ( )
HuginBase::Panorama * ToolHelper::GetPanoramaPtr ( )
GLPreviewFrame* ToolHelper::GetPreviewFrame ( )
inline
ViewState * ToolHelper::GetViewStatePtr ( )
VisualizationState * ToolHelper::GetVisualizationStatePtr ( )

Definition at line 300 of file ToolHelper.cpp.

References visualization_state.

Referenced by PreviewEditCPTool::AddLineCP(), PreviewDifferenceTool::AfterDrawImagesEvent(), PreviewIdentifyTool::AfterDrawImagesEvent(), PreviewLayoutLinesTool::AfterDrawImagesEvent(), PreviewDifferenceTool::BeforeDrawImagesEvent(), PanosphereOverviewCameraTool::ChangeFOV(), PanosphereOverviewCameraTool::ChangeZoomLevel(), PreviewCameraTool::ChangeZoomLevel(), PlaneOverviewCameraTool::ChangeZoomLevel(), PreviewProjectionGridTool::createMesh(), OverviewOutlinesTool::draw(), PanosphereOverviewOutlinesTool::drawBackground(), PreviewLayoutLinesTool::drawIdentificationBorder(), OverviewOutlinesTool::DrawRect(), PreviewIdentifyTool::ForceRedraw(), PreviewDifferenceTool::ImagesUnderMouseChangedEvent(), PreviewControlPointTool::MakeTransforms(), PreviewCropTool::MouseButtonEvent(), PanosphereOverviewCameraTool::MouseButtonEvent(), PreviewEditCPTool::MouseButtonEvent(), DragTool::MouseButtonEvent(), PlaneOverviewCameraTool::MouseButtonEvent(), PreviewCropTool::MouseMoveEvent(), PanosphereOverviewCameraTool::MouseMoveEvent(), PreviewEditCPTool::MouseMoveEvent(), DragTool::MouseMoveEvent(), PreviewLayoutLinesTool::MouseMoveEvent(), PlaneOverviewCameraTool::MouseMoveEvent(), PanosphereOverviewCameraTool::MouseWheelEvent(), OverviewOutlinesTool::panoramaChanged(), PreviewControlPointTool::PreviewControlPointTool(), PreviewCropTool::ReallyAfterDrawImagesEvent(), PreviewCameraTool::UpdateCenter(), and PreviewLayoutLinesTool::updateLineInformation().

void ToolHelper::InvalidateImagesUnderMouse ( )
protected
bool ToolHelper::IsMouseOverPano ( )
inline
void ToolHelper::KeypressEvent ( int  keycode,
int  modifiers,
bool  pressed 
)
void ToolHelper::MarkDirty ( )

Definition at line 203 of file ToolHelper.cpp.

References m_tools_need_dirty_flag.

Referenced by GLViewer::MarkToolsDirty().

void ToolHelper::MouseButtonEvent ( wxMouseEvent &  e)

Definition at line 148 of file ToolHelper.cpp.

References mouse_button_notified_tools.

Referenced by GLViewer::MouseButtons().

void ToolHelper::MouseEnter ( int  x,
int  y,
wxMouseEvent &  e 
)
void ToolHelper::MouseLeave ( )
void ToolHelper::MouseMoved ( int  x,
int  y,
wxMouseEvent &  e 
)
virtual
void ToolHelper::MouseWheelEvent ( wxMouseEvent &  e)

Definition at line 156 of file ToolHelper.cpp.

References mouse_wheel_notified_tools.

Referenced by GLViewer::MouseWheel().

void ToolHelper::NotifyMe ( Event  event,
Tool tool 
)
void ToolHelper::NotifyMeAfterDrawing ( unsigned int  image_nr,
Tool tool 
)

Definition at line 355 of file ToolHelper.cpp.

References AddTool(), and image_draw_end_tools.

void ToolHelper::NotifyMeBeforeDrawing ( unsigned int  image_nr,
Tool tool 
)
void ToolHelper::RemoveTool ( Tool tool,
Tool **  single 
)
protected
void ToolHelper::RemoveTool ( Tool tool,
std::set< Tool * > *  set 
)
protected

Definition at line 428 of file ToolHelper.cpp.

void ToolHelper::RemoveTool ( Tool tool,
std::vector< std::set< Tool * > > *  vector 
)
protected

Definition at line 438 of file ToolHelper.cpp.

void ToolHelper::RemoveTool ( Tool tool,
std::vector< std::set< Tool * > > *  vector,
unsigned int  index 
)
protected

Definition at line 448 of file ToolHelper.cpp.

void ToolHelper::SetStatusMessage ( wxString  message)
void ToolHelper::UpdateImagesUnderMouse ( )
protected

Member Data Documentation

std::set<Tool *> ToolHelper::draw_over_notified_tools
protected

Definition at line 155 of file ToolHelper.h.

Referenced by AfterDrawImages(), DeactivateTool(), DoNotNotifyMe(), and NotifyMe().

std::set<Tool *> ToolHelper::draw_under_notified_tools
protected

Definition at line 154 of file ToolHelper.h.

Referenced by BeforeDrawImages(), DeactivateTool(), DoNotNotifyMe(), and NotifyMe().

GLPreviewFrame* ToolHelper::frame
protected

Definition at line 145 of file ToolHelper.h.

Referenced by GetPreviewFrame(), SetStatusMessage(), and ToolHelper().

std::vector<std::set<Tool *> > ToolHelper::image_draw_begin_tools
protected
std::vector<std::set<Tool *> > ToolHelper::image_draw_end_tools
protected
std::set<unsigned int> ToolHelper::images_under_mouse
protected
bool ToolHelper::images_under_mouse_current
protected
std::set<Tool *> ToolHelper::images_under_mouse_notified_tools
protected
std::set<Tool *> ToolHelper::keypress_notified_tools
protected

Definition at line 153 of file ToolHelper.h.

Referenced by DeactivateTool(), DoNotNotifyMe(), KeypressEvent(), and NotifyMe().

std::set<Tool *> ToolHelper::m_tools_need_dirty_flag
protected

Definition at line 159 of file ToolHelper.h.

Referenced by DoNotNotifyMe(), MarkDirty(), and NotifyMe().

std::set<Tool *> ToolHelper::mouse_button_notified_tools
protected

Definition at line 152 of file ToolHelper.h.

Referenced by DeactivateTool(), DoNotNotifyMe(), MouseButtonEvent(), and NotifyMe().

std::set<Tool *> ToolHelper::mouse_move_notified_tools
protected
bool ToolHelper::mouse_over_pano
protected
double ToolHelper::mouse_pano_x
protected
double ToolHelper::mouse_pano_y
protected
double ToolHelper::mouse_screen_x
protected
double ToolHelper::mouse_screen_y
protected
std::set<Tool *> ToolHelper::mouse_wheel_notified_tools
protected

Definition at line 158 of file ToolHelper.h.

Referenced by DoNotNotifyMe(), MouseWheelEvent(), and NotifyMe().

HuginBase::Panorama* ToolHelper::pano
protected

Definition at line 143 of file ToolHelper.h.

Referenced by GetImagesUnderPos(), GetPanoramaPtr(), and ToolHelper().

std::set<Tool *> ToolHelper::really_draw_over_notified_tools
protected

Definition at line 156 of file ToolHelper.h.

Referenced by AfterDrawImages(), DeactivateTool(), DoNotNotifyMe(), and NotifyMe().

std::set<Tool *> ToolHelper::tools_deactivated
protected

Definition at line 142 of file ToolHelper.h.

Referenced by ActivateTool(), and DeactivateTool().

VisualizationState* ToolHelper::visualization_state
protected

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