63#include <wx/hyperlink.h>
65using namespace std::placeholders;
70 bool aKicadFilesOnly =
false );
77 m_pickerItem( nullptr )
90 m_frame = getEditFrame<PCB_BASE_FRAME>();
118 const wxString fn = *aEvent.
Parameter<wxString*>();
126 const wxString fn = *aEvent.
Parameter<wxString*>();
140template<
class T>
void Flip( T& aValue )
168 getEditFrame<PCB_EDIT_FRAME>()->SetElementVisibility(
LAYER_RATSNEST,
209 if(
Pgm().GetCommonSettings()->m_DoNotShowAgain.zone_fill_warning )
212 bool unfilledZones =
false;
214 for(
const ZONE* zone :
board()->Zones() )
216 if( !zone->GetIsRuleArea() && !zone->IsFilled() )
218 unfilledZones =
true;
226 wxHyperlinkCtrl* button =
new wxHyperlinkCtrl( infobar, wxID_ANY,
_(
"Don't show again" ),
229 button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<
void( wxHyperlinkEvent& aEvent )>(
230 [&]( wxHyperlinkEvent& aEvent )
232 Pgm().GetCommonSettings()->m_DoNotShowAgain.zone_fill_warning =
true;
240 msg.Printf(
_(
"Not all zones are filled. Use Edit > Fill All Zones (%s) "
241 "if you wish to see all fills." ),
359 getEditFrame<PCB_EDIT_FRAME>()->SetElementVisibility(
LAYER_RATSNEST,
383 int startLayer = layer;
385 while( startLayer != ++layer )
406 int startLayer = layer;
408 while( startLayer != --layer )
443#define ALPHA_MIN 0.20
444#define ALPHA_MAX 1.00
445#define ALPHA_STEP 0.05
457 settings->
SetColor( currentLayer, currentColor );
485 settings->
SetColor( currentLayer, currentColor );
539 [
this](
const VECTOR2D& pt ) ->
bool
561#define HITTEST_THRESHOLD_PIXELS 5
580 [
this](
const VECTOR2D& aPosition ) ->
bool
586 m_statusPopup.reset( new STATUS_TEXT_POPUP( m_frame ) );
587 m_statusPopup->SetText( _(
"Item locked." ) );
588 m_statusPopup->PopupFor( 2000 );
589 m_statusPopup->Move( wxGetMousePosition() + wxPoint( 20, 20 ) );
623 for(
int i = collector.
GetCount() - 1; i >= 0; --i )
625 if( !selectionTool->
Selectable( collector[ i ] ) )
647 [
this](
const int& aFinalState )
666 std::vector<BOARD_ITEM*>& aPastedItems )
674 pad->SetParent( editorFootprint );
675 aPastedItems.push_back(
pad );
678 aClipFootprint->
Pads().clear();
702 text->SetParent(
nullptr );
703 text->SetLocalCoord();
706 item->SetParent( editorFootprint );
707 aPastedItems.push_back( item );
714 zone->SetParent( editorFootprint );
715 aPastedItems.push_back( zone );
718 aClipFootprint->
Zones().clear();
722 group->SetParent( editorFootprint );
723 aPastedItems.push_back(
group );
726 aClipFootprint->
Groups().clear();
740 std::vector<BOARD_ITEM*> returnItems;
741 bool fpItemDeleted =
false;
746 LSET allowed = aItem->GetLayerSet() & enabledLayers;
751 if( aItem->HasHole() && aItem->IsOnCopperLayer() )
754 aItem->SetLayerSet( allowed );
758 aFootprint->
Remove( aItem );
759 fpItemDeleted =
true;
778 for(
int ii =
static_cast<int>( fp->
Pads().size() ) - 1; ii >= 0; ii-- )
779 processFPItem( fp, fp->
Pads()[ii] );
781 for(
int ii =
static_cast<int>( fp->
Zones().size() ) - 1; ii >= 0; ii-- )
782 processFPItem( fp, fp->
Zones()[ii] );
784 for(
int ii =
static_cast<int>( fp->
GraphicalItems().size() ) - 1; ii >= 0; ii-- )
788 returnItems.push_back( fp );
792 returnItems.push_back( item );
796 LSET allowed = item->GetLayerSet() & enabledLayers;
800 item->SetLayerSet( allowed );
801 returnItems.push_back( item );
806 if( ( returnItems.size() < aItems.size() ) || fpItemDeleted )
809 "present in the current board.\n"
810 "These items could not be pasted.\n" ) );
813 aItems = returnItems;
830 const wxString defaultRef = wxT(
"REF**" );
836 if( dlg.ShowModal() == wxID_CANCEL )
844 if( isFootprintEditor )
861 switch( clipItem->
Type() )
865 BOARD* clipBoard =
static_cast<BOARD*
>( clipItem );
867 if( isFootprintEditor )
870 std::vector<BOARD_ITEM*> pastedItems;
874 group->SetParent( editorFootprint );
875 pastedItems.push_back(
group );
878 clipBoard->
Groups().clear();
895 static_cast<PCB_SHAPE*
>( pastedShape )->SwapItemData( clipShape );
899 parentGroup->
AddItem( pastedShape );
901 pastedItems.push_back( pastedShape );
913 static_cast<EDA_TEXT*
>( pastedTextItem )->SwapText( *clipTextItem );
914 static_cast<EDA_TEXT*
>( pastedTextItem )->SwapAttributes( *clipTextItem );
917 parentGroup->
AddItem( pastedTextItem );
919 pastedItems.push_back( pastedTextItem );
933 static_cast<PCB_SHAPE*
>( pastedTextBox )->SwapItemData( clipTextBox );
937 static_cast<EDA_TEXT*
>( pastedTextBox )->SwapText( *clipTextBox );
938 static_cast<EDA_TEXT*
>( pastedTextBox )->SwapAttributes( *clipTextBox );
941 parentGroup->
AddItem( pastedTextBox );
943 pastedItems.push_back( pastedTextBox );
958 clipFootprint->SetReference( defaultRef );
970 std::vector<BOARD_ITEM*> pastedItems;
972 if( isFootprintEditor )
975 delete clipFootprint;
983 pastedItems.push_back( clipFootprint );
1027 std::copy_if( aList.begin(), aList.end(), std::back_inserter( aTarget ),
1030 bool doCopy = ( aItem->GetFlags() & SKIP_STRUCT ) == 0;
1032 aItem->ClearFlags( SKIP_STRUCT );
1033 aItem->SetFlags( aIsNew ? IS_NEW : 0 );
1045 if( aList.size() == 0 )
1048 auto obj = aList.front();
1062 aTarget.push_back( obj );
1078 obj = idx < int(aList.size()-1) ? aList[++idx] :
nullptr;
1088 bool isNew =
board() != aBoard;
1089 std::vector<BOARD_ITEM*> items;
1105 return placeBoardItems( items, isNew, aAnchorAtOrigin, aReannotateDuplicates );
1110 bool aAnchorAtOrigin,
bool aReannotateDuplicates )
1117 std::vector<BOARD_ITEM*> itemsToSel;
1118 itemsToSel.reserve( aItems.size() );
1124 const_cast<KIID&
>( item->m_Uuid ) =
KIID();
1156 if( !item->GetParentGroup() || !
alg::contains( aItems, item->GetParentGroup() ) )
1157 itemsToSel.push_back( item );
1171 editTool->GetCurrentCommit()->Add( item );
1173 editTool->GetCurrentCommit()->Added( item );
1180 if( aAnchorAtOrigin )
1229 std::map<wxString, wxString> oldProperties = brd->
GetProperties();
1230 std::map<wxString, wxString> newProperties;
1247 snprintf( xbuf,
sizeof(xbuf),
"%d", editFrame->
GetPageSizeIU().
x );
1248 snprintf( ybuf,
sizeof(ybuf),
"%d", editFrame->
GetPageSizeIU().
y );
1250 props[
"page_width"] = xbuf;
1251 props[
"page_height"] = ybuf;
1254 [&]( wxString aTitle,
int aIcon, wxString aMessage, wxString aAction ) ->
bool
1256 KIDIALOG dlg( editFrame, aMessage, aTitle, wxOK | wxCANCEL | aIcon );
1258 if( !aAction.IsEmpty() )
1259 dlg.SetOKLabel( aAction );
1269 pi.
Load( fileName, brd, &props,
nullptr, &progressReporter );
1281 for(
const std::pair<const wxString, wxString>& prop : oldProperties )
1282 newProperties[ prop.first ] = prop.second;
1298 if( copperLayerCount > initialCopperLayerCount )
1303 enabledLayers |= initialEnabledLayers;
1314 wxCommandEvent
dummy;
1326 wxCommandEvent
dummy;
1344 std::vector<MSG_PANEL_ITEM> msgItems;
1346 if( routerTool && routerTool->RoutingInProgress() )
1348 routerTool->UpdateMessagePanel();
1387 if( a_conn && b_conn )
1393 if( overlap.count() > 0
1394 && ( a_netcode != b_netcode || a_netcode < 0 || b_netcode < 0 ) )
1403 int actual_clearance = a_shape->GetClearance( b_shape.get() );
1405 msgItems.emplace_back(
_(
"Resolved clearance" ),
1408 if( actual_clearance > -1 && actual_clearance < std::numeric_limits<int>::max() )
1410 msgItems.emplace_back(
_(
"Actual clearance" ),
1432 int actual = std::numeric_limits<int>::max();
1439 actual = std::min( actual, hole->GetClearance( other.get() ) );
1447 actual = std::min( actual, hole->GetClearance( other.get() ) );
1450 if( actual < std::numeric_limits<int>::max() )
1453 msgItems.emplace_back(
_(
"Resolved hole clearance" ),
1456 if( actual > -1 && actual < std::numeric_limits<int>::max() )
1458 msgItems.emplace_back(
_(
"Actual hole clearance" ),
1491 msgItems.emplace_back(
_(
"Resolved edge clearance" ),
1496 msgItems.emplace_back(
_(
"Resolved margin clearance" ),
1503 if( msgItems.empty() )
1507 msgItems.emplace_back(
_(
"Selected Items" ),
1510 std::set<wxString> netNames;
1511 std::set<wxString> netClasses;
1518 netClasses.insert(
UnescapeString( bci->GetEffectiveNetClass()->GetName() ) );
1520 if( netNames.size() > 1 && netClasses.size() > 1 )
1525 if( netNames.size() == 1 )
1526 msgItems.emplace_back(
_(
"Net" ), *netNames.begin() );
1528 if( netClasses.size() == 1 )
1529 msgItems.emplace_back(
_(
"Resolved Netclass" ), *netClasses.begin() );
1545 wxFileName fileName = wxFileName( *aEvent.
Parameter<wxString*>() );
1554 wxString filePath = fileName.GetFullPath();
@ NORMAL
Inactive layers are shown normally (no high-contrast mode)
@ HIDDEN
Inactive layers are hidden.
@ DIMMED
Inactive layers are dimmed (old high-contrast mode)
@ RATSNEST
Net/netclass colors are shown on ratsnest lines only.
@ ALL
Net/netclass colors are shown on all net copper.
@ OFF
Net (and netclass) colors are not shown.
@ VISIBLE
Ratsnest lines are drawn to items on visible layers only.
@ ALL
Ratsnest lines are drawn to items on all layers (default)
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
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 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 IsOnLayer(PCB_LAYER_ID aLayer, bool aIncludeCourtyards=false) const
Test to see if this object is on the given layer.
virtual bool IsOnCopperLayer() const
virtual std::shared_ptr< SHAPE_SEGMENT > GetEffectiveHoleShape() const
virtual bool HasHole() const
Information pertinent to a Pcbnew printed circuit board.
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
bool IsType(FRAME_T aType) const
WX_INFOBAR * GetInfoBar()
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.
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
Update the board display after modifying it by a python script (note: it is automatically called by a...
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)
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
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 ConnectivityChangedEvent
Selected item had a property changed (except movement)
static const TOOL_EVENT UnselectedEvent
virtual void SetLocalCoord()
Set relative coordinates from draw coordinates.
A specialization of ZONE for use in footprints.
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,...
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 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()
Wrapper class, so you can iterate through NETINFO_ITEM*s, not std::pair<int/wxString,...
Describe the page size and margins of a paper page on which to eventually print or plot.
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 ddAppendBoard
Drag and drop.
static TOOL_ACTION layerInner25
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 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...
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 ...
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
virtual void SaveCopyInUndoList(EDA_ITEM *aItemToCopy, UNDO_REDO aTypeCommand)=0
Create a new entry in undo list of commands.
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 placeBoardItems(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 DdImportFootprint(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.
int GridSetOrigin(const TOOL_EVENT &aEvent)
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 FlipPcbView(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.
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 * Load(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
#define SKIP_STRUCT
flag indicating that the structure should be ignored
const std::string KiCadPcbFileExtension
wxString KeyNameFromKeyCode(int aKeycode, bool *aIsFound)
Return the key name from the key code.
#define KICTL_EAGLE_BRD
chosen *.brd file is Eagle 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.
SGLIB_API S3DMODEL * GetModel(SCENEGRAPH *aNode)
Function GetModel creates an S3DMODEL representation of aNode (raw data, no transforms)
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
#define HITTEST_THRESHOLD_PIXELS
static void pasteFootprintItemsToFootprintEditor(FOOTPRINT *aClipFootprint, BOARD *aBoard, std::vector< BOARD_ITEM * > &aPastedItems)
bool AskLoadBoardFileName(PCB_EDIT_FRAME *aParent, int *aCtl, wxString *aFileName, bool aKicadFilesOnly=false)
Show a wxFileDialog asking for a BOARD filename to open.
static void moveUnflaggedItems(std::deque< T > &aList, std::vector< BOARD_ITEM * > &aTarget, bool aIsNew)
IO_MGR::PCB_FILE_T plugin_type(const wxString &aFileName, int aCtl)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
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_FP_SHAPE_T
class FP_SHAPE, a footprint edge
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_FP_TEXTBOX_T
class FP_TEXTBOX, wrapped text in a footprint
@ 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_FP_TEXT_T
class FP_TEXT, text in a footprint
@ 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)
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.