KiCad PCB EDA Suite
module_editor_tools.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2014-2015 CERN
5  * @author Maciej Suminski <maciej.suminski@cern.ch>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #include "module_editor_tools.h"
26 #include "kicad_clipboard.h"
27 #include "selection_tool.h"
28 #include "pcb_actions.h"
29 
30 #include <core/optional.h>
31 
32 #include <tool/tool_manager.h>
33 
34 #include <class_draw_panel_gal.h>
35 #include <view/view_controls.h>
36 #include <view/view_group.h>
37 #include <pcb_painter.h>
38 #include <origin_viewitem.h>
39 
40 #include <kicad_plugin.h>
41 #include <pcbnew_id.h>
42 #include <collectors.h>
43 #include <confirm.h>
45 #include <hotkeys.h>
46 #include <bitmaps.h>
47 
48 #include <wxPcbStruct.h>
49 #include <class_board.h>
50 #include <class_module.h>
51 #include <class_edge_mod.h>
52 #include <board_commit.h>
53 
54 #include <tools/tool_event_utils.h>
55 
56 #include <functional>
57 using namespace std::placeholders;
58 #include <wx/defs.h>
59 
60 // Module editor tools
61 TOOL_ACTION PCB_ACTIONS::placePad( "pcbnew.ModuleEditor.placePad",
62  AS_GLOBAL, 0,
63  _( "Add Pad" ), _( "Add a pad" ), NULL, AF_ACTIVATE );
64 
65 TOOL_ACTION PCB_ACTIONS::createPadFromShapes( "pcbnew.ModuleEditor.createPadFromShapes",
66  AS_CONTEXT, 0,
67  _( "Create Pad from Selected Shapes" ),
68  _( "Creates a custom-shaped pads from a set of selected shapes" ),
69  primitives_to_custom_pad_xpm );
70 
71 TOOL_ACTION PCB_ACTIONS::explodePadToShapes( "pcbnew.ModuleEditor.explodePadToShapes",
72  AS_CONTEXT, 0,
73  _( "Explode Selected Pad to Graphical Shapes" ),
74  _( "Converts a custom-shaped pads to a set of graphical shapes" ),
75  custom_pad_to_primitives_xpm );
76 
77 TOOL_ACTION PCB_ACTIONS::enumeratePads( "pcbnew.ModuleEditor.enumeratePads",
78  AS_GLOBAL, 0,
79  _( "Enumerate Pads" ), _( "Enumerate pads" ), pad_enumerate_xpm, AF_ACTIVATE );
80 
81 TOOL_ACTION PCB_ACTIONS::moduleEdgeOutlines( "pcbnew.ModuleEditor.graphicOutlines",
82  AS_GLOBAL, 0,
83  "", "" );
84 
85 TOOL_ACTION PCB_ACTIONS::moduleTextOutlines( "pcbnew.ModuleEditor.textOutlines",
86  AS_GLOBAL, 0,
87  "", "" );
88 
89 
91  PCB_TOOL( "pcbnew.ModuleEditor" )
92 {
93 }
94 
95 
97 {
98 }
99 
100 
102 {
103 }
104 
105 
106 
108 {
109  struct PAD_PLACER : public INTERACTIVE_PLACER_BASE
110  {
111  std::unique_ptr<BOARD_ITEM> CreateItem() override
112  {
113  D_PAD* pad = new D_PAD ( m_board->m_Modules );
114  m_frame->Import_Pad_Settings( pad, false ); // use the global settings for pad
115  pad->IncrementPadName( true, true );
116  return std::unique_ptr<BOARD_ITEM>( pad );
117  }
118  };
119 
120  PAD_PLACER placer;
121 
122  frame()->SetToolID( ID_MODEDIT_PAD_TOOL, wxCURSOR_PENCIL, _( "Add pads" ) );
123 
124  assert( board()->m_Modules );
125 
127 
129 
130  return 0;
131 }
132 
133 
135 {
136  if( !board()->m_Modules || !board()->m_Modules->PadsList() )
137  return 0;
138 
139  DIALOG_ENUM_PADS settingsDlg( frame() );
140 
141  if( settingsDlg.ShowModal() != wxID_OK )
142  return 0;
143 
144  Activate();
145 
146  GENERAL_COLLECTOR collector;
147  const KICAD_T types[] = { PCB_PAD_T, EOT };
148 
150  guide.SetIgnoreMTextsMarkedNoShow( true );
151  guide.SetIgnoreMTextsOnBack( true );
152  guide.SetIgnoreMTextsOnFront( true );
153  guide.SetIgnoreModulesVals( true );
154  guide.SetIgnoreModulesRefs( true );
155 
156  int padNumber = settingsDlg.GetStartNumber();
157  wxString padPrefix = settingsDlg.GetPrefix();
158 
159  frame()->DisplayToolMsg( _(
160  "Hold left mouse button and move cursor over pads to enumerate them" ) );
161 
163  getViewControls()->ShowCursor( true );
164  frame()->GetGalCanvas()->SetCursor( wxCURSOR_HAND );
165 
167  VECTOR2I oldCursorPos; // store the previous mouse cursor position, during mouse drag
168  std::list<D_PAD*> selectedPads;
169  BOARD_COMMIT commit( frame() );
170  std::map<wxString, wxString> oldNames;
171  bool isFirstPoint = true; // used to be sure oldCursorPos will be initialized at least once.
172 
173  while( OPT_TOOL_EVENT evt = Wait() )
174  {
175  if( evt->IsDrag( BUT_LEFT ) || evt->IsClick( BUT_LEFT ) )
176  {
177  selectedPads.clear();
178  VECTOR2I cursorPos = getViewControls()->GetCursorPosition();
179 
180  // Be sure the old cursor mouse position was initialized:
181  if( isFirstPoint )
182  {
183  oldCursorPos = cursorPos;
184  isFirstPoint = false;
185  }
186 
187  // wxWidgets deliver mouse move events not frequently enough, resulting in skipping
188  // pads if the user moves cursor too fast. To solve it, create a line that approximates
189  // the mouse move and search pads that are on the line.
190  int distance = ( cursorPos - oldCursorPos ).EuclideanNorm();
191  // Search will be made every 0.1 mm:
192  int segments = distance / int( 0.1*IU_PER_MM ) + 1;
193  const wxPoint line_step( ( cursorPos - oldCursorPos ) / segments );
194 
195  collector.Empty();
196 
197  for( int j = 0; j < segments; ++j )
198  {
199  wxPoint testpoint( cursorPos.x - j * line_step.x,
200  cursorPos.y - j * line_step.y );
201  collector.Collect( board(), types, testpoint, guide );
202 
203  for( int i = 0; i < collector.GetCount(); ++i )
204  {
205  selectedPads.push_back( static_cast<D_PAD*>( collector[i] ) );
206  }
207  }
208 
209  selectedPads.unique();
210 
211  for( D_PAD* pad : selectedPads )
212  {
213  // If pad was not selected, then enumerate it
214  if( !pad->IsSelected() )
215  {
216  commit.Modify( pad );
217 
218  // Rename pad and store the old name
219  wxString newName = wxString::Format( wxT( "%s%d" ), padPrefix.c_str(), padNumber++ );
220  oldNames[newName] = pad->GetName();
221  pad->SetName( newName );
222  pad->SetSelected();
223  getView()->Update( pad );
224  }
225 
226  // ..or restore the old name if it was enumerated and clicked again
227  else if( pad->IsSelected() && evt->IsClick( BUT_LEFT ) )
228  {
229  auto it = oldNames.find( pad->GetName() );
230  wxASSERT( it != oldNames.end() );
231 
232  if( it != oldNames.end() )
233  {
234  pad->SetName( it->second );
235  oldNames.erase( it );
236  }
237 
238  pad->ClearSelected();
239  getView()->Update( pad );
240  }
241  }
242  }
243 
244  else if( ( evt->IsKeyPressed() && evt->KeyCode() == WXK_RETURN ) ||
245  evt->IsDblClick( BUT_LEFT ) )
246  {
247  commit.Push( _( "Enumerate pads" ) );
248  break;
249  }
250 
251  else if( evt->IsCancel() || evt->IsActivate() )
252  {
253  commit.Revert();
254  break;
255  }
256 
257  // Prepare the next loop by updating the old cursor mouse position
258  // to this last mouse cursor position
259  oldCursorPos = getViewControls()->GetCursorPosition();
260  }
261 
262  for( auto p : board()->m_Modules->Pads() )
263  {
264  p->ClearSelected();
265  view->Update( p );
266  }
267 
268  frame()->DisplayToolMsg( wxEmptyString );
269  frame()->GetGalCanvas()->SetCursor( wxCURSOR_ARROW );
270 
271  return 0;
272 }
273 
274 
276 {
277  KIGFX::VIEW* view = getView();
278  KIGFX::PCB_RENDER_SETTINGS* settings =
279  static_cast<KIGFX::PCB_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() );
280 
281  const LAYER_NUM layers[] = { LAYER_MOD_TEXT_BK,
286 
287  bool enable = !settings->GetSketchMode( layers[0] );
288 
289  for( LAYER_NUM layer : layers )
290  settings->SetSketchMode( layer, enable );
291 
292  for( auto module : board()->Modules() )
293  {
294  for( auto item : module->GraphicalItems() )
295  {
296  if( item->Type() == PCB_MODULE_TEXT_T )
297  view->Update( item, KIGFX::GEOMETRY );
298  }
299 
300  view->Update( &module->Reference(), KIGFX::GEOMETRY );
301  view->Update( &module->Value(), KIGFX::GEOMETRY );
302  }
303 
304  frame()->GetGalCanvas()->Refresh();
305 
306  return 0;
307 }
308 
309 
311 {
312  KIGFX::VIEW* view = getView();
313  KIGFX::PCB_RENDER_SETTINGS* settings =
314  static_cast<KIGFX::PCB_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() );
315 
316  const PCB_LAYER_ID layers[] = { F_Adhes, B_Adhes, F_Paste, B_Paste,
319 
320  bool enable = !settings->GetSketchMode( layers[0] );
321 
322  for( LAYER_NUM layer : layers )
323  settings->SetSketchMode( layer, enable );
324 
325  for( auto module : board()->Modules() )
326  {
327  for( auto item : module->GraphicalItems() )
328  {
329  if( item->Type() == PCB_MODULE_EDGE_T )
330  view->Update( item, KIGFX::GEOMETRY );
331  }
332  }
333 
334  frame()->GetGalCanvas()->Refresh();
335 
336  return 0;
337 }
338 
340 {
341  SELECTION& selection = m_toolMgr->GetTool<SELECTION_TOOL>()->GetSelection();
342  BOARD_COMMIT commit( frame() );
343 
344  if( selection.Size() != 1 )
345  return 0;
346 
347  if( selection[0]->Type() != PCB_PAD_T )
348  return 0;
349 
350  auto pad = static_cast<D_PAD*>( selection[0] );
351 
352  if( pad->GetShape() != PAD_SHAPE_CUSTOM )
353  return 0;
354 
355  commit.Modify( pad );
356 
357  wxPoint anchor = pad->GetPosition();
358 
359  for( auto prim : pad->GetPrimitives() )
360  {
361  auto ds = new EDGE_MODULE( board()->m_Modules );
362 
363  prim.ExportTo( ds ); // ExportTo exports to a DRAWSEGMENT
364  // Fix an arbitray draw layer for this EDGE_MODULE
365  ds->SetLayer( Dwgs_User ); //pad->GetLayer() );
366  ds->Move( anchor );
367 
368  commit.Add( ds );
369  }
370 
371  pad->SetShape( pad->GetAnchorPadShape() );
372  commit.Push( _("Explode pad to shapes") );
373 
375 
376  return 0;
377 }
378 
379 
381 {
382  SELECTION& selection = m_toolMgr->GetTool<SELECTION_TOOL>()->GetSelection();
383 
384  std::unique_ptr<D_PAD> pad ( new D_PAD ( board()->m_Modules ) );
385  D_PAD *refPad = nullptr;
386  bool multipleRefPadsFound = false;
387  bool illegalItemsFound = false;
388 
389  std::vector<PAD_CS_PRIMITIVE> shapes;
390 
391  BOARD_COMMIT commit( frame() );
392 
393  for( auto item : selection )
394  {
395  switch( item->Type() )
396  {
397  case PCB_PAD_T:
398  {
399  if( refPad )
400  multipleRefPadsFound = true;
401 
402  refPad = static_cast<D_PAD*>( item );
403  break;
404  }
405 
406  case PCB_MODULE_EDGE_T:
407  {
408  auto em = static_cast<EDGE_MODULE*> ( item );
409 
410  PAD_CS_PRIMITIVE shape( em->GetShape() );
411  shape.m_Start = em->GetStart();
412  shape.m_End = em->GetEnd();
413  shape.m_Radius = em->GetRadius();
414  shape.m_Thickness = em->GetWidth();
415  shape.m_ArcAngle = em->GetAngle();
416  shape.m_Poly = em->GetPolyPoints();
417 
418  shapes.push_back(shape);
419 
420  break;
421  }
422 
423  default:
424  {
425  illegalItemsFound = true;
426  break;
427  }
428  }
429  }
430 
431  if( refPad && selection.Size() == 1 )
432  {
433  // don't convert a pad into itself...
434  return 0;
435  }
436 
437  if( multipleRefPadsFound )
438  {
440  _( "Cannot convert items to a custom-shaped pad:\n"
441  "selection contains more than one reference pad." ) );
442  return 0;
443  }
444 
445  if( illegalItemsFound )
446  {
448  _( "Cannot convert items to a custom-shaped pad:\n"
449  "selection contains unsupported items.\n"
450  "Only graphical lines, circles, arcs and polygons are allowed." ) );
451  return 0;
452  }
453 
454  if( refPad )
455  {
456  pad.reset( static_cast<D_PAD*>( refPad->Clone() ) );
457  }
458  else
459  {
460  // Create a default pad anchor:
461  pad->SetAnchorPadShape( PAD_SHAPE_CIRCLE );
462  pad->SetAttribute( PAD_ATTRIB_SMD );
463  pad->SetLayerSet( D_PAD::SMDMask() );
464  int radius = Millimeter2iu( 0.2 );
465  pad->SetSize ( wxSize( radius, radius ) );
466  pad->IncrementPadName( true, true );
467  }
468 
469 
470  pad->SetPrimitives( shapes );
471  pad->SetShape ( PAD_SHAPE_CUSTOM );
472 
473  OPT<VECTOR2I> anchor;
474  VECTOR2I tmp;
475 
476  if( refPad )
477  {
478  anchor = VECTOR2I( pad->GetPosition() );
479  }
480  else if( pad->GetBestAnchorPosition( tmp ) )
481  {
482  anchor = tmp;
483  }
484 
485  if( !anchor )
486  {
488  _( "Cannot convert items to a custom-shaped pad:\n"
489  "unable to determine the anchor point position.\n"
490  "Consider adding a small anchor pad to the selection and try again.") );
491  return 0;
492  }
493 
494 
495  // relocate the shapes, they are relative to the anchor pad position
496  for( auto& shape : shapes )
497  {
498  shape.Move( wxPoint( -anchor->x, -anchor->y ) );
499  }
500 
501 
502  pad->SetPosition( wxPoint( anchor->x, anchor->y ) );
503  pad->SetPrimitives( shapes );
504 
505  bool result = pad->MergePrimitivesAsPolygon();
506 
507  if( !result )
508  {
510  _( "Cannot convert items to a custom-shaped pad:\n"
511  "selected items do not form a single solid shape.") );
512  return 0;
513  }
514 
515  auto padPtr = pad.release();
516 
517  commit.Add( padPtr );
518  for ( auto item : selection )
519  {
520  commit.Remove( item );
521  }
522 
524  m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, padPtr );
525 
526  commit.Push(_("Create Pad from Selected Shapes") );
527 
528  return 0;
529 }
530 
532 {
539 }
double EuclideanNorm(const wxPoint &vector)
Euclidean norm of a 2D vector.
Definition: trigo.h:112
void Empty()
Function Empty sets the list to empty.
static TOOL_ACTION selectionClear
Clears the current selection.
Definition: pcb_actions.h:53
virtual void ShowCursor(bool aEnabled)
Function ShowCursor() Enables or disables display of cursor.
bool IncrementPadName(bool aSkipUnconnectable, bool aFillSequenceGaps)
Function IncrementPadName.
Definition: class_pad.cpp:515
void Reset(RESET_REASON aReason) override
Function Reset() Brings the tool to a known, initial state.
int GetCount() const
Function GetCount returns the number of objects in the list.
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: class_pad.cpp:1208
COMMIT & Modify(EDA_ITEM *aItem)
Modifies a given item in the model.
Definition: commit.h:103
TEXTE_MODULE & Reference()
Definition: class_module.h:483
virtual void SetToolID(int aId, int aCursor, const wxString &aToolMsg) override
Function SetToolID sets the tool command ID to aId and sets the cursor to aCursor.
This file is part of the common library.
static LSET SMDMask()
layer set for a SMD pad on Front layer
Definition: class_pad.cpp:106
COMMIT & Add(EDA_ITEM *aItem)
Adds a new item to the model
Definition: commit.h:78
VIEW_CONTROLS class definition.
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:435
void SetIgnoreModulesVals(bool ignore)
Definition: collectors.h:529
Class SELECTION_TOOL.
Class BOARD to handle a board.
virtual void Revert() override
Revertes the commit by restoring the modifed items state.
wxPoint m_Start
angle of an arc, from its starting point, in 0.1 deg
Definition: class_pad.h:100
static TOOL_ACTION explodePadToShapes
Definition: pcb_actions.h:295
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:215
static TOOL_ACTION enumeratePads
Tool for quick pad enumeration.
Definition: pcb_actions.h:298
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:61
OPT_TOOL_EVENT Wait(const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
Function Wait()
wxString GetPrefix() const
Returns common prefix for all enumerated pads.
void SetIgnoreModulesRefs(bool ignore)
Definition: collectors.h:535
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
show modules values (when texts are visibles)
static TOOL_ACTION placePad
Activation of the drawing tool (placing a PAD)
Definition: pcb_actions.h:292
class D_PAD, a pad in a footprint
Definition: typeinfo.h:90
int CreatePadFromShapes(const TOOL_EVENT &aEvent)
Function CreatePadFromShapes()
VECTOR2< int > VECTOR2I
Definition: vector2d.h:589
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Function Go()
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
Implementing DIALOG_ENUM_PADS_BASE.
bool GetSketchMode(int aItemLayer) const
Function GetSketchMode Returns sketch mode setting for a given item layer.
Definition: pcb_painter.h:124
virtual void Push(const wxString &aMessage=wxT("A commit"), bool aCreateUndoEntry=true) override
Executes the changes.
search types array terminator (End Of Types)
Definition: typeinfo.h:82
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
Pcbnew hotkeys.
int ExplodePadToShapes(const TOOL_EVENT &aEvent)
Function ExplodePadToShapes()
Class PCB_RENDER_SETTINGS Stores PCB specific render settings.
Definition: pcb_painter.h:62
DLIST_ITERATOR_WRAPPER< BOARD_ITEM > GraphicalItems()
Definition: class_module.h:165
PCB_LAYER_ID
A quick note on layer IDs:
int ModuleTextOutlines(const TOOL_EVENT &aEvent)
Function ModuleTextOutlines()
GENERAL_COLLECTORS_GUIDE GetCollectorsGuide()
Function GetCollectorsGuide.
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString aExtraInfo)
Function DisplayErrorMessage displays an error message with aMessage.
Definition: confirm.cpp:87
int PlacePad(const TOOL_EVENT &aEvent)
Function PlacePad() Places a pad in module editor.
void SetIgnoreMTextsOnBack(bool ignore)
Definition: collectors.h:493
TEXTE_MODULE & Value()
read/write accessors:
Definition: class_module.h:482
void SetIgnoreMTextsOnFront(bool ignore)
Definition: collectors.h:499
VECTOR2D GetCursorPosition() const
Returns the current cursor position in world coordinates.
PCB_EDIT_FRAME * frame() const
Definition: pcb_tool.h:133
Class TOOL_EVENT.
Definition: tool_event.h:162
Helper class to handle a primitive (basic shape: polygon, segment, circle or arc) to build a custom p...
Definition: class_pad.h:91
void setTransitions() override
Sets up handlers for various events.
MODULE * module() const
Definition: pcb_tool.h:135
VIEW_GROUP extends VIEW_ITEM by possibility of grouping items into a single object.
COMMIT & Remove(EDA_ITEM *aItem)
Removes a new item from the model
Definition: commit.h:90
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:196
All active tools
Definition: tool_event.h:138
void SetIgnoreMTextsMarkedNoShow(bool ignore)
Definition: collectors.h:487
virtual void Update(VIEW_ITEM *aItem, int aUpdateFlags)
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1385
Subclass of DIALOG_ENUM_PADS_BASE, which is generated by wxFormBuilder.
void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it bu a python script (note: it is automatically called by a...
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:41
static TOOL_ACTION moduleEdgeOutlines
Display module edges as outlines.
Definition: pcb_actions.h:313
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:35
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:93
int ModuleEdgeOutlines(const TOOL_EVENT &aEvent)
Function ModuleEdgeOutlines()
static TOOL_ACTION moduleTextOutlines
Display module texts as outlines.
Definition: pcb_actions.h:316
static TOOL_ACTION createPadFromShapes
Definition: pcb_actions.h:294
virtual void SetNoToolSelected()
Select the ID_NO_TOOL_SELECTED id tool (Idle tool)
Definition: draw_frame.cpp:571
int GetStartNumber() const
Returns the starting number that is going to be used for the first enumerated pad.
virtual RENDER_SETTINGS * GetSettings()=0
Function GetSettings Returns pointer to current settings that are going to be used when drawing items...
void DisplayToolMsg(const wxString &msg)
Definition: draw_frame.cpp:508
int EnumeratePads(const TOOL_EVENT &aEvent)
Function EnumeratePads() Tool for quick pad enumeration.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
KIGFX::PCB_VIEW * view() const
Definition: pcb_tool.h:131
void SetSketchMode(int aItemLayer, bool aEnabled)
Function SetSketchMode Turns on/off sketch mode for given item layer.
Definition: pcb_painter.h:114
Used when the right click button is pressed, or when the select tool is in effect.
Definition: collectors.h:212
Class TOOL_ACTION.
Definition: tool_action.h:46
static TOOL_ACTION selectItem
Selects an item (specified as the event parameter).
Definition: pcb_actions.h:56
RESET_REASON
Determines the reason of reset for a tool
Definition: tool_base.h:80
boost::optional< T > OPT
Definition: optional.h:7
void Activate()
Function Activate() Runs the tool.
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Function GetGalCanvas returns a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:870
int Size() const
Returns the number of selected parts.
Definition: selection.h:112
Module description (excepted pads)
void doInteractiveItemPlacement(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: pcb_tool.cpp:39
Class VIEW.
Definition: view.h:58
A general implementation of a COLLECTORS_GUIDE.
Definition: collectors.h:351
KIGFX::VIEW * GetView() const
Definition: tool_manager.h:252
EDGE_MODULE class definition.
show modules references (when texts are visibles)
OPT< TOOL_EVENT > OPT_TOOL_EVENT
Definition: tool_event.h:460
Color has changed.
Definition: view_item.h:57
BOARD * board() const
Definition: pcb_tool.h:134