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 <board.h>
37 #include <gal/dpi_scaling.h>
38 #include <pgm_base.h>
39 #include <project.h>
41 #include <widgets/infobar.h>
42 
43 
44 PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, FOOTPRINT* aFootprint,
45  std::vector<FP_3DMODEL>* aParentModelList ) :
46  PANEL_PREV_3D_BASE( aParent, wxID_ANY ),
47  m_previewPane( nullptr ),
48  m_infobar( nullptr ),
49  m_boardAdapter(),
50  m_currentCamera( m_trackBallCamera ),
51  m_trackBallCamera( RANGE_SCALE_3D )
52 {
53  m_userUnits = aFrame->GetUserUnits();
54 
55  m_dummyBoard = new BOARD();
56 
57  // This board will only be used to hold a footprint for viewing
59 
60  m_selected = -1;
61 
62  // Set the bitmap of 3D view buttons:
63  m_bpvTop->SetBitmap( KiBitmap( axis3d_top_xpm ) );
64  m_bpvFront->SetBitmap( KiBitmap( axis3d_front_xpm ) );
65  m_bpvBack->SetBitmap( KiBitmap( axis3d_back_xpm ) );
66  m_bpvLeft->SetBitmap( KiBitmap( axis3d_left_xpm ) );
67  m_bpvRight->SetBitmap( KiBitmap( axis3d_right_xpm ) );
68  m_bpvBottom->SetBitmap( KiBitmap( axis3d_bottom_xpm ) );
69  m_bpvISO->SetBitmap( KiBitmap( ortho_xpm ) );
70  m_bpUpdate->SetBitmap( KiBitmap( reload_xpm ) );
71 
72  // Set the min and max values of spin buttons (mandatory on Linux)
73  // They are not used, so they are set to min and max 32 bits int values
74  // (the min and max values supported by a wxSpinButton)
75  // It avoids blocking the up or down arrows when reaching this limit after
76  // a few clicks.
77  wxSpinButton* spinButtonList[] =
78  {
82  };
83 
84  for( wxSpinButton* button : spinButtonList )
85  button->SetRange(INT_MIN, INT_MAX );
86 
87  m_parentModelList = aParentModelList;
88 
89  m_dummyFootprint = new FOOTPRINT( *aFootprint );
91 
92  // Create the 3D canvas
93  m_previewPane = new EDA_3D_CANVAS( this,
96  aFrame->Prj().Get3DCacheManager() );
97 
99 
101 
102  // Create the manager
104  m_toolManager->SetEnvironment( m_dummyBoard, nullptr, nullptr, nullptr, this );
105 
106  m_actions = new EDA_3D_ACTIONS();
109 
110  // Register tools
113 
114  // Run the viewer control tool, it is supposed to be always active
115  m_toolManager->InvokeTool( "3DViewer.Control" );
116 
117  m_infobar = new WX_INFOBAR( this );
119 
120  m_SizerPanelView->Add( m_infobar, 0, wxEXPAND, 0 );
121  m_SizerPanelView->Add( m_previewPane, 1, wxEXPAND, 5 );
122 
123  for( wxEventType eventType : { wxEVT_MENU_OPEN, wxEVT_MENU_CLOSE, wxEVT_MENU_HIGHLIGHT } )
124  Connect( eventType, wxMenuEventHandler( PANEL_PREV_3D::OnMenuEvent ), NULL, this );
125 
126 #ifdef __WXOSX__
127  // Call layout once to get the proper button sizes after the bitmaps have been set
128  Layout();
129 
130  // The rounded-button style used has a small border on the left/right sides.
131  // This is automatically fixed in wx for buttons with a bitmap < 20, but not
132  // when the bitmap is set to be 26x26.
133  wxSize borderFix = wxSize( 4, 4 );
134 
135  m_bpvTop->SetMinSize( m_bpvTop->GetSize() + borderFix );
136  m_bpvFront->SetMinSize( m_bpvFront->GetSize() + borderFix );
137  m_bpvBack->SetMinSize( m_bpvBack->GetSize() + borderFix );
138  m_bpvLeft->SetMinSize( m_bpvLeft->GetSize() + borderFix );
139  m_bpvRight->SetMinSize( m_bpvRight->GetSize() + borderFix );
140  m_bpvBottom->SetMinSize( m_bpvBottom->GetSize() + borderFix );
141  m_bpvISO->SetMinSize( m_bpvISO->GetSize() + borderFix );
142  m_bpUpdate->SetMinSize( m_bpUpdate->GetSize() + borderFix );
143 #endif
144 }
145 
146 
148 {
149  delete m_dummyBoard;
150  delete m_previewPane;
151 }
152 
153 
154 void PANEL_PREV_3D::OnMenuEvent( wxMenuEvent& aEvent )
155 {
156  if( !m_toolDispatcher )
157  aEvent.Skip();
158  else
160 }
161 
162 
164 {
165  wxCHECK_RET( m_previewPane, "Cannot load settings to null canvas" );
166 
167  COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
168 
169  const DPI_SCALING dpi{ settings, this };
170  m_previewPane->SetScaleFactor( dpi.GetScaleFactor() );
171 
172  // TODO(JE) use all control options
174 }
175 
176 
182 static double rotationFromString( const wxString& aValue )
183 {
184  double rotation = DoubleValueFromString( EDA_UNITS::DEGREES, aValue ) / 10.0;
185 
186  if( rotation > MAX_ROTATION )
187  {
188  int n = KiROUND( rotation / MAX_ROTATION );
189  rotation -= MAX_ROTATION * n;
190  }
191  else if( rotation < -MAX_ROTATION )
192  {
193  int n = KiROUND( -rotation / MAX_ROTATION );
194  rotation += MAX_ROTATION * n;
195  }
196 
197  return rotation;
198 }
199 
200 
201 wxString PANEL_PREV_3D::formatScaleValue( double aValue )
202 {
203  return wxString::Format( "%.4f", aValue );
204 }
205 
206 
207 wxString PANEL_PREV_3D::formatRotationValue( double aValue )
208 {
209  return wxString::Format( "%.2f %s", aValue, GetAbbreviatedUnitsLabel( EDA_UNITS::DEGREES ) );
210 }
211 
212 
213 wxString PANEL_PREV_3D::formatOffsetValue( double aValue )
214 {
215  // Convert from internal units (mm) to user units
217  aValue /= 25.4f;
218 
219  return wxString::Format( "%.4f %s", aValue, GetAbbreviatedUnitsLabel( m_userUnits ) );
220 }
221 
222 
224 {
225  if( m_parentModelList && idx >= 0 && idx < (int) m_parentModelList->size() )
226  {
227  m_selected = idx;
228  const FP_3DMODEL& modelInfo = m_parentModelList->at( (unsigned) m_selected );
229 
230  // Use ChangeValue() instead of SetValue(). It's not the user making the change, so we
231  // don't want to generate wxEVT_GRID_CELL_CHANGED events.
232  xscale->ChangeValue( formatScaleValue( modelInfo.m_Scale.x ) );
233  yscale->ChangeValue( formatScaleValue( modelInfo.m_Scale.y ) );
234  zscale->ChangeValue( formatScaleValue( modelInfo.m_Scale.z ) );
235 
236  xrot->ChangeValue( formatRotationValue( modelInfo.m_Rotation.x ) );
237  yrot->ChangeValue( formatRotationValue( modelInfo.m_Rotation.y ) );
238  zrot->ChangeValue( formatRotationValue( modelInfo.m_Rotation.z ) );
239 
240  xoff->ChangeValue( formatOffsetValue( modelInfo.m_Offset.x ) );
241  yoff->ChangeValue( formatOffsetValue( modelInfo.m_Offset.y ) );
242  zoff->ChangeValue( formatOffsetValue( modelInfo.m_Offset.z ) );
243 
244  m_opacity->SetValue( modelInfo.m_Opacity * 100.0 );
245  }
246  else
247  {
248  m_selected = -1;
249 
250  xscale->ChangeValue( wxEmptyString );
251  yscale->ChangeValue( wxEmptyString );
252  zscale->ChangeValue( wxEmptyString );
253 
254  xrot->ChangeValue( wxEmptyString );
255  yrot->ChangeValue( wxEmptyString );
256  zrot->ChangeValue( wxEmptyString );
257 
258  xoff->ChangeValue( wxEmptyString );
259  yoff->ChangeValue( wxEmptyString );
260  zoff->ChangeValue( wxEmptyString );
261 
262  m_opacity->SetValue( 100 );
263  }
264 }
265 
266 
267 void PANEL_PREV_3D::updateOrientation( wxCommandEvent &event )
268 {
269  if( m_parentModelList && m_selected >= 0 && m_selected < (int) m_parentModelList->size() )
270  {
271  // Write settings back to the parent
272  FP_3DMODEL* modelInfo = &m_parentModelList->at( (unsigned) m_selected );
273 
274  modelInfo->m_Scale.x = DoubleValueFromString( EDA_UNITS::UNSCALED, xscale->GetValue() );
275  modelInfo->m_Scale.y = DoubleValueFromString( EDA_UNITS::UNSCALED, yscale->GetValue() );
276  modelInfo->m_Scale.z = DoubleValueFromString( EDA_UNITS::UNSCALED, zscale->GetValue() );
277 
278  modelInfo->m_Rotation.x = rotationFromString( xrot->GetValue() );
279  modelInfo->m_Rotation.y = rotationFromString( yrot->GetValue() );
280  modelInfo->m_Rotation.z = rotationFromString( zrot->GetValue() );
281 
282  modelInfo->m_Offset.x = DoubleValueFromString( m_userUnits, xoff->GetValue() ) / IU_PER_MM;
283  modelInfo->m_Offset.y = DoubleValueFromString( m_userUnits, yoff->GetValue() ) / IU_PER_MM;
284  modelInfo->m_Offset.z = DoubleValueFromString( m_userUnits, zoff->GetValue() ) / IU_PER_MM;
285 
286  // Update the dummy footprint for the preview
287  UpdateDummyFootprint( false );
288  }
289 }
290 
291 
292 void PANEL_PREV_3D::onOpacitySlider( wxCommandEvent& event )
293 {
294  if( m_parentModelList && m_selected >= 0 && m_selected < (int) m_parentModelList->size() )
295  {
296  // Write settings back to the parent
297  FP_3DMODEL* modelInfo = &m_parentModelList->at( (unsigned) m_selected );
298 
299  modelInfo->m_Opacity = m_opacity->GetValue() / 100.0;
300 
301  // Update the dummy footprint for the preview
302  UpdateDummyFootprint( false );
303  }
304 }
305 
306 
307 void PANEL_PREV_3D::doIncrementScale( wxSpinEvent& event, double aSign )
308 {
309  wxSpinButton* spinCtrl = (wxSpinButton*) event.GetEventObject();
310 
311  wxTextCtrl * textCtrl = xscale;
312 
313  if( spinCtrl == m_spinYscale )
314  textCtrl = yscale;
315  else if( spinCtrl == m_spinZscale )
316  textCtrl = zscale;
317 
318  double curr_value = DoubleValueFromString( EDA_UNITS::UNSCALED, textCtrl->GetValue() );
319 
320  curr_value += ( SCALE_INCREMENT * aSign );
321  curr_value = std::max( 1/MAX_SCALE, curr_value );
322  curr_value = std::min( curr_value, MAX_SCALE );
323 
324  textCtrl->SetValue( formatScaleValue( curr_value ) );
325 }
326 
327 
328 void PANEL_PREV_3D::doIncrementRotation( wxSpinEvent& aEvent, double aSign )
329 {
330  wxSpinButton* spinCtrl = (wxSpinButton*) aEvent.GetEventObject();
331  wxTextCtrl* textCtrl = xrot;
332 
333  if( spinCtrl == m_spinYrot )
334  textCtrl = yrot;
335  else if( spinCtrl == m_spinZrot )
336  textCtrl = zrot;
337 
338  double curr_value = DoubleValueFromString( EDA_UNITS::DEGREES, textCtrl->GetValue() ) / 10.0;
339 
340  curr_value += ( ROTATION_INCREMENT * aSign );
341  curr_value = std::max( -MAX_ROTATION, curr_value );
342  curr_value = std::min( curr_value, MAX_ROTATION );
343 
344  textCtrl->SetValue( formatRotationValue( curr_value ) );
345 }
346 
347 
348 void PANEL_PREV_3D::doIncrementOffset( wxSpinEvent& event, double aSign )
349 {
350  wxSpinButton* spinCtrl = (wxSpinButton*) event.GetEventObject();
351 
352  wxTextCtrl * textCtrl = xoff;
353 
354  if( spinCtrl == m_spinYoffset )
355  textCtrl = yoff;
356  else if( spinCtrl == m_spinZoffset )
357  textCtrl = zoff;
358 
359  double step = OFFSET_INCREMENT_MM;
360 
362  step = OFFSET_INCREMENT_MIL/1000.0;
363 
364  double curr_value = DoubleValueFromString( m_userUnits, textCtrl->GetValue() ) / IU_PER_MM;
365 
366  curr_value += ( step * aSign );
367  curr_value = std::max( -MAX_OFFSET, curr_value );
368  curr_value = std::min( curr_value, MAX_OFFSET );
369 
370  textCtrl->SetValue( formatOffsetValue( curr_value ) );
371 }
372 
373 
374 void PANEL_PREV_3D::onMouseWheelScale( wxMouseEvent& event )
375 {
376  wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
377 
378  double step = SCALE_INCREMENT;
379 
380  if( event.ShiftDown( ) )
381  step = SCALE_INCREMENT_FINE;
382 
383  if( event.GetWheelRotation() >= 0 )
384  step = -step;
385 
386  double curr_value = DoubleValueFromString( EDA_UNITS::UNSCALED, textCtrl->GetValue() );
387 
388  curr_value += step;
389  curr_value = std::max( 1/MAX_SCALE, curr_value );
390  curr_value = std::min( curr_value, MAX_SCALE );
391 
392  textCtrl->SetValue( formatScaleValue( curr_value ) );
393 }
394 
395 
396 void PANEL_PREV_3D::onMouseWheelRot( wxMouseEvent& event )
397 {
398  wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
399 
400  double step = ROTATION_INCREMENT_WHEEL;
401 
402  if( event.ShiftDown( ) )
404 
405  if( event.GetWheelRotation() >= 0 )
406  step = -step;
407 
408  double curr_value = DoubleValueFromString( EDA_UNITS::DEGREES, textCtrl->GetValue() ) / 10.0;
409 
410  curr_value += step;
411  curr_value = std::max( -MAX_ROTATION, curr_value );
412  curr_value = std::min( curr_value, MAX_ROTATION );
413 
414  textCtrl->SetValue( formatRotationValue( curr_value ) );
415 }
416 
417 
418 void PANEL_PREV_3D::onMouseWheelOffset( wxMouseEvent& event )
419 {
420  wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
421 
422  double step = OFFSET_INCREMENT_MM;
423 
424  if( event.ShiftDown( ) )
426 
428  {
429  step = OFFSET_INCREMENT_MIL/1000.0;
430 
431  if( event.ShiftDown( ) )
432  step = OFFSET_INCREMENT_MIL_FINE/1000.0;
433  }
434 
435  if( event.GetWheelRotation() >= 0 )
436  step = -step;
437 
438  double curr_value = DoubleValueFromString( m_userUnits, textCtrl->GetValue() ) / IU_PER_MM;
439 
440  curr_value += step;
441  curr_value = std::max( -MAX_OFFSET, curr_value );
442  curr_value = std::min( curr_value, MAX_OFFSET );
443 
444  textCtrl->SetValue( formatOffsetValue( curr_value ) );
445 }
446 
447 
448 void PANEL_PREV_3D::UpdateDummyFootprint( bool aReloadRequired )
449 {
450  m_dummyFootprint->Models().clear();
451 
452  for( FP_3DMODEL& model : *m_parentModelList )
453  {
454  if( model.m_Show )
455  m_dummyFootprint->Models().push_back( model );
456  }
457 
458  if( aReloadRequired )
460 
462 }
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
const BITMAP_OPAQUE axis3d_front_xpm[1]
wxSpinButton * m_spinYoffset
std::list< FP_3DMODEL > & Models()
Definition: footprint.h:178
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)
Ensure -MAX_ROTATION <= rotation <= MAX_ROTATION.
static constexpr double IU_PER_MM
Mock up a conversion function.
void SetFlag(DISPLAY3D_FLG aFlag, bool aState)
Set the status of a flag.
void onMouseWheelOffset(wxMouseEvent &event) override
EDA_3D_ACTIONS.
Definition: 3d_actions.h:41
WX_INFOBAR * m_infobar
wxBitmapButton * m_bpUpdate
EDA_UNITS m_userUnits
Index into m_parentInfoList.
const BITMAP_OPAQUE ortho_xpm[1]
Definition: ortho.cpp:45
Implement a canvas based on a wxGLCanvas.
Definition: eda_3d_canvas.h:48
wxString formatRotationValue(double aValue)
wxBoxSizer * m_SizerPanelView
#define ROTATION_INCREMENT_WHEEL
Definition: panel_prev_3d.h:56
wxString GetAbbreviatedUnitsLabel(EDA_UNITS aUnit, EDA_DATA_TYPE aType)
Get the units string for a given units type.
Definition: base_units.cpp:472
Declaration of the cogl_att_list class.
void doIncrementScale(wxSpinEvent &aEvent, double aSign)
std::vector< FP_3DMODEL > * m_parentModelList
void Request_refresh(bool aRedrawImmediately=true)
Schedule a refresh update of the canvas.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:106
static const int * GetAttributesList(ANTIALIASING_MODE aAntiAliasingMode)
Get a list of attributes to pass to wxGLCanvas.
VECTOR3D m_Offset
3D model offset (mm)
Definition: footprint.h:95
bool InvokeTool(TOOL_ID aToolId)
Call a tool by sending a tool activation event to tool of given ID.
void doIncrementRotation(wxSpinEvent &aEvent, double aSign)
wxString formatScaleValue(double aValue)
void UpdateDummyFootprint(bool aRelaodRequired=true)
Copy shapes from the current shape list which are flagged for preview to the copy of footprint that i...
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:53
wxBitmapButton * m_bpvRight
wxString formatOffsetValue(double aValue)
FOOTPRINT * m_dummyFootprint
void doIncrementOffset(wxSpinEvent &aEvent, double aSign)
Master controller class:
Definition: tool_manager.h:52
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:82
#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.
Definition: board.cpp:563
wxSpinButton * m_spinZrot
void SetInfoBar(WX_INFOBAR *aInfoBar)
Definition: eda_3d_canvas.h:79
void SetEventDispatcher(TOOL_DISPATCHER *aEventDispatcher)
Set a dispatcher that processes events and forwards them to tools.
#define SCALE_INCREMENT
Definition: panel_prev_3d.h:53
#define NULL
#define ROTATION_INCREMENT_WHEEL_FINE
Definition: panel_prev_3d.h:57
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
wxSpinButton * m_spinXoffset
virtual void DispatchWxEvent(wxEvent &aEvent)
Process wxEvents (mostly UI events), translate them to TOOL_EVENTs, and make tools handle those.
const BITMAP_OPAQUE axis3d_left_xpm[1]
Definition: axis3d_left.cpp:61
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 ...
VECTOR3D m_Scale
3D model scaling factor (dimensionless)
Definition: footprint.h:93
EDA_3D_CANVAS * m_previewPane
ACTIONS * m_actions
Definition: tools_holder.h:158
const BITMAP_OPAQUE axis3d_bottom_xpm[1]
#define ROTATION_INCREMENT
Definition: panel_prev_3d.h:55
double m_Opacity
Definition: footprint.h:96
wxSpinButton * m_spinYrot
#define OFFSET_INCREMENT_MIL
Definition: panel_prev_3d.h:62
void SetSelectedModel(int idx)
Set the currently selected index in the model list so that the scale/rotation/offset controls can be ...
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:159
void onMouseWheelRot(wxMouseEvent &event) override
const BITMAP_OPAQUE axis3d_top_xpm[1]
Definition: axis3d_top.cpp:60
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
A modified version of the wxInfoBar class that allows us to:
Definition: infobar.h:71
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:157
see class PGM_BASE
VECTOR3D m_Rotation
3D model rotation (degrees)
Definition: footprint.h:94
void updateOrientation(wxCommandEvent &event) override
It will receive the events from editing the fields.
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:190
void SetEnvironment(EDA_ITEM *aModel, KIGFX::VIEW *aView, KIGFX::VIEW_CONTROLS *aViewControls, APP_SETTINGS_BASE *aSettings, TOOLS_HOLDER *aFrame)
Set 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
void SetScaleFactor(double aFactor)
Set the canvas scale factor, probably for a hi-DPI display.
CAMERA & m_currentCamera
void ReloadRequest(BOARD *aBoard=nullptr, S3D_CACHE *aCachePointer=nullptr)
#define MAX_ROTATION
Definition: panel_prev_3d.h:49
const BITMAP_OPAQUE axis3d_right_xpm[1]
#define MAX_OFFSET
Definition: panel_prev_3d.h:50
void InitTools()
Initializes all registered tools.
BOARD * m_dummyBoard
double DoubleValueFromString(EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType)
Function DoubleValueFromString converts aTextValue to a double.
Definition: base_units.cpp:338
PANEL_PREV_3D(wxWindow *aParent, PCB_BASE_FRAME *aFrame, FOOTPRINT *aFootprint, std::vector< FP_3DMODEL > *aParentModelList)
#define RANGE_SCALE_3D
This defines the range that all coord will have to be rendered.
Definition: board_adapter.h:61
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
void SetBoardUse(BOARD_USE aUse)
Set what the board is going to be used for.
Definition: board.h:262
const BITMAP_OPAQUE axis3d_back_xpm[1]
Definition: axis3d_back.cpp:61
void RegisterTool(TOOL_BASE *aTool)
Add a tool to the manager set and sets it up.
BOARD_ADAPTER m_boardAdapter
wxSpinButton * m_spinYscale
#define OFFSET_INCREMENT_MM
Definition: panel_prev_3d.h:59