KiCad PCB EDA Suite
Loading...
Searching...
No Matches
hidpi_gl_3D_canvas.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2015-2016 Mario Luzeiro <[email protected]>
5 * Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#ifndef HIDPI_GL_3D_CANVAS_H
26#define HIDPI_GL_3D_CANVAS_H
27
28#include <gal/gal.h>
29#include <atomic>
30#include <gal/3d/camera.h>
31#include <gal/hidpi_gl_canvas.h>
32#include <wx/image.h>
33#include <wx/timer.h>
34
40{
41public:
42 // wxGLCanvas constructor
43
44 HIDPI_GL_3D_CANVAS( const KIGFX::VC_SETTINGS& aVcSettings, CAMERA& aCamera, wxWindow* parent,
45 const wxGLAttributes& aGLAttribs, wxWindowID id = wxID_ANY,
46 const wxPoint& pos = wxDefaultPosition,
47 const wxSize& size = wxDefaultSize, long style = 0,
48 const wxString& name = wxGLCanvasName,
49 const wxPalette& palette = wxNullPalette );
50
51 bool m_mouse_is_moving; // Mouse activity is in progress
53 bool m_camera_is_moving; // Camera animation is ongoing
54
56 static const float m_delta_move_step_factor; // Step factor to used with cursor on
57 // relation to the current zoom
58
62 CAMERA* GetCamera() { return &m_camera; }
63
64 void OnMouseMoveCamera( wxMouseEvent& event );
65 void OnMouseWheelCamera( wxMouseEvent& event, bool aPan );
66};
67
68
69#endif // HIDPI_GL_3D_CANVAS_H
const char * name
Definition: DXF_plotter.cpp:57
Define an abstract camera.
A class used to derive camera objects from.
Definition: camera.h:103
Provides basic 3D controls ( zoom, rotate, translate, ... )
static const float m_delta_move_step_factor
CAMERA * GetCamera()
Get the canvas camera.
wxGLCanvas wrapper for HiDPI/Retina support.
#define GAL_API
Definition: gal.h:28
Structure to keep VIEW_CONTROLS settings for easy store/restore operations.
Definition: view_controls.h:43