Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OverviewOutlinesTool.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
23 #ifndef __OVERVIEW_OUTLINES_TOOL_H__
24 #define __OVERVIEW_OUTLINES_TOOL_H__
25 
26 #include "Tool.h"
27 
28 class GLViewer;
29 
44 {
45  public:
47  virtual ~OverviewOutlinesTool();
48 
49 
50  virtual void panoramaChanged(HuginBase::Panorama &pano);
52 
56  class Rect {
57  public:
58  Rect(double left, double top, double right, double bottom) {
59  val[0][0] = left; val[0][1] = top;
60  val[1][0] = left; val[1][1] = bottom;
61  val[2][0] = right; val[2][1] = bottom;
62  val[3][0] = right; val[3][1] = top;
63  }
69  Rect res(0,0,0,0);
70  for (int s = 0 ; s < 4 ; s++) {
71  double x,y;
72  trans->transformImgCoord(x,y, val[s][0], val[s][1]);
73  res.val[s][0] = x;
74  res.val[s][1] = y;
75  }
76  return res;
77  }
81  void center(double &x, double &y) {
82  x = (val[0][0] + val[1][0] + val[2][0] + val[3][0]) / 4.0;
83  y = (val[0][1] + val[1][1] + val[2][1] + val[3][1]) / 4.0;
84  }
85  double val[4][2];
86  };
87 
91  virtual void drawBackground() {}
92 
93  protected:
94 
95  void draw();
96 
97  void DrawRect(double left, double top, double right, double bottom, bool outline, double linewidth = 1.0);
98 
100 
102 
103  //TODO take into consideration scale of gl canvas
104  //resolution of the mesh
105  const static double res;
106  const static double mindist;
107 
109 
114 
115  /* data */
116 };
117 
119 {
120  public:
121 
123 
124  void Activate();
127 
128 
129  void drawBackground();
130  virtual void MarkDirty() override;
131 };
132 
134 {
135  public:
136 
138 
139  void Activate();
140  void AfterDrawImagesEvent();
141 
142  void drawBackground();
143  virtual void MarkDirty() override;
144 };
145 
146 
147 #endif /* __OVERVIEW_OUTLINES_TOOL_H__ */
148 
unsigned int display_list_number_crop_outline
class to represent a single rectangle
PlaneOverviewOutlinesTool(PlaneOverviewToolHelper *helper, GLViewer *preview)
void Activate()
Switch on a tool.
class for drawing the outlines of the preview canvas and the crop rectangle in the overview openl sce...
virtual void panoramaChanged(HuginBase::Panorama &pano)
Notification about a Panorama change.
unsigned int display_list_number_canvas_outline
void drawBackground()
drawing the background means drawing a mesh that covers the whole panorama for the purpose of darkeni...
std::set< unsigned int > UIntSet
Definition: PanoramaData.h:51
static const double res
unsigned int display_list_number_canvas
ToolHelper * helper
The PreviewToolHelper that uses the same preview window and panorama as the tool should.
Definition: Tool.h:102
Model for a panorama.
Definition: Panorama.h:152
OverviewOutlinesTool(ToolHelper *, GLViewer *preview)
Rect transformImgCoord(HuginBase::PTools::Transform *trans)
transform the rectangle&#39;s coordinates with a certain transform
void AfterDrawImagesBackEvent()
Draw using opengl anything after drawing the front face culled images.
void Activate()
Switch on a tool.
virtual void drawBackground()
drawing the background means drawing a mesh that covers the whole panorama for the purpose of darkeni...
PanosphereOverviewOutlinesTool(PanosphereOverviewToolHelper *helper, GLViewer *preview)
void DrawRect(double left, double top, double right, double bottom, bool outline, double linewidth=1.0)
void drawBackground()
drawing the background means drawing a mesh that covers the whole panorama for the purpose of darkeni...
void center(double &x, double &y)
get the center of the rectangle
bool transformImgCoord(double &x_dest, double &y_dest, double x_src, double y_src) const
like transform, but return image coordinates, not cartesian coordinates
this handler class will receive change events from the Panorama.
Definition: PanoramaData.h:401
Rect(double left, double top, double right, double bottom)
unsigned int display_list_number_crop
void AfterDrawImagesFrontEvent()
Draw using opengl anything after drawing the back face culled images.
void AfterDrawImagesEvent()
Draw (using OpenGL) images above the others.
Holds transformations for Image -&gt; Pano and the other way.
virtual void panoramaImagesChanged(HuginBase::Panorama &, const HuginBase::UIntSet &)
notifies about changes to images
static const double mindist
virtual void MarkDirty() override
A wxWidget to display the fast preview.
Definition: GLViewer.h:51