KiCad PCB EDA Suite
GERBVIEW_CONTROL Class Reference

Handle actions that are shared between different frames in Pcbnew. More...

#include <gerbview_control.h>

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

 GERBVIEW_CONTROL ()
 
 ~GERBVIEW_CONTROL () override
 
void Reset (RESET_REASON aReason) override
 Bring the tool to a known, initial state. More...
 
int DisplayControl (const TOOL_EVENT &aEvent)
 
int LayerNext (const TOOL_EVENT &aEvent)
 
int LayerPrev (const TOOL_EVENT &aEvent)
 
int ClearLayer (const TOOL_EVENT &aEvent)
 
int ClearAllLayers (const TOOL_EVENT &aEvent)
 
int ReloadAllLayers (const TOOL_EVENT &aEvent)
 
int OpenGerber (const TOOL_EVENT &aEvent)
 
int OpenDrillFile (const TOOL_EVENT &aEvent)
 
int OpenJobFile (const TOOL_EVENT &aEvent)
 
int OpenZipFile (const TOOL_EVENT &aEvent)
 
int ToggleLayerManager (const TOOL_EVENT &aEvent)
 
int HighlightControl (const TOOL_EVENT &aEvent)
 
int ExportToPcbnew (const TOOL_EVENT &aEvent)
 
int UpdateMessagePanel (const TOOL_EVENT &aEvent)
 
int Print (const TOOL_EVENT &aEvent)
 Set up handlers for various events. More...
 
void setTransitions () override
 This method is meant to be overridden in order to specify handlers for events. 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...
 
virtual bool Init ()
 Init() is called once upon a registration of the tool. 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 Member Functions

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

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 Attributes

GERBVIEW_FRAMEm_frame
 

Detailed Description

Handle actions that are shared between different frames in Pcbnew.

Definition at line 33 of file gerbview_control.h.

Member Enumeration Documentation

◆ 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

◆ GERBVIEW_CONTROL()

GERBVIEW_CONTROL::GERBVIEW_CONTROL ( )

Definition at line 42 of file gerbview_control.cpp.

42  : TOOL_INTERACTIVE( "gerbview.Control" ), m_frame( nullptr )
43 {
44 }
GERBVIEW_FRAME * m_frame
TOOL_INTERACTIVE(TOOL_ID aId, const std::string &aName)
Create a tool with given id & name.

◆ ~GERBVIEW_CONTROL()

GERBVIEW_CONTROL::~GERBVIEW_CONTROL ( )
inlineoverride

Definition at line 37 of file gerbview_control.h.

37 { }

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(), PAD_TOOL::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().

◆ canvas()

EDA_DRAW_PANEL_GAL* GERBVIEW_CONTROL::canvas ( )
inlineprotected

Definition at line 72 of file gerbview_control.h.

73  {
74  return m_frame->GetCanvas();
75  }
GERBVIEW_FRAME * m_frame
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.

References EDA_DRAW_FRAME::GetCanvas(), and m_frame.

Referenced by ClearAllLayers(), DisplayControl(), HighlightControl(), OpenDrillFile(), OpenJobFile(), and OpenZipFile().

◆ ClearAllLayers()

int GERBVIEW_CONTROL::ClearAllLayers ( const TOOL_EVENT aEvent)

Definition at line 314 of file gerbview_control.cpp.

315 {
316  m_frame->Clear_DrawLayers( false );
318  canvas()->Refresh();
320 
321  // Clear pending highlight selections, now outdated
323  static_cast<KIGFX::GERBVIEW_PAINTER*>( getView()->GetPainter() )->GetSettings();
324  settings->ClearHighlightSelections();
325 
326  return 0;
327 }
bool Clear_DrawLayers(bool query)
GERBVIEW_FRAME * m_frame
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
static TOOL_ACTION zoomFitScreen
Definition: actions.h:96
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:143
void ClearHighlightSelections()
Clear all highlight selections (dcode, net, component, attribute selection)
Store GerbView specific render settings.
virtual void ClearMsgPanel()
Clear all messages from the message panel.
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition: tool_base.cpp:36
EDA_DRAW_PANEL_GAL * canvas()
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...

References canvas(), GERBVIEW_FRAME::Clear_DrawLayers(), KIGFX::GERBVIEW_RENDER_SETTINGS::ClearHighlightSelections(), EDA_DRAW_FRAME::ClearMsgPanel(), TOOL_BASE::getView(), m_frame, TOOL_BASE::m_toolMgr, EDA_DRAW_PANEL_GAL::Refresh(), TOOL_MANAGER::RunAction(), and ACTIONS::zoomFitScreen.

Referenced by setTransitions().

◆ ClearLayer()

int GERBVIEW_CONTROL::ClearLayer ( const TOOL_EVENT aEvent)

Definition at line 305 of file gerbview_control.cpp.

306 {
309 
310  return 0;
311 }
GERBVIEW_FRAME * m_frame
void Erase_Current_DrawLayer(bool query)
virtual void ClearMsgPanel()
Clear all messages from the message panel.

References EDA_DRAW_FRAME::ClearMsgPanel(), GERBVIEW_FRAME::Erase_Current_DrawLayer(), and m_frame.

Referenced by setTransitions().

◆ DisplayControl()

int GERBVIEW_CONTROL::DisplayControl ( const TOOL_EVENT aEvent)

Definition at line 226 of file gerbview_control.cpp.

227 {
228  bool state;
229  bool needs_refresh = false;
230  auto options = m_frame->GetDisplayOptions();
231 
233  {
234  options.m_DisplayLinesFill = !options.m_DisplayLinesFill;
235  needs_refresh = true;
236  }
238  {
239  options.m_DisplayFlashedItemsFill = !options.m_DisplayFlashedItemsFill;
240  needs_refresh = true;
241  }
243  {
244  options.m_DisplayPolygonsFill = !options.m_DisplayPolygonsFill;
245  needs_refresh = true;
246  }
248  {
251  }
252  else if( aEvent.IsAction( &GERBVIEW_ACTIONS::dcodeDisplay ) )
253  {
256  }
257  else if( aEvent.IsAction( &ACTIONS::highContrastMode ) )
258  {
259  options.m_HighContrastMode = !options.m_HighContrastMode;
260  needs_refresh = true;
261  }
262  else if( aEvent.IsAction( &GERBVIEW_ACTIONS::toggleDiffMode ) )
263  {
264  options.m_DiffMode = !options.m_DiffMode;
265  needs_refresh = true;
266  }
267  else if( aEvent.IsAction( &GERBVIEW_ACTIONS::flipGerberView ) )
268  {
269  options.m_FlipGerberView = !options.m_FlipGerberView;
270 
271  KIGFX::VIEW* view = canvas()->GetView();
272  view->SetMirror( options.m_FlipGerberView, false );
273  needs_refresh = true;
274  }
275 
276  if( needs_refresh )
277  m_frame->UpdateDisplayOptions( options );
278 
279  return 0;
280 }
GERBVIEW_FRAME * m_frame
const GBR_DISPLAY_OPTIONS & GetDisplayOptions() const
void SetMirror(bool aMirrorX, bool aMirrorY)
Control the mirroring of the VIEW.
Definition: view.cpp:537
static TOOL_ACTION dcodeDisplay
static TOOL_ACTION negativeObjectDisplay
bool m_DisplayLinesFill
Option to draw line items (filled/sketch)
bool IsAction(const TOOL_ACTION *aAction) const
Test if the event contains an action issued upon activation of the given TOOL_ACTION.
Definition: tool_event.cpp:88
static TOOL_ACTION toggleDiffMode
static TOOL_ACTION flipGerberView
void UpdateDisplayOptions(const GBR_DISPLAY_OPTIONS &aOptions)
Update the display options and refreshes the view as needed.
static TOOL_ACTION linesDisplayOutlines
bool IsElementVisible(int aLayerID) const
Test whether a given element category is visible.
virtual KIGFX::VIEW * GetView() const
Return a pointer to the #VIEW instance used in the panel.
static TOOL_ACTION flashedDisplayOutlines
static TOOL_ACTION polygonsDisplayOutlines
EDA_DRAW_PANEL_GAL * canvas()
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:68
static TOOL_ACTION highContrastMode
Definition: actions.h:103
void SetElementVisibility(int aLayerID, bool aNewState)
Change the visibility of an element category.

References canvas(), GERBVIEW_ACTIONS::dcodeDisplay, GERBVIEW_ACTIONS::flashedDisplayOutlines, GERBVIEW_ACTIONS::flipGerberView, GERBVIEW_FRAME::GetDisplayOptions(), EDA_DRAW_PANEL_GAL::GetView(), ACTIONS::highContrastMode, TOOL_EVENT::IsAction(), GERBVIEW_FRAME::IsElementVisible(), LAYER_DCODES, LAYER_NEGATIVE_OBJECTS, GERBVIEW_ACTIONS::linesDisplayOutlines, GBR_DISPLAY_OPTIONS::m_DisplayLinesFill, m_frame, GERBVIEW_ACTIONS::negativeObjectDisplay, GERBVIEW_ACTIONS::polygonsDisplayOutlines, GERBVIEW_FRAME::SetElementVisibility(), KIGFX::VIEW::SetMirror(), GERBVIEW_ACTIONS::toggleDiffMode, and GERBVIEW_FRAME::UpdateDisplayOptions().

Referenced by setTransitions().

◆ ExportToPcbnew()

int GERBVIEW_CONTROL::ExportToPcbnew ( const TOOL_EVENT aEvent)

Definition at line 97 of file gerbview_control.cpp.

98 {
99  int layercount = 0;
100 
102 
103  // Count the Gerber layers which are actually currently used
104  for( LAYER_NUM ii = 0; ii < (LAYER_NUM)images->ImagesMaxCount(); ++ii )
105  {
106  if( images->GetGbrImage( ii ) )
107  layercount++;
108  }
109 
110  if( layercount == 0 )
111  {
112  DisplayInfoMessage( m_frame, _( "None of the Gerber layers contain any data" ) );
113  return 0;
114  }
115 
116  wxString fileDialogName( NAMELESS_PROJECT + wxT( "." ) + KiCadPcbFileExtension );
117  wxString path = m_frame->GetMruPath();
118 
119  wxFileDialog filedlg( m_frame, _( "Board File Name" ), path, fileDialogName, PcbFileWildcard(),
120  wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
121 
122  if( filedlg.ShowModal() == wxID_CANCEL )
123  return 0;
124 
125  wxFileName fileName = filedlg.GetPath();
126 
127  /* Install a dialog frame to choose the mapping
128  * between gerber layers and Pcbnew layers
129  */
130  LAYERS_MAP_DIALOG* layerdlg = new LAYERS_MAP_DIALOG( m_frame );
131  int ok = layerdlg->ShowModal();
132  layerdlg->Destroy();
133 
134  if( ok != wxID_OK )
135  return 0;
136 
137  // If no extension was entered, then force the extension to be a KiCad PCB file
138  if( !fileName.HasExt() )
139  fileName.SetExt( KiCadPcbFileExtension );
140 
141  m_frame->SetMruPath( fileName.GetPath() );
142 
143  GBR_TO_PCB_EXPORTER gbr_exporter( m_frame, fileName.GetFullPath() );
144 
145  gbr_exporter.ExportPcb( layerdlg->GetLayersLookUpTable(), layerdlg->GetCopperLayersCount() );
146 
147  return 0;
148 }
GERBVIEW_FRAME * m_frame
void SetMruPath(const wxString &aPath)
int LAYER_NUM
This can be replaced with int and removed.
Definition: layer_ids.h:41
const std::string KiCadPcbFileExtension
GERBER_FILE_IMAGE_LIST is a helper class to handle a list of GERBER_FILE_IMAGE files which are loaded...
wxString GetMruPath() const
Show the Gerber files loaded and allow the user to choose between Gerber layers and pcb layers.
GERBER_FILE_IMAGE * GetGbrImage(int aIdx)
#define _(s)
GBR_LAYOUT * GetGerberLayout() const
#define NAMELESS_PROJECT
default name for nameless projects
Definition: project.h:41
GERBER_FILE_IMAGE_LIST * GetImagesList() const
Definition: gbr_layout.cpp:41
wxString PcbFileWildcard()
bool ExportPcb(const LAYER_NUM *aLayerLookUpTable, int aCopperLayers)
Save a board from a set of Gerber images.
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
Definition: confirm.cpp:307
A helper class to export a Gerber set of files to Pcbnew.

References _, DisplayInfoMessage(), GBR_TO_PCB_EXPORTER::ExportPcb(), LAYERS_MAP_DIALOG::GetCopperLayersCount(), GERBER_FILE_IMAGE_LIST::GetGbrImage(), GERBVIEW_FRAME::GetGerberLayout(), GBR_LAYOUT::GetImagesList(), LAYERS_MAP_DIALOG::GetLayersLookUpTable(), EDA_BASE_FRAME::GetMruPath(), GERBER_FILE_IMAGE_LIST::ImagesMaxCount(), KiCadPcbFileExtension, m_frame, NAMELESS_PROJECT, path, PcbFileWildcard(), and EDA_BASE_FRAME::SetMruPath().

Referenced by setTransitions().

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

◆ 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(), 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(), PAD_TOOL::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(), 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(), SCH_MOVE_TOOL::moveItem(), PL_EDIT_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(), 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::updateParentItem(), 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(), PAD_TOOL::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(), PAD_TOOL::setTransitions(), PCB_POINT_EDITOR::setTransitions(), setTransitions(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::setTransitions(), GLOBAL_EDIT_TOOL::setTransitions(), GROUP_TOOL::setTransitions(), PL_EDITOR_CONTROL::setTransitions(), SYMBOL_EDITOR_CONTROL::setTransitions(), SYMBOL_EDITOR_EDIT_TOOL::setTransitions(), SCH_MOVE_TOOL::setTransitions(), PL_EDIT_TOOL::setTransitions(), POSITION_RELATIVE_TOOL::setTransitions(), GERBVIEW_SELECTION_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_CONTROL::setTransitions(), SCH_LINE_WIRE_BUS_TOOL::setTransitions(), CVPCB_ASSOCIATION_TOOL::setTransitions(), BOARD_INSPECTION_TOOL::setTransitions(), BOARD_EDITOR_CONTROL::setTransitions(), PICKER_TOOL::setTransitions(), EDIT_TOOL::setTransitions(), PCB_SELECTION_TOOL::setTransitions(), PL_SELECTION_TOOL::setTransitions(), SCH_EDITOR_CONTROL::setTransitions(), DRAWING_TOOL::setTransitions(), and EE_SELECTION_TOOL::setTransitions().

◆ HighlightControl()

int GERBVIEW_CONTROL::HighlightControl ( const TOOL_EVENT aEvent)

Definition at line 151 of file gerbview_control.cpp.

152 {
153  auto settings = static_cast<KIGFX::GERBVIEW_PAINTER*>( getView()->GetPainter() )->GetSettings();
154  const auto& selection = m_toolMgr->GetTool<GERBVIEW_SELECTION_TOOL>()->GetSelection();
155  GERBER_DRAW_ITEM* item = nullptr;
156 
157  if( selection.Size() == 1 )
158  {
159  item = static_cast<GERBER_DRAW_ITEM*>( selection[0] );
160  }
161 
163  {
164  m_frame->m_SelComponentBox->SetSelection( 0 );
165  m_frame->m_SelNetnameBox->SetSelection( 0 );
166  m_frame->m_SelAperAttributesBox->SetSelection( 0 );
167 
168  settings->ClearHighlightSelections();
169 
171 
172  if( gerber )
173  gerber->m_Selected_Tool = settings->m_dcodeHighlightValue;
174  }
175  else if( item && aEvent.IsAction( &GERBVIEW_ACTIONS::highlightNet ) )
176  {
177  wxString net_name = item->GetNetAttributes().m_Netname;
178  settings->m_netHighlightString = net_name;
179  m_frame->m_SelNetnameBox->SetStringSelection( UnescapeString( net_name ) );
180  }
181  else if( item && aEvent.IsAction( &GERBVIEW_ACTIONS::highlightComponent ) )
182  {
183  wxString net_attr = item->GetNetAttributes().m_Cmpref;
184  settings->m_componentHighlightString = net_attr;
185  m_frame->m_SelComponentBox->SetStringSelection( net_attr );
186  }
187  else if( item && aEvent.IsAction( &GERBVIEW_ACTIONS::highlightAttribute ) )
188  {
189  D_CODE* apertDescr = item->GetDcodeDescr();
190 
191  if( apertDescr )
192  {
193  wxString ap_name = apertDescr->m_AperFunction;
194  settings->m_attributeHighlightString = ap_name;
195  m_frame->m_SelAperAttributesBox->SetStringSelection( ap_name );
196  }
197  }
198  else if( item && aEvent.IsAction( &GERBVIEW_ACTIONS::highlightDCode ) )
199  {
200  D_CODE* apertDescr = item->GetDcodeDescr();
201 
202  if( apertDescr )
203  {
204  int dcodeSelected = -1;
206 
207  if( gerber )
208  dcodeSelected = apertDescr->m_Num_Dcode;
209 
210  if( dcodeSelected > 0 )
211  {
212  settings->m_dcodeHighlightValue = dcodeSelected;
213  gerber->m_Selected_Tool = dcodeSelected;
214  m_frame->syncLayerBox( false );
215  }
216  }
217  }
218 
220  canvas()->Refresh();
221 
222  return 0;
223 }
D_CODE * GetDcodeDescr() const
Return the GetDcodeDescr of this object, or NULL.
GERBVIEW_FRAME * m_frame
void syncLayerBox(bool aRebuildLayerBox=false)
Update the currently "selected" layer within m_SelLayerBox.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
Definition: view.cpp:1424
Hold the image data and parameters for one gerber file and layer parameters.
wxString m_Cmpref
the component reference parent of the data
Color has changed.
Definition: view_item.h:48
static TOOL_ACTION highlightNet
wxChoice * m_SelNetnameBox
bool IsAction(const TOOL_ACTION *aAction) const
Test if the event contains an action issued upon activation of the given TOOL_ACTION.
Definition: tool_event.cpp:88
static TOOL_ACTION highlightAttribute
GERBER_FILE_IMAGE * GetGbrImage(int aIdx) const
int m_Num_Dcode
D code value ( >= 10 )
Definition: dcode.h:190
wxString m_Netname
for items associated to a net: the netname
virtual KIGFX::VIEW * GetView() const
Return a pointer to the #VIEW instance used in the panel.
const GBR_NETLIST_METADATA & GetNetAttributes() const
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition: tool_base.cpp:36
wxString UnescapeString(const wxString &aSource)
wxString m_AperFunction
the aperture attribute (created by a TA.AperFunction command).
Definition: dcode.h:200
int GetActiveLayer() const
Return the active layer.
Selection tool for GerbView, based on the one in Pcbnew.
wxChoice * m_SelAperAttributesBox
A gerber DCODE (also called Aperture) definition.
Definition: dcode.h:80
static TOOL_ACTION highlightClear
EDA_DRAW_PANEL_GAL * canvas()
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
wxChoice * m_SelComponentBox
static TOOL_ACTION highlightDCode
static TOOL_ACTION highlightComponent

References canvas(), KIGFX::COLOR, GERBVIEW_FRAME::GetActiveLayer(), GERBER_DRAW_ITEM::GetDcodeDescr(), GERBVIEW_FRAME::GetGbrImage(), GERBER_DRAW_ITEM::GetNetAttributes(), TOOL_MANAGER::GetTool(), EDA_DRAW_PANEL_GAL::GetView(), TOOL_BASE::getView(), GERBVIEW_ACTIONS::highlightAttribute, GERBVIEW_ACTIONS::highlightClear, GERBVIEW_ACTIONS::highlightComponent, GERBVIEW_ACTIONS::highlightDCode, GERBVIEW_ACTIONS::highlightNet, TOOL_EVENT::IsAction(), D_CODE::m_AperFunction, GBR_NETLIST_METADATA::m_Cmpref, m_frame, GBR_NETLIST_METADATA::m_Netname, D_CODE::m_Num_Dcode, GERBVIEW_FRAME::m_SelAperAttributesBox, GERBVIEW_FRAME::m_SelComponentBox, GERBER_FILE_IMAGE::m_Selected_Tool, GERBVIEW_FRAME::m_SelNetnameBox, TOOL_BASE::m_toolMgr, EDA_DRAW_PANEL_GAL::Refresh(), GERBVIEW_FRAME::syncLayerBox(), UnescapeString(), and KIGFX::VIEW::UpdateAllItems().

Referenced by setTransitions().

◆ Init()

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

◆ LayerNext()

int GERBVIEW_CONTROL::LayerNext ( const TOOL_EVENT aEvent)

Definition at line 283 of file gerbview_control.cpp.

284 {
285  int layer = m_frame->GetActiveLayer();
286 
287  if( layer < GERBER_DRAWLAYERS_COUNT - 1 )
288  m_frame->SetActiveLayer( layer + 1, true );
289 
290  return 0;
291 }
GERBVIEW_FRAME * m_frame
void SetActiveLayer(int aLayer, bool doLayerWidgetUpdate=true)
change the currently active layer to aLayer and update the GERBER_LAYER_WIDGET.
#define GERBER_DRAWLAYERS_COUNT
Definition: layer_ids.h:378
int GetActiveLayer() const
Return the active layer.

References GERBER_DRAWLAYERS_COUNT, GERBVIEW_FRAME::GetActiveLayer(), m_frame, and GERBVIEW_FRAME::SetActiveLayer().

Referenced by setTransitions().

◆ LayerPrev()

int GERBVIEW_CONTROL::LayerPrev ( const TOOL_EVENT aEvent)

Definition at line 294 of file gerbview_control.cpp.

295 {
296  int layer = m_frame->GetActiveLayer();
297 
298  if( layer > 0 )
299  m_frame->SetActiveLayer( layer - 1, true );
300 
301  return 0;
302 }
GERBVIEW_FRAME * m_frame
void SetActiveLayer(int aLayer, bool doLayerWidgetUpdate=true)
change the currently active layer to aLayer and update the GERBER_LAYER_WIDGET.
int GetActiveLayer() const
Return the active layer.

References GERBVIEW_FRAME::GetActiveLayer(), m_frame, and GERBVIEW_FRAME::SetActiveLayer().

Referenced by setTransitions().

◆ OpenDrillFile()

int GERBVIEW_CONTROL::OpenDrillFile ( const TOOL_EVENT aEvent)

Definition at line 62 of file gerbview_control.cpp.

63 {
64  m_frame->LoadExcellonFiles( wxEmptyString );
65  canvas()->Refresh();
66 
67  return 0;
68 }
GERBVIEW_FRAME * m_frame
EDA_DRAW_PANEL_GAL * canvas()
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
bool LoadExcellonFiles(const wxString &aFileName)
Load a drill (EXCELLON) file or many files.

References canvas(), GERBVIEW_FRAME::LoadExcellonFiles(), m_frame, and EDA_DRAW_PANEL_GAL::Refresh().

Referenced by setTransitions().

◆ OpenGerber()

int GERBVIEW_CONTROL::OpenGerber ( const TOOL_EVENT aEvent)

Definition at line 53 of file gerbview_control.cpp.

54 {
55  m_frame->LoadGerberFiles( wxEmptyString );
56  // loadListOfGerberAndDrillFiles() refreshes the canvas
57 
58  return 0;
59 }
GERBVIEW_FRAME * m_frame
bool LoadGerberFiles(const wxString &aFileName)
Load a given Gerber file or selected file(s), if the filename is empty.

References GERBVIEW_FRAME::LoadGerberFiles(), and m_frame.

Referenced by setTransitions().

◆ OpenJobFile()

int GERBVIEW_CONTROL::OpenJobFile ( const TOOL_EVENT aEvent)

Definition at line 71 of file gerbview_control.cpp.

72 {
73  m_frame->LoadGerberJobFile( wxEmptyString );
74  canvas()->Refresh();
75 
76  return 0;
77 }
GERBVIEW_FRAME * m_frame
bool LoadGerberJobFile(const wxString &aFileName)
Load a Gerber job file, and load gerber files found in job files.
EDA_DRAW_PANEL_GAL * canvas()
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...

References canvas(), GERBVIEW_FRAME::LoadGerberJobFile(), m_frame, and EDA_DRAW_PANEL_GAL::Refresh().

Referenced by setTransitions().

◆ OpenZipFile()

int GERBVIEW_CONTROL::OpenZipFile ( const TOOL_EVENT aEvent)

Definition at line 80 of file gerbview_control.cpp.

81 {
82  m_frame->LoadZipArchiveFile( wxEmptyString );
83  canvas()->Refresh();
84 
85  return 0;
86 }
GERBVIEW_FRAME * m_frame
bool LoadZipArchiveFile(const wxString &aFileName)
Load a zipped archive file.
EDA_DRAW_PANEL_GAL * canvas()
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...

References canvas(), GERBVIEW_FRAME::LoadZipArchiveFile(), m_frame, and EDA_DRAW_PANEL_GAL::Refresh().

Referenced by setTransitions().

◆ Print()

int GERBVIEW_CONTROL::Print ( const TOOL_EVENT aEvent)

Set up handlers for various events.

Definition at line 309 of file dialog_print_gerbview.cpp.

310 {
311  // Selection affects the original item visibility
313 
316  DIALOG_PRINT_GERBVIEW dlg( m_frame, &settings );
317  dlg.ForcePrintBorder( false );
318  dlg.ShowModal();
319 
320  return 0;
321 }
static TOOL_ACTION selectionClear
Clear the current selection.
GERBVIEW_FRAME * m_frame
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
COLOR_SETTINGS * m_colorSettings
The color settings to be used for printing.
Definition: printout.h:66
const PAGE_INFO & GetPageSettings() const override
virtual COLOR_SETTINGS * GetColorSettings() const
Returns a pointer to the active color theme settings.

References DIALOG_PRINT_GENERIC::ForcePrintBorder(), EDA_DRAW_FRAME::GetColorSettings(), GERBVIEW_FRAME::GetPageSettings(), PRINTOUT_SETTINGS::m_colorSettings, m_frame, TOOL_BASE::m_toolMgr, TOOL_MANAGER::RunAction(), and GERBVIEW_ACTIONS::selectionClear.

Referenced by setTransitions().

◆ ReloadAllLayers()

int GERBVIEW_CONTROL::ReloadAllLayers ( const TOOL_EVENT aEvent)

Definition at line 330 of file gerbview_control.cpp.

331 {
332  // Store filenames
333  wxArrayString listOfGerberFiles;
334  std::vector<int> fileType;
336 
337  for( unsigned i = 0; i < list->ImagesMaxCount(); i++ )
338  {
339  if( list->GetGbrImage( i ) == nullptr )
340  continue;
341 
342  if( !list->GetGbrImage( i )->m_InUse )
343  continue;
344 
345  EXCELLON_IMAGE* drill_file = dynamic_cast<EXCELLON_IMAGE*>( list->GetGbrImage( i ) );
346 
347  if( drill_file )
348  fileType.push_back( 1 );
349  else
350  fileType.push_back( 0 );
351 
352  listOfGerberFiles.Add( list->GetGbrImage( i )->m_FileName );
353  }
354 
355  // Clear all layers
356  m_frame->Clear_DrawLayers( false );
358 
359  // Load the layers from stored paths
360  wxBusyCursor wait;
361  m_frame->LoadListOfGerberAndDrillFiles( wxEmptyString, listOfGerberFiles, &fileType );
362 
363  return 0;
364 }
bool Clear_DrawLayers(bool query)
GERBVIEW_FRAME * m_frame
GERBER_FILE_IMAGE_LIST is a helper class to handle a list of GERBER_FILE_IMAGE files which are loaded...
GERBER_FILE_IMAGE * GetGbrImage(int aIdx)
bool LoadListOfGerberAndDrillFiles(const wxString &aPath, const wxArrayString &aFilenameList, const std::vector< int > *aFileType=nullptr)
Load a list of Gerber and NC drill files and updates the view based on them.
FormatType fileType(const char *aFileName)
Definition: loadmodel.cpp:278
virtual void ClearMsgPanel()
Clear all messages from the message panel.
Handle a drill image.
GERBER_FILE_IMAGE_LIST * GetImagesList() const
Accessors to GERBER_FILE_IMAGE_LIST and GERBER_FILE_IMAGE data.

References GERBVIEW_FRAME::Clear_DrawLayers(), EDA_DRAW_FRAME::ClearMsgPanel(), fileType(), GERBER_FILE_IMAGE_LIST::GetGbrImage(), GERBVIEW_FRAME::GetImagesList(), GERBER_FILE_IMAGE_LIST::ImagesMaxCount(), GERBVIEW_FRAME::LoadListOfGerberAndDrillFiles(), GERBER_FILE_IMAGE::m_FileName, m_frame, and GERBER_FILE_IMAGE::m_InUse.

Referenced by setTransitions().

◆ Reset()

void GERBVIEW_CONTROL::Reset ( RESET_REASON  aReason)
overridevirtual

Bring the tool to a known, initial state.

If the tool claimed anything from the model or the view, it must release it when its reset.

Parameters
aReasoncontains information about the reason of tool reset.

Implements TOOL_BASE.

Definition at line 47 of file gerbview_control.cpp.

48 {
49  m_frame = getEditFrame<GERBVIEW_FRAME>();
50 }
GERBVIEW_FRAME * m_frame

References m_frame.

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

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

◆ setTransitions()

void GERBVIEW_CONTROL::setTransitions ( )
overridevirtual

This method is meant to be overridden in order to specify handlers for events.

It is called every time tool is reset or finished.

Implements TOOL_INTERACTIVE.

Definition at line 389 of file gerbview_control.cpp.

390 {
397  Go( &GERBVIEW_CONTROL::Print, ACTIONS::print.MakeEvent() );
398 
404 
410 
419 
423 }
int OpenJobFile(const TOOL_EVENT &aEvent)
int OpenGerber(const TOOL_EVENT &aEvent)
static const TOOL_EVENT SelectedEvent
Definition: actions.h:199
static TOOL_ACTION openDrillFile
static TOOL_ACTION openGerber
static const TOOL_EVENT UnselectedEvent
Definition: actions.h:200
int OpenZipFile(const TOOL_EVENT &aEvent)
int Print(const TOOL_EVENT &aEvent)
Set up handlers for various events.
static TOOL_ACTION clearAllLayers
int LayerPrev(const TOOL_EVENT &aEvent)
static TOOL_ACTION layerNext
static TOOL_ACTION exportToPcbnew
static TOOL_ACTION toggleLayerManager
int UpdateMessagePanel(const TOOL_EVENT &aEvent)
static TOOL_ACTION print
Definition: actions.h:57
int HighlightControl(const TOOL_EVENT &aEvent)
static TOOL_ACTION highlightNet
int ClearLayer(const TOOL_EVENT &aEvent)
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 layerPrev
static TOOL_ACTION dcodeDisplay
static TOOL_ACTION negativeObjectDisplay
static TOOL_ACTION toggleDiffMode
static TOOL_ACTION flipGerberView
int ReloadAllLayers(const TOOL_EVENT &aEvent)
static TOOL_ACTION highlightAttribute
static TOOL_ACTION linesDisplayOutlines
static TOOL_ACTION openJobFile
static const TOOL_EVENT ClearedEvent
Selected item had a property changed (except movement)
Definition: actions.h:201
static TOOL_ACTION flashedDisplayOutlines
static TOOL_ACTION clearLayer
int LayerNext(const TOOL_EVENT &aEvent)
static TOOL_ACTION highlightClear
int OpenDrillFile(const TOOL_EVENT &aEvent)
static TOOL_ACTION polygonsDisplayOutlines
int ExportToPcbnew(const TOOL_EVENT &aEvent)
static TOOL_ACTION highlightDCode
int DisplayControl(const TOOL_EVENT &aEvent)
int ToggleLayerManager(const TOOL_EVENT &aEvent)
static TOOL_ACTION highContrastMode
Definition: actions.h:103
int ClearAllLayers(const TOOL_EVENT &aEvent)
static TOOL_ACTION reloadAllLayers
static TOOL_ACTION openZipFile
static TOOL_ACTION highlightComponent

References ClearAllLayers(), GERBVIEW_ACTIONS::clearAllLayers, EVENTS::ClearedEvent, ClearLayer(), GERBVIEW_ACTIONS::clearLayer, GERBVIEW_ACTIONS::dcodeDisplay, DisplayControl(), GERBVIEW_ACTIONS::exportToPcbnew, ExportToPcbnew(), GERBVIEW_ACTIONS::flashedDisplayOutlines, GERBVIEW_ACTIONS::flipGerberView, TOOL_INTERACTIVE::Go(), ACTIONS::highContrastMode, GERBVIEW_ACTIONS::highlightAttribute, GERBVIEW_ACTIONS::highlightClear, GERBVIEW_ACTIONS::highlightComponent, HighlightControl(), GERBVIEW_ACTIONS::highlightDCode, GERBVIEW_ACTIONS::highlightNet, LayerNext(), GERBVIEW_ACTIONS::layerNext, LayerPrev(), GERBVIEW_ACTIONS::layerPrev, GERBVIEW_ACTIONS::linesDisplayOutlines, GERBVIEW_ACTIONS::negativeObjectDisplay, OpenDrillFile(), GERBVIEW_ACTIONS::openDrillFile, OpenGerber(), GERBVIEW_ACTIONS::openGerber, OpenJobFile(), GERBVIEW_ACTIONS::openJobFile, OpenZipFile(), GERBVIEW_ACTIONS::openZipFile, GERBVIEW_ACTIONS::polygonsDisplayOutlines, ACTIONS::print, Print(), ReloadAllLayers(), GERBVIEW_ACTIONS::reloadAllLayers, EVENTS::SelectedEvent, GERBVIEW_ACTIONS::toggleDiffMode, ToggleLayerManager(), GERBVIEW_ACTIONS::toggleLayerManager, EVENTS::UnselectedEvent, and UpdateMessagePanel().

◆ ToggleLayerManager()

int GERBVIEW_CONTROL::ToggleLayerManager ( const TOOL_EVENT aEvent)

Definition at line 89 of file gerbview_control.cpp.

90 {
92 
93  return 0;
94 }
GERBVIEW_FRAME * m_frame

References m_frame, and GERBVIEW_FRAME::ToggleLayerManager().

Referenced by setTransitions().

◆ UpdateMessagePanel()

int GERBVIEW_CONTROL::UpdateMessagePanel ( const TOOL_EVENT aEvent)

Definition at line 367 of file gerbview_control.cpp.

368 {
370  GERBVIEW_SELECTION& selection = selTool->GetSelection();
371 
372  if( selection.GetSize() == 1 )
373  {
374  EDA_ITEM* item = (EDA_ITEM*) selection.Front();
375 
376  std::vector<MSG_PANEL_ITEM> msgItems;
377  item->GetMsgPanelInfo( m_frame, msgItems );
378  m_frame->SetMsgPanel( msgItems );
379  }
380  else
381  {
382  m_frame->EraseMsgBox();
383  }
384 
385  return 0;
386 }
GERBVIEW_FRAME * m_frame
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
virtual void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
Definition: eda_item.h:214
GERBVIEW_SELECTION & GetSelection()
Return the set of currently selected items.
Selection tool for GerbView, based on the one in Pcbnew.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100

References EDA_DRAW_FRAME::EraseMsgBox(), EDA_ITEM::GetMsgPanelInfo(), GERBVIEW_SELECTION_TOOL::GetSelection(), TOOL_MANAGER::GetTool(), m_frame, TOOL_BASE::m_toolMgr, and EDA_DRAW_FRAME::SetMsgPanel().

Referenced by setTransitions().

◆ 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(), PAD_TOOL::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(), SCH_MOVE_TOOL::Main(), PL_SELECTION_TOOL::Main(), EDA_3D_CONTROLLER::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_frame

◆ 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(), PAD_TOOL::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(), PAD_TOOL::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(), SCH_MOVE_TOOL::Main(), EDA_3D_CONTROLLER::Main(), PL_SELECTION_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(), 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(), PAD_TOOL::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(), PAD_TOOL::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(), PAD_TOOL::EnumeratePads(), EE_INSPECTION_TOOL::ExcludeMarker(), PCB_SELECTION_TOOL::expandConnection(), PAD_TOOL::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(), 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(), PAD_TOOL::Init(), CONVERT_TOOL::Init(), PL_DRAWING_TOOLS::Init(), GLOBAL_EDIT_TOOL::Init(), SYMBOL_EDITOR_CONTROL::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(), SYMBOL_EDITOR_MOVE_TOOL::Main(), CVPCB_CONTROL::Main(), SCH_MOVE_TOOL::Main(), PL_SELECTION_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(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), PL_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), PAD_TOOL::pastePadProperties(), 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(), Print(), SYMBOL_EDITOR_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), PAD_TOOL::pushPadSettings(), EE_SELECTION_TOOL::RebuildSelection(), 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(), 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(), UpdateMessagePanel(), PL_EDITOR_CONTROL::UpdateMessagePanel(), PCB_CONTROL::UpdateMessagePanel(), EDIT_TOOL::updateModificationPoint(), 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().


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