OpenCPN Partial API docs
route_point_gui.h
1 /***************************************************************************
2  *
3  * Project: OpenCPN
4  * Purpose: Track and Trackpoint drawing stuff
5  * Author: David Register, Alec Leamas
6  *
7  ***************************************************************************
8  * Copyright (C) 2022 by David Register, Alec Leamas *
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 #ifndef _ROUTE_POINT_GUI_H
27 #define _ROUTE_POINT_GUI_H
28 
29 #include <wx/gdicmn.h>
30 
31 #include "chcanv.h"
32 #include "ocpndc.h"
33 #include "model/route_point.h"
34 #include "SendToGpsDlg.h"
35 #include "viewport.h"
36 
38 public:
39  RoutePointGui(RoutePoint& point) : m_point(point) { /*ReLoadIcon();*/ }
40 
41  void Draw(ocpnDC& dc, ChartCanvas* canvas, wxPoint* rpn = 0,
42  bool boverride_viz = false);
43  void CalculateDCRect(wxDC &dc, ChartCanvas *canvas, wxRect *prect);
44  bool IsVisibleSelectable(ChartCanvas *canvas, bool boverrideViz = false);
45  wxPoint2DDouble GetDragHandlePoint(ChartCanvas *canvas);
46  void SetPointFromDraghandlePoint(ChartCanvas *canvas, double lat, double lon);
47  void SetPointFromDraghandlePoint(ChartCanvas *canvas, int x, int y);
48  void PresetDragOffset(ChartCanvas *canvas, int x, int y);
49  void ShowScaleWarningMessage(ChartCanvas *canvas);
50 
51  bool SendToGPS(const wxString &com_name, SendToGpsDlg *dialog);
52  void ReLoadIcon(void);
53  void EnableDragHandle(bool bEnable);
54  int GetIconImageIndex();
55  wxBitmap* GetIconBitmap() {
56  if (m_point.m_IconIsDirty) ReLoadIcon();
57  return m_point.m_pbmIcon;
58  }
59 
60 #ifdef ocpnUSE_GL
61  void DrawGL(ViewPort &vp, ChartCanvas* canvas, ocpnDC &dc,
62  bool use_cached_screen_coords = false, bool vizOverride = false);
63 #endif
64 
65 private:
66  wxPoint2DDouble computeDragHandlePoint(ChartCanvas *canvas);
67  RoutePoint& m_point;
68 };
69 
70 
71 #endif // _ROUTE_POINT_GUI_H
Route "Send to GPS..." Dialog Definition.
Definition: SendToGpsDlg.h:51
Definition: ocpndc.h:58