OpenCPN Partial API docs
Loading...
Searching...
No Matches
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"
27class ocpnDC;
28class ChartCanvas;
29
38public:
39 ocpnCompass(ChartCanvas *parent, bool bShowGPS = true);
41
42 bool IsShown() const { return m_shown; }
43 void Show(bool show) { m_shown = show; }
44 void Paint(ocpnDC &dc);
45
46 void UpdateStatus(bool newColorScheme = false);
47
48 bool MouseEvent(wxMouseEvent &event);
49 void SetColorScheme(ColorScheme cs);
50 int GetXOffset(void) const { return m_xoffset; }
51 int GetYOffset(void) const { return m_yoffset; }
52 float GetScaleFactor() { return m_scale; }
53 void SetScaleFactor(float factor);
54
55 void Move(const wxPoint &pt) { m_rect.SetPosition(pt); }
61 wxRect GetRect(void) const { return m_rect; }
66 wxRect GetLogicalRect(void) const;
67
68private:
69 void CreateBmp(bool bnew = false);
70 void CreateTexture();
71 void UpdateTexture();
72
73 ChartCanvas *m_parent;
74 wxBitmap m_StatBmp;
75 wxBitmap m_MaskBmp;
76 wxStaticBitmap *m_pStatBoxToolStaticBmp;
77
78 wxString m_lastgpsIconName;
79 double m_rose_angle;
80
81 wxBitmap _img_compass;
82 wxBitmap _img_gpsRed;
83 int m_xoffset;
84 int m_yoffset;
85 float m_scale;
86
91 wxRect m_rect;
92 bool m_shown;
93 bool m_bshowGPS;
94 ColorScheme m_cs;
95 bool m_texOK;
96
97#ifdef ocpnUSE_GL
98 unsigned int m_texobj;
99 int m_tex_w, m_tex_h;
100 int m_image_width, m_image_height;
101#endif
102};
Chart display canvas.
Definition chcanv.h:135
Represents a compass display in the OpenCPN navigation system.
Definition compass.h:37
wxRect GetRect(void) const
Return the coordinates of the compass widget, in physical pixels relative to the canvas window.
Definition compass.h:61
wxRect GetLogicalRect(void) const
Return the coordinates of the compass widget, in logical pixels.
Definition compass.cpp:201
Device context class that can use either wxDC or OpenGL for drawing.
Definition ocpndc.h:64