Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GraphTools.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
10 /*
11  * This is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public
13  * License as published by the Free Software Foundation; either
14  * version 2 of the License, or (at your option) any later version.
15  *
16  * This software is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public
22  * License along with this software. If not, see
23  * <http://www.gnu.org/licenses/>.
24  *
25  */
26 
27 #ifndef GRAPHTOOLS_H
28 #define GRAPHTOOLS_H
29 
30 #include <hugin_shared.h>
31 #include "panoinc_WX.h"
32 #include "panoinc.h"
33 #include "wx/popupwin.h"
34 
35 namespace wxGraphTools
36 {
38 class WXIMPEX GraphPopupWindow : public wxPopupTransientWindow
39 {
40 public:
41  GraphPopupWindow(wxWindow* parent, wxBitmap bitmap);
42 protected:
43  void OnLeftDown(wxMouseEvent &e);
44  void OnRightDown(wxMouseEvent &e);
45 private:
46  wxStaticBitmap* m_bitmapControl;
47  DECLARE_CLASS(GraphPopupWindow)
48 };
49 
52 {
53 public:
55  Graph(int graphWidth, int graphHeight, wxColour backgroundColour);
57  ~Graph();
59  void SetChartArea(int left, int top, int right, int bottom);
61  void SetChartDisplay(double xmin, double ymin, double xmax, double ymax);
63  void DrawGrid(size_t linesX, size_t linesY);
65  void DrawLine(std::vector<hugin_utils::FDiff2D> points, wxColour colour, int penWidth = 1);
66  const wxBitmap GetGraph() const;
67 private:
68  // prevent copying of class
69  Graph(const Graph&);
70  Graph& operator=(const Graph&);
71  //helper function to transform coordinates from real world to bitmap
72  int TransformX(double x);
73  int TransformY(double y);
74  // area to be drawn
75  double m_xmin, m_xmax, m_ymin, m_ymax;
76  // size of canvas
77  int m_width, m_height;
78  // chart area
79  int m_left, m_top, m_right, m_bottom;
80  // bitmap
81  wxBitmap* m_bitmap;
82  wxMemoryDC m_dc;
83 };
84 
87 }
88 #endif // GRAPHTOOLS_H
wxBitmap * m_bitmap
Definition: GraphTools.h:81
wxStaticBitmap * m_bitmapControl
Definition: GraphTools.h:46
include file for the hugin project
simple popup to show graph
Definition: GraphTools.h:38
wxMemoryDC m_dc
Definition: GraphTools.h:82
vigra::pair< typename ROIImage< Image, Mask >::image_const_traverser, typename ROIImage< Image, Mask >::ImageConstAccessor > srcImage(const ROIImage< Image, Mask > &img)
Definition: ROIImage.h:300
#define WXIMPEX
Definition: hugin_shared.h:40
help class to draw charts
Definition: GraphTools.h:51
include file for the hugin project
wxBitmap GetDistortionGraph(const HuginBase::SrcPanoImage &srcImage)
return wxBitmap with graph of distortion for given SrcPanoImage
Definition: GraphTools.cpp:193
All variables of a source image.
Definition: SrcPanoImage.h:194