Version: 0.6.0
layer.h
1 /******************************************************************************
2  * Project: wxGIS
3  * Purpose: RasterLayer header.
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2013,2014 Dmitry Baryshnikov
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  ****************************************************************************/
21 #pragma once
22 
23 #include "wxgis/carto/renderer.h"
24 #include "wxgis/core/pointer.h"
25 
26 #include <wx/event.h>
27 
35 class WXDLLIMPEXP_GIS_CRT wxGISLayer :
36  public wxEvtHandler,
38 {
39  DECLARE_ABSTRACT_CLASS(wxGISLayer)
40 public:
41  wxGISLayer(const wxString &sName = _("new layer"), wxGISDataset* pwxGISDataset = NULL);
42  virtual ~wxGISLayer(void);
43  virtual const wxGISSpatialReference GetSpatialReference(void);
44  virtual OGREnvelope GetEnvelope(void) const;
45  virtual void SetMaximumScale(double dMaxScale){m_dMaxScale = dMaxScale;};
46  virtual double GetMaximumScale(void) const {return m_dMaxScale;};
47  virtual void SetMinimumScale(double dMinScale){m_dMinScale = dMinScale;};
48  virtual double GetMinimumScale(void) const {return m_dMinScale;};
49  virtual bool GetVisible(void) const {return m_bVisible;};
50  virtual void SetVisible(bool bVisible){m_bVisible = bVisible;};
51  virtual void SetName(const wxString &sName){m_sName = sName;};
52  virtual wxString GetName(void) const {return m_sName;};
53  virtual bool IsCacheNeeded(void) const;
54  virtual wxGISEnumDatasetType GetType(void) const {return enumGISAny;};
55  virtual bool IsValid(void) const;
56  virtual bool Draw(wxGISEnumDrawPhase DrawPhase, ITrackCancel* const pTrackCancel = NULL) = 0;
57  virtual void SetRenderer(wxGISRenderer* pRenderer);
58  virtual wxGISRenderer* GetRenderer(void);
59  virtual size_t GetCacheId(void) const {return m_nCacheId;};
60  virtual void SetCacheId(size_t nCacheId) {m_nCacheId = nCacheId;};
61  virtual void SetSpatialReference(const wxGISSpatialReference &SpatialReference);
62  virtual void SetDisplay(wxGISDisplay *pDisplay) { m_pDisplay = pDisplay; };
63  virtual wxGISDataset* GetDataset() {wsGET(m_pwxGISDataset);};
64  virtual bool IsLoading() const;
65  virtual short GetId() const;
66  virtual void SetId(short nNewId);
67 protected:
68  wxGISDataset* m_pwxGISDataset;
69  wxGISSpatialReference m_SpatialReference;
70  wxGISDisplay *m_pDisplay;
71  OGREnvelope m_FullEnvelope;
72  double m_dMaxScale, m_dMinScale;
73  bool m_bVisible;
74  wxString m_sName;
75  size_t m_nCacheId;
76  short m_nId;
77  //renderer
78  wxGISRenderer* m_pRenderer;
79 };
Definition: gisdisplay.h:43
Definition: pointer.h:34
A TrackCancel interface class.
Definition: core.h:144
Definition: layer.h:35
Definition: dataset.h:33
Definition: gdalinh.h:57
The base class for renderers.
Definition: renderer.h:31