PreviewLayoutLinesTool.h

Go to the documentation of this file.
00001 // -*- c-basic-offset: 4 -*-
00022 #ifndef PREVIEW_LAYOUT_LINES_TOOL_H
00023 #define PREVIEW_LAYOUT_LINES_TOOL_H
00024 
00025 #include "Tool.h"
00026 #include <vector>
00027 #include <hugin_math/hugin_math.h>
00028 #include "GreatCircles.h"
00029 
00030 class GLPreviewFrame;
00031 
00047 class PreviewLayoutLinesTool : public Tool, public HuginBase::PanoramaObserver
00048 {
00049 public:
00050     PreviewLayoutLinesTool(ToolHelper *helper);
00051     ~PreviewLayoutLinesTool();
00052     
00057     void panoramaChanged(HuginBase::PanoramaData &pano);
00058     void panoramaImagesChanged(HuginBase::PanoramaData&, const HuginBase::UIntSet&);
00059     
00061     void Activate();
00062     
00065     virtual void MouseMoveEvent(double x, double y, wxMouseEvent & e);
00066     
00070     void MouseButtonEvent(wxMouseEvent & e);
00071 
00075     void BeforeDrawImagesEvent();
00076     
00077     bool BeforeDrawImageEvent(unsigned int image);
00078     
00082     void AfterDrawImagesEvent();
00083 private:
00084 
00085     //user has clicked and is holding left button while near a line
00086     bool m_holdOnNear;
00087 
00089     bool m_updateStatistics;
00091     unsigned int m_rectangleBorderTex;
00092     
00094     std::vector<hugin_utils::FDiff2D> m_imageCentres;
00095     
00097     std::vector<hugin_utils::FDiff2D> m_imageCentresSpherical;
00098     
00100     std::vector<HuginBase::PTools::Transform *> m_transforms;
00101     
00102     
00105     class LineDetails
00106     {
00107     public:
00109         unsigned int image1, image2;
00110         LineDetails();
00112         unsigned int numberOfControlPoints;
00114         double worstError;
00116         double totalError;
00121         bool dud;
00122         
00123         GreatCircleArc arc;
00124         
00140         void draw(bool highlight);
00141         
00145         float getDistance(hugin_utils::FDiff2D point);
00146     };
00147     
00149     std::vector<LineDetails> m_lines;
00150     
00152     unsigned int m_nearestLine;
00153     
00155     bool m_useNearestLine;
00156     
00158     void updateLineInformation();
00159     
00161     void updateImageCentres();
00162     
00164     void drawIdentificationBorder(unsigned int image);
00165 };
00166 
00167 #endif
00168 

Generated on 31 Oct 2014 for Hugintrunk by  doxygen 1.4.7