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
[legend]
List of all members.

Public Member Functions

 PreviewDifferenceTool (ToolHelper *helper)
void Activate ()
 Switch on a tool.
void ImagesUnderMouseChangedEvent ()
 Notify when the images directly underneath the mouse pointer have changed.
void AfterDrawImagesEvent ()
 Draw (using OpenGL) images above the others.
void BeforeDrawImagesEvent ()
 Draw using OpenGL anything the tool requires underneath the images.
bool BeforeDrawImageEvent (unsigned int image)
 Draw what the tool requires just before a given image is drawn.

Static Public Member Functions

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

Private Attributes

unsigned int image_number
bool over_image

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  ) 
 

Definition at line 40 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 56 of file PreviewDifferenceTool.cpp.

References CheckOpenGLCanDifference(), ToolHelper::NotifyMe(), and over_image.

void PreviewDifferenceTool::AfterDrawImagesEvent  )  [virtual]
 

Draw (using OpenGL) images above the others.

Reimplemented from Tool.

Definition at line 110 of file PreviewDifferenceTool.cpp.

References TextureManager::BindTexture(), TextureManager::DisableTexture(), HuginBase::SrcPanoImage::getExposure(), VisualizationState::GetMeshDisplayList(), HuginBase::Panorama::getOptions(), ToolHelper::GetPanoramaPtr(), TextureManager::GetPhotometricCorrect(), ViewState::GetSrcImage(), ViewState::GetTextureManager(), ToolHelper::GetViewStatePtr(), ToolHelper::GetVisualizationStatePtr(), image_number, and vigra_ext::pow().

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 167 of file PreviewDifferenceTool.cpp.

void PreviewDifferenceTool::BeforeDrawImagesEvent  )  [virtual]
 

Draw using OpenGL anything the tool requires underneath the images.

Reimplemented from Tool.

Definition at line 160 of file PreviewDifferenceTool.cpp.

References TextureManager::DrawImage(), VisualizationState::GetMeshDisplayList(), ViewState::GetTextureManager(), ToolHelper::GetViewStatePtr(), ToolHelper::GetVisualizationStatePtr(), 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

Returns:
true, if graphic card supports difference mode

Definition at line 47 of file PreviewDifferenceTool.cpp.

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

void PreviewDifferenceTool::ImagesUnderMouseChangedEvent  )  [virtual]
 

Notify when the images directly underneath the mouse pointer have changed.

It is monitored by the PreviewToolHelper.

Reimplemented from Tool.

Definition at line 70 of file PreviewDifferenceTool.cpp.

References ToolHelper::DoNotNotifyMe(), ToolHelper::DoNotNotifyMeBeforeDrawing(), VisualizationState::ForceRequireRedraw(), ToolHelper::GetImageNumbersUnderMouse(), ToolHelper::GetVisualizationStatePtr(), image_number, ToolHelper::NotifyMe(), ToolHelper::NotifyMeBeforeDrawing(), over_image, and VisualizationState::Redraw().


Member Data Documentation

unsigned int PreviewDifferenceTool::image_number [private]
 

Definition at line 49 of file PreviewDifferenceTool.h.

Referenced by AfterDrawImagesEvent(), BeforeDrawImagesEvent(), and ImagesUnderMouseChangedEvent().

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:
Generated on Wed Jul 16 01:25:49 2014 for Hugintrunk by  doxygen 1.3.9.1