KiCad PCB EDA Suite
dialog_edit_footprint_for_fp_editor.cpp
Go to the documentation of this file.
1 
7 /*
8  * This program source code file is part of KiCad, a free EDA CAD application.
9  *
10  * Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
11  * Copyright (C) 2015 Dick Hollenbeck, dick@softplc.com
12  * Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
13  * Copyright (C) 2004-2018 KiCad Developers, see AUTHORS.txt for contributors.
14  *
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License
17  * as published by the Free Software Foundation; either version 2
18  * of the License, or (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with this program; if not, you may find one here:
27  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
28  * or you may search the http://www.gnu.org website for the version 2 license,
29  * or you may write to the Free Software Foundation, Inc.,
30  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
31  */
32 
33 
34 #include <fctsys.h>
35 #include <class_drawpanel.h>
36 #include <confirm.h>
37 #include <dialog_text_entry.h>
38 #include <pcbnew.h>
39 #include <kiface_i.h>
40 #include <gestfich.h>
41 #include <3d_viewer.h>
42 #include <pcb_edit_frame.h>
43 #include <base_units.h>
44 #include <macros.h>
45 #include <validators.h>
46 #include <kicad_string.h>
47 #include <board_commit.h>
48 #include <bitmaps.h>
49 #include <widgets/text_ctrl_eval.h>
50 
51 #include <class_module.h>
52 #include <class_text_mod.h>
53 #include <footprint_edit_frame.h>
56 #include <pgm_base.h>
59 #include "3d_cache/3d_cache.h"
61 
63 
64 size_t DIALOG_FOOTPRINT_FP_EDITOR::m_page = 0; // remember the last open page during session
65 
66 
68  MODULE* aModule ) :
70 {
71  m_parent = aParent;
72  m_currentModule = aModule;
73 
74  // Give an icon
75  wxIcon icon;
76  icon.CopyFromBitmap( KiBitmap( icon_modedit_xpm ) );
77  SetIcon( icon );
78 
79  aParent->Prj().Get3DCacheManager()->GetResolver()->SetProgramBase( &Pgm() );
80 
81  m_currentModuleCopy = new MODULE( *aModule );
82 
84  aParent->Prj().Get3DCacheManager(),
86  &aParent->Settings().Colors(),
87  &m_shapes3D_list );
88 
89  bLowerSizer3D->Add( m_PreviewPane, 1, wxEXPAND, 5 );
90 
93 
94  wxFont infoFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
95  infoFont.SetSymbolicSize( wxFONTSIZE_X_SMALL );
96  m_staticTextInfoValNeg->SetFont( infoFont );
97  m_staticTextInfoValPos->SetFont( infoFont );
98  m_staticTextInfo2->SetFont( infoFont );
99 
100  m_NoteBook->SetSelection( m_page );
101 
102  m_sdbSizerStdButtonsOK->SetDefault();
103 
104  Layout();
105 
106 }
107 
108 
110 {
111  m_shapes3D_list.clear();
112 
113  // free the memory used by all models, otherwise models which were
114  // browsed but not used would consume memory
115  Prj().Get3DCacheManager()->FlushCache( false );
116 
117  // the GL canvas has to be visible before it is destroyed
118  m_page = m_NoteBook->GetSelection();
119  m_NoteBook->SetSelection( 1 );
120 
121  delete m_referenceCopy;
122  m_referenceCopy = NULL; // just in case, to avoid double-free
123 
124  delete m_valueCopy;
125  m_valueCopy = NULL;
126 
127  delete m_PreviewPane;
128  m_PreviewPane = NULL; // just in case, to avoid double-free
129 
130  // this is already deleted by the board used on preview pane so
131  // no need to delete here
132  // delete m_currentModuleCopy;
133  // m_currentModuleCopy = NULL;
134 }
135 
136 
138 {
139  SetFocus();
140 
141  // Display the default path, given by environment variable KISYS3DMOD
142  wxString default_path;
143  wxGetEnv( KISYS3DMOD, &default_path );
144 
145 #ifdef __WINDOWS__
146  default_path.Replace( wxT( "/" ), wxT( "\\" ) );
147 #endif
148 
150 
151  // Init 3D shape list
152  m_3D_ShapeNameListBox->Clear();
153  auto sM = m_currentModule->Models().begin();
154  auto eM = m_currentModule->Models().end();
155  m_shapes3D_list.clear();
156 
157  wxString origPath;
158  wxString alias;
159  wxString shortPath;
160  S3D_FILENAME_RESOLVER* res = Prj().Get3DCacheManager()->GetResolver();
161 
162  while( sM != eM )
163  {
164  m_shapes3D_list.push_back( *sM );
165  origPath = sM->m_Filename;
166 
167  if( res && res->SplitAlias( origPath, alias, shortPath ) )
168  {
169  origPath = alias;
170  origPath.append( wxT( ":" ) );
171  origPath.append( shortPath );
172  }
173 
174  m_3D_ShapeNameListBox->Append( origPath );
175  ++sM;
176  }
177 
178  m_DocCtrl->SetValue( m_currentModule->GetDescription() );
179  m_KeywordCtrl->SetValue( m_currentModule->GetKeywords() );
184  m_ReferenceCtrl->SetValue( m_referenceCopy->GetText() );
185  m_ValueCtrl->SetValue( m_valueCopy->GetText() );
186 
190 
191  m_AttributsCtrl->SetItemToolTip( 0, _( "Use this attribute for most non SMD footprints" ) );
192  m_AttributsCtrl->SetItemToolTip( 1,
193  _( "Use this attribute for SMD footprints.\n"
194  "Only footprints with this option are put in the footprint position list file" ) );
195  m_AttributsCtrl->SetItemToolTip( 2,
196  _( "Use this attribute for \"virtual\" footprints drawn on board\n"
197  "like an edge connector (old ISA PC bus for instance)" ) );
198 
199  // Controls on right side of the dialog
200  switch( m_currentModule->GetAttributes() & 255 )
201  {
202  case 0:
203  m_AttributsCtrl->SetSelection( 0 );
204  break;
205 
206  case MOD_CMS:
207  m_AttributsCtrl->SetSelection( 1 );
208  break;
209 
210  case MOD_VIRTUAL:
211  m_AttributsCtrl->SetSelection( 2 );
212  break;
213 
214  default:
215  m_AttributsCtrl->SetSelection( 0 );
216  break;
217  }
218 
219  m_AutoPlaceCtrl->SetSelection( (m_currentModule->IsLocked()) ? 1 : 0 );
220  m_AutoPlaceCtrl->SetItemToolTip( 0, _( "Enable hotkey move commands and Auto Placement" ) );
221  m_AutoPlaceCtrl->SetItemToolTip( 1, _( "Disable hotkey move commands and Auto Placement" ) );
222 
225 
227  {
228  default:
230  m_ZoneConnectionChoice->SetSelection( 0 );
231  break;
232 
233  case PAD_ZONE_CONN_FULL:
234  m_ZoneConnectionChoice->SetSelection( 1 );
235  break;
236 
238  m_ZoneConnectionChoice->SetSelection( 2 );
239  break;
240 
241  case PAD_ZONE_CONN_NONE:
242  m_ZoneConnectionChoice->SetSelection( 3 );
243  break;
244  }
245 
246  // Initialize dialog relative to masks clearances
250 
251  wxString msg;
254 
255  // These 2 parameters are usually < 0, so prepare entering a negative value, if current is 0
257 
259  m_SolderPasteMarginCtrl->SetValue( wxT( "-" ) + m_SolderPasteMarginCtrl->GetValue() );
260 
262  msg.Printf( wxT( "-%f" ), m_currentModule->GetLocalSolderPasteMarginRatio() * 100.0 );
263  else
264  msg.Printf( wxT( "%f" ), m_currentModule->GetLocalSolderPasteMarginRatio() * 100.0 );
265 
267 
268  // Add solder paste margin ration in per cent
269  // for the usual default value 0.0, display -0.0 (or -0,0 in some countries)
270  msg.Printf( wxT( "%f" ), m_currentModule->GetLocalSolderPasteMarginRatio() * 100.0 );
271 
273  msg[0] == '0') // Sometimes Printf adds a sign if the value is very small (0.0)
274  m_SolderPasteMarginRatioCtrl->SetValue( wxT( "-" ) + msg );
275  else
277 
278  // if m_3D_ShapeNameListBox is not empty, preselect first 3D shape
279  if( m_3D_ShapeNameListBox->GetCount() > 0 )
280  {
283  if( m_PreviewPane )
285  }
286  else
287  {
288  if( m_PreviewPane )
289  m_PreviewPane->ResetModelData( true );
290  }
291 
292  // We have modified the UI, so call Fit() for m_Panel3D
293  // to be sure the m_Panel3D sizers are initialized before opening the dialog
294  m_Panel3D->GetSizer()->Fit( m_Panel3D );
295 }
296 
297 
299 {
301 
302  if( m_lastSelected3DShapeIndex < 0 ) // happens under wxGTK when deleting an item in m_3D_ShapeNameListBox wxListBox
303  {
304  if( m_PreviewPane )
306 
307  return;
308  }
309 
310  if( m_lastSelected3DShapeIndex >= (int)m_shapes3D_list.size() )
311  {
312  wxMessageBox( wxT( "On3DShapeNameSelected() error" ) );
314 
315  if( m_PreviewPane )
317 
318  return;
319  }
320 
322 }
323 
324 
325 void DIALOG_FOOTPRINT_FP_EDITOR::Remove3DShape( wxCommandEvent& event )
326 {
327  int ii = m_3D_ShapeNameListBox->GetSelection();
328 
329  if( ii < 0 )
330  {
331  if( m_PreviewPane )
332  m_PreviewPane->ResetModelData( true );
333 
334  return;
335  }
336 
337  m_shapes3D_list.erase( m_shapes3D_list.begin() + ii );
338  m_3D_ShapeNameListBox->Delete( ii );
339 
340  if( m_3D_ShapeNameListBox->GetCount() > 0 )
341  {
342  if( ii > 0 )
344  else
346 
348 
349  if( m_PreviewPane )
351  }
352  else
353  {
354  if( m_PreviewPane )
355  m_PreviewPane->ResetModelData( true );
356  }
357 
358  return;
359 }
360 
361 
363 {
364  int idx = m_3D_ShapeNameListBox->GetSelection();
365 
366  if( idx < 0 )
367  return;
368 
369  // Edit filename
370  wxString filename = m_3D_ShapeNameListBox->GetStringSelection();
371  WX_TEXT_ENTRY_DIALOG dlg( this, _( "Filepath:" ), _( "Edit 3D Shape Name" ), filename );
372 
373  bool hasAlias;
374  S3D_FILENAME_RESOLVER* res = Prj().Get3DCacheManager()->GetResolver();
375 
376  if( dlg.ShowModal() != wxID_OK )
377  return;
378 
379  filename = dlg.GetValue();
380 
381  if( filename.empty() )
382  return;
383 
384  if( !res->ValidateFileName( filename, hasAlias ) )
385  {
386  wxString msg = _( "Invalid filename: " );
387  msg.append( filename );
388  wxMessageBox( msg, _( "Edit 3D file name" ) );
389 
390  return;
391  }
392 
393  m_3D_ShapeNameListBox->SetString( idx, filename );
394 
395  // if the user has specified an alias in the name then prepend ':'
396  if( hasAlias )
397  filename.insert( 0, wxT( ":" ) );
398 
399  #ifdef __WINDOWS__
400  // In Kicad files, filenames and paths are stored using Unix notation
401  filename.Replace( wxT( "\\" ), wxT( "/" ) );
402  #endif
403 
404  m_shapes3D_list[idx].m_Filename = filename;
405 
406  // This assumes that the index didn't change and will just update the filename
407  if( m_PreviewPane )
408  m_PreviewPane->UpdateModelName( filename );
409 
410  return;
411 }
412 
413 
415 {
416  PROJECT& prj = Prj();
417  MODULE_3D_SETTINGS model;
418 
419  wxString initialpath = prj.GetRString( PROJECT::VIEWER_3D_PATH );
420  wxString sidx = prj.GetRString( PROJECT::VIEWER_3D_FILTER_INDEX );
421  int filter = 0;
422 
423  // If the PROJECT::VIEWER_3D_PATH hasn't been set yet, use the KISYS3DMOD environment
424  // varaible and fall back to the project path if necessary.
425  if( initialpath.IsEmpty() )
426  {
427  if( !wxGetEnv( "KISYS3DMOD", &initialpath ) || initialpath.IsEmpty() )
428  initialpath = prj.GetProjectPath();
429  }
430 
431  if( !sidx.empty() )
432  {
433  long tmp;
434  sidx.ToLong( &tmp );
435 
436  if( tmp > 0 && tmp <= 0x7FFFFFFF )
437  filter = (int) tmp;
438  }
439 
440  if( !S3D::Select3DModel( m_PreviewPane, Prj().Get3DCacheManager(),
441  initialpath, filter, &model ) || model.m_Filename.empty() )
442  {
443  return;
444  }
445 
446  prj.SetRString( PROJECT::VIEWER_3D_PATH, initialpath );
447  sidx = wxString::Format( wxT( "%i" ), filter );
449  wxString origPath = model.m_Filename;
450  wxString alias;
451  wxString shortPath;
452  S3D_FILENAME_RESOLVER* res = Prj().Get3DCacheManager()->GetResolver();
453 
454  if( res && res->SplitAlias( origPath, alias, shortPath ) )
455  {
456  origPath = alias;
457  origPath.append( wxT( ":" ) );
458  origPath.append( shortPath );
459  }
460 
461  m_3D_ShapeNameListBox->Append( origPath );
462 
463 #ifdef __WINDOWS__
464  // In Kicad files, filenames and paths are stored using Unix notation
465  model.m_Filename.Replace( wxT( "\\" ), wxT( "/" ) );
466 #endif
467 
468  m_shapes3D_list.push_back( model );
471 
472  if( m_PreviewPane )
474 
475  return;
476 }
477 
478 
480 {
481  wxString msg;
482  // First, test for invalid chars in module name
483  wxString footprintName = m_FootprintNameCtrl->GetValue();
484 
485  if( ! footprintName.IsEmpty() )
486  {
487  if( ! MODULE::IsLibNameValid( footprintName ) )
488  {
489  msg.Printf( _( "Error:\n"
490  "one of invalid chars \"%s\" found\nin \"%s\"" ),
492  GetChars( footprintName ) );
493 
494  DisplayError( NULL, msg );
495 
496  return false;
497  }
498  }
499 
500  // Check if footprint local clerance is acceptable (i.e. >= 0 )
501  int localNetClearance = ValueFromTextCtrl( *m_NetClearanceValueCtrl );
502 
503  if( localNetClearance < 0 )
504  {
505  wxMessageBox( _( "Error: footprint local net clearance is < 0" ) );
506  return false;
507  }
508 
509  if( !m_PreviewPane->ValidateWithMessage( msg ) )
510  {
511  DisplayError( NULL, msg );
512  return false;
513  }
514 
515  BOARD_COMMIT commit( m_parent );
516  commit.Modify( m_currentModule );
517 
518  m_currentModule->SetLocked( m_AutoPlaceCtrl->GetSelection() == 1 );
519 
520  switch( m_AttributsCtrl->GetSelection() )
521  {
522  case 0:
524  break;
525 
526  case 1:
528  break;
529 
530  case 2:
532  break;
533  }
534 
537  m_currentModule->SetDescription( m_DocCtrl->GetValue() );
538  m_currentModule->SetKeywords( m_KeywordCtrl->GetValue() );
539 
540  // Set footprint name in library
541  if( ! footprintName.IsEmpty() )
542  {
543  m_currentFPID.SetLibItemName( footprintName, false );
545  }
546 
547  // Set fields
548  TEXTE_MODULE& reference = m_currentModule->Reference();
549  reference = *m_referenceCopy;
550  TEXTE_MODULE& value = m_currentModule->Value();
551  value = *m_valueCopy;
552 
553  switch( m_ZoneConnectionChoice->GetSelection() )
554  {
555  default:
556  case 0:
558  break;
559 
560  case 1:
562  break;
563 
564  case 2:
566  break;
567 
568  case 3:
570  break;
571  }
572 
573  // Set masks clearances
574  m_currentModule->SetLocalClearance( localNetClearance );
577  double dtmp;
578  msg = m_SolderPasteMarginRatioCtrl->GetValue();
579  msg.ToDouble( &dtmp );
580 
581  // A -50% margin ratio means no paste on a pad, the ratio must be >= -50%
582  if( dtmp < -50.0 )
583  dtmp = -50.0;
584 
585  // A margin ratio is always <= 0
586  if( dtmp > 0.0 )
587  dtmp = 0.0;
588 
590 
591  std::list<MODULE_3D_SETTINGS>* draw3D = &m_currentModule->Models();
592  draw3D->clear();
593  draw3D->insert( draw3D->end(), m_shapes3D_list.begin(), m_shapes3D_list.end() );
594 
596 
597  commit.Push( _( "Modify module properties" ) );
598 
599  return true;
600 }
601 
602 
603 void DIALOG_FOOTPRINT_FP_EDITOR::OnEditReference( wxCommandEvent& event )
604 {
607 
608  DIALOG_EDIT_FPTEXT dialog( this, m_parent, m_referenceCopy, NULL );
609  dialog.ShowModal();
610 
612  m_ReferenceCtrl->SetValue( m_referenceCopy->GetText() );
613 }
614 
615 
616 void DIALOG_FOOTPRINT_FP_EDITOR::OnEditValue( wxCommandEvent& event )
617 {
620 
621  DIALOG_EDIT_FPTEXT dialog( this, m_parent, m_valueCopy, NULL );
622  dialog.ShowModal();
623 
625  m_ValueCtrl->SetValue( m_valueCopy->GetText() );
626 }
627 
628 
629 void DIALOG_FOOTPRINT_FP_EDITOR::Cfg3DPath( wxCommandEvent& event )
630 {
631  if( S3D::Configure3DPaths( this, Prj().Get3DCacheManager()->GetResolver() ) )
632  if( m_lastSelected3DShapeIndex >= 0 )
633  if( m_PreviewPane )
635 }
void ResetModelData(bool aReloadPreviewModule=false)
ResetModelData - Clear the values and reload the preview board.
void Cfg3DPath(wxCommandEvent &event) override
void SetPlacementCost90(int aCost)
Definition: class_module.h:573
void On3DShapeNameSelected(wxCommandEvent &event) override
COMMIT & Modify(EDA_ITEM *aItem)
Modifies a given item in the model.
Definition: commit.h:103
TEXTE_MODULE & Reference()
Definition: class_module.h:502
Class PROJECT holds project specific data.
Definition: project.h:56
const wxPoint & GetTextPos() const
Definition: eda_text.h:222
void SetLocalClearance(int aClearance)
Definition: class_module.h:207
This file is part of the common library TODO brief description.
void SetPlacementCost180(int aCost)
Definition: class_module.h:570
Implementation of conversion functions that require both schematic and board internal units...
This file is part of the common library.
int GetLocalClearance() const
Definition: class_module.h:206
void CalculateBoundingBox()
Function CalculateBoundingBox calculates the bounding box in board coordinates.
bool ValidateWithMessage(wxString &aErrorMessage)
verify X,Y and Z scale factors are acceptable (> 0.001 and < 1000.0)
Set for modules listed in the automatic insertion list (usually SMD footprints)
Definition: class_module.h:77
void SetZoneConnection(ZoneConnection aType)
Definition: class_module.h:215
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:66
Class DIALOG_FOOTPRINT_FP_EDITOR_BASE.
static const wxChar * StringLibNameInvalidChars(bool aUserReadable)
static function StringLibNameInvalidChars Test for validity of the name in a library of the footprint...
ZoneConnection GetZoneConnection() const
Definition: class_module.h:216
int GetPlacementCost90() const
Definition: class_module.h:572
Definition of class FOOTPRINT_EDIT_FRAME.
void SetLocalSolderPasteMarginRatio(double aRatio)
Definition: class_module.h:213
double GetLocalSolderPasteMarginRatio() const
Definition: class_module.h:212
void SetValue(const wxString &aValue) override
Set a new value in evaluator buffer, and display it in the wxTextCtrl.
This file contains miscellaneous commonly used macros and functions.
Class FILE_NAME_CHAR_VALIDATOR.
Definition: validators.h:43
Pads are not covered.
Definition: zones.h:57
bool Configure3DPaths(wxWindow *aParent, S3D_FILENAME_RESOLVER *aResolver)
bool ValidateFileName(const wxString &aFileName, bool &hasAlias)
Function ValidateName returns true if the given path is a valid aliased relative path.
bool SplitAlias(const wxString &aFileName, wxString &anAlias, wxString &aRelPath)
Function SplitAlias returns true if the given name contains an alias and populates the string anAlias...
const LIB_ID & GetFPID() const
Definition: class_module.h:191
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:78
void OnEditValue(wxCommandEvent &event) override
void SetModelDataIdx(int idx, bool aReloadPreviewModule=false)
SetModelDataIdx - This will set the index of the INFO list that was set on the parent.
Footprint text class description.
Defines a panel which is to be added to a wxFileDialog via SetExtraControl(); The panel shows a previ...
void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:224
TEXTE_MODULE & Value()
read/write accessors:
Definition: class_module.h:501
PCB_GENERAL_SETTINGS & Settings()
const UTF8 & GetLibItemName() const
Definition: lib_id.h:118
const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:128
wxString GetAbbreviatedUnitsLabel(EDA_UNITS_T aUnit)
Definition: base_units.cpp:485
#define KISYS3DMOD
A variable name whose value holds the path of 3D shape files.
Definition: 3d_viewer.h:38
The common library.
int GetAttributes() const
Definition: class_module.h:224
const wxString & GetKeywords() const
Definition: class_module.h:197
int GetLocalSolderMaskMargin() const
Definition: class_module.h:203
int ValueFromTextCtrl(const wxTextCtrl &aTextCtr)
Convert the number Value in a string according to the internal units and the selected unit (g_UserUni...
Definition: base_units.cpp:386
bool IsLocked() const override
Function IsLocked.
Definition: class_module.h:263
void SetLocalSolderMaskMargin(int aMargin)
Definition: class_module.h:204
int SetLibItemName(const UTF8 &aLibItemName, bool aTestForRev=true)
Override the library item name portion of the LIB_ID to aLibItemName.
Definition: lib_id.cpp:232
COLORS_DESIGN_SETTINGS & Colors()
int GetLocalSolderPasteMargin() const
Definition: class_module.h:209
wxString m_Filename
The 3D shape filename in 3D library.
Definition: class_module.h:102
VTBL_ENTRY void SetRString(RSTRING_T aStringId, const wxString &aString)
Function SetRString stores a "retained string", which is any session and project specific string iden...
Definition: project.cpp:171
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:57
static bool IsLibNameValid(const wxString &aName)
static function IsLibNameValid Test for validity of a name of a footprint to be used in a footprint l...
void PutValueInLocalUnits(wxTextCtrl &aTextCtr, int aValue)
Function PutValueInLocalUnits converts aValue from internal units to user units and append the units ...
Definition: base_units.cpp:267
void SetLocalSolderPasteMargin(int aMargin)
Definition: class_module.h:210
VTBL_ENTRY const wxString & GetRString(RSTRING_T aStringId)
Function GetRString returns a "retained string", which is any session and project specific string ide...
Definition: project.cpp:186
wxString GetValue()
std::list< MODULE_3D_SETTINGS > & Models()
Definition: class_module.h:177
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
see class PGM_BASE
void SetLocked(bool isLocked) override
Function SetLocked sets the MODULE_is_LOCKED bit in the m_ModuleStatus.
Definition: class_module.h:273
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
const wxString & GetDescription() const
Definition: class_module.h:194
provides an extensible class to resolve 3D model paths.
void Remove3DShape(wxCommandEvent &event) override
Virtual component: when created by copper shapes on board (Like edge card connectors, mounting hole...)
Definition: class_module.h:79
void OnEditReference(wxCommandEvent &event) override
defines the display data cache manager for 3D models
VTBL_ENTRY const wxString GetProjectPath() const
Function GetProjectPath returns the full path of the project.
Definition: project.cpp:102
virtual void Push(const wxString &aMessage=wxT("A commit"), bool aCreateUndoEntry=true, bool aSetDirtyBit=true) override
Executes the changes.
void SetKeywords(const wxString &aKeywords)
Definition: class_module.h:198
DIALOG_FOOTPRINT_FP_EDITOR(FOOTPRINT_EDIT_FRAME *aParent, MODULE *aModule)
bool Select3DModel(wxWindow *aParent, S3D_CACHE *aCache, wxString &prevModelSelectDir, int &prevModelWildcard, MODULE_3D_SETTINGS *aModel)
Module description (excepted pads)
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:101
void SetCrossHairPosition(const wxPoint &aPosition, bool aSnapToGrid=true)
Function SetCrossHairPosition sets the screen cross hair position to aPosition in logical (drawing) u...
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:185
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates...
int GetPlacementCost180() const
Definition: class_module.h:569
void SetFPID(const LIB_ID &aFPID)
Definition: class_module.h:192
Use thermal relief for pads.
Definition: zones.h:58
Custom text control validator definitions.
Declaration of the eda_3d_viewer class.
void UpdateModelName(wxString const &aModel)
void SetAttributes(int aAttributes)
Definition: class_module.h:225
pads are covered by copper
Definition: zones.h:59
void SetDescription(const wxString &aDoc)
Definition: class_module.h:195
std::vector< MODULE_3D_SETTINGS > m_shapes3D_list