KiCad PCB EDA Suite
Loading...
Searching...
No Matches
footprint_editor_utils.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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#include <board_commit.h>
21#include <confirm.h>
24#include <footprint_info.h>
25#include <footprint_tree_pane.h>
27#include <functional>
28#include <kiway_mail.h>
29#include <pcb_group.h>
30#include <pcb_marker.h>
31#include <pcb_textbox.h>
32#include <pcb_barcode.h>
33#include <pcb_table.h>
34#include <pcb_shape.h>
35#include <pad.h>
36#include <zone.h>
38#include <tool/tool_manager.h>
39#include <tools/pcb_actions.h>
43#include <widgets/lib_tree.h>
45#include <pcb_dimension.h>
46#include <project_pcb.h>
47#include <view/view_controls.h>
50
51using namespace std::placeholders;
52
53
55{
56 bool is_last_fp_from_brd = IsCurrentFPFromBoard();
57
58 if( aFPID.IsValid() )
59 {
60 const wxString key = aFPID.GetLibNickname().wx_str() + wxT( ':' ) + aFPID.GetLibItemName().wx_str();
61
62 // Reactivate rather than reload, which would discard in-tab edits.
63 if( int existing = m_tabsPanel->FindTab( key ); existing >= 0 )
64 {
65 m_tabsPanel->SelectTab( existing );
66
67 setFPWatcher( GetBoard()->GetFirstFootprint() );
68
69 m_treePane->GetLibTree()->ExpandLibId( aFPID );
70
71 m_centerItemOnIdle = aFPID;
72 Bind( wxEVT_IDLE, &FOOTPRINT_EDIT_FRAME::centerItemIdleHandler, this );
73
74 m_treePane->GetLibTree()->RefreshLibTree(); // update highlighting
75
76 return;
77 }
78 }
79
80 FOOTPRINT* footprint = LoadFootprint( aFPID );
81
82 if( !footprint )
83 return;
84
85 // A board-sourced or new footprint occupies the frame-owned board with no backing tab.
86 // Switching to the library footprint's tab frees that board, so prompt to save those edits
87 // first, the same way the legacy single-board path did. A tab-owned board survives the
88 // switch untouched and needs no prompt.
90 {
91 if( !::HandleUnsavedChanges( this, _( "The current footprint has been modified. Save changes?" ),
92 [&]() -> bool
93 {
94 return SaveFootprint( GetBoard()->Footprints().front() );
95 } ) )
96 {
97 // AddFootprintToBoard would have taken ownership; on cancel we still own the clone.
98 delete footprint;
99 return;
100 }
101 }
102
104 AddFootprintToBoard( footprint );
105
106 footprint->ClearFlags();
107
108 // if either reference or value are missing, reinstall them -
109 // otherwise you cannot see what you are doing on board
110 if( footprint->Reference().GetText().IsEmpty() )
111 footprint->SetReference( wxT( "Ref**" ) );
112
113 if( footprint->Value().GetText().IsEmpty() )
114 footprint->SetValue( wxT( "Val**" ) );
115
116 Zoom_Automatique( false );
117
118 Update3DView( true, true );
119
120 GetScreen()->SetContentModified( false );
121
122 UpdateView();
123 GetCanvas()->Refresh();
124
125 // Update the save items if needed.
126 if( is_last_fp_from_brd )
127 {
130 }
131
132 m_treePane->GetLibTree()->ExpandLibId( aFPID );
133
134 m_centerItemOnIdle = aFPID;
135 Bind( wxEVT_IDLE, &FOOTPRINT_EDIT_FRAME::centerItemIdleHandler, this );
136
137 m_treePane->GetLibTree()->RefreshLibTree(); // update highlighting
138}
139
140
141bool FOOTPRINT_EDIT_FRAME::BeginNewFootprint( const wxString& aLibrary )
142{
143 // No tab strip or target library to key a tab on, so use the legacy single-board clear.
144 if( aLibrary.IsEmpty() )
145 {
146 if( !HandleUnsavedChanges( false ) )
147 return false;
148
149 Clear_Pcb();
150 return true;
151 }
152
153 // The new footprint opens in its own tab. Only a dirty tab-less frame board needs saving.
155 {
156 if( !::HandleUnsavedChanges( this, _( "The current footprint has been modified. Save changes?" ),
157 [&]() -> bool
158 {
159 return SaveFootprint( GetBoard()->Footprints().front() );
160 } ) )
161 {
162 return false;
163 }
164 }
165
166 return true;
167}
168
169
171{
172 m_treePane->GetLibTree()->CenterLibId( m_centerItemOnIdle );
173 Unbind( wxEVT_IDLE, &FOOTPRINT_EDIT_FRAME::centerItemIdleHandler, this );
174}
175
176
177void FOOTPRINT_EDIT_FRAME::OnTabCharHook( wxKeyEvent& aEvent )
178{
179 const bool isTab = aEvent.GetKeyCode() == WXK_TAB;
180 const bool ctrlOnly = aEvent.ControlDown() && !aEvent.AltDown() && !aEvent.MetaDown();
181
182 // Ctrl+W arrives as 'W' or the control char depending on platform, so accept both.
183 const int keyCode = aEvent.GetKeyCode();
184 const bool isCtrlW = ctrlOnly && !aEvent.ShiftDown()
185 && ( keyCode == 'W' || keyCode == ( 'W' - '@' ) );
186
187 if( isCtrlW && m_tabsPanel && m_tabsPanel->Model().Entries().size() >= 1 )
188 {
190 return;
191 }
192
193 if( !isTab || !ctrlOnly || !m_tabsPanel )
194 {
195 aEvent.Skip();
196 return;
197 }
198
199 // The appearance panel owns Ctrl+Tab for its layer-preset cycle while focused, so defer to it.
200 if( APPEARANCE_CONTROLS* appearance = GetAppearancePanel() )
201 {
202 for( wxWindow* focus = wxWindow::FindFocus(); focus; focus = focus->GetParent() )
203 {
204 if( focus == appearance )
205 {
206 aEvent.Skip();
207 return;
208 }
209 }
210 }
211
212 AdvanceFootprintTab( !aEvent.ShiftDown() );
213
214 // Do not Skip, so the GTK default Tab focus-traversal does not also run.
215}
216
217
219{
220public:
222 {
223 wxASSERT( aFootprint );
224
225 m_nickname = aFootprint->GetFPID().GetLibNickname().wx_str();
226 m_fpname = aFootprint->GetFPID().GetLibItemName().wx_str();
227 m_keywords = aFootprint->GetKeywords();
228 m_doc = aFootprint->GetLibDescription();
229 m_loaded = true;
230 }
231};
232
233
234void FOOTPRINT_EDIT_FRAME::UpdateLibraryTree( const wxDataViewItem& aTreeItem, FOOTPRINT* aFootprint )
235{
236 wxCHECK( aFootprint, /* void */ );
237
238 BASIC_FOOTPRINT_INFO footprintInfo( aFootprint );
239
240 if( aTreeItem.IsOk() ) // Can be not found in tree if the current footprint is imported
241 // from file therefore not yet in tree.
242 {
243 static_cast<LIB_TREE_NODE_ITEM*>( aTreeItem.GetID() )->Update( &footprintInfo );
244 m_treePane->GetLibTree()->RefreshLibTree();
245 }
246}
247
248
250{
251 LIB_ID oldFPID = aFootprint->GetFPID();
252
253 DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR dialog( this, aFootprint );
254 dialog.ShowQuasiModal();
255
256 // Update design settings for footprint layers
258
259 // Update library tree and title in case of a name change
260 wxDataViewItem treeItem = m_adapter->FindItem( oldFPID );
261 UpdateLibraryTree( treeItem, aFootprint );
262
263 RenameFootprintTab( oldFPID, aFootprint->GetFPID() );
264
267}
268
269
271{
272 switch( aItem->Type() )
273 {
276 break;
277
278 case PCB_BARCODE_T:
279 ShowBarcodePropertiesDialog( static_cast<PCB_BARCODE*>( aItem ) );
280 break;
281
282 case PCB_PAD_T:
283 ShowPadPropertiesDialog( static_cast<PAD&>( *aItem ) );
284 break;
285
286 case PCB_FOOTPRINT_T:
287 editFootprintProperties( static_cast<FOOTPRINT*>( aItem ) );
288 GetCanvas()->Refresh();
289 break;
290
291 case PCB_FIELD_T:
292 case PCB_TEXT_T:
293 ShowTextPropertiesDialog( static_cast<PCB_TEXT*>( aItem ) );
294 break;
295
296 case PCB_TEXTBOX_T:
297 ShowTextBoxPropertiesDialog( static_cast<PCB_TEXTBOX*>( aItem ) );
298 break;
299
300 case PCB_TABLE_T:
301 {
302 DIALOG_TABLE_PROPERTIES dlg( this, static_cast<PCB_TABLE*>( aItem ) );
303
304 //QuasiModal required for Scintilla auto-complete
305 dlg.ShowQuasiModal();
306 break;
307 }
308
309 case PCB_SHAPE_T :
310 ShowGraphicItemPropertiesDialog( static_cast<PCB_SHAPE*>( aItem ) );
311 break;
312
314 case PCB_DIM_CENTER_T:
315 case PCB_DIM_RADIAL_T:
317 case PCB_DIM_LEADER_T:
318 {
319 DIALOG_DIMENSION_PROPERTIES dlg( this, static_cast<PCB_DIMENSION_BASE*>( aItem ) );
320
321 dlg.ShowModal();
322 break;
323 }
324
325 case PCB_ZONE_T:
326 {
327 ZONE* zone = static_cast<ZONE*>( aItem );
328 bool success = false;
329 ZONE_SETTINGS zoneSettings;
330
331 zoneSettings << *static_cast<ZONE*>( aItem );
332
333 if( zone->GetIsRuleArea() )
334 success = InvokeRuleAreaEditor( this, &zoneSettings ) == wxID_OK;
335 else if( zone->IsOnCopperLayer() )
336 success = InvokeCopperZonesEditor( this, zone, &zoneSettings ) == wxID_OK;
337 else
338 success = InvokeNonCopperZonesEditor( this, &zoneSettings ) == wxID_OK;
339
340 if( success )
341 {
342 BOARD_COMMIT commit( this );
343 commit.Modify( zone );
344 commit.Push( _( "Edit Zone" ) );
345 zoneSettings.ExportSetting( *static_cast<ZONE*>( aItem ) );
346 }
347
348 break;
349 }
350
351 case PCB_GROUP_T:
353 static_cast<EDA_GROUP*>( static_cast<PCB_GROUP*>( aItem ) ) );
354 break;
355
356 case PCB_MARKER_T:
357 m_toolManager->GetTool<FOOTPRINT_EDITOR_CONTROL>()->CrossProbe( static_cast<PCB_MARKER*>( aItem ) );
358 break;
359
360 case PCB_POINT_T:
361 break;
362
363 default:
364 wxFAIL_MSG( wxT( "FOOTPRINT_EDIT_FRAME::OnEditItemRequest: unsupported item type " )
365 + aItem->GetClass() );
366 break;
367 }
368}
369
370
375
376
378{
379 const PCB_LAYER_ID oldLayer = GetActiveLayer();
380
381 if( oldLayer == aLayer )
382 return;
383
385
386 /*
387 * Follow the PCB editor logic for showing/hiding clearance layers: show only for
388 * the active copper layer or a front/back non-copper layer.
389 */
390 const auto getClearanceLayerForActive = []( PCB_LAYER_ID aActiveLayer ) -> std::optional<int>
391 {
392 if( IsCopperLayer( aActiveLayer ) )
393 return CLEARANCE_LAYER_FOR( aActiveLayer );
394
395 return std::nullopt;
396 };
397
398 if( std::optional<int> oldClearanceLayer = getClearanceLayerForActive( oldLayer ) )
399 GetCanvas()->GetView()->SetLayerVisible( *oldClearanceLayer, false );
400
401 if( std::optional<int> newClearanceLayer = getClearanceLayerForActive( aLayer ) )
402 GetCanvas()->GetView()->SetLayerVisible( *newClearanceLayer, true );
403
404 m_appearancePanel->OnLayerChanged();
405
406 m_toolManager->RunAction( PCB_ACTIONS::layerChanged ); // notify other tools
407 GetCanvas()->SetFocus(); // allow capture of hotkeys
409 GetCanvas()->Refresh();
410}
411
412
413bool FOOTPRINT_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl )
414{
416
417 if( !ImportFootprint( aFileSet[ 0 ] ) )
418 return false;
419
420 if( GetBoard()->GetFirstFootprint() )
422
423 Zoom_Automatique( false );
424 GetCanvas()->Refresh();
425
426 return true;
427}
428
429
431{
432 const std::string& payload = mail.GetPayload();
433
434 switch( mail.Command() )
435 {
436 case MAIL_FP_EDIT:
437 if( !payload.empty() )
438 {
439 wxFileName fpFileName( payload );
440 wxString libNickname;
441 wxString msg;
442
444 std::optional<LIBRARY_TABLE_ROW*> optRow = adapter->FindRowByURI( fpFileName.GetPath() );
445
446 if( !optRow )
447 {
448 msg.Printf( _( "The current configuration does not include the footprint library '%s'." ),
449 fpFileName.GetPath() );
450 msg += wxS( "\n" ) + _( "Use Manage Footprint Libraries to edit the configuration." );
451 DisplayErrorMessage( this, _( "Library not found in footprint library table." ),
452 msg );
453 break;
454 }
455
456 libNickname = ( *optRow )->Nickname();
457
458 if( !adapter->HasLibrary( libNickname, true ) )
459 {
460 msg.Printf( _( "The footprint library '%s' is not enabled in the current configuration." ),
461 libNickname );
462 msg += wxS( "\n" ) + _( "Use Manage Footprint Libraries to edit the configuration." );
463 DisplayErrorMessage( this, _( "Footprint library not enabled." ), msg );
464 break;
465 }
466
467 LIB_ID fpId( libNickname, fpFileName.GetName() );
468
469 if( m_treePane )
470 {
471 m_treePane->GetLibTree()->SelectLibId( fpId );
472 wxCommandEvent event( EVT_LIBITEM_CHOSEN );
473 wxPostEvent( m_treePane, event );
474 }
475 }
476
477 break;
478
480 {
481 LIB_ID fpId;
482
483 if( fpId.Parse( wxString::FromUTF8( payload ) ) == -1 && fpId.IsValid() )
484 {
486 Raise();
487 }
488
489 break;
490 }
491
493 mail.SetPayload( SaveModifiedLibraryTabs() ? "success" : "failed" );
494 break;
495
497 mail.SetPayload( HasModifiedFootprintTabs( true ) ? "yes" : "no" );
498 break;
499
500 case MAIL_RELOAD_LIB:
501 SyncLibraryTree( true );
503 break;
504
505 default:
506 break;
507 }
508}
static TOOL_ACTION groupProperties
Definition actions.h:244
void SetContentModified(bool aModified=true)
Definition base_screen.h:55
BASIC_FOOTPRINT_INFO(FOOTPRINT *aFootprint)
void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:99
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
Definition board.h:713
COLOR4D GetColor(int aLayer) const
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
Definition commit.h:102
int ShowModal() override
void ReCreateMenuBar()
Recreate the menu bar.
virtual void ReCreateHToolbar()
virtual void Zoom_Automatique(bool aWarpPointer)
Redraw the screen with best zoom level and the best centering that shows all the page or the board.
KIGFX::VIEW_CONTROLS * GetViewControls() const
Return a pointer to the KIGFX::VIEW_CONTROLS instance used in the panel.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
void SetFocus() override
A set of EDA_ITEMs (i.e., without duplicates).
Definition eda_group.h:43
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:110
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition eda_item.h:160
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition eda_text.h:118
Module editor specific tools.
bool SaveModifiedLibraryTabs()
Save every tab with unsaved edits to a library footprint, then return to the tab that was active.
void editFootprintProperties(FOOTPRINT *aFootprint)
Run the Footprint Properties dialog and handle changes made in it.
void Clear_Pcb()
Delete all and reinitialize the current board.
Definition initpcb.cpp:107
void UpdateLibraryTree(const wxDataViewItem &treeItem, FOOTPRINT *aFootprint)
Update a single node in the library tree.
void SyncLibraryTree(bool aProgress)
Synchronize the footprint library tree to the current state of the footprint library table.
void UpdateMsgPanel() override
Redraw the message panel.
EDITOR_TABS_PANEL * m_tabsPanel
bool SaveFootprint(FOOTPRINT *aFootprint)
Save in an existing library a given footprint.
void OnTabCharHook(wxKeyEvent &aEvent)
Cycle footprint tabs from the CHAR_HOOK stream, since GTK cannot register WXK_TAB as a menu accelerat...
void LoadFootprintFromLibrary(LIB_ID aFPID)
bool BeginNewFootprint(const wxString &aLibrary)
Prepare the editor for a new footprint, returning false if the user cancels.
FOOTPRINT * ImportFootprint(const wxString &aName=wxT(""))
Read a file containing only one footprint.
bool IsContentModified() const override
Get if any footprints or libraries have been modified but not saved.
void UpdateUserInterface()
Update the layer manager and other widgets from the board setup (layer and items visibility,...
wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > m_adapter
void centerItemIdleHandler(wxIdleEvent &aEvent)
void RenameFootprintTab(const LIB_ID &aOldId, const LIB_ID &aNewId)
Update the open tab for aOldId, if any, to the renamed footprint aNewId so its label and key track th...
bool HasModifiedFootprintTabs(bool aLibraryOnly=false) const
Return true if any footprint editor tab has unsaved changes, or with aLibraryOnly any tab holding a l...
bool HandleUnsavedChanges(bool aFromBoardOnly)
Prompt to save each dirty tab that meets the requirements.
void KiwayMailIn(KIWAY_MAIL_EVENT &mail) override
Receive KIWAY_MAIL_EVENT messages from other players.
void OnEditItemRequest(BOARD_ITEM *aItem) override
Install the corresponding dialog editor for the given item.
void UpdateView()
Reload displayed items and sets view.
void AdvanceFootprintTab(bool aForward)
Advance the active tab forward or backward in MRU order.
void SetActiveLayer(PCB_LAYER_ID aLayer) override
void AddFootprintToBoard(FOOTPRINT *aFootprint) override
Override from PCB_BASE_EDIT_FRAME which adds a footprint to the editor's dummy board,...
bool activeBoardOwnedByTab() const
True when a tab context owns the frame's borrowed board, so the frame must not delete it.
void CloseActiveFootprintTab()
Request closing the active tab, prompting to save if it is modified.
FOOTPRINT_TREE_PANE * m_treePane
void RefreshLibraryTree()
Redisplay the library tree.
bool OpenProjectFiles(const std::vector< wxString > &aFileSet, int aCtl=0) override
Load a KiCad board (.kicad_pcb) from aFileName.
COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const override
Helper to retrieve the current color settings.
Helper class to handle the list of footprints available in libraries.
wxString m_doc
Footprint description.
wxString m_fpname
Module name.
wxString m_keywords
Footprint keywords.
wxString m_nickname
library as known in FP_LIB_TABLE
An interface to the global shared library manager that is schematic-specific and linked to one projec...
wxString GetLibDescription() const
Definition footprint.h:449
PCB_FIELD & Value()
read/write accessors:
Definition footprint.h:831
const LIB_ID & GetFPID() const
Definition footprint.h:417
void SetReference(const wxString &aReference)
Definition footprint.h:799
void SetValue(const wxString &aValue)
Definition footprint.h:822
PCB_FIELD & Reference()
Definition footprint.h:832
wxString GetKeywords() const
Definition footprint.h:452
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:101
virtual void SetCrossHairCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true)=0
Move the graphic crosshair cursor to the requested position expressed in world coordinates.
virtual wxString GetClass() const =0
Return the class name.
void SetLayerVisible(int aLayer, bool aVisible=true)
Control the visibility of a particular layer.
Definition view.h:431
Carry a payload from one KIWAY_PLAYER to another within a PROJECT.
Definition kiway_mail.h:34
std::string & GetPayload()
Return the payload, which can be any text but it typically self identifying s-expression.
Definition kiway_mail.h:52
void SetPayload(const std::string &aPayload)
Definition kiway_mail.h:53
MAIL_T Command()
Returns the MAIL_T associated with this mail.
Definition kiway_mail.h:44
std::optional< LIBRARY_TABLE_ROW * > FindRowByURI(const wxString &aUri, LIBRARY_TABLE_SCOPE aScope=LIBRARY_TABLE_SCOPE::BOTH) const
Like LIBRARY_MANAGER::FindRowByURI but filtered to the LIBRARY_TABLE_TYPE of this adapter.
bool HasLibrary(const wxString &aNickname, bool aCheckEnabled=false) const
Test for the existence of aNickname in the library tables.
A logical library item identifier and consists of various portions much like a URI.
Definition lib_id.h:45
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
Definition lib_id.cpp:65
bool IsValid() const
Check if this LID_ID is valid.
Definition lib_id.h:168
const UTF8 & GetLibItemName() const
Definition lib_id.h:98
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition lib_id.h:83
Node type: LIB_ID.
void Update(LIB_TREE_ITEM *aItem)
Update the node using data from a LIB_ALIAS object.
Definition pad.h:61
static TOOL_ACTION layerChanged
int ShowTextBoxPropertiesDialog(PCB_TEXTBOX *aTextBox)
APPEARANCE_CONTROLS * GetAppearancePanel()
APPEARANCE_CONTROLS * m_appearancePanel
void ShowReferenceImagePropertiesDialog(BOARD_ITEM *aBitmap)
void ShowBarcodePropertiesDialog(PCB_BARCODE *aText)
void ShowGraphicItemPropertiesDialog(PCB_SHAPE *aShape)
void ShowPadPropertiesDialog(PAD &aPad)
void setFPWatcher(FOOTPRINT *aFootprint)
Create or removes a watcher on the specified footprint.
virtual void SetActiveLayer(PCB_LAYER_ID aLayer)
FOOTPRINT * LoadFootprint(const LIB_ID &aFootprintId)
Attempt to load aFootprintId from the footprint library table.
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
virtual PCB_LAYER_ID GetActiveLayer() const
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
BOARD * GetBoard() const
virtual void Update3DView(bool aMarkDirty, bool aRefresh, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
Abstract dimension API.
void ChangeHighContrastLayer(PCB_LAYER_ID aLayer)
Follow an active layer change when nothing else that colours items has changed.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the KIGFX::VIEW instance used in the panel.
A set of BOARD_ITEMs (i.e., without duplicates).
Definition pcb_group.h:51
static FOOTPRINT_LIBRARY_ADAPTER * FootprintLibAdapter(PROJECT *aProject)
TOOL_MANAGER * m_toolManager
wxString wx_str() const
Definition utf8.cpp:41
Handle zones parameters.
void ExportSetting(ZONE &aTarget, bool aFullExport=true) const
Copy settings to a given zone.
Handle a list of polygons defining a copper zone.
Definition zone.h:70
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
Definition zone.h:834
bool IsOnCopperLayer() const override
Definition zone.cpp:652
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition confirm.cpp:217
This file is part of the common library.
int InvokeCopperZonesEditor(PCB_BASE_FRAME *aCaller, ZONE *aZone, ZONE_SETTINGS *aSettings, CONVERT_SETTINGS *aConvertSettings)
Invoke a modal dialog window for copper zone editing.
int InvokeNonCopperZonesEditor(PCB_BASE_FRAME *aParent, ZONE_SETTINGS *aSettings, CONVERT_SETTINGS *aConvertSettings)
Invoke a modal dialog window for non-copper zone editing.
int InvokeRuleAreaEditor(PCB_BASE_FRAME *aCaller, ZONE_SETTINGS *aZoneSettings, BOARD *aBoard, CONVERT_SETTINGS *aConvertSettings)
Invoke a modal dialog window for copper zone editing.
#define _(s)
PROJECT & Prj()
Definition kicad.cpp:730
bool IsCopperLayer(int aLayerId)
Test whether a layer is a copper layer.
Definition layer_ids.h:744
@ LAYER_GRID
Definition layer_ids.h:250
#define CLEARANCE_LAYER_FOR(boardLayer)
Definition layer_ids.h:399
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56
@ MAIL_LIB_HAS_UNSAVED
Definition mail_type.h:70
@ MAIL_FP_EDIT_LIBID
Definition mail_type.h:53
@ MAIL_FP_EDIT
Definition mail_type.h:52
@ MAIL_RELOAD_LIB
Definition mail_type.h:55
@ MAIL_LIB_SAVE_ALL
Definition mail_type.h:69
BARCODE class definition.
Class to handle a set of BOARD_ITEMs.
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
Definition typeinfo.h:80
@ PCB_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
Definition typeinfo.h:98
@ PCB_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
Definition typeinfo.h:95
@ PCB_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
Definition typeinfo.h:96
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
Definition typeinfo.h:103
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
Definition typeinfo.h:85
@ PCB_ZONE_T
class ZONE, a copper pour area
Definition typeinfo.h:100
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
Definition typeinfo.h:84
@ PCB_REFERENCE_IMAGE_T
class PCB_REFERENCE_IMAGE, bitmap on a layer
Definition typeinfo.h:81
@ PCB_FIELD_T
class PCB_FIELD, text associated with a footprint property
Definition typeinfo.h:82
@ PCB_MARKER_T
class PCB_MARKER, a marker used to show something
Definition typeinfo.h:91
@ PCB_BARCODE_T
class PCB_BARCODE, a barcode (graphic item)
Definition typeinfo.h:93
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition typeinfo.h:78
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
Definition typeinfo.h:94
@ PCB_PAD_T
class PAD, a pad in a footprint
Definition typeinfo.h:79
@ PCB_TABLE_T
class PCB_TABLE, table of PCB_TABLECELLs
Definition typeinfo.h:86
@ PCB_POINT_T
class PCB_POINT, a 0-dimensional point
Definition typeinfo.h:105
@ PCB_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension
Definition typeinfo.h:97
VECTOR2< double > VECTOR2D
Definition vector2d.h:707