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

Finds the topmost image underneath the mouse pontier, cancel it's normal drawing, and then subtract it from the rest of the images. More...

#include <PreviewDifferenceTool.h>

Inheritance diagram for PreviewDifferenceTool:
Inheritance graph

Public Member Functions

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

Static Public Member Functions

static bool CheckOpenGLCanDifference ()
 check, if graphic card supports the necessary modes for difference tool call this procedure first, when there is a OpenGL context More...
 

Private Attributes

unsigned int image_number
 
bool over_image
 

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

Finds the topmost image underneath the mouse pontier, cancel it's normal drawing, and then subtract it from the rest of the images.

It is meant to be the fast preview's equivalent of the accurate preview's difference mode.

Warning
Since the fast preview is approximate, this will show errors that don't really exist.

Definition at line 34 of file PreviewDifferenceTool.h.

Constructor & Destructor Documentation

PreviewDifferenceTool::PreviewDifferenceTool ( ToolHelper helper)
explicit

Definition at line 44 of file PreviewDifferenceTool.cpp.

Member Function Documentation

void PreviewDifferenceTool::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 71 of file PreviewDifferenceTool.cpp.

References CheckOpenGLCanDifference(), Tool::helper, ToolHelper::IMAGES_UNDER_MOUSE_CHANGE, ToolHelper::NotifyMe(), and over_image.

void PreviewDifferenceTool::AfterDrawImagesEvent ( )
virtual
bool PreviewDifferenceTool::BeforeDrawImageEvent ( unsigned int  image)
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 from Tool.

Definition at line 182 of file PreviewDifferenceTool.cpp.

void PreviewDifferenceTool::BeforeDrawImagesEvent ( )
virtual

Draw using OpenGL anything the tool requires underneath the images.

Reimplemented from Tool.

Definition at line 175 of file PreviewDifferenceTool.cpp.

References TextureManager::DrawImage(), VisualizationState::GetMeshDisplayList(), ViewState::GetTextureManager(), ToolHelper::GetViewStatePtr(), ToolHelper::GetVisualizationStatePtr(), Tool::helper, and image_number.

bool PreviewDifferenceTool::CheckOpenGLCanDifference ( )
static

check, if graphic card supports the necessary modes for difference tool call this procedure first, when there is a OpenGL context

call this function only after OpenGL context was created

Returns
true, if graphic card supports difference mode

Definition at line 51 of file PreviewDifferenceTool.cpp.

Referenced by Activate(), and GLPreviewFrame::FillBlendChoice().

void PreviewDifferenceTool::ImagesUnderMouseChangedEvent ( )
virtual

Member Data Documentation

unsigned int PreviewDifferenceTool::image_number
private
bool PreviewDifferenceTool::over_image
private

Definition at line 50 of file PreviewDifferenceTool.h.

Referenced by Activate(), and ImagesUnderMouseChangedEvent().


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