KiCad PCB EDA Suite
Loading...
Searching...
No Matches
nl_gerbview_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) 2024 3Dconnexion
5 * Copyright (C) 2022 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_GERBVIEW_PLUGIN_IMPL_H_
27#define NL_GERBVIEW_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 VIEW;
52}
53
54// Convenience typedef.
55typedef TDx::SpaceMouse::Navigation3D::CNavigation3D NAV_3D;
56
62{
63public:
68
69
71
72
78 void SetCanvas( EDA_DRAW_PANEL_GAL* aViewport );
79
80
87 void SetFocus( bool aFocus );
88
89private:
94
95 long GetCameraMatrix( navlib::matrix_t& aMatrix ) const override;
96 long GetPointerPosition( navlib::point_t& aPosition ) const override;
97 long GetViewExtents( navlib::box_t& aExtents ) const override;
98 long GetViewFOV( double& aFov ) const override;
99 long GetViewFrustum( navlib::frustum_t& aFrustum ) const override;
100 long GetIsViewPerspective( navlib::bool_t& aPerspective ) const override;
101 long SetCameraMatrix( const navlib::matrix_t& aMatrix ) override;
102 long SetViewExtents( const navlib::box_t& aExtents ) override;
103 long SetViewFOV( double aFov ) override;
104 long SetViewFrustum( const navlib::frustum_t& aFrustum ) override;
105 long GetModelExtents( navlib::box_t& aExtents ) const override;
106 long GetSelectionExtents( navlib::box_t& aExtents ) const override;
107 long GetSelectionTransform( navlib::matrix_t& aTransform ) const override;
108 long GetIsSelectionEmpty( navlib::bool_t& aEmpty ) const override;
109 long SetSelectionTransform( const navlib::matrix_t& aMatrix ) override;
110 long GetPivotPosition( navlib::point_t& aPosition ) const override;
111 long IsUserPivot( navlib::bool_t& aUserPivot ) const override;
112 long SetPivotPosition( const navlib::point_t& aPosition ) override;
113 long GetPivotVisible( navlib::bool_t& aVisible ) const override;
114 long SetPivotVisible( bool aVisible ) override;
115 long GetHitLookAt( navlib::point_t& aPosition ) const override;
116 long SetHitAperture( double aAperture ) override;
117 long SetHitDirection( const navlib::vector_t& aDirection ) override;
118 long SetHitLookFrom( const navlib::point_t& aPosition ) override;
119 long SetHitSelectionOnly( bool aSelectionOnly ) override;
120 long SetActiveCommand( std::string aCommandId ) override;
121
122 long SetSettingsChanged( long aChangeNumber ) override;
123 long SetMotionFlag( bool aValue ) override;
124 long SetTransaction( long aValue ) override;
125 long SetCameraTarget( const navlib::point_t& aPosition ) override;
126
127 long GetFrontView( navlib::matrix_t& aMatrix ) const override;
128 long GetCoordinateSystem( navlib::matrix_t& aMatrix ) const override;
129 long GetIsViewRotatable( navlib::bool_t& isRotatable ) const override;
130
131private:
133 KIGFX::VIEW* m_view = nullptr;
134 bool m_isMoving = false;
135 mutable double m_viewportWidth = 0.0;
137
144 static const wxChar* m_logTrace;
145};
146
147#endif // NL_GERBVIEW_PLUGIN_IMPL
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:68
The class that implements the accessors and mutators required for 3D navigation in an PCB_DRAW_PANEL_...
long GetCoordinateSystem(navlib::matrix_t &aMatrix) const override
long GetHitLookAt(navlib::point_t &aPosition) const override
long SetSettingsChanged(long aChangeNumber) override
long GetIsViewPerspective(navlib::bool_t &aPerspective) const override
long SetCameraMatrix(const navlib::matrix_t &aMatrix) override
long GetPivotPosition(navlib::point_t &aPosition) const override
long GetViewFOV(double &aFov) const override
long SetPivotVisible(bool aVisible) override
long SetSelectionTransform(const navlib::matrix_t &aMatrix) override
long GetViewFrustum(navlib::frustum_t &aFrustum) const override
long SetTransaction(long aValue) override
long GetIsViewRotatable(navlib::bool_t &isRotatable) const override
long SetHitLookFrom(const navlib::point_t &aPosition) override
long GetIsSelectionEmpty(navlib::bool_t &aEmpty) const override
long SetMotionFlag(bool aValue) override
long GetCameraMatrix(navlib::matrix_t &aMatrix) const override
long SetViewExtents(const navlib::box_t &aExtents) override
long SetCameraTarget(const navlib::point_t &aPosition) override
long GetFrontView(navlib::matrix_t &aMatrix) const override
long SetHitSelectionOnly(bool aSelectionOnly) override
long GetSelectionExtents(navlib::box_t &aExtents) const override
long SetHitDirection(const navlib::vector_t &aDirection) override
long SetViewFOV(double aFov) override
NL_GERBVIEW_PLUGIN_IMPL()
Initializes a new instance of the NL_GERBVIEW_PLUGIN_IMPL.
long GetPointerPosition(navlib::point_t &aPosition) const override
long SetPivotPosition(const navlib::point_t &aPosition) override
void exportCommandsAndImages()
Export the invocable actions and images to the 3Dconnexion UI.
void SetCanvas(EDA_DRAW_PANEL_GAL *aViewport)
Sets the viewport controlled by the SpaceMouse.
void SetFocus(bool aFocus)
Set the connection to the 3Dconnexion driver to the focus state so that 3DMouse data is routed here.
long SetViewFrustum(const navlib::frustum_t &aFrustum) override
long SetActiveCommand(std::string aCommandId) override
long SetHitAperture(double aAperture) override
long GetViewExtents(navlib::box_t &aExtents) const override
long IsUserPivot(navlib::bool_t &aUserPivot) const override
long GetPivotVisible(navlib::bool_t &aVisible) const override
long GetModelExtents(navlib::box_t &aExtents) const override
long GetSelectionTransform(navlib::matrix_t &aTransform) const override
EDA_DRAW_PANEL_GAL * m_viewport2D
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