KiCad PCB EDA Suite
Loading...
Searching...
No Matches
spacenav_driver.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 The KiCad Developers, see CHANGELOG.txt for contributors.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 3
8 * of the License, or (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, you may find one here:
17 * http://www.gnu.org/licenses/gpl-3.0.html
18 * or you may search the http://www.gnu.org website for the version 3 license,
19 * or you may write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
21 */
22#ifndef KICAD_SPACENAV_DRIVER_H
23#define KICAD_SPACENAV_DRIVER_H
24
26{
27public:
28 virtual ~SPACEMOUSE_HANDLER() = default;
29
31 virtual void OnPan(double x, double y, double z) = 0;
32
34 virtual void OnRotate(double rx, double ry, double rz) = 0;
35
37 virtual void OnButton(int button, bool pressed) = 0;
38};
39
41{
42public:
43 virtual ~SPACENAV_DRIVER() = default;
44
46 virtual bool Connect() = 0;
47
49 virtual void Disconnect() = 0;
50
52 virtual void Poll() = 0;
53
54 void SetHandler( SPACEMOUSE_HANDLER* aHandler ) { m_handler = aHandler; }
55
56protected:
58};
59
60#endif // KICAD_SPACENAV_DRIVER_H
virtual void OnPan(double x, double y, double z)=0
Handle translation (pan) events.
virtual void OnRotate(double rx, double ry, double rz)=0
Handle rotational events.
virtual void OnButton(int button, bool pressed)=0
Handle button press/release events.
virtual ~SPACEMOUSE_HANDLER()=default
virtual void Disconnect()=0
Disconnect from the device.
virtual bool Connect()=0
Connect to the device.
void SetHandler(SPACEMOUSE_HANDLER *aHandler)
SPACEMOUSE_HANDLER * m_handler
virtual void Poll()=0
Poll for pending events and dispatch them to the handler.
virtual ~SPACENAV_DRIVER()=default