KiCad PCB EDA Suite
Loading...
Searching...
No Matches
nl_pcbnew_plugin_impl.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) 2021 3Dconnexion
5 * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
26#ifndef NL_PCBNEW_PLUGIN_IMPL_H_
27#define NL_PCBNEW_PLUGIN_IMPL_H_
28
29#if _WIN32
30#ifndef _WIN32_WINNT
31#define _WIN32_WINNT 0x0603
32#endif
33#endif
34
35// TDxWare SDK.
36#include <SpaceMouse/CNavigation3D.hpp>
37
38// wx
39#include <wx/chartype.h>
40
41// KiCAD
42#include <math/vector2d.h>
43
44// stdlib
45#include <string>
46
47// Forward declarations.
49namespace KIGFX
50{
51class PCB_VIEW;
52}
53
54// Convenience typedef.
55typedef TDx::SpaceMouse::Navigation3D::CNavigation3D NAV_3D;
56
62{
63public:
70
71 virtual ~NL_PCBNEW_PLUGIN_IMPL();
72
79 void SetFocus( bool aFocus );
80
81private:
86
87 long GetCameraMatrix( navlib::matrix_t& aMatrix ) const override;
88 long GetPointerPosition( navlib::point_t& aPosition ) const override;
89 long GetViewExtents( navlib::box_t& aExtents ) const override;
90 long GetViewFOV( double& aFov ) const override;
91 long GetViewFrustum( navlib::frustum_t& aFrustum ) const override;
92 long GetIsViewPerspective( navlib::bool_t& aPerspective ) const override;
93 long SetCameraMatrix( const navlib::matrix_t& aMatrix ) override;
94 long SetViewExtents( const navlib::box_t& aExtents ) override;
95 long SetViewFOV( double aFov ) override;
96 long SetViewFrustum( const navlib::frustum_t& aFrustum ) override;
97 long GetModelExtents( navlib::box_t& aExtents ) const override;
98 long GetSelectionExtents( navlib::box_t& aExtents ) const override;
99 long GetSelectionTransform( navlib::matrix_t& aTransform ) const override;
100 long GetIsSelectionEmpty( navlib::bool_t& aEmpty ) const override;
101 long SetSelectionTransform( const navlib::matrix_t& aMatrix ) override;
102 long GetPivotPosition( navlib::point_t& aPosition ) const override;
103 long IsUserPivot( navlib::bool_t& aUserPivot ) const override;
104 long SetPivotPosition( const navlib::point_t& aPosition ) override;
105 long GetPivotVisible( navlib::bool_t& aVisible ) const override;
106 long SetPivotVisible( bool aVisible ) override;
107 long GetHitLookAt( navlib::point_t& aPosition ) const override;
108 long SetHitAperture( double aAperture ) override;
109 long SetHitDirection( const navlib::vector_t& aDirection ) override;
110 long SetHitLookFrom( const navlib::point_t& aPosition ) override;
111 long SetHitSelectionOnly( bool aSelectionOnly ) override;
112 long SetActiveCommand( std::string aCommandId ) override;
113
114 long SetSettingsChanged( long aChangeNumber ) override;
115 long SetMotionFlag( bool aValue ) override;
116 long SetTransaction( long aValue ) override;
117 long SetCameraTarget( const navlib::point_t& aPosition ) override;
118
119 long GetFrontView( navlib::matrix_t& aMatrix ) const override;
120 long GetCoordinateSystem( navlib::matrix_t& aMatrix ) const override;
121 long GetIsViewRotatable( navlib::bool_t& isRotatable ) const override;
122
123private:
127 mutable double m_viewportWidth;
129
136 static const wxChar* m_logTrace;
137};
138
139#endif // NL_PCBNEW_PLUGIN_IMPL_H_
The class that implements the accessors and mutators required for 3D navigation in an PCB_DRAW_PANEL_...
long GetIsViewRotatable(navlib::bool_t &isRotatable) const override
long SetCameraMatrix(const navlib::matrix_t &aMatrix) override
long GetPivotVisible(navlib::bool_t &aVisible) const override
long GetPointerPosition(navlib::point_t &aPosition) const override
long SetHitLookFrom(const navlib::point_t &aPosition) override
long GetFrontView(navlib::matrix_t &aMatrix) const override
long SetHitSelectionOnly(bool aSelectionOnly) override
long SetViewFOV(double aFov) override
long GetViewFOV(double &aFov) const override
long IsUserPivot(navlib::bool_t &aUserPivot) const override
long SetSettingsChanged(long aChangeNumber) override
void SetFocus(bool aFocus)
Set the connection to the 3Dconnexion driver to the focus state so that 3DMouse data is routed here.
long SetTransaction(long aValue) override
long GetViewExtents(navlib::box_t &aExtents) const override
long GetPivotPosition(navlib::point_t &aPosition) const override
long GetCoordinateSystem(navlib::matrix_t &aMatrix) const override
long SetPivotVisible(bool aVisible) override
long SetPivotPosition(const navlib::point_t &aPosition) override
long GetIsViewPerspective(navlib::bool_t &aPerspective) const override
long GetHitLookAt(navlib::point_t &aPosition) const override
long GetSelectionTransform(navlib::matrix_t &aTransform) const override
long SetViewExtents(const navlib::box_t &aExtents) override
void exportCommandsAndImages()
Export the invocable actions and images to the 3Dconnexion UI.
long SetCameraTarget(const navlib::point_t &aPosition) override
long GetCameraMatrix(navlib::matrix_t &aMatrix) const override
long SetMotionFlag(bool aValue) override
long GetViewFrustum(navlib::frustum_t &aFrustum) const override
long GetModelExtents(navlib::box_t &aExtents) const override
long SetViewFrustum(const navlib::frustum_t &aFrustum) override
long GetSelectionExtents(navlib::box_t &aExtents) const override
long SetSelectionTransform(const navlib::matrix_t &aMatrix) override
PCB_DRAW_PANEL_GAL * m_viewport2D
long SetHitAperture(double aAperture) override
long SetHitDirection(const navlib::vector_t &aDirection) override
long GetIsSelectionEmpty(navlib::bool_t &aEmpty) const override
long SetActiveCommand(std::string aCommandId) override
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
The Cairo implementation of the graphics abstraction layer.
Definition: color4d.cpp:247
TDx::SpaceMouse::Navigation3D::CNavigation3D NAV_3D