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, see <https://www.gnu.org/licenses/>.
17 */
18#ifndef KICAD_SPACENAV_DRIVER_H
19#define KICAD_SPACENAV_DRIVER_H
20
22{
23public:
24 virtual ~SPACEMOUSE_HANDLER() = default;
25
27 virtual void OnPan(double x, double y, double z) = 0;
28
30 virtual void OnRotate(double rx, double ry, double rz) = 0;
31
33 virtual void OnButton(int button, bool pressed) = 0;
34};
35
37{
38public:
39 virtual ~SPACENAV_DRIVER() = default;
40
42 virtual bool Connect() = 0;
43
45 virtual void Disconnect() = 0;
46
48 virtual void Poll() = 0;
49
50 void SetHandler( SPACEMOUSE_HANDLER* aHandler ) { m_handler = aHandler; }
51
52protected:
54};
55
56#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