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 }
 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)
 
void SetIsFootprintEditor (bool aEnabled)
 Function SetIsFootprintEditor() More...
 
bool IsFootprintEditor () 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 std::string &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
 
const PCB_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
 
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 recombinePad (PAD *aPad)
 

Private Attributes

wxString m_lastPadNumber
 
bool m_wasHighContrast
 
KIID m_editPad
 

Detailed Description

Tool relating to pads and pad settings.

Definition at line 35 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 116 of file pcb_tool_base.h.

116  {
118  IPO_ROTATE = 0x01,
119 
121  IPO_FLIP = 0x02,
122 
125  IPO_SINGLE_CLICK = 0x04,
126 
128  IPO_REPEAT = 0x08
129  };
Handle flip action in the loop by calling the item's flip method.
Allow repeat placement of the item.
Create an item immediately on placement starting, otherwise show the pencil cursor until the item is ...
Handle the rotate action in the loop by calling the item's rotate method.

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

Definition at line 77 of file tool_base.h.

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

Constructor & Destructor Documentation

◆ PAD_TOOL()

PAD_TOOL::PAD_TOOL ( )

Definition at line 46 of file pad_tool.cpp.

46  :
47  PCB_TOOL_BASE( "pcbnew.PadTool" ),
48  m_wasHighContrast( false ),
50 {}
KIID niluuid(0)
KIID m_editPad
Definition: pad_tool.h:86
bool m_wasHighContrast
Definition: pad_tool.h:85
PCB_TOOL_BASE(TOOL_ID aId, const std::string &aName)
Constructor.
Definition: pcb_tool_base.h:77

◆ ~PAD_TOOL()

PAD_TOOL::~PAD_TOOL ( )

React to model/view changes.

Definition at line 53 of file pad_tool.cpp.

54 {}

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:214
TOOL_ID m_toolId
Name of the tool.
Definition: tool_base.h:209
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(), SYMBOL_EDITOR_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_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(), 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(), PCB_PICKER_TOOL::Main(), PL_EDIT_TOOL::Main(), EE_POINT_EDITOR::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PL_POINT_EDITOR::Main(), SCH_MOVE_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), LIB_TREE::onContextMenu(), PCB_POINT_EDITOR::OnSelectionChange(), GROUP_TOOL::PickNewMember(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), EDIT_TOOL::Remove(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), DRAWING_TOOL::SetAnchor(), DRC_TOOL::ShowDRCDialog(), SCH_DRAWING_TOOLS::SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_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 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214

References TOOL_BASE::m_toolMgr.

Referenced by TOOL_MANAGER::RegisterTool().

◆ board()

BOARD* PCB_TOOL_BASE::board ( ) const
inlineprotectedinherited

Definition at line 165 of file pcb_tool_base.h.

165 { return getModel<BOARD>(); }

Referenced by PCB_CONTROL::AppendBoard(), 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::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawSegment(), EnumeratePads(), explodePad(), BOARD_EDITOR_CONTROL::ExportNetlist(), ZONE_FILLER_TOOL::FillAllZones(), EDIT_TOOL::FilletTracks(), PCB_SELECTION_TOOL::filterSelection(), PCB_TOOL_BASE::footprint(), PCB_SELECTION_TOOL::GetBoard(), PCB_SELECTION_TOOL::getCollectorsGuide(), GROUP_TOOL::Group(), ROUTER_TOOL::handleLayerSwitch(), BOARD_INSPECTION_TOOL::highlightNet(), 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(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), PCB_SELECTION_TOOL::RebuildSelection(), recombinePad(), BOARD_EDITOR_CONTROL::RepairBoard(), FOOTPRINT_EDITOR_CONTROL::RepairFootprint(), PNS::TOOL_BASE::Reset(), PCB_CONTROL::Reset(), PCB_SELECTION_TOOL::Selectable(), PCB_SELECTION_TOOL::selectAllItemsOnNet(), PCB_SELECTION_TOOL::selectAllItemsOnSheet(), PCB_SELECTION_TOOL::selectConnectedTracks(), PCB_SELECTION_TOOL::selectionContains(), PCB_SELECTION_TOOL::selectPoint(), PCB_CONTROL::TrackDisplayMode(), PCB_CONTROL::unfilledZoneCheck(), GROUP_TOOL::Ungroup(), ROUTER_TOOL::UpdateMessagePanel(), PCB_CONTROL::ViaDisplayMode(), PCB_CONTROL::ZoneDisplayMode(), ZONE_FILLER_TOOL::ZoneFill(), 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 162 of file pad_tool.cpp.

163 {
165  const PCB_SELECTION& selection = selTool->GetSelection();
166 
167  // can only copy from a single pad
168  if( selection.Size() == 1 )
169  {
170  EDA_ITEM* item = selection[0];
171 
172  if( item->Type() == PCB_PAD_T )
173  {
174  const PAD& selPad = static_cast<const PAD&>( *item );
175  frame()->GetDesignSettings().m_Pad_Master->ImportSettingsFrom( selPad );
176  }
177  }
178 
179  return 0;
180 }
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Returns the BOARD_DESIGN_SETTINGS for the open project.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
class PAD, a pad in a footprint
Definition: typeinfo.h:89
std::unique_ptr< PAD > m_Pad_Master
PCB_BASE_EDIT_FRAME * frame() const
PCB_SELECTION & GetSelection()
Return the set of currently selected items.
const PCB_SELECTION & selection() const
int Size() const
Returns the number of selected parts.
Definition: selection.h:104
The selection tool: currently supports:
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:99
Definition: pad.h:57
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:112

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

const PCB_DISPLAY_OPTIONS & PCB_TOOL_BASE::displayOptions ( ) const
protectedinherited

◆ doInteractiveItemPlacement()

void PCB_TOOL_BASE::doInteractiveItemPlacement ( const std::string &  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 37 of file pcb_tool_base.cpp.

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

References TOOL_INTERACTIVE::Activate(), KIGFX::PCB_VIEW::Add(), KIGFX::VIEW_GROUP::Add(), SELECTION::Add(), ARROW, PCB_TOOL_BASE::board(), BUT_LEFT, BUT_RIGHT, KIGFX::VIEW_CONTROLS::CaptureCursor(), SELECTION::Clear(), PCB_TOOL_BASE::controls(), INTERACTIVE_PLACER_BASE::CreateItem(), PCB_ACTIONS::flip, PCB_TOOL_BASE::frame(), PCB_BASE_FRAME::GetCanvas(), TOOL_EVT_UTILS::GetEventRotationAngle(), 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, PCBNEW_SETTINGS::m_FlipLeftRight, 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(), PCB_BASE_FRAME::Settings(), 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 565 of file pad_tool.cpp.

566 {
568  WX_INFOBAR* infoBar = frame()->GetInfoBar();
570  wxString msg;
571 
572  if( m_editPad != niluuid )
573  {
574  PAD* pad = dynamic_cast<PAD*>( frame()->GetItem( m_editPad ) );
575 
576  if( pad )
577  recombinePad( pad );
578 
579  m_editPad = niluuid;
580  }
581  else if( selection.Size() == 1 && selection[0]->Type() == PCB_PAD_T )
582  {
583  PAD* pad = static_cast<PAD*>( selection[0] );
584  PCB_LAYER_ID layer = explodePad( pad );
585 
587  frame()->SetActiveLayer( layer );
588 
589  if( !m_wasHighContrast )
591 
592  if( PCB_ACTIONS::explodePad.GetHotKey() == PCB_ACTIONS::recombinePad.GetHotKey() )
593  {
594  msg.Printf( _( "Pad Edit Mode. Press %s again to exit." ),
596 
597  else
598  {
599  msg.Printf( _( "Pad Edit Mode. Press %s to exit." ),
601  }
602 
603  infoBar->RemoveAllButtons();
604  infoBar->ShowMessage( msg, wxICON_INFORMATION );
605 
606  m_editPad = pad->m_Uuid;
607  }
608 
609  if( m_editPad == niluuid )
610  {
611  bool highContrast = ( opts.m_ContrastModeDisplay != HIGH_CONTRAST_MODE::NORMAL );
612 
613  if( m_wasHighContrast != highContrast )
615 
616  infoBar->Dismiss();
617  }
618 
619  return 0;
620 }
void ShowMessage(const wxString &aMessage, int aFlags=wxICON_INFORMATION) override
Show the info bar with the provided message and icon.
Definition: infobar.cpp:142
static TOOL_ACTION explodePad
Definition: pcb_actions.h:383
KIID niluuid(0)
KIID m_editPad
Definition: pad_tool.h:86
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:143
class PAD, a pad in a footprint
Definition: typeinfo.h:89
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
PCB_BASE_EDIT_FRAME * frame() const
Container for display options like enable/disable some optional drawings.
void Dismiss() override
Dismisses the infobar and updates the containing layout and AUI manager (if one is provided).
Definition: infobar.cpp:175
bool m_wasHighContrast
Definition: pad_tool.h:85
const PCB_SELECTION & selection() const
Inactive layers are shown normally (no high-contrast mode)
static TOOL_ACTION recombinePad
Definition: pcb_actions.h:384
#define _(s)
HIGH_CONTRAST_MODE m_ContrastModeDisplay
How inactive layers are displayed.
virtual void SetActiveLayer(PCB_LAYER_ID aLayer)
void RemoveAllButtons()
Remove all the buttons that have been added by the user.
Definition: infobar.cpp:286
PCB_LAYER_ID explodePad(PAD *aPad)
Definition: pad_tool.cpp:623
A modified version of the wxInfoBar class that allows us to:
Definition: infobar.h:73
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:65
int Size() const
Returns the number of selected parts.
Definition: selection.h:104
The selection tool: currently supports:
WX_INFOBAR * GetInfoBar()
wxString KeyNameFromKeyCode(int aKeycode, bool *aIsFound)
Return the key name from the key code.
void recombinePad(PAD *aPad)
Definition: pad_tool.cpp:696
Definition: pad.h:57
static TOOL_ACTION highContrastMode
Definition: actions.h:103

References _, WX_INFOBAR::Dismiss(), explodePad(), PCB_ACTIONS::explodePad, PCB_TOOL_BASE::frame(), PCB_BASE_FRAME::GetDisplayOptions(), EDA_BASE_FRAME::GetInfoBar(), TOOL_MANAGER::GetTool(), ACTIONS::highContrastMode, KeyNameFromKeyCode(), PCB_DISPLAY_OPTIONS::m_ContrastModeDisplay, m_editPad, TOOL_BASE::m_toolMgr, m_wasHighContrast, niluuid, NORMAL, pad, PCB_PAD_T, recombinePad(), PCB_ACTIONS::recombinePad, WX_INFOBAR::RemoveAllButtons(), TOOL_MANAGER::RunAction(), PCB_TOOL_BASE::selection(), PCB_BASE_FRAME::SetActiveLayer(), WX_INFOBAR::ShowMessage(), and SELECTION::Size().

Referenced by setTransitions().

◆ EnumeratePads()

int PAD_TOOL::EnumeratePads ( const TOOL_EVENT aEvent)

Tool for quick pad enumeration.

Definition at line 277 of file pad_tool.cpp.

278 {
279  if( !board()->GetFirstFootprint() || board()->GetFirstFootprint()->Pads().empty() )
280  return 0;
281 
282  GENERAL_COLLECTOR collector;
283  const KICAD_T types[] = { PCB_PAD_T, EOT };
284 
286  guide.SetIgnoreMTextsMarkedNoShow( true );
287  guide.SetIgnoreMTextsOnBack( true );
288  guide.SetIgnoreMTextsOnFront( true );
289  guide.SetIgnoreModulesVals( true );
290  guide.SetIgnoreModulesRefs( true );
291 
292  DIALOG_ENUM_PADS settingsDlg( frame() );
293 
294  if( settingsDlg.ShowModal() != wxID_OK )
295  return 0;
296 
297  int seqPadNum = settingsDlg.GetStartNumber();
298  wxString padPrefix = settingsDlg.GetPrefix();
299  std::deque<int> storedPadNumbers;
300  std::map<wxString, std::pair<int, wxString>> oldNumbers;
301 
303 
304  std::string tool = aEvent.GetCommandStr().get();
305  frame()->PushTool( tool );
306 
307  VECTOR2I oldCursorPos; // store the previous mouse cursor position, during mouse drag
308  std::list<PAD*> selectedPads;
309  BOARD_COMMIT commit( frame() );
310  bool isFirstPoint = true; // make sure oldCursorPos is initialized at least once
311  PADS pads = board()->GetFirstFootprint()->Pads();
312 
313  MAGNETIC_SETTINGS mag_settings;
314  mag_settings.graphics = false;
315  mag_settings.tracks = MAGNETIC_OPTIONS::NO_EFFECT;
316  mag_settings.pads = MAGNETIC_OPTIONS::CAPTURE_ALWAYS;
317  PCB_GRID_HELPER grid( m_toolMgr, &mag_settings );
318 
319  grid.SetSnap( true );
320  grid.SetUseGrid( false );
321 
322  auto setCursor =
323  [&]()
324  {
326  };
327 
328  Activate();
329  // Must be done after Activate() so that it gets set into the correct context
330  getViewControls()->ShowCursor( true );
331  // Set initial cursor
332  setCursor();
333 
334  STATUS_TEXT_POPUP statusPopup( frame() );
335  wxString msg = _( "Click on pad %s%d\nPress <esc> to cancel or double-click to commit" );
336  statusPopup.SetText( wxString::Format( msg, padPrefix, seqPadNum ) );
337  statusPopup.Popup();
338  statusPopup.Move( wxGetMousePosition() + wxPoint( 20, 20 ) );
339 
340  while( TOOL_EVENT* evt = Wait() )
341  {
342  setCursor();
343 
344  VECTOR2I cursorPos = grid.AlignToNearestPad( getViewControls()->GetMousePosition(), pads );
345  getViewControls()->ForceCursorPosition( true, cursorPos );
346 
347  if( evt->IsCancelInteractive() )
348  {
350  commit.Revert();
351 
352  frame()->PopTool( tool );
353  break;
354  }
355  else if( evt->IsActivate() )
356  {
357  commit.Push( _( "Renumber pads" ) );
358 
359  frame()->PopTool( tool );
360  break;
361  }
362  else if( evt->IsDrag( BUT_LEFT ) || evt->IsClick( BUT_LEFT ) )
363  {
364  selectedPads.clear();
365 
366  // Be sure the old cursor mouse position was initialized:
367  if( isFirstPoint )
368  {
369  oldCursorPos = cursorPos;
370  isFirstPoint = false;
371  }
372 
373  // wxWidgets deliver mouse move events not frequently enough, resulting in skipping
374  // pads if the user moves cursor too fast. To solve it, create a line that approximates
375  // the mouse move and search pads that are on the line.
376  int distance = ( cursorPos - oldCursorPos ).EuclideanNorm();
377  // Search will be made every 0.1 mm:
378  int segments = distance / int( 0.1*IU_PER_MM ) + 1;
379  const wxPoint line_step( ( cursorPos - oldCursorPos ) / segments );
380 
381  collector.Empty();
382 
383  for( int j = 0; j < segments; ++j )
384  {
385  wxPoint testpoint( cursorPos.x - j * line_step.x, cursorPos.y - j * line_step.y );
386  collector.Collect( board(), types, testpoint, guide );
387 
388  for( int i = 0; i < collector.GetCount(); ++i )
389  selectedPads.push_back( static_cast<PAD*>( collector[i] ) );
390  }
391 
392  selectedPads.unique();
393 
394  for( PAD* pad : selectedPads )
395  {
396  // If pad was not selected, then enumerate it
397  if( !pad->IsSelected() )
398  {
399  commit.Modify( pad );
400 
401  // Rename pad and store the old name
402  int newval;
403 
404  if( storedPadNumbers.size() > 0 )
405  {
406  newval = storedPadNumbers.front();
407  storedPadNumbers.pop_front();
408  }
409  else
410  newval = seqPadNum++;
411 
412  wxString newNumber = wxString::Format( wxT( "%s%d" ), padPrefix, newval );
413  oldNumbers[newNumber] = { newval, pad->GetNumber() };
414  pad->SetNumber( newNumber );
415  SetLastPadNumber( newNumber );
416  pad->SetSelected();
417  getView()->Update( pad );
418 
419  // Ensure the popup text shows the correct next value
420  if( storedPadNumbers.size() > 0 )
421  newval = storedPadNumbers.front();
422  else
423  newval = seqPadNum;
424 
425  statusPopup.SetText( wxString::Format( msg, padPrefix, newval ) );
426  }
427 
428  // ... or restore the old name if it was enumerated and clicked again
429  else if( pad->IsSelected() && evt->IsClick( BUT_LEFT ) )
430  {
431  auto it = oldNumbers.find( pad->GetNumber() );
432  wxASSERT( it != oldNumbers.end() );
433 
434  if( it != oldNumbers.end() )
435  {
436  storedPadNumbers.push_back( it->second.first );
437  pad->SetNumber( it->second.second );
438  SetLastPadNumber( it->second.second );
439  oldNumbers.erase( it );
440 
441  int newval = storedPadNumbers.front();
442 
443  statusPopup.SetText( wxString::Format( msg, padPrefix, newval ) );
444  }
445 
446  pad->ClearSelected();
447  getView()->Update( pad );
448  }
449  }
450  }
451  else if( ( evt->IsKeyPressed() && evt->KeyCode() == WXK_RETURN ) ||
452  evt->IsDblClick( BUT_LEFT ) )
453  {
454  commit.Push( _( "Renumber pads" ) );
455  frame()->PopTool( tool );
456  break;
457  }
458  else if( evt->IsClick( BUT_RIGHT ) )
459  {
461  }
462  else
463  {
464  evt->SetPassEvent();
465  }
466 
467  // Prepare the next loop by updating the old cursor mouse position
468  // to this last mouse cursor position
469  oldCursorPos = getViewControls()->GetCursorPosition();
470  statusPopup.Move( wxGetMousePosition() + wxPoint( 20, 20 ) );
471  }
472 
473  for( PAD* p : board()->GetFirstFootprint()->Pads() )
474  {
475  p->ClearSelected();
476  getView()->Update( p );
477  }
478 
479  statusPopup.Hide();
481  return 0;
482 }
double EuclideanNorm(const wxPoint &vector)
Euclidean norm of a 2D vector.
Definition: trigo.h:146
void Empty()
Clear the list.
Definition: collector.h:90
static TOOL_ACTION selectionClear
Clear the current selection.
Definition: pcb_actions.h:59
virtual void ShowCursor(bool aEnabled)
Enable or disables display of cursor.
void SetLastPadNumber(const wxString &aPadNumber)
Definition: pad_tool.h:65
TOOL_MENU m_menu
The functions below are not yet implemented - their interface may change.
void SetCurrentCursor(KICURSOR aCursor)
Set the current cursor shape for this panel.
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.
BOARD * board() const
static constexpr double IU_PER_MM
Mock up a conversion function.
void Collect(BOARD_ITEM *aItem, const KICAD_T aScanList[], const wxPoint &aRefPos, const COLLECTORS_GUIDE &aGuide)
Scan a BOARD_ITEM using this class's Inspector method, which does the collection.
Definition: collectors.cpp:571
void SetIgnoreModulesVals(bool ignore)
Definition: collectors.h:547
Extension of STATUS_POPUP for displaying a single line text.
Definition: status_popup.h:79
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
virtual void PushTool(const std::string &actionName)
NB: the definition of "tool" is different at the user level.
void SetIgnoreModulesRefs(bool ignore)
Definition: collectors.h:553
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:143
class PAD, a pad in a footprint
Definition: typeinfo.h:89
search types array terminator (End Of Types)
Definition: typeinfo.h:81
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
PADS & Pads()
Definition: footprint.h:169
PCB_BASE_EDIT_FRAME * frame() const
int GetCount() const
Return the number of objects in the list.
Definition: collector.h:82
GENERAL_COLLECTORS_GUIDE GetCollectorsGuide()
const PCB_SELECTION & selection() const
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
Definition: board.h:318
void SetIgnoreMTextsOnBack(bool ignore)
Definition: collectors.h:505
virtual void PopTool(const std::string &actionName)
void SetIgnoreMTextsOnFront(bool ignore)
Definition: collectors.h:511
Generic, UI-independent tool event.
Definition: tool_event.h:152
#define _(s)
virtual void ForceCursorPosition(bool aEnabled, const VECTOR2D &aPosition=VECTOR2D(0, 0))
Place the cursor immediately at a given point.
static float distance(const SFVEC2UI &a, const SFVEC2UI &b)
void SetIgnoreMTextsMarkedNoShow(bool ignore)
Definition: collectors.h:499
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition: tool_base.cpp:36
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
OPT< std::string > GetCommandStr() const
Definition: tool_event.h:460
Used when the right click button is pressed, or when the select tool is in effect.
Definition: collectors.h:240
MAGNETIC_OPTIONS pads
static bool empty(const wxTextEntryBase *aCtrl)
void Activate()
Run the tool.
KIGFX::VIEW_CONTROLS * getViewControls() const
Return the instance of VIEW_CONTROLS object used in the application.
Definition: tool_base.cpp:42
A general implementation of a COLLECTORS_GUIDE.
Definition: collectors.h:377
Definition: pad.h:57
void ShowContextMenu(SELECTION &aSelection)
Helper function to set and immediately show a CONDITIONAL_MENU in concert with the given SELECTION.
Definition: tool_menu.cpp:59
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:1570
MAGNETIC_OPTIONS tracks

References _, TOOL_INTERACTIVE::Activate(), ARROW, PCB_TOOL_BASE::board(), BULLSEYE, BUT_LEFT, BUT_RIGHT, CAPTURE_ALWAYS, GENERAL_COLLECTOR::Collect(), distance(), empty(), COLLECTOR::Empty(), EOT, EuclideanNorm(), KIGFX::VIEW_CONTROLS::ForceCursorPosition(), Format(), PCB_TOOL_BASE::frame(), PCB_BASE_FRAME::GetCanvas(), PCB_BASE_FRAME::GetCollectorsGuide(), TOOL_EVENT::GetCommandStr(), COLLECTOR::GetCount(), KIGFX::VIEW_CONTROLS::GetCursorPosition(), BOARD::GetFirstFootprint(), DIALOG_ENUM_PADS::GetPrefix(), DIALOG_ENUM_PADS::GetStartNumber(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), MAGNETIC_SETTINGS::graphics, grid, IU_PER_MM, TOOL_INTERACTIVE::m_menu, TOOL_BASE::m_toolMgr, COMMIT::Modify(), STATUS_POPUP::Move(), NO_EFFECT, pad, MAGNETIC_SETTINGS::pads, FOOTPRINT::Pads(), PCB_PAD_T, 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(), 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 623 of file pad_tool.cpp.

624 {
625  PCB_LAYER_ID layer;
626  BOARD_COMMIT commit( frame() );
627 
628  if( aPad->IsOnLayer( F_Cu ) )
629  layer = F_Cu;
630  else if( aPad->IsOnLayer( B_Cu ) )
631  layer = B_Cu;
632  else
633  layer = *aPad->GetLayerSet().UIOrder();
634 
635  if( aPad->GetShape() == PAD_SHAPE::CUSTOM )
636  {
637  commit.Modify( aPad );
638 
639  for( const std::shared_ptr<PCB_SHAPE>& primitive : aPad->GetPrimitives() )
640  {
641  FP_SHAPE* shape = new FP_SHAPE( board()->GetFirstFootprint() );
642 
643  shape->SetShape( primitive->GetShape() );
644  shape->SetFilled( primitive->IsFilled() );
645  shape->SetWidth( primitive->GetWidth() );
646 
647  switch( shape->GetShape() )
648  {
649  case SHAPE_T::SEGMENT:
650  case SHAPE_T::RECT:
651  case SHAPE_T::CIRCLE:
652  shape->SetStart( primitive->GetStart() );
653  shape->SetEnd( primitive->GetEnd() );
654  break;
655 
656  case SHAPE_T::ARC:
657  shape->SetStart( primitive->GetStart() );
658  shape->SetEnd( primitive->GetEnd() );
659  shape->SetCenter( primitive->GetCenter() );
660  break;
661 
662  case SHAPE_T::BEZIER:
663  shape->SetStart( primitive->GetStart() );
664  shape->SetEnd( primitive->GetEnd() );
665  shape->SetBezierC1( primitive->GetBezierC1() );
666  shape->SetBezierC2( primitive->GetBezierC2() );
667  break;
668 
669  case SHAPE_T::POLY:
670  shape->SetPolyShape( primitive->GetPolyShape() );
671  break;
672 
673  default:
675  }
676 
677  shape->SetLocalCoord();
678  shape->Move( aPad->GetPosition() );
679  shape->Rotate( aPad->GetPosition(), aPad->GetOrientation() );
680  shape->SetLayer( layer );
681 
682  commit.Add( shape );
683  }
684 
685  aPad->SetShape( aPad->GetAnchorPadShape() );
686  aPad->DeletePrimitivesList();
687  m_editPad = aPad->m_Uuid;
688  }
689 
690  commit.Push( _("Edit pad shapes") );
692  return layer;
693 }
static TOOL_ACTION selectionClear
Clear the current selection.
Definition: pcb_actions.h:59
BOARD * board() const
void SetFilled(bool aFlag)
Definition: eda_shape.h:92
KIID m_editPad
Definition: pad_tool.h:86
void SetEnd(const wxPoint &aEnd)
Definition: eda_shape.h:135
void DeletePrimitivesList()
Clear the basic shapes list.
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Definition: board_item.h:164
void SetPolyShape(const SHAPE_POLY_SET &aShape)
Definition: eda_shape.h:235
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:143
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
Definition: pad.h:568
void SetBezierC1(const wxPoint &aPt)
Definition: eda_shape.h:153
void SetStart(const wxPoint &aStart)
Definition: eda_shape.h:110
PCB_BASE_EDIT_FRAME * frame() const
double GetOrientation() const
Return the rotation angle of the pad in a variety of units (the basic call returns tenths of degrees)...
Definition: pad.h:349
void Rotate(const wxPoint &aRotCentre, double aAngle) override
Rotate an edge of the footprint.
Definition: fp_shape.cpp:343
#define UNIMPLEMENTED_FOR(type)
Definition: macros.h:120
PAD_SHAPE GetShape() const
Definition: pad.h:170
#define _(s)
void SetWidth(int aWidth)
Definition: eda_shape.h:97
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: pad.h:368
void SetCenter(const wxPoint &aCenter)
Definition: eda_shape.cpp:419
wxString SHAPE_T_asString() const
Definition: eda_shape.cpp:71
const KIID m_Uuid
Definition: eda_item.h:474
wxPoint GetPosition() const override
Definition: pad.h:178
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:65
Definition: layer_ids.h:71
void SetShape(SHAPE_T aShape)
Definition: eda_shape.h:100
void SetBezierC2(const wxPoint &aPt)
Definition: eda_shape.h:156
void SetShape(PAD_SHAPE aShape)
Set the new shape of this pad.
Definition: pad.h:161
void SetLocalCoord()
Set relative coordinates from draw coordinates.
Definition: fp_shape.cpp:52
void Move(const wxPoint &aMoveVector) override
Move an edge of the footprint.
Definition: fp_shape.cpp:355
SHAPE_T GetShape() const
Definition: eda_shape.h:101
LSEQ UIOrder() const
Definition: lset.cpp:904
const std::vector< std::shared_ptr< PCB_SHAPE > > & GetPrimitives() const
Accessor to the basic shape list for custom-shaped pads.
Definition: pad.h:301
PAD_SHAPE GetAnchorPadShape() const
Definition: pad.h:183

References _, COMMIT::Add(), ARC, B_Cu, BEZIER, PCB_TOOL_BASE::board(), CIRCLE, CUSTOM, PAD::DeletePrimitivesList(), 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(), BOARD_ITEM::SetLayer(), FP_SHAPE::SetLocalCoord(), EDA_SHAPE::SetPolyShape(), EDA_SHAPE::SetShape(), PAD::SetShape(), EDA_SHAPE::SetStart(), EDA_SHAPE::SetWidth(), 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 160 of file pcb_tool_base.h.

161  {
162  return getEditFrame<PCB_BASE_EDIT_FRAME>();
163  }

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(), BOARD_INSPECTION_TOOL::CrossProbePcbToSch(), ROUTER_TOOL::CustomTrackWidthDialog(), FOOTPRINT_EDITOR_CONTROL::DeleteFootprint(), PCB_TOOL_BASE::displayOptions(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), ROUTER_TOOL::DpDimensionsDialog(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), DRAWING_TOOL::DrawVia(), DRAWING_TOOL::DrawZone(), EditPad(), EnumeratePads(), explodePad(), BOARD_EDITOR_CONTROL::ExportSpecctraDSN(), ZONE_FILLER_TOOL::FillAllZones(), EDIT_TOOL::FilletTracks(), PCB_SELECTION_TOOL::FilterCollectorForFreePads(), ROUTER_TOOL::finishInteractive(), EDIT_TOOL::Flip(), PCB_CONTROL::FlipPcbView(), GLOBAL_EDIT_TOOL::GlobalDeletions(), ROUTER_TOOL::handleLayerSwitch(), BOARD_INSPECTION_TOOL::HighlightItem(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), BOARD_EDITOR_CONTROL::ImportSpecctraSession(), ROUTER_TOOL::Init(), SCRIPTING_TOOL::Init(), PCB_SELECTION_TOOL::Init(), EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::InteractivePlaceWithPreview(), PCB_TOOL_BASE::Is45Limited(), PCB_PICKER_TOOL::Main(), PCB_SELECTION_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::meanderSettingsDialog(), EDIT_TOOL::MoveExact(), PCB_POINT_EDITOR::OnSelectionChange(), PCB_CONTROL::Paste(), pastePadProperties(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), GROUP_TOOL::PickNewMember(), PCB_CONTROL::placeBoardItems(), BOARD_EDITOR_CONTROL::PlaceFootprint(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), ROUTER_TOOL::prepareInteractive(), pushPadSettings(), recombinePad(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), SCRIPTING_TOOL::reloadPlugins(), EDIT_TOOL::Remove(), PCB_POINT_EDITOR::removeCorner(), PCB_SELECTION_TOOL::RequestSelection(), Reset(), PNS::TOOL_BASE::Reset(), EDIT_TOOL::Rotate(), 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(), PCB_CONTROL::unfilledZoneCheck(), ROUTER_TOOL::UpdateMessagePanel(), EDIT_TOOL::updateModificationPoint(), BOARD_EDITOR_CONTROL::UpdateSchematicFromPCB(), ZONE_FILLER_TOOL::ZoneFill(), and ZONE_FILLER_TOOL::ZoneFillAll().

◆ getEditFrame()

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

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

Definition at line 184 of file tool_base.h.

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

References TOOL_BASE::getToolHolderInt().

Referenced by ZONE_CREATE_HELPER::createNewZone().

◆ 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 120 of file tool_base.h.

121  {
122  return m_toolId;
123  }
TOOL_ID m_toolId
Name of the tool.
Definition: tool_base.h:209

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 64 of file pad_tool.h.

64 { return m_lastPadNumber; }
wxString m_lastPadNumber
Definition: pad_tool.h:83

References m_lastPadNumber.

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

◆ GetManager()

TOOL_MANAGER* TOOL_BASE::GetManager ( ) const
inlineinherited

Return the instance of TOOL_MANAGER that takes care of the tool.

Returns
Instance of the TOOL_MANAGER or NULL if there is no associated tool manager.

Definition at line 143 of file tool_base.h.

144  {
145  return m_toolMgr;
146  }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214

References TOOL_BASE::m_toolMgr.

Referenced by BOARD_COMMIT::BOARD_COMMIT(), ZONE_CREATE_HELPER::commitZone(), ZONE_CREATE_HELPER::createNewZone(), PCB_TOOL_BASE::doInteractiveItemPlacement(), ACTION_MENU::getToolManager(), LIB_TREE::onContextMenu(), ZONE_CREATE_HELPER::OnFirstPoint(), ACTION_MENU::OnMenuEvent(), and ZONE_CREATE_HELPER::performZoneCutout().

◆ 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 196 of file tool_base.h.

References TOOL_BASE::getModelInt().

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

◆ 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 133 of file tool_base.h.

134  {
135  return m_toolName;
136  }
std::string m_toolName
Definition: tool_base.h:213

References TOOL_BASE::m_toolName.

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

◆ GetToolMenu()

◆ GetType()

TOOL_TYPE TOOL_BASE::GetType ( ) const
inlineinherited

Return the type of the tool.

Returns
The type of the tool.

Definition at line 108 of file tool_base.h.

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

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:283
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214

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(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCB_CONTROL::DeleteItemCursor(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), PL_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), PCB_SELECTION_TOOL::doSelectionMenu(), COMMON_TOOLS::doZoomFit(), COMMON_TOOLS::doZoomInOut(), COMMON_TOOLS::doZoomToPreset(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), PL_DRAWING_TOOLS::DrawShape(), DRAWING_TOOL::DrawZone(), BOARD_EDITOR_CONTROL::DrillOrigin(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), EnumeratePads(), SCH_EDITOR_CONTROL::FindSymbolAndItem(), EE_SELECTION_TOOL::GetNode(), ROUTER_TOOL::getStartLayer(), PCB_CONTROL::GridResetOrigin(), PCB_CONTROL::GridSetOrigin(), ROUTER_TOOL::handleCommonEvents(), PL_SELECTION_TOOL::highlight(), EE_SELECTION_TOOL::highlight(), PCB_SELECTION_TOOL::highlight(), GERBVIEW_CONTROL::HighlightControl(), PNS::TOOL_BASE::highlightNet(), BOARD_INSPECTION_TOOL::highlightNet(), PCB_SELECTION_TOOL::hitTestDistance(), SCH_EDIT_TOOL::Init(), EDIT_TOOL::Init(), ROUTER_TOOL::InlineDrag(), PCB_PICKER_TOOL::Main(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), SCH_MOVE_TOOL::Main(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), PL_EDIT_TOOL::moveItem(), SCH_MOVE_TOOL::moveItem(), COMMON_TOOLS::OnGridChanged(), PCB_POINT_EDITOR::OnSelectionChange(), COMMON_TOOLS::PanControl(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), PL_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), ROUTER_TOOL::performRouting(), PNS::TOOL_BASE::pickSingleItem(), BOARD_EDITOR_CONTROL::PlaceFootprint(), PL_DRAWING_TOOLS::PlaceItem(), BOARD_EDITOR_CONTROL::PlaceTarget(), ROUTER_TOOL::prepareInteractive(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), EDIT_TOOL::Remove(), BOARD_EDITOR_CONTROL::Reset(), PNS::TOOL_BASE::Reset(), PCB_CONTROL::Reset(), GERBVIEW_SELECTION_TOOL::Reset(), DRAWING_TOOL::Reset(), EE_SELECTION_TOOL::Reset(), PCB_SELECTION_TOOL::Reset(), EE_TOOL_BASE< SCH_BASE_FRAME >::Reset(), SCH_EDIT_TOOL::Rotate(), GERBVIEW_SELECTION_TOOL::select(), GERBVIEW_SELECTION_TOOL::selectable(), PCB_SELECTION_TOOL::Selectable(), PCB_SELECTION_TOOL::SelectAll(), EE_SELECTION_TOOL::SelectAll(), PL_SELECTION_TOOL::selectionContains(), EE_SELECTION_TOOL::selectionContains(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), PL_SELECTION_TOOL::SelectPoint(), ZOOM_TOOL::selectRegion(), GERBVIEW_SELECTION_TOOL::selectVisually(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_EDITOR_CONTROL::ToggleHiddenFields(), SCH_EDITOR_CONTROL::ToggleHiddenPins(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), PL_SELECTION_TOOL::unhighlight(), EE_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_EDITOR_CONTROL::UpdateFind(), PL_POINT_EDITOR::updateItem(), PCB_POINT_EDITOR::updateItem(), EE_TOOL_BASE< SCH_BASE_FRAME >::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_VIEWER_TOOLS::view(), PCB_TOOL_BASE::view(), 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 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
KIGFX::VIEW_CONTROLS * GetViewControls() const
Definition: tool_manager.h:285

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

Referenced by EE_POINT_EDITOR::addCorner(), PCB_POINT_EDITOR::addCorner(), EE_POINT_EDITOR::addCornerCondition(), SCH_EDITOR_CONTROL::AssignNetclass(), SCH_EDIT_TOOL::BreakWire(), PCB_TOOL_BASE::controls(), EDIT_TOOL::copyToClipboard(), SCH_DRAWING_TOOLS::createSheetPin(), COMMON_TOOLS::CursorControl(), 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(), 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_DRAWING_TOOLS::GetCanvasFreeAreaPixels(), BOARD_INSPECTION_TOOL::HighlightNet(), SCH_EDITOR_CONTROL::HighlightNet(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), SCH_EDIT_TOOL::Init(), EDIT_TOOL::Init(), PCB_PICKER_TOOL::Main(), EE_POINT_EDITOR::Main(), PL_EDIT_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PL_POINT_EDITOR::Main(), SCH_MOVE_TOOL::Main(), EE_SELECTION_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), COMMON_TOOLS::OnGridChanged(), PCB_POINT_EDITOR::OnSelectionChange(), 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(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), BOARD_EDITOR_CONTROL::PlaceTarget(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), EDIT_TOOL::Remove(), SCH_EDIT_TOOL::RepeatDrawItem(), PL_SELECTION_TOOL::RequestSelection(), EE_SELECTION_TOOL::RequestSelection(), PCB_POINT_EDITOR::Reset(), DRAWING_TOOL::Reset(), COMMON_TOOLS::ResetLocalCoords(), GERBVIEW_SELECTION_TOOL::selectCursor(), PCB_SELECTION_TOOL::selectCursor(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::SelectNode(), ZOOM_TOOL::selectRegion(), ALIGN_DISTRIBUTE_TOOL::selectTarget(), PCB_PICKER_TOOL::setControls(), PICKER_TOOL::setControls(), PL_POINT_EDITOR::setEditedPoint(), EE_POINT_EDITOR::setEditedPoint(), PCB_POINT_EDITOR::setEditedPoint(), SCH_DRAWING_TOOLS::SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_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 }
std::function< int(const TOOL_EVENT &)> TOOL_STATE_FUNC
Definition: tool_base.h:58
void goInternal(TOOL_STATE_FUNC &aState, const TOOL_EVENT_LIST &aConditions)

References TOOL_INTERACTIVE::goInternal().

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

◆ 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 77 of file pad_tool.cpp.

78 {
80 
81  if( selTool )
82  {
83  // Add context menu entries that are displayed when selection tool is active
84  CONDITIONAL_MENU& menu = selTool->GetToolMenu().GetMenu();
85 
89 
90  auto explodeCondition =
91  [&]( const SELECTION& aSel )
92  {
93  return m_editPad == niluuid && aSel.Size() == 1 && aSel[0]->Type() == PCB_PAD_T;
94  };
95 
96  auto recombineCondition =
97  [&]( const SELECTION& aSel )
98  {
99  return m_editPad != niluuid;
100  };
101 
102  menu.AddSeparator( 400 );
103 
104  if( m_isFootprintEditor )
105  {
107  menu.AddItem( PCB_ACTIONS::recombinePad, recombineCondition, 400 );
108  menu.AddItem( PCB_ACTIONS::explodePad, explodeCondition, 400 );
109  }
110 
111  menu.AddItem( PCB_ACTIONS::copyPadSettings, singlePadSel, 400 );
112  menu.AddItem( PCB_ACTIONS::applyPadSettings, padSel, 400 );
113  menu.AddItem( PCB_ACTIONS::pushPadSettings, singlePadSel, 400 );
114  }
115 
116  auto& ctxMenu = m_menu.GetMenu();
117 
118  // cancel current tool goes in main context menu at the top if present
120  ctxMenu.AddSeparator( 1 );
121 
127 
128  // Finally, add the standard zoom/grid items
129  getEditFrame<PCB_BASE_FRAME>()->AddStandardSubMenus( m_menu );
130 
131  return true;
132 }
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
TOOL_MENU m_menu
The functions below are not yet implemented - their interface may change.
static TOOL_ACTION explodePad
Definition: pcb_actions.h:383
KIID niluuid(0)
KIID m_editPad
Definition: pad_tool.h:86
CONDITIONAL_MENU & GetMenu()
Definition: tool_menu.cpp:46
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
static TOOL_ACTION enumeratePads
Tool for quick pad enumeration.
Definition: pcb_actions.h:387
static TOOL_ACTION cancelInteractive
Definition: actions.h:62
static TOOL_ACTION properties
Activation of the edit tool.
Definition: pcb_actions.h:117
TOOL_MENU & GetToolMenu()
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 TOOL_ACTION mirror
Mirroring of selected items.
Definition: pcb_actions.h:108
class PAD, a pad in a footprint
Definition: typeinfo.h:89
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 TOOL_ACTION pushPadSettings
Copy the current pad's settings to other pads in the footprint or on the board.
Definition: pcb_actions.h:407
static TOOL_ACTION rotateCw
Rotation of selected objects.
Definition: pcb_actions.h:101
static TOOL_ACTION copyPadSettings
Copy the selected pad's settings to the board design settings.
Definition: pcb_actions.h:401
static TOOL_ACTION applyPadSettings
Copy the default pad settings to the selected pad.
Definition: pcb_actions.h:404
static TOOL_ACTION recombinePad
Definition: pcb_actions.h:384
std::function< bool(const SELECTION &)> SELECTION_CONDITION
< Functor type that checks a specific condition for selected items.
bool m_isFootprintEditor
void AddSeparator(int aOrder=ANY_ORDER)
Add a separator to the menu.
static TOOL_ACTION rotateCcw
Definition: pcb_actions.h:102
static TOOL_ACTION flip
Flipping of selected objects.
Definition: pcb_actions.h:105
static SELECTION_CONDITION OnlyType(KICAD_T aType)
Create a functor that tests if the selected items are only of given type.
The selection tool: currently supports:
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.

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::mirror, niluuid, SELECTION_CONDITIONS::OnlyType(), 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 62 of file pad_tool.h.

62 { return m_editPad != niluuid; }
KIID niluuid(0)
KIID m_editPad
Definition: pad_tool.h:86

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 323 of file pcb_tool_base.cpp.

324 {
325  if( frame()->IsType( FRAME_PCB_EDITOR ) )
327  else
329 }
PCB_BASE_EDIT_FRAME * frame() const
PCBNEW_SETTINGS & Settings()

References PCB_TOOL_BASE::frame(), FRAME_PCB_EDITOR, PCBNEW_SETTINGS::m_FpeditUse45DegreeLimit, PCBNEW_SETTINGS::m_PcbUse45DegreeLimit, and PCB_BASE_FRAME::Settings().

Referenced by DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), and DRAWING_TOOL::DrawZone().

◆ IsFootprintEditor()

◆ IsToolActive()

bool TOOL_BASE::IsToolActive ( ) const
inherited

Definition at line 31 of file tool_base.cpp.

32 {
33  return m_toolMgr->IsToolActive( m_toolId );
34 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
TOOL_ID m_toolId
Name of the tool.
Definition: tool_base.h:209
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(), EDIT_TOOL::isRouterActive(), 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 135 of file pad_tool.cpp.

136 {
138  const PCB_SELECTION& selection = selTool->GetSelection();
139  const PAD* masterPad = frame()->GetDesignSettings().m_Pad_Master.get();
140 
141  BOARD_COMMIT commit( frame() );
142 
143  // for every selected pad, paste global settings
144  for( EDA_ITEM* item : selection )
145  {
146  if( item->Type() == PCB_PAD_T )
147  {
148  commit.Modify( item );
149  static_cast<PAD&>( *item ).ImportSettingsFrom( *masterPad );
150  }
151  }
152 
153  commit.Push( _( "Paste Pad Properties" ) );
154 
156  frame()->Refresh();
157 
158  return 0;
159 }
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Returns the BOARD_DESIGN_SETTINGS for the open project.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
class PAD, a pad in a footprint
Definition: typeinfo.h:89
std::unique_ptr< PAD > m_Pad_Master
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
Definition: actions.h:205
PCB_BASE_EDIT_FRAME * frame() const
PCB_SELECTION & GetSelection()
Return the set of currently selected items.
const PCB_SELECTION & selection() const
bool ProcessEvent(const TOOL_EVENT &aEvent)
Propagate an event to tools that requested events of matching type(s).
#define _(s)
The selection tool: currently supports:
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:99
Definition: pad.h:57

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, 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 485 of file pad_tool.cpp.

486 {
487  if( !board()->GetFirstFootprint() )
488  return 0;
489 
490  struct PAD_PLACER : public INTERACTIVE_PLACER_BASE
491  {
492  PAD_PLACER( PAD_TOOL* aPadTool )
493  {
494  m_padTool = aPadTool;
495  }
496 
497  virtual ~PAD_PLACER()
498  {
499  }
500 
501  std::unique_ptr<BOARD_ITEM> CreateItem() override
502  {
503  PAD* pad = new PAD( m_board->GetFirstFootprint() );
504  PAD* master = m_frame->GetDesignSettings().m_Pad_Master.get();
505 
506  pad->ImportSettingsFrom( *master );
507 
508  // If the footprint type and master pad type directly conflict then make some
509  // adjustments. Otherwise assume the user set what they wanted.
510  if( ( m_board->GetFirstFootprint()->GetAttributes() & FP_SMD )
511  && master->GetAttribute() == PAD_ATTRIB::PTH )
512  {
513  pad->SetAttribute( PAD_ATTRIB::SMD );
514  pad->SetShape( PAD_SHAPE::ROUNDRECT );
515  pad->SetSizeX( 1.5 * pad->GetSizeY() );
516  pad->SetLayerSet( PAD::SMDMask() );
517  }
518  else if( ( m_board->GetFirstFootprint()->GetAttributes() & FP_THROUGH_HOLE )
519  && master->GetAttribute() == PAD_ATTRIB::SMD )
520  {
521  pad->SetAttribute( PAD_ATTRIB::PTH );
522  pad->SetShape( PAD_SHAPE::CIRCLE );
523  pad->SetSize( wxSize( pad->GetSizeX(), pad->GetSizeX() ) );
524  pad->SetLayerSet( PAD::PTHMask() );
525  }
526 
527  if( pad->CanHaveNumber() )
528  {
529  wxString padNumber = m_padTool->GetLastPadNumber();
530  padNumber = m_board->GetFirstFootprint()->GetNextPadNumber( padNumber );
531  pad->SetNumber( padNumber );
532  m_padTool->SetLastPadNumber( padNumber );
533  }
534 
535  return std::unique_ptr<BOARD_ITEM>( pad );
536  }
537 
538  bool PlaceItem( BOARD_ITEM *aItem, BOARD_COMMIT& aCommit ) override
539  {
540  PAD* pad = dynamic_cast<PAD*>( aItem );
541 
542  if( pad )
543  {
544  m_frame->GetDesignSettings().m_Pad_Master->ImportSettingsFrom( *pad );
545  pad->SetLocalCoord();
546  aCommit.Add( aItem );
547  return true;
548  }
549 
550  return false;
551  }
552 
553  PAD_TOOL* m_padTool;
554  };
555 
556  PAD_PLACER placer( this );
557 
558  doInteractiveItemPlacement( aEvent.GetCommandStr().get(), &placer, _( "Place pad" ),
560 
561  return 0;
562 }
Handle flip action in the loop by calling the item's flip method.
BOARD * board() const
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:49
COMMIT & Add(EDA_ITEM *aItem)
Notify observers that aItem has been added.
Definition: commit.h:78
Smd pad, appears on the solder paste layer (default)
Tool relating to pads and pad settings.
Definition: pad_tool.h:35
Plated through hole pad.
Allow repeat placement of the item.
static LSET PTHMask()
layer set for a through hole pad
Definition: pad.cpp:159
#define _(s)
Create an item immediately on placement starting, otherwise show the pencil cursor until the item is ...
OPT< std::string > GetCommandStr() const
Definition: tool_event.h:460
Handle the rotate action in the loop by calling the item's rotate method.
void doInteractiveItemPlacement(const std::string &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...
Definition: pad.h:57
static LSET SMDMask()
layer set for a SMD pad on Front layer
Definition: pad.cpp:166

References _, COMMIT::Add(), PCB_TOOL_BASE::board(), CIRCLE, PCB_TOOL_BASE::doInteractiveItemPlacement(), FP_SMD, FP_THROUGH_HOLE, TOOL_EVENT::GetCommandStr(), 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 234 of file pad_tool.cpp.

235 {
237  const PCB_SELECTION& selection = selTool->GetSelection();
238  PAD* srcPad;
239 
240  if( selection.Size() == 1 && selection[0]->Type() == PCB_PAD_T )
241  srcPad = static_cast<PAD*>( selection[0] );
242  else
243  return 0;
244 
245  FOOTPRINT* footprint = srcPad->GetParent();
246 
247  if( !footprint )
248  return 0;
249 
251 
253  int dialogRet = dlg.ShowModal();
254 
255  if( dialogRet == wxID_CANCEL )
256  return 0;
257 
258  const bool edit_Same_Modules = (dialogRet == 1);
259 
260  BOARD_COMMIT commit( frame() );
261 
262  doPushPadProperties( *getModel<BOARD>(), *srcPad, commit, edit_Same_Modules,
267 
268  commit.Push( _( "Push Pad Settings" ) );
269 
271  frame()->Refresh();
272 
273  return 0;
274 }
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:183
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
class PAD, a pad in a footprint
Definition: typeinfo.h:89
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
Definition: actions.h:205
PCB_BASE_EDIT_FRAME * frame() const
PCB_SELECTION & GetSelection()
Return the set of currently selected items.
const PCB_SELECTION & selection() const
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
bool ProcessEvent(const TOOL_EVENT &aEvent)
Propagate an event to tools that requested events of matching type(s).
FOOTPRINT * footprint() const
#define _(s)
FOOTPRINT * GetParent() const
Definition: pad.cpp:1439
int Size() const
Returns the number of selected parts.
Definition: selection.h:104
The selection tool: currently supports:
Definition: pad.h:57

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

void PAD_TOOL::recombinePad ( PAD aPad)
private

Definition at line 696 of file pad_tool.cpp.

697 {
698  int maxError = board()->GetDesignSettings().m_MaxError;
699 
700  // Don't leave an object in the point editor that might no longer exist after
701  // recombining the pad.
703 
704  auto findNext =
705  [&]( PCB_LAYER_ID aLayer ) -> FP_SHAPE*
706  {
707  SHAPE_POLY_SET padPoly;
708  aPad->TransformShapeWithClearanceToPolygon( padPoly, aLayer, 0, maxError,
709  ERROR_INSIDE );
710 
711  for( BOARD_ITEM* item : board()->GetFirstFootprint()->GraphicalItems() )
712  {
713  PCB_SHAPE* shape = dynamic_cast<PCB_SHAPE*>( item );
714 
715  if( !shape || ( shape->GetEditFlags() & STRUCT_DELETED ) )
716  continue;
717 
718  if( shape->GetLayer() != aLayer )
719  continue;
720 
721  SHAPE_POLY_SET drawPoly;
722  shape->TransformShapeWithClearanceToPolygon( drawPoly, aLayer, 0, maxError,
723  ERROR_INSIDE );
724  drawPoly.BooleanIntersection( padPoly, SHAPE_POLY_SET::PM_FAST );
725 
726  if( !drawPoly.IsEmpty() )
727  return (FP_SHAPE*) item;
728  }
729 
730  return nullptr;
731  };
732 
733  BOARD_COMMIT commit( frame() );
734  PCB_LAYER_ID layer;
735 
736  if( aPad->IsOnLayer( F_Cu ) )
737  layer = F_Cu;
738  else if( aPad->IsOnLayer( B_Cu ) )
739  layer = B_Cu;
740  else
741  layer = *aPad->GetLayerSet().UIOrder();
742 
743  while( FP_SHAPE* fpShape = findNext( layer ) )
744  {
745  commit.Modify( aPad );
746 
747  // We've found an intersecting item. First convert the pad to a custom-shape
748  // pad (if it isn't already)
749  //
750  if( aPad->GetShape() == PAD_SHAPE::RECT || aPad->GetShape() == PAD_SHAPE::CIRCLE )
751  {
752  aPad->SetAnchorPadShape( aPad->GetShape() );
753  }
754  else if( aPad->GetShape() != PAD_SHAPE::CUSTOM )
755  {
756  // Create a new minimally-sized circular anchor and convert existing pad
757  // to a polygon primitive
758  SHAPE_POLY_SET existingOutline;
759  aPad->TransformShapeWithClearanceToPolygon( existingOutline, layer, 0, maxError,
760  ERROR_INSIDE );
761 
763  if( aPad->GetSizeX() > aPad->GetSizeY() )
764  aPad->SetSizeX( aPad->GetSizeY() );
765 
766  aPad->SetOffset( wxPoint( 0, 0 ) );
767 
768  PCB_SHAPE* shape = new PCB_SHAPE( nullptr, SHAPE_T::POLY );
769  shape->SetFilled( true );
770  shape->SetWidth( 0 );
771  shape->SetPolyShape( existingOutline );
772  shape->Move( - aPad->GetPosition() );
773  shape->Rotate( wxPoint( 0, 0 ), - aPad->GetOrientation() );
774 
775  aPad->AddPrimitive( shape );
776  }
777 
778  aPad->SetShape( PAD_SHAPE::CUSTOM );
779 
780  // Now add the new shape to the primitives list
781  //
782  PCB_SHAPE* pcbShape = new PCB_SHAPE;
783 
784  pcbShape->SetShape( fpShape->GetShape() );
785  pcbShape->SetFilled( fpShape->IsFilled() );
786  pcbShape->SetWidth( fpShape->GetWidth() );
787 
788 
789  switch( pcbShape->GetShape() )
790  {
791  case SHAPE_T::SEGMENT:
792  case SHAPE_T::RECT:
793  case SHAPE_T::CIRCLE:
794  pcbShape->SetStart( fpShape->GetStart() );
795  pcbShape->SetEnd( fpShape->GetEnd() );
796  break;
797 
798  case SHAPE_T::ARC:
799  pcbShape->SetStart( fpShape->GetStart() );
800  pcbShape->SetEnd( fpShape->GetEnd() );
801  pcbShape->SetCenter( fpShape->GetCenter() );
802  break;
803 
804  case SHAPE_T::BEZIER:
805  pcbShape->SetStart( fpShape->GetStart() );
806  pcbShape->SetEnd( fpShape->GetEnd() );
807  pcbShape->SetBezierC1( fpShape->GetBezierC1() );
808  pcbShape->SetBezierC2( fpShape->GetBezierC2() );
809  break;
810 
811  case SHAPE_T::POLY:
812  pcbShape->SetPolyShape( fpShape->GetPolyShape() );
813  break;
814 
815  default:
816  UNIMPLEMENTED_FOR( pcbShape->SHAPE_T_asString() );
817  }
818 
819  pcbShape->Move( - aPad->GetPosition() );
820  pcbShape->Rotate( wxPoint( 0, 0 ), - aPad->GetOrientation() );
821  aPad->AddPrimitive( pcbShape );
822 
823  fpShape->SetFlags( STRUCT_DELETED );
824  commit.Remove( fpShape );
825  }
826 
827  commit.Push( _( "Recombine pads" ) );
828 }
static TOOL_ACTION selectionClear
Clear the current selection.
Definition: pcb_actions.h:59
void SetOffset(const wxPoint &aOffset)
Definition: pad.h:249
const int GetSizeY() const
Definition: pad.h:237
static PCB_SHAPE * findNext(PCB_SHAPE *aShape, const wxPoint &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.
BOARD * board() const
void SetFilled(bool aFlag)
Definition: eda_shape.h:92
void SetEnd(const wxPoint &aEnd)
Definition: eda_shape.h:135
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:49
void SetPolyShape(const SHAPE_POLY_SET &aShape)
Definition: eda_shape.h:235
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
bool IsEmpty() const
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:143
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
Definition: pad.h:568
void SetSizeX(const int aX)
Definition: pad.h:234
virtual void Rotate(const wxPoint &aRotCentre, double aAngle) override
Rotate this object.
Definition: pcb_shape.cpp:109
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:590
void SetBezierC1(const wxPoint &aPt)
Definition: eda_shape.h:153
void SetStart(const wxPoint &aStart)
Definition: eda_shape.h:110
PCB_BASE_EDIT_FRAME * frame() const
virtual void Move(const wxPoint &aMoveVector) override
Move this object.
Definition: pcb_shape.cpp:97
double GetOrientation() const
Return the rotation angle of the pad in a variety of units (the basic call returns tenths of degrees)...
Definition: pad.h:349
Represent a set of closed polygons.
#define UNIMPLEMENTED_FOR(type)
Definition: macros.h:120
PAD_SHAPE GetShape() const
Definition: pad.h:170
#define STRUCT_DELETED
flag indication structures to be erased
#define _(s)
void SetWidth(int aWidth)
Definition: eda_shape.h:97
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: pad.h:368
EDA_ITEM_FLAGS GetEditFlags() const
Definition: eda_item.h:157
void SetCenter(const wxPoint &aCenter)
Definition: eda_shape.cpp:419
wxString SHAPE_T_asString() const
Definition: eda_shape.cpp:71
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,...
void TransformShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, PCB_LAYER_ID aLayer, int aClearanceValue, int aMaxError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Convert the pad shape to a closed polygon.
Definition: pad.cpp:1554
wxPoint GetPosition() const override
Definition: pad.h:178
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:65
Definition: layer_ids.h:71
void SetShape(SHAPE_T aShape)
Definition: eda_shape.h:100
const int GetSizeX() const
Definition: pad.h:235
void AddPrimitive(PCB_SHAPE *aPrimitive)
Add item to the custom shape primitives list.
void SetBezierC2(const wxPoint &aPt)
Definition: eda_shape.h:156
void SetShape(PAD_SHAPE aShape)
Set the new shape of this pad.
Definition: pad.h:161
SHAPE_T GetShape() const
Definition: eda_shape.h:101
void TransformShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, PCB_LAYER_ID aLayer, int aClearanceValue, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Convert the shape to a closed polygon.
Definition: pcb_shape.cpp:236
LSEQ UIOrder() const
Definition: lset.cpp:904
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:143
void SetAnchorPadShape(PAD_SHAPE aShape)
Set the shape of the anchor pad for custom shaped pads.
Definition: pad.h:209

References _, PAD::AddPrimitive(), ARC, B_Cu, BEZIER, PCB_TOOL_BASE::board(), SHAPE_POLY_SET::BooleanIntersection(), CIRCLE, CUSTOM, ERROR_INSIDE, F_Cu, findNext(), PCB_TOOL_BASE::frame(), BOARD::GetDesignSettings(), EDA_ITEM::GetEditFlags(), BOARD_ITEM::GetLayer(), PAD::GetLayerSet(), PAD::GetOrientation(), PAD::GetPosition(), EDA_SHAPE::GetShape(), PAD::GetShape(), PAD::GetSizeX(), PAD::GetSizeY(), 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, BOARD_COMMIT::Push(), 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(), PAD::SetOffset(), EDA_SHAPE::SetPolyShape(), EDA_SHAPE::SetShape(), PAD::SetShape(), PAD::SetSizeX(), EDA_SHAPE::SetStart(), EDA_SHAPE::SetWidth(), EDA_SHAPE::SHAPE_T_asString(), STRUCT_DELETED, PCB_SHAPE::TransformShapeWithClearanceToPolygon(), PAD::TransformShapeWithClearanceToPolygon(), LSET::UIOrder(), and UNIMPLEMENTED_FOR.

Referenced by EditPad().

◆ Reset()

void PAD_TOOL::Reset ( RESET_REASON  aReason)
overridevirtual

Basic initialization.

Reimplemented from PCB_TOOL_BASE.

Definition at line 57 of file pad_tool.cpp.

58 {
59  if( aReason == MODEL_RELOAD )
60  m_lastPadNumber = wxT( "1" );
61 
62  if( m_editPad != niluuid )
63  {
65  bool highContrast = ( opts.m_ContrastModeDisplay != HIGH_CONTRAST_MODE::NORMAL );
66 
67  if( m_wasHighContrast != highContrast )
69 
70  frame()->GetInfoBar()->Dismiss();
71  }
72 
74 }
KIID niluuid(0)
KIID m_editPad
Definition: pad_tool.h:86
Model changes (required full reload)
Definition: tool_base.h:80
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:143
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
PCB_BASE_EDIT_FRAME * frame() const
Container for display options like enable/disable some optional drawings.
void Dismiss() override
Dismisses the infobar and updates the containing layout and AUI manager (if one is provided).
Definition: infobar.cpp:175
bool m_wasHighContrast
Definition: pad_tool.h:85
wxString m_lastPadNumber
Definition: pad_tool.h:83
Inactive layers are shown normally (no high-contrast mode)
HIGH_CONTRAST_MODE m_ContrastModeDisplay
How inactive layers are displayed.
WX_INFOBAR * GetInfoBar()
static TOOL_ACTION highContrastMode
Definition: actions.h:103

References WX_INFOBAR::Dismiss(), PCB_TOOL_BASE::frame(), PCB_BASE_FRAME::GetDisplayOptions(), EDA_BASE_FRAME::GetInfoBar(), ACTIONS::highContrastMode, PCB_DISPLAY_OPTIONS::m_ContrastModeDisplay, m_editPad, m_lastPadNumber, TOOL_BASE::m_toolMgr, m_wasHighContrast, TOOL_BASE::MODEL_RELOAD, niluuid, NORMAL, and TOOL_MANAGER::RunAction().

◆ 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 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
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]

const PCB_SELECTION & PCB_TOOL_BASE::selection ( ) const
protectedinherited

Definition at line 307 of file pcb_tool_base.cpp.

308 {
310 
311  return selTool->GetSelection();
312 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
PCB_SELECTION & GetSelection()
Return the set of currently selected items.
The selection tool: currently supports:

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

Referenced by AUTOPLACE_TOOL::autoplaceSelected(), BOARD_INSPECTION_TOOL::calculateSelectionRatsnest(), ROUTER_TOOL::CanInlineDrag(), EDIT_TOOL::ChangeTrackWidth(), copyPadSettings(), EDIT_TOOL::copyToClipboard(), EDIT_TOOL::CreateArray(), DRC_TOOL::CrossProbe(), BOARD_INSPECTION_TOOL::CrossProbePcbToSch(), BOARD_INSPECTION_TOOL::doHideNet(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), EDIT_TOOL::Drag(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), DRAWING_TOOL::DrawZone(), EDIT_TOOL::Duplicate(), BOARD_EDITOR_CONTROL::EditFpInFpEditor(), EditPad(), GROUP_TOOL::EnterGroup(), EnumeratePads(), GLOBAL_EDIT_TOOL::ExchangeFootprints(), EDIT_TOOL::FilletTracks(), PCB_SELECTION_TOOL::filterSelection(), 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(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), EDIT_TOOL::Mirror(), BOARD_EDITOR_CONTROL::modifyLockSelected(), EDIT_TOOL::MoveExact(), PCB_POINT_EDITOR::OnSelectionChange(), pastePadProperties(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), PCB_CONTROL::placeBoardItems(), BOARD_EDITOR_CONTROL::PlaceFootprint(), DRAWING_TOOL::PlaceImportedGraphics(), BOARD_EDITOR_CONTROL::PlaceTarget(), 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(), PCB_SELECTION_TOOL::selectNet(), DRAWING_TOOL::SetAnchor(), BOARD_EDITOR_CONTROL::TrackWidthDec(), BOARD_EDITOR_CONTROL::TrackWidthInc(), GROUP_TOOL::Ungroup(), PCB_CONTROL::UpdateMessagePanel(), BOARD_INSPECTION_TOOL::UpdateSelectionRatsnest(), 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().

◆ selection() [2/2]

PCB_SELECTION & PCB_TOOL_BASE::selection ( )
protectedinherited

Definition at line 315 of file pcb_tool_base.cpp.

316 {
318 
319  return selTool->GetSelection();
320 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
PCB_SELECTION & GetSelection()
Return the set of currently selected items.
The selection tool: currently supports:

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

◆ 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 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
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.

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

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), PCB_SELECTION_TOOL::doSelectionMenu(), TOOL_MENU::ShowContextMenu(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ 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 103 of file pcb_tool_base.h.

103 { m_isFootprintEditor = aEnabled; }
bool m_isFootprintEditor

References PCB_TOOL_BASE::m_isFootprintEditor.

◆ SetLastPadNumber()

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

Definition at line 65 of file pad_tool.h.

65 { m_lastPadNumber = aPadNumber; }
wxString m_lastPadNumber
Definition: pad_tool.h:83

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 831 of file pad_tool.cpp.

832 {
836 
839 
842 }
static TOOL_ACTION explodePad
Definition: pcb_actions.h:383
static TOOL_ACTION enumeratePads
Tool for quick pad enumeration.
Definition: pcb_actions.h:387
static TOOL_ACTION placePad
Activation of the drawing tool (placing a PAD)
Definition: pcb_actions.h:381
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).
static TOOL_ACTION pushPadSettings
Copy the current pad's settings to other pads in the footprint or on the board.
Definition: pcb_actions.h:407
int pushPadSettings(const TOOL_EVENT &aEvent)
Definition: pad_tool.cpp:234
static TOOL_ACTION copyPadSettings
Copy the selected pad's settings to the board design settings.
Definition: pcb_actions.h:401
static TOOL_ACTION applyPadSettings
Copy the default pad settings to the selected pad.
Definition: pcb_actions.h:404
int pastePadProperties(const TOOL_EVENT &aEvent)
Copy pad settings from a pad to the board design settings.
Definition: pad_tool.cpp:135
static TOOL_ACTION recombinePad
Definition: pcb_actions.h:384
int EnumeratePads(const TOOL_EVENT &aEvent)
Tool for quick pad enumeration.
Definition: pad_tool.cpp:277
int EditPad(const TOOL_EVENT &aEvent)
Enter/exit WYSIWYG pad shape editing.
Definition: pad_tool.cpp:565
int PlacePad(const TOOL_EVENT &aEvent)
Place a pad in footprint editor.
Definition: pad_tool.cpp:485
int copyPadSettings(const TOOL_EVENT &aEvent)
Push pad settings from a pad to other pads on board or footprint.
Definition: pad_tool.cpp:162

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_MANAGER * m_toolMgr
Definition: tool_base.h:214
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 GERBVIEW_SELECTION_TOOL::disambiguationMenu(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), PCB_SELECTION_TOOL::doSelectionMenu(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), EnumeratePads(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::InteractivePlaceWithPreview(), ZOOM_TOOL::Main(), PCB_PICKER_TOOL::Main(), EE_POINT_EDITOR::Main(), PL_EDIT_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), CVPCB_CONTROL::Main(), PL_POINT_EDITOR::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PL_SELECTION_TOOL::Main(), EDA_3D_CONTROLLER::Main(), SCH_MOVE_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), PCB_SELECTION_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), PCB_POINT_EDITOR::OnSelectionChange(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), GROUP_TOOL::PickNewMember(), EDIT_TOOL::pickReferencePoint(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), GERBVIEW_SELECTION_TOOL::selectPoint(), PCB_SELECTION_TOOL::selectPoint(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), ZOOM_TOOL::selectRegion(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

Member Data Documentation

◆ m_editPad

KIID PAD_TOOL::m_editPad
private

Definition at line 86 of file pad_tool.h.

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

◆ m_isFootprintEditor

◆ m_lastPadNumber

wxString PAD_TOOL::m_lastPadNumber
private

Definition at line 83 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(), DRAWING_TOOL::drawSegment(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), EnumeratePads(), TOOL_INTERACTIVE::GetToolMenu(), ROUTER_TOOL::Init(), LENGTH_TUNER_TOOL::Init(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Init(), PL_EDIT_TOOL::Init(), SCH_EDIT_TOOL::Init(), Init(), PL_DRAWING_TOOLS::Init(), SYMBOL_EDITOR_DRAWING_TOOLS::Init(), SYMBOL_EDITOR_CONTROL::Init(), PCB_VIEWER_TOOLS::Init(), FOOTPRINT_EDITOR_CONTROL::Init(), PL_SELECTION_TOOL::Init(), SCH_DRAWING_TOOLS::Init(), BOARD_EDITOR_CONTROL::Init(), GERBVIEW_SELECTION_TOOL::Init(), EDA_3D_CONTROLLER::Init(), DRAWING_TOOL::Init(), EE_SELECTION_TOOL::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), PCB_SELECTION_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), PCB_TOOL_BASE::Init(), PICKER_TOOL::Init(), DRAWING_TOOL::InteractivePlaceWithPreview(), PCB_PICKER_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), PL_EDIT_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), EDA_3D_CONTROLLER::Main(), PL_SELECTION_TOOL::Main(), SCH_MOVE_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), PCB_SELECTION_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_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::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and SCH_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 209 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 214 of file tool_base.h.

Referenced by TOOL_INTERACTIVE::Activate(), PL_SELECTION_TOOL::AddItemsToSel(), EE_SELECTION_TOOL::AddItemsToSel(), PL_SELECTION_TOOL::AddItemToSel(), PCB_SELECTION_TOOL::AddItemToSel(), EE_SELECTION_TOOL::AddItemToSel(), SCH_MOVE_TOOL::AlignElements(), SCH_EDITOR_CONTROL::AssignNetclass(), CVPCB_ASSOCIATION_TOOL::Associate(), TOOL_BASE::attachManager(), SCH_EDIT_TOOL::AutoplaceFields(), SCH_EDIT_TOOL::BreakWire(), BOARD_INSPECTION_TOOL::calculateSelectionRatsnest(), ROUTER_TOOL::CanInlineDrag(), SCH_EDIT_TOOL::ChangeTextType(), EDIT_TOOL::ChangeTrackWidth(), SCH_EDIT_TOOL::CleanupSheetPins(), GERBVIEW_CONTROL::ClearAllLayers(), BOARD_INSPECTION_TOOL::ClearHighlight(), SCH_EDITOR_CONTROL::ClearHighlight(), PL_SELECTION_TOOL::ClearSelection(), PCB_SELECTION_TOOL::ClearSelection(), GERBVIEW_SELECTION_TOOL::clearSelection(), EE_SELECTION_TOOL::ClearSelection(), SCH_EDIT_TOOL::ConvertDeMorgan(), PL_EDIT_TOOL::Copy(), SYMBOL_EDITOR_EDIT_TOOL::Copy(), copyPadSettings(), EDIT_TOOL::copyToClipboard(), EDIT_TOOL::CreateArray(), MICROWAVE_TOOL::createInductorBetween(), DRC_TOOL::CrossProbe(), BOARD_INSPECTION_TOOL::CrossProbePcbToSch(), COMMON_TOOLS::CursorControl(), SCH_EDITOR_CONTROL::Cut(), SYMBOL_EDITOR_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCB_CONTROL::DeleteItemCursor(), SCH_EDITOR_CONTROL::doCopy(), SCH_EDITOR_CONTROL::doCrossProbeSchToPcb(), SYMBOL_EDITOR_EDIT_TOOL::DoDelete(), SCH_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), BOARD_INSPECTION_TOOL::doHideNet(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), 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(), DRAWING_TOOL::drawSegment(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::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(), GROUP_TOOL::EnterGroup(), SCH_NAVIGATE_TOOL::EnterSheet(), SCH_EDITOR_CONTROL::EnterSheet(), EnumeratePads(), EE_INSPECTION_TOOL::ExcludeMarker(), 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(), COMMON_TOOLS::GridNext(), COMMON_TOOLS::GridPreset(), COMMON_TOOLS::GridPrev(), PCB_CONTROL::GridSetOrigin(), GROUP_TOOL::Group(), GERBVIEW_CONTROL::HighlightControl(), BOARD_INSPECTION_TOOL::HighlightItem(), BOARD_INSPECTION_TOOL::HighlightNet(), SCH_EDITOR_CONTROL::HighlightNet(), BOARD_INSPECTION_TOOL::highlightNet(), SCH_EDITOR_CONTROL::HighlightNetCursor(), PL_EDIT_TOOL::ImportDrawingSheetContent(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), BOARD_REANNOTATE_TOOL::Init(), SYMBOL_EDITOR_EDIT_TOOL::Init(), PL_EDIT_TOOL::Init(), SCH_EDIT_TOOL::Init(), GROUP_TOOL::Init(), Init(), CONVERT_TOOL::Init(), PL_DRAWING_TOOLS::Init(), SYMBOL_EDITOR_CONTROL::Init(), GLOBAL_EDIT_TOOL::Init(), PL_POINT_EDITOR::Init(), BOARD_INSPECTION_TOOL::Init(), ALIGN_DISTRIBUTE_TOOL::Init(), PCB_POINT_EDITOR::Init(), BOARD_EDITOR_CONTROL::Init(), POSITION_RELATIVE_TOOL::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), EDIT_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(), SCH_NAVIGATE_TOOL::LeaveSheet(), SCH_EDITOR_CONTROL::LeaveSheet(), COMMON_CONTROL::ListHotKeys(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), PCB_PICKER_TOOL::Main(), PL_EDIT_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), CVPCB_CONTROL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PL_SELECTION_TOOL::Main(), EDA_3D_CONTROLLER::Main(), SCH_MOVE_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), PCB_SELECTION_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), PCB_VIEWER_TOOLS::MeasureTool(), SYMBOL_EDITOR_EDIT_TOOL::Mirror(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::Mirror(), BOARD_EDITOR_CONTROL::modifyLockSelected(), EDIT_TOOL::MoveExact(), SYMBOL_EDITOR_CONTROL::OnDeMorgan(), PL_SELECTION_TOOL::onDisambiguationExpire(), EE_SELECTION_TOOL::onDisambiguationExpire(), PCB_SELECTION_TOOL::onDisambiguationExpire(), COMMON_TOOLS::OnGridChanged(), PCB_POINT_EDITOR::OnSelectionChange(), PL_EDIT_TOOL::Paste(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::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::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), PCB_CONTROL::Print(), GERBVIEW_CONTROL::Print(), SYMBOL_EDITOR_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), pushPadSettings(), EE_SELECTION_TOOL::RebuildSelection(), recombinePad(), SYMBOL_EDITOR_EDIT_TOOL::Redo(), SCH_EDITOR_CONTROL::Redo(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), EDIT_TOOL::Remove(), PCB_POINT_EDITOR::removeCorner(), GROUP_TOOL::RemoveFromGroup(), PL_SELECTION_TOOL::RemoveItemFromSel(), EE_SELECTION_TOOL::RemoveItemFromSel(), PCB_SELECTION_TOOL::RemoveItemFromSel(), PL_SELECTION_TOOL::RemoveItemsFromSel(), EE_SELECTION_TOOL::RemoveItemsFromSel(), SCH_EDIT_TOOL::RepeatDrawItem(), SYMBOL_EDITOR_DRAWING_TOOLS::RepeatDrawItem(), EE_SELECTION_TOOL::RequestSelection(), PCB_SELECTION_TOOL::RequestSelection(), Reset(), COMMON_TOOLS::Reset(), PNS::TOOL_BASE::Reset(), EDA_3D_CONTROLLER::Reset(), COMMON_TOOLS::ResetLocalCoords(), TOOL_INTERACTIVE::resetTransitions(), SYMBOL_EDITOR_EDIT_TOOL::Rotate(), SCH_EDIT_TOOL::Rotate(), EDIT_TOOL::Rotate(), TOOL_INTERACTIVE::RunMainStack(), DRC_TOOL::RunTests(), EE_SELECTION_TOOL::Selectable(), EE_SELECTION_TOOL::SelectConnection(), PCB_TOOL_BASE::selection(), COMMON_TOOLS::SelectionTool(), GERBVIEW_SELECTION_TOOL::SelectItem(), GERBVIEW_SELECTION_TOOL::SelectItems(), PCB_SELECTION_TOOL::SelectItems(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectNet(), PL_SELECTION_TOOL::SelectPoint(), GERBVIEW_SELECTION_TOOL::selectPoint(), EE_SELECTION_TOOL::selectPoint(), PCB_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(), EDA_3D_CONTROLLER::ToggleVisibility(), BOARD_EDITOR_CONTROL::TrackWidthDec(), BOARD_EDITOR_CONTROL::TrackWidthInc(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_EDIT_TOOL::Undo(), SCH_EDITOR_CONTROL::Undo(), GROUP_TOOL::Ungroup(), GERBVIEW_SELECTION_TOOL::UnselectItem(), GERBVIEW_SELECTION_TOOL::UnselectItems(), PCB_SELECTION_TOOL::UnselectItems(), PNS::TOOL_BASE::updateEndItem(), EE_INSPECTION_TOOL::UpdateMessagePanel(), GERBVIEW_CONTROL::UpdateMessagePanel(), PL_EDITOR_CONTROL::UpdateMessagePanel(), PCB_CONTROL::UpdateMessagePanel(), EDIT_TOOL::updateModificationPoint(), EE_POINT_EDITOR::updateParentItem(), BOARD_INSPECTION_TOOL::UpdateSelectionRatsnest(), 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 213 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 206 of file tool_base.h.

Referenced by TOOL_BASE::GetType(), and BOARD_COMMIT::Push().

◆ m_wasHighContrast

bool PAD_TOOL::m_wasHighContrast
private

Definition at line 85 of file pad_tool.h.

Referenced by EditPad(), and Reset().


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