Hugintrunk
0.1
|
The PreviewLayoutLinesTool handles the lines connecting images in the layout view of the fast preview. More...
#include <PreviewLayoutLinesTool.h>
Classes | |
class | LineDetails |
A class to store information about each line that will be drawn. More... | |
Public Member Functions | |
PreviewLayoutLinesTool (ToolHelper *helper) | |
~PreviewLayoutLinesTool () | |
void | panoramaChanged (HuginBase::Panorama &pano) |
This just sets a flag when the panorama is changed. More... | |
void | panoramaImagesChanged (HuginBase::Panorama &, const HuginBase::UIntSet &) |
notifies about changes to images More... | |
void | Activate () |
Start using the PreviewLayoutLinesTool. More... | |
virtual void | MouseMoveEvent (double x, double y, wxMouseEvent &e) |
Revaluate the lines under the mouse pointer when it moves. More... | |
void | MouseButtonEvent (wxMouseEvent &e) |
Capture clicks on lines, and load up the relavent images in the control point tab. More... | |
void | BeforeDrawImagesEvent () |
Draw all the lines between images that indicate the quality and quantity of control points. More... | |
bool | BeforeDrawImageEvent (unsigned int image) |
Draw what the tool requires just before a given image is drawn. More... | |
void | AfterDrawImagesEvent () |
Draw a border over the images when a line is hilighted, similar to the identify tool. More... | |
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 | 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 () |
Public Member Functions inherited from HuginBase::PanoramaObserver | |
virtual | ~PanoramaObserver () |
Private Member Functions | |
void | updateLineInformation () |
Update the line information. More... | |
void | updateImageCentres () |
Update the locations of the image centres. More... | |
void | drawIdentificationBorder (unsigned int image) |
Draw a border for an image. More... | |
Private Attributes | |
bool | m_holdOnNear |
bool | m_updateStatistics |
Flag set to true to update statistics next redraw. More... | |
unsigned int | m_rectangleBorderTex |
OpenGL texture names for the border highlight. More... | |
std::vector< hugin_utils::FDiff2D > | m_imageCentres |
The location on the panorama that the middle of the images map to. More... | |
std::vector< hugin_utils::FDiff2D > | m_imageCentresSpherical |
The spherical coordinates of the middle of the images. More... | |
std::vector < HuginBase::PTools::Transform * > | m_transforms |
The transformations used to make the image centres. More... | |
std::vector< LineDetails > | m_lines |
A container for the line information. More... | |
unsigned int | m_nearestLine |
The index of nearest line to the mouse position. More... | |
bool | m_useNearestLine |
True if we should highlight the nearest line to the mouse position. More... | |
Additional Inherited Members | |
Protected Attributes inherited from Tool | |
ToolHelper * | helper |
The PreviewToolHelper that uses the same preview window and panorama as the tool should. More... | |
The PreviewLayoutLinesTool handles the lines connecting images in the layout view of the fast preview.
These are its functions:
Definition at line 47 of file PreviewLayoutLinesTool.h.
|
explicit |
Definition at line 82 of file PreviewLayoutLinesTool.cpp.
References HuginBase::Panorama::addObserver(), ToolHelper::GetPanoramaPtr(), m_rectangleBorderTex, and rect_ts.
PreviewLayoutLinesTool::~PreviewLayoutLinesTool | ( | ) |
Definition at line 143 of file PreviewLayoutLinesTool.cpp.
References ToolHelper::GetPanoramaPtr(), Tool::helper, m_rectangleBorderTex, m_transforms, and HuginBase::Panorama::removeObserver().
|
virtual |
Start using the PreviewLayoutLinesTool.
Implements Tool.
Definition at line 169 of file PreviewLayoutLinesTool.cpp.
References ToolHelper::DRAW_OVER_IMAGES, ToolHelper::DRAW_UNDER_IMAGES, Tool::helper, ToolHelper::MOUSE_MOVE, ToolHelper::MOUSE_PRESS, ToolHelper::NotifyMe(), and ToolHelper::SetStatusMessage().
|
virtual |
Draw a border over the images when a line is hilighted, similar to the identify tool.
Reimplemented from Tool.
Definition at line 274 of file PreviewLayoutLinesTool.cpp.
References TextureManager::DisableTexture(), drawIdentificationBorder(), TextureManager::DrawImage(), VisualizationState::GetMeshDisplayList(), ViewState::GetTextureManager(), ToolHelper::GetViewStatePtr(), ToolHelper::GetVisualizationStatePtr(), Tool::helper, m_lines, m_nearestLine, m_rectangleBorderTex, and m_useNearestLine.
|
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).
Reimplemented from Tool.
Definition at line 342 of file PreviewLayoutLinesTool.cpp.
References ToolHelper::DoNotNotifyMeBeforeDrawing(), Tool::helper, PreviewLayoutLinesTool::LineDetails::image1, PreviewLayoutLinesTool::LineDetails::image2, celeste::line, m_lines, m_nearestLine, and m_useNearestLine.
|
virtual |
Draw all the lines between images that indicate the quality and quantity of control points.
Reimplemented from Tool.
Definition at line 241 of file PreviewLayoutLinesTool.cpp.
References TextureManager::DisableTexture(), ViewState::GetTextureManager(), ToolHelper::GetViewStatePtr(), Tool::helper, m_lines, m_nearestLine, m_updateStatistics, m_useNearestLine, updateImageCentres(), and updateLineInformation().
|
private |
Draw a border for an image.
Definition at line 308 of file PreviewLayoutLinesTool.cpp.
References HuginBase::BaseSrcPanoImage::CROP_CIRCLE, HuginBase::BaseSrcPanoImage::CROP_RECTANGLE, VisualizationState::GetMeshDisplayList(), ToolHelper::GetViewStatePtr(), ToolHelper::GetVisualizationStatePtr(), Tool::helper, and HuginBase::BaseSrcPanoImage::NO_CROP.
Referenced by AfterDrawImagesEvent().
|
virtual |
Capture clicks on lines, and load up the relavent images in the control point tab.
Reimplemented from Tool.
Definition at line 359 of file PreviewLayoutLinesTool.cpp.
References MainFrame::Get(), PreviewLayoutLinesTool::LineDetails::image1, PreviewLayoutLinesTool::LineDetails::image2, celeste::line, m_holdOnNear, m_lines, m_nearestLine, m_useNearestLine, and MainFrame::ShowCtrlPointEditor().
|
virtual |
Revaluate the lines under the mouse pointer when it moves.
Reimplemented from Tool.
Definition at line 180 of file PreviewLayoutLinesTool.cpp.
References VisualizationState::ForceRequireRedraw(), ToolHelper::GetMousePanoPosition(), VisualizationState::GetScale(), ToolHelper::GetVisualizationStatePtr(), Tool::helper, PreviewLayoutLinesTool::LineDetails::image1, PreviewLayoutLinesTool::LineDetails::image2, ToolHelper::IsMouseOverPano(), celeste::line, m_holdOnNear, m_lines, m_nearestLine, m_useNearestLine, ToolHelper::NotifyMeBeforeDrawing(), and VisualizationState::Redraw().
|
virtual |
This just sets a flag when the panorama is changed.
When we next redraw, we recalculate the statistics for the lines if the flag is set.
Implements HuginBase::PanoramaObserver.
Definition at line 159 of file PreviewLayoutLinesTool.cpp.
References m_updateStatistics.
|
virtual |
notifies about changes to images
Images might have been added/removed. to find out how many images are still there, use Panorama::getNrOfImages.
pano | the panorama object that changed |
changed | set of changed images |
Implements HuginBase::PanoramaObserver.
Definition at line 163 of file PreviewLayoutLinesTool.cpp.
References m_updateStatistics.
|
private |
Update the locations of the image centres.
Definition at line 519 of file PreviewLayoutLinesTool.cpp.
References HuginBase::PTools::Transform::createInvTransform(), HuginBase::PanoramaOptions::EQUIRECTANGULAR, HuginBase::Panorama::getNrOfImages(), ViewState::GetOptions(), ToolHelper::GetPanoramaPtr(), ViewState::GetSrcImage(), ToolHelper::GetViewStatePtr(), Tool::helper, m_imageCentres, m_imageCentresSpherical, m_transforms, HuginBase::PanoramaOptions::setHeight(), HuginBase::PanoramaOptions::setHFOV(), HuginBase::PanoramaOptions::setProjection(), HuginBase::PanoramaOptions::setWidth(), and HuginBase::PTools::Transform::transformImgCoord().
Referenced by BeforeDrawImagesEvent().
|
private |
Update the line information.
test if the line should be visible.
Definition at line 380 of file PreviewLayoutLinesTool.cpp.
References PreviewLayoutLinesTool::LineDetails::arc, HuginBase::PTools::Transform::createTransform(), PreviewLayoutLinesTool::LineDetails::dud, HuginBase::ControlPoint::error, HuginBase::Panorama::getActiveImages(), HuginBase::Panorama::getCtrlPoint(), HuginBase::Panorama::getImage(), HuginBase::Panorama::getNrOfCtrlPoints(), HuginBase::Panorama::getNrOfImages(), ViewState::GetOptions(), ToolHelper::GetPanoramaPtr(), ViewState::GetSrcImage(), ToolHelper::GetViewStatePtr(), ToolHelper::GetVisualizationStatePtr(), Tool::helper, PreviewLayoutLinesTool::LineDetails::image1, HuginBase::ControlPoint::image1Nr, PreviewLayoutLinesTool::LineDetails::image2, HuginBase::ControlPoint::image2Nr, HuginBase::SrcPanoImage::isInside(), celeste::line, m_imageCentresSpherical, m_lines, m_transforms, MIN_SAMPLE_OVERLAPS, PreviewLayoutLinesTool::LineDetails::numberOfControlPoints, SAMPLE_FREQUENCY, set_contains(), PreviewLayoutLinesTool::LineDetails::totalError, HuginBase::PTools::Transform::transformImgCoord(), and PreviewLayoutLinesTool::LineDetails::worstError.
Referenced by BeforeDrawImagesEvent().
|
private |
Definition at line 86 of file PreviewLayoutLinesTool.h.
Referenced by MouseButtonEvent(), and MouseMoveEvent().
|
private |
The location on the panorama that the middle of the images map to.
Definition at line 94 of file PreviewLayoutLinesTool.h.
Referenced by updateImageCentres().
|
private |
The spherical coordinates of the middle of the images.
Definition at line 97 of file PreviewLayoutLinesTool.h.
Referenced by updateImageCentres(), and updateLineInformation().
|
private |
A container for the line information.
Definition at line 149 of file PreviewLayoutLinesTool.h.
Referenced by AfterDrawImagesEvent(), BeforeDrawImageEvent(), BeforeDrawImagesEvent(), MouseButtonEvent(), MouseMoveEvent(), and updateLineInformation().
|
private |
The index of nearest line to the mouse position.
Definition at line 152 of file PreviewLayoutLinesTool.h.
Referenced by AfterDrawImagesEvent(), BeforeDrawImageEvent(), BeforeDrawImagesEvent(), MouseButtonEvent(), and MouseMoveEvent().
|
private |
OpenGL texture names for the border highlight.
Definition at line 91 of file PreviewLayoutLinesTool.h.
Referenced by AfterDrawImagesEvent(), PreviewLayoutLinesTool(), and ~PreviewLayoutLinesTool().
|
private |
The transformations used to make the image centres.
Definition at line 100 of file PreviewLayoutLinesTool.h.
Referenced by updateImageCentres(), updateLineInformation(), and ~PreviewLayoutLinesTool().
|
private |
Flag set to true to update statistics next redraw.
Definition at line 89 of file PreviewLayoutLinesTool.h.
Referenced by BeforeDrawImagesEvent(), panoramaChanged(), and panoramaImagesChanged().
|
private |
True if we should highlight the nearest line to the mouse position.
Definition at line 155 of file PreviewLayoutLinesTool.h.
Referenced by AfterDrawImagesEvent(), BeforeDrawImageEvent(), BeforeDrawImagesEvent(), MouseButtonEvent(), and MouseMoveEvent().