KiCad PCB EDA Suite
dialog_edit_module_for_BoardEditor.cpp
Go to the documentation of this file.
1 
5 /*
6  * This program source code file is part of KiCad, a free EDA CAD application.
7  *
8  * Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
9  * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
10  * Copyright (C) 2015 Dick Hollenbeck, dick@softplc.com
11  * Copyright (C) 2004-2016 KiCad Developers, see AUTHORS.txt for contributors.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, you may find one here:
25  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
26  * or you may search the http://www.gnu.org website for the version 2 license,
27  * or you may write to the Free Software Foundation, Inc.,
28  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
29  */
30 
31 
32 #include <fctsys.h>
33 #include <kiface_i.h>
34 #include <gr_basic.h>
35 #include <class_drawpanel.h>
36 #include <confirm.h>
37 #include <pcbnew.h>
38 #include <pgm_base.h>
39 #include <gestfich.h>
40 #include <3d_viewer.h>
41 #include <wxPcbStruct.h>
42 #include <base_units.h>
43 #include <project.h>
44 #include <board_commit.h>
45 #include <bitmaps.h>
46 
47 #include <class_module.h>
48 #include <class_text_mod.h>
49 #include <validators.h>
50 
55 #include "3d_cache/3d_cache.h"
57 
58 size_t DIALOG_MODULE_BOARD_EDITOR::m_page = 0; // remember the last open page during session
59 
61  EVT_CLOSE( DIALOG_MODULE_BOARD_EDITOR::OnCloseWindow )
62 wxEND_EVENT_TABLE()
63 
65  MODULE* aModule,
66  wxDC* aDC ) :
68  m_OrientValidator( 1, &m_OrientValue )
69 {
70  wxASSERT( aParent != NULL );
71  wxASSERT( aModule != NULL );
72 
73  m_Parent = aParent;
74  m_DC = aDC;
75  m_CurrentModule = aModule;
76 
77  m_currentModuleCopy = new MODULE( *aModule );
78 
79  // Give an icon
80  wxIcon icon;
81  icon.CopyFromBitmap( KiBitmap( icon_modedit_xpm ) );
82  SetIcon( icon );
83 
84  m_OrientValidator.SetRange( -360.0, 360.0 );
85  m_OrientValueCtrl->SetValidator( m_OrientValidator );
86  m_OrientValidator.SetWindow( m_OrientValueCtrl );
87 
88  aParent->Prj().Get3DCacheManager()->GetResolver()->SetProgramBase( &Pgm() );
89 
90  m_PreviewPane = new PANEL_PREV_3D( m_Panel3D,
91  aParent->Prj().Get3DCacheManager(),
92  m_currentModuleCopy,
93  &m_shapes3D_list );
94 
95  bLowerSizer3D->Add( m_PreviewPane, 1, wxEXPAND, 5 );
96 
97  m_NoteBook->SetSelection( m_page );
98  m_sdbSizerStdButtonsOK->SetDefault();
99 
100  m_ReferenceCopy = NULL;
101  m_ValueCopy = NULL;
102  m_LastSelected3DShapeIndex = 0;
103  m_OrientValue = 0;
104 
105  Layout();
106 
107 }
108 
109 
110 
112 {
113  m_shapes3D_list.clear();
114 
115  // free the memory used by all models, otherwise models which were
116  // browsed but not used would consume memory
117  Prj().Get3DCacheManager()->FlushCache( false );
118 
119  // the GL canvas has to be visible before it is destroyed
120  m_page = m_NoteBook->GetSelection();
121  m_NoteBook->SetSelection( 1 );
122 
123  delete m_ReferenceCopy;
124  m_ReferenceCopy = NULL;
125 
126  delete m_ValueCopy;
127  m_ValueCopy = NULL;
128 
129  delete m_PreviewPane;
130  m_PreviewPane = NULL; // just in case, to avoid double-free
131 
132  // this is already deleted by the board used on preview pane so
133  // no need to delete here
134  // delete m_currentModuleCopy;
135  // m_currentModuleCopy = NULL;
136 }
137 
138 
139 void DIALOG_MODULE_BOARD_EDITOR::OnCloseWindow( wxCloseEvent &event )
140 {
141  m_PreviewPane->Close();
142 
143  event.Skip();
144 }
145 
146 
147 // Creation of the panel properties of the module editor.
149 {
152 
155 
156  m_LayerCtrl->SetSelection(
157  (m_CurrentModule->GetLayer() == B_Cu) ? 1 : 0 );
158 
159  bool custom_orientation = false;
160  switch( int( m_CurrentModule->GetOrientation() ) )
161  {
162  case 0:
163  m_OrientCtrl->SetSelection( 0 );
164  break;
165 
166  case 900:
167  case -2700:
168  m_OrientCtrl->SetSelection( 1 );
169  break;
170 
171  case -900:
172  case 2700:
173  m_OrientCtrl->SetSelection( 2 );
174  break;
175 
176  case -1800:
177  case 1800:
178  m_OrientCtrl->SetSelection( 3 );
179  break;
180 
181  default:
182  m_OrientCtrl->SetSelection( 4 );
183  custom_orientation = true;
184  break;
185  }
186 
187  m_OrientValueCtrl->Enable( custom_orientation );
189  m_OrientValidator.TransferToWindow();
190 
191  // Initialize dialog relative to masks clearances
195 
198 
199  // These 2 parameters are usually < 0, so prepare entering a negative
200  // value, if current is 0
202 
204  m_SolderPasteMarginCtrl->SetValue( wxT( "-" ) +
205  m_SolderPasteMarginCtrl->GetValue() );
206 
207  // Add solder paste margin ration in per cent
208  // for the usual default value 0.0, display -0.0 (or -0,0 in some countries)
209  wxString msg;
210  msg.Printf( wxT( "%f" ),
212 
214  msg[0] == '0') // Sometimes Printf adds a sign if the value is very small (0.0)
215  m_SolderPasteMarginRatioCtrl->SetValue( wxT("-") + msg );
216  else
217  m_SolderPasteMarginRatioCtrl->SetValue( msg );
218 
220  {
221  default:
223  m_ZoneConnectionChoice->SetSelection( 0 );
224  break;
225 
226  case PAD_ZONE_CONN_FULL:
227  m_ZoneConnectionChoice->SetSelection( 1 );
228  break;
229 
231  m_ZoneConnectionChoice->SetSelection( 2 );
232  break;
233 
234  case PAD_ZONE_CONN_NONE:
235  m_ZoneConnectionChoice->SetSelection( 3 );
236  break;
237  }
238 }
239 
240 
241 void DIALOG_MODULE_BOARD_EDITOR::GotoModuleEditor( wxCommandEvent& event )
242 {
243  if( m_CurrentModule->GetTimeStamp() == 0 ) // Module Editor needs a non null timestamp
244  {
246  m_Parent->OnModify();
247  }
248 
249  EndModal( PRM_EDITOR_WANT_MODEDIT );
250 }
251 
252 
253 void DIALOG_MODULE_BOARD_EDITOR::ExchangeModule( wxCommandEvent& event )
254 {
255  EndModal( PRM_EDITOR_WANT_EXCHANGE_FP );
256 }
257 
258 
260 {
261  bool custom_orientation = false;
262 
263  switch( m_OrientCtrl->GetSelection() )
264  {
265  case 0:
266  m_OrientValue = 0.0;
267  break;
268 
269  case 1:
270  m_OrientValue = 90.0;
271  break;
272 
273  case 2:
274  m_OrientValue = 270.0;
275  break;
276 
277  case 3:
278  m_OrientValue = 180.0;
279  break;
280 
281  default:
282  custom_orientation = true;
283  break;
284  }
285 
286  m_OrientValidator.TransferToWindow();
287  m_OrientValueCtrl->Enable( custom_orientation );
288 }
289 
290 
292 {
293  wxString default_path;
294  wxGetEnv( KISYS3DMOD, &default_path );
295 #ifdef __WINDOWS__
296  default_path.Replace( wxT( "/" ), wxT( "\\" ) );
297 #endif
298 
300 
301  // Init 3D shape list
302  m_3D_ShapeNameListBox->Clear();
303  std::list<S3D_INFO>::iterator sM = m_CurrentModule->Models().begin();
304  std::list<S3D_INFO>::iterator eM = m_CurrentModule->Models().end();
305  m_shapes3D_list.clear();
306 
307  wxString origPath;
308  wxString alias;
309  wxString shortPath;
310  S3D_FILENAME_RESOLVER* res = Prj().Get3DCacheManager()->GetResolver();
311 
312  while( sM != eM )
313  {
314  m_shapes3D_list.push_back( *sM );
315  origPath = sM->m_Filename;
316 
317  if( res && res->SplitAlias( origPath, alias, shortPath ) )
318  {
319  origPath = alias;
320  origPath.append( wxT( ":" ) );
321  origPath.append( shortPath );
322  }
323 
324  m_3D_ShapeNameListBox->Append( origPath );
325  ++sM;
326 
327  }
328 
333  m_ReferenceCtrl->SetValue( m_ReferenceCopy->GetText() );
334  m_ValueCtrl->SetValue( m_ValueCopy->GetText() );
335 
336  // Shows the footprint's schematic path.
338 
339  m_AttributsCtrl->SetItemToolTip( 0,
340  _( "Use this attribute for most non SMD components\n"
341  "Components with this option are not put in the footprint position list file" ) );
342  m_AttributsCtrl->SetItemToolTip( 1,
343  _( "Use this attribute for SMD components.\n"
344  "Only components with this option are put in the footprint position list file" ) );
345  m_AttributsCtrl->SetItemToolTip( 2,
346  _( "Use this attribute for \"virtual\" components drawn on board\n"
347  "like an edge connector (old ISA PC bus for instance)" ) );
348 
349  // Controls on right side of the dialog
350  switch( m_CurrentModule->GetAttributes() & 255 )
351  {
352  case 0:
353  m_AttributsCtrl->SetSelection( 0 );
354  break;
355 
356  case MOD_CMS:
357  m_AttributsCtrl->SetSelection( 1 );
358  break;
359 
360  case MOD_VIRTUAL:
361  m_AttributsCtrl->SetSelection( 2 );
362  break;
363 
364  default:
365  m_AttributsCtrl->SetSelection( 0 );
366  break;
367  }
368 
369  if( m_CurrentModule->IsLocked() )
370  m_AutoPlaceCtrl->SetSelection( 2 );
371  else if( m_CurrentModule->PadsLocked() )
372  m_AutoPlaceCtrl->SetSelection( 1 );
373  else
374  m_AutoPlaceCtrl->SetSelection( 0 );
375 
376  m_AutoPlaceCtrl->SetItemToolTip( 0,
377  _( "Component can be freely moved and auto placed. User can arbitrarily select and edit component's pads." ) );
378  m_AutoPlaceCtrl->SetItemToolTip( 1,
379  _( "Component can be freely moved and auto placed, but its pads cannot be selected or edited." ) );
380  m_AutoPlaceCtrl->SetItemToolTip( 2,
381  _( "Component is locked: it cannot be freely moved or auto placed." ) );
382 
384 
386 
387  // if m_3D_ShapeNameListBox is not empty, preselect first 3D shape
388  if( m_3D_ShapeNameListBox->GetCount() > 0 )
389  {
392 
393  if( m_PreviewPane )
395  }
396  else
397  {
398  if( m_PreviewPane )
399  m_PreviewPane->ResetModelData( true );
400  }
401 
402  // We have modified the UI, so call Fit() for m_Panel3D
403  // to be sure the m_Panel3D sizers are initiliazed before opening the dialog
404  m_Panel3D->GetSizer()->Fit( m_Panel3D );
405 }
406 
407 
409 {
411 
412  if( m_LastSelected3DShapeIndex < 0 ) // happens under wxGTK when
413  // deleting an item in
414  // m_3D_ShapeNameListBox wxListBox
415  {
416  if( m_PreviewPane )
418 
419  return;
420  }
421 
422  if( m_LastSelected3DShapeIndex >= (int) m_shapes3D_list.size() )
423  {
424  wxMessageBox( wxT( "On3DShapeNameSelected() error" ) );
426 
427  if( m_PreviewPane )
429 
430  return;
431  }
432 
433  if( m_PreviewPane )
435 }
436 
437 
438 
439 void DIALOG_MODULE_BOARD_EDITOR::Remove3DShape( wxCommandEvent& event )
440 {
441  int ii = m_3D_ShapeNameListBox->GetSelection();
442 
443  if( ii < 0 )
444  {
445  if( m_PreviewPane )
446  m_PreviewPane->ResetModelData( true );
447 
448  return;
449  }
450 
451  m_shapes3D_list.erase( m_shapes3D_list.begin() + ii );
452  m_3D_ShapeNameListBox->Delete( ii );
453 
454  if( m_3D_ShapeNameListBox->GetCount() > 0 )
455  {
456  if( ii > 0 )
458  else
460 
462 
463  if( m_PreviewPane )
465  }
466  else
467  {
468  if( m_PreviewPane )
469  m_PreviewPane->ResetModelData( true );
470  }
471 
472  return;
473 }
474 
475 
477 {
478  int idx = m_3D_ShapeNameListBox->GetSelection();
479 
480  if( idx < 0 )
481  return;
482 
483  // Edit filename
484  wxString filename = m_3D_ShapeNameListBox->GetStringSelection();
485  wxTextEntryDialog dlg( this, wxEmptyString, wxEmptyString, filename );
486 
487  bool hasAlias;
488  S3D_FILENAME_RESOLVER* res = Prj().Get3DCacheManager()->GetResolver();
489 
490  if( dlg.ShowModal() != wxID_OK )
491  return;
492 
493  filename = dlg.GetValue();
494 
495  if( filename.empty() )
496  return;
497 
498  if( !res->ValidateFileName( filename, hasAlias ) )
499  {
500  wxString msg = _( "Invalid filename: " );
501  msg.append( filename );
502  wxMessageBox( msg, _( "Edit 3D file name" ) );
503 
504  return;
505  }
506 
507  m_3D_ShapeNameListBox->SetString( idx, filename );
508 
509  // if the user has specified an alias in the name then prepend ':'
510  if( hasAlias )
511  filename.insert( 0, wxT( ":" ) );
512 
513  #ifdef __WINDOWS__
514  // In Kicad files, filenames and paths are stored using Unix notation
515  filename.Replace( wxT( "\\" ), wxT( "/" ) );
516  #endif
517 
518  m_shapes3D_list[idx].m_Filename = filename;
519 
520  // This assumes that the index didn't change and will just update the filename
521  if( m_PreviewPane )
522  m_PreviewPane->UpdateModelName( filename );
523 
524  return;
525 }
526 
527 
529 {
530  PROJECT& prj = Prj();
531  S3D_INFO model;
532 
533  wxString initialpath = prj.GetRString( PROJECT::VIEWER_3D_PATH );
534  wxString sidx = prj.GetRString( PROJECT::VIEWER_3D_FILTER_INDEX );
535  int filter = 0;
536 
537  if( !sidx.empty() )
538  {
539  long tmp;
540  sidx.ToLong( &tmp );
541 
542  if( tmp > 0 && tmp <= INT_MAX )
543  filter = (int) tmp;
544  }
545 
546  if( !S3D::Select3DModel( this, Prj().Get3DCacheManager(),
547  initialpath, filter, &model ) || model.m_Filename.empty() )
548  {
549  return;
550  }
551 
552  prj.SetRString( PROJECT::VIEWER_3D_PATH, initialpath );
553  sidx = wxString::Format( wxT( "%i" ), filter );
555  S3D_FILENAME_RESOLVER* res = Prj().Get3DCacheManager()->GetResolver();
556  wxString alias;
557  wxString shortPath;
558  wxString filename = model.m_Filename;
559 
560  if( res && res->SplitAlias( filename, alias, shortPath ) )
561  {
562  alias.Append( wxT( ":" ) );
563  alias.Append( shortPath );
564  m_3D_ShapeNameListBox->Append( alias );
565  }
566  else
567  {
568  m_3D_ShapeNameListBox->Append( filename );
569  }
570 
571 #ifdef __WINDOWS__
572  // In Kicad files, filenames and paths are stored using Unix notation
573  model.m_Filename.Replace( wxT( "\\" ), wxT( "/" ) );
574 #endif
575 
576  m_shapes3D_list.push_back( model );
579 
580  if( m_PreviewPane )
582 
583  return;
584 }
585 
586 
588 {
589  if( !wxDialog::TransferDataToWindow() ||
590  !m_PanelProperties->TransferDataToWindow() )
591  {
592  wxMessageBox( _( "Error: invalid footprint parameter" ) );
593  return false;
594  }
595 
596  if( !m_Panel3D->TransferDataToWindow() )
597  {
598  wxMessageBox( _( "Error: invalid 3D parameter" ) );
599  return false;
600  }
601 
604 
605  return true;
606 }
607 
608 
610 {
611  wxPoint modpos;
612  wxString msg;
613 
614  BOARD_COMMIT commit( m_Parent );
615  commit.Modify( m_CurrentModule );
616 
617  if( !Validate() || !DIALOG_MODULE_BOARD_EDITOR_BASE::TransferDataFromWindow() ||
618  !m_PanelProperties->TransferDataFromWindow() )
619  {
620  wxMessageBox( _( "Error: invalid or missing footprint parameter" ) );
621  return false;
622  }
623 
624  if( !m_Panel3D->TransferDataFromWindow() )
625  {
626  wxMessageBox( _( "Error: invalid or missing 3D parameter" ) );
627  return false;
628  }
629 
630  if( m_DC )
631  {
634  }
635 
636  // Init Fields (should be first, because they can be moved or/and flipped later):
637  TEXTE_MODULE& reference = m_CurrentModule->Reference();
638  reference = *m_ReferenceCopy;
639  TEXTE_MODULE& value = m_CurrentModule->Value();
640  value = *m_ValueCopy;
641 
642  // Initialize masks clearances
646 
647  double dtmp = 0.0;
648  msg = m_SolderPasteMarginRatioCtrl->GetValue();
649  msg.ToDouble( &dtmp );
650 
651  // A -50% margin ratio means no paste on a pad, the ratio must be >= -50%
652  if( dtmp < -50.0 )
653  dtmp = -50.0;
654  // A margin ratio is always <= 0
655  // 0 means use full pad copper area
656  if( dtmp > 0.0 )
657  dtmp = 0.0;
658 
660 
661  switch( m_ZoneConnectionChoice->GetSelection() )
662  {
663  default:
664  case 0:
666  break;
667 
668  case 1:
670  break;
671 
672  case 2:
674  break;
675 
676  case 3:
678  break;
679  }
680 
681  // Set Module Position
682  modpos.x = ValueFromTextCtrl( *m_ModPositionX );
683  modpos.y = ValueFromTextCtrl( *m_ModPositionY );
684  m_CurrentModule->SetPosition( modpos );
685  m_CurrentModule->SetLocked( m_AutoPlaceCtrl->GetSelection() == 2 );
686  m_CurrentModule->SetPadsLocked( m_AutoPlaceCtrl->GetSelection() == 1 );
687 
688  switch( m_AttributsCtrl->GetSelection() )
689  {
690  case 0:
692  break;
693 
694  case 1:
696  break;
697 
698  case 2:
700  break;
701  }
702 
705 
706  /* Now, set orientation. must be made after others changes,
707  * because rotation changes fields positions on board according to the new orientation
708  * (relative positions are not modified)
709  */
710  int orient = KiROUND( m_OrientValue * 10.0 );
711 
712  if( m_CurrentModule->GetOrientation() != orient )
714  orient - m_CurrentModule->GetOrientation() );
715 
716  // Set component side, that also have effect on the fields positions on board
717  bool change_layer = false;
718  if( m_LayerCtrl->GetSelection() == 0 ) // layer req = COMPONENT
719  {
720  if( m_CurrentModule->GetLayer() == B_Cu )
721  change_layer = true;
722  }
723  else if( m_CurrentModule->GetLayer() == F_Cu )
724  change_layer = true;
725 
726  if( change_layer )
728 
729  // This will update the S3D_INFO list into the current module
730  msg.Clear();
731 
732  if( !m_PreviewPane->ValidateWithMessage( msg ) )
733  {
734  DisplayError( this, msg );
735  return false;
736  }
737 
738  std::list<S3D_INFO>* draw3D = &m_CurrentModule->Models();
739  draw3D->clear();
740  draw3D->insert( draw3D->end(), m_shapes3D_list.begin(), m_shapes3D_list.end() );
741 
743 
744  // This is a simple edition, we must create an undo entry
745  if( m_CurrentModule->GetFlags() == 0 )
746  commit.Push( _( "Modify module properties" ) );
747 
748  SetReturnCode( PRM_EDITOR_EDIT_OK );
749 
750  if( m_DC )
751  {
754  }
755 
756  return true;
757 }
758 
759 
760 void DIALOG_MODULE_BOARD_EDITOR::OnEditReference( wxCommandEvent& event )
761 {
763 
768  m_ReferenceCtrl->SetValue( m_ReferenceCopy->GetText() );
769 }
770 
771 
772 void DIALOG_MODULE_BOARD_EDITOR::OnEditValue( wxCommandEvent& event )
773 {
775 
780  m_ValueCtrl->SetValue( m_ValueCopy->GetText() );
781 }
782 
783 
784 void DIALOG_MODULE_BOARD_EDITOR::Cfg3DPath( wxCommandEvent& event )
785 {
786  if( S3D::Configure3DPaths( this, Prj().Get3DCacheManager()->GetResolver() ) )
787  if( m_LastSelected3DShapeIndex >= 0 )
788  if( m_PreviewPane )
790 }
void ResetModelData(bool aReloadPreviewModule=false)
ResetModelData - Clear the values and reload the preview board.
void SetPlacementCost90(int aCost)
Definition: class_module.h:524
virtual void OnModify() override
Function OnModify must be called after a board change to set the modified flag.
Definition: pcbframe.cpp:1004
STATUS_FLAGS GetFlags() const
Definition: base_struct.h:255
COMMIT & Modify(EDA_ITEM *aItem)
Modifies a given item in the model.
Definition: commit.h:103
TEXTE_MODULE & Reference()
Definition: class_module.h:455
void Rotate(const wxPoint &aRotCentre, double aAngle) override
Function Rotate Rotate this object.
Class PROJECT holds project specific data.
Definition: project.h:51
const wxPoint & GetTextPos() const
Definition: eda_text.h:224
void SetLocalClearance(int aClearance)
Definition: class_module.h:167
This file is part of the common library TODO brief description.
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
void SetPlacementCost180(int aCost)
Definition: class_module.h:521
Implementation of conversion functions that require both schematic and board internal units...
This file is part of the common library.
EDA_DRAW_PANEL * GetCanvas()
Definition: draw_frame.h:299
int GetLocalClearance() const
Definition: class_module.h:166
void CalculateBoundingBox()
Function CalculateBoundingBox calculates the bounding box in board coordinates.
void Draw(EDA_DRAW_PANEL *aPanel, wxDC *aDC, GR_DRAWMODE aDrawMode, const wxPoint &aOffset=ZeroOffset) override
Function Draw draws the footprint to the aDC.
void Flip(const wxPoint &aCentre) override
Function Flip Flip this object, i.e.
const wxPoint & GetPosition() const override
Definition: class_module.h:143
wxBEGIN_EVENT_TABLE(DIALOG_MODULE_BOARD_EDITOR, wxDialog) wxEND_EVENT_TABLE() DIALOG_MODULE_BOARD_EDITOR
time_t GetNewTimeStamp()
Definition: common.cpp:166
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:76
void SetZoneConnection(ZoneConnection aType)
Definition: class_module.h:175
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
wxFloatingPointValidator< double > m_OrientValidator
ZoneConnection GetZoneConnection() const
Definition: class_module.h:176
std::list< S3D_INFO > & Models()
Definition: class_module.h:139
static size_t m_page
Module editor: Dialog for editing module properties in the pcb editor.
int GetPlacementCost90() const
Definition: class_module.h:523
LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
void Cfg3DPath(wxCommandEvent &event) override
void SetLocalSolderPasteMarginRatio(double aRatio)
Definition: class_module.h:173
void ExchangeModule(wxCommandEvent &event) override
double GetLocalSolderPasteMarginRatio() const
Definition: class_module.h:172
virtual void Push(const wxString &aMessage=wxT("A commit"), bool aCreateUndoEntry=true) override
Executes the changes.
void SetTimeStamp(time_t aNewTimeStamp)
Definition: base_struct.h:203
Class DIALOG_MODULE_BOARD_EDITOR_BASE.
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...
void On3DShapeNameSelected(wxCommandEvent &event) override
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:36
bool PadsLocked() const
Definition: class_module.h:259
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 InstallTextModOptionsFrame(TEXTE_MODULE *TextMod, wxDC *DC)
void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:213
double GetOrientation() const
Definition: class_module.h:147
bool Select3DModel(wxWindow *aParent, S3D_CACHE *aCache, wxString &prevModelSelectDir, int &prevModelWildcard, S3D_INFO *aModel)
TEXTE_MODULE & Value()
read/write accessors:
Definition: class_module.h:454
const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:130
wxString GetAbbreviatedUnitsLabel(EDA_UNITS_T aUnit)
Definition: base_units.cpp:479
#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:184
void SetPadsLocked(bool aPadsLocked)
Definition: class_module.h:261
void SetPosition(const wxPoint &aPos) override
int GetLocalSolderMaskMargin() const
Definition: class_module.h:163
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:384
void CrossHairOff(wxDC *DC)
Definition: draw_panel.cpp:253
bool IsLocked() const override
Function IsLocked.
Definition: class_module.h:223
void SetLocalSolderMaskMargin(int aMargin)
Definition: class_module.h:164
int GetLocalSolderPasteMargin() const
Definition: class_module.h:169
time_t GetTimeStamp() const
Definition: base_struct.h:204
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:162
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
Definition: gr_basic.h:42
void PutValueInLocalUnits(wxTextCtrl &aTextCtr, int aValue)
Function PutValueInLocalUnits converts aValue from internal units to user units and append the units ...
Definition: base_units.cpp:265
void SetLocalSolderPasteMargin(int aMargin)
Definition: class_module.h:170
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:177
void CrossHairOn(wxDC *DC)
Definition: draw_panel.cpp:260
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:233
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
provides an extensible class to resolve 3D model paths.
void OnEditValue(wxCommandEvent &event) override
Virtual component: when created by copper shapes on board (Like edge card connectors, mounting hole...)
Definition: class_module.h:78
void OnEditReference(wxCommandEvent &event) override
defines the display data cache manager for 3D models
void Remove3DShape(wxCommandEvent &event) override
void GotoModuleEditor(wxCommandEvent &event) override
void ModuleOrientEvent(wxCommandEvent &event) override
Module description (excepted pads)
const wxString & GetPath() const
Definition: class_module.h:160
void SetCrossHairPosition(const wxPoint &aPosition, bool aSnapToGrid=true)
Function SetCrossHairPosition sets the screen cross hair position to aPosition in logical (drawing) u...
void OnCloseWindow(wxCloseEvent &event)
OnCloseWindow - called when the frame is closed.
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:69
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:520
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:185
pads are covered by copper
Definition: zones.h:59
wxString m_Filename
The 3D shape filename in 3D library.
Definition: 3d_info.h:45