KiCad PCB EDA Suite
PAD_TOOL Class Reference

Tool relating to pads and pad settings. More...

#include <pad_tool.h>

Inheritance diagram for PAD_TOOL:
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

 PAD_TOOL ()
 
 ~PAD_TOOL ()
 React to model/view changes. More...
 
void Reset (RESET_REASON aReason) override
 Basic initialization. More...
 
bool Init () override
 Init() is called once upon a registration of the tool. More...
 
int EnumeratePads (const TOOL_EVENT &aEvent)
 Tool for quick pad enumeration. More...
 
int PlacePad (const TOOL_EVENT &aEvent)
 Place a pad in footprint editor. More...
 
int EditPad (const TOOL_EVENT &aEvent)
 Enter/exit WYSIWYG pad shape editing. More...
 
bool InPadEditMode ()
 
wxString GetLastPadNumber () const
 
void SetLastPadNumber (const wxString &aPadNumber)
 
std::vector< FP_SHAPE * > RecombinePad (PAD *aPad, bool aIsDryRun, BOARD_COMMIT &aCommit)
 Recombine an exploded pad (or one produced with overlapping polygons in an older version). 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
 < Bind handlers to corresponding TOOL_ACTIONs. More...
 
int pastePadProperties (const TOOL_EVENT &aEvent)
 Copy pad settings from a pad to the board design settings. More...
 
int copyPadSettings (const TOOL_EVENT &aEvent)
 Push pad settings from a pad to other pads on board or footprint. More...
 
int pushPadSettings (const TOOL_EVENT &aEvent)
 
PCB_LAYER_ID explodePad (PAD *aPad)
 
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

wxString m_lastPadNumber
 
bool m_wasHighContrast
 
KIID m_editPad
 

Detailed Description

Tool relating to pads and pad settings.

Definition at line 36 of file pad_tool.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

◆ PAD_TOOL()

PAD_TOOL::PAD_TOOL ( )

Definition at line 51 of file pad_tool.cpp.

51 :
52 PCB_TOOL_BASE( "pcbnew.PadTool" ),
53 m_wasHighContrast( false ),
55{}
bool m_wasHighContrast
Definition: pad_tool.h:95
KIID m_editPad
Definition: pad_tool.h:96
PCB_TOOL_BASE(TOOL_ID aId, const std::string &aName)
Constructor.
Definition: pcb_tool_base.h:77
KIID niluuid(0)

◆ ~PAD_TOOL()

PAD_TOOL::~PAD_TOOL ( )

React to model/view changes.

Definition at line 58 of file pad_tool.cpp.

59{}

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(), 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(), FOOTPRINT_EDITOR_CONTROL::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(), EnumeratePads(), 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(), FOOTPRINT_EDITOR_CONTROL::NewFootprint(), PCB_CONTROL::Paste(), PCB_CONTROL::placeBoardItems(), BOARD_EDITOR_CONTROL::PlaceFootprint(), PlacePad(), DRAWING_TOOL::PlaceText(), PCB_CONTROL::pruneItemLayers(), EDIT_TOOL::rebuildConnectivity(), ZONE_FILLER_TOOL::rebuildConnectivity(), RecombinePad(), BOARD_EDITOR_CONTROL::RepairBoard(), FOOTPRINT_EDITOR_CONTROL::RepairFootprint(), PNS::TOOL_BASE::Reset(), 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()

◆ controls()

◆ copyPadSettings()

int PAD_TOOL::copyPadSettings ( const TOOL_EVENT aEvent)
private

Push pad settings from a pad to other pads on board or footprint.

Definition at line 168 of file pad_tool.cpp.

169{
171 const PCB_SELECTION& selection = selTool->GetSelection();
172
173 // can only copy from a single pad
174 if( selection.Size() == 1 )
175 {
176 EDA_ITEM* item = selection[0];
177
178 if( item->Type() == PCB_PAD_T )
179 {
180 const PAD& selPad = static_cast<const PAD&>( *item );
181 frame()->GetDesignSettings().m_Pad_Master->ImportSettingsFrom( selPad );
182 }
183 }
184
185 return 0;
186}
std::unique_ptr< PAD > m_Pad_Master
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:85
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
Definition: pad.h:60
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Returns the BOARD_DESIGN_SETTINGS for the open project.
The selection tool: currently supports:
PCB_SELECTION & GetSelection()
const PCB_SELECTION & selection() const
int Size() const
Returns the number of selected parts.
Definition: selection.h:115
@ PCB_PAD_T
class PAD, a pad in a footprint
Definition: typeinfo.h:87

References PCB_TOOL_BASE::frame(), PCB_BASE_FRAME::GetDesignSettings(), PCB_SELECTION_TOOL::GetSelection(), TOOL_MANAGER::GetTool(), BOARD_DESIGN_SETTINGS::m_Pad_Master, TOOL_BASE::m_toolMgr, PCB_PAD_T, PCB_TOOL_BASE::selection(), SELECTION::Size(), and EDA_ITEM::Type().

Referenced by setTransitions().

◆ 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
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: eda_item.h:141
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
BOARD * board() 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 PlacePad().

◆ EditPad()

int PAD_TOOL::EditPad ( const TOOL_EVENT aEvent)

Enter/exit WYSIWYG pad shape editing.

Definition at line 572 of file pad_tool.cpp.

573{
575 PCB_RENDER_SETTINGS* settings = static_cast<PCB_RENDER_SETTINGS*>( view()->GetPainter()->GetSettings() );
576 WX_INFOBAR* infoBar = frame()->GetInfoBar();
578 wxString msg;
579
580 if( m_editPad != niluuid )
581 {
582 PAD* pad = dynamic_cast<PAD*>( frame()->GetItem( m_editPad ) );
583
584 if( pad )
585 {
586 BOARD_COMMIT commit( frame() );
587 RecombinePad( pad, false, commit );
588 commit.Push( _( "Recombine pad" ) );
589 }
590
592 }
593 else if( selection.Size() == 1 && selection[0]->Type() == PCB_PAD_T )
594 {
595 PAD* pad = static_cast<PAD*>( selection[0] );
596 PCB_LAYER_ID layer = explodePad( pad );
597
599 frame()->SetActiveLayer( layer );
600
601 settings->m_PadEditModePad = pad;
602
604 [&]( KIGFX::VIEW_ITEM* aItem ) -> bool
605 {
606 return dynamic_cast<PAD*>( aItem ) != nullptr;
607 } );
608
609 if( !m_wasHighContrast )
611
613 {
614 msg.Printf( _( "Pad Edit Mode. Press %s again to exit." ),
616 }
617 else
618 {
619 msg.Printf( _( "Pad Edit Mode. Press %s to exit." ),
621 }
622
623 infoBar->RemoveAllButtons();
624 infoBar->ShowMessage( msg, wxICON_INFORMATION );
625
626 m_editPad = pad->m_Uuid;
627 }
628
629 if( m_editPad == niluuid )
630 {
631 bool highContrast = ( opts.m_ContrastModeDisplay != HIGH_CONTRAST_MODE::NORMAL );
632
633 if( m_wasHighContrast != highContrast )
635
636 settings->m_PadEditModePad = nullptr;
637
638 // Note: KIGFX::REPAINT isn't enough for things that go from invisible to visible as
639 // they won't be found in the view layer's itemset for re-painting.
641 [&]( KIGFX::VIEW_ITEM* aItem ) -> bool
642 {
643 return dynamic_cast<PAD*>( aItem ) != nullptr;
644 } );
645
646 // Refresh now (otherwise there's an uncomfortably long pause while the infoBar
647 // closes before refresh).
648 canvas()->ForceRefresh();
649
650 infoBar->Dismiss();
651 }
652
653 return 0;
654}
@ NORMAL
Inactive layers are shown normally (no high-contrast mode)
static TOOL_ACTION highContrastMode
Definition: actions.h:106
WX_INFOBAR * GetInfoBar()
void ForceRefresh()
Force a redraw.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
PCB specific render settings.
Definition: pcb_painter.h:72
An abstract base class for deriving all objects that can be added to a VIEW.
Definition: view_item.h:77
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:213
void UpdateAllItemsConditionally(int aUpdateFlags, std::function< bool(VIEW_ITEM *)> aCondition)
Update items in the view according to the given flags and condition.
Definition: view.cpp:1494
std::vector< FP_SHAPE * > RecombinePad(PAD *aPad, bool aIsDryRun, BOARD_COMMIT &aCommit)
Recombine an exploded pad (or one produced with overlapping polygons in an older version).
Definition: pad_tool.cpp:732
PCB_LAYER_ID explodePad(PAD *aPad)
Definition: pad_tool.cpp:657
static TOOL_ACTION recombinePad
Definition: pcb_actions.h:429
static TOOL_ACTION explodePad
Definition: pcb_actions.h:428
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
EDA_ITEM * GetItem(const KIID &aId) const override
Fetch an item by KIID.
virtual void SetActiveLayer(PCB_LAYER_ID aLayer)
HIGH_CONTRAST_MODE m_ContrastModeDisplay
How inactive layers are displayed.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
PCB_DRAW_PANEL_GAL * canvas() const
int GetHotKey() const
Return the hotkey keycode which initiates the action.
Definition: tool_action.h:111
A modified version of the wxInfoBar class that allows us to:
Definition: wx_infobar.h:75
void RemoveAllButtons()
Remove all the buttons that have been added by the user.
Definition: wx_infobar.cpp:289
void Dismiss() override
Dismisses the infobar and updates the containing layout and AUI manager (if one is provided).
Definition: wx_infobar.cpp:175
void ShowMessage(const wxString &aMessage, int aFlags=wxICON_INFORMATION) override
Show the info bar with the provided message and icon.
Definition: wx_infobar.cpp:142
#define _(s)
wxString KeyNameFromKeyCode(int aKeycode, bool *aIsFound)
Return the key name from the key code.
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:59
@ REPAINT
Item needs to be redrawn.
Definition: view_item.h:52
@ ALL
All except INITIAL_ADD.
Definition: view_item.h:53

References _, KIGFX::ALL, PCB_TOOL_BASE::canvas(), WX_INFOBAR::Dismiss(), explodePad(), PCB_ACTIONS::explodePad, EDA_DRAW_PANEL_GAL::ForceRefresh(), PCB_TOOL_BASE::frame(), PCB_BASE_FRAME::GetDisplayOptions(), TOOL_ACTION::GetHotKey(), EDA_BASE_FRAME::GetInfoBar(), PCB_BASE_FRAME::GetItem(), KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), TOOL_MANAGER::GetTool(), PCB_DRAW_PANEL_GAL::GetView(), ACTIONS::highContrastMode, KeyNameFromKeyCode(), PCB_DISPLAY_OPTIONS::m_ContrastModeDisplay, m_editPad, KIGFX::PCB_RENDER_SETTINGS::m_PadEditModePad, TOOL_BASE::m_toolMgr, m_wasHighContrast, niluuid, NORMAL, pad, PCB_PAD_T, BOARD_COMMIT::Push(), RecombinePad(), PCB_ACTIONS::recombinePad, WX_INFOBAR::RemoveAllButtons(), KIGFX::REPAINT, TOOL_MANAGER::RunAction(), PCB_TOOL_BASE::selection(), PCB_BASE_FRAME::SetActiveLayer(), WX_INFOBAR::ShowMessage(), SELECTION::Size(), KIGFX::VIEW::UpdateAllItemsConditionally(), and PCB_TOOL_BASE::view().

Referenced by setTransitions().

◆ EnumeratePads()

int PAD_TOOL::EnumeratePads ( const TOOL_EVENT aEvent)

Tool for quick pad enumeration.

Definition at line 283 of file pad_tool.cpp.

284{
285 if( !board()->GetFirstFootprint() || board()->GetFirstFootprint()->Pads().empty() )
286 return 0;
287
288 GENERAL_COLLECTOR collector;
290 guide.SetIgnoreMTextsMarkedNoShow( true );
291 guide.SetIgnoreMTextsOnBack( true );
292 guide.SetIgnoreMTextsOnFront( true );
293 guide.SetIgnoreModulesVals( true );
294 guide.SetIgnoreModulesRefs( true );
295
296 DIALOG_ENUM_PADS settingsDlg( frame() );
297
298 if( settingsDlg.ShowModal() != wxID_OK )
299 return 0;
300
301 int seqPadNum = settingsDlg.GetStartNumber();
302 wxString padPrefix = settingsDlg.GetPrefix();
303 std::deque<int> storedPadNumbers;
304 std::map<wxString, std::pair<int, wxString>> oldNumbers;
305
307
308 frame()->PushTool( aEvent );
309
310 VECTOR2I oldCursorPos; // store the previous mouse cursor position, during mouse drag
311 std::list<PAD*> selectedPads;
312 BOARD_COMMIT commit( frame() );
313 bool isFirstPoint = true; // make sure oldCursorPos is initialized at least once
314 PADS pads = board()->GetFirstFootprint()->Pads();
315
316 MAGNETIC_SETTINGS mag_settings;
317 mag_settings.graphics = false;
318 mag_settings.tracks = MAGNETIC_OPTIONS::NO_EFFECT;
320 PCB_GRID_HELPER grid( m_toolMgr, &mag_settings );
321
322 grid.SetSnap( true );
323 grid.SetUseGrid( false );
324
325 auto setCursor =
326 [&]()
327 {
329 };
330
331 Activate();
332 // Must be done after Activate() so that it gets set into the correct context
333 getViewControls()->ShowCursor( true );
335 // Set initial cursor
336 setCursor();
337
338 STATUS_TEXT_POPUP statusPopup( frame() );
339 wxString msg = _( "Click on pad %s%d\nPress <esc> to cancel all; double-click to finish" );
340 statusPopup.SetText( wxString::Format( msg, padPrefix, seqPadNum ) );
341 statusPopup.Popup();
342 statusPopup.Move( wxGetMousePosition() + wxPoint( 20, 20 ) );
343 canvas()->SetStatusPopup( statusPopup.GetPanel() );
344
345 while( TOOL_EVENT* evt = Wait() )
346 {
347 setCursor();
348
349 VECTOR2I cursorPos = grid.AlignToNearestPad( getViewControls()->GetMousePosition(), pads );
350 getViewControls()->ForceCursorPosition( true, cursorPos );
351
352 if( evt->IsCancelInteractive() )
353 {
355 commit.Revert();
356
357 frame()->PopTool( aEvent );
358 break;
359 }
360 else if( evt->IsActivate() )
361 {
362 commit.Push( _( "Renumber pads" ) );
363
364 frame()->PopTool( aEvent );
365 break;
366 }
367 else if( evt->IsDrag( BUT_LEFT ) || evt->IsClick( BUT_LEFT ) )
368 {
369 selectedPads.clear();
370
371 // Be sure the old cursor mouse position was initialized:
372 if( isFirstPoint )
373 {
374 oldCursorPos = cursorPos;
375 isFirstPoint = false;
376 }
377
378 // wxWidgets deliver mouse move events not frequently enough, resulting in skipping
379 // pads if the user moves cursor too fast. To solve it, create a line that approximates
380 // the mouse move and search pads that are on the line.
381 int distance = ( cursorPos - oldCursorPos ).EuclideanNorm();
382 // Search will be made every 0.1 mm:
383 int segments = distance / int( 0.1 * pcbIUScale.IU_PER_MM ) + 1;
384 const VECTOR2I line_step( ( cursorPos - oldCursorPos ) / segments );
385
386 collector.Empty();
387
388 for( int j = 0; j < segments; ++j )
389 {
390 VECTOR2I testpoint( cursorPos.x - j * line_step.x, cursorPos.y - j * line_step.y );
391 collector.Collect( board(), { PCB_PAD_T }, testpoint, guide );
392
393 for( int i = 0; i < collector.GetCount(); ++i )
394 selectedPads.push_back( static_cast<PAD*>( collector[i] ) );
395 }
396
397 selectedPads.unique();
398
399 for( PAD* pad : selectedPads )
400 {
401 // If pad was not selected, then enumerate it
402 if( !pad->IsSelected() )
403 {
404 commit.Modify( pad );
405
406 // Rename pad and store the old name
407 int newval;
408
409 if( storedPadNumbers.size() > 0 )
410 {
411 newval = storedPadNumbers.front();
412 storedPadNumbers.pop_front();
413 }
414 else
415 newval = seqPadNum++;
416
417 wxString newNumber = wxString::Format( wxT( "%s%d" ), padPrefix, newval );
418 oldNumbers[newNumber] = { newval, pad->GetNumber() };
419 pad->SetNumber( newNumber );
420 SetLastPadNumber( newNumber );
421 pad->SetSelected();
422 getView()->Update( pad );
423
424 // Ensure the popup text shows the correct next value
425 if( storedPadNumbers.size() > 0 )
426 newval = storedPadNumbers.front();
427 else
428 newval = seqPadNum;
429
430 statusPopup.SetText( wxString::Format( msg, padPrefix, newval ) );
431 }
432
433 // ... or restore the old name if it was enumerated and clicked again
434 else if( pad->IsSelected() && evt->IsClick( BUT_LEFT ) )
435 {
436 auto it = oldNumbers.find( pad->GetNumber() );
437 wxASSERT( it != oldNumbers.end() );
438
439 if( it != oldNumbers.end() )
440 {
441 storedPadNumbers.push_back( it->second.first );
442 pad->SetNumber( it->second.second );
443 SetLastPadNumber( it->second.second );
444 oldNumbers.erase( it );
445
446 int newval = storedPadNumbers.front();
447
448 statusPopup.SetText( wxString::Format( msg, padPrefix, newval ) );
449 }
450
451 pad->ClearSelected();
452 getView()->Update( pad );
453 }
454 }
455 }
456 else if( evt->IsDblClick( BUT_LEFT ) )
457 {
458 commit.Push( _( "Renumber pads" ) );
459 frame()->PopTool( aEvent );
460 break;
461 }
462 else if( evt->IsClick( BUT_RIGHT ) )
463 {
465 }
466 else
467 {
468 evt->SetPassEvent();
469 }
470
471 // Prepare the next loop by updating the old cursor mouse position
472 // to this last mouse cursor position
473 oldCursorPos = getViewControls()->GetCursorPosition();
474 statusPopup.Move( wxGetMousePosition() + wxPoint( 20, 20 ) );
475 }
476
477 for( PAD* p : board()->GetFirstFootprint()->Pads() )
478 {
479 p->ClearSelected();
480 getView()->Update( p );
481 }
482
483 canvas()->SetStatusPopup( nullptr );
484 statusPopup.Hide();
485
488 return 0;
489}
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:109
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
Definition: board.h:403
void Empty()
Clear the list.
Definition: collector.h:89
int GetCount() const
Return the number of objects in the list.
Definition: collector.h:81
void SetStatusPopup(wxWindow *aPopup)
PADS & Pads()
Definition: footprint.h:170
A general implementation of a COLLECTORS_GUIDE.
Definition: collectors.h:326
void SetIgnoreMTextsMarkedNoShow(bool ignore)
Definition: collectors.h:411
void SetIgnoreModulesRefs(bool ignore)
Definition: collectors.h:465
void SetIgnoreModulesVals(bool ignore)
Definition: collectors.h:459
void SetIgnoreMTextsOnFront(bool ignore)
Definition: collectors.h:423
void SetIgnoreMTextsOnBack(bool ignore)
Definition: collectors.h:417
Used when the right click button is pressed, or when the select tool is in effect.
Definition: collectors.h:204
void Collect(BOARD_ITEM *aItem, const std::vector< KICAD_T > &aScanList, const VECTOR2I &aRefPos, const COLLECTORS_GUIDE &aGuide)
Scan a BOARD_ITEM using this class's Inspector method, which does the collection.
Definition: collectors.cpp:596
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
Definition: view.cpp:1591
void SetLastPadNumber(const wxString &aPadNumber)
Definition: pad_tool.h:66
GENERAL_COLLECTORS_GUIDE GetCollectorsGuide()
Extension of STATUS_POPUP for displaying a single line text.
Definition: status_popup.h:83
static bool empty(const wxTextEntryBase *aCtrl)
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
static float distance(const SFVEC2UI &a, const SFVEC2UI &b)
const double IU_PER_MM
Definition: base_units.h:77
MAGNETIC_OPTIONS tracks
MAGNETIC_OPTIONS pads
double EuclideanNorm(const VECTOR2I &vector)
Definition: trigo.h:129

References _, TOOL_INTERACTIVE::Activate(), ARROW, PCB_TOOL_BASE::board(), BULLSEYE, BUT_LEFT, BUT_RIGHT, PCB_TOOL_BASE::canvas(), CAPTURE_ALWAYS, GENERAL_COLLECTOR::Collect(), distance(), COLLECTOR::Empty(), empty(), EuclideanNorm(), KIGFX::VIEW_CONTROLS::ForceCursorPosition(), Format(), PCB_TOOL_BASE::frame(), PCB_BASE_FRAME::GetCollectorsGuide(), COLLECTOR::GetCount(), KIGFX::VIEW_CONTROLS::GetCursorPosition(), BOARD::GetFirstFootprint(), STATUS_POPUP::GetPanel(), DIALOG_ENUM_PADS::GetPrefix(), DIALOG_ENUM_PADS::GetStartNumber(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), MAGNETIC_SETTINGS::graphics, grid, EDA_IU_SCALE::IU_PER_MM, TOOL_INTERACTIVE::m_menu, TOOL_BASE::m_toolMgr, COMMIT::Modify(), STATUS_POPUP::Move(), NO_EFFECT, pad, FOOTPRINT::Pads(), MAGNETIC_SETTINGS::pads, PCB_PAD_T, pcbIUScale, TOOLS_HOLDER::PopTool(), STATUS_POPUP::Popup(), BOARD_COMMIT::Push(), TOOLS_HOLDER::PushTool(), BOARD_COMMIT::Revert(), TOOL_MANAGER::RunAction(), PCB_TOOL_BASE::selection(), PCB_ACTIONS::selectionClear, EDA_DRAW_PANEL_GAL::SetCurrentCursor(), GENERAL_COLLECTORS_GUIDE::SetIgnoreModulesRefs(), GENERAL_COLLECTORS_GUIDE::SetIgnoreModulesVals(), GENERAL_COLLECTORS_GUIDE::SetIgnoreMTextsMarkedNoShow(), GENERAL_COLLECTORS_GUIDE::SetIgnoreMTextsOnBack(), GENERAL_COLLECTORS_GUIDE::SetIgnoreMTextsOnFront(), SetLastPadNumber(), EDA_DRAW_PANEL_GAL::SetStatusPopup(), STATUS_TEXT_POPUP::SetText(), TOOL_MENU::ShowContextMenu(), KIGFX::VIEW_CONTROLS::ShowCursor(), MAGNETIC_SETTINGS::tracks, KIGFX::VIEW::Update(), TOOL_INTERACTIVE::Wait(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by setTransitions().

◆ explodePad()

PCB_LAYER_ID PAD_TOOL::explodePad ( PAD aPad)
private

Definition at line 657 of file pad_tool.cpp.

658{
659 PCB_LAYER_ID layer;
660 BOARD_COMMIT commit( frame() );
661
662 if( aPad->IsOnLayer( F_Cu ) )
663 layer = F_Cu;
664 else if( aPad->IsOnLayer( B_Cu ) )
665 layer = B_Cu;
666 else
667 layer = *aPad->GetLayerSet().UIOrder();
668
669 if( aPad->GetShape() == PAD_SHAPE::CUSTOM )
670 {
671 commit.Modify( aPad );
672
673 for( const std::shared_ptr<PCB_SHAPE>& primitive : aPad->GetPrimitives() )
674 {
675 FP_SHAPE* shape = new FP_SHAPE( board()->GetFirstFootprint() );
676
677 shape->SetShape( primitive->GetShape() );
678 shape->SetIsAnnotationProxy( primitive->IsAnnotationProxy());
679 shape->SetFilled( primitive->IsFilled() );
680 shape->SetStroke( primitive->GetStroke() );
681
682 switch( shape->GetShape() )
683 {
684 case SHAPE_T::SEGMENT:
685 case SHAPE_T::RECT:
686 case SHAPE_T::CIRCLE:
687 shape->SetStart( primitive->GetStart() );
688 shape->SetEnd( primitive->GetEnd() );
689 break;
690
691 case SHAPE_T::ARC:
692 shape->SetStart( primitive->GetStart() );
693 shape->SetEnd( primitive->GetEnd() );
694 shape->SetCenter( primitive->GetCenter() );
695 break;
696
697 case SHAPE_T::BEZIER:
698 shape->SetStart( primitive->GetStart() );
699 shape->SetEnd( primitive->GetEnd() );
700 shape->SetBezierC1( primitive->GetBezierC1() );
701 shape->SetBezierC2( primitive->GetBezierC2() );
702 break;
703
704 case SHAPE_T::POLY:
705 shape->SetPolyShape( primitive->GetPolyShape() );
706 break;
707
708 default:
710 }
711
712 shape->SetLocalCoord();
713 shape->Move( aPad->GetPosition() );
714 shape->Rotate( aPad->GetPosition(), aPad->GetOrientation() );
715 shape->SetLayer( layer );
716
717 commit.Add( shape );
718 }
719
720 aPad->SetShape( aPad->GetAnchorPadShape() );
721 aPad->DeletePrimitivesList();
722 aPad->SetFlags( ENTERED );
723 m_editPad = aPad->m_Uuid;
724 }
725
726 commit.Push( _("Edit pad shapes") );
728 return layer;
729}
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Definition: board_item.h:226
const KIID m_Uuid
Definition: eda_item.h:492
void SetBezierC2(const VECTOR2I &aPt)
Definition: eda_shape.h:178
void SetCenter(const VECTOR2I &aCenter)
Definition: eda_shape.cpp:470
void SetFilled(bool aFlag)
Definition: eda_shape.h:95
SHAPE_T GetShape() const
Definition: eda_shape.h:113
void SetPolyShape(const SHAPE_POLY_SET &aShape)
Definition: eda_shape.h:255
void SetStart(const VECTOR2I &aStart)
Definition: eda_shape.h:124
void SetShape(SHAPE_T aShape)
Definition: eda_shape.h:112
void SetEnd(const VECTOR2I &aEnd)
Definition: eda_shape.h:149
void SetBezierC1(const VECTOR2I &aPt)
Definition: eda_shape.h:175
wxString SHAPE_T_asString() const
Definition: eda_shape.cpp:75
void SetIsAnnotationProxy(bool aIsProxy=true)
Definition: eda_shape.h:88
virtual void SetLocalCoord()
Set relative coordinates from draw coordinates.
Definition: fp_shape.cpp:52
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
Definition: fp_shape.cpp:343
void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition: fp_shape.cpp:355
LSEQ UIOrder() const
Definition: lset.cpp:922
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: pad.h:398
void DeletePrimitivesList()
Clear the basic shapes list.
bool IsOnLayer(PCB_LAYER_ID aLayer, bool aIncludeCourtyards=false) const override
Test to see if this object is on the given layer.
Definition: pad.h:631
VECTOR2I GetPosition() const override
Definition: pad.h:203
const std::vector< std::shared_ptr< PCB_SHAPE > > & GetPrimitives() const
Accessor to the basic shape list for custom-shaped pads.
Definition: pad.h:331
PAD_SHAPE GetShape() const
Definition: pad.h:195
EDA_ANGLE GetOrientation() const
Return the rotation angle of the pad.
Definition: pad.h:371
void SetShape(PAD_SHAPE aShape)
Set the new shape of this pad.
Definition: pad.h:186
PAD_SHAPE GetAnchorPadShape() const
Definition: pad.h:208
void SetStroke(const STROKE_PARAMS &aStroke) override
Definition: pcb_shape.h:72
#define ENTERED
indicates a group has been entered
@ B_Cu
Definition: layer_ids.h:95
@ F_Cu
Definition: layer_ids.h:64
#define UNIMPLEMENTED_FOR(type)
Definition: macros.h:120

References _, COMMIT::Add(), ARC, B_Cu, BEZIER, PCB_TOOL_BASE::board(), CIRCLE, CUSTOM, PAD::DeletePrimitivesList(), ENTERED, F_Cu, PCB_TOOL_BASE::frame(), PAD::GetAnchorPadShape(), PAD::GetLayerSet(), PAD::GetOrientation(), PAD::GetPosition(), PAD::GetPrimitives(), EDA_SHAPE::GetShape(), PAD::GetShape(), PAD::IsOnLayer(), m_editPad, TOOL_BASE::m_toolMgr, EDA_ITEM::m_Uuid, COMMIT::Modify(), FP_SHAPE::Move(), POLY, BOARD_COMMIT::Push(), RECT, FP_SHAPE::Rotate(), TOOL_MANAGER::RunAction(), SEGMENT, PCB_ACTIONS::selectionClear, EDA_SHAPE::SetBezierC1(), EDA_SHAPE::SetBezierC2(), EDA_SHAPE::SetCenter(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetFilled(), EDA_ITEM::SetFlags(), EDA_SHAPE::SetIsAnnotationProxy(), BOARD_ITEM::SetLayer(), FP_SHAPE::SetLocalCoord(), EDA_SHAPE::SetPolyShape(), PAD::SetShape(), EDA_SHAPE::SetShape(), EDA_SHAPE::SetStart(), PCB_SHAPE::SetStroke(), EDA_SHAPE::SHAPE_T_asString(), LSET::UIOrder(), and UNIMPLEMENTED_FOR.

Referenced by EditPad().

◆ 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(), copyPadSettings(), EDIT_TOOL::copyToClipboard(), ROUTER_TOOL::CustomTrackWidthDialog(), FOOTPRINT_EDITOR_CONTROL::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(), EditPad(), EnumeratePads(), 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(), FOOTPRINT_EDITOR_CONTROL::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(), 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(), pushPadSettings(), PCB_CONTROL::RatsnestModeCycle(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), SCRIPTING_TOOL::reloadPlugins(), PCB_POINT_EDITOR::removeCorner(), PNS::TOOL_BASE::Reset(), 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().

◆ GetLastPadNumber()

wxString PAD_TOOL::GetLastPadNumber ( ) const
inline

Definition at line 65 of file pad_tool.h.

65{ return m_lastPadNumber; }
wxString m_lastPadNumber
Definition: pad_tool.h:93

References m_lastPadNumber.

Referenced by EDIT_TOOL::Duplicate(), and DIALOG_PAD_PROPERTIES::initValues().

◆ 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(), 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(), EnumeratePads(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), SCH_EDITOR_CONTROL::HighlightNet(), BOARD_INSPECTION_TOOL::HighlightNet(), FOOTPRINT_EDITOR_CONTROL::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(), FOOTPRINT_EDITOR_CONTROL::setTransitions(), GLOBAL_EDIT_TOOL::setTransitions(), GROUP_TOOL::setTransitions(), 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().

◆ Init()

bool PAD_TOOL::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 82 of file pad_tool.cpp.

83{
85
86 if( selTool )
87 {
88 // Add context menu entries that are displayed when selection tool is active
89 CONDITIONAL_MENU& menu = selTool->GetToolMenu().GetMenu();
90
94
95 auto explodeCondition =
96 [&]( const SELECTION& aSel )
97 {
98 return m_editPad == niluuid && aSel.Size() == 1 && aSel[0]->Type() == PCB_PAD_T;
99 };
100
101 auto recombineCondition =
102 [&]( const SELECTION& aSel )
103 {
104 return m_editPad != niluuid;
105 };
106
107 menu.AddSeparator( 400 );
108
110 {
112 menu.AddItem( PCB_ACTIONS::recombinePad, recombineCondition, 400 );
113 menu.AddItem( PCB_ACTIONS::explodePad, explodeCondition, 400 );
114 }
115
116 menu.AddItem( PCB_ACTIONS::copyPadSettings, singlePadSel, 400 );
117 menu.AddItem( PCB_ACTIONS::applyPadSettings, padSel, 400 );
118 menu.AddItem( PCB_ACTIONS::pushPadSettings, singlePadSel, 400 );
119 }
120
121 auto& ctxMenu = m_menu.GetMenu();
122
123 // cancel current tool goes in main context menu at the top if present
125 ctxMenu.AddSeparator( 1 );
126
133
134 // Finally, add the standard zoom/grid items
135 getEditFrame<PCB_BASE_FRAME>()->AddStandardSubMenus( m_menu );
136
137 return true;
138}
static TOOL_ACTION cancelInteractive
Definition: actions.h:63
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.
static TOOL_ACTION enumeratePads
Tool for quick pad enumeration.
Definition: pcb_actions.h:432
static TOOL_ACTION pushPadSettings
Copy the current pad's settings to other pads in the footprint or on the board.
Definition: pcb_actions.h:452
static TOOL_ACTION mirrorH
Mirroring of selected items.
Definition: pcb_actions.h:129
static TOOL_ACTION copyPadSettings
Copy the selected pad's settings to the board design settings.
Definition: pcb_actions.h:446
static TOOL_ACTION applyPadSettings
Copy the default pad settings to the selected pad.
Definition: pcb_actions.h:449
static TOOL_ACTION mirrorV
Definition: pcb_actions.h:130
static TOOL_ACTION rotateCw
Rotation of selected objects.
Definition: pcb_actions.h:122
static TOOL_ACTION rotateCcw
Definition: pcb_actions.h:123
bool m_isFootprintEditor
static SELECTION_CONDITION HasType(KICAD_T aType)
Create a functor that tests if among the selected items there is at least one of a given type.
static SELECTION_CONDITION Count(int aNumber)
Create a functor that tests if the number of selected items is equal to the value given as parameter.
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
static SELECTION_CONDITION OnlyTypes(std::vector< KICAD_T > aTypes)
Create a functor that tests if the selected items are only of given types.
TOOL_MENU & GetToolMenu()
CONDITIONAL_MENU & GetMenu()
Definition: tool_menu.cpp:44
std::function< bool(const SELECTION &)> SELECTION_CONDITION
< Functor type that checks a specific condition for selected items.

References CONDITIONAL_MENU::AddItem(), CONDITIONAL_MENU::AddSeparator(), PCB_ACTIONS::applyPadSettings, ACTIONS::cancelInteractive, PCB_ACTIONS::copyPadSettings, SELECTION_CONDITIONS::Count(), PCB_ACTIONS::enumeratePads, PCB_ACTIONS::explodePad, PCB_ACTIONS::flip, TOOL_MENU::GetMenu(), TOOL_MANAGER::GetTool(), TOOL_INTERACTIVE::GetToolMenu(), SELECTION_CONDITIONS::HasType(), m_editPad, PCB_TOOL_BASE::m_isFootprintEditor, TOOL_INTERACTIVE::m_menu, TOOL_BASE::m_toolMgr, PCB_ACTIONS::mirrorH, PCB_ACTIONS::mirrorV, niluuid, SELECTION_CONDITIONS::OnlyTypes(), PCB_PAD_T, PCB_ACTIONS::properties, PCB_ACTIONS::pushPadSettings, PCB_ACTIONS::recombinePad, PCB_ACTIONS::rotateCcw, PCB_ACTIONS::rotateCw, and SELECTION_CONDITIONS::ShowAlways().

◆ InPadEditMode()

bool PAD_TOOL::InPadEditMode ( )
inline

Definition at line 63 of file pad_tool.h.

63{ return m_editPad != niluuid; }

References m_editPad, and niluuid.

Referenced by FOOTPRINT_EDIT_FRAME::SaveFootprint().

◆ 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().

◆ pastePadProperties()

int PAD_TOOL::pastePadProperties ( const TOOL_EVENT aEvent)
private

Copy pad settings from a pad to the board design settings.

Definition at line 141 of file pad_tool.cpp.

142{
144 const PCB_SELECTION& selection = selTool->GetSelection();
145 const PAD* masterPad = frame()->GetDesignSettings().m_Pad_Master.get();
146
147 BOARD_COMMIT commit( frame() );
148
149 // for every selected pad, paste global settings
150 for( EDA_ITEM* item : selection )
151 {
152 if( item->Type() == PCB_PAD_T )
153 {
154 commit.Modify( item );
155 static_cast<PAD&>( *item ).ImportSettingsFrom( *masterPad );
156 }
157 }
158
159 commit.Push( _( "Paste Pad Properties" ) );
160
162 frame()->Refresh();
163
164 return 0;
165}
void ImportSettingsFrom(const PAD &aMasterPad)
Import the pad settings from aMasterPad.
Definition: pad.cpp:1477

References _, PCB_TOOL_BASE::frame(), PCB_BASE_FRAME::GetDesignSettings(), PCB_SELECTION_TOOL::GetSelection(), TOOL_MANAGER::GetTool(), PAD::ImportSettingsFrom(), BOARD_DESIGN_SETTINGS::m_Pad_Master, TOOL_BASE::m_toolMgr, COMMIT::Modify(), PCB_PAD_T, TOOL_MANAGER::ProcessEvent(), BOARD_COMMIT::Push(), EVENTS::SelectedItemsModified, and PCB_TOOL_BASE::selection().

Referenced by setTransitions().

◆ PlacePad()

int PAD_TOOL::PlacePad ( const TOOL_EVENT aEvent)

Place a pad in footprint editor.

Definition at line 492 of file pad_tool.cpp.

493{
494 if( !board()->GetFirstFootprint() )
495 return 0;
496
497 struct PAD_PLACER : public INTERACTIVE_PLACER_BASE
498 {
499 PAD_PLACER( PAD_TOOL* aPadTool )
500 {
501 m_padTool = aPadTool;
502 }
503
504 virtual ~PAD_PLACER()
505 {
506 }
507
508 std::unique_ptr<BOARD_ITEM> CreateItem() override
509 {
510 PAD* pad = new PAD( m_board->GetFirstFootprint() );
511 PAD* master = m_frame->GetDesignSettings().m_Pad_Master.get();
512
513 pad->ImportSettingsFrom( *master );
514
515 // If the footprint type and master pad type directly conflict then make some
516 // adjustments. Otherwise assume the user set what they wanted.
517 if( ( m_board->GetFirstFootprint()->GetAttributes() & FP_SMD )
518 && master->GetAttribute() == PAD_ATTRIB::PTH )
519 {
520 pad->SetAttribute( PAD_ATTRIB::SMD );
521 pad->SetShape( PAD_SHAPE::ROUNDRECT );
522 pad->SetSizeX( 1.5 * pad->GetSizeY() );
523 pad->SetLayerSet( PAD::SMDMask() );
524 }
525 else if( ( m_board->GetFirstFootprint()->GetAttributes() & FP_THROUGH_HOLE )
526 && master->GetAttribute() == PAD_ATTRIB::SMD )
527 {
528 pad->SetAttribute( PAD_ATTRIB::PTH );
529 pad->SetShape( PAD_SHAPE::CIRCLE );
530 pad->SetSize( VECTOR2I( pad->GetSizeX(), pad->GetSizeX() ) );
531 pad->SetLayerSet( PAD::PTHMask() );
532 }
533
534 if( pad->CanHaveNumber() )
535 {
536 wxString padNumber = m_padTool->GetLastPadNumber();
537 padNumber = m_board->GetFirstFootprint()->GetNextPadNumber( padNumber );
538 pad->SetNumber( padNumber );
539 m_padTool->SetLastPadNumber( padNumber );
540 }
541
542 return std::unique_ptr<BOARD_ITEM>( pad );
543 }
544
545 bool PlaceItem( BOARD_ITEM *aItem, BOARD_COMMIT& aCommit ) override
546 {
547 PAD* pad = dynamic_cast<PAD*>( aItem );
548
549 if( pad )
550 {
551 m_frame->GetDesignSettings().m_Pad_Master->ImportSettingsFrom( *pad );
552 pad->SetLocalCoord();
553 aCommit.Add( aItem );
554 return true;
555 }
556
557 return false;
558 }
559
560 PAD_TOOL* m_padTool;
561 };
562
563 PAD_PLACER placer( this );
564
565 doInteractiveItemPlacement( aEvent, &placer, _( "Place pad" ),
567
568 return 0;
569}
COMMIT & Add(EDA_ITEM *aItem)
Notify observers that aItem has been added.
Definition: commit.h:78
Tool relating to pads and pad settings.
Definition: pad_tool.h:37
PAD_ATTRIB GetAttribute() const
Definition: pad.h:401
static LSET PTHMask()
layer set for a through hole pad
Definition: pad.cpp:196
static LSET SMDMask()
layer set for a SMD pad on Front layer
Definition: pad.cpp:203
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...
@ FP_SMD
Definition: footprint.h:69
@ FP_THROUGH_HOLE
Definition: footprint.h:68
@ SMD
Smd pad, appears on the solder paste layer (default)
@ PTH
Plated through hole pad.
VECTOR2< int > VECTOR2I
Definition: vector2d.h:590

References _, COMMIT::Add(), PCB_TOOL_BASE::board(), CIRCLE, PCB_TOOL_BASE::doInteractiveItemPlacement(), FP_SMD, FP_THROUGH_HOLE, PAD::GetAttribute(), PAD::ImportSettingsFrom(), PCB_TOOL_BASE::IPO_FLIP, PCB_TOOL_BASE::IPO_REPEAT, PCB_TOOL_BASE::IPO_ROTATE, PCB_TOOL_BASE::IPO_SINGLE_CLICK, pad, PAD, PTH, PAD::PTHMask(), ROUNDRECT, SMD, and PAD::SMDMask().

Referenced by setTransitions().

◆ pushPadSettings()

int PAD_TOOL::pushPadSettings ( const TOOL_EVENT aEvent)
private

Definition at line 240 of file pad_tool.cpp.

241{
243 const PCB_SELECTION& selection = selTool->GetSelection();
244 PAD* srcPad;
245
246 if( selection.Size() == 1 && selection[0]->Type() == PCB_PAD_T )
247 srcPad = static_cast<PAD*>( selection[0] );
248 else
249 return 0;
250
251 FOOTPRINT* footprint = srcPad->GetParent();
252
253 if( !footprint )
254 return 0;
255
257
259 int dialogRet = dlg.ShowModal();
260
261 if( dialogRet == wxID_CANCEL )
262 return 0;
263
264 const bool edit_Same_Modules = (dialogRet == 1);
265
266 BOARD_COMMIT commit( frame() );
267
268 doPushPadProperties( *getModel<BOARD>(), *srcPad, commit, edit_Same_Modules,
273
274 commit.Push( _( "Push Pad Settings" ) );
275
277 frame()->Refresh();
278
279 return 0;
280}
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
FOOTPRINT * GetParent() const
Definition: pad.cpp:1471
FOOTPRINT * footprint() const
static void doPushPadProperties(BOARD &board, const PAD &aSrcPad, BOARD_COMMIT &commit, bool aSameFootprints, bool aPadShapeFilter, bool aPadOrientFilter, bool aPadLayerFilter, bool aPadTypeFilter)
Definition: pad_tool.cpp:189

References _, doPushPadProperties(), PCB_TOOL_BASE::footprint(), PCB_TOOL_BASE::frame(), PAD::GetParent(), PCB_SELECTION_TOOL::GetSelection(), TOOL_MANAGER::GetTool(), DIALOG_PUSH_PAD_PROPERTIES::m_Pad_Layer_Filter, DIALOG_PUSH_PAD_PROPERTIES::m_Pad_Orient_Filter, DIALOG_PUSH_PAD_PROPERTIES::m_Pad_Shape_Filter, DIALOG_PUSH_PAD_PROPERTIES::m_Pad_Type_Filter, TOOL_BASE::m_toolMgr, PCB_PAD_T, TOOL_MANAGER::ProcessEvent(), BOARD_COMMIT::Push(), EVENTS::SelectedItemsModified, PCB_TOOL_BASE::selection(), EDA_DRAW_FRAME::SetMsgPanel(), and SELECTION::Size().

Referenced by setTransitions().

◆ RecombinePad()

std::vector< FP_SHAPE * > PAD_TOOL::RecombinePad ( PAD aPad,
bool  aIsDryRun,
BOARD_COMMIT aCommit 
)

Recombine an exploded pad (or one produced with overlapping polygons in an older version).

Parameters
aPadthe pad to run the recombination algorithm on
aIsDryRunif true the list will be generated but no changes will be made
aCommitthe commit to add any changes to
Returns
a list of FP_SHAPEs that will be combined

Definition at line 732 of file pad_tool.cpp.

733{
734 int maxError = board()->GetDesignSettings().m_MaxError;
735 FOOTPRINT* footprint = static_cast<FOOTPRINT*>( aPad->GetParentFootprint() );
736
737 // Don't leave an object in the point editor that might no longer exist after
738 // recombining the pad.
740
741 for( BOARD_ITEM* item : footprint->GraphicalItems() )
742 item->ClearFlags( SKIP_STRUCT );
743
744 auto findNext =
745 [&]( PCB_LAYER_ID aLayer ) -> FP_SHAPE*
746 {
747 SHAPE_POLY_SET padPoly;
748 aPad->TransformShapeToPolygon( padPoly, aLayer, 0, maxError, ERROR_INSIDE );
749
750 for( BOARD_ITEM* item : footprint->GraphicalItems() )
751 {
752 FP_SHAPE* shape = dynamic_cast<FP_SHAPE*>( item );
753
754 if( !shape || ( shape->GetFlags() & SKIP_STRUCT ) )
755 continue;
756
757 if( shape->GetLayer() != aLayer )
758 continue;
759
760 if( shape->IsAnnotationProxy() ) // Pad number (and net name) box
761 return (FP_SHAPE*) item;
762
763 SHAPE_POLY_SET drawPoly;
764 shape->TransformShapeToPolygon( drawPoly, aLayer, 0, maxError, ERROR_INSIDE );
765 drawPoly.BooleanIntersection( padPoly, SHAPE_POLY_SET::PM_FAST );
766
767 if( !drawPoly.IsEmpty() )
768 return (FP_SHAPE*) item;
769 }
770
771 return nullptr;
772 };
773
774 auto findMatching =
775 [&]( FP_SHAPE* aShape ) -> std::vector<FP_SHAPE*>
776 {
777 std::vector<FP_SHAPE*> matching;
778
779 for( BOARD_ITEM* item : footprint->GraphicalItems() )
780 {
781 FP_SHAPE* other = dynamic_cast<FP_SHAPE*>( item );
782
783 if( !other || ( other->GetFlags() & SKIP_STRUCT ) )
784 continue;
785
786 if( aPad->GetLayerSet().test( other->GetLayer() )
787 && aShape->Compare( other ) == 0 )
788 {
789 matching.push_back( other );
790 }
791 }
792
793 return matching;
794 };
795
796 PCB_LAYER_ID layer;
797 std::vector<FP_SHAPE*> mergedShapes;
798
799 if( aPad->IsOnLayer( F_Cu ) )
800 layer = F_Cu;
801 else if( aPad->IsOnLayer( B_Cu ) )
802 layer = B_Cu;
803 else
804 layer = *aPad->GetLayerSet().UIOrder();
805
806 while( FP_SHAPE* fpShape = findNext( layer ) )
807 {
808 // We've found an intersecting item to combine.
809 //
810 fpShape->SetFlags( SKIP_STRUCT );
811
812 // First convert the pad to a custom-shape pad (if it isn't already)
813 //
814 if( !aIsDryRun )
815 {
816 aCommit.Modify( aPad );
817
818 if( aPad->GetShape() == PAD_SHAPE::RECT || aPad->GetShape() == PAD_SHAPE::CIRCLE )
819 {
820 aPad->SetAnchorPadShape( aPad->GetShape() );
821 }
822 else if( aPad->GetShape() != PAD_SHAPE::CUSTOM )
823 {
824 // Create a new minimally-sized circular anchor and convert existing pad
825 // to a polygon primitive
826 SHAPE_POLY_SET existingOutline;
827 aPad->TransformShapeToPolygon( existingOutline, layer, 0, maxError, ERROR_INSIDE );
828
830
831 if( aPad->GetSizeX() > aPad->GetSizeY() )
832 aPad->SetSizeX( aPad->GetSizeY() );
833
834 aPad->SetOffset( VECTOR2I( 0, 0 ) );
835
836 PCB_SHAPE* shape = new PCB_SHAPE( nullptr, SHAPE_T::POLY );
837 shape->SetFilled( true );
839 shape->SetPolyShape( existingOutline );
840 shape->Move( - aPad->GetPosition() );
841 shape->Rotate( VECTOR2I( 0, 0 ), - aPad->GetOrientation() );
842
843 aPad->AddPrimitive( shape );
844 }
845
847 }
848
849 // Now add the new shape to the primitives list
850 //
851 mergedShapes.push_back( fpShape );
852
853 if( !aIsDryRun )
854 {
855 PCB_SHAPE* pcbShape = new PCB_SHAPE;
856
857 pcbShape->SetShape( fpShape->GetShape() );
858 pcbShape->SetFilled( fpShape->IsFilled() );
859 pcbShape->SetStroke( fpShape->GetStroke() );
860
861 switch( pcbShape->GetShape() )
862 {
863 case SHAPE_T::SEGMENT:
864 case SHAPE_T::RECT:
865 case SHAPE_T::CIRCLE:
866 pcbShape->SetStart( fpShape->GetStart() );
867 pcbShape->SetEnd( fpShape->GetEnd() );
868 break;
869
870 case SHAPE_T::ARC:
871 pcbShape->SetStart( fpShape->GetStart() );
872 pcbShape->SetEnd( fpShape->GetEnd() );
873 pcbShape->SetCenter( fpShape->GetCenter() );
874 break;
875
876 case SHAPE_T::BEZIER:
877 pcbShape->SetStart( fpShape->GetStart() );
878 pcbShape->SetEnd( fpShape->GetEnd() );
879 pcbShape->SetBezierC1( fpShape->GetBezierC1() );
880 pcbShape->SetBezierC2( fpShape->GetBezierC2() );
881 break;
882
883 case SHAPE_T::POLY:
884 pcbShape->SetPolyShape( fpShape->GetPolyShape() );
885 break;
886
887 default:
888 UNIMPLEMENTED_FOR( pcbShape->SHAPE_T_asString() );
889 }
890
891 pcbShape->Move( - aPad->GetPosition() );
892 pcbShape->Rotate( VECTOR2I( 0, 0 ), - aPad->GetOrientation() );
893 pcbShape->SetIsAnnotationProxy( fpShape->IsAnnotationProxy());
894 aPad->AddPrimitive( pcbShape );
895
896 aCommit.Remove( fpShape );
897 }
898
899 // See if there are other shapes that match and mark them for delete. (KiCad won't
900 // produce these, but old footprints from other vendors have them.)
901 for( FP_SHAPE* other : findMatching( fpShape ) )
902 {
903 other->SetFlags( SKIP_STRUCT );
904 mergedShapes.push_back( other );
905
906 if( !aIsDryRun )
907 aCommit.Remove( other );
908 }
909 }
910
911 for( BOARD_ITEM* item : footprint->GraphicalItems() )
912 item->ClearFlags( SKIP_STRUCT );
913
914 if( !aIsDryRun )
915 aPad->ClearFlags( ENTERED );
916
917 return mergedShapes;
918}
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:192
BOARD_ITEM_CONTAINER * GetParentFootprint() const
Definition: board_item.cpp:239
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:704
COMMIT & Modify(EDA_ITEM *aItem)
Create an undo entry for an item that has been already modified.
Definition: commit.h:103
COMMIT & Remove(EDA_ITEM *aItem)
Notify observers that aItem has been removed.
Definition: commit.h:90
bool IsAnnotationProxy() const
Definition: eda_shape.h:87
DRAWINGS & GraphicalItems()
Definition: footprint.h:173
int GetSizeX() const
Definition: pad.h:260
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aMaxError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Convert the pad shape to a closed polygon.
Definition: pad.cpp:1586
void SetOffset(const VECTOR2I &aOffset)
Definition: pad.h:274
int GetSizeY() const
Definition: pad.h:262
void SetAnchorPadShape(PAD_SHAPE aShape)
Set the shape of the anchor pad for custom shaped pads.
Definition: pad.h:234
void AddPrimitive(PCB_SHAPE *aPrimitive)
Add item to the custom shape primitives list.
void SetSizeX(const int aX)
Definition: pad.h:259
virtual void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
Definition: pcb_shape.cpp:191
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Convert the shape to a closed polygon.
Definition: pcb_shape.cpp:390
virtual void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition: pcb_shape.cpp:163
Represent a set of closed polygons.
bool IsEmpty() const
void BooleanIntersection(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Perform boolean polyset union between a and b, store the result in it self For aFastMode meaning,...
Simple container to manage line stroke parameters.
Definition: stroke_params.h:88
static PCB_SHAPE * findNext(PCB_SHAPE *aShape, const VECTOR2I &aPoint, const std::vector< PCB_SHAPE * > &aList, unsigned aLimit)
Searches for a PCB_SHAPE matching a given end point or start point in a list.
#define SKIP_STRUCT
flag indicating that the structure should be ignored
@ ERROR_INSIDE

References PAD::AddPrimitive(), ARC, B_Cu, BEZIER, PCB_TOOL_BASE::board(), SHAPE_POLY_SET::BooleanIntersection(), CIRCLE, EDA_ITEM::ClearFlags(), CUSTOM, ENTERED, ERROR_INSIDE, F_Cu, findNext(), PCB_TOOL_BASE::footprint(), BOARD::GetDesignSettings(), EDA_ITEM::GetFlags(), BOARD_ITEM::GetLayer(), PAD::GetLayerSet(), PAD::GetOrientation(), BOARD_ITEM::GetParentFootprint(), PAD::GetPosition(), EDA_SHAPE::GetShape(), PAD::GetShape(), PAD::GetSizeX(), PAD::GetSizeY(), FOOTPRINT::GraphicalItems(), EDA_SHAPE::IsAnnotationProxy(), SHAPE_POLY_SET::IsEmpty(), PAD::IsOnLayer(), BOARD_DESIGN_SETTINGS::m_MaxError, TOOL_BASE::m_toolMgr, COMMIT::Modify(), PCB_SHAPE::Move(), SHAPE_POLY_SET::PM_FAST, POLY, RECT, COMMIT::Remove(), PCB_SHAPE::Rotate(), TOOL_MANAGER::RunAction(), SEGMENT, PCB_ACTIONS::selectionClear, PAD::SetAnchorPadShape(), EDA_SHAPE::SetBezierC1(), EDA_SHAPE::SetBezierC2(), EDA_SHAPE::SetCenter(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetFilled(), EDA_SHAPE::SetIsAnnotationProxy(), PAD::SetOffset(), EDA_SHAPE::SetPolyShape(), PAD::SetShape(), EDA_SHAPE::SetShape(), PAD::SetSizeX(), EDA_SHAPE::SetStart(), PCB_SHAPE::SetStroke(), EDA_SHAPE::SHAPE_T_asString(), SKIP_STRUCT, SOLID, PCB_SHAPE::TransformShapeToPolygon(), PAD::TransformShapeToPolygon(), LSET::UIOrder(), and UNIMPLEMENTED_FOR.

Referenced by EditPad(), and GRAPHICS_CLEANER::mergePads().

◆ Reset()

◆ 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().

◆ 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().

◆ 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}

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(), 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(), EditPad(), GROUP_TOOL::EnterGroup(), 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(), 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(), 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.

◆ SetLastPadNumber()

void PAD_TOOL::SetLastPadNumber ( const wxString &  aPadNumber)
inline

Definition at line 66 of file pad_tool.h.

66{ m_lastPadNumber = aPadNumber; }

References m_lastPadNumber.

Referenced by EDIT_TOOL::Duplicate(), EnumeratePads(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

◆ setTransitions()

void PAD_TOOL::setTransitions ( )
overrideprivatevirtual

< Bind handlers to corresponding TOOL_ACTIONs.

Apply pad settings from board design settings to a pad.

Reimplemented from PCB_TOOL_BASE.

Definition at line 921 of file pad_tool.cpp.

922{
926
929
932}
int EditPad(const TOOL_EVENT &aEvent)
Enter/exit WYSIWYG pad shape editing.
Definition: pad_tool.cpp:572
int copyPadSettings(const TOOL_EVENT &aEvent)
Push pad settings from a pad to other pads on board or footprint.
Definition: pad_tool.cpp:168
int pastePadProperties(const TOOL_EVENT &aEvent)
Copy pad settings from a pad to the board design settings.
Definition: pad_tool.cpp:141
int PlacePad(const TOOL_EVENT &aEvent)
Place a pad in footprint editor.
Definition: pad_tool.cpp:492
int EnumeratePads(const TOOL_EVENT &aEvent)
Tool for quick pad enumeration.
Definition: pad_tool.cpp:283
int pushPadSettings(const TOOL_EVENT &aEvent)
Definition: pad_tool.cpp:240
static TOOL_ACTION placePad
Activation of the drawing tool (placing a PAD)
Definition: pcb_actions.h:426
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 PCB_ACTIONS::applyPadSettings, copyPadSettings(), PCB_ACTIONS::copyPadSettings, EditPad(), EnumeratePads(), PCB_ACTIONS::enumeratePads, PCB_ACTIONS::explodePad, TOOL_INTERACTIVE::Go(), pastePadProperties(), PlacePad(), PCB_ACTIONS::placePad, pushPadSettings(), PCB_ACTIONS::pushPadSettings, and PCB_ACTIONS::recombinePad.

◆ 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(), 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_editPad

KIID PAD_TOOL::m_editPad
private

Definition at line 96 of file pad_tool.h.

Referenced by EditPad(), explodePad(), Init(), InPadEditMode(), and Reset().

◆ m_isBoardEditor

bool PCB_TOOL_BASE::m_isBoardEditor
protectedinherited

◆ m_isFootprintEditor

◆ m_lastPadNumber

wxString PAD_TOOL::m_lastPadNumber
private

Definition at line 93 of file pad_tool.h.

Referenced by GetLastPadNumber(), Reset(), and SetLastPadNumber().

◆ 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(), 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(), FOOTPRINT_EDITOR_CONTROL::Init(), 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(), 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(), 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(), EnumeratePads(), EE_INSPECTION_TOOL::ExcludeMarker(), PCB_SELECTION_TOOL::ExitGroup(), PCB_SELECTION_TOOL::expandConnection(), 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(), FOOTPRINT_EDITOR_CONTROL::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(), 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(), 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(), pushPadSettings(), EDIT_TOOL::rebuildConnectivity(), ZONE_FILLER_TOOL::rebuildConnectivity(), EE_SELECTION_TOOL::RebuildSelection(), 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(), 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().

◆ m_wasHighContrast

bool PAD_TOOL::m_wasHighContrast
private

Definition at line 95 of file pad_tool.h.

Referenced by EditPad(), and Reset().


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