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/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, aFrame->GetIuScale(), 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 );
102
103 // Create the 3D canvas
104 m_previewPane = new EDA_3D_CANVAS( this,
107 aFrame->Prj().Get3DCacheManager() );
108
111 m_boardAdapter.m_IsPreviewer = true; // Force display 3D models, regardless the 3D viewer options
112
113 loadSettings();
114
115 // Create the manager
117 m_toolManager->SetEnvironment( m_dummyBoard, nullptr, nullptr, nullptr, this );
118
122
123 // Register tools
126
127 // Run the viewer control tool, it is supposed to be always active
128 m_toolManager->InvokeTool( "3DViewer.Control" );
129
130 m_infobar = new WX_INFOBAR( this );
132
133 m_SizerPanelView->Add( m_infobar, 0, wxEXPAND, 0 );
134 m_SizerPanelView->Add( m_previewPane, 1, wxEXPAND, 5 );
135
136 for( wxEventType eventType : { wxEVT_MENU_OPEN, wxEVT_MENU_CLOSE, wxEVT_MENU_HIGHLIGHT } )
137 {
138 Connect( eventType, wxMenuEventHandler( PANEL_PREVIEW_3D_MODEL::OnMenuEvent ), nullptr,
139 this );
140 }
141
142#ifdef __WXOSX__
143 // Call layout once to get the proper button sizes after the bitmaps have been set
144 Layout();
145
146 // The rounded-button style used has a small border on the left/right sides.
147 // This is automatically fixed in wx for buttons with a bitmap < 20, but not
148 // when the bitmap is set to be 26x26.
149 wxSize borderFix = wxSize( 4, 4 );
150
151 m_bpvTop->SetMinSize( m_bpvTop->GetSize() + borderFix );
152 m_bpvFront->SetMinSize( m_bpvFront->GetSize() + borderFix );
153 m_bpvBack->SetMinSize( m_bpvBack->GetSize() + borderFix );
154 m_bpvLeft->SetMinSize( m_bpvLeft->GetSize() + borderFix );
155 m_bpvRight->SetMinSize( m_bpvRight->GetSize() + borderFix );
156 m_bpvBottom->SetMinSize( m_bpvBottom->GetSize() + borderFix );
157 m_bpvISO->SetMinSize( m_bpvISO->GetSize() + borderFix );
158 m_bpUpdate->SetMinSize( m_bpUpdate->GetSize() + borderFix );
159#endif
160}
161
162
164{
165 delete m_dummyBoard;
166 delete m_previewPane;
167}
168
169
170void PANEL_PREVIEW_3D_MODEL::OnMenuEvent( wxMenuEvent& aEvent )
171{
172 if( !m_toolDispatcher )
173 aEvent.Skip();
174 else
176}
177
178
180{
181 wxCHECK_RET( m_previewPane, wxT( "Cannot load settings to null canvas" ) );
182
183 COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
184
185 const DPI_SCALING dpi{ settings, this };
186 m_previewPane->SetScaleFactor( dpi.GetScaleFactor() );
187
188 // TODO(JE) use all control options
190
191 COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings();
192
193 if( colors )
194 {
195 auto set =
196 [] ( const COLOR4D& aColor, SFVEC4F& aTarget )
197 {
198 aTarget.r = aColor.r;
199 aTarget.g = aColor.g;
200 aTarget.b = aColor.b;
201 aTarget.a = aColor.a;
202 };
203
213 }
214
215 EDA_3D_VIEWER_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
216
217 if( cfg )
218 {
219 m_boardAdapter.m_Cfg = cfg;
220
224 }
225}
226
227
233static double rotationFromString( const wxString& aValue )
234{
236
237 if( rotation > MAX_ROTATION )
238 {
239 int n = KiROUND( rotation / MAX_ROTATION );
240 rotation -= MAX_ROTATION * n;
241 }
242 else if( rotation < -MAX_ROTATION )
243 {
244 int n = KiROUND( -rotation / MAX_ROTATION );
245 rotation += MAX_ROTATION * n;
246 }
247
248 return rotation;
249}
250
251
253{
254 return wxString::Format( wxT( "%.4f" ),
255 aValue );
256}
257
258
260{
261 return wxString::Format( wxT( "%.2f%s" ),
262 aValue,
264}
265
266
268{
269 // Convert from internal units (mm) to user units
271 aValue /= 25.4;
272 else if( m_userUnits == EDA_UNITS::MILS )
273 aValue /= 25.4 / 1e3;
274
275 return wxString::Format( wxT( "%.6f%s" ),
276 aValue,
278}
279
280
282{
283 if( m_parentModelList && idx >= 0 && idx < (int) m_parentModelList->size() )
284 {
285 m_selected = idx;
286 const FP_3DMODEL& modelInfo = m_parentModelList->at( (unsigned) m_selected );
287
288 // Use ChangeValue() instead of SetValue(). It's not the user making the change, so we
289 // don't want to generate wxEVT_GRID_CELL_CHANGED events.
290 xscale->ChangeValue( formatScaleValue( modelInfo.m_Scale.x ) );
291 yscale->ChangeValue( formatScaleValue( modelInfo.m_Scale.y ) );
292 zscale->ChangeValue( formatScaleValue( modelInfo.m_Scale.z ) );
293
294 xrot->ChangeValue( formatRotationValue( modelInfo.m_Rotation.x ) );
295 yrot->ChangeValue( formatRotationValue( modelInfo.m_Rotation.y ) );
296 zrot->ChangeValue( formatRotationValue( modelInfo.m_Rotation.z ) );
297
298 xoff->ChangeValue( formatOffsetValue( modelInfo.m_Offset.x ) );
299 yoff->ChangeValue( formatOffsetValue( modelInfo.m_Offset.y ) );
300 zoff->ChangeValue( formatOffsetValue( modelInfo.m_Offset.z ) );
301
302 m_opacity->SetValue( modelInfo.m_Opacity * 100.0 );
303 }
304 else
305 {
306 m_selected = -1;
307
308 xscale->ChangeValue( wxEmptyString );
309 yscale->ChangeValue( wxEmptyString );
310 zscale->ChangeValue( wxEmptyString );
311
312 xrot->ChangeValue( wxEmptyString );
313 yrot->ChangeValue( wxEmptyString );
314 zrot->ChangeValue( wxEmptyString );
315
316 xoff->ChangeValue( wxEmptyString );
317 yoff->ChangeValue( wxEmptyString );
318 zoff->ChangeValue( wxEmptyString );
319
320 m_opacity->SetValue( 100 );
321 }
322
325}
326
327
328void PANEL_PREVIEW_3D_MODEL::updateOrientation( wxCommandEvent &event )
329{
330 if( m_parentModelList && m_selected >= 0 && m_selected < (int) m_parentModelList->size() )
331 {
332 // Write settings back to the parent
333 FP_3DMODEL* modelInfo = &m_parentModelList->at( (unsigned) m_selected );
334
336 pcbIUScale, EDA_UNITS::UNSCALED, xscale->GetValue() );
338 pcbIUScale, EDA_UNITS::UNSCALED, yscale->GetValue() );
340 pcbIUScale, EDA_UNITS::UNSCALED, zscale->GetValue() );
341
342 modelInfo->m_Rotation.x = rotationFromString( xrot->GetValue() );
343 modelInfo->m_Rotation.y = rotationFromString( yrot->GetValue() );
344 modelInfo->m_Rotation.z = rotationFromString( zrot->GetValue() );
345
347 xoff->GetValue() )
350 yoff->GetValue() )
353 zoff->GetValue() )
355
356 // Update the dummy footprint for the preview
357 UpdateDummyFootprint( false );
358 }
359}
360
361
362void PANEL_PREVIEW_3D_MODEL::onOpacitySlider( wxCommandEvent& event )
363{
364 if( m_parentModelList && m_selected >= 0 && m_selected < (int) m_parentModelList->size() )
365 {
366 // Write settings back to the parent
367 FP_3DMODEL* modelInfo = &m_parentModelList->at( (unsigned) m_selected );
368
369 modelInfo->m_Opacity = m_opacity->GetValue() / 100.0;
370
371 // Update the dummy footprint for the preview
372 UpdateDummyFootprint( false );
373 }
374}
375
376
378{
381
383 dummy_board_stackup.RemoveAll();
384 dummy_board_stackup.BuildDefaultStackupList( &dummy_bds, 2 );
385
386 UpdateDummyFootprint( true );
387}
388
389
390void PANEL_PREVIEW_3D_MODEL::doIncrementScale( wxSpinEvent& event, double aSign )
391{
392 wxSpinButton* spinCtrl = (wxSpinButton*) event.GetEventObject();
393
394 wxTextCtrl * textCtrl = xscale;
395
396 if( spinCtrl == m_spinYscale )
397 textCtrl = yscale;
398 else if( spinCtrl == m_spinZscale )
399 textCtrl = zscale;
400
402 textCtrl->GetValue() );
403
404 curr_value += ( SCALE_INCREMENT * aSign );
405 curr_value = std::max( 1/MAX_SCALE, curr_value );
406 curr_value = std::min( curr_value, MAX_SCALE );
407
408 textCtrl->SetValue( formatScaleValue( curr_value ) );
409}
410
411
412void PANEL_PREVIEW_3D_MODEL::doIncrementRotation( wxSpinEvent& aEvent, double aSign )
413{
414 wxSpinButton* spinCtrl = (wxSpinButton*) aEvent.GetEventObject();
415 wxTextCtrl* textCtrl = xrot;
416
417 if( spinCtrl == m_spinYrot )
418 textCtrl = yrot;
419 else if( spinCtrl == m_spinZrot )
420 textCtrl = zrot;
421
423 textCtrl->GetValue() );
424
425 curr_value += ( ROTATION_INCREMENT * aSign );
426 curr_value = std::max( -MAX_ROTATION, curr_value );
427 curr_value = std::min( curr_value, MAX_ROTATION );
428
429 textCtrl->SetValue( formatRotationValue( curr_value ) );
430}
431
432
433void PANEL_PREVIEW_3D_MODEL::doIncrementOffset( wxSpinEvent& event, double aSign )
434{
435 wxSpinButton* spinCtrl = (wxSpinButton*) event.GetEventObject();
436
437 wxTextCtrl * textCtrl = xoff;
438
439 if( spinCtrl == m_spinYoffset )
440 textCtrl = yoff;
441 else if( spinCtrl == m_spinZoffset )
442 textCtrl = zoff;
443
444 double step_mm = OFFSET_INCREMENT_MM;
445 double curr_value_mm =
448
450 {
451 step_mm = 25.4*OFFSET_INCREMENT_MIL/1000;
452 }
453
454 curr_value_mm += ( step_mm * aSign );
455 curr_value_mm = std::max( -MAX_OFFSET, curr_value_mm );
456 curr_value_mm = std::min( curr_value_mm, MAX_OFFSET );
457
458 textCtrl->SetValue( formatOffsetValue( curr_value_mm ) );
459}
460
461
463{
464 wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
465
466 double step = SCALE_INCREMENT;
467
468 if( event.ShiftDown( ) )
470
471 if( event.GetWheelRotation() >= 0 )
472 step = -step;
473
475 textCtrl->GetValue() );
476
477 curr_value += step;
478 curr_value = std::max( 1/MAX_SCALE, curr_value );
479 curr_value = std::min( curr_value, MAX_SCALE );
480
481 textCtrl->SetValue( formatScaleValue( curr_value ) );
482}
483
484
486{
487 wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
488
489 double step = ROTATION_INCREMENT_WHEEL;
490
491 if( event.ShiftDown( ) )
493
494 if( event.GetWheelRotation() >= 0 )
495 step = -step;
496
498 textCtrl->GetValue() );
499
500 curr_value += step;
501 curr_value = std::max( -MAX_ROTATION, curr_value );
502 curr_value = std::min( curr_value, MAX_ROTATION );
503
504 textCtrl->SetValue( formatRotationValue( curr_value ) );
505}
506
507
509{
510 wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
511
512 double step_mm = OFFSET_INCREMENT_MM;
513
514 if( event.ShiftDown( ) )
515 step_mm = OFFSET_INCREMENT_MM_FINE;
516
518 {
519 step_mm = 25.4*OFFSET_INCREMENT_MIL/1000.0;
520
521 if( event.ShiftDown( ) )
522 step_mm = 25.4*OFFSET_INCREMENT_MIL_FINE/1000.0;
523 }
524
525 if( event.GetWheelRotation() >= 0 )
526 step_mm = -step_mm;
527
529 textCtrl->GetValue() )
531
532 curr_value_mm += step_mm;
533 curr_value_mm = std::max( -MAX_OFFSET, curr_value_mm );
534 curr_value_mm = std::min( curr_value_mm, MAX_OFFSET );
535
536 textCtrl->SetValue( formatOffsetValue( curr_value_mm ) );
537}
538
539
541{
542 m_dummyFootprint->Models().clear();
543
544 for( FP_3DMODEL& model : *m_parentModelList )
545 {
546 if( model.m_Show )
547 m_dummyFootprint->Models().push_back( model );
548 }
549
550 if( aReloadRequired )
552
554}
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)
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:686
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:162
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:618
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:188
VECTOR3D m_Offset
3D model offset (mm)
Definition: footprint.h:97
double m_Opacity
Definition: footprint.h:98
VECTOR3D m_Rotation
3D model rotation (degrees)
Definition: footprint.h:96
VECTOR3D m_Scale
3D model scaling factor (dimensionless)
Definition: footprint.h:95
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:384
double g
Green component.
Definition: color4d.h:385
double a
Alpha component.
Definition: color4d.h:387
double b
Blue component.
Definition: color4d.h:386
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...
A modified version of the wxInfoBar class that allows us to:
Definition: 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:451
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:102
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:80
glm::vec4 SFVEC4F
Definition: xv3d_types.h:46