OpenCPN Partial API docs
Loading...
Searching...
No Matches
route_point_gui.h
Go to the documentation of this file.
1/**************************************************************************
2 * Copyright (C) 2022 by David Register *
3 * Copyright (C) 2022 Alec Leamas *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, see <https://www.gnu.org/licenses/>. *
17 **************************************************************************/
18
25#ifndef _ROUTE_POINT_GUI_H
26#define _ROUTE_POINT_GUI_H
27
28#include <wx/gdicmn.h>
29#include <wx/string.h>
30#include <wx/dc.h>
31
32#include "model/route_point.h"
33
34#include "chcanv.h"
35#include "ocpndc.h"
36#include "send_to_gps_dlg.h"
37#include "viewport.h"
38
40public:
41 RoutePointGui(RoutePoint &point) : m_point(point) { /*ReLoadIcon();*/ }
42
43 void Draw(ocpnDC &dc, ChartCanvas *canvas, wxPoint *rpn = 0,
44 bool boverride_viz = false);
45 void CalculateDCRect(wxDC &dc, ChartCanvas *canvas, wxRect *prect);
46 bool IsVisibleSelectable(ChartCanvas *canvas, bool boverrideViz = false);
47 wxPoint2DDouble GetDragHandlePoint(ChartCanvas *canvas);
48 void SetPointFromDraghandlePoint(ChartCanvas *canvas, double lat, double lon);
49 void SetPointFromDraghandlePoint(ChartCanvas *canvas, int x, int y);
50 void PresetDragOffset(ChartCanvas *canvas, int x, int y);
51 void ShowScaleWarningMessage(ChartCanvas *canvas);
52
53 bool SendToGPS(const wxString &com_name, SendToGpsDlg *dialog);
54 void ReLoadIcon();
55 void EnableDragHandle(bool bEnable);
56 int GetIconImageIndex();
57 wxBitmap *GetIconBitmap() {
58 if (m_point.m_IconIsDirty) ReLoadIcon();
59 return m_point.m_pbmIcon;
60 }
61
62#ifdef ocpnUSE_GL
63 void DrawGL(ViewPort &vp, ChartCanvas *canvas, ocpnDC &dc,
64 bool use_cached_screen_coords = false, bool vizOverride = false);
65#endif
66
67private:
68 wxPoint2DDouble computeDragHandlePoint(ChartCanvas *canvas);
69 RoutePoint &m_point;
70};
71
72#endif // _ROUTE_POINT_GUI_H
Generic Chart canvas base.
ChartCanvas - Main chart display and interaction component.
Definition chcanv.h:157
Represents a waypoint or mark within the navigation system.
Definition route_point.h:71
bool m_IconIsDirty
Flag indicating if the waypoint icon needs to be reloaded or redrawn.
Dialog for sending routes/waypoints to a GPS device.
ViewPort - Core geographic projection and coordinate transformation engine.
Definition viewport.h:56
Device context class that can use either wxDC or OpenGL for drawing.
Definition ocpndc.h:60
Layer to use wxDC or opengl.
Waypoint or mark abstraction.
Send route/waypoint to GPS dialog.
Geographic projection and coordinate transformations.