KiCad PCB EDA Suite
COMMON_TOOLS Class Reference

Class COMMON_TOOLS. More...

#include <common_tools.h>

Inheritance diagram for COMMON_TOOLS:
TOOL_INTERACTIVE TOOL_BASE

Public Types

enum  RESET_REASON { RUN, MODEL_RELOAD, GAL_SWITCH }
 

Determines the reason of reset for a tool

More...
 

Public Member Functions

 COMMON_TOOLS ()
 
 ~COMMON_TOOLS () override
 
void Reset (RESET_REASON aReason) override
 Function Reset() Brings the tool to a known, initial state. More...
 
int SelectionTool (const TOOL_EVENT &aEvent)
 
int ZoomRedraw (const TOOL_EVENT &aEvent)
 
int ZoomInOut (const TOOL_EVENT &aEvent)
 
int ZoomInOutCenter (const TOOL_EVENT &aEvent)
 
int ZoomCenter (const TOOL_EVENT &aEvent)
 
int ZoomFitScreen (const TOOL_EVENT &aEvent)
 
int ZoomPreset (const TOOL_EVENT &aEvent)
 
int CenterContents (const TOOL_EVENT &aEvent)
 
int PanControl (const TOOL_EVENT &aEvent)
 
int CursorControl (const TOOL_EVENT &aEvent)
 
int ToggleCursor (const TOOL_EVENT &aEvent)
 
int ToggleCursorStyle (const TOOL_EVENT &aEvent)
 
int ImperialUnits (const TOOL_EVENT &aEvent)
 
int MetricUnits (const TOOL_EVENT &aEvent)
 
int ToggleUnits (const TOOL_EVENT &aEvent)
 
int TogglePolarCoords (const TOOL_EVENT &aEvent)
 
int ResetLocalCoords (const TOOL_EVENT &aEvent)
 
int GridNext (const TOOL_EVENT &aEvent)
 
int GridPrev (const TOOL_EVENT &aEvent)
 
int GridPreset (const TOOL_EVENT &aEvent)
 
int ToggleGrid (const TOOL_EVENT &aEvent)
 
int GridProperties (const TOOL_EVENT &aEvent)
 
int GridPreset (int idx)
 
int SwitchCanvas (const TOOL_EVENT &aEvent)
 
void Activate ()
 Function Activate() Runs the tool. More...
 
TOOL_MENUGetToolMenu ()
 
void SetContextMenu (ACTION_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger=CMENU_BUTTON)
 Function SetContextMenu() More...
 
void RunMainStack (std::function< void()> aFunc)
 Function RunMainStack() More...
 
template<class T >
void Go (int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
 Function Go() More...
 
TOOL_EVENTWait (const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
 Function Wait() More...
 
virtual bool Init ()
 Function Init() Init() is called once upon a registration of the tool. More...
 
TOOL_TYPE GetType () const
 Function GetType() Returns the type of the tool. More...
 
TOOL_ID GetId () const
 Function GetId() Returns the unique identifier of the tool. More...
 
const std::string & GetName () const
 Function GetName() Returns the name of the tool. More...
 
TOOL_MANAGERGetManager () const
 Function GetManager() Returns the instance of TOOL_MANAGER that takes care of the tool. More...
 
TOOL_SETTINGSGetSettings ()
 
bool IsToolActive () const
 

Protected Member Functions

void attachManager (TOOL_MANAGER *aManager)
 Function attachManager() More...
 
KIGFX::VIEWgetView () const
 Function getView() More...
 
KIGFX::VIEW_CONTROLSgetViewControls () const
 Function getViewControls() More...
 
template<typename T >
T * getEditFrame () const
 Function getEditFrame() More...
 
template<typename T >
T * getModel () const
 Function getModel() More...
 

Protected Attributes

TOOL_MENU m_menu
 functions below are not yet implemented - their interface may change More...
 
TOOL_TYPE m_type
 

Stores the type of the tool.

More...
 
TOOL_ID m_toolId
 

Unique identifier for the tool, assigned by a TOOL_MANAGER instance.

More...
 
std::string m_toolName
 

Name of the tool.

More...
 
TOOL_MANAGERm_toolMgr
 
TOOL_SETTINGS m_toolSettings
 

Private Member Functions

void setTransitions () override
 

Sets up handlers for various events.

More...
 
int doZoomInOut (bool aDirection, bool aCenterOnCursor)
 
int doZoomToPreset (int idx, bool aCenterOnCursor)
 

Note: idx == 0 is Auto; idx == 1 is first entry in zoomList

More...
 

Private Attributes

EDA_DRAW_FRAMEm_frame
 

Pointer to the currently used edit frame.

More...
 

Detailed Description

Class COMMON_TOOLS.

Handles actions that are shared between different applications

Definition at line 38 of file common_tools.h.

Member Enumeration Documentation

◆ RESET_REASON

enum TOOL_BASE::RESET_REASON
inherited

Determines 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 79 of file tool_base.h.

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

Constructor & Destructor Documentation

◆ COMMON_TOOLS()

COMMON_TOOLS::COMMON_TOOLS ( )
inline

Definition at line 41 of file common_tools.h.

41  :
42  TOOL_INTERACTIVE( "common.Control" ),
43  m_frame( nullptr )
44  { }
EDA_DRAW_FRAME * m_frame
Pointer to the currently used edit frame.
Definition: common_tools.h:92
TOOL_INTERACTIVE(TOOL_ID aId, const std::string &aName)
Constructor.

◆ ~COMMON_TOOLS()

COMMON_TOOLS::~COMMON_TOOLS ( )
inlineoverride

Definition at line 46 of file common_tools.h.

46 { }

Member Function Documentation

◆ Activate()

void TOOL_INTERACTIVE::Activate ( )
inherited

Function Activate() Runs 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:219
TOOL_ID m_toolId
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:214
bool InvokeTool(TOOL_ID aToolId)
Function InvokeTool() Calls 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(), LIB_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCBNEW_CONTROL::DeleteItemCursor(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), LIB_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PCB_EDITOR_CONTROL::DrillOrigin(), PAD_TOOL::EnumeratePads(), PCBNEW_CONTROL::GridSetOrigin(), SCH_EDITOR_CONTROL::HighlightNetCursor(), PCB_INSPECTION_TOOL::HighlightNetTool(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), PCB_INSPECTION_TOOL::LocalRatsnestTool(), PL_EDIT_TOOL::Main(), SCH_MOVE_TOOL::Main(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), PCBNEW_PICKER_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), EDIT_TOOL::Move(), LIB_TREE::onContextMenu(), POINT_EDITOR::OnSelectionChange(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), EDIT_TOOL::Remove(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), DRAWING_TOOL::SetAnchor(), DRC::ShowDRCDialog(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ attachManager()

void TOOL_BASE::attachManager ( TOOL_MANAGER aManager)
protectedinherited

Function attachManager()

Sets 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  m_toolSettings = TOOL_SETTINGS( this );
64 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
TOOL_SETTINGS m_toolSettings
Definition: tool_base.h:220
friend class TOOL_SETTINGS
Definition: tool_base.h:154

References TOOL_BASE::m_toolMgr, TOOL_BASE::m_toolSettings, and TOOL_BASE::TOOL_SETTINGS.

Referenced by TOOL_MANAGER::RegisterTool().

◆ CenterContents()

int COMMON_TOOLS::CenterContents ( const TOOL_EVENT aEvent)

Definition at line 279 of file common_tools.cpp.

280 {
281  EDA_DRAW_PANEL_GAL* canvas = m_frame->GetCanvas();
282  BOX2I bBox = getModel<EDA_ITEM>()->ViewBBox();
283 
284  if( bBox.GetWidth() == 0 || bBox.GetHeight() == 0 )
285  bBox = canvas->GetDefaultViewBBox();
286 
287  getView()->SetCenter( bBox.Centre() );
288 
289  // Take scrollbars into account
290  VECTOR2D scrollbarSize = VECTOR2D( canvas->GetSize() - canvas->GetClientSize() );
291  VECTOR2D worldScrollbarSize = getView()->ToWorld( scrollbarSize, false );
292  getView()->SetCenter( getView()->GetCenter() + worldScrollbarSize / 2.0 );
293 
294  return 0;
295 }
EDA_DRAW_FRAME * m_frame
Pointer to the currently used edit frame.
Definition: common_tools.h:92
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Function ToWorld() Converts a screen space point/vector to a point/vector in world space coordinates.
Definition: view.cpp:475
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
void SetCenter(const VECTOR2D &aCenter)
Function SetCenter() Sets the center point of the VIEW (i.e.
Definition: view.cpp:604
VECTOR2< double > VECTOR2D
Definition: vector2d.h:586
coord_type GetWidth() const
Definition: box2.h:195
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
Vec Centre() const
Definition: box2.h:77
coord_type GetHeight() const
Definition: box2.h:196
virtual BOX2I GetDefaultViewBBox() const
Returns the bounding box of the view that should be used if model is not valid For example,...

References BOX2< Vec >::Centre(), EDA_DRAW_FRAME::GetCanvas(), EDA_DRAW_PANEL_GAL::GetDefaultViewBBox(), BOX2< Vec >::GetHeight(), TOOL_BASE::getView(), BOX2< Vec >::GetWidth(), m_frame, KIGFX::VIEW::SetCenter(), and KIGFX::VIEW::ToWorld().

Referenced by setTransitions().

◆ CursorControl()

int COMMON_TOOLS::CursorControl ( const TOOL_EVENT aEvent)

Definition at line 57 of file common_tools.cpp.

58 {
59  long type = aEvent.Parameter<intptr_t>();
60  bool fastMove = type & ACTIONS::CURSOR_FAST_MOVE;
61  type &= ~ACTIONS::CURSOR_FAST_MOVE;
62  bool mirroredX = getView()->IsMirroredX();
63 
64  VECTOR2D cursor = getViewControls()->GetRawCursorPosition( false );
65  VECTOR2I gridSize = VECTOR2D( m_frame->GetScreen()->GetGridSize() );
66 
67  if( fastMove )
68  gridSize = gridSize * 10;
69 
70  switch( type )
71  {
72  case ACTIONS::CURSOR_UP:
73  cursor -= VECTOR2D( 0, gridSize.y );
74  break;
75 
77  cursor += VECTOR2D( 0, gridSize.y );
78  break;
79 
81  cursor -= VECTOR2D( mirroredX ? -gridSize.x : gridSize.x, 0 );
82  break;
83 
85  cursor += VECTOR2D( mirroredX ? -gridSize.x : gridSize.x, 0 );
86  break;
87 
88  case ACTIONS::CURSOR_CLICK: // fall through
91  {
94  int modifiers = 0;
95 
96  modifiers |= wxGetKeyState( WXK_SHIFT ) ? MD_SHIFT : 0;
97  modifiers |= wxGetKeyState( WXK_CONTROL ) ? MD_CTRL : 0;
98  modifiers |= wxGetKeyState( WXK_ALT ) ? MD_ALT : 0;
99 
100  if( type == ACTIONS::CURSOR_DBL_CLICK )
101  action = TA_MOUSE_DBLCLICK;
102 
103  if( type == ACTIONS::CURSOR_RIGHT_CLICK )
104  button = BUT_RIGHT;
105 
106  TOOL_EVENT evt( TC_MOUSE, action, button | modifiers );
107  evt.SetMousePosition( getViewControls()->GetCursorPosition() );
108  m_toolMgr->ProcessEvent( evt );
109 
110  return 0;
111  }
112  default:
113  wxFAIL_MSG( "CursorControl(): unexpected request" );
114  }
115 
116  getViewControls()->SetCursorPosition( cursor, true, true );
118 
119  return 0;
120 }
EDA_DRAW_FRAME * m_frame
Pointer to the currently used edit frame.
Definition: common_tools.h:92
const wxRealPoint & GetGridSize() const
Return the grid size of the currently selected grid.
Definition: base_screen.h:279
TOOL_ACTIONS
Definition: tool_event.h:61
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:109
VECTOR2< double > VECTOR2D
Definition: vector2d.h:586
bool ProcessEvent(const TOOL_EVENT &aEvent)
Propagates an event to tools that requested events of matching type(s).
T Parameter() const
Function Parameter() Returns a non-standard parameter assigned to the event.
Definition: tool_event.h:427
Class TOOL_EVENT.
Definition: tool_event.h:168
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
bool IsMirroredX() const
Function IsMirroredX() Returns true if view is flipped across the X axis.
Definition: view.h:230
TOOL_MOUSE_BUTTONS
Definition: tool_event.h:121
virtual VECTOR2D GetRawCursorPosition(bool aSnappingEnabled=true) const =0
Returns the current cursor position in world coordinates - ingoring the cursorUp position force mode.
Class ACTIONS.
Definition: actions.h:43
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:42
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
static TOOL_ACTION refreshPreview
Definition: actions.h:101
virtual void SetCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true, bool aTriggeredByArrows=false)=0
Moves cursor to the requested position expressed in world coordinates.

References BUT_LEFT, BUT_RIGHT, ACTIONS::CURSOR_CLICK, ACTIONS::CURSOR_DBL_CLICK, ACTIONS::CURSOR_DOWN, ACTIONS::CURSOR_FAST_MOVE, ACTIONS::CURSOR_LEFT, ACTIONS::CURSOR_RIGHT, ACTIONS::CURSOR_RIGHT_CLICK, ACTIONS::CURSOR_UP, BASE_SCREEN::GetGridSize(), KIGFX::VIEW_CONTROLS::GetRawCursorPosition(), EDA_DRAW_FRAME::GetScreen(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), KIGFX::VIEW::IsMirroredX(), m_frame, TOOL_BASE::m_toolMgr, MD_ALT, MD_CTRL, MD_SHIFT, TOOL_EVENT::Parameter(), TOOL_MANAGER::ProcessEvent(), ACTIONS::refreshPreview, TOOL_MANAGER::RunAction(), KIGFX::VIEW_CONTROLS::SetCursorPosition(), TOOL_EVENT::SetMousePosition(), TA_MOUSE_CLICK, TA_MOUSE_DBLCLICK, TC_MOUSE, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by setTransitions().

◆ doZoomInOut()

int COMMON_TOOLS::doZoomInOut ( bool  aDirection,
bool  aCenterOnCursor 
)
private

Definition at line 181 of file common_tools.cpp.

182 {
183  double zoom = m_frame->GetCanvas()->GetLegacyZoom();
184 
185  // Step must be AT LEAST 1.3
186  if( aDirection )
187  zoom /= 1.3;
188  else
189  zoom *= 1.3;
190 
191  // Now look for the next closest menu step
192  std::vector<double>& zoomList = m_frame->GetScreen()->m_ZoomList;
193  int idx;
194 
195  if( aDirection )
196  {
197  for( idx = zoomList.size() - 1; idx >= 0; --idx )
198  {
199  if( zoomList[idx] <= zoom )
200  break;
201  }
202 
203  if( idx < 0 )
204  idx = 0; // if we ran off the end then peg to the end
205  }
206  else
207  {
208  for( idx = 0; idx < (int)zoomList.size(); ++idx )
209  {
210  if( zoomList[idx] >= zoom )
211  break;
212  }
213 
214  if( idx >= (int)zoomList.size() )
215  idx = zoomList.size() - 1; // if we ran off the end then peg to the end
216  }
217 
218  return doZoomToPreset( idx + 1, aCenterOnCursor );
219 }
EDA_DRAW_FRAME * m_frame
Pointer to the currently used edit frame.
Definition: common_tools.h:92
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
int doZoomToPreset(int idx, bool aCenterOnCursor)
Note: idx == 0 is Auto; idx == 1 is first entry in zoomList
double GetLegacyZoom() const
Function GetLegacyZoom() Returns current view scale converted to zoom value used by the legacy canvas...
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
std::vector< double > m_ZoomList
standard zoom (i.e. scale) coefficients.
Definition: base_screen.h:138

References doZoomToPreset(), EDA_DRAW_FRAME::GetCanvas(), EDA_DRAW_PANEL_GAL::GetLegacyZoom(), EDA_DRAW_FRAME::GetScreen(), m_frame, and BASE_SCREEN::m_ZoomList.

Referenced by ZoomInOut(), and ZoomInOutCenter().

◆ doZoomToPreset()

int COMMON_TOOLS::doZoomToPreset ( int  idx,
bool  aCenterOnCursor 
)
private

Note: idx == 0 is Auto; idx == 1 is first entry in zoomList

Definition at line 306 of file common_tools.cpp.

307 {
308  std::vector<double>& zoomList = m_frame->GetScreen()->m_ZoomList;
309  KIGFX::VIEW* view = m_frame->GetCanvas()->GetView();
310 
311  if( idx == 0 ) // Zoom Auto
312  {
314  return ZoomFitScreen( dummy );
315  }
316  else
317  {
318  idx--;
319  }
320 
321  double scale = m_frame->GetZoomLevelCoeff() / zoomList[idx];
322 
323  if( aCenterOnCursor )
324  {
325  view->SetScale( scale, getViewControls()->GetCursorPosition() );
326 
327  if( getViewControls()->IsCursorWarpingEnabled() )
329  }
330  else
331  {
332  view->SetScale( scale );
333  }
334 
335  return 0;
336 }
EDA_DRAW_FRAME * m_frame
Pointer to the currently used edit frame.
Definition: common_tools.h:92
int ZoomFitScreen(const TOOL_EVENT &aEvent)
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
virtual void CenterOnCursor() const =0
Function CenterOnCursor() Sets the viewport center to the current cursor position and warps the curso...
double GetZoomLevelCoeff() const
Return the coefficient to convert internal display scale factor to zoom level.
Class TOOL_EVENT.
Definition: tool_event.h:168
virtual KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
virtual void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 })
Function SetScale() Sets the scaling factor, zooming around a given anchor point.
Definition: view.cpp:578
const int scale
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:42
Class VIEW.
Definition: view.h:61
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
std::vector< double > m_ZoomList
standard zoom (i.e. scale) coefficients.
Definition: base_screen.h:138

References KIGFX::VIEW_CONTROLS::CenterOnCursor(), dummy(), EDA_DRAW_FRAME::GetCanvas(), EDA_DRAW_FRAME::GetScreen(), EDA_DRAW_PANEL_GAL::GetView(), TOOL_BASE::getViewControls(), EDA_DRAW_FRAME::GetZoomLevelCoeff(), m_frame, BASE_SCREEN::m_ZoomList, scale, KIGFX::VIEW::SetScale(), and ZoomFitScreen().

Referenced by doZoomInOut(), and ZoomPreset().

◆ getEditFrame()

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

Function getEditFrame()

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

Definition at line 187 of file tool_base.h.

188  {
189 #if !defined( QA_TEST ) // Dynamic casts give the linker a siezure in the test framework
190  wxASSERT( dynamic_cast<T*>( getEditFrameInt() ) );
191 #endif
192  return static_cast<T*>( getEditFrameInt() );
193  }
EDA_BASE_FRAME * getEditFrameInt() const
Definition: tool_base.cpp:48

References TOOL_BASE::getEditFrameInt().

Referenced by ZONE_CREATE_HELPER::createNewZone(), and TOOL_SETTINGS::getConfigBase().

◆ GetId()

TOOL_ID TOOL_BASE::GetId ( ) const
inlineinherited

Function GetId() Returns the unique identifier of the tool.

The identifier is set by an instance of TOOL_MANAGER.

Returns
Identifier of the tool.

Definition at line 121 of file tool_base.h.

122  {
123  return m_toolId;
124  }
TOOL_ID m_toolId
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:214

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(), and TOOL_MANAGER::saveViewControls().

◆ GetManager()

TOOL_MANAGER* TOOL_BASE::GetManager ( ) const
inlineinherited

Function GetManager() Returns the instance of TOOL_MANAGER that takes care of the tool.

Returns
Instance of the TOOL_MANAGER. If there is no TOOL_MANAGER associated, it returns NULL.

Definition at line 143 of file tool_base.h.

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

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

Function getModel()

Returns the model object if it matches the requested type.

Definition at line 201 of file tool_base.h.

202  {
203  EDA_ITEM* m = getModelInt();
204 #if !defined( QA_TEST ) // Dynamic casts give the linker a siezure in the test framework
205  wxASSERT( dynamic_cast<T*>( m ) );
206 #endif
207  return static_cast<T*>( m );
208  }
EDA_ITEM * getModelInt() const
Definition: tool_base.cpp:54
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:163

References TOOL_BASE::getModelInt().

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

◆ GetName()

const std::string& TOOL_BASE::GetName ( void  ) const
inlineinherited

Function GetName() Returns 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 132 of file tool_base.h.

133  {
134  return m_toolName;
135  }
std::string m_toolName
Name of the tool.
Definition: tool_base.h:218

References TOOL_BASE::m_toolName.

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

◆ GetSettings()

TOOL_SETTINGS & TOOL_BASE::GetSettings ( )
inherited

Definition at line 78 of file tool_base.cpp.

79 {
80  return m_toolSettings;
81 }
TOOL_SETTINGS m_toolSettings
Definition: tool_base.h:220

References TOOL_BASE::m_toolSettings.

Referenced by ROUTER_TOOL::Init(), GERBVIEW_SELECTION_TOOL::selectable(), and ROUTER_TOOL::~ROUTER_TOOL().

◆ GetToolMenu()

◆ GetType()

TOOL_TYPE TOOL_BASE::GetType ( ) const
inlineinherited

Function GetType() Returns the type of the tool.

Returns
The type of the tool.

Definition at line 110 of file tool_base.h.

111  {
112  return m_type;
113  }
TOOL_TYPE m_type
Stores the type of the tool.
Definition: tool_base.h:211

References TOOL_BASE::m_type.

Referenced by TOOL_MANAGER::finishTool(), TOOL_MANAGER::InvokeTool(), TOOL_MANAGER::ResetTools(), and TOOL_MANAGER::runTool().

◆ getView()

KIGFX::VIEW * TOOL_BASE::getView ( ) const
protectedinherited

Function getView()

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

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

Referenced by EE_POINT_EDITOR::addCornerCondition(), ALIGN_DISTRIBUTE_TOOL::AlignLeft(), ALIGN_DISTRIBUTE_TOOL::AlignRight(), CenterContents(), PL_SELECTION_TOOL::ClearSelection(), EE_SELECTION_TOOL::ClearSelection(), CursorControl(), LIB_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCBNEW_CONTROL::DeleteItemCursor(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), PL_EDIT_TOOL::DoDelete(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), MICROWAVE_TOOL::drawMicrowaveInductor(), PL_DRAWING_TOOLS::DrawShape(), PCB_EDITOR_CONTROL::DrillOrigin(), LIB_EDIT_TOOL::Duplicate(), PAD_TOOL::EnumeratePads(), EE_SELECTION_TOOL::GetNode(), ROUTER_TOOL::getStartLayer(), GridPreset(), PCBNEW_CONTROL::GridResetOrigin(), PCBNEW_CONTROL::GridSetOrigin(), SELECTION_TOOL::GuessSelectionCandidates(), PL_SELECTION_TOOL::highlight(), EE_SELECTION_TOOL::highlight(), SELECTION_TOOL::highlight(), GERBVIEW_CONTROL::HighlightControl(), PNS::TOOL_BASE::highlightNet(), PCB_INSPECTION_TOOL::highlightNet(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_MOVE_TOOL::moveItem(), PL_EDIT_TOOL::moveItem(), POINT_EDITOR::OnSelectionChange(), PanControl(), LIB_EDIT_TOOL::Paste(), PL_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), PNS::TOOL_BASE::pickSingleItem(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Remove(), PCB_EDITOR_CONTROL::Reset(), PNS::TOOL_BASE::Reset(), PCBNEW_CONTROL::Reset(), GERBVIEW_SELECTION_TOOL::Reset(), DRAWING_TOOL::Reset(), EE_SELECTION_TOOL::Reset(), SELECTION_TOOL::Reset(), EE_TOOL_BASE< SCH_BASE_FRAME >::Reset(), SCH_EDIT_TOOL::Rotate(), GERBVIEW_SELECTION_TOOL::select(), SELECTION_TOOL::Selectable(), GERBVIEW_SELECTION_TOOL::selectable(), PL_SELECTION_TOOL::selectionContains(), EE_SELECTION_TOOL::selectionContains(), SELECTION_TOOL::selectionContains(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), PL_SELECTION_TOOL::SelectPoint(), EE_SELECTION_TOOL::SelectPoint(), ZOOM_TOOL::selectRegion(), GERBVIEW_SELECTION_TOOL::selectVisually(), PL_EDITOR_CONTROL::ToggleBackgroundColor(), ToggleGrid(), SCH_EDITOR_CONTROL::ToggleHiddenPins(), PL_SELECTION_TOOL::unhighlight(), EE_SELECTION_TOOL::unhighlight(), SELECTION_TOOL::unhighlight(), GERBVIEW_SELECTION_TOOL::unselect(), GERBVIEW_SELECTION_TOOL::unselectVisually(), EE_POINT_EDITOR::updateEditedPoint(), PL_POINT_EDITOR::updateEditedPoint(), POINT_EDITOR::updateEditedPoint(), SCH_EDITOR_CONTROL::UpdateFind(), PCBNEW_CONTROL::updateGrid(), EE_POINT_EDITOR::updateItem(), PL_POINT_EDITOR::updateItem(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), EE_POINT_EDITOR::updatePoints(), PL_POINT_EDITOR::updatePoints(), POINT_EDITOR::updatePoints(), SELECTION_TOOL::updateSelection(), PNS::TOOL_BASE::updateStartItem(), EE_TOOL_BASE< SCH_BASE_FRAME >::updateView(), PCB_TOOL_BASE::view(), ZoomFitScreen(), SELECTION_TOOL::zoomFitSelection(), EE_SELECTION_TOOL::~EE_SELECTION_TOOL(), GERBVIEW_SELECTION_TOOL::~GERBVIEW_SELECTION_TOOL(), and SELECTION_TOOL::~SELECTION_TOOL().

◆ getViewControls()

KIGFX::VIEW_CONTROLS * TOOL_BASE::getViewControls ( ) const
protectedinherited

Function getViewControls()

Returns 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:219
KIGFX::VIEW_CONTROLS * GetViewControls() const
Definition: tool_manager.h:246

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

Referenced by EE_POINT_EDITOR::addCorner(), POINT_EDITOR::addCorner(), EE_POINT_EDITOR::addCornerCondition(), SCH_EDIT_TOOL::BreakWire(), PCB_TOOL_BASE::controls(), CursorControl(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), doZoomToPreset(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), LIB_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), LIB_EDIT_TOOL::Duplicate(), PAD_TOOL::EnumeratePads(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), GridPreset(), PCB_INSPECTION_TOOL::HighlightNet(), SCH_EDITOR_CONTROL::HighlightNet(), PCB_INSPECTION_TOOL::HighlightNetTool(), MODULE_EDITOR_TOOLS::ImportFootprint(), PL_EDIT_TOOL::Main(), SCH_MOVE_TOOL::Main(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), PCBNEW_PICKER_TOOL::Main(), PICKER_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), ROUTER_TOOL::MainLoop(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), EDIT_TOOL::Move(), POINT_EDITOR::OnSelectionChange(), LIB_EDIT_TOOL::Paste(), ROUTER_TOOL::performDragging(), LIB_DRAWING_TOOLS::PlaceAnchor(), PCBNEW_CONTROL::placeBoardItems(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), SCH_EDIT_TOOL::RepeatDrawItem(), PL_SELECTION_TOOL::RequestSelection(), EE_SELECTION_TOOL::RequestSelection(), POINT_EDITOR::Reset(), DRAWING_TOOL::Reset(), ResetLocalCoords(), GERBVIEW_SELECTION_TOOL::selectCursor(), SELECTION_TOOL::selectCursor(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::SelectNode(), ZOOM_TOOL::selectRegion(), ALIGN_DISTRIBUTE_TOOL::selectTarget(), PICKER_TOOL::setControls(), PCBNEW_PICKER_TOOL::setControls(), EE_POINT_EDITOR::setEditedPoint(), PL_POINT_EDITOR::setEditedPoint(), POINT_EDITOR::setEditedPoint(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), EE_POINT_EDITOR::updateEditedPoint(), PL_POINT_EDITOR::updateEditedPoint(), POINT_EDITOR::updateEditedPoint(), LIB_MOVE_TOOL::updateModificationPoint(), PL_EDIT_TOOL::updateModificationPoint(), EDIT_TOOL::updateModificationPoint(), and 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

Function Go()

Defines which state (aStateFunc) to go when a certain event arrives (aConditions). No conditions means any event.

Definition at line 129 of file tool_interactive.h.

131 {
132  TOOL_STATE_FUNC sptr = std::bind( aStateFunc, static_cast<T*>( this ), std::placeholders::_1 );
133 
134  goInternal( sptr, aConditions );
135 }
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 LENGTH_TUNER_TOOL::setTransitions(), ZOOM_TOOL::setTransitions(), AUTOPLACE_TOOL::setTransitions(), MICROWAVE_TOOL::setTransitions(), ROUTER_TOOL::setTransitions(), CVPCB_FOOTPRINT_VIEWER_CONTROL::setTransitions(), LIB_PIN_TOOL::setTransitions(), PAD_TOOL::setTransitions(), EE_INSPECTION_TOOL::setTransitions(), PL_DRAWING_TOOLS::setTransitions(), KICAD_MANAGER_CONTROL::setTransitions(), COMMON_CONTROL::setTransitions(), LIB_DRAWING_TOOLS::setTransitions(), ZONE_FILLER_TOOL::setTransitions(), EE_POINT_EDITOR::setTransitions(), PL_POINT_EDITOR::setTransitions(), SCH_MOVE_TOOL::setTransitions(), LIB_MOVE_TOOL::setTransitions(), GERBVIEW_CONTROL::setTransitions(), SCH_DRAWING_TOOLS::setTransitions(), GLOBAL_EDIT_TOOL::setTransitions(), POINT_EDITOR::setTransitions(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::setTransitions(), LIB_CONTROL::setTransitions(), PL_EDITOR_CONTROL::setTransitions(), LIB_EDIT_TOOL::setTransitions(), SCH_EDIT_TOOL::setTransitions(), PL_EDIT_TOOL::setTransitions(), POSITION_RELATIVE_TOOL::setTransitions(), GERBVIEW_SELECTION_TOOL::setTransitions(), setTransitions(), SCH_LINE_WIRE_BUS_TOOL::setTransitions(), PCB_INSPECTION_TOOL::setTransitions(), PCBNEW_CONTROL::setTransitions(), ALIGN_DISTRIBUTE_TOOL::setTransitions(), MODULE_EDITOR_TOOLS::setTransitions(), CVPCB_CONTROL::setTransitions(), CVPCB_ASSOCIATION_TOOL::setTransitions(), PCBNEW_PICKER_TOOL::setTransitions(), PICKER_TOOL::setTransitions(), PCB_EDITOR_CONTROL::setTransitions(), DRAWING_TOOL::setTransitions(), EDIT_TOOL::setTransitions(), SELECTION_TOOL::setTransitions(), SCH_EDITOR_CONTROL::setTransitions(), PL_SELECTION_TOOL::setTransitions(), EE_SELECTION_TOOL::setTransitions(), and DRC::setTransitions().

◆ GridNext()

int COMMON_TOOLS::GridNext ( const TOOL_EVENT aEvent)

Definition at line 370 of file common_tools.cpp.

371 {
372  const OPT<int> next_grid_id = getNextPreviousGrid( *m_frame->GetScreen(), 1 );
373 
374  if( next_grid_id )
375  return GridPreset( *next_grid_id - ID_POPUP_GRID_LEVEL_1000 );
376 
377  return 1;
378 }
EDA_DRAW_FRAME * m_frame
Pointer to the currently used edit frame.
Definition: common_tools.h:92
int GridPreset(const TOOL_EVENT &aEvent)
static OPT< int > getNextPreviousGrid(const BASE_SCREEN &aScreen, int aOffset)
Advance a BASE_SCREEN's grid forwards or backwards by the given offset and return the cmd ID of that ...
boost::optional< T > OPT
Definition: optional.h:7
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.

References getNextPreviousGrid(), EDA_DRAW_FRAME::GetScreen(), GridPreset(), ID_POPUP_GRID_LEVEL_1000, and m_frame.

Referenced by setTransitions().

◆ GridPreset() [1/2]

int COMMON_TOOLS::GridPreset ( const TOOL_EVENT aEvent)

Definition at line 392 of file common_tools.cpp.

393 {
394  return GridPreset( aEvent.Parameter<intptr_t>() );
395 }
int GridPreset(const TOOL_EVENT &aEvent)
T Parameter() const
Function Parameter() Returns a non-standard parameter assigned to the event.
Definition: tool_event.h:427

References TOOL_EVENT::Parameter().

Referenced by GridNext(), GridPrev(), and setTransitions().

◆ GridPreset() [2/2]

int COMMON_TOOLS::GridPreset ( int  idx)

Definition at line 398 of file common_tools.cpp.

399 {
400  BASE_SCREEN* screen = m_frame->GetScreen();
401 
402  if( !screen->GridExists( idx + ID_POPUP_GRID_LEVEL_1000 ) )
403  idx = 0;
404 
405  screen->SetGrid( idx + ID_POPUP_GRID_LEVEL_1000 );
406 
407  // Be sure m_LastGridSizeId is up to date.
408  m_frame->SetLastGridSizeId( idx );
409 
410  // Update the combobox (if any)
411  wxUpdateUIEvent dummy;
413 
414  // Update GAL canvas from screen
415  getView()->GetGAL()->SetGridSize( VECTOR2D( screen->GetGridSize() ) );
417 
418  // Put cursor on new grid
419  VECTOR2D gridCursor = getViewControls()->GetCursorPosition( true );
420  getViewControls()->SetCrossHairCursorPosition( gridCursor, false );
421  return 0;
422 }
EDA_DRAW_FRAME * m_frame
Pointer to the currently used edit frame.
Definition: common_tools.h:92
const wxRealPoint & GetGridSize() const
Return the grid size of the currently selected grid.
Definition: base_screen.h:279
GAL * GetGAL() const
Function GetGAL() Returns the GAL this view is using to draw graphical primitives.
Definition: view.h:180
Auxiliary rendering target (noncached)
Definition: definitions.h:49
VECTOR2< double > VECTOR2D
Definition: vector2d.h:586
void MarkTargetDirty(int aTarget)
Function MarkTargetDirty() Sets or clears target 'dirty' flag.
Definition: view.h:585
void OnUpdateSelectGrid(wxUpdateUIEvent &aEvent)
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:74
virtual void SetCrossHairCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true)=0
Moves the graphic crosshair cursor to the requested position expressed in world coordinates.
void SetGridSize(const VECTOR2D &aGridSize)
Set the grid size.
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
bool GridExists(int aCommandId)
Function GridExists tests for grid command ID (not an index in grid list, but a wxID) exists in grid ...
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
void SetLastGridSizeId(int aId)
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:42
int SetGrid(const wxRealPoint &size)
set the current grid size m_Grid.
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
VECTOR2D GetCursorPosition() const
Returns the current cursor position in world coordinates.

References dummy(), KIGFX::VIEW_CONTROLS::GetCursorPosition(), KIGFX::VIEW::GetGAL(), BASE_SCREEN::GetGridSize(), EDA_DRAW_FRAME::GetScreen(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), BASE_SCREEN::GridExists(), ID_POPUP_GRID_LEVEL_1000, m_frame, KIGFX::VIEW::MarkTargetDirty(), EDA_DRAW_FRAME::OnUpdateSelectGrid(), KIGFX::VIEW_CONTROLS::SetCrossHairCursorPosition(), BASE_SCREEN::SetGrid(), KIGFX::GAL::SetGridSize(), EDA_DRAW_FRAME::SetLastGridSizeId(), and KIGFX::TARGET_NONCACHED.

◆ GridPrev()

int COMMON_TOOLS::GridPrev ( const TOOL_EVENT aEvent)

Definition at line 381 of file common_tools.cpp.

382 {
383  const OPT<int> next_grid_id = getNextPreviousGrid( *m_frame->GetScreen(), -1 );
384 
385  if( next_grid_id )
386  return GridPreset( *next_grid_id - ID_POPUP_GRID_LEVEL_1000 );
387 
388  return 1;
389 }
EDA_DRAW_FRAME * m_frame
Pointer to the currently used edit frame.
Definition: common_tools.h:92
int GridPreset(const TOOL_EVENT &aEvent)
static OPT< int > getNextPreviousGrid(const BASE_SCREEN &aScreen, int aOffset)
Advance a BASE_SCREEN's grid forwards or backwards by the given offset and return the cmd ID of that ...
boost::optional< T > OPT
Definition: optional.h:7
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.

References getNextPreviousGrid(), EDA_DRAW_FRAME::GetScreen(), GridPreset(), ID_POPUP_GRID_LEVEL_1000, and m_frame.

Referenced by setTransitions().

◆ GridProperties()

int COMMON_TOOLS::GridProperties ( const TOOL_EVENT aEvent)

Definition at line 437 of file common_tools.cpp.

438 {
439  wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
440 
441  cmd.SetId( ID_GRID_SETTINGS );
442  m_frame->ProcessEvent( cmd );
443 
444  return 0;
445 }
EDA_DRAW_FRAME * m_frame
Pointer to the currently used edit frame.
Definition: common_tools.h:92
bool ProcessEvent(wxEvent &aEvent) override
Override the default process event handler to implement the auto save feature.

References ID_GRID_SETTINGS, m_frame, and EDA_BASE_FRAME::ProcessEvent().

Referenced by setTransitions().

◆ ImperialUnits()

int COMMON_TOOLS::ImperialUnits ( const TOOL_EVENT aEvent)

Definition at line 455 of file common_tools.cpp.

456 {
458  return 0;
459 }
EDA_DRAW_FRAME * m_frame
Pointer to the currently used edit frame.
Definition: common_tools.h:92
Definition: common.h:134
void ChangeUserUnits(EDA_UNITS_T aUnits)

References EDA_BASE_FRAME::ChangeUserUnits(), INCHES, and m_frame.

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:219
TOOL_ID m_toolId
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:214
bool IsToolActive(TOOL_ID aId) const
Function IsToolActive() Returns true if a tool with given id is active (executing)

References TOOL_MANAGER::IsToolActive(), TOOL_BASE::m_toolId, and TOOL_BASE::m_toolMgr.

◆ MetricUnits()

int COMMON_TOOLS::MetricUnits ( const TOOL_EVENT aEvent)

Definition at line 448 of file common_tools.cpp.

449 {
451  return 0;
452 }
EDA_DRAW_FRAME * m_frame
Pointer to the currently used edit frame.
Definition: common_tools.h:92
void ChangeUserUnits(EDA_UNITS_T aUnits)

References EDA_BASE_FRAME::ChangeUserUnits(), m_frame, and MILLIMETRES.

Referenced by setTransitions().

◆ PanControl()

int COMMON_TOOLS::PanControl ( const TOOL_EVENT aEvent)

Definition at line 123 of file common_tools.cpp.

124 {
125  long type = aEvent.Parameter<intptr_t>();
126  KIGFX::VIEW* view = getView();
127  VECTOR2D center = view->GetCenter();
128  VECTOR2I gridSize = VECTOR2D( m_frame->GetScreen()->GetGridSize() ) * 10;
129  bool mirroredX = view->IsMirroredX();
130 
131  switch( type )
132  {
133  case ACTIONS::CURSOR_UP:
134  center -= VECTOR2D( 0, gridSize.y );
135  break;
136 
138  center += VECTOR2D( 0, gridSize.y );
139  break;
140 
142  center -= VECTOR2D( mirroredX ? -gridSize.x : gridSize.x, 0 );
143  break;
144 
146  center += VECTOR2D( mirroredX ? -gridSize.x : gridSize.x, 0 );
147  break;
148 
149  default:
150  wxFAIL;
151  break;
152  }
153 
154  view->SetCenter( center );
155 
156  return 0;
157 }
EDA_DRAW_FRAME * m_frame
Pointer to the currently used edit frame.
Definition: common_tools.h:92
const wxRealPoint & GetGridSize() const
Return the grid size of the currently selected grid.
Definition: base_screen.h:279
VECTOR2< double > VECTOR2D
Definition: vector2d.h:586
T Parameter() const
Function Parameter() Returns a non-standard parameter assigned to the event.
Definition: tool_event.h:427
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
Class VIEW.
Definition: view.h:61
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.

References ACTIONS::CURSOR_DOWN, ACTIONS::CURSOR_LEFT, ACTIONS::CURSOR_RIGHT, ACTIONS::CURSOR_UP, BASE_SCREEN::GetGridSize(), EDA_DRAW_FRAME::GetScreen(), TOOL_BASE::getView(), m_frame, TOOL_EVENT::Parameter(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by setTransitions().

◆ Reset()

void COMMON_TOOLS::Reset ( RESET_REASON  aReason)
overridevirtual

Function Reset() Brings 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 40 of file common_tools.cpp.

41 {
42  m_frame = getEditFrame<EDA_DRAW_FRAME>();
43 }
EDA_DRAW_FRAME * m_frame
Pointer to the currently used edit frame.
Definition: common_tools.h:92

References m_frame.

◆ ResetLocalCoords()

int COMMON_TOOLS::ResetLocalCoords ( const TOOL_EVENT aEvent)

Definition at line 479 of file common_tools.cpp.

480 {
481  auto vcSettings = m_toolMgr->GetCurrentToolVC();
482 
483  // Use either the active tool forced cursor position or the general settings
484  if( vcSettings.m_forceCursorPosition )
485  m_frame->GetScreen()->m_LocalOrigin = vcSettings.m_forcedPosition;
486  else
488 
490 
491  return 0;
492 }
EDA_DRAW_FRAME * m_frame
Pointer to the currently used edit frame.
Definition: common_tools.h:92
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
const KIGFX::VC_SETTINGS & GetCurrentToolVC() const
Returns the view controls settings for the current tool or the general settings if there is no active...
void UpdateStatusBar() override
Update the status bar information.
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:42
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
VECTOR2D GetCursorPosition() const
Returns the current cursor position in world coordinates.
VECTOR2D m_LocalOrigin
Relative Screen cursor coordinate (on grid) in user units.
Definition: base_screen.h:114

References TOOL_MANAGER::GetCurrentToolVC(), KIGFX::VIEW_CONTROLS::GetCursorPosition(), EDA_DRAW_FRAME::GetScreen(), TOOL_BASE::getViewControls(), m_frame, BASE_SCREEN::m_LocalOrigin, TOOL_BASE::m_toolMgr, and EDA_DRAW_FRAME::UpdateStatusBar().

Referenced by setTransitions().

◆ RunMainStack()

void TOOL_INTERACTIVE::RunMainStack ( std::function< void()>  aFunc)
inherited

Function RunMainStack()

Calls 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:219
void RunMainStack(TOOL_BASE *aTool, std::function< void()> aFunc)

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

Referenced by DRAWING_TOOL::PlaceText().

◆ SelectionTool()

int COMMON_TOOLS::SelectionTool ( const TOOL_EVENT aEvent)

Definition at line 46 of file common_tools.cpp.

47 {
48  // Since selection tools are run permanently underneath the toolStack, this is really
49  // just a cancel of whatever other tools might be running.
50 
52  return 0;
53 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
bool ProcessEvent(const TOOL_EVENT &aEvent)
Propagates an event to tools that requested events of matching type(s).
Class TOOL_EVENT.
Definition: tool_event.h:168

References TOOL_BASE::m_toolMgr, TOOL_MANAGER::ProcessEvent(), TA_CANCEL_TOOL, and TC_COMMAND.

Referenced by setTransitions().

◆ SetContextMenu()

void TOOL_INTERACTIVE::SetContextMenu ( ACTION_MENU aMenu,
CONTEXT_MENU_TRIGGER  aTrigger = CMENU_BUTTON 
)
inherited

Function SetContextMenu()

Assigns 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:219
void SetTool(TOOL_INTERACTIVE *aTool)
Function SetTool() Sets a tool that is the creator of the menu.
void ScheduleContextMenu(TOOL_BASE *aTool, ACTION_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger)
Sets behaviour 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(), SELECTION_TOOL::doSelectionMenu(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), TOOL_MENU::ShowContextMenu(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ setTransitions()

void COMMON_TOOLS::setTransitions ( )
overrideprivatevirtual

Sets up handlers for various events.

Implements TOOL_INTERACTIVE.

Definition at line 530 of file common_tools.cpp.

531 {
533 
534  // Cursor control
543 
547 
548  // Pan control
549  Go( &COMMON_TOOLS::PanControl, ACTIONS::panUp.MakeEvent() );
553 
554  // Zoom control
556  Go( &COMMON_TOOLS::ZoomInOut, ACTIONS::zoomIn.MakeEvent() );
564 
565  // Grid control
571 
572  // Units and coordinates
578 
579  // Misc
584 }
int MetricUnits(const TOOL_EVENT &aEvent)
int ZoomFitScreen(const TOOL_EVENT &aEvent)
static TOOL_ACTION zoomPreset
Definition: actions.h:94
static TOOL_ACTION zoomInCenter
Definition: actions.h:90
int ToggleCursorStyle(const TOOL_EVENT &aEvent)
static TOOL_ACTION cursorRight
Definition: actions.h:108
static TOOL_ACTION zoomFitScreen
Definition: actions.h:93
static TOOL_ACTION standardGraphics
Definition: actions.h:155
static TOOL_ACTION cursorRightFast
Definition: actions.h:113
int GridPreset(const TOOL_EVENT &aEvent)
static TOOL_ACTION panLeft
Definition: actions.h:121
int ResetLocalCoords(const TOOL_EVENT &aEvent)
static TOOL_ACTION imperialUnits
Definition: actions.h:136
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Function Go()
int ImperialUnits(const TOOL_EVENT &aEvent)
static TOOL_ACTION zoomOutCenter
Definition: actions.h:91
int GridNext(const TOOL_EVENT &aEvent)
int ToggleUnits(const TOOL_EVENT &aEvent)
int ZoomInOutCenter(const TOOL_EVENT &aEvent)
static TOOL_ACTION centerContents
Definition: actions.h:96
static TOOL_ACTION toggleCursor
Definition: actions.h:97
static TOOL_ACTION gridPreset
Definition: actions.h:131
static TOOL_ACTION gridPrev
Definition: actions.h:128
static TOOL_ACTION panDown
Definition: actions.h:120
int GridPrev(const TOOL_EVENT &aEvent)
static TOOL_ACTION toggleGrid
Definition: actions.h:132
static TOOL_ACTION cursorUpFast
Definition: actions.h:110
static TOOL_ACTION cursorDownFast
Definition: actions.h:111
static TOOL_ACTION cursorLeft
Definition: actions.h:107
static TOOL_ACTION panRight
Definition: actions.h:122
int ZoomCenter(const TOOL_EVENT &aEvent)
static TOOL_ACTION togglePolarCoords
Definition: actions.h:139
int ToggleGrid(const TOOL_EVENT &aEvent)
int ZoomInOut(const TOOL_EVENT &aEvent)
static TOOL_ACTION cursorLeftFast
Definition: actions.h:112
int CursorControl(const TOOL_EVENT &aEvent)
int ToggleCursor(const TOOL_EVENT &aEvent)
int SwitchCanvas(const TOOL_EVENT &aEvent)
int CenterContents(const TOOL_EVENT &aEvent)
static TOOL_ACTION metricUnits
Definition: actions.h:137
int SelectionTool(const TOOL_EVENT &aEvent)
static TOOL_ACTION zoomCenter
Definition: actions.h:92
static TOOL_ACTION cursorUp
Cursor control with keyboard.
Definition: actions.h:105
static TOOL_ACTION zoomRedraw
Definition: actions.h:87
static TOOL_ACTION cursorDblClick
Definition: actions.h:116
int ZoomPreset(const TOOL_EVENT &aEvent)
static TOOL_ACTION acceleratedGraphics
Definition: actions.h:154
static TOOL_ACTION resetLocalCoords
Definition: actions.h:140
static TOOL_ACTION gridNext
Definition: actions.h:127
static TOOL_ACTION gridProperties
Definition: actions.h:133
static TOOL_ACTION panUp
Definition: actions.h:119
static TOOL_ACTION zoomIn
Definition: actions.h:88
static TOOL_ACTION zoomOut
Definition: actions.h:89
int TogglePolarCoords(const TOOL_EVENT &aEvent)
static TOOL_ACTION toggleCursorStyle
Definition: actions.h:98
static TOOL_ACTION showContextMenu
Definition: actions.h:66
static TOOL_ACTION cursorDown
Definition: actions.h:106
int PanControl(const TOOL_EVENT &aEvent)
int ZoomRedraw(const TOOL_EVENT &aEvent)
static TOOL_ACTION toggleUnits
Definition: actions.h:138
int GridProperties(const TOOL_EVENT &aEvent)
static TOOL_ACTION selectionTool
Definition: actions.h:143
static TOOL_ACTION cursorClick
Definition: actions.h:115

References ACTIONS::acceleratedGraphics, CenterContents(), ACTIONS::centerContents, ACTIONS::cursorClick, CursorControl(), ACTIONS::cursorDblClick, ACTIONS::cursorDown, ACTIONS::cursorDownFast, ACTIONS::cursorLeft, ACTIONS::cursorLeftFast, ACTIONS::cursorRight, ACTIONS::cursorRightFast, ACTIONS::cursorUp, ACTIONS::cursorUpFast, TOOL_INTERACTIVE::Go(), GridNext(), ACTIONS::gridNext, GridPreset(), ACTIONS::gridPreset, GridPrev(), ACTIONS::gridPrev, GridProperties(), ACTIONS::gridProperties, ImperialUnits(), ACTIONS::imperialUnits, MetricUnits(), ACTIONS::metricUnits, PanControl(), ACTIONS::panDown, ACTIONS::panLeft, ACTIONS::panRight, ACTIONS::panUp, ResetLocalCoords(), ACTIONS::resetLocalCoords, SelectionTool(), ACTIONS::selectionTool, ACTIONS::showContextMenu, ACTIONS::standardGraphics, SwitchCanvas(), ToggleCursor(), ACTIONS::toggleCursor, ToggleCursorStyle(), ACTIONS::toggleCursorStyle, ToggleGrid(), ACTIONS::toggleGrid, TogglePolarCoords(), ACTIONS::togglePolarCoords, ToggleUnits(), ACTIONS::toggleUnits, ZoomCenter(), ACTIONS::zoomCenter, ZoomFitScreen(), ACTIONS::zoomFitScreen, ACTIONS::zoomIn, ACTIONS::zoomInCenter, ZoomInOut(), ZoomInOutCenter(), ACTIONS::zoomOut, ACTIONS::zoomOutCenter, ZoomPreset(), ACTIONS::zoomPreset, ZoomRedraw(), and ACTIONS::zoomRedraw.

◆ SwitchCanvas()

int COMMON_TOOLS::SwitchCanvas ( const TOOL_EVENT aEvent)

Definition at line 517 of file common_tools.cpp.

518 {
519  if( aEvent.IsAction( &ACTIONS::acceleratedGraphics ) )
521  else if( aEvent.IsAction( &ACTIONS::standardGraphics ) )
523  else
524  wxFAIL_MSG( "Unknown canvas type" );
525 
526  return 0;
527 }
EDA_DRAW_FRAME * m_frame
Pointer to the currently used edit frame.
Definition: common_tools.h:92
static TOOL_ACTION standardGraphics
Definition: actions.h:155
bool IsAction(const TOOL_ACTION *aAction) const
Function IsAction() Tests if the event contains an action issued upon activation of the given TOOL_AC...
Definition: tool_event.cpp:63
virtual void SwitchCanvas(EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType)
Changes the current rendering backend.
static TOOL_ACTION acceleratedGraphics
Definition: actions.h:154

References ACTIONS::acceleratedGraphics, EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO, EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL, TOOL_EVENT::IsAction(), m_frame, ACTIONS::standardGraphics, and EDA_DRAW_FRAME::SwitchCanvas().

Referenced by setTransitions().

◆ ToggleCursor()

int COMMON_TOOLS::ToggleCursor ( const TOOL_EVENT aEvent)

Definition at line 495 of file common_tools.cpp.

496 {
497  auto& galOpts = m_frame->GetGalDisplayOptions();
498 
499  galOpts.m_forceDisplayCursor = !galOpts.m_forceDisplayCursor;
500  galOpts.NotifyChanged();
501 
502  return 0;
503 }
EDA_DRAW_FRAME * m_frame
Pointer to the currently used edit frame.
Definition: common_tools.h:92
KIGFX::GAL_DISPLAY_OPTIONS & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
bool m_forceDisplayCursor
Force cursor display

References EDA_DRAW_FRAME::GetGalDisplayOptions(), KIGFX::GAL_DISPLAY_OPTIONS::m_forceDisplayCursor, and m_frame.

Referenced by setTransitions().

◆ ToggleCursorStyle()

int COMMON_TOOLS::ToggleCursorStyle ( const TOOL_EVENT aEvent)

Definition at line 506 of file common_tools.cpp.

507 {
509 
510  galOpts.m_fullscreenCursor = !galOpts.m_fullscreenCursor;
511  galOpts.NotifyChanged();
512 
513  return 0;
514 }
EDA_DRAW_FRAME * m_frame
Pointer to the currently used edit frame.
Definition: common_tools.h:92
KIGFX::GAL_DISPLAY_OPTIONS & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
bool m_fullscreenCursor
Fullscreen crosshair or small cross

References EDA_DRAW_FRAME::GetGalDisplayOptions(), m_frame, KIGFX::GAL_DISPLAY_OPTIONS::m_fullscreenCursor, and KIGFX::GAL_DISPLAY_OPTIONS::NotifyChanged().

Referenced by setTransitions().

◆ ToggleGrid()

int COMMON_TOOLS::ToggleGrid ( const TOOL_EVENT aEvent)

Definition at line 425 of file common_tools.cpp.

426 {
428 
431  m_frame->GetCanvas()->Refresh();
432 
433  return 0;
434 }
EDA_DRAW_FRAME * m_frame
Pointer to the currently used edit frame.
Definition: common_tools.h:92
virtual bool IsGridVisible() const
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Auxiliary rendering target (noncached)
Definition: definitions.h:49
void MarkTargetDirty(int aTarget)
Function MarkTargetDirty() Sets or clears target 'dirty' flag.
Definition: view.h:585
KIGFX::GAL * GetGAL() const
Function GetGAL() Returns a pointer to the GAL instance used in the panel.
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
void SetGridVisibility(bool aVisibility)
Sets the visibility setting of the grid.
virtual void SetGridVisibility(bool aVisible)

References EDA_DRAW_FRAME::GetCanvas(), EDA_DRAW_PANEL_GAL::GetGAL(), TOOL_BASE::getView(), EDA_DRAW_FRAME::IsGridVisible(), m_frame, KIGFX::VIEW::MarkTargetDirty(), EDA_DRAW_PANEL_GAL::Refresh(), EDA_DRAW_FRAME::SetGridVisibility(), KIGFX::GAL::SetGridVisibility(), and KIGFX::TARGET_NONCACHED.

Referenced by setTransitions().

◆ TogglePolarCoords()

int COMMON_TOOLS::TogglePolarCoords ( const TOOL_EVENT aEvent)

Definition at line 469 of file common_tools.cpp.

470 {
471  m_frame->SetStatusText( wxEmptyString );
474 
475  return 0;
476 }
EDA_DRAW_FRAME * m_frame
Pointer to the currently used edit frame.
Definition: common_tools.h:92
void SetShowPolarCoords(bool aShow)
bool GetShowPolarCoords() const
For those frames that support polar coordinates.
void UpdateStatusBar() override
Update the status bar information.

References EDA_DRAW_FRAME::GetShowPolarCoords(), m_frame, EDA_DRAW_FRAME::SetShowPolarCoords(), and EDA_DRAW_FRAME::UpdateStatusBar().

Referenced by setTransitions().

◆ ToggleUnits()

int COMMON_TOOLS::ToggleUnits ( const TOOL_EVENT aEvent)

Definition at line 462 of file common_tools.cpp.

463 {
465  return 0;
466 }
EDA_DRAW_FRAME * m_frame
Pointer to the currently used edit frame.
Definition: common_tools.h:92
Definition: common.h:134
EDA_UNITS_T GetUserUnits() const
Return the user units currently in use.
void ChangeUserUnits(EDA_UNITS_T aUnits)

References EDA_BASE_FRAME::ChangeUserUnits(), EDA_BASE_FRAME::GetUserUnits(), INCHES, m_frame, and MILLIMETRES.

Referenced by setTransitions().

◆ Wait()

TOOL_EVENT * TOOL_INTERACTIVE::Wait ( const TOOL_EVENT_LIST aEventList = TOOL_EVENTTC_ANYTA_ANY ))
inherited

Function Wait()

Suspends 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:219
TOOL_EVENT * ScheduleWait(TOOL_BASE *aTool, const TOOL_EVENT_LIST &aConditions)
Pauses 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(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), LIB_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), ROUTER_TOOL::InlineDrag(), ZOOM_TOOL::Main(), PL_EDIT_TOOL::Main(), CVPCB_CONTROL::Main(), SCH_MOVE_TOOL::Main(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), PCBNEW_PICKER_TOOL::Main(), PICKER_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), PL_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), SELECTION_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), EDIT_TOOL::Move(), POINT_EDITOR::OnSelectionChange(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), EDIT_TOOL::pickCopyReferencePoint(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), EDIT_TOOL::Remove(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), GERBVIEW_SELECTION_TOOL::selectPoint(), SELECTION_TOOL::selectPoint(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), ZOOM_TOOL::selectRegion(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ ZoomCenter()

int COMMON_TOOLS::ZoomCenter ( const TOOL_EVENT aEvent)

Definition at line 222 of file common_tools.cpp.

223 {
225 
226  ctls->CenterOnCursor();
227 
228  return 0;
229 }
virtual void CenterOnCursor() const =0
Function CenterOnCursor() Sets the viewport center to the current cursor position and warps the curso...
Class VIEW_CONTROLS is an interface for classes handling user events controlling the view behaviour (...
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:42

References KIGFX::VIEW_CONTROLS::CenterOnCursor(), and TOOL_BASE::getViewControls().

Referenced by setTransitions().

◆ ZoomFitScreen()

int COMMON_TOOLS::ZoomFitScreen ( const TOOL_EVENT aEvent)

Definition at line 232 of file common_tools.cpp.

233 {
234  KIGFX::VIEW* view = getView();
235  EDA_DRAW_PANEL_GAL* canvas = m_frame->GetCanvas();
236  EDA_DRAW_FRAME* frame = getEditFrame<EDA_DRAW_FRAME>();
237 
238  BOX2I bBox = frame->GetDocumentExtents();
239  BOX2I defaultBox = canvas->GetDefaultViewBBox();
240  VECTOR2D scrollbarSize = VECTOR2D( canvas->GetSize() - canvas->GetClientSize() );
241 
242  view->SetScale( 1.0 ); // the best scale will be fixed later, from this initial value
243  // but this call ensure all view parameters are up to date
244  // especially at init time
245  VECTOR2D screenSize = view->ToWorld( canvas->GetClientSize(), false );
246 
247  if( bBox.GetWidth() == 0 || bBox.GetHeight() == 0 )
248  bBox = defaultBox;
249 
250  VECTOR2D vsize = bBox.GetSize();
251  double scale = view->GetScale() / std::max( fabs( vsize.x / screenSize.x ),
252  fabs( vsize.y / screenSize.y ) );
253 
254  // Reserve a 10% margin around component bounding box.
255  double margin_scale_factor = 1.1;
256 
257  // Leave a bigger margin for library editors & viewers
259  || frame->IsType( FRAME_SCH_VIEWER ) || frame->IsType( FRAME_SCH_VIEWER_MODAL ) )
260  {
261  margin_scale_factor = 1.4;
262  }
263  else if( frame->IsType( FRAME_SCH_LIB_EDITOR ) || frame->IsType( FRAME_FOOTPRINT_EDITOR ) )
264  {
265  margin_scale_factor = 2;
266  }
267 
268  view->SetScale( scale / margin_scale_factor );
269  view->SetCenter( bBox.Centre() );
270 
271  // Take scrollbars into account
272  VECTOR2D worldScrollbarSize = view->ToWorld( scrollbarSize, false );
273  view->SetCenter( view->GetCenter() + worldScrollbarSize / 2.0 );
274 
275  return 0;
276 }
EDA_DRAW_FRAME * m_frame
Pointer to the currently used edit frame.
Definition: common_tools.h:92
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Function ToWorld() Converts a screen space point/vector to a point/vector in world space coordinates.
Definition: view.cpp:475
const VECTOR2D & GetCenter() const
Function GetCenter() Returns the center point of this VIEW (in world space coordinates)
Definition: view.h:328
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
The base class for create windows for drawing purpose.
void SetCenter(const VECTOR2D &aCenter)
Function SetCenter() Sets the center point of the VIEW (i.e.
Definition: view.cpp:604
VECTOR2< double > VECTOR2D
Definition: vector2d.h:586
coord_type GetWidth() const
Definition: box2.h:195
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
virtual void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 })
Function SetScale() Sets the scaling factor, zooming around a given anchor point.
Definition: view.cpp:578
const int scale
bool IsType(FRAME_T aType) const
Vec Centre() const
Definition: box2.h:77
#define max(a, b)
Definition: auxiliary.h:86
coord_type GetHeight() const
Definition: box2.h:196
const Vec & GetSize() const
Definition: box2.h:187
Class VIEW.
Definition: view.h:61
double GetScale() const
Function GetScale()
Definition: view.h:257
virtual BOX2I GetDefaultViewBBox() const
Returns the bounding box of the view that should be used if model is not valid For example,...
virtual const BOX2I GetDocumentExtents() const

References BOX2< Vec >::Centre(), FRAME_FOOTPRINT_EDITOR, FRAME_FOOTPRINT_VIEWER, FRAME_FOOTPRINT_VIEWER_MODAL, FRAME_SCH_LIB_EDITOR, FRAME_SCH_VIEWER, FRAME_SCH_VIEWER_MODAL, EDA_DRAW_FRAME::GetCanvas(), KIGFX::VIEW::GetCenter(), EDA_DRAW_PANEL_GAL::GetDefaultViewBBox(), EDA_DRAW_FRAME::GetDocumentExtents(), BOX2< Vec >::GetHeight(), KIGFX::VIEW::GetScale(), BOX2< Vec >::GetSize(), TOOL_BASE::getView(), BOX2< Vec >::GetWidth(), EDA_BASE_FRAME::IsType(), m_frame, max, scale, KIGFX::VIEW::SetCenter(), KIGFX::VIEW::SetScale(), KIGFX::VIEW::ToWorld(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by doZoomToPreset(), and setTransitions().

◆ ZoomInOut()

int COMMON_TOOLS::ZoomInOut ( const TOOL_EVENT aEvent)

Definition at line 167 of file common_tools.cpp.

168 {
169  bool direction = aEvent.IsAction( &ACTIONS::zoomIn );
170  return doZoomInOut( direction, true );
171 }
bool IsAction(const TOOL_ACTION *aAction) const
Function IsAction() Tests if the event contains an action issued upon activation of the given TOOL_AC...
Definition: tool_event.cpp:63
int doZoomInOut(bool aDirection, bool aCenterOnCursor)
static TOOL_ACTION zoomIn
Definition: actions.h:88

References doZoomInOut(), TOOL_EVENT::IsAction(), and ACTIONS::zoomIn.

Referenced by setTransitions().

◆ ZoomInOutCenter()

int COMMON_TOOLS::ZoomInOutCenter ( const TOOL_EVENT aEvent)

Definition at line 174 of file common_tools.cpp.

175 {
176  bool direction = aEvent.IsAction( &ACTIONS::zoomInCenter );
177  return doZoomInOut( direction, false );
178 }
static TOOL_ACTION zoomInCenter
Definition: actions.h:90
bool IsAction(const TOOL_ACTION *aAction) const
Function IsAction() Tests if the event contains an action issued upon activation of the given TOOL_AC...
Definition: tool_event.cpp:63
int doZoomInOut(bool aDirection, bool aCenterOnCursor)

References doZoomInOut(), TOOL_EVENT::IsAction(), and ACTIONS::zoomInCenter.

Referenced by setTransitions().

◆ ZoomPreset()

int COMMON_TOOLS::ZoomPreset ( const TOOL_EVENT aEvent)

Definition at line 298 of file common_tools.cpp.

299 {
300  unsigned int idx = aEvent.Parameter<intptr_t>();
301  return doZoomToPreset( idx, false );
302 }
int doZoomToPreset(int idx, bool aCenterOnCursor)
Note: idx == 0 is Auto; idx == 1 is first entry in zoomList
T Parameter() const
Function Parameter() Returns a non-standard parameter assigned to the event.
Definition: tool_event.h:427

References doZoomToPreset(), and TOOL_EVENT::Parameter().

Referenced by setTransitions().

◆ ZoomRedraw()

int COMMON_TOOLS::ZoomRedraw ( const TOOL_EVENT aEvent)

Definition at line 160 of file common_tools.cpp.

161 {
162  m_frame->HardRedraw();
163  return 0;
164 }
EDA_DRAW_FRAME * m_frame
Pointer to the currently used edit frame.
Definition: common_tools.h:92
virtual void HardRedraw()
Rebuild the GAL and redraws the screen.

References EDA_DRAW_FRAME::HardRedraw(), and m_frame.

Referenced by setTransitions().

Member Data Documentation

◆ m_frame

◆ m_menu

TOOL_MENU TOOL_INTERACTIVE::m_menu
protectedinherited

functions below are not yet implemented - their interface may change

Definition at line 108 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(), LIB_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), TOOL_INTERACTIVE::GetToolMenu(), PICKER_TOOL::Init(), PL_EDIT_TOOL::Init(), SCH_EDIT_TOOL::Init(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Init(), LIB_DRAWING_TOOLS::Init(), MODULE_EDITOR_TOOLS::Init(), PL_DRAWING_TOOLS::Init(), LIB_CONTROL::Init(), PCB_EDITOR_CONTROL::Init(), SCH_DRAWING_TOOLS::Init(), GERBVIEW_SELECTION_TOOL::Init(), DRAWING_TOOL::Init(), PL_SELECTION_TOOL::Init(), EE_SELECTION_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), SELECTION_TOOL::Init(), EDIT_TOOL::Init(), PCB_TOOL_BASE::Init(), PL_EDIT_TOOL::Main(), SCH_MOVE_TOOL::Main(), LIB_MOVE_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), PCBNEW_PICKER_TOOL::Main(), PICKER_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), PL_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), SELECTION_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ m_toolId

TOOL_ID TOOL_BASE::m_toolId
protectedinherited

Unique identifier for the tool, assigned by a TOOL_MANAGER instance.

Definition at line 214 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 219 of file tool_base.h.

Referenced by TOOL_INTERACTIVE::Activate(), PL_SELECTION_TOOL::AddItemsToSel(), EE_SELECTION_TOOL::AddItemsToSel(), PL_SELECTION_TOOL::AddItemToSel(), EE_SELECTION_TOOL::AddItemToSel(), SELECTION_TOOL::AddItemToSel(), CVPCB_ASSOCIATION_TOOL::Associate(), TOOL_BASE::attachManager(), PCB_INSPECTION_TOOL::calculateSelectionRatsnest(), ROUTER_TOOL::CanInlineDrag(), PCB_INSPECTION_TOOL::ClearHighlight(), SCH_EDITOR_CONTROL::ClearHighlight(), SELECTION_TOOL::ClearSelection(), PL_SELECTION_TOOL::ClearSelection(), GERBVIEW_SELECTION_TOOL::clearSelection(), EE_SELECTION_TOOL::ClearSelection(), SCH_EDIT_TOOL::ConvertDeMorgan(), LIB_EDIT_TOOL::Copy(), PL_EDIT_TOOL::Copy(), PAD_TOOL::copyPadSettings(), MICROWAVE_TOOL::createInductorBetween(), MODULE_EDITOR_TOOLS::CreatePadFromShapes(), PCB_INSPECTION_TOOL::CrossProbePcbToSch(), CursorControl(), ROUTER_TOOL::CustomTrackWidthDialog(), SCH_EDITOR_CONTROL::Cut(), LIB_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCBNEW_CONTROL::DeleteItemCursor(), SCH_EDITOR_CONTROL::doCopy(), SCH_EDITOR_CONTROL::doCrossProbeSchToPcb(), LIB_EDIT_TOOL::DoDelete(), SCH_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawSegment(), LIB_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PCB_EDITOR_CONTROL::DrillOrigin(), LIB_EDIT_TOOL::Duplicate(), SCH_EDIT_TOOL::Duplicate(), EDIT_TOOL::Duplicate(), SCH_EDIT_TOOL::editComponentFieldText(), EDIT_TOOL::EditFpInFpEditor(), LIB_EDIT_TOOL::editSymbolProperties(), SCH_EDITOR_CONTROL::EditWithLibEdit(), SCH_EDITOR_CONTROL::EnterSheet(), PAD_TOOL::EnumeratePads(), GLOBAL_EDIT_TOOL::ExchangeFootprints(), SELECTION_TOOL::expandConnection(), MODULE_EDITOR_TOOLS::ExplodePadToShapes(), SELECTION_TOOL::filterSelection(), SELECTION_TOOL::findCallback(), SCH_EDITOR_CONTROL::FindComponentAndItem(), POINT_EDITOR::finishItem(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), EDIT_TOOL::Flip(), EDIT_TOOL::GetAndPlace(), TOOL_BASE::getEditFrameInt(), TOOL_BASE::GetManager(), TOOL_BASE::getModelInt(), DRAWING_TOOL::getSourceZoneForAction(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), TOOL_INTERACTIVE::goInternal(), PCBNEW_CONTROL::GridSetOrigin(), GERBVIEW_CONTROL::HighlightControl(), PCB_INSPECTION_TOOL::HighlightItem(), PCB_INSPECTION_TOOL::HighlightNet(), SCH_EDITOR_CONTROL::HighlightNet(), PCB_INSPECTION_TOOL::highlightNet(), SCH_EDITOR_CONTROL::HighlightNetCursor(), PCB_INSPECTION_TOOL::HighlightNetTool(), MODULE_EDITOR_TOOLS::ImportFootprint(), PL_EDIT_TOOL::ImportWorksheetContent(), LIB_EDIT_TOOL::Init(), SCH_EDIT_TOOL::Init(), PL_EDIT_TOOL::Init(), PAD_TOOL::Init(), GLOBAL_EDIT_TOOL::Init(), ALIGN_DISTRIBUTE_TOOL::Init(), PL_DRAWING_TOOLS::Init(), LIB_CONTROL::Init(), PL_POINT_EDITOR::Init(), POINT_EDITOR::Init(), PCB_EDITOR_CONTROL::Init(), POSITION_RELATIVE_TOOL::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), EDIT_TOOL::invokeInlineRouter(), EDIT_TOOL::isInteractiveDragEnabled(), TOOL_BASE::IsToolActive(), SCH_EDITOR_CONTROL::LeaveSheet(), COMMON_CONTROL::ListHotKeys(), PCB_INSPECTION_TOOL::LocalRatsnestTool(), PL_EDIT_TOOL::Main(), CVPCB_CONTROL::Main(), SCH_MOVE_TOOL::Main(), LIB_MOVE_TOOL::Main(), PL_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), SELECTION_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), LIB_EDIT_TOOL::Mirror(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::Mirror(), PCB_EDITOR_CONTROL::modifyLockSelected(), EDIT_TOOL::Move(), EDIT_TOOL::MoveExact(), LIB_CONTROL::OnDeMorgan(), LIB_EDIT_TOOL::Paste(), PL_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), PAD_TOOL::pastePadProperties(), EDIT_TOOL::pickCopyReferencePoint(), LIB_EDIT_TOOL::PinTable(), PCBNEW_CONTROL::placeBoardItems(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), PCBNEW_CONTROL::Print(), GERBVIEW_CONTROL::Print(), LIB_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), PAD_TOOL::pushPadSettings(), EE_SELECTION_TOOL::RebuildSelection(), LIB_EDIT_TOOL::Redo(), SCH_EDITOR_CONTROL::Redo(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), EDIT_TOOL::Remove(), POINT_EDITOR::removeCorner(), PL_SELECTION_TOOL::RemoveItemFromSel(), EE_SELECTION_TOOL::RemoveItemFromSel(), PL_SELECTION_TOOL::RemoveItemsFromSel(), EE_SELECTION_TOOL::RemoveItemsFromSel(), SCH_EDIT_TOOL::RepeatDrawItem(), LIB_DRAWING_TOOLS::RepeatDrawItem(), EE_SELECTION_TOOL::RequestSelection(), SELECTION_TOOL::RequestSelection(), ResetLocalCoords(), TOOL_INTERACTIVE::resetTransitions(), LIB_EDIT_TOOL::Rotate(), SCH_EDIT_TOOL::Rotate(), EDIT_TOOL::Rotate(), TOOL_INTERACTIVE::RunMainStack(), DRC::RunTests(), EE_SELECTION_TOOL::SelectConnection(), SELECTION_TOOL::selectCopper(), PCB_TOOL_BASE::selection(), SelectionTool(), GERBVIEW_SELECTION_TOOL::SelectItem(), GERBVIEW_SELECTION_TOOL::SelectItems(), SELECTION_TOOL::SelectItems(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectNet(), PL_SELECTION_TOOL::SelectPoint(), GERBVIEW_SELECTION_TOOL::selectPoint(), EE_SELECTION_TOOL::SelectPoint(), SELECTION_TOOL::selectPoint(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), SELECTION_TOOL::selectSameSheet(), SELECTION_TOOL::selectSheetContents(), DRAWING_TOOL::SetAnchor(), TOOL_INTERACTIVE::SetContextMenu(), DRC::ShowDRCDialog(), SCH_DRAWING_TOOLS::SingleClickPlace(), PCB_EDITOR_CONTROL::TrackWidthDec(), PCB_EDITOR_CONTROL::TrackWidthInc(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), LIB_EDIT_TOOL::Undo(), SCH_EDITOR_CONTROL::Undo(), GERBVIEW_SELECTION_TOOL::UnselectItem(), SELECTION_TOOL::UnselectItem(), GERBVIEW_SELECTION_TOOL::UnselectItems(), SELECTION_TOOL::UnselectItems(), EE_INSPECTION_TOOL::UpdateMessagePanel(), GERBVIEW_CONTROL::UpdateMessagePanel(), PL_EDITOR_CONTROL::UpdateMessagePanel(), PCBNEW_CONTROL::UpdateMessagePanel(), PCB_INSPECTION_TOOL::UpdateSelectionRatsnest(), PCB_EDITOR_CONTROL::ViaSizeDec(), PCB_EDITOR_CONTROL::ViaSizeInc(), TOOL_INTERACTIVE::Wait(), PCB_EDITOR_CONTROL::ZoneDuplicate(), and PCB_EDITOR_CONTROL::ZoneMerge().

◆ m_toolName

std::string TOOL_BASE::m_toolName
protectedinherited

Name of the tool.

Names are expected to obey the format application.ToolName (eg. pcbnew.InteractiveSelection).

Definition at line 218 of file tool_base.h.

Referenced by TOOL_BASE::GetName().

◆ m_toolSettings

TOOL_SETTINGS TOOL_BASE::m_toolSettings
protectedinherited

Definition at line 220 of file tool_base.h.

Referenced by TOOL_BASE::attachManager(), and TOOL_BASE::GetSettings().

◆ m_type

TOOL_TYPE TOOL_BASE::m_type
protectedinherited

Stores the type of the tool.

Definition at line 211 of file tool_base.h.

Referenced by TOOL_BASE::GetType().


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