KiCad PCB EDA Suite
modules.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) 2015 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
5  * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
6  * Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net>
7  * Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, you may find one here:
21  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22  * or you may search the http://www.gnu.org website for the version 2 license,
23  * or you may write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25  */
26 
31 #include <fctsys.h>
32 #include <gr_basic.h>
33 #include <class_drawpanel.h>
34 #include <confirm.h>
35 #include <wxPcbStruct.h>
36 #include <trigo.h>
37 #include <macros.h>
38 
39 #include <class_board.h>
40 #include <class_module.h>
41 
42 #include <pcbnew.h>
43 #include <drag.h>
45 
46 static void MoveFootprint( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
47  const wxPoint& aPosition, bool aErase );
48 static void Abort_MoveOrCopyModule( EDA_DRAW_PANEL* Panel, wxDC* DC );
49 
50 
51 static MODULE* s_ModuleInitialCopy = NULL; /* Copy of module for
52  * abort/undo command
53  */
54 static PICKED_ITEMS_LIST s_PickedList; /* a picked list to
55  * save initial module
56  * and dragged tracks
57  */
58 
59 
61 {
62  wxString moduleName;
63  MODULE* module = NULL;
64  wxArrayString fplist;
65 
66  // Build list of available fp references, to display them in dialog
67  for( MODULE* fp = GetBoard()->m_Modules; fp; fp = fp->Next() )
68  fplist.Add( fp->GetReference() + wxT(" ( ") + fp->GetValue() + wxT(" )") );
69 
70  fplist.Sort();
71 
72  DIALOG_GET_FOOTPRINT_BY_NAME dlg( this, fplist );
73 
74  if( dlg.ShowModal() != wxID_OK ) //Aborted by user
75  return NULL;
76 
77  moduleName = dlg.GetValue();
78  moduleName.Trim( true );
79  moduleName.Trim( false );
80 
81  if( !moduleName.IsEmpty() )
82  {
83  module = GetBoard()->m_Modules;
84 
85  while( module )
86  {
87  if( module->GetReference().CmpNoCase( moduleName ) == 0 )
88  break;
89 
90  module = module->Next();
91  }
92  }
93 
94  return module;
95 }
96 
97 
98 void PCB_EDIT_FRAME::StartMoveModule( MODULE* aModule, wxDC* aDC,
99  bool aDragConnectedTracks )
100 {
101  if( aModule == NULL )
102  return;
103 
104  if( s_ModuleInitialCopy )
105  delete s_ModuleInitialCopy;
106 
107  s_PickedList.ClearItemsList(); // Should be empty, but...
108 
109  // Creates a copy of the current module, for abort and undo commands
110  s_ModuleInitialCopy = (MODULE*)aModule->Clone();
111  s_ModuleInitialCopy->SetParent( GetBoard() );
112  s_ModuleInitialCopy->ClearFlags();
113 
114  SetCurItem( aModule );
116  aModule->SetFlags( IS_MOVED );
117 
118  /* Show ratsnest. */
120  DrawGeneralRatsnest( aDC );
121 
122  EraseDragList();
123 
124  if( aDragConnectedTracks )
125  {
126  DRAG_LIST drglist( GetBoard() );
127  drglist.BuildDragListe( aModule );
128 
129  ITEM_PICKER itemWrapper( NULL, UR_CHANGED );
130 
131  for( unsigned ii = 0; ii < g_DragSegmentList.size(); ii++ )
132  {
133  TRACK* segm = g_DragSegmentList[ii].m_Track;
134  itemWrapper.SetItem( segm );
135  itemWrapper.SetLink( segm->Clone() );
136  itemWrapper.GetLink()->SetState( IN_EDIT, false );
137  s_PickedList.PushItem( itemWrapper );
138  }
139 
141  }
142 
145  m_canvas->SetAutoPanRequest( true );
146 
147  // Erase the module.
148  if( aDC )
149  {
150  aModule->SetFlags( DO_NOT_DRAW );
152  aModule->ClearFlags( DO_NOT_DRAW );
153  }
154 
155  m_canvas->CallMouseCapture( aDC, wxDefaultPosition, false );
156 }
157 
158 
159 /* Called on a move or copy module command abort
160  */
161 void Abort_MoveOrCopyModule( EDA_DRAW_PANEL* Panel, wxDC* DC )
162 {
163  TRACK* pt_segm;
164  MODULE* module;
165  PCB_EDIT_FRAME* pcbframe = (PCB_EDIT_FRAME*) Panel->GetParent();
166 
167  module = (MODULE*) pcbframe->GetScreen()->GetCurItem();
169  Panel->SetMouseCapture( NULL, NULL );
170 
171  if( module )
172  {
173  // Erase the current footprint on screen
174  module->DrawOutlinesWhenMoving( Panel, DC, g_Offset_Module );
175 
176  /* If a move command: return to old position
177  * If a copy command, delete the new footprint
178  */
179  if( module->IsMoving() )
180  {
181  /* Restore old position for dragged tracks */
182  for( unsigned ii = 0; ii < g_DragSegmentList.size(); ii++ )
183  {
184  pt_segm = g_DragSegmentList[ii].m_Track;
185  pt_segm->Draw( Panel, DC, GR_XOR );
186  pt_segm->SetState( IN_EDIT, false );
187  pt_segm->ClearFlags();
188  g_DragSegmentList[ii].RestoreInitialValues();
189  pt_segm->Draw( Panel, DC, GR_OR );
190  }
191 
192  EraseDragList();
193  module->ClearFlags( IS_MOVED );
194  }
195 
196  if( module->IsNew() ) // Copy command: delete new footprint
197  {
198  module->DeleteStructure();
199  module = NULL;
200  pcbframe->GetBoard()->m_Status_Pcb = 0;
201  pcbframe->GetBoard()->BuildListOfNets();
202  }
203  }
204 
205  /* Redraw the module. */
206  if( module && s_ModuleInitialCopy )
207  {
208  if( s_ModuleInitialCopy->GetOrientation() != module->GetOrientation() )
209  pcbframe->Rotate_Module( NULL, module, s_ModuleInitialCopy->GetOrientation(), false );
210 
211  if( s_ModuleInitialCopy->GetLayer() != module->GetLayer() )
212  pcbframe->Change_Side_Module( module, NULL );
213 
214  module->Draw( Panel, DC, GR_OR );
215  }
216 
217  pcbframe->SetCurItem( NULL );
218 
219  delete s_ModuleInitialCopy;
220  s_ModuleInitialCopy = NULL;
221  s_PickedList.ClearListAndDeleteItems();
222 
223  // Display ratsnest is allowed
225 
226  if( pcbframe->GetBoard()->IsElementVisible( LAYER_RATSNEST ) )
227  pcbframe->DrawGeneralRatsnest( DC );
228 
229 #ifdef __WXMAC__
230  Panel->Refresh();
231 #endif
232 }
233 
234 
235 /* Redraw the footprint when moving the mouse.
236  */
237 void MoveFootprint( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition, bool aErase )
238 {
239  MODULE* module = (MODULE*) aPanel->GetScreen()->GetCurItem();
240 
241  if( module == NULL )
242  return;
243 
244  /* Erase current footprint. */
245  if( aErase )
246  {
247  module->DrawOutlinesWhenMoving( aPanel, aDC, g_Offset_Module );
248  }
249 
250  /* Redraw the module at the new position. */
251  g_Offset_Module = module->GetPosition() - aPanel->GetParent()->GetCrossHairPosition();
252  module->DrawOutlinesWhenMoving( aPanel, aDC, g_Offset_Module );
253 
254  DrawSegmentWhileMovingFootprint( aPanel, aDC );
255 }
256 
257 
258 bool PCB_EDIT_FRAME::Delete_Module( MODULE* aModule, wxDC* aDC )
259 {
260  wxString msg;
261 
262  if( aModule == NULL )
263  return false;
264 
265  SetMsgPanel( aModule );
266 
267  /* Remove module from list, and put it in undo command list */
268  m_Pcb->m_Modules.Remove( aModule );
269  aModule->SetState( IS_DELETED, true );
270  SaveCopyInUndoList( aModule, UR_DELETED );
271 
272  if( aDC && GetBoard()->IsElementVisible( LAYER_RATSNEST ) )
273  Compile_Ratsnest( aDC, true );
274 
275  // Redraw the full screen to ensure perfect display of board and ratsnest.
276  if( aDC )
277  m_canvas->Refresh();
278 
279  OnModify();
280 
281  return true;
282 }
283 
284 
286 {
287  if( Module == NULL )
288  return;
289 
290  if( ( Module->GetLayer() != F_Cu ) && ( Module->GetLayer() != B_Cu ) )
291  return;
292 
293  OnModify();
294 
295  if( !Module->IsMoving() ) /* This is a simple flip, no other edition in progress */
296  {
298 
299  if( DC )
300  {
301  Module->SetFlags( DO_NOT_DRAW );
303  Module->ClearFlags( DO_NOT_DRAW );
304  }
305 
306  /* Show ratsnest if necessary. */
307  if( DC && GetBoard()->IsElementVisible( LAYER_RATSNEST ) )
308  DrawGeneralRatsnest( DC );
309 
310  g_Offset_Module.x = 0;
311  g_Offset_Module.y = 0;
312  }
313  else // Module is being moved.
314  {
315  /* Erase footprint and draw outline if it has been already drawn. */
316  if( DC )
317  {
320  }
321  }
322 
323  /* Flip the module */
324  Module->Flip( Module->GetPosition() );
325 
326  SetMsgPanel( Module );
327 
328  if( !Module->IsMoving() ) /* Inversion simple */
329  {
330  if( DC )
331  {
332  Module->Draw( m_canvas, DC, GR_OR );
333 
335  Compile_Ratsnest( DC, true );
336  }
337  }
338  else
339  {
340  if( DC )
341  {
344  }
345 
347  }
348 }
349 
350 
351 void PCB_BASE_FRAME::PlaceModule( MODULE* aModule, wxDC* aDC, bool aDoNotRecreateRatsnest )
352 {
353  wxPoint newpos;
354 
355  if( aModule == 0 )
356  return;
357 
358  OnModify();
360 
361  if( aModule->IsNew() )
362  {
363  SaveCopyInUndoList( aModule, UR_NEW );
364  }
365  else if( aModule->IsMoving() )
366  {
367  ITEM_PICKER picker( aModule, UR_CHANGED );
368  picker.SetLink( s_ModuleInitialCopy );
369  s_PickedList.PushItem( picker );
370  s_ModuleInitialCopy = NULL; // the picker is now owner of s_ModuleInitialCopy.
371  }
372 
373  if( s_PickedList.GetCount() )
374  {
375  SaveCopyInUndoList( s_PickedList, UR_UNSPECIFIED );
376 
377  // Clear list, but DO NOT delete items, because they are owned by the saved undo
378  // list and they therefore in use
379  s_PickedList.ClearItemsList();
380  }
381 
383 
384  if( displ_opts->m_Show_Module_Ratsnest && ( GetBoard()->m_Status_Pcb & LISTE_PAD_OK ) && aDC )
385  TraceModuleRatsNest( aDC );
386 
387  newpos = GetCrossHairPosition();
388  aModule->SetPosition( newpos );
389  aModule->ClearFlags();
390 
391  delete s_ModuleInitialCopy;
392  s_ModuleInitialCopy = NULL;
393 
394  if( aDC )
395  aModule->Draw( m_canvas, aDC, GR_OR );
396 
397  // Redraw dragged track segments, if any
398  for( unsigned ii = 0; ii < g_DragSegmentList.size(); ii++ )
399  {
400  TRACK * track = g_DragSegmentList[ii].m_Track;
401  track->SetState( IN_EDIT, false );
402  track->ClearFlags();
403 
404  if( aDC )
405  track->Draw( m_canvas, aDC, GR_OR );
406  }
407 
408  // Delete drag list
409  EraseDragList();
410 
411  m_canvas->SetMouseCapture( NULL, NULL );
412 
413  if( GetBoard()->IsElementVisible( LAYER_RATSNEST ) && !aDoNotRecreateRatsnest )
414  Compile_Ratsnest( aDC, true );
415 
416  if( aDC )
417  m_canvas->Refresh();
418 
419  SetMsgPanel( aModule );
420 }
421 
422 
423 /*
424  * Rotate the footprint angle degrees in the direction < 0.
425  * If incremental == true, the rotation is made from the last orientation,
426  * If the module is placed in the absolute orientation angle.
427  * If DC == NULL, the component does not redraw.
428  * Otherwise, it erases and redraws turns
429  */
430 void PCB_BASE_FRAME::Rotate_Module( wxDC* DC, MODULE* module, double angle, bool incremental )
431 {
432  if( module == NULL )
433  return;
434 
435  OnModify();
436 
437  if( !module->IsMoving() ) /* This is a simple rotation, no other
438  * edition in progress */
439  {
440  if( DC ) // Erase footprint to screen
441  {
442  module->SetFlags( DO_NOT_DRAW );
444  module->ClearFlags( DO_NOT_DRAW );
445 
446  if( GetBoard()->IsElementVisible( LAYER_RATSNEST ) )
447  DrawGeneralRatsnest( DC );
448  }
449  }
450  else
451  {
452  if( DC )
453  {
456  }
457  }
458 
460 
461  if( incremental )
462  module->SetOrientation( module->GetOrientation() + angle );
463  else
464  module->SetOrientation( angle );
465 
466  SetMsgPanel( module );
467 
468  if( DC )
469  {
470  if( !module->IsMoving() )
471  {
472  // not beiing moved: redraw the module and update ratsnest
473  module->Draw( m_canvas, DC, GR_OR );
474 
475  if( GetBoard()->IsElementVisible( LAYER_RATSNEST ) )
476  Compile_Ratsnest( DC, true );
477  }
478  else
479  {
480  // Beiing moved: just redraw it
483  }
484 
485  if( module->GetFlags() == 0 ) // module not in edit: redraw full screen
486  m_canvas->Refresh();
487  }
488 }
489 
490 
491 // Redraw in XOR mode the outlines of the module.
493  const wxPoint& aMoveVector )
494 {
495  int pad_fill_tmp;
496  D_PAD* pt_pad;
497 
498  DrawEdgesOnly( panel, DC, aMoveVector, GR_XOR );
499  DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)panel->GetDisplayOptions();
500 
501  // Show pads in sketch mode to speedu up drawings
502  pad_fill_tmp = displ_opts->m_DisplayPadFill;
503  displ_opts->m_DisplayPadFill = true;
504 
505  pt_pad = Pads();
506 
507  for( ; pt_pad != NULL; pt_pad = pt_pad->Next() )
508  pt_pad->Draw( panel, DC, GR_XOR, aMoveVector );
509 
510  displ_opts->m_DisplayPadFill = pad_fill_tmp;
511 
512  if( displ_opts->m_Show_Module_Ratsnest )
513  {
514  PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) panel->GetParent();
515  frame->build_ratsnest_module( this );
516  frame->TraceModuleRatsNest( DC );
517  }
518 }
void Add(BOARD_ITEM *aBoardItem, ADD_MODE aMode=ADD_INSERT) override
>
void BuildListOfNets()
Definition: class_board.h:764
static PICKED_ITEMS_LIST s_PickedList
Definition: modules.cpp:54
virtual void OnModify() override
Function OnModify must be called after a board change to set the modified flag.
Definition: pcbframe.cpp:996
static void Abort_MoveOrCopyModule(EDA_DRAW_PANEL *Panel, wxDC *DC)
Definition: modules.cpp:161
STATUS_FLAGS GetFlags() const
Definition: base_struct.h:255
wxPoint g_Offset_Module
Definition: pcbnew.cpp:83
bool IsElementVisible(GAL_LAYER_ID LAYER_aPCB) const
Function IsElementVisible tests whether a given element category is visible.
bool IsMoving() const
Definition: base_struct.h:218
#define IN_EDIT
Item currently edited.
Definition: base_struct.h:111
void DrawSegmentWhileMovingFootprint(EDA_DRAW_PANEL *panel, wxDC *DC)
Definition: dragsegm.cpp:294
T * Remove(T *aElement)
Function Remove removes aElement from the list, but does not delete it.
Definition: dlist.h:211
void TraceModuleRatsNest(wxDC *aDC)
Function TraceModuleRatsNest display the rats nest of a moving footprint, computed by build_ratsnest_...
Definition: ratsnest.cpp:751
EDA_ITEM * GetCurItem() const
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Definition: draw_panel.cpp:326
bool Delete_Module(MODULE *aModule, wxDC *aDC)
Function Delete Module Remove a footprint from m_Modules linked list and put it in undelete buffer Th...
Definition: modules.cpp:258
This file is part of the common library.
bool IsNew() const
Definition: base_struct.h:216
void Draw(EDA_DRAW_PANEL *aPanel, wxDC *aDC, GR_DRAWMODE aDrawMode, const wxPoint &aOffset=ZeroOffset) override
Function Draw BOARD_ITEMs have their own color information.
void Draw(EDA_DRAW_PANEL *aPanel, wxDC *aDC, GR_DRAWMODE aDrawMode, const wxPoint &aOffset=ZeroOffset) override
Function Draw draws the footprint to the aDC.
void Flip(const wxPoint &aCentre) override
Function Flip Flip this object, i.e.
Class BOARD to handle a board.
const wxPoint & GetPosition() const override
Definition: class_module.h:143
MODULE * Next() const
Definition: class_module.h:99
void SetCurItem(BOARD_ITEM *aItem, bool aDisplayInfo=true)
Function SetCurItem sets the currently selected item and displays it in the MsgPanel.
void EraseDragList()
Function EraseDragList clear the .m_Flags of all track segments stored in g_DragSegmentList and clear...
Definition: dragsegm.cpp:309
void DeleteStructure()
Function DeleteStructure deletes this object after UnLink()ing it from its owner if it has one...
virtual EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
BOARD * GetBoard() const
void Rotate_Module(wxDC *DC, MODULE *module, double angle, bool incremental)
Definition: modules.cpp:430
void RefreshDrawingRect(const EDA_RECT &aRect, bool aEraseBackground=true)
Function RefreshDrawingRect redraws the contents of aRect in drawing units.
Definition: draw_panel.cpp:306
void PushItem(const ITEM_PICKER &aItem)
Function PushItem pushes aItem to the top of the list.
void SetLink(EDA_ITEM *aItem)
void * GetDisplayOptions() override
Function GetDisplayOptions returns the display options current in use Display options are relative to...
This file contains miscellaneous commonly used macros and functions.
void PlaceModule(MODULE *aModule, wxDC *aDC, bool aDoNotRecreateRatsnest=false)
Function PlaceModule places aModule at the current cursor position and updates module coordinates wit...
Definition: modules.cpp:351
BOARD_ITEM * Next() const
DIALOG_GET_FOOTPRINT_BY_NAME is a helper dialog to select a footprint by its reference One can enter ...
bool IsElementVisible(GAL_LAYER_ID aElement) const
Function IsElementVisible tests whether a given element category is visible.
Definition: pcbframe.cpp:930
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
std::vector< DRAG_SEGM_PICKER > g_DragSegmentList
Definition: dragsegm.cpp:48
BOARD_ITEM * GetCurItem() const
Function GetCurItem returns the currently selected BOARD_ITEM, overriding BASE_SCREEN::GetCurItem().
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:253
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Function SetMsgPanel clears the message panel and populates it with the contents of aList...
Definition: draw_frame.cpp:754
static MODULE * s_ModuleInitialCopy
Definition: modules.cpp:51
void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:213
double GetOrientation() const
Definition: class_module.h:147
#define IS_DELETED
Definition: base_struct.h:116
void build_ratsnest_module(MODULE *aModule)
Function build_ratsnest_module Build a ratsnest relative to one footprint.
Definition: ratsnest.cpp:533
Useful classes and functions used to collect tracks to drag.
void UndrawAndMarkSegmentsToDrag(EDA_DRAW_PANEL *aCanvas, wxDC *aDC)
Definition: dragsegm.cpp:404
void DrawGeneralRatsnest(wxDC *aDC, int aNetcode=0)
function Displays the general ratsnest Only ratsnest with the status bit CH_VISIBLE is set are displa...
Definition: ratsnest.cpp:300
void CallMouseCapture(wxDC *aDC, const wxPoint &aPosition, bool aErase)
Function CallMouseCapture calls the mouse capture callback.
D_PAD * Next() const
Definition: class_pad.h:106
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
EDA_DRAW_FRAME * GetParent() const
Definition: draw_panel.cpp:175
static void MoveFootprint(EDA_DRAW_PANEL *aPanel, wxDC *aDC, const wxPoint &aPosition, bool aErase)
Definition: modules.cpp:237
void SetPosition(const wxPoint &aPos) override
void SetAutoPanRequest(bool aEnable)
Class PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.
void SaveCopyInUndoList(BOARD_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, const wxPoint &aTransformPoint=wxPoint(0, 0)) override
Function SaveCopyInUndoList Creates a new entry in undo list of commands.
Definition: undo_redo.cpp:172
void DrawEdgesOnly(EDA_DRAW_PANEL *panel, wxDC *DC, const wxPoint &offset, GR_DRAWMODE draw_mode)
Function DrawEdgesOnly Draws the footprint edges only to the current Device Context.
void SetItem(EDA_ITEM *aItem)
void Compile_Ratsnest(wxDC *aDC, bool aDisplayStatus)
Function Compile_Ratsnest Create the entire board ratsnest.
Definition: ratsnest.cpp:165
Class DISPLAY_OPTIONS handles display options like enable/disable some optional drawings.
Definition: pcbstruct.h:62
unsigned GetCount() const
Function GetCount.
Definition: gr_basic.h:42
void Draw(EDA_DRAW_PANEL *panel, wxDC *DC, GR_DRAWMODE aDrawMode, const wxPoint &aOffset=ZeroOffset) override
Function Draw BOARD_ITEMs have their own color information.
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
virtual void OnModify()
Function OnModify Virtual Must be called after a change in order to set the "modify" flag of the curr...
bool m_DisplayPadFill
Definition: pcbstruct.h:65
PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
void SetState(int type, int state)
Definition: base_struct.h:242
const wxString & GetReference() const
Function GetReference.
Definition: class_module.h:411
void StartMoveModule(MODULE *aModule, wxDC *aDC, bool aDragConnectedTracks)
Function StartMoveModule Initialize a drag or move pad command.
Definition: modules.cpp:98
DLIST< MODULE > m_Modules
Definition: class_board.h:243
void SetOrientation(double newangle)
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
void BuildDragListe(MODULE *aModule)
Build the list of track segments connected to pads of aModule in m_DragList For each selected track s...
Definition: dragsegm.cpp:153
virtual void SaveCopyInUndoList(BOARD_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, const wxPoint &aTransformPoint=wxPoint(0, 0))=0
Function SaveCopyInUndoList (virtual pure) Creates a new entry in undo list of commands.
BASE_SCREEN * GetScreen()
Definition: draw_panel.cpp:188
void ClearItemsList()
Function ClearItemsList deletes only the list of pickers, NOT the picked data itself.
PCB_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:254
MODULE * GetFootprintFromBoardByReference()
Function GetFootprintFromBoardByReference.
Definition: modules.cpp:60
DLIST< D_PAD > & Pads()
Definition: class_module.h:133
void DrawOutlinesWhenMoving(EDA_DRAW_PANEL *aPanel, wxDC *aDC, const wxPoint &aMoveVector)
Function DrawOutlinesWhenMoving draws in XOR mode the footprint when moving it to the aDC...
Definition: modules.cpp:492
Module description (excepted pads)
void * GetDisplayOptions()
Function GetDisplayOptions A way to pass info to draw functions.
Definition: draw_panel.cpp:182
bool m_Show_Module_Ratsnest
Definition: pcbstruct.h:87
void Change_Side_Module(MODULE *Module, wxDC *DC)
Function Change_Side_Module Flip a footprint (switch layer from component or component to copper) The...
Definition: modules.cpp:285
void SetMouseCapture(MOUSE_CAPTURE_CALLBACK aMouseCaptureCallback, END_MOUSE_CAPTURE_CALLBACK aEndMouseCaptureCallback)
Function SetMouseCapture sets the mouse capture and end mouse capture callbacks to aMouseCaptureCallb...
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates...
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...
EDA_ITEM * GetLink() const
void ClearListAndDeleteItems()
Function ClearListAndDeleteItems deletes the list of pickers, AND the data pointed by m_PickedItem or...
#define DO_NOT_DRAW
Used to disable draw function.
Definition: base_struct.h:125
int m_Status_Pcb
Flags used in ratsnest calculation and update.
Definition: class_board.h:240
#define IS_MOVED
Item being moved.
Definition: base_struct.h:112