ToolMap
Loading...
Searching...
No Matches
tmmemoryzoom.h
1/***************************************************************************
2 tmmemoryzoom.h
3 Store Previous Zoom in memory
4 -------------------
5 copyright : (C) 2009 CREALP Lucien Schreiber
6 ***************************************************************************/
7
8/***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16
17#ifndef _TM_MEMORYZOOM_H_
18#define _TM_MEMORYZOOM_H_
19
20// For compilers that support precompilation, includes "wx/wx.h".
21#include <wx/wxprec.h>
22
23// Include wxWidgets' headers
24#ifndef WX_PRECOMP
25#include <wx/wx.h>
26#endif
27
28#include <wx/graphics.h>
29
30/***************************************************************************/
37 public:
38 wxPoint2DDouble m_TopLeftPosition;
39 double m_ZoomFactor;
40
42
43 tmZoomExtent(double top, double left, double pixelsize);
44
46
47 bool operator==(const tmZoomExtent& zoom) const;
48
49 bool IsOk();
50};
51
52WX_DECLARE_OBJARRAY(tmZoomExtent, tmArrayZoomExtent);
53
54/***************************************************************************/
60class tmMemoryZoomManager : public wxEvtHandler {
61 private:
62 tmArrayZoomExtent m_ZoomExtents;
63 int m_MaxSize;
64
65 public:
66 tmMemoryZoomManager(int maxsize = 50);
67
69
70 bool Add(const tmZoomExtent& value);
71
72 bool Add(double top, double left, double zoomfactor);
73
74 int GetCount();
75
76 bool GetPrevious(tmZoomExtent& extent);
77
78 void Clear();
79};
80
81// TODO: Ajouter dans tmLayerManager
82/*
83class tmLayerManager {
84 private:
85 tmMemoryZoomManager * m_ZoomManager;
86
87 void _ZoomChanged();
88
89
90 public:
91 void OnZoomPrevious(const wxCommandEvent & event);
92
93};*/
94#endif
tmMemoryZoomManager
Definition tmmemoryzoom.h:60
bool GetPrevious(tmZoomExtent &extent)
Return previous zoom level.
Definition tmmemoryzoom.cpp:97
tmZoomExtent
Definition tmmemoryzoom.h:36
tmZoomExtent()
Definition tmmemoryzoom.cpp:25