OpenCPN Partial API docs
Loading...
Searching...
No Matches
route_gui.h
1
2/***************************************************************************
3 *
4 * Project: OpenCPN
5 * Purpose: Route drawing stuff
6 * Author: David Register, Alec Leamas
7 *
8 ***************************************************************************
9 * Copyright (C) 2022 by David Register, Alec Leamas *
10 * Copyright (C) 2025 by NoCodeHummel *
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 * This program is distributed in the hope that it will be useful, *
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
20 * GNU General Public License for more details. *
21 * *
22 * You should have received a copy of the GNU General Public License *
23 * along with this program; if not, write to the *
24 * Free Software Foundation, Inc., *
25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
26 **************************************************************************/
27
28#ifndef _ROUTE_GUI_H
29#define _ROUTE_GUI_H
30
31#include <wx/gdicmn.h>
32#include <wx/dc.h>
33
34#include "bbox.h"
35#include "chcanv.h"
36#include "ocpndc.h"
37#include "model/route.h"
38#include "viewport.h"
39#include "SendToGpsDlg.h"
40
41class RouteGui {
42public:
43 RouteGui(Route &route) : m_route(route) {}
44 virtual void Draw(ocpnDC &dc, ChartCanvas *canvas, const LLBBox &box);
45 void DrawPointWhich(ocpnDC &dc, ChartCanvas *canvas, int iPoint,
46 wxPoint *rpn);
47 void DrawSegment(ocpnDC &dc, ChartCanvas *canvas, wxPoint *rp1, wxPoint *rp2,
48 ViewPort &vp, bool bdraw_arrow);
49
50 void DrawGLLines(ViewPort &vp, ocpnDC *dc, ChartCanvas *canvas);
51 void DrawGL(ViewPort &vp, ChartCanvas *canvas, ocpnDC &dc);
52 void DrawGLRouteLines(ViewPort &vp, ChartCanvas *canvas, ocpnDC &dc);
53 void CalculateDCRect(wxDC &dc_route, ChartCanvas *canvas, wxRect *prect);
54 void RenderSegment(ocpnDC &dc, int xa, int ya, int xb, int yb, ViewPort &vp,
55 bool bdraw_arrow, int hilite_width = 0);
56 void RenderSegmentArrowsGL(ocpnDC &dc, int xa, int ya, int xb, int yb,
57 ViewPort &vp);
58 int SendToGPS(const wxString &com_name, bool bsend_waypoints,
59 SendToGpsDlg *dialog);
60 static bool OnDelete(wxWindow *parent, const int count = 0);
61
62private:
63 Route &m_route;
64};
65
66#endif // _ROUTE_GUI_H
Chart display canvas.
Definition chcanv.h:135
Definition route.h:75
Dialog for sending routes/waypoints to a GPS device.
Represents the view port for chart display in OpenCPN.
Definition viewport.h:84
Device context class that can use either wxDC or OpenGL for drawing.
Definition ocpndc.h:64