Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PreviewLayoutLinesTool.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
22 #ifndef PREVIEW_LAYOUT_LINES_TOOL_H
23 #define PREVIEW_LAYOUT_LINES_TOOL_H
24 
25 #include "Tool.h"
26 #include <vector>
27 #include <hugin_math/hugin_math.h>
28 #include "GreatCircles.h"
29 
30 class GLPreviewFrame;
31 
48 {
49 public:
52 
59 
61  void Activate();
62 
65  virtual void MouseMoveEvent(double x, double y, wxMouseEvent & e);
66 
70  void MouseButtonEvent(wxMouseEvent & e);
71 
75  void BeforeDrawImagesEvent();
76 
77  bool BeforeDrawImageEvent(unsigned int image);
78 
82  void AfterDrawImagesEvent();
83 private:
84 
85  //user has clicked and is holding left button while near a line
87 
91  unsigned int m_rectangleBorderTex;
92 
94  std::vector<hugin_utils::FDiff2D> m_imageCentres;
95 
97  std::vector<hugin_utils::FDiff2D> m_imageCentresSpherical;
98 
100  std::vector<HuginBase::PTools::Transform *> m_transforms;
101 
102 
106  {
107  public:
109  unsigned int image1, image2;
110  LineDetails();
112  unsigned int numberOfControlPoints;
114  double worstError;
116  double totalError;
121  bool dud;
122 
124 
140  void draw(bool highlight);
141 
145  float getDistance(hugin_utils::FDiff2D point);
146  };
147 
149  std::vector<LineDetails> m_lines;
150 
152  unsigned int m_nearestLine;
153 
156 
158  void updateLineInformation();
159 
161  void updateImageCentres();
162 
164  void drawIdentificationBorder(unsigned int image);
165 };
166 
167 #endif
168 
void MouseButtonEvent(wxMouseEvent &e)
Capture clicks on lines, and load up the relavent images in the control point tab.
A class to store information about each line that will be drawn.
double totalError
the total of all the control point errors between these images
The OpenGL preview frame.
unsigned int m_rectangleBorderTex
OpenGL texture names for the border highlight.
misc math function &amp; classes used by other parts of the program
unsigned int image1
index of images for this line
bool m_useNearestLine
True if we should highlight the nearest line to the mouse position.
PreviewLayoutLinesTool(ToolHelper *helper)
bool BeforeDrawImageEvent(unsigned int image)
Draw what the tool requires just before a given image is drawn.
std::vector< HuginBase::PTools::Transform * > m_transforms
The transformations used to make the image centres.
bool dud
false if the line should be used, true if it shouldn&#39;t.
std::set< unsigned int > UIntSet
Definition: PanoramaData.h:51
unsigned int m_nearestLine
The index of nearest line to the mouse position.
ToolHelper * helper
The PreviewToolHelper that uses the same preview window and panorama as the tool should.
Definition: Tool.h:102
void panoramaChanged(HuginBase::Panorama &pano)
This just sets a flag when the panorama is changed.
Model for a panorama.
Definition: Panorama.h:152
float getDistance(hugin_utils::FDiff2D point)
Get the square of the distance from the arc to some panorama coordinate.
std::vector< hugin_utils::FDiff2D > m_imageCentresSpherical
The spherical coordinates of the middle of the images.
Definition: Tool.h:42
void AfterDrawImagesEvent()
Draw a border over the images when a line is hilighted, similar to the identify tool.
Declare GreatCircles class.
The PreviewLayoutLinesTool handles the lines connecting images in the layout view of the fast preview...
void BeforeDrawImagesEvent()
Draw all the lines between images that indicate the quality and quantity of control points...
double worstError
the error of the control point with the greatest error between these images
std::vector< LineDetails > m_lines
A container for the line information.
bool m_updateStatistics
Flag set to true to update statistics next redraw.
this handler class will receive change events from the Panorama.
Definition: PanoramaData.h:401
void Activate()
Start using the PreviewLayoutLinesTool.
void panoramaImagesChanged(HuginBase::Panorama &, const HuginBase::UIntSet &)
notifies about changes to images
std::vector< hugin_utils::FDiff2D > m_imageCentres
The location on the panorama that the middle of the images map to.
void draw(bool highlight)
Draw a line in the preview for this pair of images.
virtual void MouseMoveEvent(double x, double y, wxMouseEvent &e)
Revaluate the lines under the mouse pointer when it moves.
void updateImageCentres()
Update the locations of the image centres.
void updateLineInformation()
Update the line information.
void drawIdentificationBorder(unsigned int image)
Draw a border for an image.
unsigned int numberOfControlPoints
the number of control points between these images