Hugin trunk 0.1
Loading...
Searching...
No Matches
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
28class 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
132
134{
135 public:
136
138
139 void Activate() override;
140 void AfterDrawImagesEvent() override;
141
142 void drawBackground() override;
143 void MarkDirty() override;
144};
145
146
147#endif /* __OVERVIEW_OUTLINES_TOOL_H__ */
148
A wxWidget to display the fast preview.
Definition GLViewer.h:52
Holds transformations for Image -> Pano and the other way.
this handler class will receive change events from the Panorama.
Model for a panorama.
Definition Panorama.h:153
class to represent a single rectangle
void center(double &x, double &y)
get the center of the rectangle
Rect(double left, double top, double right, double bottom)
Rect transformImgCoord(HuginBase::PTools::Transform *trans)
transform the rectangle's coordinates with a certain transform
class for drawing the outlines of the preview canvas and the crop rectangle in the overview openl sce...
unsigned int display_list_number_canvas_outline
virtual void panoramaChanged(HuginBase::Panorama &pano)
Notification about a Panorama change.
unsigned int display_list_number_crop
unsigned int display_list_number_crop_outline
unsigned int display_list_number_canvas
virtual void drawBackground()
drawing the background means drawing a mesh that covers the whole panorama for the purpose of darkeni...
virtual void panoramaImagesChanged(HuginBase::Panorama &, const HuginBase::UIntSet &)
notifies about changes to images
void DrawRect(double left, double top, double right, double bottom, bool outline, double linewidth=1.0)
static const double mindist
static const double res
void Activate() override
Switch on a tool.
PanosphereOverviewOutlinesTool(PanosphereOverviewToolHelper *helper, GLViewer *preview)
void drawBackground() override
drawing the background means drawing a mesh that covers the whole panorama for the purpose of darkeni...
void AfterDrawImagesFrontEvent() override
Draw using opengl anything after drawing the back face culled images.
void AfterDrawImagesBackEvent() override
Draw using opengl anything after drawing the front face culled images.
void drawBackground() override
drawing the background means drawing a mesh that covers the whole panorama for the purpose of darkeni...
void AfterDrawImagesEvent() override
Draw (using OpenGL) images above the others.
PlaneOverviewOutlinesTool(PlaneOverviewToolHelper *helper, GLViewer *preview)
void Activate() override
Switch on a tool.
ToolHelper * helper
The PreviewToolHelper that uses the same preview window and panorama as the tool should.
Definition Tool.h:109
std::set< unsigned int > UIntSet
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41