OpenCPN Partial API docs
Loading...
Searching...
No Matches
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 "route_point.h"
34#include "viewport.h"
35
36class SendToGpsDlg;
37
39public:
40 RoutePointGui(RoutePoint& point) : m_point(point) { /*ReLoadIcon();*/ }
41
42 void Draw(ocpnDC& dc, ChartCanvas* canvas, wxPoint* rpn = 0,
43 bool boverride_viz = false);
44 void CalculateDCRect(wxDC &dc, ChartCanvas *canvas, wxRect *prect);
45 bool IsVisibleSelectable(ChartCanvas *canvas, bool boverrideViz = false);
46 wxPoint2DDouble GetDragHandlePoint(ChartCanvas *canvas);
47 void SetPointFromDraghandlePoint(ChartCanvas *canvas, double lat, double lon);
48 void SetPointFromDraghandlePoint(ChartCanvas *canvas, int x, int y);
49 void PresetDragOffset(ChartCanvas *canvas, int x, int y);
50 void ShowScaleWarningMessage(ChartCanvas *canvas);
51
52 bool SendToGPS(const wxString &com_name, SendToGpsDlg *dialog);
53 void ReLoadIcon(void);
54 void EnableDragHandle(bool bEnable);
55 int GetIconImageIndex();
56 wxBitmap* GetIconBitmap() {
57 if (m_point.m_IconIsDirty) ReLoadIcon();
58 return m_point.m_pbmIcon;
59 }
60
61#ifdef ocpnUSE_GL
62 void DrawGL(ViewPort &vp, ChartCanvas* canvas, ocpnDC &dc,
63 bool use_cached_screen_coords = false, bool vizOverride = false);
64#endif
65
66private:
67 wxPoint2DDouble computeDragHandlePoint(ChartCanvas *canvas);
68 RoutePoint& m_point;
69};
70
71
72#endif // _ROUTE_POINT_GUI_H
Route "Send to GPS..." Dialog Definition.
Definition: SendToGpsDlg.h:56
Definition: ocpndc.h:55