KiCad PCB EDA Suite
FOOTPRINT_EDITOR_CONTROL Class Reference

Module editor specific tools. More...

#include <footprint_editor_control.h>

Inheritance diagram for FOOTPRINT_EDITOR_CONTROL:
PCB_TOOL_BASE TOOL_INTERACTIVE TOOL_BASE

Public Types

enum  RESET_REASON { RUN , MODEL_RELOAD , GAL_SWITCH , REDRAW }
 Determine the reason of reset for a tool. More...
 

Public Member Functions

 FOOTPRINT_EDITOR_CONTROL ()
 
 ~FOOTPRINT_EDITOR_CONTROL () override
 
void Reset (RESET_REASON aReason) override
 Bring the tool to a known, initial state. More...
 
bool Init () override
 Init() is called once upon a registration of the tool. More...
 
int NewFootprint (const TOOL_EVENT &aEvent)
 
int CreateFootprint (const TOOL_EVENT &aEvent)
 
int Save (const TOOL_EVENT &aEvent)
 
int SaveAs (const TOOL_EVENT &aEvent)
 
int Revert (const TOOL_EVENT &aEvent)
 
int EditFootprint (const TOOL_EVENT &aEvent)
 
int CutCopyFootprint (const TOOL_EVENT &aEvent)
 
int PasteFootprint (const TOOL_EVENT &aEvent)
 
int DuplicateFootprint (const TOOL_EVENT &aEvent)
 
int RenameFootprint (const TOOL_EVENT &aEvent)
 
int DeleteFootprint (const TOOL_EVENT &aEvent)
 
int ImportFootprint (const TOOL_EVENT &aEvent)
 
int ExportFootprint (const TOOL_EVENT &aEvent)
 
int PinLibrary (const TOOL_EVENT &aEvent)
 
int UnpinLibrary (const TOOL_EVENT &aEvent)
 
int ToggleFootprintTree (const TOOL_EVENT &aEvent)
 
int ToggleLayersManager (const TOOL_EVENT &aEvent)
 
int ToggleProperties (const TOOL_EVENT &aEvent)
 
int Properties (const TOOL_EVENT &aEvent)
 
int EditTextAndGraphics (const TOOL_EVENT &aEvent)
 
int CheckFootprint (const TOOL_EVENT &aEvent)
 
void CrossProbe (const PCB_MARKER *aMarker)
 
void DestroyCheckerDialog ()
 
int CleanupGraphics (const TOOL_EVENT &aEvent)
 
int RepairFootprint (const TOOL_EVENT &aEvent)
 
int DefaultPadProperties (const TOOL_EVENT &aEvent)
 Edit the properties used for new pad creation. More...
 
void SetIsFootprintEditor (bool aEnabled)
 Function SetIsFootprintEditor() More...
 
bool IsFootprintEditor () const
 
void SetIsBoardEditor (bool aEnabled)
 
bool IsBoardEditor () const
 
virtual bool Is45Limited () const
 Should the tool use its 45° mode option? More...
 
void Activate ()
 Run the tool. More...
 
TOOL_MENUGetToolMenu ()
 
void SetContextMenu (ACTION_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger=CMENU_BUTTON)
 Assign a context menu and tells when it should be activated. More...
 
void RunMainStack (std::function< void()> aFunc)
 Call a function using the main stack. More...
 
template<class T >
void Go (int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
 Define which state (aStateFunc) to go when a certain event arrives (aConditions). More...
 
TOOL_EVENTWait (const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
 Suspend execution of the tool until an event specified in aEventList arrives. More...
 
TOOL_TYPE GetType () const
 Return the type of the tool. More...
 
TOOL_ID GetId () const
 Return the unique identifier of the tool. More...
 
const std::string & GetName () const
 Return the name of the tool. More...
 
TOOL_MANAGERGetManager () const
 Return the instance of TOOL_MANAGER that takes care of the tool. More...
 
bool IsToolActive () const
 

Protected Types

enum  INTERACTIVE_PLACEMENT_OPTIONS { IPO_ROTATE = 0x01 , IPO_FLIP = 0x02 , IPO_SINGLE_CLICK = 0x04 , IPO_REPEAT = 0x08 }
 Options for placing items interactively. More...
 

Protected Member Functions

void doInteractiveItemPlacement (const TOOL_EVENT &aTool, INTERACTIVE_PLACER_BASE *aPlacer, const wxString &aCommitMessage, int aOptions=IPO_ROTATE|IPO_FLIP|IPO_REPEAT)
 Helper function for performing a common interactive idiom: wait for a left click, place an item there (perhaps with a dialog or other user interaction), then have it move with the mouse and respond to rotate/flip, etc. More...
 
KIGFX::PCB_VIEWview () const
 
KIGFX::VIEW_CONTROLScontrols () const
 
PCB_BASE_EDIT_FRAMEframe () const
 
BOARDboard () const
 
FOOTPRINTfootprint () const
 
PCBNEW_SETTINGS::DISPLAY_OPTIONSdisplayOptions () const
 
PCB_DRAW_PANEL_GALcanvas () const
 
const PCB_SELECTIONselection () const
 
PCB_SELECTIONselection ()
 
void attachManager (TOOL_MANAGER *aManager)
 Set the TOOL_MANAGER the tool will belong to. More...
 
KIGFX::VIEWgetView () const
 Returns the instance of #VIEW object used in the application. More...
 
KIGFX::VIEW_CONTROLSgetViewControls () const
 Return the instance of VIEW_CONTROLS object used in the application. More...
 
template<typename T >
T * getEditFrame () const
 Return the application window object, casted to requested user type. More...
 
template<typename T >
T * getModel () const
 Return the model object if it matches the requested type. More...
 

Protected Attributes

bool m_isFootprintEditor
 
bool m_isBoardEditor
 
TOOL_MENU m_menu
 The functions below are not yet implemented - their interface may change. More...
 
TOOL_TYPE m_type
 Unique identifier for the tool, assigned by a TOOL_MANAGER instance. More...
 
TOOL_ID m_toolId
 Name of the tool. More...
 
std::string m_toolName
 
TOOL_MANAGERm_toolMgr
 

Private Member Functions

void setTransitions () override
 < Set up handlers for various events. More...
 
void resetTransitions ()
 Clear the current transition map and restores the default one created by setTransitions(). More...
 
void goInternal (TOOL_STATE_FUNC &aState, const TOOL_EVENT_LIST &aConditions)
 
EDA_ITEMgetModelInt () const
 
TOOLS_HOLDERgetToolHolderInt () const
 

Private Attributes

FOOTPRINT_EDIT_FRAMEm_frame
 
DIALOG_FOOTPRINT_CHECKERm_checkerDialog
 
std::unique_ptr< FOOTPRINTm_copiedFootprint
 

Detailed Description

Module editor specific tools.

Definition at line 39 of file footprint_editor_control.h.

Member Enumeration Documentation

◆ INTERACTIVE_PLACEMENT_OPTIONS

Options for placing items interactively.

Enumerator
IPO_ROTATE 

Handle the rotate action in the loop by calling the item's rotate method.

IPO_FLIP 

Handle flip action in the loop by calling the item's flip method.

IPO_SINGLE_CLICK 

Create an item immediately on placement starting, otherwise show the pencil cursor until the item is created.

IPO_REPEAT 

Allow repeat placement of the item.

Definition at line 121 of file pcb_tool_base.h.

121 {
123 IPO_ROTATE = 0x01,
124
126 IPO_FLIP = 0x02,
127
130 IPO_SINGLE_CLICK = 0x04,
131
133 IPO_REPEAT = 0x08
134 };
@ IPO_FLIP
Handle flip action in the loop by calling the item's flip method.
@ IPO_ROTATE
Handle the rotate action in the loop by calling the item's rotate method.
@ IPO_SINGLE_CLICK
Create an item immediately on placement starting, otherwise show the pencil cursor until the item is ...
@ IPO_REPEAT
Allow repeat placement of the item.

◆ RESET_REASON

enum TOOL_BASE::RESET_REASON
inherited

Determine the reason of reset for a tool.

Enumerator
RUN 

Tool is invoked after being inactive.

MODEL_RELOAD 

Model changes (required full reload)

GAL_SWITCH 

Rendering engine changes.

REDRAW 

Full drawing refresh.

Definition at line 77 of file tool_base.h.

78 {
79 RUN,
82 REDRAW
83 };
@ REDRAW
Full drawing refresh.
Definition: tool_base.h:82
@ MODEL_RELOAD
Model changes (required full reload)
Definition: tool_base.h:80
@ GAL_SWITCH
Rendering engine changes.
Definition: tool_base.h:81
@ RUN
Tool is invoked after being inactive.
Definition: tool_base.h:79

Constructor & Destructor Documentation

◆ FOOTPRINT_EDITOR_CONTROL()

FOOTPRINT_EDITOR_CONTROL::FOOTPRINT_EDITOR_CONTROL ( )

Definition at line 50 of file footprint_editor_control.cpp.

50 :
51 PCB_TOOL_BASE( "pcbnew.ModuleEditor" ),
52 m_frame( nullptr ),
53 m_checkerDialog( nullptr )
54{
55}
DIALOG_FOOTPRINT_CHECKER * m_checkerDialog
FOOTPRINT_EDIT_FRAME * m_frame
PCB_TOOL_BASE(TOOL_ID aId, const std::string &aName)
Constructor.
Definition: pcb_tool_base.h:77

◆ ~FOOTPRINT_EDITOR_CONTROL()

FOOTPRINT_EDITOR_CONTROL::~FOOTPRINT_EDITOR_CONTROL ( )
override

Definition at line 58 of file footprint_editor_control.cpp.

59{
60}

Member Function Documentation

◆ Activate()

void TOOL_INTERACTIVE::Activate ( )
inherited

Run the tool.

After activation, the tool starts receiving events until it is finished.

Definition at line 51 of file tool_interactive.cpp.

52{
54}
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:215
TOOL_ID m_toolId
Name of the tool.
Definition: tool_base.h:210
bool InvokeTool(TOOL_ID aToolId)
Call a tool by sending a tool activation event to tool of given ID.

References TOOL_MANAGER::InvokeTool(), TOOL_BASE::m_toolId, and TOOL_BASE::m_toolMgr.

Referenced by AUTOPLACE_TOOL::autoplace(), EDIT_TOOL::copyToClipboard(), SCH_EDIT_TOOL::DeleteItemCursor(), SYMBOL_EDITOR_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), PCB_CONTROL::DeleteItemCursor(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::DrawRectangle(), SCH_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), BOARD_EDITOR_CONTROL::DrillOrigin(), PAD_TOOL::EnumeratePads(), PCB_CONTROL::GridSetOrigin(), SCH_EDITOR_CONTROL::HighlightNetCursor(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::InteractivePlaceWithPreview(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), EE_POINT_EDITOR::Main(), SCH_MOVE_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PICKER_TOOL::Main(), PL_EDIT_TOOL::Main(), PL_POINT_EDITOR::Main(), PCB_PICKER_TOOL::Main(), LENGTH_TUNER_TOOL::MainLoop(), ROUTER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), PCB_POINT_EDITOR::OnSelectionChange(), GROUP_TOOL::PickNewMember(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), DRAWING_TOOL::PlaceText(), EDIT_TOOL::Remove(), ROUTER_TOOL::RouteSelected(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), DRAWING_TOOL::SetAnchor(), DRC_TOOL::ShowDRCDialog(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ attachManager()

void TOOL_BASE::attachManager ( TOOL_MANAGER aManager)
protectedinherited

Set the TOOL_MANAGER the tool will belong to.

Called by TOOL_MANAGER::RegisterTool()

Definition at line 60 of file tool_base.cpp.

61{
62 m_toolMgr = aManager;
63}

References TOOL_BASE::m_toolMgr.

Referenced by TOOL_MANAGER::RegisterTool().

◆ board()

BOARD * PCB_TOOL_BASE::board ( ) const
inlineprotectedinherited

Definition at line 170 of file pcb_tool_base.h.

170{ return getModel<BOARD>(); }

Referenced by PCB_CONTROL::AppendBoard(), BOARD_EDITOR_CONTROL::AssignNetclass(), AUTOPLACE_TOOL::autoplace(), BOARD_INSPECTION_TOOL::calculateSelectionRatsnest(), EDIT_TOOL::ChangeTrackWidth(), ZONE_FILLER_TOOL::CheckAllZones(), BOARD_INSPECTION_TOOL::ClearHighlight(), EDIT_TOOL::copyToClipboard(), CreateFootprint(), MICROWAVE_TOOL::createInductorBetween(), ROUTER_TOOL::CustomTrackWidthDialog(), PCB_CONTROL::DeleteItemCursor(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawShape(), PAD_TOOL::EnumeratePads(), PAD_TOOL::explodePad(), BOARD_EDITOR_CONTROL::ExportNetlist(), ZONE_FILLER_TOOL::FillAllZones(), EDIT_TOOL::FilletTracks(), PCB_TOOL_BASE::footprint(), GROUP_TOOL::Group(), ROUTER_TOOL::handleLayerSwitch(), BOARD_INSPECTION_TOOL::highlightNet(), ROUTER_TOOL::Init(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::InteractivePlaceWithPreview(), PCB_CONTROL::LayerNext(), PCB_CONTROL::LayerPrev(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), EDIT_TOOL::MoveExact(), NewFootprint(), PCB_CONTROL::Paste(), PCB_CONTROL::placeBoardItems(), BOARD_EDITOR_CONTROL::PlaceFootprint(), PAD_TOOL::PlacePad(), DRAWING_TOOL::PlaceText(), PCB_CONTROL::pruneItemLayers(), EDIT_TOOL::rebuildConnectivity(), ZONE_FILLER_TOOL::rebuildConnectivity(), PAD_TOOL::RecombinePad(), BOARD_EDITOR_CONTROL::RepairBoard(), RepairFootprint(), PNS::TOOL_BASE::Reset(), PAD_TOOL::Reset(), PCB_CONTROL::Reset(), PCB_CONTROL::TrackDisplayMode(), PCB_CONTROL::unfilledZoneCheck(), GROUP_TOOL::Ungroup(), ROUTER_TOOL::UpdateMessagePanel(), ROUTER_TOOL::updateSizesAfterLayerSwitch(), PCB_CONTROL::ViaDisplayMode(), PCB_CONTROL::ZoneDisplayMode(), ZONE_FILLER_TOOL::ZoneFill(), ZONE_FILLER_TOOL::ZoneFillDirty(), BOARD_EDITOR_CONTROL::ZoneMerge(), and ZONE_FILLER_TOOL::ZoneUnfillAll().

◆ canvas()

◆ CheckFootprint()

int FOOTPRINT_EDITOR_CONTROL::CheckFootprint ( const TOOL_EVENT aEvent)

Definition at line 631 of file footprint_editor_control.cpp.

632{
633 if( !m_checkerDialog )
634 {
636
637 m_checkerDialog->Show( true );
638 }
639 else // The dialog is just not visible (because the user has double clicked on an error item)
640 {
641 m_checkerDialog->Show( true );
642 }
643
644 return 0;
645}
bool Show(bool show) override

References m_checkerDialog, m_frame, and DIALOG_SHIM::Show().

Referenced by setTransitions().

◆ CleanupGraphics()

int FOOTPRINT_EDITOR_CONTROL::CleanupGraphics ( const TOOL_EVENT aEvent)

Definition at line 621 of file footprint_editor_control.cpp.

622{
623 FOOTPRINT_EDIT_FRAME* editFrame = getEditFrame<FOOTPRINT_EDIT_FRAME>();
624 DIALOG_CLEANUP_GRAPHICS dlg( editFrame, true );
625
626 dlg.ShowModal();
627 return 0;
628}

Referenced by setTransitions().

◆ controls()

◆ CreateFootprint()

int FOOTPRINT_EDITOR_CONTROL::CreateFootprint ( const TOOL_EVENT aEvent)

Definition at line 185 of file footprint_editor_control.cpp.

186{
187 LIB_ID selected = m_frame->GetTreeFPID();
188
190 {
191 if( !HandleUnsavedChanges( m_frame, _( "The current footprint has been modified. "
192 "Save changes?" ),
193 [&]() -> bool
194 {
195 return m_frame->SaveFootprint( footprint() );
196 } ) )
197 {
198 return 0;
199 }
200 }
201
203 true, m_frame );
204
205 if( wizard->ShowModal( nullptr, m_frame ) )
206 {
207 // Creates the new footprint from python script wizard
208 FOOTPRINT* newFootprint = wizard->GetBuiltFootprint();
209
210 if( newFootprint ) // i.e. if create footprint command is OK
211 {
212 m_frame->Clear_Pcb( false );
213
215 // Add the new object to board
216 m_frame->AddFootprintToBoard( newFootprint );
217
218 // Initialize data relative to nets and netclasses (for a new footprint the defaults
219 // are used). This is mandatory to handle and draw pads.
221 newFootprint->SetPosition( VECTOR2I( 0, 0 ) );
222 newFootprint->ClearFlags();
223
224 m_frame->Zoom_Automatique( false );
226 m_frame->OnModify();
227
228 // If selected from the library tree then go ahead and save it there
229 if( !selected.GetLibNickname().empty() )
230 {
231 LIB_ID fpid = newFootprint->GetFPID();
232 fpid.SetLibNickname( selected.GetLibNickname() );
233 newFootprint->SetFPID( fpid );
234 m_frame->SaveFootprint( newFootprint );
236 }
237
239 canvas()->Refresh();
240 m_frame->Update3DView( true, true );
241
242 m_frame->SyncLibraryTree( false );
243 }
244 }
245
246 wizard->Destroy();
247 return 0;
248}
void SetContentModified(bool aModified=true)
Definition: base_screen.h:59
void BuildListOfNets()
Definition: board.h:763
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 #VIEW_CONTROLS instance used in the 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...
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: eda_item.h:141
void SyncLibraryTree(bool aProgress)
Synchronize the footprint library tree to the current state of the footprint library table.
bool SaveFootprint(FOOTPRINT *aFootprint)
Save in an existing library a given footprint.
LIB_ID GetTreeFPID() const
Return the LIB_ID of the part or library selected in the footprint tree.
bool IsContentModified() const override
Get if any footprints or libraries have been modified but not saved.
void AddFootprintToBoard(FOOTPRINT *aFootprint) override
Override from PCB_BASE_EDIT_FRAME which adds a footprint to the editor's dummy board,...
void OnModify() override
Must be called after a footprint change in order to set the "modify" flag of the current screen and p...
bool Clear_Pcb(bool aQuery)
Delete all and reinitialize the current board.
Definition: initpcb.cpp:97
void SetPosition(const VECTOR2I &aPos) override
Definition: footprint.cpp:1688
void SetFPID(const LIB_ID &aFPID)
Definition: footprint.h:213
const LIB_ID & GetFPID() const
Definition: footprint.h:212
virtual void SetCrossHairCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true)=0
Move the graphic crosshair cursor to the requested position expressed in world coordinates.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:53
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:394
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:49
int SetLibNickname(const UTF8 &aNickname)
Override the logical library name portion of the LIB_ID to aNickname.
Definition: lib_id.cpp:98
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:87
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
virtual void Update3DView(bool aMarkDirty, bool aRefresh, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
BOARD * board() const
PCB_DRAW_PANEL_GAL * canvas() const
FOOTPRINT * footprint() const
bool empty() const
Definition: utf8.h:103
bool HandleUnsavedChanges(wxWindow *aParent, const wxString &aMessage, const std::function< bool()> &aSaveFunction)
Display a dialog with Save, Cancel and Discard Changes buttons.
Definition: confirm.cpp:260
#define _(s)
@ FRAME_FOOTPRINT_WIZARD
Definition: frame_type.h:44
VECTOR2< double > VECTOR2D
Definition: vector2d.h:589
VECTOR2< int > VECTOR2I
Definition: vector2d.h:590

References _, FOOTPRINT_EDIT_FRAME::AddFootprintToBoard(), PCB_TOOL_BASE::board(), BOARD::BuildListOfNets(), PCB_TOOL_BASE::canvas(), FOOTPRINT_EDIT_FRAME::Clear_Pcb(), EDA_ITEM::ClearFlags(), FOOTPRINT_EDIT_FRAME::ClearModify(), UTF8::empty(), PCB_TOOL_BASE::footprint(), FRAME_FOOTPRINT_WIZARD, FOOTPRINT::GetFPID(), LIB_ID::GetLibNickname(), PCB_BASE_FRAME::GetScreen(), FOOTPRINT_EDIT_FRAME::GetTreeFPID(), EDA_DRAW_PANEL_GAL::GetViewControls(), HandleUnsavedChanges(), FOOTPRINT_EDIT_FRAME::IsContentModified(), KIWAY_HOLDER::Kiway(), m_frame, FOOTPRINT_EDIT_FRAME::OnModify(), KIWAY::Player(), EDA_DRAW_PANEL_GAL::Refresh(), FOOTPRINT_EDIT_FRAME::SaveFootprint(), BASE_SCREEN::SetContentModified(), KIGFX::VIEW_CONTROLS::SetCrossHairCursorPosition(), FOOTPRINT::SetFPID(), LIB_ID::SetLibNickname(), FOOTPRINT::SetPosition(), FOOTPRINT_EDIT_FRAME::SyncLibraryTree(), PCB_BASE_FRAME::Update3DView(), FOOTPRINT_EDIT_FRAME::UpdateView(), and EDA_DRAW_FRAME::Zoom_Automatique().

Referenced by setTransitions().

◆ CrossProbe()

void FOOTPRINT_EDITOR_CONTROL::CrossProbe ( const PCB_MARKER aMarker)

Definition at line 648 of file footprint_editor_control.cpp.

649{
650 if( !m_checkerDialog )
652
653 if( !m_checkerDialog->IsShown() )
654 m_checkerDialog->Show( true );
655
656 m_checkerDialog->SelectMarker( aMarker );
657}
void SelectMarker(const PCB_MARKER *aMarker)

References m_checkerDialog, m_frame, DIALOG_FOOTPRINT_CHECKER::SelectMarker(), and DIALOG_SHIM::Show().

◆ CutCopyFootprint()

int FOOTPRINT_EDITOR_CONTROL::CutCopyFootprint ( const TOOL_EVENT aEvent)

Definition at line 326 of file footprint_editor_control.cpp.

327{
328 LIB_ID fpID = m_frame->GetTreeFPID();
329
330 if( fpID == m_frame->GetLoadedFPID() )
331 {
332 m_copiedFootprint = std::make_unique<FOOTPRINT>( *m_frame->GetBoard()->GetFirstFootprint() );
333 m_copiedFootprint->SetParent( nullptr );
334 }
335 else
336 {
337 m_copiedFootprint.reset( m_frame->LoadFootprint( fpID ) );
338 }
339
340 if( aEvent.IsAction( &PCB_ACTIONS::cutFootprint ) )
341 DeleteFootprint( aEvent );
342
343 return 0;
344}
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
Definition: board.h:403
std::unique_ptr< FOOTPRINT > m_copiedFootprint
int DeleteFootprint(const TOOL_EVENT &aEvent)
LIB_ID GetLoadedFPID() const
Return the LIB_ID of the part being edited.
static TOOL_ACTION cutFootprint
Definition: pcb_actions.h:414
FOOTPRINT * LoadFootprint(const LIB_ID &aFootprintId)
Attempt to load aFootprintId from the footprint library table.
BOARD * GetBoard() const
bool IsAction(const TOOL_ACTION *aAction) const
Test if the event contains an action issued upon activation of the given TOOL_ACTION.
Definition: tool_event.cpp:81

References PCB_ACTIONS::cutFootprint, DeleteFootprint(), PCB_BASE_FRAME::GetBoard(), BOARD::GetFirstFootprint(), FOOTPRINT_EDIT_FRAME::GetLoadedFPID(), FOOTPRINT_EDIT_FRAME::GetTreeFPID(), TOOL_EVENT::IsAction(), PCB_BASE_FRAME::LoadFootprint(), m_copiedFootprint, and m_frame.

Referenced by setTransitions().

◆ DefaultPadProperties()

int FOOTPRINT_EDITOR_CONTROL::DefaultPadProperties ( const TOOL_EVENT aEvent)

Edit the properties used for new pad creation.

Definition at line 614 of file footprint_editor_control.cpp.

615{
616 getEditFrame<FOOTPRINT_EDIT_FRAME>()->ShowPadPropertiesDialog( nullptr );
617 return 0;
618}

Referenced by setTransitions().

◆ DeleteFootprint()

int FOOTPRINT_EDITOR_CONTROL::DeleteFootprint ( const TOOL_EVENT aEvent)

Definition at line 482 of file footprint_editor_control.cpp.

483{
484 FOOTPRINT_EDIT_FRAME* frame = getEditFrame<FOOTPRINT_EDIT_FRAME>();
485
486 if( frame->DeleteFootprintFromLibrary( frame->GetTargetFPID(), true ) )
487 {
488 if( frame->GetTargetFPID() == frame->GetLoadedFPID() )
489 frame->Clear_Pcb( false );
490
491 frame->SyncLibraryTree( true );
492 }
493
494 return 0;
495}

References PCB_TOOL_BASE::frame().

Referenced by CutCopyFootprint(), and setTransitions().

◆ DestroyCheckerDialog()

void FOOTPRINT_EDITOR_CONTROL::DestroyCheckerDialog ( )

Definition at line 660 of file footprint_editor_control.cpp.

661{
662 if( m_checkerDialog )
663 {
664 m_checkerDialog->Destroy();
665 m_checkerDialog = nullptr;
666 }
667}

References m_checkerDialog.

Referenced by DIALOG_FOOTPRINT_CHECKER::OnCancelClick(), and Reset().

◆ displayOptions()

◆ doInteractiveItemPlacement()

void PCB_TOOL_BASE::doInteractiveItemPlacement ( const TOOL_EVENT aTool,
INTERACTIVE_PLACER_BASE aPlacer,
const wxString &  aCommitMessage,
int  aOptions = IPO_ROTATE | IPO_FLIP | IPO_REPEAT 
)
protectedinherited

Helper function for performing a common interactive idiom: wait for a left click, place an item there (perhaps with a dialog or other user interaction), then have it move with the mouse and respond to rotate/flip, etc.

More complex interactive processes are not supported here, you should implement a customised event loop for those.

Parameters
aItemCreatorthe callable that will attempt to create the item
aCommitMessagethe message used on a successful commit

Definition at line 41 of file pcb_tool_base.cpp.

44{
45 using namespace std::placeholders;
46 std::unique_ptr<BOARD_ITEM> newItem;
47
48 frame()->PushTool( aTool );
49
50 BOARD_COMMIT commit( frame() );
51
53
54 Activate();
55 // Must be done after Activate() so that it gets set into the correct context
56 controls()->ShowCursor( true );
57 controls()->ForceCursorPosition( false );
58 // do not capture or auto-pan until we start placing an item
59
60 PCB_GRID_HELPER grid( m_toolMgr, frame()->GetMagneticItemsSettings() );
61
62 // Add a VIEW_GROUP that serves as a preview for the new item
63 PCB_SELECTION preview;
64 view()->Add( &preview );
65
66 aPlacer->m_board = board();
67 aPlacer->m_frame = frame();
68 aPlacer->m_modifiers = 0;
69
70 auto makeNewItem =
71 [&]( VECTOR2I aPosition )
72 {
73 if( frame()->GetModel() )
74 newItem = aPlacer->CreateItem();
75
76 if( newItem )
77 {
78 newItem->SetPosition( aPosition );
79 preview.Add( newItem.get() );
80
81 if( newItem->Type() == PCB_FOOTPRINT_T )
82 {
83 FOOTPRINT* fp = dyn_cast<FOOTPRINT*>( newItem.get() );
84
85 // footprints have more drawable parts
86 fp->RunOnChildren( std::bind( &KIGFX::VIEW_GROUP::Add, &preview, _1 ) );
87 }
88 }
89 };
90
91 if( aOptions & IPO_SINGLE_CLICK )
92 makeNewItem( controls()->GetCursorPosition() );
93
94 auto setCursor =
95 [&]()
96 {
97 if( !newItem )
99 else
101 };
102
103 // Set initial cursor
104 setCursor();
105
106 // Main loop: keep receiving events
107 while( TOOL_EVENT* evt = Wait() )
108 {
109 setCursor();
110
111 grid.SetSnap( false ); // Interactive placement tools need to set their own item snaps
112 grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
113 VECTOR2I cursorPos = grid.BestSnapAnchor( controls()->GetMousePosition(), nullptr );
114
115 aPlacer->m_modifiers = evt->Modifier();
116
117 auto cleanup =
118 [&] ()
119 {
120 newItem = nullptr;
121 preview.Clear();
122 view()->Update( &preview );
123 controls()->SetAutoPan( false );
124 controls()->CaptureCursor( false );
125 controls()->ShowCursor( true );
126 controls()->ForceCursorPosition( false );
127 };
128
129 if( evt->IsCancelInteractive() )
130 {
131 if( aOptions & IPO_SINGLE_CLICK )
132 {
133 cleanup();
134 frame()->PopTool( aTool );
135 break;
136 }
137 else if( newItem )
138 {
139 cleanup();
140 }
141 else
142 {
143 frame()->PopTool( aTool );
144 break;
145 }
146 }
147 else if( evt->IsActivate() )
148 {
149 if( newItem )
150 cleanup();
151
152 if( evt->IsPointEditor() )
153 {
154 // don't exit (the point editor runs in the background)
155 }
156 else if( evt->IsMoveTool() )
157 {
158 // leave ourselves on the stack so we come back after the move
159 break;
160 }
161 else
162 {
163 frame()->PopTool( aTool );
164 break;
165 }
166 }
167 else if( evt->IsClick( BUT_LEFT ) || evt->IsDblClick( BUT_LEFT ) )
168 {
169 if( !newItem )
170 {
171 // create the item if possible
172 makeNewItem( cursorPos );
173
174 // no item created, so wait for another click
175 if( !newItem )
176 continue;
177
178 controls()->CaptureCursor( true );
179 controls()->SetAutoPan( true );
180 }
181 else
182 {
183 BOARD_ITEM* newBoardItem = newItem.release();
184 EDA_ITEM_FLAGS oldFlags = newBoardItem->GetFlags();
185
186 newBoardItem->ClearFlags();
187
188 if( !aPlacer->PlaceItem( newBoardItem, commit ) )
189 {
190 newBoardItem->SetFlags( oldFlags );
191 newItem.reset( newBoardItem );
192 continue;
193 }
194
195 preview.Clear();
196 commit.Push( aCommitMessage );
197
198 controls()->CaptureCursor( false );
199 controls()->SetAutoPan( false );
200 controls()->ShowCursor( true );
201
202 if( !( aOptions & IPO_REPEAT ) )
203 break;
204
205 if( aOptions & IPO_SINGLE_CLICK )
206 makeNewItem( controls()->GetCursorPosition() );
207
208 setCursor();
209 }
210 }
211 else if( evt->IsClick( BUT_RIGHT ) )
212 {
214 }
215 else if( evt->IsAction( &PCB_ACTIONS::trackViaSizeChanged ) )
216 {
218 }
219 else if( newItem && evt->Category() == TC_COMMAND )
220 {
221 /*
222 * Handle any events that can affect the item as we move it around
223 */
224 if( TOOL_EVT_UTILS::IsRotateToolEvt( *evt ) && ( aOptions & IPO_ROTATE ) )
225 {
226 EDA_ANGLE rotationAngle = TOOL_EVT_UTILS::GetEventRotationAngle( *frame(), *evt );
227 newItem->Rotate( newItem->GetPosition(), rotationAngle );
228 view()->Update( &preview );
229 }
230 else if( evt->IsAction( &PCB_ACTIONS::flip ) && ( aOptions & IPO_FLIP ) )
231 {
232 newItem->Flip( newItem->GetPosition(), frame()->GetPcbNewSettings()->m_FlipLeftRight );
233 view()->Update( &preview );
234 }
235 else if( evt->IsAction( &PCB_ACTIONS::properties ) )
236 {
237 frame()->OnEditItemRequest( newItem.get() );
238
239 // Notify other tools of the changes
241 }
242 else if( evt->IsAction( &ACTIONS::refreshPreview ) )
243 {
244 preview.Clear();
245 newItem.reset();
246
247 makeNewItem( cursorPos );
248 aPlacer->SnapItem( newItem.get() );
249 view()->Update( &preview );
250 }
251 else
252 {
253 evt->SetPassEvent();
254 }
255 }
256 else if( newItem && evt->IsMotion() )
257 {
258 // track the cursor
259 newItem->SetPosition( cursorPos );
260 aPlacer->SnapItem( newItem.get() );
261
262 // Show a preview of the item
263 view()->Update( &preview );
264 }
265 else
266 {
267 evt->SetPassEvent();
268 }
269 }
270
271 view()->Remove( &preview );
273 controls()->SetAutoPan( false );
274 controls()->CaptureCursor( false );
275 controls()->ForceCursorPosition( false );
276}
static TOOL_ACTION refreshPreview
Definition: actions.h:110
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:70
void SetCurrentCursor(KICURSOR aCursor)
Set the current cursor shape for this panel.
void SetFlags(EDA_ITEM_FLAGS aMask)
Definition: eda_item.h:139
EDA_ITEM_FLAGS GetFlags() const
Definition: eda_item.h:142
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
Definition: actions.h:214
void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction) const
Invoke a function on all BOARD_ITEMs that belong to the footprint (pads, drawings,...
Definition: footprint.cpp:1393
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...
Definition: pcb_view.cpp:92
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1) override
Add a VIEW_ITEM to the view.
Definition: pcb_view.cpp:58
virtual void Remove(VIEW_ITEM *aItem) override
Remove a VIEW_ITEM from the view.
Definition: pcb_view.cpp:75
virtual void CaptureCursor(bool aEnabled)
Force the cursor to stay within the drawing panel area.
virtual void ForceCursorPosition(bool aEnabled, const VECTOR2D &aPosition=VECTOR2D(0, 0))
Place the cursor immediately at a given point.
virtual void ShowCursor(bool aEnabled)
Enable or disables display of cursor.
virtual void SetAutoPan(bool aEnabled)
Turn on/off auto panning (this feature is used when there is a tool active (eg.
virtual void Add(VIEW_ITEM *aItem)
Add an item to the group.
Definition: view_group.cpp:57
static TOOL_ACTION trackViaSizeChanged
Definition: pcb_actions.h:338
static TOOL_ACTION properties
Activation of the edit tool.
Definition: pcb_actions.h:149
static TOOL_ACTION selectionClear
Clear the current selection.
Definition: pcb_actions.h:59
static TOOL_ACTION flip
Flipping of selected objects.
Definition: pcb_actions.h:126
virtual void OnEditItemRequest(BOARD_ITEM *aItem)=0
Install the corresponding dialog editor for the given item.
virtual BOARD_ITEM_CONTAINER * GetModel() const =0
KIGFX::PCB_VIEW * view() const
KIGFX::VIEW_CONTROLS * controls() const
const PCB_SELECTION & selection() const
virtual void Add(EDA_ITEM *aItem)
Definition: selection.cpp:42
virtual void Clear() override
Remove all the stored items from the group.
Definition: selection.h:92
virtual void PopTool(const TOOL_EVENT &aEvent)
Pops a tool from the stack.
virtual void PushTool(const TOOL_EVENT &aEvent)
NB: the definition of "tool" is different at the user level.
TOOL_MANAGER * GetManager() const
Return the instance of TOOL_MANAGER that takes care of the tool.
Definition: tool_base.h:144
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition: tool_base.cpp:36
Generic, UI-independent tool event.
Definition: tool_event.h:156
TOOL_MENU m_menu
The functions below are not yet implemented - their interface may change.
TOOL_EVENT * Wait(const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
Suspend execution of the tool until an event specified in aEventList arrives.
void Activate()
Run the tool.
bool ProcessEvent(const TOOL_EVENT &aEvent)
Propagate an event to tools that requested events of matching type(s).
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:142
void ShowContextMenu(SELECTION &aSelection)
Helper function to set and immediately show a CONDITIONAL_MENU in concert with the given SELECTION.
Definition: tool_menu.cpp:57
std::uint32_t EDA_ITEM_FLAGS
EDA_ANGLE GetEventRotationAngle(const PCB_BASE_EDIT_FRAME &aFrame, const TOOL_EVENT &aEvent)
Function getEventRotationAngle()
bool IsRotateToolEvt(const TOOL_EVENT &aEvt)
Function isRotateToolEvt()
virtual void SnapItem(BOARD_ITEM *aItem)
PCB_BASE_EDIT_FRAME * m_frame
Definition: pcb_tool_base.h:64
virtual std::unique_ptr< BOARD_ITEM > CreateItem()=0
virtual bool PlaceItem(BOARD_ITEM *aItem, BOARD_COMMIT &aCommit)
@ TC_COMMAND
Definition: tool_event.h:52
@ BUT_LEFT
Definition: tool_event.h:127
@ BUT_RIGHT
Definition: tool_event.h:128
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition: typeinfo.h:86

References TOOL_INTERACTIVE::Activate(), SELECTION::Add(), KIGFX::VIEW_GROUP::Add(), KIGFX::PCB_VIEW::Add(), ARROW, PCB_TOOL_BASE::board(), BUT_LEFT, BUT_RIGHT, KIGFX::VIEW_CONTROLS::CaptureCursor(), SELECTION::Clear(), EDA_ITEM::ClearFlags(), PCB_TOOL_BASE::controls(), INTERACTIVE_PLACER_BASE::CreateItem(), PCB_ACTIONS::flip, KIGFX::VIEW_CONTROLS::ForceCursorPosition(), PCB_TOOL_BASE::frame(), PCB_BASE_FRAME::GetCanvas(), TOOL_EVT_UTILS::GetEventRotationAngle(), EDA_ITEM::GetFlags(), TOOL_BASE::GetManager(), PCB_BASE_FRAME::GetModel(), TOOL_BASE::getView(), grid, PCB_TOOL_BASE::IPO_FLIP, PCB_TOOL_BASE::IPO_REPEAT, PCB_TOOL_BASE::IPO_ROTATE, PCB_TOOL_BASE::IPO_SINGLE_CLICK, TOOL_EVT_UTILS::IsRotateToolEvt(), INTERACTIVE_PLACER_BASE::m_board, INTERACTIVE_PLACER_BASE::m_frame, TOOL_INTERACTIVE::m_menu, INTERACTIVE_PLACER_BASE::m_modifiers, TOOL_BASE::m_toolMgr, PCB_BASE_EDIT_FRAME::OnEditItemRequest(), PCB_FOOTPRINT_T, PENCIL, PLACE, INTERACTIVE_PLACER_BASE::PlaceItem(), TOOLS_HOLDER::PopTool(), TOOL_MANAGER::ProcessEvent(), PCB_ACTIONS::properties, BOARD_COMMIT::Push(), TOOLS_HOLDER::PushTool(), ACTIONS::refreshPreview, KIGFX::PCB_VIEW::Remove(), TOOL_MANAGER::RunAction(), FOOTPRINT::RunOnChildren(), EVENTS::SelectedItemsModified, PCB_TOOL_BASE::selection(), PCB_ACTIONS::selectionClear, KIGFX::VIEW_CONTROLS::SetAutoPan(), EDA_DRAW_PANEL_GAL::SetCurrentCursor(), EDA_ITEM::SetFlags(), TOOL_MENU::ShowContextMenu(), KIGFX::VIEW_CONTROLS::ShowCursor(), INTERACTIVE_PLACER_BASE::SnapItem(), TC_COMMAND, PCB_ACTIONS::trackViaSizeChanged, KIGFX::PCB_VIEW::Update(), PCB_TOOL_BASE::view(), and TOOL_INTERACTIVE::Wait().

Referenced by MICROWAVE_TOOL::addMicrowaveFootprint(), DRAWING_TOOL::DrawVia(), and PAD_TOOL::PlacePad().

◆ DuplicateFootprint()

int FOOTPRINT_EDITOR_CONTROL::DuplicateFootprint ( const TOOL_EVENT aEvent)

Definition at line 370 of file footprint_editor_control.cpp.

371{
372 LIB_ID fpID = m_frame->GetTreeFPID();
374
375 if( fpID == m_frame->GetLoadedFPID() )
377 else
379
381 {
382 m_frame->SyncLibraryTree( true );
386 }
387
388 return 0;
389}
bool DuplicateFootprint(FOOTPRINT *aFootprint)
LIB_ID GetTargetFPID() const
Return the LIB_ID of the part selected in the footprint tree, or the loaded part if there is no selec...
void LoadFootprintFromLibrary(LIB_ID aFPID)
void FocusOnLibID(const LIB_ID &aLibID)
void RefreshLibraryTree()
Redisplay the library tree.

References FOOTPRINT_EDIT_FRAME::DuplicateFootprint(), FOOTPRINT_EDIT_FRAME::FocusOnLibID(), PCB_TOOL_BASE::footprint(), PCB_BASE_FRAME::GetBoard(), BOARD::GetFirstFootprint(), FOOTPRINT::GetFPID(), FOOTPRINT_EDIT_FRAME::GetLoadedFPID(), FOOTPRINT_EDIT_FRAME::GetTargetFPID(), FOOTPRINT_EDIT_FRAME::GetTreeFPID(), PCB_BASE_FRAME::LoadFootprint(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromLibrary(), m_frame, FOOTPRINT_EDIT_FRAME::RefreshLibraryTree(), and FOOTPRINT_EDIT_FRAME::SyncLibraryTree().

Referenced by setTransitions().

◆ EditFootprint()

int FOOTPRINT_EDITOR_CONTROL::EditFootprint ( const TOOL_EVENT aEvent)

◆ EditTextAndGraphics()

int FOOTPRINT_EDITOR_CONTROL::EditTextAndGraphics ( const TOOL_EVENT aEvent)

Definition at line 589 of file pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp.

590{
591 FOOTPRINT_EDIT_FRAME* editFrame = getEditFrame<FOOTPRINT_EDIT_FRAME>();
593
594 dlg.ShowModal();
595 return 0;
596}

Referenced by setTransitions().

◆ ExportFootprint()

int FOOTPRINT_EDITOR_CONTROL::ExportFootprint ( const TOOL_EVENT aEvent)

Definition at line 526 of file footprint_editor_control.cpp.

527{
528 LIB_ID fpID = m_frame->GetTreeFPID();
529 FOOTPRINT* fp;
530
531 if( !fpID.IsValid() )
533 else
534 fp = m_frame->LoadFootprint( fpID );
535
537 return 0;
538}
void ExportFootprint(FOOTPRINT *aFootprint)
Create a file containing only one footprint.
bool IsValid() const
Check if this LID_ID is valid.
Definition: lib_id.h:172

References FOOTPRINT_EDIT_FRAME::ExportFootprint(), PCB_BASE_FRAME::GetBoard(), BOARD::GetFirstFootprint(), FOOTPRINT_EDIT_FRAME::GetTreeFPID(), LIB_ID::IsValid(), PCB_BASE_FRAME::LoadFootprint(), and m_frame.

Referenced by setTransitions().

◆ footprint()

◆ frame()

PCB_BASE_EDIT_FRAME * PCB_TOOL_BASE::frame ( ) const
inlineprotectedinherited

Definition at line 165 of file pcb_tool_base.h.

166 {
167 return getEditFrame<PCB_BASE_EDIT_FRAME>();
168 }

Referenced by PCB_POINT_EDITOR::addCorner(), AUTOPLACE_TOOL::autoplace(), PCB_TOOL_BASE::canvas(), ZONE_FILLER_TOOL::CheckAllZones(), PNS::TOOL_BASE::checkSnap(), PAD_TOOL::copyPadSettings(), EDIT_TOOL::copyToClipboard(), ROUTER_TOOL::CustomTrackWidthDialog(), DeleteFootprint(), EDIT_TOOL::DeleteItems(), PCB_TOOL_BASE::displayOptions(), BOARD_EDITOR_CONTROL::doCrossProbePcbToSch(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), ROUTER_TOOL::DpDimensionsDialog(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawShape(), DRAWING_TOOL::DrawVia(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EditPad(), PAD_TOOL::EnumeratePads(), PAD_TOOL::explodePad(), BOARD_EDITOR_CONTROL::ExportSpecctraDSN(), ZONE_FILLER_TOOL::FillAllZones(), EDIT_TOOL::FilletTracks(), ROUTER_TOOL::finishInteractive(), EDIT_TOOL::Flip(), PCB_CONTROL::FlipPcbView(), GLOBAL_EDIT_TOOL::GlobalDeletions(), ROUTER_TOOL::handleLayerSwitch(), PCB_CONTROL::HighContrastMode(), PCB_CONTROL::HighContrastModeCycle(), BOARD_INSPECTION_TOOL::HighlightItem(), ImportFootprint(), BOARD_EDITOR_CONTROL::ImportSpecctraSession(), SCRIPTING_TOOL::Init(), ROUTER_TOOL::Init(), EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::InteractivePlaceWithPreview(), PCB_TOOL_BASE::Is45Limited(), PCB_PICKER_TOOL::Main(), LENGTH_TUNER_TOOL::MainLoop(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::meanderSettingsDialog(), EDIT_TOOL::MoveExact(), PCB_CONTROL::NetColorModeCycle(), PCB_POINT_EDITOR::OnSelectionChange(), ROUTER_TOOL::onViaCommand(), PCB_CONTROL::Paste(), PAD_TOOL::pastePadProperties(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), GROUP_TOOL::PickNewMember(), PNS::TOOL_BASE::pickSingleItem(), BOARD_EDITOR_CONTROL::PlaceFootprint(), DRAWING_TOOL::PlaceText(), ROUTER_TOOL::prepareInteractive(), PCB_CONTROL::pruneItemLayers(), PAD_TOOL::pushPadSettings(), PCB_CONTROL::RatsnestModeCycle(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), SCRIPTING_TOOL::reloadPlugins(), PCB_POINT_EDITOR::removeCorner(), PNS::TOOL_BASE::Reset(), PAD_TOOL::Reset(), EDIT_TOOL::Rotate(), ROUTER_TOOL::RouteSelected(), ROUTER_TOOL::SelectCopperLayerPair(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), PCB_POINT_EDITOR::setEditedPoint(), ROUTER_TOOL::SettingsDialog(), GLOBAL_EDIT_TOOL::swapBoardItem(), GLOBAL_EDIT_TOOL::SwapLayers(), ROUTER_TOOL::switchLayerOnViaPlacement(), DRAWING_TOOL::ToggleHV45Mode(), PCB_CONTROL::ToggleRatsnest(), PCB_CONTROL::unfilledZoneCheck(), PCB_POINT_EDITOR::updateItem(), ROUTER_TOOL::UpdateMessagePanel(), EDIT_TOOL::updateModificationPoint(), BOARD_EDITOR_CONTROL::UpdateSchematicFromPCB(), PCB_CONTROL::ZoneDisplayMode(), ZONE_FILLER_TOOL::ZoneFill(), ZONE_FILLER_TOOL::ZoneFillAll(), and ZONE_FILLER_TOOL::ZoneFillDirty().

◆ getEditFrame()

template<typename T >
T * TOOL_BASE::getEditFrame ( ) const
inlineprotectedinherited

Return the application window object, casted to requested user type.

Definition at line 185 of file tool_base.h.

186 {
187#if !defined( QA_TEST ) // Dynamic casts give the linker a seizure in the test framework
188 wxASSERT( dynamic_cast<T*>( getToolHolderInt() ) );
189#endif
190 return static_cast<T*>( getToolHolderInt() );
191 }
TOOLS_HOLDER * getToolHolderInt() const
Definition: tool_base.cpp:48

References TOOL_BASE::getToolHolderInt().

Referenced by ZONE_CREATE_HELPER::createNewZone(), and ZONE_CREATE_HELPER::setUniquePriority().

◆ GetId()

TOOL_ID TOOL_BASE::GetId ( ) const
inlineinherited

Return the unique identifier of the tool.

The identifier is set by an instance of TOOL_MANAGER.

Returns
Identifier of the tool.

Definition at line 121 of file tool_base.h.

122 {
123 return m_toolId;
124 }

References TOOL_BASE::m_toolId.

Referenced by TOOL_MANAGER::finishTool(), TOOL_MANAGER::InitTools(), TOOL_MANAGER::isActive(), TOOL_MANAGER::RegisterTool(), ACTION_MANAGER::RunHotKey(), TOOL_MANAGER::runTool(), TOOL_MANAGER::saveViewControls(), and TOOL_MANAGER::ShutdownTool().

◆ GetManager()

TOOL_MANAGER * TOOL_BASE::GetManager ( ) const
inlineinherited

◆ getModel()

template<typename T >
T * TOOL_BASE::getModel ( ) const
inlineprotectedinherited

Return the model object if it matches the requested type.

Store the type of the tool.

Definition at line 197 of file tool_base.h.

References TOOL_BASE::getModelInt().

Referenced by ZONE_CREATE_HELPER::commitZone(), and ZONE_CREATE_HELPER::createZoneFromExisting().

◆ getModelInt()

EDA_ITEM * TOOL_BASE::getModelInt ( ) const
privateinherited

Definition at line 54 of file tool_base.cpp.

55{
56 return m_toolMgr->GetModel();
57}
EDA_ITEM * GetModel() const
Definition: tool_manager.h:292

References TOOL_MANAGER::GetModel(), and TOOL_BASE::m_toolMgr.

Referenced by TOOL_BASE::getModel().

◆ GetName()

const std::string & TOOL_BASE::GetName ( void  ) const
inlineinherited

Return the name of the tool.

Tool names are expected to obey the format: application.ToolName (eg. pcbnew.InteractiveSelection).

Returns
The name of the tool.

Definition at line 134 of file tool_base.h.

135 {
136 return m_toolName;
137 }
std::string m_toolName
Definition: tool_base.h:214

References TOOL_BASE::m_toolName.

Referenced by TOOL_MANAGER::dispatchInternal(), TOOL_MANAGER::InitTools(), TOOL_MANAGER::invokeTool(), TOOL_MANAGER::RegisterTool(), TOOL_MANAGER::runTool(), and TOOL_MANAGER::ShutdownTool().

◆ getToolHolderInt()

TOOLS_HOLDER * TOOL_BASE::getToolHolderInt ( ) const
privateinherited

Definition at line 48 of file tool_base.cpp.

49{
50 return m_toolMgr->GetToolHolder();
51}
TOOLS_HOLDER * GetToolHolder() const
Definition: tool_manager.h:296

References TOOL_MANAGER::GetToolHolder(), and TOOL_BASE::m_toolMgr.

Referenced by TOOL_BASE::getEditFrame().

◆ GetToolMenu()

◆ GetType()

TOOL_TYPE TOOL_BASE::GetType ( ) const
inlineinherited

Return the type of the tool.

Returns
The type of the tool.

Definition at line 109 of file tool_base.h.

110 {
111 return m_type;
112 }
TOOL_TYPE m_type
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:207

References TOOL_BASE::m_type.

Referenced by TOOL_MANAGER::finishTool(), TOOL_MANAGER::InvokeTool(), TOOL_MANAGER::ResetTools(), TOOL_MANAGER::runTool(), and TOOL_MANAGER::ShutdownTool().

◆ getView()

KIGFX::VIEW * TOOL_BASE::getView ( ) const
protectedinherited

Returns the instance of #VIEW object used in the application.

It allows tools to draw.

Returns
The instance of VIEW.

Definition at line 36 of file tool_base.cpp.

37{
38 return m_toolMgr->GetView();
39}
KIGFX::VIEW * GetView() const
Definition: tool_manager.h:285

References TOOL_MANAGER::GetView(), and TOOL_BASE::m_toolMgr.

Referenced by EE_POINT_EDITOR::addCornerCondition(), ALIGN_DISTRIBUTE_TOOL::AlignLeft(), ALIGN_DISTRIBUTE_TOOL::AlignRight(), COMMON_TOOLS::CenterContents(), SCH_EDIT_TOOL::ChangeTextType(), EE_INSPECTION_TOOL::CheckSymbol(), GERBVIEW_CONTROL::ClearAllLayers(), PL_SELECTION_TOOL::ClearSelection(), EE_SELECTION_TOOL::ClearSelection(), EE_SELECTION_TOOL::CollectHits(), SCH_LINE_WIRE_BUS_TOOL::computeBreakPoint(), COMMON_TOOLS::CursorControl(), SCH_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), PCB_CONTROL::DeleteItemCursor(), EDIT_TOOL::DeleteItems(), PL_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), SELECTION_TOOL::doSelectionMenu(), COMMON_TOOLS::doZoomFit(), COMMON_TOOLS::doZoomInOut(), COMMON_TOOLS::doZoomToPreset(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), PL_DRAWING_TOOLS::DrawShape(), DRAWING_TOOL::drawShape(), DRAWING_TOOL::DrawZone(), BOARD_EDITOR_CONTROL::DrillOrigin(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PAD_TOOL::EnumeratePads(), EE_SELECTION_TOOL::GetNode(), ROUTER_TOOL::getStartLayer(), PCB_CONTROL::GridResetOrigin(), PCB_CONTROL::GridSetOrigin(), EE_SELECTION_TOOL::GuessSelectionCandidates(), PCB_SELECTION_TOOL::GuessSelectionCandidates(), ROUTER_TOOL::handleCommonEvents(), EE_SELECTION_TOOL::highlight(), PL_SELECTION_TOOL::highlight(), PCB_SELECTION_TOOL::highlight(), GERBVIEW_CONTROL::HighlightControl(), BOARD_INSPECTION_TOOL::highlightNet(), PNS::TOOL_BASE::highlightNets(), PCB_SELECTION_TOOL::hitTestDistance(), SCH_EDIT_TOOL::Init(), EDIT_TOOL::Init(), ROUTER_TOOL::InlineDrag(), EE_POINT_EDITOR::Main(), SCH_MOVE_TOOL::Main(), PL_POINT_EDITOR::Main(), PCB_PICKER_TOOL::Main(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), PL_EDIT_TOOL::moveItem(), COMMON_TOOLS::OnGridChanged(), PCB_POINT_EDITOR::OnSelectionChange(), COMMON_TOOLS::PanControl(), SCH_EDITOR_CONTROL::Paste(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), PL_EDIT_TOOL::Paste(), ROUTER_TOOL::performRouting(), PNS::TOOL_BASE::pickSingleItem(), BOARD_EDITOR_CONTROL::PlaceFootprint(), DRAWING_TOOL::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), DRAWING_TOOL::PlaceText(), ROUTER_TOOL::prepareInteractive(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), EE_SELECTION_TOOL::Reset(), EE_TOOL_BASE< T >::Reset(), GERBVIEW_SELECTION_TOOL::Reset(), PNS::TOOL_BASE::Reset(), BOARD_EDITOR_CONTROL::Reset(), DRAWING_TOOL::Reset(), PCB_CONTROL::Reset(), PCB_SELECTION_TOOL::Reset(), SCH_EDIT_TOOL::Rotate(), GERBVIEW_SELECTION_TOOL::select(), PCB_SELECTION_TOOL::Selectable(), EE_SELECTION_TOOL::SelectAll(), PCB_SELECTION_TOOL::SelectAll(), EE_SELECTION_TOOL::selectionContains(), PL_SELECTION_TOOL::selectionContains(), PCB_SELECTION_TOOL::selectionContains(), EE_SELECTION_TOOL::selectMultiple(), PL_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), PL_SELECTION_TOOL::SelectPoint(), EE_SELECTION_TOOL::selectPoint(), ZOOM_TOOL::selectRegion(), GERBVIEW_SELECTION_TOOL::selectVisually(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_EDITOR_CONTROL::ToggleERCErrors(), SCH_EDITOR_CONTROL::ToggleERCExclusions(), SCH_EDITOR_CONTROL::ToggleERCWarnings(), SCH_EDITOR_CONTROL::ToggleHiddenFields(), SCH_EDITOR_CONTROL::ToggleHiddenPins(), SCH_EDITOR_CONTROL::ToggleOPCurrents(), SCH_EDITOR_CONTROL::ToggleOPVoltages(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), EE_SELECTION_TOOL::unhighlight(), PL_SELECTION_TOOL::unhighlight(), PCB_SELECTION_TOOL::unhighlight(), GERBVIEW_SELECTION_TOOL::unselect(), GERBVIEW_SELECTION_TOOL::unselectVisually(), EE_POINT_EDITOR::updateEditedPoint(), PL_POINT_EDITOR::updateEditedPoint(), PCB_POINT_EDITOR::updateEditedPoint(), SCH_FIND_REPLACE_TOOL::UpdateFind(), PL_POINT_EDITOR::updateItem(), PCB_POINT_EDITOR::updateItem(), EE_TOOL_BASE< T >::updateItem(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), EE_POINT_EDITOR::updatePoints(), PL_POINT_EDITOR::updatePoints(), PCB_POINT_EDITOR::updatePoints(), PCB_SELECTION_TOOL::updateSelection(), PNS::TOOL_BASE::updateStartItem(), PCB_SELECTION_TOOL::view(), PCB_TOOL_BASE::view(), PCB_VIEWER_TOOLS::view(), EE_SELECTION_TOOL::ZoomFitCrossProbeBBox(), PCB_SELECTION_TOOL::ZoomFitCrossProbeBBox(), PCB_SELECTION_TOOL::zoomFitSelection(), EE_SELECTION_TOOL::~EE_SELECTION_TOOL(), GERBVIEW_SELECTION_TOOL::~GERBVIEW_SELECTION_TOOL(), and PCB_SELECTION_TOOL::~PCB_SELECTION_TOOL().

◆ getViewControls()

KIGFX::VIEW_CONTROLS * TOOL_BASE::getViewControls ( ) const
protectedinherited

Return the instance of VIEW_CONTROLS object used in the application.

It allows tools to read & modify user input and its settings (eg. show cursor, enable snapping to grid, etc.).

Returns
The instance of VIEW_CONTROLS.

Definition at line 42 of file tool_base.cpp.

43{
44 return m_toolMgr->GetViewControls();
45}
KIGFX::VIEW_CONTROLS * GetViewControls() const
Definition: tool_manager.h:287

References TOOL_MANAGER::GetViewControls(), and TOOL_BASE::m_toolMgr.

Referenced by EE_POINT_EDITOR::addCorner(), PCB_POINT_EDITOR::addCorner(), EE_POINT_EDITOR::addCornerCondition(), EE_SELECTION_TOOL::autostartEvent(), SCH_EDIT_TOOL::BreakWire(), PCB_SELECTION_TOOL::controls(), PCB_TOOL_BASE::controls(), EDIT_TOOL::copyToClipboard(), COMMON_TOOLS::CursorControl(), EDIT_TOOL::DeleteItems(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), EDIT_TOOL::doMoveSelection(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), COMMON_TOOLS::doZoomToPreset(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::DrawRectangle(), SCH_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PAD_TOOL::EnumeratePads(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), SCH_EDITOR_CONTROL::HighlightNet(), BOARD_INSPECTION_TOOL::HighlightNet(), ImportFootprint(), SCH_EDIT_TOOL::Init(), EDIT_TOOL::Init(), EE_POINT_EDITOR::Main(), EE_SELECTION_TOOL::Main(), SCH_MOVE_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PICKER_TOOL::Main(), PL_EDIT_TOOL::Main(), PL_POINT_EDITOR::Main(), PCB_PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), COMMON_TOOLS::OnGridChanged(), PCB_POINT_EDITOR::OnSelectionChange(), SCH_EDITOR_CONTROL::Paste(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), ROUTER_TOOL::performDragging(), LENGTH_TUNER_TOOL::performTuning(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), PCB_CONTROL::placeBoardItems(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImage(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), SCH_EDIT_TOOL::RepeatDrawItem(), PL_SELECTION_TOOL::RequestSelection(), EE_SELECTION_TOOL::RequestSelection(), DRAWING_TOOL::Reset(), PCB_POINT_EDITOR::Reset(), COMMON_TOOLS::ResetLocalCoords(), ROUTER_TOOL::RouteSelected(), PCB_SELECTION_TOOL::selectCursor(), EE_SELECTION_TOOL::selectMultiple(), PL_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::SelectNode(), ZOOM_TOOL::selectRegion(), ALIGN_DISTRIBUTE_TOOL::selectTarget(), PICKER_TOOL::setControls(), PCB_PICKER_TOOL::setControls(), EE_POINT_EDITOR::setEditedPoint(), PL_POINT_EDITOR::setEditedPoint(), PCB_POINT_EDITOR::setEditedPoint(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), EE_POINT_EDITOR::updateEditedPoint(), PL_POINT_EDITOR::updateEditedPoint(), PCB_POINT_EDITOR::updateEditedPoint(), PCB_POINT_EDITOR::updateItem(), PL_EDIT_TOOL::updateModificationPoint(), and COMMON_TOOLS::ZoomCenter().

◆ Go()

template<class T >
void TOOL_INTERACTIVE::Go ( int(T::*)(const TOOL_EVENT &)  aStateFunc,
const TOOL_EVENT_LIST aConditions = TOOL_EVENTTC_ANYTA_ANY ) 
)
inherited

Define which state (aStateFunc) to go when a certain event arrives (aConditions).

No conditions means any event.

Definition at line 147 of file tool_interactive.h.

149{
150 TOOL_STATE_FUNC sptr = std::bind( aStateFunc, static_cast<T*>( this ), std::placeholders::_1 );
151
152 goInternal( sptr, aConditions );
153}
void goInternal(TOOL_STATE_FUNC &aState, const TOOL_EVENT_LIST &aConditions)
std::function< int(const TOOL_EVENT &)> TOOL_STATE_FUNC
Definition: tool_base.h:58

References TOOL_INTERACTIVE::goInternal().

Referenced by EDA_3D_CONTROLLER::setTransitions(), CVPCB_ASSOCIATION_TOOL::setTransitions(), CVPCB_CONTROL::setTransitions(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::setTransitions(), EE_INSPECTION_TOOL::setTransitions(), EE_POINT_EDITOR::setTransitions(), EE_SELECTION_TOOL::setTransitions(), SCH_DRAWING_TOOLS::setTransitions(), SCH_EDIT_TOOL::setTransitions(), SCH_EDITOR_CONTROL::setTransitions(), SCH_FIND_REPLACE_TOOL::setTransitions(), SCH_LINE_WIRE_BUS_TOOL::setTransitions(), SCH_MOVE_TOOL::setTransitions(), SCH_NAVIGATE_TOOL::setTransitions(), SIMULATOR_CONTROL::setTransitions(), SYMBOL_EDITOR_CONTROL::setTransitions(), SYMBOL_EDITOR_DRAWING_TOOLS::setTransitions(), SYMBOL_EDITOR_EDIT_TOOL::setTransitions(), SYMBOL_EDITOR_MOVE_TOOL::setTransitions(), SYMBOL_EDITOR_PIN_TOOL::setTransitions(), GERBVIEW_CONTROL::setTransitions(), GERBVIEW_INSPECTION_TOOL::setTransitions(), GERBVIEW_SELECTION_TOOL::setTransitions(), COMMON_CONTROL::setTransitions(), COMMON_TOOLS::setTransitions(), PICKER_TOOL::setTransitions(), ZOOM_TOOL::setTransitions(), KICAD_MANAGER_CONTROL::setTransitions(), PL_DRAWING_TOOLS::setTransitions(), PL_EDIT_TOOL::setTransitions(), PL_EDITOR_CONTROL::setTransitions(), PL_POINT_EDITOR::setTransitions(), PL_SELECTION_TOOL::setTransitions(), AUTOPLACE_TOOL::setTransitions(), MICROWAVE_TOOL::setTransitions(), SCRIPTING_TOOL::setTransitions(), LENGTH_TUNER_TOOL::setTransitions(), ROUTER_TOOL::setTransitions(), BOARD_EDITOR_CONTROL::setTransitions(), BOARD_INSPECTION_TOOL::setTransitions(), BOARD_REANNOTATE_TOOL::setTransitions(), CONVERT_TOOL::setTransitions(), DRAWING_TOOL::setTransitions(), DRC_TOOL::setTransitions(), EDIT_TOOL::setTransitions(), setTransitions(), GLOBAL_EDIT_TOOL::setTransitions(), GROUP_TOOL::setTransitions(), PAD_TOOL::setTransitions(), PCB_CONTROL::setTransitions(), PCB_PICKER_TOOL::setTransitions(), PCB_POINT_EDITOR::setTransitions(), PCB_SELECTION_TOOL::setTransitions(), PCB_VIEWER_TOOLS::setTransitions(), ALIGN_DISTRIBUTE_TOOL::setTransitions(), POSITION_RELATIVE_TOOL::setTransitions(), PROPERTIES_TOOL::setTransitions(), and ZONE_FILLER_TOOL::setTransitions().

◆ goInternal()

void TOOL_INTERACTIVE::goInternal ( TOOL_STATE_FUNC aState,
const TOOL_EVENT_LIST aConditions 
)
privateinherited

Definition at line 70 of file tool_interactive.cpp.

71{
72 m_toolMgr->ScheduleNextState( this, aState, aConditions );
73}
void ScheduleNextState(TOOL_BASE *aTool, TOOL_STATE_FUNC &aHandler, const TOOL_EVENT_LIST &aConditions)
Define a state transition.

References TOOL_BASE::m_toolMgr, and TOOL_MANAGER::ScheduleNextState().

Referenced by TOOL_INTERACTIVE::Go().

◆ ImportFootprint()

int FOOTPRINT_EDITOR_CONTROL::ImportFootprint ( const TOOL_EVENT aEvent)

Definition at line 498 of file footprint_editor_control.cpp.

499{
500 bool is_last_fp_from_brd = m_frame->IsCurrentFPFromBoard();
501
502 if( !m_frame->Clear_Pcb( true ) )
503 return -1; // this command is aborted
504
507
510
512
513 // Update the save items if needed.
514 if( is_last_fp_from_brd )
515 {
518 }
519
521 m_frame->OnModify();
522 return 0;
523}
static TOOL_ACTION zoomFitScreen
Definition: actions.h:99
virtual void ClearUndoRedoList()
Clear the undo and redo list using ClearUndoORRedoList()
void ReCreateMenuBar()
Recreates the menu bar.
FOOTPRINT * ImportFootprint(const wxString &aName=wxT(""))
Read a file containing only one footprint.
void ReCreateHToolbar() override
Create the main horizontal toolbar for the footprint editor.

References FOOTPRINT_EDIT_FRAME::Clear_Pcb(), EDA_ITEM::ClearFlags(), EDA_BASE_FRAME::ClearUndoRedoList(), PCB_TOOL_BASE::frame(), PCB_BASE_FRAME::GetBoard(), BOARD::GetFirstFootprint(), TOOL_BASE::getViewControls(), FOOTPRINT_EDIT_FRAME::ImportFootprint(), FOOTPRINT_EDIT_FRAME::IsCurrentFPFromBoard(), m_frame, TOOL_BASE::m_toolMgr, FOOTPRINT_EDIT_FRAME::OnModify(), FOOTPRINT_EDIT_FRAME::ReCreateHToolbar(), EDA_BASE_FRAME::ReCreateMenuBar(), TOOL_MANAGER::RunAction(), KIGFX::VIEW_CONTROLS::SetCrossHairCursorPosition(), and ACTIONS::zoomFitScreen.

Referenced by setTransitions().

◆ Init()

bool FOOTPRINT_EDITOR_CONTROL::Init ( )
overridevirtual

Init() is called once upon a registration of the tool.

Returns
True if the initialization went fine, false - otherwise.

Reimplemented from PCB_TOOL_BASE.

Definition at line 72 of file footprint_editor_control.cpp.

73{
74 // Build a context menu for the footprint tree
75 //
76 CONDITIONAL_MENU& ctxMenu = m_menu.GetMenu();
77
78 auto libSelectedCondition =
79 [ this ]( const SELECTION& aSel )
80 {
81 LIB_ID sel = m_frame->GetTreeFPID();
82 return !sel.GetLibNickname().empty() && sel.GetLibItemName().empty();
83 };
84
85 // The libInferredCondition allows you to do things like New Symbol and Paste with a
86 // symbol selected (in other words, when we know the library context even if the library
87 // itself isn't selected.
88 auto libInferredCondition =
89 [ this ]( const SELECTION& aSel )
90 {
91 LIB_ID sel = m_frame->GetTreeFPID();
92 return !sel.GetLibNickname().empty();
93 };
94 auto pinnedLibSelectedCondition =
95 [ this ]( const SELECTION& aSel )
96 {
98 return current && current->m_Type == LIB_TREE_NODE::LIB && current->m_Pinned;
99 };
100 auto unpinnedLibSelectedCondition =
101 [ this ](const SELECTION& aSel )
102 {
104 return current && current->m_Type == LIB_TREE_NODE::LIB && !current->m_Pinned;
105 };
106 auto fpSelectedCondition =
107 [ this ]( const SELECTION& aSel )
108 {
109 LIB_ID sel = m_frame->GetTreeFPID();
110 return !sel.GetLibNickname().empty() && !sel.GetLibItemName().empty();
111 };
112
113 ctxMenu.AddItem( ACTIONS::pinLibrary, unpinnedLibSelectedCondition );
114 ctxMenu.AddItem( ACTIONS::unpinLibrary, pinnedLibSelectedCondition );
115
116 ctxMenu.AddSeparator();
117 ctxMenu.AddItem( PCB_ACTIONS::newFootprint, libSelectedCondition );
118 ctxMenu.AddItem( PCB_ACTIONS::createFootprint, libSelectedCondition );
119
120 ctxMenu.AddSeparator();
122 ctxMenu.AddItem( ACTIONS::saveAs, libSelectedCondition || fpSelectedCondition );
123 ctxMenu.AddItem( ACTIONS::revert, libSelectedCondition || libInferredCondition );
124
125 ctxMenu.AddSeparator();
126 ctxMenu.AddItem( PCB_ACTIONS::cutFootprint, fpSelectedCondition );
127 ctxMenu.AddItem( PCB_ACTIONS::copyFootprint, fpSelectedCondition );
128 ctxMenu.AddItem( PCB_ACTIONS::pasteFootprint, libInferredCondition );
129 ctxMenu.AddItem( PCB_ACTIONS::duplicateFootprint, fpSelectedCondition );
130 ctxMenu.AddItem( PCB_ACTIONS::renameFootprint, fpSelectedCondition );
131 ctxMenu.AddItem( PCB_ACTIONS::deleteFootprint, fpSelectedCondition );
132
133 ctxMenu.AddSeparator();
134 ctxMenu.AddItem( PCB_ACTIONS::importFootprint, libInferredCondition );
135 ctxMenu.AddItem( PCB_ACTIONS::exportFootprint, fpSelectedCondition );
136
137 // If we've got nothing else to show, at least show a hide tree option
138 ctxMenu.AddItem( PCB_ACTIONS::hideFootprintTree, !libInferredCondition );
139
140 return true;
141}
static TOOL_ACTION revert
Definition: actions.h:55
static TOOL_ACTION saveAs
Definition: actions.h:52
static TOOL_ACTION pinLibrary
Definition: actions.h:113
static TOOL_ACTION save
Definition: actions.h:51
static TOOL_ACTION unpinLibrary
Definition: actions.h:114
void AddItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Add a menu entry to run a TOOL_ACTION on selected items.
void AddSeparator(int aOrder=ANY_ORDER)
Add a separator to the menu.
LIB_TREE_NODE * GetCurrentTreeNode() const
const UTF8 & GetLibItemName() const
Definition: lib_id.h:102
Model class in the component selector Model-View-Adapter (mediated MVC) architecture.
enum TYPE m_Type
static TOOL_ACTION deleteFootprint
Definition: pcb_actions.h:413
static TOOL_ACTION renameFootprint
Definition: pcb_actions.h:412
static TOOL_ACTION createFootprint
Definition: pcb_actions.h:403
static TOOL_ACTION hideFootprintTree
Definition: pcb_actions.h:396
static TOOL_ACTION exportFootprint
Definition: pcb_actions.h:418
static TOOL_ACTION newFootprint
Definition: pcb_actions.h:400
static TOOL_ACTION importFootprint
Definition: pcb_actions.h:417
static TOOL_ACTION pasteFootprint
Definition: pcb_actions.h:416
static TOOL_ACTION duplicateFootprint
Definition: pcb_actions.h:411
static TOOL_ACTION copyFootprint
Definition: pcb_actions.h:415
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
CONDITIONAL_MENU & GetMenu()
Definition: tool_menu.cpp:44

References CONDITIONAL_MENU::AddItem(), CONDITIONAL_MENU::AddSeparator(), PCB_ACTIONS::copyFootprint, PCB_ACTIONS::createFootprint, PCB_ACTIONS::cutFootprint, PCB_ACTIONS::deleteFootprint, PCB_ACTIONS::duplicateFootprint, UTF8::empty(), PCB_ACTIONS::exportFootprint, FOOTPRINT_EDIT_FRAME::GetCurrentTreeNode(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), TOOL_MENU::GetMenu(), FOOTPRINT_EDIT_FRAME::GetTreeFPID(), PCB_ACTIONS::hideFootprintTree, PCB_ACTIONS::importFootprint, LIB_TREE_NODE::LIB, m_frame, TOOL_INTERACTIVE::m_menu, LIB_TREE_NODE::m_Pinned, LIB_TREE_NODE::m_Type, PCB_ACTIONS::newFootprint, PCB_ACTIONS::pasteFootprint, ACTIONS::pinLibrary, PCB_ACTIONS::renameFootprint, ACTIONS::revert, ACTIONS::save, ACTIONS::saveAs, SELECTION_CONDITIONS::ShowAlways(), and ACTIONS::unpinLibrary.

◆ Is45Limited()

bool PCB_TOOL_BASE::Is45Limited ( ) const
virtualinherited

Should the tool use its 45° mode option?

Returns
True if set to use 45°

Definition at line 332 of file pcb_tool_base.cpp.

333{
334 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
335
336 if( frame()->IsType( FRAME_PCB_EDITOR ) )
337 return mgr.GetAppSettings<PCBNEW_SETTINGS>()->m_Use45DegreeLimit;
338 else
339 return mgr.GetAppSettings<FOOTPRINT_EDITOR_SETTINGS>()->m_Use45Limit;
340}
T * GetAppSettings(bool aLoadNow=true)
Returns a handle to the a given settings by type If the settings have already been loaded,...
@ FRAME_PCB_EDITOR
Definition: frame_type.h:40
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:111

References PCB_TOOL_BASE::frame(), FRAME_PCB_EDITOR, SETTINGS_MANAGER::GetAppSettings(), and Pgm().

Referenced by DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawShape(), DRAWING_TOOL::DrawZone(), and ZONE_CREATE_HELPER::OnFirstPoint().

◆ IsBoardEditor()

bool PCB_TOOL_BASE::IsBoardEditor ( ) const
inlineinherited

Definition at line 109 of file pcb_tool_base.h.

109{ return m_isBoardEditor; }

References PCB_TOOL_BASE::m_isBoardEditor.

Referenced by BOARD_COMMIT::BOARD_COMMIT().

◆ IsFootprintEditor()

◆ IsToolActive()

bool TOOL_BASE::IsToolActive ( ) const
inherited

Definition at line 31 of file tool_base.cpp.

32{
34}
bool IsToolActive(TOOL_ID aId) const
Return true if a tool with given id is active (executing)

References TOOL_MANAGER::IsToolActive(), TOOL_BASE::m_toolId, and TOOL_BASE::m_toolMgr.

Referenced by EDIT_TOOL::Drag(), ROUTER_TOOL::handleLayerSwitch(), PCB_SELECTION_TOOL::Main(), BOARD_EDITOR_CONTROL::TrackWidthDec(), and BOARD_EDITOR_CONTROL::TrackWidthInc().

◆ NewFootprint()

int FOOTPRINT_EDITOR_CONTROL::NewFootprint ( const TOOL_EVENT aEvent)

Definition at line 144 of file footprint_editor_control.cpp.

145{
146 LIB_ID selected = m_frame->GetTreeFPID();
147 FOOTPRINT* newFootprint = m_frame->CreateNewFootprint( wxEmptyString );
148
149 if( !newFootprint )
150 return 0;
151
152 if( !m_frame->Clear_Pcb( true ) )
153 return 0;
154
156 m_frame->AddFootprintToBoard( newFootprint );
157
158 // Initialize data relative to nets and netclasses (for a new footprint the defaults are
159 // used). This is mandatory to handle and draw pads.
161 newFootprint->SetPosition( VECTOR2I( 0, 0 ) );
162 newFootprint->ClearFlags();
163
164 m_frame->Zoom_Automatique( false );
166
167 // If selected from the library tree then go ahead and save it there
168 if( !selected.GetLibNickname().empty() )
169 {
170 LIB_ID fpid = newFootprint->GetFPID();
171 fpid.SetLibNickname( selected.GetLibNickname() );
172 newFootprint->SetFPID( fpid );
173 m_frame->SaveFootprint( newFootprint );
175 }
176
178 m_frame->Update3DView( true, true );
179
180 m_frame->SyncLibraryTree( false );
181 return 0;
182}
FOOTPRINT * CreateNewFootprint(const wxString &aFootprintName, bool aQuiet=false)
Creates a new footprint, at position 0,0.

References FOOTPRINT_EDIT_FRAME::AddFootprintToBoard(), PCB_TOOL_BASE::board(), BOARD::BuildListOfNets(), PCB_TOOL_BASE::canvas(), FOOTPRINT_EDIT_FRAME::Clear_Pcb(), EDA_ITEM::ClearFlags(), FOOTPRINT_EDIT_FRAME::ClearModify(), PCB_BASE_FRAME::CreateNewFootprint(), UTF8::empty(), FOOTPRINT::GetFPID(), LIB_ID::GetLibNickname(), PCB_BASE_FRAME::GetScreen(), FOOTPRINT_EDIT_FRAME::GetTreeFPID(), EDA_DRAW_PANEL_GAL::GetViewControls(), m_frame, FOOTPRINT_EDIT_FRAME::SaveFootprint(), BASE_SCREEN::SetContentModified(), KIGFX::VIEW_CONTROLS::SetCrossHairCursorPosition(), FOOTPRINT::SetFPID(), LIB_ID::SetLibNickname(), FOOTPRINT::SetPosition(), FOOTPRINT_EDIT_FRAME::SyncLibraryTree(), PCB_BASE_FRAME::Update3DView(), FOOTPRINT_EDIT_FRAME::UpdateView(), and EDA_DRAW_FRAME::Zoom_Automatique().

Referenced by setTransitions().

◆ PasteFootprint()

int FOOTPRINT_EDITOR_CONTROL::PasteFootprint ( const TOOL_EVENT aEvent)

Definition at line 347 of file footprint_editor_control.cpp.

348{
350 {
351 wxString newLib = m_frame->GetTreeFPID().GetLibNickname();
352 wxString newName = m_copiedFootprint->GetFPID().GetLibItemName();
353
354 while( m_frame->Prj().PcbFootprintLibs()->FootprintExists( newLib, newName ) )
355 newName += _( "_copy" );
356
357 m_copiedFootprint->SetFPID( LIB_ID( newLib, newName ) );
359
360 m_frame->SyncLibraryTree( true );
364 }
365
366 return 0;
367}
bool SaveFootprintInLibrary(FOOTPRINT *aFootprint, const wxString &aLibraryName)
bool FootprintExists(const wxString &aNickname, const wxString &aFootprintName)
Indicates whether or not the given footprint already exists in the given library.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
virtual FP_LIB_TABLE * PcbFootprintLibs(KIWAY &aKiway)
Return the table of footprint libraries.
Definition: project.cpp:324

References _, UTF8::empty(), FOOTPRINT_EDIT_FRAME::FocusOnLibID(), FP_LIB_TABLE::FootprintExists(), LIB_ID::GetLibNickname(), FOOTPRINT_EDIT_FRAME::GetTreeFPID(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromLibrary(), m_copiedFootprint, m_frame, PROJECT::PcbFootprintLibs(), KIWAY_HOLDER::Prj(), FOOTPRINT_EDIT_FRAME::RefreshLibraryTree(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), and FOOTPRINT_EDIT_FRAME::SyncLibraryTree().

Referenced by setTransitions().

◆ PinLibrary()

int FOOTPRINT_EDITOR_CONTROL::PinLibrary ( const TOOL_EVENT aEvent)

Definition at line 548 of file footprint_editor_control.cpp.

549{
550 LIB_TREE_NODE* currentNode = m_frame->GetCurrentTreeNode();
551
552 if( currentNode && !currentNode->m_Pinned )
553 {
554 m_frame->Prj().PinLibrary( currentNode->m_LibId.GetLibNickname(), false );
555
556 currentNode->m_Pinned = true;
558 }
559
560 return 0;
561}
void RegenerateLibraryTree()
Filter, sort, and redisplay the library tree.
void PinLibrary(const wxString &aLibrary, bool isSymbolLibrary)
Definition: project.cpp:156

References FOOTPRINT_EDIT_FRAME::GetCurrentTreeNode(), LIB_ID::GetLibNickname(), m_frame, LIB_TREE_NODE::m_LibId, LIB_TREE_NODE::m_Pinned, PROJECT::PinLibrary(), KIWAY_HOLDER::Prj(), and FOOTPRINT_EDIT_FRAME::RegenerateLibraryTree().

Referenced by setTransitions().

◆ Properties()

int FOOTPRINT_EDITOR_CONTROL::Properties ( const TOOL_EVENT aEvent)

Definition at line 601 of file footprint_editor_control.cpp.

602{
604
605 if( footprint )
606 {
607 getEditFrame<FOOTPRINT_EDIT_FRAME>()->OnEditItemRequest( footprint );
609 }
610 return 0;
611}

References PCB_TOOL_BASE::footprint(), PCB_BASE_FRAME::GetBoard(), PCB_BASE_FRAME::GetCanvas(), BOARD::GetFirstFootprint(), m_frame, and EDA_DRAW_PANEL_GAL::Refresh().

Referenced by setTransitions().

◆ RenameFootprint()

int FOOTPRINT_EDITOR_CONTROL::RenameFootprint ( const TOOL_EVENT aEvent)

Definition at line 392 of file footprint_editor_control.cpp.

393{
395 LIB_ID fpID = m_frame->GetTreeFPID();
396 wxString libraryName = fpID.GetLibNickname();
397 wxString oldName = fpID.GetLibItemName();
398 wxString newName = oldName;
399 bool done = false;
400
401 while( !done )
402 {
403 wxTextEntryDialog dlg( m_frame, _( "New name:" ), _( "Change Footprint Name" ), newName );
404
405 if( dlg.ShowModal() != wxID_OK )
406 return 0; // canceled by user
407
408 newName = dlg.GetValue();
409 newName.Trim( true ).Trim( false );
410
411 if( newName.IsEmpty() )
412 {
413 DisplayErrorMessage( m_frame, _( "Footprint name cannot be empty." ) );
414 }
415 else if( tbl->FootprintExists( libraryName, newName ) )
416 {
417 DisplayErrorMessage( m_frame, wxString::Format( _( "Footprint name '%s' already "
418 "in use in library '%s'." ),
419 UnescapeString( newName ),
420 libraryName ) );
421 newName = oldName;
422 }
423 else
424 {
425 done = true;
426 }
427 }
428
429 FOOTPRINT* footprint = nullptr;
430
431 if( fpID == m_frame->GetLoadedFPID() )
432 {
434
435 if( footprint )
436 {
437 footprint->SetFPID( LIB_ID( libraryName, newName ) );
438
439 if( footprint->GetValue() == oldName )
440 footprint->SetValue( newName );
441
442 m_frame->OnModify();
444 }
445 }
446 else
447 {
449
450 if( footprint )
451 {
452 try
453 {
454 footprint->SetFPID( LIB_ID( libraryName, newName ) );
455
456 if( footprint->GetValue() == oldName )
457 footprint->SetValue( newName );
458
460
461 m_frame->Prj().PcbFootprintLibs()->FootprintDelete( libraryName, oldName );
462 }
463 catch( const IO_ERROR& ioe )
464 {
465 DisplayError( m_frame, ioe.What() );
466 }
467 catch( ... )
468 {
469 // Best efforts...
470 }
471 }
472 }
473
474 wxDataViewItem treeItem = m_frame->GetLibTreeAdapter()->FindItem( fpID );
475 m_frame->UpdateLibraryTree( treeItem, footprint );
476 m_frame->FocusOnLibID( LIB_ID( libraryName, newName ) );
477
478 return 0;
479}
void UpdateLibraryTree(const wxDataViewItem &treeItem, FOOTPRINT *aFootprint)
Update a single node in the library tree.
wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > & GetLibTreeAdapter()
Return the adapter object that provides the stored data.
void SetValue(const wxString &aValue)
Definition: footprint.h:555
const wxString & GetValue() const
Definition: footprint.h:547
void FootprintDelete(const wxString &aNickname, const wxString &aFootprintName)
Delete the aFootprintName from the library given by aNickname.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:76
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:30
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:300
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:325
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
wxString UnescapeString(const wxString &aSource)

References _, DisplayError(), DisplayErrorMessage(), FOOTPRINT_EDIT_FRAME::FocusOnLibID(), PCB_TOOL_BASE::footprint(), FP_LIB_TABLE::FootprintDelete(), FP_LIB_TABLE::FootprintExists(), Format(), PCB_BASE_FRAME::GetBoard(), BOARD::GetFirstFootprint(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), FOOTPRINT_EDIT_FRAME::GetLibTreeAdapter(), FOOTPRINT_EDIT_FRAME::GetLoadedFPID(), FOOTPRINT_EDIT_FRAME::GetTreeFPID(), FOOTPRINT::GetValue(), PCB_BASE_FRAME::LoadFootprint(), m_frame, FOOTPRINT_EDIT_FRAME::OnModify(), PROJECT::PcbFootprintLibs(), KIWAY_HOLDER::Prj(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), FOOTPRINT::SetFPID(), FOOTPRINT::SetValue(), UnescapeString(), FOOTPRINT_EDIT_FRAME::UpdateLibraryTree(), FOOTPRINT_EDIT_FRAME::UpdateView(), and IO_ERROR::What().

Referenced by setTransitions().

◆ RepairFootprint()

int FOOTPRINT_EDITOR_CONTROL::RepairFootprint ( const TOOL_EVENT aEvent)

Definition at line 670 of file footprint_editor_control.cpp.

671{
672 FOOTPRINT* footprint = board()->Footprints().front();
673 int errors = 0;
674 wxString details;
675
676 // Repair duplicate IDs and missing nets.
677 std::set<KIID> ids;
678 int duplicates = 0;
679
680 auto processItem =
681 [&]( EDA_ITEM* aItem )
682 {
683 if( ids.count( aItem->m_Uuid ) )
684 {
685 duplicates++;
686 const_cast<KIID&>( aItem->m_Uuid ) = KIID();
687 }
688
689 ids.insert( aItem->m_Uuid );
690 };
691
692 // Footprint IDs are the most important, so give them the first crack at "claiming" a
693 // particular KIID.
694
695 processItem( footprint );
696
697 // After that the principal use is for DRC marker pointers, which are most likely to pads.
698
699 for( PAD* pad : footprint->Pads() )
700 processItem( pad );
701
702 // From here out I don't think order matters much.
703
704 processItem( &footprint->Reference() );
705 processItem( &footprint->Value() );
706
707 for( BOARD_ITEM* item : footprint->GraphicalItems() )
708 processItem( item );
709
710 for( ZONE* zone : footprint->Zones() )
711 processItem( zone );
712
713 for( PCB_GROUP* group : footprint->Groups() )
714 processItem( group );
715
716 if( duplicates )
717 {
718 errors += duplicates;
719 details += wxString::Format( _( "%d duplicate IDs replaced.\n" ), duplicates );
720 }
721
722 /*******************************
723 * Your test here
724 */
725
726 /*******************************
727 * Inform the user
728 */
729
730 if( errors )
731 {
732 m_frame->OnModify();
733
734 wxString msg = wxString::Format( _( "%d potential problems repaired." ), errors );
735 DisplayInfoMessage( m_frame, msg, details );
736 }
737 else
738 {
739 DisplayInfoMessage( m_frame, _( "No footprint problems found." ) );
740 }
741
742 return 0;
743}
FOOTPRINTS & Footprints()
Definition: board.h:311
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:85
FP_GROUPS & Groups()
Definition: footprint.h:179
PADS & Pads()
Definition: footprint.h:170
FP_TEXT & Value()
read/write accessors:
Definition: footprint.h:567
FP_ZONES & Zones()
Definition: footprint.h:176
DRAWINGS & GraphicalItems()
Definition: footprint.h:173
FP_TEXT & Reference()
Definition: footprint.h:568
Definition: kiid.h:48
Definition: pad.h:60
A set of BOARD_ITEMs (i.e., without duplicates).
Definition: pcb_group.h:51
Handle a list of polygons defining a copper zone.
Definition: zone.h:57
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
Definition: confirm.cpp:352

References _, PCB_TOOL_BASE::board(), DisplayInfoMessage(), PCB_TOOL_BASE::footprint(), BOARD::Footprints(), Format(), FOOTPRINT::GraphicalItems(), group, FOOTPRINT::Groups(), m_frame, FOOTPRINT_EDIT_FRAME::OnModify(), pad, FOOTPRINT::Pads(), FOOTPRINT::Reference(), FOOTPRINT::Value(), and FOOTPRINT::Zones().

Referenced by setTransitions().

◆ Reset()

void FOOTPRINT_EDITOR_CONTROL::Reset ( RESET_REASON  aReason)
overridevirtual

Bring the tool to a known, initial state.

If the tool claimed anything from the model or the view, it must release it when its reset.

Parameters
aReasoncontains information about the reason of tool reset.

Reimplemented from PCB_TOOL_BASE.

Definition at line 63 of file footprint_editor_control.cpp.

64{
65 m_frame = getEditFrame<FOOTPRINT_EDIT_FRAME>();
66
67 if( m_checkerDialog )
69}

References DestroyCheckerDialog(), m_checkerDialog, and m_frame.

◆ resetTransitions()

void TOOL_INTERACTIVE::resetTransitions ( )
privateinherited

Clear the current transition map and restores the default one created by setTransitions().

Definition at line 63 of file tool_interactive.cpp.

64{
67}
virtual void setTransitions()=0
This method is meant to be overridden in order to specify handlers for events.
void ClearTransitions(TOOL_BASE *aTool)
Clear the state transition map for a tool.

References TOOL_MANAGER::ClearTransitions(), TOOL_BASE::m_toolMgr, and TOOL_INTERACTIVE::setTransitions().

◆ Revert()

int FOOTPRINT_EDITOR_CONTROL::Revert ( const TOOL_EVENT aEvent)

Definition at line 319 of file footprint_editor_control.cpp.

320{
321 getEditFrame<FOOTPRINT_EDIT_FRAME>()->RevertFootprint();
322 return 0;
323}

Referenced by setTransitions().

◆ RunMainStack()

void TOOL_INTERACTIVE::RunMainStack ( std::function< void()>  aFunc)
inherited

Call a function using the main stack.

Parameters
aFuncis the function to be calls.

Definition at line 87 of file tool_interactive.cpp.

88{
89 m_toolMgr->RunMainStack( this, std::move( aFunc ) );
90}
void RunMainStack(TOOL_BASE *aTool, std::function< void()> aFunc)

References TOOL_BASE::m_toolMgr, and TOOL_MANAGER::RunMainStack().

Referenced by DRAWING_TOOL::PlaceText().

◆ Save()

◆ SaveAs()

int FOOTPRINT_EDITOR_CONTROL::SaveAs ( const TOOL_EVENT aEvent)

Definition at line 273 of file footprint_editor_control.cpp.

274{
276 {
277 // Save Library As
278 const wxString& src_libNickname = m_frame->GetTargetFPID().GetLibNickname();
279 wxString src_libFullName = m_frame->Prj().PcbFootprintLibs()->GetFullURI( src_libNickname );
280
281 if( m_frame->SaveLibraryAs( src_libFullName ) )
282 m_frame->SyncLibraryTree( true );
283 }
284 else if( m_frame->GetTargetFPID() == m_frame->GetLoadedFPID() )
285 {
286 // Save Footprint As
288 {
289 view()->Update( footprint() );
291
292 // Get rid of the save-will-update-board-only (or any other dismissable warning)
293 WX_INFOBAR* infobar = m_frame->GetInfoBar();
294
295 if( infobar->IsShown() && infobar->HasCloseButton() )
296 infobar->Dismiss();
297
298 canvas()->ForceRefresh();
299 m_frame->SyncLibraryTree( true );
300 }
301 }
302 else
303 {
304 // Save Selected Footprint As
306
308 {
309 m_frame->SyncLibraryTree( true );
311 }
312 }
313
315 return 0;
316}
WX_INFOBAR * GetInfoBar()
bool SaveLibraryAs(const wxString &aLibraryPath)
Save a library to a new name and/or library type.
bool SaveFootprintAs(FOOTPRINT *aFootprint)
wxString GetFullURI(const wxString &aLibNickname, bool aExpandEnvVars=true) const
Return the full URI of the library mapped to aLibNickname.
A modified version of the wxInfoBar class that allows us to:
Definition: wx_infobar.h:75
bool HasCloseButton() const
Definition: wx_infobar.cpp:313
void Dismiss() override
Dismisses the infobar and updates the containing layout and AUI manager (if one is provided).
Definition: wx_infobar.cpp:175

References PCB_TOOL_BASE::canvas(), FOOTPRINT_EDIT_FRAME::ClearModify(), WX_INFOBAR::Dismiss(), UTF8::empty(), FOOTPRINT_EDIT_FRAME::FocusOnLibID(), PCB_TOOL_BASE::footprint(), EDA_DRAW_PANEL_GAL::ForceRefresh(), FOOTPRINT::GetFPID(), LIB_TABLE::GetFullURI(), EDA_BASE_FRAME::GetInfoBar(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), FOOTPRINT_EDIT_FRAME::GetLoadedFPID(), FOOTPRINT_EDIT_FRAME::GetTargetFPID(), WX_INFOBAR::HasCloseButton(), PCB_BASE_FRAME::LoadFootprint(), m_frame, PROJECT::PcbFootprintLibs(), KIWAY_HOLDER::Prj(), FOOTPRINT_EDIT_FRAME::RefreshLibraryTree(), FOOTPRINT_EDIT_FRAME::SaveFootprintAs(), FOOTPRINT_EDIT_FRAME::SaveLibraryAs(), FOOTPRINT_EDIT_FRAME::SyncLibraryTree(), KIGFX::PCB_VIEW::Update(), and PCB_TOOL_BASE::view().

Referenced by setTransitions().

◆ selection() [1/2]

PCB_SELECTION & PCB_TOOL_BASE::selection ( )
protectedinherited

Definition at line 324 of file pcb_tool_base.cpp.

325{
327
328 return selTool->GetSelection();
329}
The selection tool: currently supports:
PCB_SELECTION & GetSelection()

References PCB_SELECTION_TOOL::GetSelection(), TOOL_MANAGER::GetTool(), and TOOL_BASE::m_toolMgr.

◆ selection() [2/2]

const PCB_SELECTION & PCB_TOOL_BASE::selection ( ) const
protectedinherited

Definition at line 316 of file pcb_tool_base.cpp.

317{
319
320 return selTool->GetSelection();
321}

References PCB_SELECTION_TOOL::GetSelection(), TOOL_MANAGER::GetTool(), and TOOL_BASE::m_toolMgr.

Referenced by BOARD_EDITOR_CONTROL::AssignNetclass(), AUTOPLACE_TOOL::autoplaceSelected(), BOARD_INSPECTION_TOOL::calculateSelectionRatsnest(), ROUTER_TOOL::CanInlineDrag(), EDIT_TOOL::ChangeTrackWidth(), PAD_TOOL::copyPadSettings(), EDIT_TOOL::copyToClipboard(), EDIT_TOOL::CreateArray(), DRC_TOOL::CrossProbe(), BOARD_EDITOR_CONTROL::doCrossProbePcbToSch(), BOARD_INSPECTION_TOOL::doHideRatsnestNet(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), EDIT_TOOL::Drag(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawShape(), DRAWING_TOOL::DrawZone(), EDIT_TOOL::Duplicate(), BOARD_EDITOR_CONTROL::EditFpInFpEditor(), PAD_TOOL::EditPad(), GROUP_TOOL::EnterGroup(), PAD_TOOL::EnumeratePads(), GLOBAL_EDIT_TOOL::ExchangeFootprints(), EDIT_TOOL::FilletLines(), EDIT_TOOL::FilletTracks(), EDIT_TOOL::Flip(), DRAWING_TOOL::getSourceZoneForAction(), GROUP_TOOL::Group(), BOARD_INSPECTION_TOOL::highlightNet(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), BOARD_INSPECTION_TOOL::InspectClearance(), BOARD_INSPECTION_TOOL::InspectConstraints(), DRAWING_TOOL::InteractivePlaceWithPreview(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), LENGTH_TUNER_TOOL::MainLoop(), ROUTER_TOOL::MainLoop(), EDIT_TOOL::Mirror(), BOARD_EDITOR_CONTROL::modifyLockSelected(), EDIT_TOOL::MoveExact(), PCB_POINT_EDITOR::OnSelectionChange(), EDIT_TOOL::PackAndMoveFootprints(), PAD_TOOL::pastePadProperties(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), PCB_CONTROL::placeBoardItems(), BOARD_EDITOR_CONTROL::PlaceFootprint(), DRAWING_TOOL::PlaceImportedGraphics(), DRAWING_TOOL::PlaceText(), POSITION_RELATIVE_TOOL::PositionRelative(), EDIT_TOOL::Properties(), PAD_TOOL::pushPadSettings(), BOARD_REANNOTATE_TOOL::ReannotateDuplicatesInSelection(), GROUP_TOOL::RemoveFromGroup(), GLOBAL_EDIT_TOOL::RemoveUnusedPads(), EDIT_TOOL::Rotate(), ROUTER_TOOL::RouteSelected(), DRAWING_TOOL::SetAnchor(), EDIT_TOOL::Swap(), BOARD_EDITOR_CONTROL::TrackWidthDec(), BOARD_EDITOR_CONTROL::TrackWidthInc(), GROUP_TOOL::Ungroup(), BOARD_INSPECTION_TOOL::UpdateLocalRatsnest(), PCB_CONTROL::UpdateMessagePanel(), BOARD_EDITOR_CONTROL::ViaSizeDec(), BOARD_EDITOR_CONTROL::ViaSizeInc(), BOARD_EDITOR_CONTROL::ZoneDuplicate(), ZONE_FILLER_TOOL::ZoneFill(), BOARD_EDITOR_CONTROL::ZoneMerge(), and ZONE_FILLER_TOOL::ZoneUnfill().

◆ SetContextMenu()

void TOOL_INTERACTIVE::SetContextMenu ( ACTION_MENU aMenu,
CONTEXT_MENU_TRIGGER  aTrigger = CMENU_BUTTON 
)
inherited

Assign a context menu and tells when it should be activated.

Parameters
aMenuis the menu to be assigned.
aTriggerdetermines conditions upon which the context menu is activated.

Definition at line 76 of file tool_interactive.cpp.

77{
78 if( aMenu )
79 aMenu->SetTool( this );
80 else
81 aTrigger = CMENU_OFF;
82
83 m_toolMgr->ScheduleContextMenu( this, aMenu, aTrigger );
84}
void SetTool(TOOL_INTERACTIVE *aTool)
Set a tool that is the creator of the menu.
void ScheduleContextMenu(TOOL_BASE *aTool, ACTION_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger)
Set behavior of the tool's context popup menu.
@ CMENU_OFF
Definition: tool_event.h:149

References CMENU_OFF, TOOL_BASE::m_toolMgr, TOOL_MANAGER::ScheduleContextMenu(), and ACTION_MENU::SetTool().

Referenced by SELECTION_TOOL::doSelectionMenu(), TOOL_MENU::ShowContextMenu(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ SetIsBoardEditor()

void PCB_TOOL_BASE::SetIsBoardEditor ( bool  aEnabled)
inlineinherited

Definition at line 108 of file pcb_tool_base.h.

108{ m_isBoardEditor = aEnabled; }

References PCB_TOOL_BASE::m_isBoardEditor.

◆ SetIsFootprintEditor()

void PCB_TOOL_BASE::SetIsFootprintEditor ( bool  aEnabled)
inlineinherited

Function SetIsFootprintEditor()

Toggles edit footprint mode. When enabled, one may select parts of footprints individually (graphics, pads, etc.), so they can be modified.

Parameters
aEnableddecides if the mode should be enabled.

Definition at line 105 of file pcb_tool_base.h.

105{ m_isFootprintEditor = aEnabled; }

References PCB_TOOL_BASE::m_isFootprintEditor.

◆ setTransitions()

void FOOTPRINT_EDITOR_CONTROL::setTransitions ( )
overrideprivatevirtual

< Set up handlers for various events.

Reimplemented from PCB_TOOL_BASE.

Definition at line 746 of file footprint_editor_control.cpp.

747{
756
761
764
767
770
779}
int Revert(const TOOL_EVENT &aEvent)
int PinLibrary(const TOOL_EVENT &aEvent)
int PasteFootprint(const TOOL_EVENT &aEvent)
int ToggleFootprintTree(const TOOL_EVENT &aEvent)
int CutCopyFootprint(const TOOL_EVENT &aEvent)
int EditFootprint(const TOOL_EVENT &aEvent)
int ToggleProperties(const TOOL_EVENT &aEvent)
int Save(const TOOL_EVENT &aEvent)
int CreateFootprint(const TOOL_EVENT &aEvent)
int NewFootprint(const TOOL_EVENT &aEvent)
int DefaultPadProperties(const TOOL_EVENT &aEvent)
Edit the properties used for new pad creation.
int ImportFootprint(const TOOL_EVENT &aEvent)
int CleanupGraphics(const TOOL_EVENT &aEvent)
int UnpinLibrary(const TOOL_EVENT &aEvent)
int Properties(const TOOL_EVENT &aEvent)
int ToggleLayersManager(const TOOL_EVENT &aEvent)
int RepairFootprint(const TOOL_EVENT &aEvent)
int RenameFootprint(const TOOL_EVENT &aEvent)
int DuplicateFootprint(const TOOL_EVENT &aEvent)
int ExportFootprint(const TOOL_EVENT &aEvent)
int SaveAs(const TOOL_EVENT &aEvent)
int CheckFootprint(const TOOL_EVENT &aEvent)
static TOOL_ACTION showLayersManager
Definition: pcb_actions.h:389
static TOOL_ACTION editFootprint
Definition: pcb_actions.h:410
static TOOL_ACTION showFootprintTree
Definition: pcb_actions.h:395
static TOOL_ACTION showProperties
Definition: pcb_actions.h:390
static TOOL_ACTION editTextAndGraphics
Definition: pcb_actions.h:360
static TOOL_ACTION defaultPadProperties
Definition: pcb_actions.h:421
static TOOL_ACTION footprintProperties
Definition: pcb_actions.h:420
static TOOL_ACTION checkFootprint
Definition: pcb_actions.h:423
static TOOL_ACTION repairFootprint
Definition: pcb_actions.h:491
static TOOL_ACTION cleanupGraphics
Definition: pcb_actions.h:363
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Define which state (aStateFunc) to go when a certain event arrives (aConditions).

References CheckFootprint(), PCB_ACTIONS::checkFootprint, CleanupGraphics(), PCB_ACTIONS::cleanupGraphics, PCB_ACTIONS::copyFootprint, CreateFootprint(), PCB_ACTIONS::createFootprint, CutCopyFootprint(), PCB_ACTIONS::cutFootprint, DefaultPadProperties(), PCB_ACTIONS::defaultPadProperties, DeleteFootprint(), PCB_ACTIONS::deleteFootprint, DuplicateFootprint(), PCB_ACTIONS::duplicateFootprint, EditFootprint(), PCB_ACTIONS::editFootprint, EditTextAndGraphics(), PCB_ACTIONS::editTextAndGraphics, ExportFootprint(), PCB_ACTIONS::exportFootprint, PCB_ACTIONS::footprintProperties, TOOL_INTERACTIVE::Go(), PCB_ACTIONS::hideFootprintTree, ImportFootprint(), PCB_ACTIONS::importFootprint, NewFootprint(), PCB_ACTIONS::newFootprint, PasteFootprint(), PCB_ACTIONS::pasteFootprint, ACTIONS::pinLibrary, PinLibrary(), Properties(), RenameFootprint(), PCB_ACTIONS::renameFootprint, RepairFootprint(), PCB_ACTIONS::repairFootprint, ACTIONS::revert, Revert(), ACTIONS::save, Save(), ACTIONS::saveAs, SaveAs(), PCB_ACTIONS::showFootprintTree, PCB_ACTIONS::showLayersManager, PCB_ACTIONS::showProperties, ToggleFootprintTree(), ToggleLayersManager(), ToggleProperties(), ACTIONS::unpinLibrary, and UnpinLibrary().

◆ ToggleFootprintTree()

int FOOTPRINT_EDITOR_CONTROL::ToggleFootprintTree ( const TOOL_EVENT aEvent)

Definition at line 580 of file footprint_editor_control.cpp.

581{
583 return 0;
584}

References m_frame, and FOOTPRINT_EDIT_FRAME::ToggleSearchTree().

Referenced by setTransitions().

◆ ToggleLayersManager()

int FOOTPRINT_EDITOR_CONTROL::ToggleLayersManager ( const TOOL_EVENT aEvent)

Definition at line 587 of file footprint_editor_control.cpp.

588{
590 return 0;
591}

References m_frame, and FOOTPRINT_EDIT_FRAME::ToggleLayersManager().

Referenced by setTransitions().

◆ ToggleProperties()

int FOOTPRINT_EDITOR_CONTROL::ToggleProperties ( const TOOL_EVENT aEvent)

Definition at line 594 of file footprint_editor_control.cpp.

595{
597 return 0;
598}

References m_frame, and PCB_BASE_EDIT_FRAME::ToggleProperties().

Referenced by setTransitions().

◆ UnpinLibrary()

int FOOTPRINT_EDITOR_CONTROL::UnpinLibrary ( const TOOL_EVENT aEvent)

Definition at line 564 of file footprint_editor_control.cpp.

565{
566 LIB_TREE_NODE* currentNode = m_frame->GetCurrentTreeNode();
567
568 if( currentNode && currentNode->m_Pinned )
569 {
570 m_frame->Prj().UnpinLibrary( currentNode->m_LibId.GetLibNickname(), false );
571
572 currentNode->m_Pinned = false;
574 }
575
576 return 0;
577}
void UnpinLibrary(const wxString &aLibrary, bool isSymbolLibrary)
Definition: project.cpp:177

References FOOTPRINT_EDIT_FRAME::GetCurrentTreeNode(), LIB_ID::GetLibNickname(), m_frame, LIB_TREE_NODE::m_LibId, LIB_TREE_NODE::m_Pinned, KIWAY_HOLDER::Prj(), FOOTPRINT_EDIT_FRAME::RegenerateLibraryTree(), and PROJECT::UnpinLibrary().

Referenced by setTransitions().

◆ view()

◆ Wait()

TOOL_EVENT * TOOL_INTERACTIVE::Wait ( const TOOL_EVENT_LIST aEventList = TOOL_EVENTTC_ANYTA_ANY ))
inherited

Suspend execution of the tool until an event specified in aEventList arrives.

No parameters means waiting for any event.

Definition at line 57 of file tool_interactive.cpp.

58{
59 return m_toolMgr->ScheduleWait( this, aEventList );
60}
TOOL_EVENT * ScheduleWait(TOOL_BASE *aTool, const TOOL_EVENT_LIST &aConditions)
Pause execution of a given tool until one or more events matching aConditions arrives.

References TOOL_BASE::m_toolMgr, and TOOL_MANAGER::ScheduleWait().

Referenced by SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), SELECTION_TOOL::doSelectionMenu(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), SCH_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), DRAWING_TOOL::drawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::InteractivePlaceWithPreview(), EDA_3D_CONTROLLER::Main(), CVPCB_CONTROL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), EE_POINT_EDITOR::Main(), EE_SELECTION_TOOL::Main(), SCH_MOVE_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), PICKER_TOOL::Main(), ZOOM_TOOL::Main(), PL_EDIT_TOOL::Main(), PL_POINT_EDITOR::Main(), PL_SELECTION_TOOL::Main(), PCB_PICKER_TOOL::Main(), PCB_SELECTION_TOOL::Main(), LENGTH_TUNER_TOOL::MainLoop(), ROUTER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), PCB_POINT_EDITOR::OnSelectionChange(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), EDIT_TOOL::pickReferencePoint(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), DRAWING_TOOL::PlaceText(), EE_SELECTION_TOOL::selectMultiple(), PL_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectPoint(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), ZOOM_TOOL::selectRegion(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

Member Data Documentation

◆ m_checkerDialog

DIALOG_FOOTPRINT_CHECKER* FOOTPRINT_EDITOR_CONTROL::m_checkerDialog
private

Definition at line 93 of file footprint_editor_control.h.

Referenced by CheckFootprint(), CrossProbe(), DestroyCheckerDialog(), and Reset().

◆ m_copiedFootprint

std::unique_ptr<FOOTPRINT> FOOTPRINT_EDITOR_CONTROL::m_copiedFootprint
private

Definition at line 96 of file footprint_editor_control.h.

Referenced by CutCopyFootprint(), and PasteFootprint().

◆ m_frame

◆ m_isBoardEditor

bool PCB_TOOL_BASE::m_isBoardEditor
protectedinherited

◆ m_isFootprintEditor

◆ m_menu

TOOL_MENU TOOL_INTERACTIVE::m_menu
protectedinherited

The functions below are not yet implemented - their interface may change.

Definition at line 125 of file tool_interactive.h.

Referenced by SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), SCH_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), DRAWING_TOOL::drawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), TOOL_INTERACTIVE::GetToolMenu(), EDA_3D_CONTROLLER::Init(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Init(), EE_SELECTION_TOOL::Init(), EE_TOOL_BASE< T >::Init(), SCH_DRAWING_TOOLS::Init(), SCH_EDIT_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), SYMBOL_EDITOR_CONTROL::Init(), SYMBOL_EDITOR_DRAWING_TOOLS::Init(), GERBVIEW_SELECTION_TOOL::Init(), PICKER_TOOL::Init(), ZOOM_TOOL::Init(), PL_DRAWING_TOOLS::Init(), PL_EDIT_TOOL::Init(), PL_SELECTION_TOOL::Init(), LENGTH_TUNER_TOOL::Init(), ROUTER_TOOL::Init(), BOARD_EDITOR_CONTROL::Init(), DRAWING_TOOL::Init(), Init(), PAD_TOOL::Init(), PCB_SELECTION_TOOL::Init(), PCB_TOOL_BASE::Init(), PCB_VIEWER_TOOLS::Init(), DRAWING_TOOL::InteractivePlaceWithPreview(), EDA_3D_CONTROLLER::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), SCH_MOVE_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), PICKER_TOOL::Main(), ZOOM_TOOL::Main(), PL_EDIT_TOOL::Main(), PL_SELECTION_TOOL::Main(), PCB_PICKER_TOOL::Main(), PCB_SELECTION_TOOL::Main(), LENGTH_TUNER_TOOL::MainLoop(), ROUTER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace().

◆ m_toolId

TOOL_ID TOOL_BASE::m_toolId
protectedinherited

Name of the tool.

Names are expected to obey the format application.ToolName (eg. pcbnew.InteractiveSelection).

Definition at line 210 of file tool_base.h.

Referenced by TOOL_INTERACTIVE::Activate(), TOOL_BASE::GetId(), and TOOL_BASE::IsToolActive().

◆ m_toolMgr

TOOL_MANAGER* TOOL_BASE::m_toolMgr
protectedinherited

Definition at line 215 of file tool_base.h.

Referenced by TOOL_INTERACTIVE::Activate(), SELECTION_TOOL::AddItemsToSel(), SELECTION_TOOL::AddItemToSel(), SCH_MOVE_TOOL::AlignElements(), SCH_EDITOR_CONTROL::AssignNetclass(), BOARD_EDITOR_CONTROL::AssignNetclass(), CVPCB_ASSOCIATION_TOOL::Associate(), TOOL_BASE::attachManager(), SCH_EDIT_TOOL::AutoplaceFields(), EE_SELECTION_TOOL::autostartEvent(), SCH_EDIT_TOOL::BreakWire(), BOARD_INSPECTION_TOOL::calculateSelectionRatsnest(), ROUTER_TOOL::CanInlineDrag(), SCH_EDITOR_CONTROL::ChangeLineMode(), SCH_EDIT_TOOL::ChangeTextType(), EDIT_TOOL::ChangeTrackWidth(), SCH_EDIT_TOOL::CleanupSheetPins(), GERBVIEW_CONTROL::ClearAllLayers(), SCH_EDITOR_CONTROL::ClearHighlight(), BOARD_INSPECTION_TOOL::ClearHighlight(), GERBVIEW_SELECTION_TOOL::clearSelection(), PL_SELECTION_TOOL::ClearSelection(), EE_SELECTION_TOOL::ClearSelection(), PCB_SELECTION_TOOL::ClearSelection(), SCH_EDIT_TOOL::ConvertDeMorgan(), SYMBOL_EDITOR_EDIT_TOOL::Copy(), PL_EDIT_TOOL::Copy(), PAD_TOOL::copyPadSettings(), EDIT_TOOL::copyToClipboard(), EDIT_TOOL::CreateArray(), MICROWAVE_TOOL::createInductorBetween(), EE_INSPECTION_TOOL::CrossProbe(), DRC_TOOL::CrossProbe(), COMMON_TOOLS::CursorControl(), SCH_EDITOR_CONTROL::Cut(), SCH_EDIT_TOOL::DeleteItemCursor(), SYMBOL_EDITOR_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), PCB_CONTROL::DeleteItemCursor(), EDIT_TOOL::DeleteItems(), SCH_EDITOR_CONTROL::doCopy(), BOARD_EDITOR_CONTROL::doCrossProbePcbToSch(), SCH_EDITOR_CONTROL::doCrossProbeSchToPcb(), SCH_EDIT_TOOL::DoDelete(), SYMBOL_EDITOR_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), BOARD_INSPECTION_TOOL::doHideRatsnestNet(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), PCB_SELECTION_TOOL::doSyncSelection(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), COMMON_TOOLS::doZoomInOut(), COMMON_TOOLS::doZoomToPreset(), EDIT_TOOL::Drag(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawRectangle(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), SCH_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), DRAWING_TOOL::drawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), BOARD_EDITOR_CONTROL::DrillOrigin(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), EDIT_TOOL::Duplicate(), SCH_EDIT_TOOL::EditField(), SCH_EDIT_TOOL::editFieldText(), BOARD_EDITOR_CONTROL::EditFpInFpEditor(), PAD_TOOL::EditPad(), SYMBOL_EDITOR_EDIT_TOOL::editShapeProperties(), SYMBOL_EDITOR_EDIT_TOOL::editSymbolProperties(), SCH_EDITOR_CONTROL::EditWithSymbolEditor(), PCB_SELECTION_TOOL::EnterGroup(), GROUP_TOOL::EnterGroup(), SCH_NAVIGATE_TOOL::EnterSheet(), PAD_TOOL::EnumeratePads(), EE_INSPECTION_TOOL::ExcludeMarker(), PCB_SELECTION_TOOL::ExitGroup(), PCB_SELECTION_TOOL::expandConnection(), PAD_TOOL::explodePad(), PCB_SELECTION_TOOL::filterSelection(), PCB_SELECTION_TOOL::FindItem(), SCH_EDITOR_CONTROL::FindSymbolAndItem(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), EDIT_TOOL::Flip(), EDIT_TOOL::GetAndPlace(), TOOL_BASE::GetManager(), TOOL_BASE::getModelInt(), DRAWING_TOOL::getSourceZoneForAction(), TOOL_BASE::getToolHolderInt(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), TOOL_INTERACTIVE::goInternal(), PCB_SELECTION_TOOL::grabUnconnected(), COMMON_TOOLS::GridNext(), COMMON_TOOLS::GridPreset(), COMMON_TOOLS::GridPrev(), PCB_CONTROL::GridSetOrigin(), GROUP_TOOL::Group(), GERBVIEW_CONTROL::HighlightControl(), BOARD_INSPECTION_TOOL::HighlightItem(), SCH_EDITOR_CONTROL::HighlightNet(), BOARD_INSPECTION_TOOL::HighlightNet(), BOARD_INSPECTION_TOOL::highlightNet(), SCH_EDITOR_CONTROL::HighlightNetCursor(), PL_EDIT_TOOL::ImportDrawingSheetContent(), ImportFootprint(), EE_TOOL_BASE< T >::Init(), SCH_EDIT_TOOL::Init(), SYMBOL_EDITOR_CONTROL::Init(), SYMBOL_EDITOR_EDIT_TOOL::Init(), PL_DRAWING_TOOLS::Init(), PL_EDIT_TOOL::Init(), PL_POINT_EDITOR::Init(), ROUTER_TOOL::Init(), BOARD_EDITOR_CONTROL::Init(), BOARD_INSPECTION_TOOL::Init(), BOARD_REANNOTATE_TOOL::Init(), CONVERT_TOOL::Init(), DRAWING_TOOL::Init(), EDIT_TOOL::Init(), GLOBAL_EDIT_TOOL::Init(), GROUP_TOOL::Init(), PAD_TOOL::Init(), PCB_POINT_EDITOR::Init(), PCB_SELECTION_TOOL::Init(), ALIGN_DISTRIBUTE_TOOL::Init(), POSITION_RELATIVE_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), BOARD_INSPECTION_TOOL::InspectClearance(), BOARD_INSPECTION_TOOL::InspectConstraints(), DRAWING_TOOL::InteractivePlaceWithPreview(), EDIT_TOOL::invokeInlineRouter(), EDIT_TOOL::isRouterActive(), TOOL_BASE::IsToolActive(), GROUP_TOOL::LeaveGroup(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), EDA_3D_CONTROLLER::Main(), CVPCB_CONTROL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), SCH_MOVE_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), PL_EDIT_TOOL::Main(), PL_SELECTION_TOOL::Main(), PCB_PICKER_TOOL::Main(), PCB_SELECTION_TOOL::Main(), LENGTH_TUNER_TOOL::MainLoop(), ROUTER_TOOL::MainLoop(), PCB_VIEWER_TOOLS::MeasureTool(), SCH_EDIT_TOOL::Mirror(), SYMBOL_EDITOR_EDIT_TOOL::Mirror(), EDIT_TOOL::Mirror(), BOARD_EDITOR_CONTROL::modifyLockSelected(), EDIT_TOOL::MoveExact(), SCH_EDITOR_CONTROL::NextLineMode(), SYMBOL_EDITOR_CONTROL::OnDeMorgan(), SELECTION_TOOL::onDisambiguationExpire(), COMMON_TOOLS::OnGridChanged(), PCB_POINT_EDITOR::OnSelectionChange(), SCH_EDITOR_CONTROL::Paste(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), PL_EDIT_TOOL::Paste(), PAD_TOOL::pastePadProperties(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), GROUP_TOOL::PickNewMember(), EDIT_TOOL::pickReferencePoint(), SYMBOL_EDITOR_EDIT_TOOL::PinTable(), PCB_CONTROL::placeBoardItems(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), DRAWING_TOOL::PlaceText(), GERBVIEW_CONTROL::Print(), PCB_CONTROL::Print(), SCH_EDIT_TOOL::Properties(), SYMBOL_EDITOR_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), PAD_TOOL::pushPadSettings(), EDIT_TOOL::rebuildConnectivity(), ZONE_FILLER_TOOL::rebuildConnectivity(), EE_SELECTION_TOOL::RebuildSelection(), PAD_TOOL::RecombinePad(), SCH_EDITOR_CONTROL::Redo(), SYMBOL_EDITOR_EDIT_TOOL::Redo(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), EDIT_TOOL::Remove(), PCB_POINT_EDITOR::removeCorner(), GROUP_TOOL::RemoveFromGroup(), SELECTION_TOOL::RemoveItemFromSel(), SELECTION_TOOL::RemoveItemsFromSel(), SCH_EDIT_TOOL::RepeatDrawItem(), SYMBOL_EDITOR_DRAWING_TOOLS::RepeatDrawItem(), PCB_SELECTION_TOOL::RequestSelection(), EE_SELECTION_TOOL::RequestSelection(), EDA_3D_CONTROLLER::Reset(), COMMON_TOOLS::Reset(), PNS::TOOL_BASE::Reset(), PAD_TOOL::Reset(), COMMON_TOOLS::ResetLocalCoords(), TOOL_INTERACTIVE::resetTransitions(), SCH_EDITOR_CONTROL::Revert(), SCH_EDIT_TOOL::Rotate(), SYMBOL_EDITOR_EDIT_TOOL::Rotate(), EDIT_TOOL::Rotate(), ROUTER_TOOL::RouteSelected(), TOOL_INTERACTIVE::RunMainStack(), DRC_TOOL::RunTests(), EE_SELECTION_TOOL::Selectable(), EE_SELECTION_TOOL::SelectAll(), PCB_SELECTION_TOOL::SelectAll(), EE_SELECTION_TOOL::SelectConnection(), PCB_TOOL_BASE::selection(), COMMON_TOOLS::SelectionTool(), GERBVIEW_SELECTION_TOOL::SelectItem(), GERBVIEW_SELECTION_TOOL::SelectItems(), EE_SELECTION_TOOL::selectMultiple(), PL_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectNet(), GERBVIEW_SELECTION_TOOL::selectPoint(), PL_SELECTION_TOOL::SelectPoint(), PCB_SELECTION_TOOL::selectPoint(), EE_SELECTION_TOOL::selectPoint(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), PCB_SELECTION_TOOL::selectSameSheet(), PCB_SELECTION_TOOL::selectSheetContents(), DRAWING_TOOL::SetAnchor(), TOOL_INTERACTIVE::SetContextMenu(), EDA_3D_CONTROLLER::SetMaterial(), DRC_TOOL::ShowDRCDialog(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_EDIT_TOOL::Swap(), EE_SELECTION_TOOL::SyncSelection(), COMMON_TOOLS::ToggleCursor(), COMMON_TOOLS::ToggleCursorStyle(), EDA_3D_CONTROLLER::ToggleVisibility(), BOARD_EDITOR_CONTROL::TrackWidthDec(), BOARD_EDITOR_CONTROL::TrackWidthInc(), SCH_MOVE_TOOL::trimDanglingLines(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_EDITOR_CONTROL::Undo(), SYMBOL_EDITOR_EDIT_TOOL::Undo(), GROUP_TOOL::Ungroup(), PCB_SELECTION_TOOL::unrouteSelected(), GERBVIEW_SELECTION_TOOL::UnselectItem(), GERBVIEW_SELECTION_TOOL::UnselectItems(), PNS::TOOL_BASE::updateEndItem(), BOARD_INSPECTION_TOOL::UpdateLocalRatsnest(), EE_INSPECTION_TOOL::UpdateMessagePanel(), GERBVIEW_CONTROL::UpdateMessagePanel(), PL_EDITOR_CONTROL::UpdateMessagePanel(), PCB_CONTROL::UpdateMessagePanel(), EDIT_TOOL::updateModificationPoint(), EE_POINT_EDITOR::updateParentItem(), PNS::TOOL_BASE::updateStartItem(), BOARD_EDITOR_CONTROL::ViaSizeDec(), BOARD_EDITOR_CONTROL::ViaSizeInc(), TOOL_INTERACTIVE::Wait(), BOARD_EDITOR_CONTROL::ZoneDuplicate(), and BOARD_EDITOR_CONTROL::ZoneMerge().

◆ m_toolName

std::string TOOL_BASE::m_toolName
protectedinherited

Definition at line 214 of file tool_base.h.

Referenced by TOOL_BASE::GetName().

◆ m_type

TOOL_TYPE TOOL_BASE::m_type
protectedinherited

Unique identifier for the tool, assigned by a TOOL_MANAGER instance.

Definition at line 207 of file tool_base.h.

Referenced by TOOL_BASE::GetType().


The documentation for this class was generated from the following files: