66#include <wx/hyperlink.h>
68using namespace std::placeholders;
78 m_pickerItem( nullptr )
91 m_frame = getEditFrame<PCB_BASE_FRAME>();
119 const wxString fn = *aEvent.
Parameter<wxString*>();
127 const wxString fn = *aEvent.
Parameter<wxString*>();
141template<
class T>
void Flip( T& aValue )
175 getEditFrame<PCB_EDIT_FRAME>()->SetElementVisibility(
LAYER_RATSNEST,
215 if(
Pgm().GetCommonSettings()->m_DoNotShowAgain.zone_fill_warning )
218 bool unfilledZones =
false;
220 for(
const ZONE* zone :
board()->Zones() )
222 if( !zone->GetIsRuleArea() && !zone->IsFilled() )
224 unfilledZones =
true;
232 wxHyperlinkCtrl* button =
new wxHyperlinkCtrl( infobar, wxID_ANY,
_(
"Don't show again" ),
235 button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<
void( wxHyperlinkEvent& aEvent )>(
236 [&]( wxHyperlinkEvent& aEvent )
238 Pgm().GetCommonSettings()->m_DoNotShowAgain.zone_fill_warning =
true;
246 msg.Printf(
_(
"Not all zones are filled. Use Edit > Fill All Zones (%s) "
247 "if you wish to see all fills." ),
306 ? HIGH_CONTRAST_MODE::DIMMED
307 : HIGH_CONTRAST_MODE::NORMAL;
334 if( !
Pgm().GetCommonSettings()->m_Input.hotkey_feedback )
339 wxArrayString labels;
340 labels.Add(
_(
"Normal" ) );
341 labels.Add(
_(
"Dimmed" ) );
342 labels.Add(
_(
"Hidden" ) );
351 popup->
Popup(
_(
"Inactive Layer Display" ), labels,
365 case NET_COLOR_MODE::ALL: opts.
m_NetColorMode = NET_COLOR_MODE::RATSNEST;
break;
366 case NET_COLOR_MODE::RATSNEST: opts.
m_NetColorMode = NET_COLOR_MODE::OFF;
break;
367 case NET_COLOR_MODE::OFF: opts.
m_NetColorMode = NET_COLOR_MODE::ALL;
break;
391 getEditFrame<PCB_EDIT_FRAME>()->SetElementVisibility(
LAYER_RATSNEST,
415 int startLayer = layer;
417 while( startLayer != ++layer )
438 int startLayer = layer;
440 while( startLayer != --layer )
475#define ALPHA_MIN 0.20
476#define ALPHA_MAX 1.00
477#define ALPHA_STEP 0.05
489 settings->
SetColor( currentLayer, currentColor );
517 settings->
SetColor( currentLayer, currentColor );
571 [
this](
const VECTOR2D& pt ) ->
bool
593#define HITTEST_THRESHOLD_PIXELS 5
612 [
this](
const VECTOR2D& aPosition ) ->
bool
618 m_statusPopup.reset( new STATUS_TEXT_POPUP( m_frame ) );
619 m_statusPopup->SetText( _(
"Item locked." ) );
620 m_statusPopup->PopupFor( 2000 );
621 m_statusPopup->Move( KIPLATFORM::UI::GetMousePosition()
622 + wxPoint( 20, 20 ) );
656 for(
int i = collector.
GetCount() - 1; i >= 0; --i )
658 if( !selectionTool->
Selectable( collector[ i ] ) )
680 [
this](
const int& aFinalState )
699 std::vector<BOARD_ITEM*>& aPastedItems )
707 pad->SetParent( editorFootprint );
708 aPastedItems.push_back(
pad );
711 aClipFootprint->
Pads().clear();
726 VECTOR2I pos = item->GetFPRelativePosition();
727 item->SetParent( editorFootprint );
728 item->SetFPRelativePosition( pos );
730 aPastedItems.push_back( item );
735 for(
ZONE* zone : aClipFootprint->
Zones() )
737 zone->SetParent( editorFootprint );
738 aPastedItems.push_back( zone );
741 aClipFootprint->
Zones().clear();
745 group->SetParent( editorFootprint );
746 aPastedItems.push_back(
group );
749 aClipFootprint->
Groups().clear();
763 std::vector<BOARD_ITEM*> returnItems;
764 bool fpItemDeleted =
false;
769 LSET allowed = aItem->GetLayerSet() & enabledLayers;
774 if( aItem->HasHole() && aItem->IsOnCopperLayer() )
777 aItem->SetLayerSet( allowed );
781 aFootprint->
Remove( aItem );
782 fpItemDeleted =
true;
801 for(
int ii =
static_cast<int>( fp->
Pads().size() ) - 1; ii >= 0; ii-- )
802 processFPItem( fp, fp->
Pads()[ii] );
804 for(
int ii =
static_cast<int>( fp->
Zones().size() ) - 1; ii >= 0; ii-- )
805 processFPItem( fp, fp->
Zones()[ii] );
807 for(
int ii =
static_cast<int>( fp->
GraphicalItems().size() ) - 1; ii >= 0; ii-- )
811 returnItems.push_back( fp );
815 returnItems.push_back( item );
819 LSET allowed = item->GetLayerSet() & enabledLayers;
823 item->SetLayerSet( allowed );
824 returnItems.push_back( item );
829 if( ( returnItems.size() < aItems.size() ) || fpItemDeleted )
832 "present in the current board.\n"
833 "These items could not be pasted.\n" ) );
836 aItems = returnItems;
852 PASTE_MODE mode = PASTE_MODE::KEEP_ANNOTATIONS;
853 const wxString defaultRef = wxT(
"REF**" );
859 if( dlg.ShowModal() == wxID_CANCEL )
867 if( isFootprintEditor )
883 bool cancelled =
false;
885 switch( clipItem->
Type() )
889 BOARD* clipBoard =
static_cast<BOARD*
>( clipItem );
891 if( isFootprintEditor )
894 std::vector<BOARD_ITEM*> pastedItems;
898 group->SetParent( editorFootprint );
899 pastedItems.push_back(
group );
902 clipBoard->
Groups().clear();
909 switch( clipDrawItem->Type() )
919 clipDrawItem->SetParent( editorFootprint );
920 pastedItems.push_back( clipDrawItem );
925 parentGroup->RemoveItem( clipDrawItem );
934 [&](
EDA_ITEM* item,
void* testData )
944 return INSPECT_RESULT::CONTINUE;
953 mode == PASTE_MODE::UNIQUE_ANNOTATIONS );
957 if( mode == PASTE_MODE::REMOVE_ANNOTATIONS )
960 clipFootprint->SetReference( defaultRef );
964 mode == PASTE_MODE::UNIQUE_ANNOTATIONS );
973 std::vector<BOARD_ITEM*> pastedItems;
975 if( isFootprintEditor )
978 delete clipFootprint;
982 if( mode == PASTE_MODE::REMOVE_ANNOTATIONS )
986 pastedItems.push_back( clipFootprint );
992 mode == PASTE_MODE::UNIQUE_ANNOTATIONS );
1004 commit.
Push(
_(
"Paste" ) );
1038 std::copy_if( aList.begin(), aList.end(), std::back_inserter( aTarget ),
1041 bool doCopy = ( aItem->GetFlags() & SKIP_STRUCT ) == 0;
1043 aItem->ClearFlags( SKIP_STRUCT );
1044 aItem->SetFlags( aIsNew ? IS_NEW : 0 );
1056 if( aList.size() == 0 )
1059 auto obj = aList.front();
1073 aTarget.push_back( obj );
1089 obj = idx < int(aList.size()-1) ? aList[++idx] :
nullptr;
1097 bool aReannotateDuplicates )
1100 bool isNew =
board() != aBoard;
1101 std::vector<BOARD_ITEM*> items;
1117 return placeBoardItems( aCommit, items, isNew, aAnchorAtOrigin, aReannotateDuplicates );
1122 bool aIsNew,
bool aAnchorAtOrigin,
bool aReannotateDuplicates )
1128 std::vector<BOARD_ITEM*> itemsToSel;
1129 itemsToSel.reserve( aItems.size() );
1135 const_cast<KIID&
>( item->m_Uuid ) =
KIID();
1167 if( !item->GetParentGroup() || !
alg::contains( aItems, item->GetParentGroup() ) )
1168 itemsToSel.push_back( item );
1172 EDA_ITEMS toSel( itemsToSel.begin(), itemsToSel.end() );
1182 aCommit->
Add( item );
1184 aCommit->
Added( item );
1191 if( aAnchorAtOrigin )
1243 std::map<wxString, wxString> oldProperties = brd->
GetProperties();
1244 std::map<wxString, wxString> newProperties;
1260 props[
"page_width"] = std::to_string( editFrame->
GetPageSizeIU().
x );
1261 props[
"page_height"] = std::to_string( editFrame->
GetPageSizeIU().
y );
1264 [&]( wxString aTitle,
int aIcon, wxString aMessage, wxString aAction ) ->
bool
1266 KIDIALOG dlg( editFrame, aMessage, aTitle, wxOK | wxCANCEL | aIcon );
1268 if( !aAction.IsEmpty() )
1269 dlg.SetOKLabel( aAction );
1279 pi.
LoadBoard( fileName, brd, &props,
nullptr, &progressReporter );
1283 wxString msg = wxString::Format(
_(
"Error loading board.\n%s" ), ioe.
What() );
1291 for(
const std::pair<const wxString, wxString>& prop : oldProperties )
1292 newProperties[ prop.first ] = prop.second;
1308 if( copperLayerCount > initialCopperLayerCount )
1313 enabledLayers |= initialEnabledLayers;
1318 commit.
Push(
_(
"Append Board" ) );
1329 wxCommandEvent
dummy;
1341 wxCommandEvent
dummy;
1362 snapMode = !snapMode;
1372 if( !
Pgm().GetCommonSettings()->m_Input.hotkey_feedback )
1375 wxArrayString labels;
1376 labels.Add(
_(
"Active Layer" ) );
1377 labels.Add(
_(
"All Layers" ) );
1389 popup->
Popup(
_(
"Object Snapping" ), labels,
static_cast<int>( settings.
allLayers ) );
1404 std::vector<MSG_PANEL_ITEM> msgItems;
1406 if( routerTool && routerTool->RoutingInProgress() )
1408 routerTool->UpdateMessagePanel();
1447 if( a_conn && b_conn )
1453 if( overlap.count() > 0
1454 && ( a_netcode != b_netcode || a_netcode < 0 || b_netcode < 0 ) )
1463 int actual_clearance = a_shape->GetClearance( b_shape.get() );
1465 msgItems.emplace_back(
_(
"Resolved clearance" ),
1468 if( actual_clearance > -1 && actual_clearance < std::numeric_limits<int>::max() )
1470 msgItems.emplace_back(
_(
"Actual clearance" ),
1492 int actual = std::numeric_limits<int>::max();
1499 actual = std::min( actual, hole->GetClearance( other.get() ) );
1507 actual = std::min( actual, hole->GetClearance( other.get() ) );
1510 if( actual < std::numeric_limits<int>::max() )
1513 msgItems.emplace_back(
_(
"Resolved hole clearance" ),
1516 if( actual > -1 && actual < std::numeric_limits<int>::max() )
1518 msgItems.emplace_back(
_(
"Actual hole clearance" ),
1551 msgItems.emplace_back(
_(
"Resolved edge clearance" ),
1556 msgItems.emplace_back(
_(
"Resolved margin clearance" ),
1563 if( msgItems.empty() )
1567 msgItems.emplace_back(
_(
"Selected Items" ),
1570 std::set<wxString> netNames;
1571 std::set<wxString> netClasses;
1578 netClasses.insert(
UnescapeString( bci->GetEffectiveNetClass()->GetName() ) );
1580 if( netNames.size() > 1 && netClasses.size() > 1 )
1585 if( netNames.size() == 1 )
1586 msgItems.emplace_back(
_(
"Net" ), *netNames.begin() );
1588 if( netClasses.size() == 1 )
1589 msgItems.emplace_back(
_(
"Resolved Netclass" ), *netClasses.begin() );
1605 wxFileName fileName = wxFileName( *aEvent.
Parameter<wxString*>() );
1612 wxString filePath = fileName.GetFullPath();
static TOOL_ACTION addLibrary
static TOOL_ACTION pickerTool
static TOOL_ACTION gridResetOrigin
static TOOL_ACTION pasteSpecial
static TOOL_ACTION highContrastModeCycle
static TOOL_ACTION highContrastMode
static TOOL_ACTION deleteTool
static TOOL_ACTION newLibrary
static TOOL_ACTION gridSetOrigin
static TOOL_ACTION ddAddLibrary
virtual void Revert() override
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
std::shared_ptr< NET_SETTINGS > m_NetSettings
void SetGridOrigin(const VECTOR2I &aOrigin)
std::shared_ptr< DRC_ENGINE > m_DRCEngine
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
PCB_GROUP * GetParentGroup() const
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Test to see if this object is on the given layer.
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
virtual LSET GetLayerSet() const
Return a std::bitset of all layers on which the item physically resides.
virtual bool IsLocked() const
virtual bool IsOnCopperLayer() const
virtual std::shared_ptr< SHAPE_SEGMENT > GetEffectiveHoleShape() const
virtual bool HasHole() const
Information pertinent to a Pcbnew printed circuit board.
INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &scanTypes) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
void SetEnabledLayers(LSET aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings.
const PAGE_INFO & GetPageSettings() const
void SetProperties(const std::map< wxString, wxString > &aProps)
bool BuildConnectivity(PROGRESS_REPORTER *aReporter=nullptr)
Build or rebuild the board connectivity database for the board, especially the list of connected item...
void SynchronizeNetsAndNetClasses(bool aResetTrackAndViaSizes)
Copy NETCLASS info to each NET, based on NET membership in a NETCLASS.
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
TITLE_BLOCK & GetTitleBlock()
FOOTPRINTS & Footprints()
int GetCopperLayerCount() const
const std::map< wxString, wxString > & GetProperties() const
GROUPS & Groups()
The groups must maintain the following invariants.
void SetPageSettings(const PAGE_INFO &aPageSettings)
void SetVisibleLayers(LSET aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings changes the bit-mask of vis...
void SetCopperLayerCount(int aCount)
bool IsLayerVisible(PCB_LAYER_ID aLayer) const
A proxy function that calls the correspondent function in m_BoardSettings tests whether a given layer...
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)
int GetCount() const
Return the number of objects in the list.
void Remove(int aIndex)
Remove the item at aIndex (first position is 0).
Color settings are a bit different than most of the settings objects in that there can be more than o...
void SetColor(int aLayer, const COLOR4D &aColor)
COLOR4D GetColor(int aLayer) const
COMMIT & Added(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Remove a new item from the model.
COMMIT & Add(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Notify observers that aItem has been added.
bool IsType(FRAME_T aType) const
WX_INFOBAR * GetInfoBar()
HOTKEY_CYCLE_POPUP * GetHotkeyPopup()
void DisplayToolMsg(const wxString &msg) override
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
virtual COLOR4D GetGridColor()
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.
virtual void CreateHotkeyPopup()
void ForceRefresh()
Force a redraw.
void SetCurrentCursor(KICURSOR aCursor)
Set the current cursor shape for this panel.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
A base class for most all the KiCad significant classes used in schematics and boards.
virtual VECTOR2I GetPosition() const
virtual void SetPosition(const VECTOR2I &aPos)
void SetFlags(EDA_ITEM_FLAGS aMask)
KICAD_T Type() const
Returns the type of object.
virtual void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
virtual wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const
Return a user-visible description string of this item.
virtual void SetParent(EDA_ITEM *aParent)
static const TOOL_EVENT ClearedEvent
static const TOOL_EVENT SelectedEvent
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
static const TOOL_EVENT PointSelectedEvent
static const TOOL_EVENT ContrastModeChangedByKeyEvent
static const TOOL_EVENT ConnectivityChangedEvent
Selected item had a property changed (except movement)
static const TOOL_EVENT UnselectedEvent
A general implementation of a COLLECTORS_GUIDE.
Used when the right click button is pressed, or when the select tool is in effect.
static const std::vector< KICAD_T > BoardLevelItems
A scan list for all primary board items, omitting items which are subordinate to a FOOTPRINT,...
static const std::vector< KICAD_T > AllBoardItems
A scan list for all editable board items.
void Collect(BOARD_ITEM *aItem, const std::vector< KICAD_T > &aScanList, const VECTOR2I &aRefPos, const COLLECTORS_GUIDE &aGuide)
Scan a BOARD_ITEM using this class's Inspector method, which does the collection.
static const std::vector< KICAD_T > FootprintItems
A scan list for primary footprint items.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
PCB_FILE_T
The set of file types that the IO_MGR knows about, and for which there has been a plugin written,...
static PCB_FILE_T FindPluginTypeFromBoardPath(const wxString &aFileName, int aCtl=0)
Return a plugin type given a path for a board file.
static PLUGIN * PluginFind(PCB_FILE_T aFileType)
Return a PLUGIN which the caller can use to import, export, save, or load design documents.
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
void DoNotShowCheckbox(wxString file, int line)
Checks the 'do not show again' setting for the dialog.
A color representation with 4 components: red, green, blue, alpha.
void SetGridOrigin(const VECTOR2D &aGridOrigin)
Set the origin point for the grid.
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const override
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
virtual void SetCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true, bool aTriggeredByArrows=false, long aArrowCommand=0)=0
Move cursor to the requested position expressed in world coordinates.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
void SetMirror(bool aMirrorX, bool aMirrorY)
Control the mirroring of the VIEW.
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
virtual void Remove(VIEW_ITEM *aItem)
Remove a VIEW_ITEM from the view.
GAL * GetGAL() const
Return the #GAL this view is using to draw graphical primitives.
void RecacheAllItems()
Rebuild GAL display lists.
void UpdateLayerColor(int aLayer)
Apply the new coloring scheme held by RENDER_SETTINGS in case that it has changed.
void MarkDirty()
Force redraw of view on the next rendering.
LSET is a set of PCB_LAYER_IDs.
LSEQ CuStack() const
Return a sequence of copper layers in starting from the front/top and extending to the back/bottom.
static LSET InternalCuMask()
Return a complete set of internal copper layers which is all Cu layers except F_Cu and B_Cu.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
EDA_MSG_PANEL items for displaying messages.
static NETINFO_ITEM * OrphanedItem()
NETINFO_ITEM meaning that there was no net assigned for an item, as there was no board storing net li...
Describe the page size and margins of a paper page on which to eventually print or plot.
MAGNETIC_SETTINGS m_MagneticItems
static TOOL_ACTION layerToggle
static TOOL_ACTION layerInner12
static TOOL_ACTION layerInner8
static TOOL_ACTION zoneDisplayToggle
static TOOL_ACTION layerInner3
static TOOL_ACTION layerPrev
static TOOL_ACTION showRatsnest
static TOOL_ACTION zoneFillAll
static TOOL_ACTION layerInner2
static TOOL_ACTION magneticSnapAllLayers
static TOOL_ACTION ddAppendBoard
Drag and drop.
static TOOL_ACTION layerInner25
static TOOL_ACTION magneticSnapActiveLayer
Snapping controls.
static TOOL_ACTION layerAlphaDec
static TOOL_ACTION zoneDisplayFilled
static TOOL_ACTION layerInner24
static TOOL_ACTION viaDisplayMode
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION layerInner29
static TOOL_ACTION layerInner11
static TOOL_ACTION layerAlphaInc
static TOOL_ACTION layerInner16
static TOOL_ACTION layerInner26
static TOOL_ACTION layerInner18
static TOOL_ACTION layerInner14
static TOOL_ACTION trackDisplayMode
static TOOL_ACTION magneticSnapToggle
static TOOL_ACTION layerInner6
static TOOL_ACTION ddImportFootprint
static TOOL_ACTION zoneDisplayTriangulated
static TOOL_ACTION layerInner22
static TOOL_ACTION layerInner5
static TOOL_ACTION zoneDisplayFractured
static TOOL_ACTION ratsnestModeCycle
static TOOL_ACTION layerInner20
static TOOL_ACTION layerInner7
static TOOL_ACTION layerInner27
static TOOL_ACTION appendBoard
static TOOL_ACTION netColorModeCycle
static TOOL_ACTION layerInner1
static TOOL_ACTION layerInner10
static TOOL_ACTION layerInner15
static TOOL_ACTION layerInner17
static TOOL_ACTION flipBoard
static TOOL_ACTION layerBottom
static TOOL_ACTION zoneDisplayOutline
static TOOL_ACTION ratsnestLineMode
static TOOL_ACTION layerInner19
static TOOL_ACTION layerInner9
static TOOL_ACTION move
move or drag an item
static TOOL_ACTION layerInner30
static TOOL_ACTION layerTop
static TOOL_ACTION selectItems
Select a list of items (specified as the event parameter)
static TOOL_ACTION layerInner4
static TOOL_ACTION layerInner13
static TOOL_ACTION layerInner21
static TOOL_ACTION layerNext
static TOOL_ACTION layerInner23
static TOOL_ACTION layerInner28
Common, abstract interface for edit frames.
bool AddLibrary(const wxString &aLibName=wxEmptyString, FP_LIB_TABLE *aTable=nullptr)
Add an existing library to either the global or project library table.
void RestoreCopyFromUndoList(wxCommandEvent &aEvent)
Undo the last edit:
void RestoreCopyFromRedoList(wxCommandEvent &aEvent)
Redo the last edit:
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
virtual void OnDisplayOptionsChanged()
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
const VECTOR2I GetPageSizeIU() const override
Works off of GetPageSettings() to return the size of the paper page in the internal units of this par...
PCBNEW_SETTINGS * GetPcbNewSettings() const
virtual void SwitchLayer(PCB_LAYER_ID aLayer)
Change the active layer in the frame.
virtual PCB_LAYER_ID GetActiveLayer() const
void OnModify() override
Must be called after a change in order to set the "modify" flag and update other data structures and ...
virtual void SaveCopyInUndoList(EDA_ITEM *aItemToCopy, UNDO_REDO aTypeCommand)
Create a new entry in undo list of commands.
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Returns the BOARD_DESIGN_SETTINGS for the open project.
void SetDisplayOptions(const PCB_DISPLAY_OPTIONS &aOptions, bool aRefresh=true)
Updates the current display options from the given options struct.
GENERAL_COLLECTORS_GUIDE GetCollectorsGuide()
virtual BOARD_ITEM_CONTAINER * GetModel() const =0
FOOTPRINT_EDITOR_SETTINGS * GetFootprintEditorSettings() const
virtual COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const override
Helper to retrieve the current color settings.
int AppendBoard(PLUGIN &pi, wxString &fileName)
void setTransitions() override
< Sets up handlers for various events.
int AppendBoardFromFile(const TOOL_EVENT &aEvent)
int AddLibrary(const TOOL_EVENT &aEvent)
int DdAppendBoard(const TOOL_EVENT &aEvent)
int DdImportFootprint(const TOOL_EVENT &aEvent)
int SnapModeFeedback(const TOOL_EVENT &aEvent)
int NetColorModeCycle(const TOOL_EVENT &aEvent)
int RatsnestModeCycle(const TOOL_EVENT &aEvent)
int TrackDisplayMode(const TOOL_EVENT &aEvent)
int DdAddLibrary(const TOOL_EVENT &aEvent)
int Redo(const TOOL_EVENT &aEvent)
int UpdateMessagePanel(const TOOL_EVENT &aEvent)
int LayerAlphaDec(const TOOL_EVENT &aEvent)
int LayerNext(const TOOL_EVENT &aEvent)
std::unique_ptr< STATUS_TEXT_POPUP > m_statusPopup
int ToggleRatsnest(const TOOL_EVENT &aEvent)
int LayerAlphaInc(const TOOL_EVENT &aEvent)
int HighContrastModeCycle(const TOOL_EVENT &aEvent)
std::unique_ptr< KIGFX::ORIGIN_VIEWITEM > m_gridOrigin
int Quit(const TOOL_EVENT &aEvent)
int HighContrastMode(const TOOL_EVENT &aEvent)
int Undo(const TOOL_EVENT &aEvent)
int ViaDisplayMode(const TOOL_EVENT &aEvent)
PCB_BASE_FRAME * m_frame
Grid origin marker.
static void DoSetGridOrigin(KIGFX::VIEW *aView, PCB_BASE_FRAME *aFrame, EDA_ITEM *originViewItem, const VECTOR2D &aPoint)
void pruneItemLayers(std::vector< BOARD_ITEM * > &aItems)
Helper for pasting.
int GridPlaceOrigin(const TOOL_EVENT &aEvent)
int FlipPcbView(const TOOL_EVENT &aEvent)
int SnapMode(const TOOL_EVENT &aEvent)
bool placeBoardItems(BOARD_COMMIT *aCommit, std::vector< BOARD_ITEM * > &aItems, bool aIsNew, bool aAnchorAtOrigin, bool aReannotateDuplicates)
Add and select or just select for move/place command a list of board items.
int ContrastModeFeedback(const TOOL_EVENT &aEvent)
int LayerToggle(const TOOL_EVENT &aEvent)
void Reset(RESET_REASON aReason) override
Bring the tool to a known, initial state.
int DeleteItemCursor(const TOOL_EVENT &aEvent)
int Print(const TOOL_EVENT &aEvent)
int ZoneDisplayMode(const TOOL_EVENT &aEvent)
int GridResetOrigin(const TOOL_EVENT &aEvent)
BOARD_ITEM * m_pickerItem
int LayerPrev(const TOOL_EVENT &aEvent)
int Paste(const TOOL_EVENT &aEvent)
void unfilledZoneCheck()
We have bug reports indicating that some new users confuse zone filling/unfilling with the display mo...
int LayerSwitch(const TOOL_EVENT &aEvent)
HIGH_CONTRAST_MODE m_ContrastModeDisplay
How inactive layers are displayed.
NET_COLOR_MODE m_NetColorMode
How to use color overrides on specific nets and netclasses.
ZONE_DISPLAY_MODE m_ZoneDisplayMode
void UpdateColors()
Update the color settings in the painter and GAL.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void RedrawRatsnest()
Return the bounding box of the view that should be used if model is not valid.
The main frame for Pcbnew.
static const TOOL_EVENT SnappingModeChangedByKeyEvent
Hotkey feedback.
A set of BOARD_ITEMs (i.e., without duplicates).
bool RemoveItem(BOARD_ITEM *aItem)
Remove item from group.
bool AddItem(BOARD_ITEM *aItem)
Add item to group.
PCB_LAYER_ID m_Route_Layer_TOP
PCB_LAYER_ID m_Route_Layer_BOTTOM
EDA_ITEM * GetTopLeftItem(bool aFootprintsOnly=false) const override
Releases a PLUGIN in the context of a potential thrown exception through its destructor.
A base class that BOARD loading and saving plugins should derive from.
virtual void SetQueryUserCallback(std::function< bool(wxString aTitle, int aIcon, wxString aMessage, wxString aAction)> aCallback)
Registers a KIDIALOG callback for collecting info from the user.
virtual BOARD * LoadBoard(const wxString &aFileName, BOARD *aAppendToMe, const STRING_UTF8_MAP *aProperties=nullptr, PROJECT *aProject=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr)
Load information from some input file format that this PLUGIN implementation knows about into either ...
virtual void Add(EDA_ITEM *aItem)
virtual unsigned int GetSize() const override
Return the number of stored items.
int Size() const
Returns the number of selected parts.
void SetReferencePoint(const VECTOR2I &aP)
bool Empty() const
Checks if there is anything selected.
A name/value tuple with unique names and optional values.
Hold the information shown in the lower right corner of a plot, printout, or editing view.
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
A lower-precision version of StringFromValue().
A modified version of the wxInfoBar class that allows us to:
void RemoveAllButtons()
Remove all the buttons that have been added by the user.
void ShowMessageFor(const wxString &aMessage, int aTime, int aFlags=wxICON_INFORMATION, MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the infobar with the provided message and icon for a specific period of time.
void AddButton(wxButton *aButton)
Add an already created button to the infobar.
void Dismiss() override
Dismisses the infobar and updates the containing layout and AUI manager (if one is provided).
Multi-thread safe progress reporter dialog, intended for use of tasks that parallel reporting back of...
Handle a list of polygons defining a copper zone.
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
This file is part of the common library.
@ EDGE_CLEARANCE_CONSTRAINT
@ HOLE_CLEARANCE_CONSTRAINT
std::vector< ZONE * > ZONES
Declaration of the eda_3d_viewer class.
std::vector< EDA_ITEM * > EDA_ITEMS
Define list of drawing items for screens.
#define SKIP_STRUCT
flag indicating that the structure should be ignored
wxString KeyNameFromKeyCode(int aKeycode, bool *aIsFound)
Return the key name from the key code.
#define KICTL_KICAD_ONLY
chosen file is from KiCad according to user
int GetNetnameLayer(int aLayer)
Returns a netname layer corresponding to the given layer.
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
PCB_LAYER_ID
A quick note on layer IDs:
#define ZONE_LAYER_FOR(boardLayer)
PCB_LAYER_ID ToLAYER_ID(int aLayer)
@ REPAINT
Item needs to be redrawn.
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
bool AskLoadBoardFileName(PCB_EDIT_FRAME *aParent, wxString *aFileName, int aCtl=0)
Show a wxFileDialog asking for a BOARD filename to open.
static void pasteFootprintItemsToFootprintEditor(FOOTPRINT *aClipFootprint, BOARD *aBoard, std::vector< BOARD_ITEM * > &aPastedItems)
static void moveUnflaggedItems(std::deque< T > &aList, std::vector< BOARD_ITEM * > &aTarget, bool aIsNew)
Class to handle a set of BOARD_ITEMs.
bool AskLoadBoardFileName(PCB_EDIT_FRAME *aParent, wxString *aFileName, int aCtl=0)
Show a wxFileDialog asking for a BOARD filename to open.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
std::vector< FAB_LAYER_COLOR > dummy
wxString UnescapeString(const wxString &aSource)
RATSNEST_MODE m_RatsnestMode
bool m_ShowGlobalRatsnest
constexpr KICAD_T BaseType(const KICAD_T aType)
Return the underlying type of the given type.
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
@ PCB_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
@ PCB_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
@ PCB_DIMENSION_T
class PCB_DIMENSION_BASE: abstract dimension meta-type
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
@ PCB_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition of file extensions used in Kicad.