KiCad PCB EDA Suite
panel_preview_3d_model.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 <[email protected]>
5 * Copyright (C) 2015 Cirilo Bernardo <[email protected]>
6 * Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
7 * Copyright (C) 2015-2022 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
29#include <tool/tool_manager.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>
41#include <widgets/wx_infobar.h>
44
46 FOOTPRINT* aFootprint,
47 std::vector<FP_3DMODEL>* aParentModelList ) :
48 PANEL_PREVIEW_3D_MODEL_BASE( aParent, wxID_ANY ),
49 m_previewPane( nullptr ),
50 m_infobar( nullptr ),
51 m_boardAdapter(),
52 m_currentCamera( m_trackBallCamera ),
53 m_trackBallCamera( 2 * RANGE_SCALE_3D ),
54 m_boardThickness( aFrame, nullptr, m_boardThicknessCtrl, m_boardThicknessUnits )
55{
56 m_userUnits = aFrame->GetUserUnits();
57
58 m_dummyBoard = new BOARD();
59 m_dummyBoard->SetProject( &aFrame->Prj(), true );
60
61 // This board will only be used to hold a footprint for viewing
63
64 BOARD_DESIGN_SETTINGS parent_bds = aFrame->GetDesignSettings();
66 dummy_bds.SetBoardThickness( parent_bds.GetBoardThickness() );
68 dummy_board_stackup.RemoveAll();
69 dummy_board_stackup.BuildDefaultStackupList( &dummy_bds, 2 );
70
71 m_selected = -1;
72
73 // Set the bitmap of 3D view buttons:
74 m_bpvTop->SetBitmap( KiBitmap( BITMAPS::axis3d_top ) );
80 m_bpvISO->SetBitmap( KiBitmap( BITMAPS::ortho ) );
81 m_bpUpdate->SetBitmap( KiBitmap( BITMAPS::reload ) );
82
83 // Set the min and max values of spin buttons (mandatory on Linux)
84 // They are not used, so they are set to min and max 32 bits int values
85 // (the min and max values supported by a wxSpinButton)
86 // It avoids blocking the up or down arrows when reaching this limit after
87 // a few clicks.
88 wxSpinButton* spinButtonList[] =
89 {
93 };
94
95 for( wxSpinButton* button : spinButtonList )
96 button->SetRange(INT_MIN, INT_MAX );
97
98 m_parentModelList = aParentModelList;
99
100 m_dummyFootprint = new FOOTPRINT( *aFootprint );
103
104 // Create the 3D canvas
105 m_previewPane = new EDA_3D_CANVAS( this,
108 aFrame->Prj().Get3DCacheManager() );
109
112 m_boardAdapter.m_IsPreviewer = true; // Force display 3D models, regardless the 3D viewer options
113
114 loadSettings();
115
116 // Create the manager
118 m_toolManager->SetEnvironment( m_dummyBoard, nullptr, nullptr, nullptr, this );
119
123
124 // Register tools
127
128 // Run the viewer control tool, it is supposed to be always active
129 m_toolManager->InvokeTool( "3DViewer.Control" );
130
131 m_infobar = new WX_INFOBAR( this );
133
134 m_SizerPanelView->Add( m_infobar, 0, wxEXPAND, 0 );
135 m_SizerPanelView->Add( m_previewPane, 1, wxEXPAND, 5 );
136
137 for( wxEventType eventType : { wxEVT_MENU_OPEN, wxEVT_MENU_CLOSE, wxEVT_MENU_HIGHLIGHT } )
138 {
139 Connect( eventType, wxMenuEventHandler( PANEL_PREVIEW_3D_MODEL::OnMenuEvent ), nullptr,
140 this );
141 }
142
143#ifdef __WXOSX__
144 // Call layout once to get the proper button sizes after the bitmaps have been set
145 Layout();
146
147 // The rounded-button style used has a small border on the left/right sides.
148 // This is automatically fixed in wx for buttons with a bitmap < 20, but not
149 // when the bitmap is set to be 26x26.
150 wxSize borderFix = wxSize( 4, 4 );
151
152 m_bpvTop->SetMinSize( m_bpvTop->GetSize() + borderFix );
153 m_bpvFront->SetMinSize( m_bpvFront->GetSize() + borderFix );
154 m_bpvBack->SetMinSize( m_bpvBack->GetSize() + borderFix );
155 m_bpvLeft->SetMinSize( m_bpvLeft->GetSize() + borderFix );
156 m_bpvRight->SetMinSize( m_bpvRight->GetSize() + borderFix );
157 m_bpvBottom->SetMinSize( m_bpvBottom->GetSize() + borderFix );
158 m_bpvISO->SetMinSize( m_bpvISO->GetSize() + borderFix );
159 m_bpUpdate->SetMinSize( m_bpUpdate->GetSize() + borderFix );
160#endif
161}
162
163
165{
166 delete m_dummyBoard;
167 delete m_previewPane;
168}
169
170
171void PANEL_PREVIEW_3D_MODEL::OnMenuEvent( wxMenuEvent& aEvent )
172{
173 if( !m_toolDispatcher )
174 aEvent.Skip();
175 else
177}
178
179
181{
182 wxCHECK_RET( m_previewPane, wxT( "Cannot load settings to null canvas" ) );
183
184 COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
185
186 const DPI_SCALING dpi{ settings, this };
187 m_previewPane->SetScaleFactor( dpi.GetScaleFactor() );
188
189 // TODO(JE) use all control options
191
192 COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings();
193
194 if( colors )
195 {
196 auto set =
197 [] ( const COLOR4D& aColor, SFVEC4F& aTarget )
198 {
199 aTarget.r = aColor.r;
200 aTarget.g = aColor.g;
201 aTarget.b = aColor.b;
202 aTarget.a = aColor.a;
203 };
204
214 }
215
216 EDA_3D_VIEWER_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
217
218 if( cfg )
219 {
220 m_boardAdapter.m_Cfg = cfg;
221
225 }
226}
227
228
234static double rotationFromString( const wxString& aValue )
235{
237
238 if( rotation > MAX_ROTATION )
239 {
240 int n = KiROUND( rotation / MAX_ROTATION );
241 rotation -= MAX_ROTATION * n;
242 }
243 else if( rotation < -MAX_ROTATION )
244 {
245 int n = KiROUND( -rotation / MAX_ROTATION );
246 rotation += MAX_ROTATION * n;
247 }
248
249 return rotation;
250}
251
252
254{
255 return wxString::Format( wxT( "%.4f" ),
256 aValue );
257}
258
259
261{
262 return wxString::Format( wxT( "%.2f%s" ),
263 aValue,
265}
266
267
269{
270 // Convert from internal units (mm) to user units
272 aValue /= 25.4;
273 else if( m_userUnits == EDA_UNITS::MILS )
274 aValue /= 25.4 / 1e3;
275
276 return wxString::Format( wxT( "%.6f%s" ),
277 aValue,
279}
280
281
283{
284 if( m_parentModelList && idx >= 0 && idx < (int) m_parentModelList->size() )
285 {
286 m_selected = idx;
287 const FP_3DMODEL& modelInfo = m_parentModelList->at( (unsigned) m_selected );
288
289 // Use ChangeValue() instead of SetValue(). It's not the user making the change, so we
290 // don't want to generate wxEVT_GRID_CELL_CHANGED events.
291 xscale->ChangeValue( formatScaleValue( modelInfo.m_Scale.x ) );
292 yscale->ChangeValue( formatScaleValue( modelInfo.m_Scale.y ) );
293 zscale->ChangeValue( formatScaleValue( modelInfo.m_Scale.z ) );
294
295 xrot->ChangeValue( formatRotationValue( modelInfo.m_Rotation.x ) );
296 yrot->ChangeValue( formatRotationValue( modelInfo.m_Rotation.y ) );
297 zrot->ChangeValue( formatRotationValue( modelInfo.m_Rotation.z ) );
298
299 xoff->ChangeValue( formatOffsetValue( modelInfo.m_Offset.x ) );
300 yoff->ChangeValue( formatOffsetValue( modelInfo.m_Offset.y ) );
301 zoff->ChangeValue( formatOffsetValue( modelInfo.m_Offset.z ) );
302
303 m_opacity->SetValue( modelInfo.m_Opacity * 100.0 );
304 }
305 else
306 {
307 m_selected = -1;
308
309 xscale->ChangeValue( wxEmptyString );
310 yscale->ChangeValue( wxEmptyString );
311 zscale->ChangeValue( wxEmptyString );
312
313 xrot->ChangeValue( wxEmptyString );
314 yrot->ChangeValue( wxEmptyString );
315 zrot->ChangeValue( wxEmptyString );
316
317 xoff->ChangeValue( wxEmptyString );
318 yoff->ChangeValue( wxEmptyString );
319 zoff->ChangeValue( wxEmptyString );
320
321 m_opacity->SetValue( 100 );
322 }
323
326}
327
328
329void PANEL_PREVIEW_3D_MODEL::updateOrientation( wxCommandEvent &event )
330{
331 if( m_parentModelList && m_selected >= 0 && m_selected < (int) m_parentModelList->size() )
332 {
333 // Write settings back to the parent
334 FP_3DMODEL* modelInfo = &m_parentModelList->at( (unsigned) m_selected );
335
337 pcbIUScale, EDA_UNITS::UNSCALED, xscale->GetValue() );
339 pcbIUScale, EDA_UNITS::UNSCALED, yscale->GetValue() );
341 pcbIUScale, EDA_UNITS::UNSCALED, zscale->GetValue() );
342
343 modelInfo->m_Rotation.x = rotationFromString( xrot->GetValue() );
344 modelInfo->m_Rotation.y = rotationFromString( yrot->GetValue() );
345 modelInfo->m_Rotation.z = rotationFromString( zrot->GetValue() );
346
348 xoff->GetValue() )
351 yoff->GetValue() )
354 zoff->GetValue() )
356
357 // Update the dummy footprint for the preview
358 UpdateDummyFootprint( false );
359 }
360}
361
362
363void PANEL_PREVIEW_3D_MODEL::onOpacitySlider( wxCommandEvent& event )
364{
365 if( m_parentModelList && m_selected >= 0 && m_selected < (int) m_parentModelList->size() )
366 {
367 // Write settings back to the parent
368 FP_3DMODEL* modelInfo = &m_parentModelList->at( (unsigned) m_selected );
369
370 modelInfo->m_Opacity = m_opacity->GetValue() / 100.0;
371
372 // Update the dummy footprint for the preview
373 UpdateDummyFootprint( false );
374 }
375}
376
377
379{
382
384 dummy_board_stackup.RemoveAll();
385 dummy_board_stackup.BuildDefaultStackupList( &dummy_bds, 2 );
386
387 UpdateDummyFootprint( true );
388}
389
390
391void PANEL_PREVIEW_3D_MODEL::doIncrementScale( wxSpinEvent& event, double aSign )
392{
393 wxSpinButton* spinCtrl = (wxSpinButton*) event.GetEventObject();
394
395 wxTextCtrl * textCtrl = xscale;
396
397 if( spinCtrl == m_spinYscale )
398 textCtrl = yscale;
399 else if( spinCtrl == m_spinZscale )
400 textCtrl = zscale;
401
403 textCtrl->GetValue() );
404
405 curr_value += ( SCALE_INCREMENT * aSign );
406 curr_value = std::max( 1/MAX_SCALE, curr_value );
407 curr_value = std::min( curr_value, MAX_SCALE );
408
409 textCtrl->SetValue( formatScaleValue( curr_value ) );
410}
411
412
413void PANEL_PREVIEW_3D_MODEL::doIncrementRotation( wxSpinEvent& aEvent, double aSign )
414{
415 wxSpinButton* spinCtrl = (wxSpinButton*) aEvent.GetEventObject();
416 wxTextCtrl* textCtrl = xrot;
417
418 if( spinCtrl == m_spinYrot )
419 textCtrl = yrot;
420 else if( spinCtrl == m_spinZrot )
421 textCtrl = zrot;
422
424 textCtrl->GetValue() );
425
426 curr_value += ( ROTATION_INCREMENT * aSign );
427 curr_value = std::max( -MAX_ROTATION, curr_value );
428 curr_value = std::min( curr_value, MAX_ROTATION );
429
430 textCtrl->SetValue( formatRotationValue( curr_value ) );
431}
432
433
434void PANEL_PREVIEW_3D_MODEL::doIncrementOffset( wxSpinEvent& event, double aSign )
435{
436 wxSpinButton* spinCtrl = (wxSpinButton*) event.GetEventObject();
437
438 wxTextCtrl * textCtrl = xoff;
439
440 if( spinCtrl == m_spinYoffset )
441 textCtrl = yoff;
442 else if( spinCtrl == m_spinZoffset )
443 textCtrl = zoff;
444
445 double step_mm = OFFSET_INCREMENT_MM;
446 double curr_value_mm =
449
451 {
452 step_mm = 25.4*OFFSET_INCREMENT_MIL/1000;
453 }
454
455 curr_value_mm += ( step_mm * aSign );
456 curr_value_mm = std::max( -MAX_OFFSET, curr_value_mm );
457 curr_value_mm = std::min( curr_value_mm, MAX_OFFSET );
458
459 textCtrl->SetValue( formatOffsetValue( curr_value_mm ) );
460}
461
462
464{
465 wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
466
467 double step = SCALE_INCREMENT;
468
469 if( event.ShiftDown( ) )
471
472 if( event.GetWheelRotation() >= 0 )
473 step = -step;
474
476 textCtrl->GetValue() );
477
478 curr_value += step;
479 curr_value = std::max( 1/MAX_SCALE, curr_value );
480 curr_value = std::min( curr_value, MAX_SCALE );
481
482 textCtrl->SetValue( formatScaleValue( curr_value ) );
483}
484
485
487{
488 wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
489
490 double step = ROTATION_INCREMENT_WHEEL;
491
492 if( event.ShiftDown( ) )
494
495 if( event.GetWheelRotation() >= 0 )
496 step = -step;
497
499 textCtrl->GetValue() );
500
501 curr_value += step;
502 curr_value = std::max( -MAX_ROTATION, curr_value );
503 curr_value = std::min( curr_value, MAX_ROTATION );
504
505 textCtrl->SetValue( formatRotationValue( curr_value ) );
506}
507
508
510{
511 wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
512
513 double step_mm = OFFSET_INCREMENT_MM;
514
515 if( event.ShiftDown( ) )
516 step_mm = OFFSET_INCREMENT_MM_FINE;
517
519 {
520 step_mm = 25.4*OFFSET_INCREMENT_MIL/1000.0;
521
522 if( event.ShiftDown( ) )
523 step_mm = 25.4*OFFSET_INCREMENT_MIL_FINE/1000.0;
524 }
525
526 if( event.GetWheelRotation() >= 0 )
527 step_mm = -step_mm;
528
530 textCtrl->GetValue() )
532
533 curr_value_mm += step_mm;
534 curr_value_mm = std::max( -MAX_OFFSET, curr_value_mm );
535 curr_value_mm = std::min( curr_value_mm, MAX_OFFSET );
536
537 textCtrl->SetValue( formatOffsetValue( curr_value_mm ) );
538}
539
540
542{
543 m_dummyFootprint->Models().clear();
544
545 for( FP_3DMODEL& model : *m_parentModelList )
546 {
547 if( model.m_Show )
548 m_dummyFootprint->Models().push_back( model );
549 }
550
551 if( aReloadRequired )
553
555}
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:109
constexpr EDA_IU_SCALE unityScale
Definition: base_units.h:112
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:105
@ axis3d_bottom
@ axis3d_front
@ axis3d_right
#define RANGE_SCALE_3D
This defines the range that all coord will have to be rendered.
Definition: board_adapter.h:62
SFVEC4F m_BgColorTop
background top color
SFVEC4F m_SolderPasteColor
in realistic mode: solder paste color
SFVEC4F m_SolderMaskColorBot
in realistic mode: solder mask color ( bot )
bool m_IsPreviewer
true if the board adaptater is living in a 3D preview panel, false for the standard 3D viewer
SFVEC4F m_SolderMaskColorTop
in realistic mode: solder mask color ( top )
SFVEC4F m_CopperColor
in realistic mode: copper color
void SetBoard(BOARD *aBoard) noexcept
Set current board to be rendered.
EDA_3D_VIEWER_SETTINGS * m_Cfg
SFVEC4F m_SilkScreenColorTop
in realistic mode: SilkScreen color ( top )
SFVEC4F m_SilkScreenColorBot
in realistic mode: SilkScreen color ( bot )
SFVEC4F m_BoardBodyColor
in realistic mode: FR4 board color
bool m_MousewheelPanning
SFVEC4F m_BgColorBot
background bottom color
Container for design settings for a BOARD object.
int GetBoardThickness() const
The full thickness of the board including copper and masks.
BOARD_STACKUP & GetStackupDescriptor()
void SetBoardThickness(int aThickness)
void SetParentGroup(PCB_GROUP *aGroup)
Definition: board_item.h:71
Manage layers needed to make a physical board.
void RemoveAll()
Delete all items in list and clear the list.
void BuildDefaultStackupList(const BOARD_DESIGN_SETTINGS *aSettings, int aActiveCopperLayersCount=0)
Create a default stackup, according to the current BOARD_DESIGN_SETTINGS settings.
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:265
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
Definition: board.cpp:750
void SetBoardUse(BOARD_USE aUse)
Set what the board is going to be used for.
Definition: board.h:277
void SetProject(PROJECT *aProject, bool aReferenceOnly=false)
Link a board to a given project.
Definition: board.cpp:172
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:682
Color settings are a bit different than most of the settings objects in that there can be more than o...
COLOR4D GetColor(int aLayer) const
Class to handle configuration and automatic determination of the DPI scale to use for canvases.
Definition: dpi_scaling.h:37
EDA_3D_ACTIONS.
Implement a canvas based on a wxGLCanvas.
Definition: eda_3d_canvas.h:49
void SetProjectionMode(int aMode)
void SetInfoBar(WX_INFOBAR *aInfoBar)
Definition: eda_3d_canvas.h:79
void SetAnimationEnabled(bool aEnable)
Enable or disable camera animation when switching to a pre-defined view.
void SetEventDispatcher(TOOL_DISPATCHER *aEventDispatcher)
Set a dispatcher that processes events and forwards them to tools.
void ReloadRequest(BOARD *aBoard=nullptr, S3D_CACHE *aCachePointer=nullptr)
void SetMovingSpeedMultiplier(int aMultiplier)
Set the camera animation moving speed multiplier option.
void Request_refresh(bool aRedrawImmediately=true)
Schedule a refresh update of the canvas.
EDA_3D_CONTROLLER.
std::vector< FP_3DMODEL > & Models()
Definition: footprint.h:184
VECTOR3D m_Offset
3D model offset (mm)
Definition: footprint.h:93
double m_Opacity
Definition: footprint.h:94
VECTOR3D m_Rotation
3D model rotation (degrees)
Definition: footprint.h:92
VECTOR3D m_Scale
3D model scaling factor (dimensionless)
Definition: footprint.h:91
void SetScaleFactor(double aFactor)
Set the canvas scale factor, probably for a hi-DPI display.
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
double r
Red component.
Definition: color4d.h:390
double g
Green component.
Definition: color4d.h:391
double a
Alpha component.
Definition: color4d.h:393
double b
Blue component.
Definition: color4d.h:392
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
static const int * GetAttributesList(ANTIALIASING_MODE aAntiAliasingMode)
Get a list of attributes to pass to wxGLCanvas.
Class PANEL_PREVIEW_3D_MODEL_BASE.
wxString formatOffsetValue(double aValue)
void onMouseWheelRot(wxMouseEvent &event) override
void onOpacitySlider(wxCommandEvent &event) override
void onMouseWheelScale(wxMouseEvent &event) override
void UpdateDummyFootprint(bool aRelaodRequired=true)
Copy shapes from the current shape list which are flagged for preview to the copy of footprint that i...
wxString formatScaleValue(double aValue)
UNIT_BINDER m_boardThickness
Index into m_parentInfoList.
void doIncrementRotation(wxSpinEvent &aEvent, double aSign)
void loadSettings()
Load 3D relevant settings from the user configuration.
void OnMenuEvent(wxMenuEvent &aEvent)
The TOOL_DISPATCHER needs these to work around some issues in wxWidgets where the menu events aren't ...
void doIncrementOffset(wxSpinEvent &aEvent, double aSign)
PANEL_PREVIEW_3D_MODEL(wxWindow *aParent, PCB_BASE_FRAME *aFrame, FOOTPRINT *aFootprint, std::vector< FP_3DMODEL > *aParentModelList)
void doIncrementScale(wxSpinEvent &aEvent, double aSign)
void updateOrientation(wxCommandEvent &event) override
It will receive the events from editing the fields.
wxString formatRotationValue(double aValue)
void onMouseWheelOffset(wxMouseEvent &event) override
void SetSelectedModel(int idx)
Set the currently selected index in the model list so that the scale/rotation/offset controls can be ...
void updateBoardThickness(wxCommandEvent &event) override
std::vector< FP_3DMODEL > * m_parentModelList
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Returns the BOARD_DESIGN_SETTINGS for the open project.
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:170
TOOL_DISPATCHER * m_toolDispatcher
Definition: tools_holder.h:172
ACTIONS * m_actions
Definition: tools_holder.h:171
virtual void DispatchWxEvent(wxEvent &aEvent)
Process wxEvents (mostly UI events), translate them to TOOL_EVENTs, and make tools handle those.
Master controller class:
Definition: tool_manager.h:55
bool InvokeTool(TOOL_ID aToolId)
Call a tool by sending a tool activation event to tool of given ID.
void RegisterTool(TOOL_BASE *aTool)
Add a tool to the manager set and sets it up.
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).
void InitTools()
Initializes all registered tools.
EDA_UNITS GetUserUnits() const
virtual long long int GetValue()
Return the current value in Internal Units.
virtual void ChangeValue(int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion WITHOUT trigger...
T y
Definition: vector3.h:62
T z
Definition: vector3.h:63
T x
Definition: vector3.h:61
A modified version of the wxInfoBar class that allows us to:
Definition: wx_infobar.h:75
@ LAYER_3D_SOLDERMASK_TOP
Definition: layer_ids.h:442
@ LAYER_3D_COPPER
Definition: layer_ids.h:438
@ LAYER_3D_BACKGROUND_TOP
Definition: layer_ids.h:436
@ LAYER_3D_SOLDERMASK_BOTTOM
Definition: layer_ids.h:441
@ LAYER_3D_BOARD
Definition: layer_ids.h:437
@ LAYER_3D_SILKSCREEN_TOP
Definition: layer_ids.h:440
@ LAYER_3D_SOLDERPASTE
Definition: layer_ids.h:443
@ LAYER_3D_BACKGROUND_BOTTOM
Definition: layer_ids.h:435
@ LAYER_3D_SILKSCREEN_BOTTOM
Definition: layer_ids.h:439
double DoubleValueFromString(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Function DoubleValueFromString converts aTextValue to a double.
Definition: eda_units.cpp:456
wxString GetText(EDA_UNITS aUnits, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Get the units string for a given units type.
Definition: eda_units.cpp:98
Declaration of the cogl_att_list class.
static double rotationFromString(const wxString &aValue)
Ensure -MAX_ROTATION <= rotation <= MAX_ROTATION.
#define MAX_SCALE
#define MAX_ROTATION
#define MAX_OFFSET
#define OFFSET_INCREMENT_MM_FINE
#define OFFSET_INCREMENT_MIL
#define ROTATION_INCREMENT_WHEEL_FINE
#define ROTATION_INCREMENT_WHEEL
#define SCALE_INCREMENT
#define OFFSET_INCREMENT_MM
#define ROTATION_INCREMENT
#define OFFSET_INCREMENT_MIL_FINE
#define SCALE_INCREMENT_FINE
see class PGM_BASE
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
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:111
const double IU_PER_MM
Definition: base_units.h:77
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:85
glm::vec4 SFVEC4F
Definition: xv3d_types.h:46