KiCad PCB EDA Suite
mocks.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) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, you may find one here:
18  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19  * or you may search the http://www.gnu.org website for the version 2 license,
20  * or you may write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22  */
23 
24 #include <pgm_base.h>
25 #include <kiface_i.h>
26 #include <confirm.h>
27 #include <pcb_edit_frame.h>
28 #include <eda_dde.h>
29 #include <wx/file.h>
30 #include <wx/snglinst.h>
31 #include <wx/app.h>
32 #include <board.h>
33 #include <fp_lib_table.h>
34 #include <footprint_viewer_frame.h>
35 #include <footprint_wizard_frame.h>
36 #include <footprint.h>
37 #include <tools/pcb_actions.h>
38 #include <router/router_tool.h>
39 #include <dialog_find.h>
41 
43 
44 
45 #if 0
46 
47 static struct IFACE : public KIFACE_I
48 {
49  // Of course all are overloads, implementations of the KIFACE.
50 
51  IFACE( const char* aName, KIWAY::FACE_T aType ) :
52  KIFACE_I( aName, aType )
53  {}
54 
55  bool OnKifaceStart( PGM_BASE* aProgram, int aCtlBits ) override
56  {
57  return true;
58  }
59 
60  void OnKifaceEnd() override {}
61 
62  wxWindow* CreateWindow( wxWindow* aParent, int aClassId, KIWAY* aKiway, int aCtlBits = 0 ) override
63  {
64  assert( false );
65  return nullptr;
66  }
67 
79  void* IfaceOrAddress( int aDataId ) override
80  {
81  return NULL;
82  }
83 }
84 kiface( "pcb_test_frame", KIWAY::FACE_PCB );
85 
86 static struct PGM_TEST_FRAME : public PGM_BASE
87 {
88  bool OnPgmInit();
89 
90  void OnPgmExit()
91  {
92  Kiway.OnKiwayEnd();
93 
94  // Destroy everything in PGM_BASE, especially wxSingleInstanceCheckerImpl
95  // earlier than wxApp and earlier than static destruction would.
97  }
98 
99  void MacOpenFile( const wxString& aFileName ) override
100  {
101  wxFileName filename( aFileName );
102 
103  if( filename.FileExists() )
104  {
105  #if 0
106  // this pulls in EDA_DRAW_FRAME type info, which we don't want in
107  // the single_top link image.
108  KIWAY_PLAYER* frame = dynamic_cast<KIWAY_PLAYER*>( App().GetTopWindow() );
109  #else
110  KIWAY_PLAYER* frame = (KIWAY_PLAYER*) App().GetTopWindow();
111  #endif
112 
113  if( frame )
114  frame->OpenProjectFiles( std::vector<wxString>( 1, aFileName ) );
115  }
116  }
117 }
118 program;
119 
120 PGM_BASE& Pgm()
121 {
122  return program;
123 }
124 
125 
126 // Similar to PGM_BASE& Pgm(), but return nullptr when a *.ki_face
127 // is run from a python script, mot from a Kicad application
129 {
130  return nullptr; //&program;
131 }
132 
133 
134 KIFACE_I& Kiface()
135 {
136  return kiface;
137 }
138 #endif
139 
140 // FP_LIB_TABLE GFootprintTable;
141 
143 {
144  // these members are initialized to avoid warnings about non initialized vars
145  m_frame = aParent;
146  m_hitList.clear();
147  m_it = m_hitList.begin();
148  m_upToDate = false;
149 }
150 
151 void DIALOG_FIND::onFindNextClick( wxCommandEvent& aEvent )
152 {
153 }
154 
155 void DIALOG_FIND::onFindPreviousClick( wxCommandEvent& aEvent )
156 {
157 }
158 
159 void DIALOG_FIND::onSearchAgainClick( wxCommandEvent& aEvent )
160 {
161 }
162 
163 void DIALOG_FIND::onTextEnter( wxCommandEvent& event )
164 {
165 }
166 
167 void DIALOG_FIND::onClose( wxCommandEvent& aEvent )
168 {
169 }
170 
171 
172 DIALOG_FIND_BASE::DIALOG_FIND_BASE( wxWindow* parent, wxWindowID id, const wxString& title,
173  const wxPoint& pos, const wxSize& size, long style ) :
174  DIALOG_SHIM( parent, id, title, pos, size, style )
175 {
176  // these members are initialized only to avoid warnings about non initialized vars
177  searchStringLabel = nullptr;
178  m_searchCombo = nullptr;
179  m_matchCase = nullptr;
180  m_matchWords = nullptr;
181  m_wildcards = nullptr;
182  m_wrap = nullptr;
183  m_includeValues = nullptr;
184  m_includeReferences = nullptr;
185  m_includeTexts = nullptr;
186  m_includeMarkers = nullptr;
187  m_includeVias = nullptr;
188  m_findNext = nullptr;
189  m_findPrevious = nullptr;
190  m_searchAgain = nullptr;
191  m_closeButton = nullptr;
192  m_status = nullptr;
193 }
194 
195 
197 {
198 }
199 
200 
202 {
203  return nullptr;
204 }
205 
206 
207 DIALOG_FILTER_SELECTION_BASE::DIALOG_FILTER_SELECTION_BASE( wxWindow* parent, wxWindowID id,
208  const wxString& title,
209  const wxPoint& pos, const wxSize& size,
210  long style ) :
211  DIALOG_SHIM( parent, id, title, pos, size, style )
212 {
213  // these members are initialized only to avoid warnings about non initialized vars
214  m_Include_Modules = nullptr;
215  m_Include_PcbTextes = nullptr;
216  m_IncludeLockedModules = nullptr;
217  m_Include_Draw_Items = nullptr;
218  m_Include_Tracks = nullptr;
219  m_Include_Vias = nullptr;
220  m_Include_Edges_Items = nullptr;
221  m_Include_Zones = nullptr;
222  m_sdbSizer1 = nullptr;
223  m_staticLine = nullptr;
224  m_sdbSizer1OK = nullptr;
225  m_sdbSizer1Cancel = nullptr;
226 }
227 
228 
230 {
231 }
232 
233 
235  DIALOG_FILTER_SELECTION_BASE( aParent ),
236  m_options( aOptions )
237 {
238  // silence another compiler warning about m_options not being used
239  if( m_options.includeModules )
240  {
241  }
242 }
243 
244 
245 void DIALOG_FILTER_SELECTION::checkBoxClicked( wxCommandEvent& aEvent )
246 {
247 }
248 
249 
250 void DIALOG_FILTER_SELECTION::ExecuteCommand( wxCommandEvent& event )
251 {
252 }
253 
254 
256 {
257 }
258 
259 
260 static const int viewer3dSchemaVersion = 0;
261 
263 
264 
266  : APP_SETTINGS_BASE( "3d_viewer", viewer3dSchemaVersion ),
267  m_Render(),
268  m_Camera()
269 {
270 }
271 
272 
273 bool EDA_3D_VIEWER_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg )
274 {
275  return false;
276 }
277 
278 #include "3d_viewer/eda_3d_viewer.h"
280 #include <3d-viewer/3d_viewer_id.h>
281 
289 const wxChar * EDA_3D_VIEWER::m_logTrace = wxT( "KI_TRACE_EDA_3D_VIEWER" );
290 
291 
292 BEGIN_EVENT_TABLE( EDA_3D_VIEWER, EDA_BASE_FRAME )
293 
294  EVT_ACTIVATE( EDA_3D_VIEWER::OnActivate )
295  EVT_SET_FOCUS( EDA_3D_VIEWER::OnSetFocus )
296 
298  EDA_3D_VIEWER::Process_Special_Functions )
299 
300  EVT_TOOL( ID_TOOL_SET_VISIBLE_ITEMS, EDA_3D_VIEWER::Install3DViewOptionDialog )
301 
302  EVT_MENU( wxID_CLOSE, EDA_3D_VIEWER::Exit3DFrame )
303  EVT_MENU( ID_RENDER_CURRENT_VIEW, EDA_3D_VIEWER::OnRenderEngineSelection )
304  EVT_MENU( ID_DISABLE_RAY_TRACING, EDA_3D_VIEWER::OnDisableRayTracing )
305 
306  EVT_CLOSE( EDA_3D_VIEWER::OnCloseWindow )
307 END_EVENT_TABLE()
308 
309 
310 EDA_3D_VIEWER::EDA_3D_VIEWER( KIWAY *aKiway, PCB_BASE_FRAME *aParent, const wxString &aTitle,
311  long style ) :
312  KIWAY_PLAYER( aKiway, aParent, FRAME_PCB_DISPLAY3D, aTitle, wxDefaultPosition,
313  wxDefaultSize, style, QUALIFIED_VIEWER3D_FRAMENAME( aParent ) ),
314  m_mainToolBar( nullptr ),
315  m_canvas( nullptr ),
316  m_currentCamera( m_trackBallCamera ),
317  m_trackBallCamera( RANGE_SCALE_3D ),
318  m_disable_ray_tracing( true )
319 {
320 
321 }
322 
323 
325 {
326 
327 }
328 
329 
331 {
332 
333 }
334 
335 
337 {
338 
339 }
340 
341 
342 void EDA_3D_VIEWER::NewDisplay( bool aForceImmediateRedraw )
343 {
344 
345 }
346 
347 
348 void EDA_3D_VIEWER::Exit3DFrame( wxCommandEvent &event )
349 {
350 
351 }
352 
353 
354 void EDA_3D_VIEWER::OnCloseWindow( wxCloseEvent &event )
355 {
356 
357 }
358 
359 
360 void EDA_3D_VIEWER::Process_Special_Functions( wxCommandEvent &event )
361 {
362 
363 }
364 
365 
366 void EDA_3D_VIEWER::OnRenderEngineSelection( wxCommandEvent &event )
367 {
368 
369 }
370 
371 
372 void EDA_3D_VIEWER::OnDisableRayTracing( wxCommandEvent& aEvent )
373 {
374 
375 }
376 
377 
378 void EDA_3D_VIEWER::OnActivate( wxActivateEvent &event )
379 {
380 
381 }
382 
383 
384 void EDA_3D_VIEWER::OnSetFocus(wxFocusEvent &event)
385 {
386 
387 }
388 
389 
391 {
392 
393 }
394 
395 
397 {
398 
399 }
400 
401 
403 {
404 
405 }
406 
407 
408 void EDA_3D_VIEWER::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged )
409 {
410 
411 }
412 
413 
414 void EDA_3D_VIEWER::takeScreenshot( wxCommandEvent& event )
415 {
416 
417 
418 }
419 
420 
422 {
423 
424 }
425 
426 
427 bool EDA_3D_VIEWER::Set3DColorFromUser( SFVEC4F &aColor, const wxString& aTitle,
428  CUSTOM_COLORS_LIST* aPredefinedColors,
429  bool aAllowOpacityControl,
430  KIGFX::COLOR4D aDefaultColor )
431 {
432 
433  return true;
434 }
435 
436 
438 {
439  return false;
440 }
441 
442 
444 {
445  return false;
446 }
447 
448 
449 void EDA_3D_VIEWER::Redraw(){};
450 
451 bool EDA_3D_VIEWER::Set3DCopperColorFromUser(){ return false; }
452 bool EDA_3D_VIEWER::Set3DBoardBodyColorFromUser() { return false; }
453 bool EDA_3D_VIEWER::Set3DSolderPasteColorFromUser() { return false; }
455 void EDA_3D_VIEWER::Install3DViewOptionDialog( wxCommandEvent& event ) { };
456 
458 
459 
464 {
465 public:
467 };
468 
469 
471  PCB_TOOL_BASE( "pcbnew.InteractiveSelection" ),
472  m_frame( NULL ),
473  m_additive( false ),
474  m_subtractive( false ),
475  m_exclusive_or( false ),
476  m_multiple( false ),
477  m_skip_heuristics( false ),
478  m_enteredGroup( NULL ),
479  m_priv( nullptr )
480 {
481 
482 }
483 
484 
486 {
487 }
488 
489 
491 {
492 
493  return true;
494 }
495 
496 
497 void PCB_SELECTION_TOOL::Reset( RESET_REASON aReason )
498 {
499 
500 }
501 
502 
503 int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
504 {
505 
506  return 0;
507 }
508 
509 
511 {
512 
513 }
514 
515 
516 void PCB_SELECTION_TOOL::ExitGroup( bool aSelectGroup )
517 {
518 
519 }
520 
521 
523 {
524  return m_selection;
525 }
526 
527 
529  bool aConfirmLockedItems )
530 {
531 
532  return m_selection;
533 }
534 
535 
537 {
539 }
540 
541 
542 bool PCB_SELECTION_TOOL::selectPoint( const VECTOR2I& aWhere, bool aOnDrag,
543  bool* aSelectionCancelledFlag,
544  CLIENT_SELECTION_FILTER aClientFilter )
545 {
546 
547 
548  return false;
549 }
550 
551 
552 bool PCB_SELECTION_TOOL::selectCursor( bool aForceSelect, CLIENT_SELECTION_FILTER aClientFilter )
553 {
554 
555  return false;
556 }
557 
558 
560 {
561 
562  return false;
563 }
564 
565 
567 {
568 
569  return 0;
570 }
571 
572 
574 {
575 
576  return 0;
577 }
578 
579 
580 int PCB_SELECTION_TOOL::SelectItems( const TOOL_EVENT& aEvent )
581 {
582 
583  return 0;
584 }
585 
586 
587 int PCB_SELECTION_TOOL::SelectItem( const TOOL_EVENT& aEvent )
588 {
589  return 0;
590 }
591 
592 
593 int PCB_SELECTION_TOOL::SelectAll( const TOOL_EVENT& aEvent )
594 {
595 
596 
597  return 0;
598 }
599 
600 
601 void PCB_SELECTION_TOOL::AddItemToSel( BOARD_ITEM* aItem, bool aQuietMode )
602 {
603 
604 }
605 
606 
608 {
609 
610  return 0;
611 }
612 
613 
614 int PCB_SELECTION_TOOL::UnselectItem( const TOOL_EVENT& aEvent )
615 {
616  return 0;
617 }
618 
619 
620 void PCB_SELECTION_TOOL::RemoveItemFromSel( BOARD_ITEM* aItem, bool aQuietMode )
621 {
622 
623 }
624 
625 
627 {
628 }
629 
630 
632 {
633 }
634 
635 
636 
637 
639 {
640 
641  return 0;
642 }
643 
644 
646  STOP_CONDITION aStopCondition )
647 {
648 
649 }
650 
651 
652 void PCB_SELECTION_TOOL::selectAllItemsOnNet( int aNetCode, bool aSelect )
653 {
654 
655 }
656 
657 
658 int PCB_SELECTION_TOOL::selectNet( const TOOL_EVENT& aEvent )
659 {
660 
661  return 0;
662 }
663 
664 
665 void PCB_SELECTION_TOOL::selectAllItemsOnSheet( wxString& aSheetPath )
666 {
667 
668 }
669 
670 
672 {
673 
674 }
675 
676 
678 {
679 
680  return 0;
681 }
682 
683 
685 {
686 
687  return 0;
688 }
689 
690 
692 {
693 
694 }
695 
696 
697 int PCB_SELECTION_TOOL::find( const TOOL_EVENT& aEvent )
698 {
699 
700  return 0;
701 }
702 
703 
711 static bool itemIsIncludedByFilter( const BOARD_ITEM& aItem, const BOARD& aBoard,
712  const DIALOG_FILTER_SELECTION::OPTIONS& aFilterOptions )
713 {
714 
715 
716  return false;
717 }
718 
719 
721 {
722 
723  return 0;
724 }
725 
726 
728 {
729 
730 }
731 
732 
734 {
735 
736 
737  return true;
738 }
739 
740 
741 void PCB_SELECTION_TOOL::ClearSelection( bool aQuietMode )
742 {
743 
744 }
745 
746 
748 {
749 
750 }
751 
752 
754 {
755 
756  return 0;
757 }
758 
759 
761 {
762  return false;
763 }
764 
765 
766 bool PCB_SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibilityOnly ) const
767 {
768  return false;
769 }
770 
771 
773 {
774 
775 }
776 
777 
779 {
780 
781 }
782 
783 void PCB_SELECTION_TOOL::highlight( BOARD_ITEM* aItem, int aMode, PCB_SELECTION* aGroup )
784 {
785 
786 }
787 
788 void PCB_SELECTION_TOOL::highlightInternal( BOARD_ITEM* aItem, int aMode, bool aUsingOverlay )
789 {
790 
791 }
792 
793 
794 void PCB_SELECTION_TOOL::unhighlight( BOARD_ITEM* aItem, int aMode, PCB_SELECTION* aGroup )
795 {
796 
797 }
798 
799 
800 void PCB_SELECTION_TOOL::unhighlightInternal( BOARD_ITEM* aItem, int aMode, bool aUsingOverlay )
801 {
802 
803 }
804 
805 
806 bool PCB_SELECTION_TOOL::selectionContains( const VECTOR2I& aPoint ) const
807 {
808 
809 
810  return false;
811 }
812 
814  const VECTOR2I& aWhere ) const
815 {
816 
817 }
818 
819 
821 {
822 
823 }
824 
825 
827 {
828 
829  return 0;
830 }
831 
832 
833 int PCB_SELECTION_TOOL::UpdateMenu( const TOOL_EVENT& aEvent )
834 {
835 
836  return 0;
837 }
838 
839 
841 {}
842 
843 void PCB_TOOL_BASE::doInteractiveItemPlacement( const std::string& aTool,
844  INTERACTIVE_PLACER_BASE* aPlacer,
845  const wxString& aCommitMessage, int aOptions )
846 {
847 }
848 
849 
850 bool PCB_TOOL_BASE::Init()
851 {
852  return true;
853 }
854 
855 
856 void PCB_TOOL_BASE::Reset( RESET_REASON aReason )
857 {
858 }
859 
860 
862 {
863 }
864 
865 
867 {
868  static PCB_DISPLAY_OPTIONS disp;
869 
870  return disp;
871 }
872 
874 {
875  return nullptr;
876 }
877 
878 
880 {
881  static PCB_SELECTION sel;
882 
883  return sel;
884 }
885 
886 
888 {
889  static PCB_SELECTION sel;
890 
891  return sel;
892 }
893 
894 
895 EDA_ITEM* PCB_SELECTION::GetTopLeftItem( bool onlyModules ) const
896 {
897  return nullptr;
898 }
899 
900 
902 {
903  std::vector<VIEW_ITEM*> items;
904 
905  return items;
906 }
907 
908 
910 {
911  return LSET();
912 }
913 
const GENERAL_COLLECTORS_GUIDE getCollectorsGuide() const
int selectSameSheet(const TOOL_EVENT &aEvent)
Find dialog callback.
virtual bool OpenProjectFiles(const std::vector< wxString > &aFileList, int aCtl=0)
Open a project or set of files given by aFileList.
Definition: kiway_player.h:115
BITMAP2CMP_SETTINGS kiface
A KIFACE (I)mplementation.
Definition: kiface_i.h:37
bool Set3DCopperColorFromUser()
Set the copper color from a set of colors.
int CursorSelection(const TOOL_EVENT &aEvent)
Clear current selection event handler.
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
Definition: kiway_player.h:61
void checkBoxClicked(wxCommandEvent &aEvent) override
Reference to the options struct to fill.
void select(BOARD_ITEM *aItem)
Take necessary action mark an item as selected.
DDE server & client.
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits) override
Typically start_common() is called from here.
void Install3DViewOptionDialog(wxCommandEvent &event)
void MacOpenFile(const wxString &aFileName) override
Specific to MacOSX (not used under Linux or Windows).
This file is part of the common library.
int find(const TOOL_EVENT &aEvent)
Invoke filter dialog and modify current selection.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:82
bool Set3DSolderMaskColorFromUser()
Set the solder mask color from a set of colors.
Container for data for KiCad programs.
Definition: pgm_base.h:131
int SelectionMenu(const TOOL_EVENT &aEvent)
Show a popup menu to trim the COLLECTOR passed as aEvent's parameter down to a single item.
static const int viewer3dSchemaVersion
Definition: mocks.cpp:260
glm::vec4 SFVEC4F
Definition: xv3d_types.h:46
void highlightInternal(BOARD_ITEM *aItem, int aHighlightMode, bool aUsingOverlay)
DIALOG_FILTER_SELECTION::OPTIONS m_filterOpts
virtual wxApp & App()
Returns a bare naked wxApp which may come from wxPython, SINGLE_TOP, or kicad.exe.
Definition: pgm_base.cpp:141
void Destroy()
Definition: pgm_base.cpp:130
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
const KIGFX::VIEW_GROUP::ITEMS updateDrawList() const override
Layer on which the group is drawn.
wxWindow * CreateWindow(wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
Create a wxWindow for the current project.
bool selectPoint(const VECTOR2I &aWhere, bool aOnDrag=false, bool *aSelectionCancelledFlag=NULL, CLIENT_SELECTION_FILTER aClientFilter=NULL)
Select an item pointed by the parameter aWhere.
virtual void Reset(RESET_REASON aReason) override
Bring the tool to a known, initial state.
void highlight(BOARD_ITEM *aItem, int aHighlightMode, PCB_SELECTION *aGroup=nullptr)
Highlight the item visually.
void OnKifaceEnd() override
Called just once just before the DSO is to be unloaded.
void SynchroniseColoursWithBoard()
Private implementation of firewalled private data.
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:83
void setTransitions() override
Zoom the screen to center and fit the current selection.
int UnselectItem(const TOOL_EVENT &aEvent)
void(* CLIENT_SELECTION_FILTER)(const VECTOR2I &, GENERAL_COLLECTOR &, PCB_SELECTION_TOOL *)
void Reset(RESET_REASON aReason) override
Bring the tool to a known, initial state.
Struct that will be set with the result of the user choices in the dialog.
std::vector< CUSTOM_COLOR_ITEM > CUSTOM_COLORS_LIST
bool doSelectionMenu(GENERAL_COLLECTOR *aItems)
Allow the selection of a single item from a list via pop-up menu.
void selectConnectedTracks(BOARD_CONNECTED_ITEM &aSourceItem, STOP_CONDITION aStopCondition)
Select connected tracks and vias.
void OnKiwayEnd()
Definition: kiway.cpp:602
DIALOG_FIND_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=wxEmptyString, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE)
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:106
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
int UnselectItems(const TOOL_EVENT &aEvent)
void Exit3DFrame(wxCommandEvent &event)
Called when user press the File->Exit.
void loadCommonSettings()
Load configuration from common settings.
KIFACE_I(const char *aKifaceName, KIWAY::FACE_T aId)
Definition: kiface_i.h:64
void onTextEnter(wxCommandEvent &event) override
Definition: dialog_find.cpp:93
void RebuildSelection()
Rebuild the selection from the EDA_ITEMs' selection flags.
bool Init() override
Init() is called once upon a registration of the tool.
PCB_SELECTION & GetSelection()
Return the set of currently selected items.
Class DIALOG_FILTER_SELECTION_BASE.
void OnActivate(wxActivateEvent &event)
void UnbrightenItem(BOARD_ITEM *aItem)
int updateSelection(const TOOL_EVENT &aEvent)
Event handler to update the selection VIEW_ITEM.
static bool itemIsIncludedByFilter(const BOARD_ITEM &aItem, const BOARD &aBoard, const DIALOG_FILTER_SELECTION::OPTIONS &aFilterOptions)
Function itemIsIncludedByFilter()
Definition: mocks.cpp:711
Container for display options like enable/disable some optional drawings.
void OnDisableRayTracing(wxCommandEvent &aEvent)
LSET is a set of PCB_LAYER_IDs.
void onFindNextClick(wxCommandEvent &event) override
Definition: dialog_find.cpp:98
bool selectMultiple()
Handle drawing a selection box that allows one to select many items at the same time.
const PCB_SELECTION & selection() const
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:99
#define NULL
int selectNet(const TOOL_EVENT &aEvent)
Select all copper connections belonging to the same net(s) as the items in the selection.
void onFindPreviousClick(wxCommandEvent &event) override
void OnPgmExit()
Definition: mock_pgm.cpp:75
virtual void setTransitions() override
This method is meant to be overridden in order to specify handlers for events.
PGM_BASE * PgmOrNull()
similar to PGM_BASE& Pgm(), but return a reference that can be nullptr when running a shared lib from...
Definition: cvpcb.cpp:112
int expandConnection(const TOOL_EVENT &aEvent)
Expand the current track selection to the next boundary (junctions, pads, or all)
void AddItemToSel(BOARD_ITEM *aItem, bool aQuietMode=false)
Select all items on the board.
bool Set3DSilkScreenColorFromUser()
Set the silkscreen color from a set of colors.
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Generic, UI-independent tool event.
Definition: tool_event.h:173
FP_LIB_TABLE GFootprintTable
!!!!!!!!!!!!!! This code is obsolete because of the merge into pcbnew, don't bother with it.
Definition: mocks.cpp:42
void findCallback(BOARD_ITEM *aItem)
Find an item.
virtual bool MigrateFromLegacy(wxConfigBase *aLegacyConfig) override
Migrates from wxConfig to JSON-based configuration.
DIALOG_FIND(PCB_BASE_FRAME *aParent)
Definition: dialog_find.cpp:52
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
bool Selectable(const BOARD_ITEM *aItem, bool checkVisibilityOnly=false) const
Check conditions for an item to be selected.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition: kiway.h:260
void OnCloseWindow(wxCloseEvent &event)
pcbnew DSO
Definition: kiway.h:269
bool Set3DColorFromUser(SFVEC4F &aColor, const wxString &aTitle, CUSTOM_COLORS_LIST *aPredefinedColors, bool aAllowOpacityControl=false, KIGFX::COLOR4D aDefaultColor=KIGFX::COLOR4D(1.0, 1.0, 1.0, 1.0))
Get a SFVEC3D from a color dialog.
EDA_ITEM * GetTopLeftItem(bool aFootprintsOnly=false) const override
void BrightenItem(BOARD_ITEM *aItem)
PCB_SELECTION m_selection
void ExitGroup(bool aSelectGroup=false)
Leave the currently entered group.
void unselect(BOARD_ITEM *aItem)
Take necessary action mark an item as unselected.
void * IfaceOrAddress(int aDataId) override
Return pointer to the requested object.
bool Set3DSolderPasteColorFromUser()
Set the solder mask color from a set of colors.
const PCB_DISPLAY_OPTIONS & displayOptions() const
FACE_T
Known KIFACE implementations.
Definition: kiway.h:266
void onClose(wxCommandEvent &event) override
void RenderEngineChanged()
RenderEngineChanged - Update toolbar icon and call canvas RenderEngineChanged.
std::vector< VIEW_ITEM * > ITEMS
Definition: view_group.h:119
int selectSheetContents(const TOOL_EVENT &aEvent)
Select all footprints belonging to same hierarchical sheet as the selected footprint (same sheet path...
int Main(const TOOL_EVENT &aEvent)
The main loop.
int SelectItems(const TOOL_EVENT &aEvent)
Item unselection event handler.
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
int SelectItem(const TOOL_EVENT &aEvent)
bool selectCursor(bool aForceSelect=false, CLIENT_SELECTION_FILTER aClientFilter=NULL)
Select an item under the cursor unless there is something already selected or aSelectAlways is true.
see class PGM_BASE
PCB_SELECTION & RequestSelection(CLIENT_SELECTION_FILTER aClientFilter, bool aConfirmLockedItems=false)
Return the current selection set, filtered according to aFlags and aClientFilter.
Declaration of the eda_3d_viewer class.
IFACE(const char *aDSOname, KIWAY::FACE_T aType)
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:190
PGM_SINGLE_TOP program
DIALOG_FILTER_SELECTION(PCB_BASE_FRAME *aParent, OPTIONS &aOptions)
Used when the right click button is pressed, or when the select tool is in effect.
Definition: collectors.h:241
void setupUIConditions() override
Setup the UI conditions for the various actions and their controls in this frame.
The base frame for deriving all KiCad main window classes.
void OnRenderEngineSelection(wxCommandEvent &event)
virtual bool Init() override
Init() is called once upon a registration of the tool.
static void NeighboringSegmentFilter(const VECTOR2I &aPt, GENERAL_COLLECTOR &aCollector)
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:149
int UpdateMenu(const TOOL_EVENT &aEvent)
Pass the selection to a conditional menu for updating.
EVT_TOOL_RANGE(ID_START_COMMAND_3D, ID_MENU_COMMAND_END, EDA_3D_VIEWER::Process_Special_Functions) EDA_3D_VIEWER
Definition: mocks.cpp:297
void OnSetFocus(wxFocusEvent &event)
int SelectAll(const TOOL_EVENT &aEvent)
Multiple item selection event handler.
bool itemPassesFilter(BOARD_ITEM *aItem)
Create and handle a window for the 3d viewer connected to a Kiway and a pcbboard.
Definition: eda_3d_viewer.h:66
void selectAllItemsOnNet(int aNetCode, bool aSelect=true)
Select all items with the given net code.
DIALOG_FILTER_SELECTION_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Filter Selected Items"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
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...
void RemoveItemFromSel(BOARD_ITEM *aItem, bool aQuietMode=false)
Multiple item unselection event handler.
void FilterCollectorForGroups(GENERAL_COLLECTOR &aCollector) const
void ExecuteCommand(wxCommandEvent &event) override
A general implementation of a COLLECTORS_GUIDE.
Definition: collectors.h:381
void onSearchAgainClick(wxCommandEvent &event) override
bool selectionContains(const VECTOR2I &aPoint) const
int ClearSelection(const TOOL_EVENT &aEvent)
PCB_DRAW_PANEL_GAL * canvas() const
void FilterCollectedItems(GENERAL_COLLECTOR &aCollector)
void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged) override
Notification that common settings are updated.
void unhighlightInternal(BOARD_ITEM *aItem, int aHighlightMode, bool aUsingOverlay)
void GuessSelectionCandidates(GENERAL_COLLECTOR &aCollector, const VECTOR2I &aWhere) const
Try to guess best selection candidates in case multiple items are clicked, by doing some brain-dead h...
void NewDisplay(bool aForceImmediateRedraw=false)
Reload and refresh (rebuild) the 3D scene.
const LSET GetSelectionLayers()
#define RANGE_SCALE_3D
This defines the range that all coord will have to be rendered.
Definition: board_adapter.h:61
void selectAllItemsOnSheet(wxString &aSheetPath)
Select all items with the given sheet timestamp/UUID name (the sheet path).
#define QUALIFIED_VIEWER3D_FRAMENAME(parent)
Definition: eda_3d_viewer.h:51
void unhighlight(BOARD_ITEM *aItem, int aHighlightMode, PCB_SELECTION *aGroup=nullptr)
Unhighlight the item visually.
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
Class DIALOG_FIND_BASE.
int PGM_BASE * aProgram
Definition: cvpcb.cpp:97
int filterSelection(const TOOL_EVENT &aEvent)
Return true if the given item passes the current SELECTION_FILTER_OPTIONS.
bool Set3DBoardBodyColorFromUser()
Set the copper color from a set of colors.
void ReloadRequest()
Request reloading the 3D view.
FOOTPRINT * GetFootprintFromBoardByReference()
KIWAY Kiway
void Process_Special_Functions(wxCommandEvent &event)
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:98
void takeScreenshot(wxCommandEvent &event)
Create a Screenshot of the current 3D view.