OpenCPN Partial API docs
compass.h
1 /***************************************************************************
2  *
3  * Project: OpenCPN
4  * Purpose: OpenCPN Main wxWidgets Program
5  * Author: David Register
6  *
7  ***************************************************************************
8  * Copyright (C) 2010 by David S. Register *
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  * This program is distributed in the hope that it will be useful, *
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18  * GNU General Public License for more details. *
19  * *
20  * You should have received a copy of the GNU General Public License *
21  * along with this program; if not, write to the *
22  * Free Software Foundation, Inc., *
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
24  **************************************************************************/
25 
26 #include "color_types.h"
27 class ocpnDC;
28 class ChartCanvas;
29 
30 class ocpnCompass {
31 public:
32  ocpnCompass(ChartCanvas *parent, bool bShowGPS = true);
33  ~ocpnCompass();
34 
35  bool IsShown() const { return m_shown; }
36  void Show(bool show) { m_shown = show; }
37  void Paint(ocpnDC &dc);
38 
39  void UpdateStatus(bool newColorScheme = false);
40 
41  bool MouseEvent(wxMouseEvent &event);
42  void SetColorScheme(ColorScheme cs);
43  int GetXOffset(void) const { return m_xoffset; }
44  int GetYOffset(void) const { return m_yoffset; }
45  float GetScaleFactor() { return m_scale; }
46  void SetScaleFactor(float factor);
47 
48  void Move(const wxPoint &pt) { m_rect.SetPosition(pt); }
49  wxRect GetRect(void) const { return m_rect; }
50 
51 private:
52  void CreateBmp(bool bnew = false);
53  void CreateTexture();
54  void UpdateTexture();
55 
56 
57  ChartCanvas *m_parent;
58  wxBitmap m_StatBmp;
59  wxBitmap m_MaskBmp;
60  wxStaticBitmap *m_pStatBoxToolStaticBmp;
61 
62  wxString m_lastgpsIconName;
63  double m_rose_angle;
64 
65  wxBitmap _img_compass;
66  wxBitmap _img_gpsRed;
67  int m_xoffset;
68  int m_yoffset;
69  float m_scale;
70 
71  wxRect m_rect;
72  bool m_shown;
73  bool m_bshowGPS;
74  ColorScheme m_cs;
75  bool m_texOK;
76 
77 #ifdef ocpnUSE_GL
78  unsigned int m_texobj;
79  int m_tex_w, m_tex_h;
80  int m_image_width, m_image_height;
81 #endif
82 };
Definition: ocpndc.h:58