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( BITMAPS::axis3d_top ) );
64  m_bpvFront->SetBitmap( KiBitmap( BITMAPS::axis3d_front ) );
65  m_bpvBack->SetBitmap( KiBitmap( BITMAPS::axis3d_back ) );
66  m_bpvLeft->SetBitmap( KiBitmap( BITMAPS::axis3d_left ) );
67  m_bpvRight->SetBitmap( KiBitmap( BITMAPS::axis3d_right ) );
69  m_bpvISO->SetBitmap( KiBitmap( BITMAPS::ortho ) );
70  m_bpUpdate->SetBitmap( KiBitmap( BITMAPS::reload ) );
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 
102 
103  // Create the manager
105  m_toolManager->SetEnvironment( m_dummyBoard, nullptr, nullptr, nullptr, this );
106 
107  m_actions = new EDA_3D_ACTIONS();
110 
111  // Register tools
114 
115  // Run the viewer control tool, it is supposed to be always active
116  m_toolManager->InvokeTool( "3DViewer.Control" );
117 
118  m_infobar = new WX_INFOBAR( this );
120 
121  m_SizerPanelView->Add( m_infobar, 0, wxEXPAND, 0 );
122  m_SizerPanelView->Add( m_previewPane, 1, wxEXPAND, 5 );
123 
124  for( wxEventType eventType : { wxEVT_MENU_OPEN, wxEVT_MENU_CLOSE, wxEVT_MENU_HIGHLIGHT } )
125  Connect( eventType, wxMenuEventHandler( PANEL_PREV_3D::OnMenuEvent ), NULL, this );
126 
127 #ifdef __WXOSX__
128  // Call layout once to get the proper button sizes after the bitmaps have been set
129  Layout();
130 
131  // The rounded-button style used has a small border on the left/right sides.
132  // This is automatically fixed in wx for buttons with a bitmap < 20, but not
133  // when the bitmap is set to be 26x26.
134  wxSize borderFix = wxSize( 4, 4 );
135 
136  m_bpvTop->SetMinSize( m_bpvTop->GetSize() + borderFix );
137  m_bpvFront->SetMinSize( m_bpvFront->GetSize() + borderFix );
138  m_bpvBack->SetMinSize( m_bpvBack->GetSize() + borderFix );
139  m_bpvLeft->SetMinSize( m_bpvLeft->GetSize() + borderFix );
140  m_bpvRight->SetMinSize( m_bpvRight->GetSize() + borderFix );
141  m_bpvBottom->SetMinSize( m_bpvBottom->GetSize() + borderFix );
142  m_bpvISO->SetMinSize( m_bpvISO->GetSize() + borderFix );
143  m_bpUpdate->SetMinSize( m_bpUpdate->GetSize() + borderFix );
144 #endif
145 }
146 
147 
149 {
150  delete m_dummyBoard;
151  delete m_previewPane;
152 }
153 
154 
155 void PANEL_PREV_3D::OnMenuEvent( wxMenuEvent& aEvent )
156 {
157  if( !m_toolDispatcher )
158  aEvent.Skip();
159  else
161 }
162 
163 
165 {
166  wxCHECK_RET( m_previewPane, "Cannot load settings to null canvas" );
167 
168  COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
169 
170  const DPI_SCALING dpi{ settings, this };
171  m_previewPane->SetScaleFactor( dpi.GetScaleFactor() );
172 
173  // TODO(JE) use all control options
175 }
176 
177 
183 static double rotationFromString( const wxString& aValue )
184 {
185  double rotation = DoubleValueFromString( EDA_UNITS::DEGREES, aValue ) / 10.0;
186 
187  if( rotation > MAX_ROTATION )
188  {
189  int n = KiROUND( rotation / MAX_ROTATION );
190  rotation -= MAX_ROTATION * n;
191  }
192  else if( rotation < -MAX_ROTATION )
193  {
194  int n = KiROUND( -rotation / MAX_ROTATION );
195  rotation += MAX_ROTATION * n;
196  }
197 
198  return rotation;
199 }
200 
201 
202 wxString PANEL_PREV_3D::formatScaleValue( double aValue )
203 {
204  return wxString::Format( "%.4f", aValue );
205 }
206 
207 
208 wxString PANEL_PREV_3D::formatRotationValue( double aValue )
209 {
210  return wxString::Format( "%.2f %s", aValue, GetAbbreviatedUnitsLabel( EDA_UNITS::DEGREES ) );
211 }
212 
213 
214 wxString PANEL_PREV_3D::formatOffsetValue( double aValue )
215 {
216  // Convert from internal units (mm) to user units
218  aValue /= 25.4f;
219 
220  return wxString::Format( "%.4f %s", aValue, GetAbbreviatedUnitsLabel( m_userUnits ) );
221 }
222 
223 
225 {
226  if( m_parentModelList && idx >= 0 && idx < (int) m_parentModelList->size() )
227  {
228  m_selected = idx;
229  const FP_3DMODEL& modelInfo = m_parentModelList->at( (unsigned) m_selected );
230 
231  // Use ChangeValue() instead of SetValue(). It's not the user making the change, so we
232  // don't want to generate wxEVT_GRID_CELL_CHANGED events.
233  xscale->ChangeValue( formatScaleValue( modelInfo.m_Scale.x ) );
234  yscale->ChangeValue( formatScaleValue( modelInfo.m_Scale.y ) );
235  zscale->ChangeValue( formatScaleValue( modelInfo.m_Scale.z ) );
236 
237  xrot->ChangeValue( formatRotationValue( modelInfo.m_Rotation.x ) );
238  yrot->ChangeValue( formatRotationValue( modelInfo.m_Rotation.y ) );
239  zrot->ChangeValue( formatRotationValue( modelInfo.m_Rotation.z ) );
240 
241  xoff->ChangeValue( formatOffsetValue( modelInfo.m_Offset.x ) );
242  yoff->ChangeValue( formatOffsetValue( modelInfo.m_Offset.y ) );
243  zoff->ChangeValue( formatOffsetValue( modelInfo.m_Offset.z ) );
244 
245  m_opacity->SetValue( modelInfo.m_Opacity * 100.0 );
246  }
247  else
248  {
249  m_selected = -1;
250 
251  xscale->ChangeValue( wxEmptyString );
252  yscale->ChangeValue( wxEmptyString );
253  zscale->ChangeValue( wxEmptyString );
254 
255  xrot->ChangeValue( wxEmptyString );
256  yrot->ChangeValue( wxEmptyString );
257  zrot->ChangeValue( wxEmptyString );
258 
259  xoff->ChangeValue( wxEmptyString );
260  yoff->ChangeValue( wxEmptyString );
261  zoff->ChangeValue( wxEmptyString );
262 
263  m_opacity->SetValue( 100 );
264  }
265 }
266 
267 
268 void PANEL_PREV_3D::updateOrientation( wxCommandEvent &event )
269 {
270  if( m_parentModelList && m_selected >= 0 && m_selected < (int) m_parentModelList->size() )
271  {
272  // Write settings back to the parent
273  FP_3DMODEL* modelInfo = &m_parentModelList->at( (unsigned) m_selected );
274 
275  modelInfo->m_Scale.x = DoubleValueFromString( EDA_UNITS::UNSCALED, xscale->GetValue() );
276  modelInfo->m_Scale.y = DoubleValueFromString( EDA_UNITS::UNSCALED, yscale->GetValue() );
277  modelInfo->m_Scale.z = DoubleValueFromString( EDA_UNITS::UNSCALED, zscale->GetValue() );
278 
279  modelInfo->m_Rotation.x = rotationFromString( xrot->GetValue() );
280  modelInfo->m_Rotation.y = rotationFromString( yrot->GetValue() );
281  modelInfo->m_Rotation.z = rotationFromString( zrot->GetValue() );
282 
283  modelInfo->m_Offset.x = DoubleValueFromString( m_userUnits, xoff->GetValue() ) / IU_PER_MM;
284  modelInfo->m_Offset.y = DoubleValueFromString( m_userUnits, yoff->GetValue() ) / IU_PER_MM;
285  modelInfo->m_Offset.z = DoubleValueFromString( m_userUnits, zoff->GetValue() ) / IU_PER_MM;
286 
287  // Update the dummy footprint for the preview
288  UpdateDummyFootprint( false );
289  }
290 }
291 
292 
293 void PANEL_PREV_3D::onOpacitySlider( wxCommandEvent& event )
294 {
295  if( m_parentModelList && m_selected >= 0 && m_selected < (int) m_parentModelList->size() )
296  {
297  // Write settings back to the parent
298  FP_3DMODEL* modelInfo = &m_parentModelList->at( (unsigned) m_selected );
299 
300  modelInfo->m_Opacity = m_opacity->GetValue() / 100.0;
301 
302  // Update the dummy footprint for the preview
303  UpdateDummyFootprint( false );
304  }
305 }
306 
307 
308 void PANEL_PREV_3D::doIncrementScale( wxSpinEvent& event, double aSign )
309 {
310  wxSpinButton* spinCtrl = (wxSpinButton*) event.GetEventObject();
311 
312  wxTextCtrl * textCtrl = xscale;
313 
314  if( spinCtrl == m_spinYscale )
315  textCtrl = yscale;
316  else if( spinCtrl == m_spinZscale )
317  textCtrl = zscale;
318 
319  double curr_value = DoubleValueFromString( EDA_UNITS::UNSCALED, textCtrl->GetValue() );
320 
321  curr_value += ( SCALE_INCREMENT * aSign );
322  curr_value = std::max( 1/MAX_SCALE, curr_value );
323  curr_value = std::min( curr_value, MAX_SCALE );
324 
325  textCtrl->SetValue( formatScaleValue( curr_value ) );
326 }
327 
328 
329 void PANEL_PREV_3D::doIncrementRotation( wxSpinEvent& aEvent, double aSign )
330 {
331  wxSpinButton* spinCtrl = (wxSpinButton*) aEvent.GetEventObject();
332  wxTextCtrl* textCtrl = xrot;
333 
334  if( spinCtrl == m_spinYrot )
335  textCtrl = yrot;
336  else if( spinCtrl == m_spinZrot )
337  textCtrl = zrot;
338 
339  double curr_value = DoubleValueFromString( EDA_UNITS::DEGREES, textCtrl->GetValue() ) / 10.0;
340 
341  curr_value += ( ROTATION_INCREMENT * aSign );
342  curr_value = std::max( -MAX_ROTATION, curr_value );
343  curr_value = std::min( curr_value, MAX_ROTATION );
344 
345  textCtrl->SetValue( formatRotationValue( curr_value ) );
346 }
347 
348 
349 void PANEL_PREV_3D::doIncrementOffset( wxSpinEvent& event, double aSign )
350 {
351  wxSpinButton* spinCtrl = (wxSpinButton*) event.GetEventObject();
352 
353  wxTextCtrl * textCtrl = xoff;
354 
355  if( spinCtrl == m_spinYoffset )
356  textCtrl = yoff;
357  else if( spinCtrl == m_spinZoffset )
358  textCtrl = zoff;
359 
360  double step = OFFSET_INCREMENT_MM;
361 
363  step = OFFSET_INCREMENT_MIL/1000.0;
364 
365  double curr_value = DoubleValueFromString( m_userUnits, textCtrl->GetValue() ) / IU_PER_MM;
366 
367  curr_value += ( step * aSign );
368  curr_value = std::max( -MAX_OFFSET, curr_value );
369  curr_value = std::min( curr_value, MAX_OFFSET );
370 
371  textCtrl->SetValue( formatOffsetValue( curr_value ) );
372 }
373 
374 
375 void PANEL_PREV_3D::onMouseWheelScale( wxMouseEvent& event )
376 {
377  wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
378 
379  double step = SCALE_INCREMENT;
380 
381  if( event.ShiftDown( ) )
382  step = SCALE_INCREMENT_FINE;
383 
384  if( event.GetWheelRotation() >= 0 )
385  step = -step;
386 
387  double curr_value = DoubleValueFromString( EDA_UNITS::UNSCALED, textCtrl->GetValue() );
388 
389  curr_value += step;
390  curr_value = std::max( 1/MAX_SCALE, curr_value );
391  curr_value = std::min( curr_value, MAX_SCALE );
392 
393  textCtrl->SetValue( formatScaleValue( curr_value ) );
394 }
395 
396 
397 void PANEL_PREV_3D::onMouseWheelRot( wxMouseEvent& event )
398 {
399  wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
400 
401  double step = ROTATION_INCREMENT_WHEEL;
402 
403  if( event.ShiftDown( ) )
405 
406  if( event.GetWheelRotation() >= 0 )
407  step = -step;
408 
409  double curr_value = DoubleValueFromString( EDA_UNITS::DEGREES, textCtrl->GetValue() ) / 10.0;
410 
411  curr_value += step;
412  curr_value = std::max( -MAX_ROTATION, curr_value );
413  curr_value = std::min( curr_value, MAX_ROTATION );
414 
415  textCtrl->SetValue( formatRotationValue( curr_value ) );
416 }
417 
418 
419 void PANEL_PREV_3D::onMouseWheelOffset( wxMouseEvent& event )
420 {
421  wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
422 
423  double step = OFFSET_INCREMENT_MM;
424 
425  if( event.ShiftDown( ) )
427 
429  {
430  step = OFFSET_INCREMENT_MIL/1000.0;
431 
432  if( event.ShiftDown( ) )
433  step = OFFSET_INCREMENT_MIL_FINE/1000.0;
434  }
435 
436  if( event.GetWheelRotation() >= 0 )
437  step = -step;
438 
439  double curr_value = DoubleValueFromString( m_userUnits, textCtrl->GetValue() ) / IU_PER_MM;
440 
441  curr_value += step;
442  curr_value = std::max( -MAX_OFFSET, curr_value );
443  curr_value = std::min( curr_value, MAX_OFFSET );
444 
445  textCtrl->SetValue( formatOffsetValue( curr_value ) );
446 }
447 
448 
449 void PANEL_PREV_3D::UpdateDummyFootprint( bool aReloadRequired )
450 {
451  m_dummyFootprint->Models().clear();
452 
453  for( FP_3DMODEL& model : *m_parentModelList )
454  {
455  if( model.m_Show )
456  m_dummyFootprint->Models().push_back( model );
457  }
458 
459  if( aReloadRequired )
461 
463 }
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
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.
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:410
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
wxBitmapButton * m_bpvRight
wxString formatOffsetValue(double aValue)
FOOTPRINT * m_dummyFootprint
void doIncrementOffset(wxSpinEvent &aEvent, double aSign)
Master controller class:
Definition: tool_manager.h:52
#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.
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
#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
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:104
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
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:73
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
#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:293
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
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