KiCad PCB EDA Suite
panel_prev_3d.cpp
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) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
5  * Copyright (C) 2015 Cirilo Bernardo <cirilo.bernardo@gmail.com>
6  * Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
7  * Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors.
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, you may find one here:
21  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22  * or you may search the http://www.gnu.org website for the version 2 license,
23  * or you may write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25  */
26 
27 #include "panel_prev_3d.h"
29 #include <tool/tool_manager.h>
30 #include <tool/tool_dispatcher.h>
31 #include <tools/3d_actions.h>
32 #include <tools/3d_controller.h>
33 #include <base_units.h>
34 #include <bitmaps.h>
35 #include <class_board.h>
37 #include <gal/dpi_scaling.h>
38 #include <pgm_base.h>
39 #include <project.h>
41 
42 
43 PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, MODULE* aModule,
44  std::vector<MODULE_3D_SETTINGS>* aParentModelList ) :
45  PANEL_PREV_3D_BASE( aParent, wxID_ANY ),
46  m_previewPane( nullptr ),
47  m_boardAdapter(),
48  m_currentCamera( m_trackBallCamera ),
49  m_trackBallCamera( RANGE_SCALE_3D )
50 {
51  m_userUnits = aFrame->GetUserUnits();
52 
53  m_dummyBoard = new BOARD();
54  m_selected = -1;
55 
56  // Set the bitmap of 3D view buttons:
57  m_bpvTop->SetBitmap( KiBitmap( axis3d_top_xpm ) );
58  m_bpvFront->SetBitmap( KiBitmap( axis3d_front_xpm ) );
59  m_bpvBack->SetBitmap( KiBitmap( axis3d_back_xpm ) );
60  m_bpvLeft->SetBitmap( KiBitmap( axis3d_left_xpm ) );
61  m_bpvRight->SetBitmap( KiBitmap( axis3d_right_xpm ) );
62  m_bpvBottom->SetBitmap( KiBitmap( axis3d_bottom_xpm ) );
63  m_bpvISO->SetBitmap( KiBitmap( ortho_xpm ) );
64  m_bpUpdate->SetBitmap( KiBitmap( reload_xpm ) );
65 
66  // Set the min and max values of spin buttons (mandatory on Linux)
67  // They are not used, so they are set to min and max 32 bits int values
68  // (the min and max values supported by a wxSpinButton)
69  // It avoids blocking the up or down arrows when reaching this limit after
70  // a few clicks.
71  wxSpinButton* spinButtonList[] =
72  {
76  };
77 
78  for( wxSpinButton* button : spinButtonList )
79  button->SetRange(INT_MIN, INT_MAX );
80 
81  m_parentModelList = aParentModelList;
82 
83  m_dummyModule = new MODULE( *aModule );
85 
86  // Create the 3D canvas
89  aFrame->Prj().Get3DCacheManager() );
90 
92 
93  // Create the manager
95  m_toolManager->SetEnvironment( m_dummyBoard, nullptr, nullptr, nullptr, this );
96 
97  m_actions = new EDA_3D_ACTIONS();
100 
101  // Register tools
104 
105  // Run the viewer control tool, it is supposed to be always active
106  m_toolManager->InvokeTool( "3DViewer.Control" );
107 
108  m_SizerPanelView->Add( m_previewPane, 1, wxEXPAND, 5 );
109 
110  for( wxEventType eventType : { wxEVT_MENU_OPEN, wxEVT_MENU_CLOSE, wxEVT_MENU_HIGHLIGHT } )
111  Connect( eventType, wxMenuEventHandler( PANEL_PREV_3D::OnMenuEvent ), NULL, this );
112 
113 #ifdef __WXOSX__
114  // Call layout once to get the proper button sizes after the bitmaps have been set
115  Layout();
116 
117  // The rounded-button style used has a small border on the left/right sides.
118  // This is automatically fixed in wx for buttons with a bitmap < 20, but not
119  // when the bitmap is set to be 26x26.
120  wxSize borderFix = wxSize(4, 4);
121 
122  m_bpvTop->SetMinSize( m_bpvTop->GetSize() + borderFix );
123  m_bpvFront->SetMinSize( m_bpvFront->GetSize() + borderFix );
124  m_bpvBack->SetMinSize( m_bpvBack->GetSize() + borderFix );
125  m_bpvLeft->SetMinSize( m_bpvLeft->GetSize() + borderFix );
126  m_bpvRight->SetMinSize( m_bpvRight->GetSize() + borderFix );
127  m_bpvBottom->SetMinSize( m_bpvBottom->GetSize() + borderFix );
128  m_bpvISO->SetMinSize( m_bpvISO->GetSize() + borderFix );
129  m_bpUpdate->SetMinSize( m_bpUpdate->GetSize() + borderFix );
130 #endif
131 }
132 
133 
135 {
136  delete m_dummyBoard;
137  delete m_previewPane;
138 }
139 
140 
141 void PANEL_PREV_3D::OnMenuEvent( wxMenuEvent& aEvent )
142 {
143  if( !m_toolDispatcher )
144  aEvent.Skip();
145  else
147 }
148 
149 
151 {
152  wxCHECK_RET( m_previewPane, "Cannot load settings to null canvas" );
153 
154  COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
155 
156  const DPI_SCALING dpi{ settings, this };
157  m_previewPane->SetScaleFactor( dpi.GetScaleFactor() );
158 
159  // TODO(JE) use all control options
161 }
162 
163 
169 static double rotationFromString( const wxString& aValue )
170 {
171  double rotation = DoubleValueFromString( EDA_UNITS::DEGREES, aValue ) / 10.0;
172 
173  if( rotation > MAX_ROTATION )
174  {
175  int n = KiROUND( rotation / MAX_ROTATION );
176  rotation -= MAX_ROTATION * n;
177  }
178  else if( rotation < -MAX_ROTATION )
179  {
180  int n = KiROUND( -rotation / MAX_ROTATION );
181  rotation += MAX_ROTATION * n;
182  }
183 
184  return rotation;
185 }
186 
187 
188 wxString PANEL_PREV_3D::formatScaleValue( double aValue )
189 {
190  return wxString::Format( "%.4f", aValue );
191 }
192 
193 
194 wxString PANEL_PREV_3D::formatRotationValue( double aValue )
195 {
196  return wxString::Format( "%.2f %s", aValue, GetAbbreviatedUnitsLabel( EDA_UNITS::DEGREES ) );
197 }
198 
199 
200 wxString PANEL_PREV_3D::formatOffsetValue( double aValue )
201 {
202  // Convert from internal units (mm) to user units
204  aValue /= 25.4f;
205 
206  return wxString::Format( "%.4f %s", aValue, GetAbbreviatedUnitsLabel( m_userUnits ) );
207 }
208 
209 
211 {
212  if( m_parentModelList && idx >= 0 && idx < (int) m_parentModelList->size() )
213  {
214  m_selected = idx;
215  const MODULE_3D_SETTINGS& modelInfo = m_parentModelList->at( (unsigned) m_selected );
216 
217  // Use ChangeValue() instead of SetValue(). It's not the user making the change, so we
218  // don't want to generate wxEVT_GRID_CELL_CHANGED events.
219 
220  xscale->ChangeValue( formatScaleValue( modelInfo.m_Scale.x ) );
221  yscale->ChangeValue( formatScaleValue( modelInfo.m_Scale.y ) );
222  zscale->ChangeValue( formatScaleValue( modelInfo.m_Scale.z ) );
223 
224  xrot->ChangeValue( formatRotationValue( modelInfo.m_Rotation.x ) );
225  yrot->ChangeValue( formatRotationValue( modelInfo.m_Rotation.y ) );
226  zrot->ChangeValue( formatRotationValue( modelInfo.m_Rotation.z ) );
227 
228  xoff->ChangeValue( formatOffsetValue( modelInfo.m_Offset.x ) );
229  yoff->ChangeValue( formatOffsetValue( modelInfo.m_Offset.y ) );
230  zoff->ChangeValue( formatOffsetValue( modelInfo.m_Offset.z ) );
231 
232  m_opacity->SetValue( modelInfo.m_Opacity * 100.0 );
233  }
234  else
235  {
236  m_selected = -1;
237 
238  xscale->ChangeValue( wxEmptyString );
239  yscale->ChangeValue( wxEmptyString );
240  zscale->ChangeValue( wxEmptyString );
241 
242  xrot->ChangeValue( wxEmptyString );
243  yrot->ChangeValue( wxEmptyString );
244  zrot->ChangeValue( wxEmptyString );
245 
246  xoff->ChangeValue( wxEmptyString );
247  yoff->ChangeValue( wxEmptyString );
248  zoff->ChangeValue( wxEmptyString );
249 
250  m_opacity->SetValue( 100 );
251  }
252 }
253 
254 
255 void PANEL_PREV_3D::updateOrientation( wxCommandEvent &event )
256 {
257  if( m_parentModelList && m_selected >= 0 && m_selected < (int) m_parentModelList->size() )
258  {
259  // Write settings back to the parent
260  MODULE_3D_SETTINGS* modelInfo = &m_parentModelList->at( (unsigned) m_selected );
261 
262  modelInfo->m_Scale.x = DoubleValueFromString( EDA_UNITS::UNSCALED, xscale->GetValue() );
263  modelInfo->m_Scale.y = DoubleValueFromString( EDA_UNITS::UNSCALED, yscale->GetValue() );
264  modelInfo->m_Scale.z = DoubleValueFromString( EDA_UNITS::UNSCALED, zscale->GetValue() );
265 
266  modelInfo->m_Rotation.x = rotationFromString( xrot->GetValue() );
267  modelInfo->m_Rotation.y = rotationFromString( yrot->GetValue() );
268  modelInfo->m_Rotation.z = rotationFromString( zrot->GetValue() );
269 
270  modelInfo->m_Offset.x = DoubleValueFromString( m_userUnits, xoff->GetValue() ) / IU_PER_MM;
271  modelInfo->m_Offset.y = DoubleValueFromString( m_userUnits, yoff->GetValue() ) / IU_PER_MM;
272  modelInfo->m_Offset.z = DoubleValueFromString( m_userUnits, zoff->GetValue() ) / IU_PER_MM;
273 
274  // Update the dummy module for the preview
275  UpdateDummyModule( false );
276  }
277 }
278 
279 
280 void PANEL_PREV_3D::onOpacitySlider( wxCommandEvent& event )
281 {
282  if( m_parentModelList && m_selected >= 0 && m_selected < (int) m_parentModelList->size() )
283  {
284  // Write settings back to the parent
285  MODULE_3D_SETTINGS* modelInfo = &m_parentModelList->at( (unsigned) m_selected );
286 
287  modelInfo->m_Opacity = m_opacity->GetValue() / 100.0;
288 
289  // Update the dummy module for the preview
290  UpdateDummyModule( false );
291  }
292 }
293 
294 
295 void PANEL_PREV_3D::doIncrementScale( wxSpinEvent& event, double aSign )
296 {
297  wxSpinButton* spinCtrl = (wxSpinButton*) event.GetEventObject();
298 
299  wxTextCtrl * textCtrl = xscale;
300 
301  if( spinCtrl == m_spinYscale )
302  textCtrl = yscale;
303  else if( spinCtrl == m_spinZscale )
304  textCtrl = zscale;
305 
306  double curr_value = DoubleValueFromString( EDA_UNITS::UNSCALED, textCtrl->GetValue() );
307 
308  curr_value += ( SCALE_INCREMENT * aSign );
309  curr_value = std::max( 1/MAX_SCALE, curr_value );
310  curr_value = std::min( curr_value, MAX_SCALE );
311 
312  textCtrl->SetValue( formatScaleValue( curr_value ) );
313 }
314 
315 
316 void PANEL_PREV_3D::doIncrementRotation( wxSpinEvent& aEvent, double aSign )
317 {
318  wxSpinButton* spinCtrl = (wxSpinButton*) aEvent.GetEventObject();
319  wxTextCtrl* textCtrl = xrot;
320 
321  if( spinCtrl == m_spinYrot )
322  textCtrl = yrot;
323  else if( spinCtrl == m_spinZrot )
324  textCtrl = zrot;
325 
326  double curr_value = DoubleValueFromString( EDA_UNITS::DEGREES, textCtrl->GetValue() ) / 10.0;
327 
328  curr_value += ( ROTATION_INCREMENT * aSign );
329  curr_value = std::max( -MAX_ROTATION, curr_value );
330  curr_value = std::min( curr_value, MAX_ROTATION );
331 
332  textCtrl->SetValue( formatRotationValue( curr_value ) );
333 }
334 
335 
336 void PANEL_PREV_3D::doIncrementOffset( wxSpinEvent& event, double aSign )
337 {
338  wxSpinButton* spinCtrl = (wxSpinButton*) event.GetEventObject();
339 
340  wxTextCtrl * textCtrl = xoff;
341 
342  if( spinCtrl == m_spinYoffset )
343  textCtrl = yoff;
344  else if( spinCtrl == m_spinZoffset )
345  textCtrl = zoff;
346 
347  double step = OFFSET_INCREMENT_MM;
348 
350  step = OFFSET_INCREMENT_MIL/1000.0;
351 
352  double curr_value = DoubleValueFromString( m_userUnits, textCtrl->GetValue() ) / IU_PER_MM;
353 
354  curr_value += ( step * aSign );
355  curr_value = std::max( -MAX_OFFSET, curr_value );
356  curr_value = std::min( curr_value, MAX_OFFSET );
357 
358  textCtrl->SetValue( formatOffsetValue( curr_value ) );
359 }
360 
361 
362 void PANEL_PREV_3D::onMouseWheelScale( wxMouseEvent& event )
363 {
364  wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
365 
366  double step = SCALE_INCREMENT;
367 
368  if( event.ShiftDown( ) )
369  step = SCALE_INCREMENT_FINE;
370 
371  if( event.GetWheelRotation() >= 0 )
372  step = -step;
373 
374  double curr_value = DoubleValueFromString( EDA_UNITS::UNSCALED, textCtrl->GetValue() );
375 
376  curr_value += step;
377  curr_value = std::max( 1/MAX_SCALE, curr_value );
378  curr_value = std::min( curr_value, MAX_SCALE );
379 
380  textCtrl->SetValue( formatScaleValue( curr_value ) );
381 }
382 
383 
384 void PANEL_PREV_3D::onMouseWheelRot( wxMouseEvent& event )
385 {
386  wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
387 
388  double step = ROTATION_INCREMENT_WHEEL;
389 
390  if( event.ShiftDown( ) )
392 
393  if( event.GetWheelRotation() >= 0 )
394  step = -step;
395 
396  double curr_value = DoubleValueFromString( EDA_UNITS::DEGREES, textCtrl->GetValue() ) / 10.0;
397 
398  curr_value += step;
399  curr_value = std::max( -MAX_ROTATION, curr_value );
400  curr_value = std::min( curr_value, MAX_ROTATION );
401 
402  textCtrl->SetValue( formatRotationValue( curr_value ) );
403 }
404 
405 
406 void PANEL_PREV_3D::onMouseWheelOffset( wxMouseEvent& event )
407 {
408  wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
409 
410  double step = OFFSET_INCREMENT_MM;
411 
412  if( event.ShiftDown( ) )
414 
416  {
417  step = OFFSET_INCREMENT_MIL/1000.0;
418 
419  if( event.ShiftDown( ) )
420  step = OFFSET_INCREMENT_MIL_FINE/1000.0;
421  }
422 
423  if( event.GetWheelRotation() >= 0 )
424  step = -step;
425 
426  double curr_value = DoubleValueFromString( m_userUnits, textCtrl->GetValue() ) / IU_PER_MM;
427 
428  curr_value += step;
429  curr_value = std::max( -MAX_OFFSET, curr_value );
430  curr_value = std::min( curr_value, MAX_OFFSET );
431 
432  textCtrl->SetValue( formatOffsetValue( curr_value ) );
433 }
434 
435 
436 void PANEL_PREV_3D::UpdateDummyModule( bool aReloadRequired )
437 {
438  m_dummyModule->Models().clear();
439 
440  for( MODULE_3D_SETTINGS& model : *m_parentModelList)
441  {
442  if( model.m_Show )
443  m_dummyModule->Models().push_back( model );
444  }
445 
446  if( aReloadRequired )
448 
450 }
wxBitmapButton * m_bpvTop
wxBitmapButton * m_bpvBottom
wxSpinButton * m_spinZoffset
Class PANEL_PREV_3D_BASE.
#define MAX_SCALE
Definition: panel_prev_3d.h:48
void onOpacitySlider(wxCommandEvent &event) override
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:104
const BITMAP_OPAQUE axis3d_front_xpm[1]
wxSpinButton * m_spinYoffset
void onMouseWheelScale(wxMouseEvent &event) override
wxBitmapButton * m_bpvBack
Implementation of conversion functions that require both schematic and board internal units.
wxBitmapButton * m_bpvLeft
#define SCALE_INCREMENT_FINE
Definition: panel_prev_3d.h:52
static double rotationFromString(const wxString &aValue)
rotationFromString Ensure -MAX_ROTATION <= rotation <= MAX_ROTATION aRotation will be normalized betw...
void SetFlag(DISPLAY3D_FLG aFlag, bool aState)
SetFlag - set the status of a flag.
void onMouseWheelOffset(wxMouseEvent &event) override
EDA_3D_ACTIONS.
Definition: 3d_actions.h:41
wxBitmapButton * m_bpUpdate
EDA_UNITS m_userUnits
Index into m_parentInfoList.
Definition: panel_prev_3d.h:93
const BITMAP_OPAQUE ortho_xpm[1]
Definition: ortho.cpp:55
double DoubleValueFromString(EDA_UNITS aUnits, const wxString &aTextValue, bool aUseMils, EDA_DATA_TYPE aType)
Function DoubleValueFromString converts aTextValue to a double.
Definition: base_units.cpp:346
Implement a canvas based on a wxGLCanvas.
Definition: eda_3d_canvas.h:47
wxString formatRotationValue(double aValue)
wxBoxSizer * m_SizerPanelView
void UpdateDummyModule(bool aRelaodRequired=true)
UpdateModelInfoList - copy shapes from the current shape list which are flagged for preview to the co...
#define ROTATION_INCREMENT_WHEEL
Definition: panel_prev_3d.h:56
void doIncrementScale(wxSpinEvent &aEvent, double aSign)
std::vector< MODULE_3D_SETTINGS > * m_parentModelList
Definition: panel_prev_3d.h:90
void Request_refresh(bool aRedrawImmediately=true)
Request_refresh - Schedule a refresh update of the canvas.
void ReloadRequest(BOARD *aBoard=NULL, S3D_CACHE *aCachePointer=NULL)
wxString GetAbbreviatedUnitsLabel(EDA_UNITS aUnit, bool aUseMils, EDA_DATA_TYPE aType)
Get the units string for a given units type.
Definition: base_units.cpp:495
bool InvokeTool(TOOL_ID aToolId)
Function InvokeTool() Calls a tool by sending a tool activation event to tool of given ID.
void doIncrementRotation(wxSpinEvent &aEvent, double aSign)
wxString formatScaleValue(double aValue)
VECTOR3D m_Offset
3D model offset (mm)
Definition: class_module.h:94
Class to handle configuration and automatic determination of the DPI scale to use for canvases.
Definition: dpi_scaling.h:36
const BITMAP_OPAQUE reload_xpm[1]
Definition: reload.cpp:71
wxBitmapButton * m_bpvRight
wxString formatOffsetValue(double aValue)
void doIncrementOffset(wxSpinEvent &aEvent, double aSign)
TOOL_MANAGER.
Definition: tool_manager.h:51
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:80
#define OFFSET_INCREMENT_MM_FINE
Definition: panel_prev_3d.h:60
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT) override
Adds an item to the container.
wxSpinButton * m_spinZrot
void SetEventDispatcher(TOOL_DISPATCHER *aEventDispatcher)
Function SetEventDispatcher() Sets a dispatcher that processes events and forwards them to tools.
#define SCALE_INCREMENT
Definition: panel_prev_3d.h:53
CCAMERA & m_currentCamera
Definition: panel_prev_3d.h:84
#define NULL
#define ROTATION_INCREMENT_WHEEL_FINE
Definition: panel_prev_3d.h:57
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
wxSpinButton * m_spinXoffset
virtual void DispatchWxEvent(wxEvent &aEvent)
Function DispatchWxEvent() Processes wxEvents (mostly UI events), translates them to TOOL_EVENTs,...
MODULE * m_dummyModule
Definition: panel_prev_3d.h:88
const BITMAP_OPAQUE axis3d_left_xpm[1]
Definition: axis3d_left.cpp:98
void loadCommonSettings()
Load 3D relevant settings from the user configuration.
EDA_3D_CONTROLLER.
Definition: 3d_controller.h:39
void OnMenuEvent(wxMenuEvent &aEvent)
The TOOL_DISPATCHER needs these to work around some issues in wxWidgets where the menu events aren't ...
EDA_3D_CANVAS * m_previewPane
Definition: panel_prev_3d.h:82
ACTIONS * m_actions
Definition: tools_holder.h:49
const BITMAP_OPAQUE axis3d_bottom_xpm[1]
#define ROTATION_INCREMENT
Definition: panel_prev_3d.h:55
wxSpinButton * m_spinYrot
#define OFFSET_INCREMENT_MIL
Definition: panel_prev_3d.h:62
Declaration of the cogl_att_list class.
void SetSelectedModel(int idx)
SetModelDataIdx - Sets the currently selected index in the model list so that the scale/rotation/offs...
wxSpinButton * m_spinXrot
wxBitmapButton * m_bpvFront
#define OFFSET_INCREMENT_MIL_FINE
Definition: panel_prev_3d.h:63
wxSpinButton * m_spinZscale
wxSpinButton * m_spinXscale
TOOL_DISPATCHER * m_toolDispatcher
Definition: tools_holder.h:50
TOOL_DISPATCHER.
void onMouseWheelRot(wxMouseEvent &event) override
static const int * GetAttributesList(ANTIALIASING_MODE aAntiAliasingMode)
Get a list of attributes to pass to wxGLCanvas.
const BITMAP_OPAQUE axis3d_top_xpm[1]
Definition: axis3d_top.cpp:94
std::list< MODULE_3D_SETTINGS > & Models()
Definition: class_module.h:201
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:48
see class PGM_BASE
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
VECTOR3D m_Rotation
3D model rotation (degrees)
Definition: class_module.h:93
void updateOrientation(wxCommandEvent &event) override
updateOrientation - it will receive the events from editing the fields
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:180
void SetEnvironment(EDA_ITEM *aModel, KIGFX::VIEW *aView, KIGFX::VIEW_CONTROLS *aViewControls, APP_SETTINGS_BASE *aSettings, TOOLS_HOLDER *aFrame)
Sets the work environment (model, view, view controls and the parent window).
wxBitmapButton * m_bpvISO
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:68
VECTOR3D m_Scale
3D model scaling factor (dimensionless)
Definition: class_module.h:92
void SetScaleFactor(double aFactor)
Set the canvas scale factor, probably for a hi-DPI display.
#define MAX_ROTATION
Definition: panel_prev_3d.h:49
PANEL_PREV_3D(wxWindow *aParent, PCB_BASE_FRAME *aFrame, MODULE *aModule, std::vector< MODULE_3D_SETTINGS > *aParentModelList)
const BITMAP_OPAQUE axis3d_right_xpm[1]
#define MAX_OFFSET
Definition: panel_prev_3d.h:50
void InitTools()
Function InitTools() Initializes all registered tools.
BOARD * m_dummyBoard
Definition: panel_prev_3d.h:87
#define RANGE_SCALE_3D
This defines the range that all coord will have to be rendered.
Definition: board_adapter.h:61
PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
const BITMAP_OPAQUE axis3d_back_xpm[1]
Definition: axis3d_back.cpp:97
void RegisterTool(TOOL_BASE *aTool)
Function RegisterTool() Adds a tool to the manager set and sets it up.
BOARD_ADAPTER m_boardAdapter
Definition: panel_prev_3d.h:83
wxSpinButton * m_spinYscale
#define OFFSET_INCREMENT_MM
Definition: panel_prev_3d.h:59