KiCad PCB EDA Suite
PNS::TOOL_BASE Class Reference

#include <pns_tool_base.h>

Inheritance diagram for PNS::TOOL_BASE:
TOOL_INTERACTIVE TOOL_BASE LENGTH_TUNER_TOOL ROUTER_TOOL

Public Types

enum  RESET_REASON { RUN, MODEL_RELOAD, GAL_SWITCH }
 

Determines the reason of reset for a tool

More...
 

Public Member Functions

 TOOL_BASE (const std::string &aToolName)
 
virtual ~TOOL_BASE ()
 
virtual void Reset (RESET_REASON aReason) override
 Function Reset() Brings the tool to a known, initial state. More...
 
const ROUTING_SETTINGSPNSSettings () const
 
ROUTERRouter () const
 
void Activate ()
 Function Activate() Runs the tool. More...
 
void SetContextMenu (CONTEXT_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...
 
OPT_TOOL_EVENT Wait (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...
 
virtual void SetTransitions ()
 Function SetTransitions() This method is meant to be overridden in order to specify handlers for events. More...
 
TOOL_SETTINGSGetSettings ()
 

Static Public Attributes

static TOOL_ACTION ACT_RouterOptions
 

Protected Member Functions

const VECTOR2I snapToItem (bool aEnabled, ITEM *aItem, VECTOR2I aP)
 
virtual ITEMpickSingleItem (const VECTOR2I &aWhere, int aNet=-1, int aLayer=-1)
 
virtual void highlightNet (bool aEnabled, int aNetcode=-1)
 
virtual void updateStartItem (TOOL_EVENT &aEvent)
 
virtual void updateEndItem (const TOOL_EVENT &aEvent)
 
void deleteTraces (ITEM *aStartItem, bool aWholeTrack)
 
const TOOL_EVENT evActivate (std::string aToolName="")
 functions below are not yet implemented - their interface may change More...
 
const TOOL_EVENT evCommand (int aCommandId=-1)
 
const TOOL_EVENT evCommand (std::string aCommandStr="")
 
const TOOL_EVENT evMotion ()
 
const TOOL_EVENT evClick (int aButton=BUT_ANY)
 
const TOOL_EVENT evDrag (int aButton=BUT_ANY)
 
const TOOL_EVENT evButtonUp (int aButton=BUT_ANY)
 
const TOOL_EVENT evButtonDown (int aButton=BUT_ANY)
 
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

MSG_PANEL_ITEMS m_panelItems
 
ROUTING_SETTINGS m_savedSettings
 Stores routing settings between router invocations. More...
 
SIZES_SETTINGS m_savedSizes
 Stores sizes settings between router invocations. More...
 
ITEMm_startItem
 
int m_startLayer
 
VECTOR2I m_startSnapPoint
 
ITEMm_endItem
 
VECTOR2I m_endSnapPoint
 
PCB_EDIT_FRAMEm_frame
 
KIGFX::VIEW_CONTROLSm_ctls
 
BOARDm_board
 
GRID_HELPERm_gridHelper
 
PNS_KICAD_IFACEm_iface
 
ROUTERm_router
 
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
 

Detailed Description

Definition at line 44 of file pns_tool_base.h.

Member Enumeration Documentation

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

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

Constructor & Destructor Documentation

TOOL_BASE::TOOL_BASE ( const std::string &  aToolName)

Definition at line 69 of file pns_tool_base.cpp.

References m_board, m_ctls, m_endItem, m_frame, m_gridHelper, m_iface, m_router, m_startItem, and m_startLayer.

69  :
70  TOOL_INTERACTIVE( aToolName )
71 {
72  m_gridHelper = nullptr;
73  m_iface = nullptr;
74  m_router = nullptr;
75 
76  m_startItem = nullptr;
77  m_startLayer = 0;
78 
79  m_endItem = nullptr;
80 
81  m_frame = nullptr;
82  m_ctls = nullptr;
83  m_board = nullptr;
84  m_gridHelper = nullptr;
85 }
GRID_HELPER * m_gridHelper
Definition: pns_tool_base.h:83
TOOL_INTERACTIVE(TOOL_ID aId, const std::string &aName)
Constructor.
KIGFX::VIEW_CONTROLS * m_ctls
Definition: pns_tool_base.h:81
ITEM * m_startItem
Definition: pns_tool_base.h:73
ROUTER * m_router
Definition: pns_tool_base.h:85
PCB_EDIT_FRAME * m_frame
Definition: pns_tool_base.h:80
PNS_KICAD_IFACE * m_iface
Definition: pns_tool_base.h:84
TOOL_BASE::~TOOL_BASE ( )
virtual

Reimplemented from TOOL_BASE.

Definition at line 88 of file pns_tool_base.cpp.

References m_gridHelper, m_iface, and m_router.

89 {
90  delete m_gridHelper;
91  delete m_iface;
92  delete m_router;
93 }
GRID_HELPER * m_gridHelper
Definition: pns_tool_base.h:83
ROUTER * m_router
Definition: pns_tool_base.h:85
PNS_KICAD_IFACE * m_iface
Definition: pns_tool_base.h:84

Member Function Documentation

void TOOL_INTERACTIVE::Activate ( )
inherited

Function Activate() Runs the tool.

After activation, the tool starts receiving events until it is finished.

Definition at line 49 of file tool_interactive.cpp.

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

Referenced by MODULE_EDITOR_TOOLS::CopyItems(), PCBNEW_CONTROL::DeleteItemCursor(), PCB_TOOL::doInteractiveItemPlacement(), ROUTER_TOOL::DpDimensionsDialog(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), DRAWING_TOOL::drawZone(), PCB_EDITOR_CONTROL::DrillOrigin(), MODULE_EDITOR_TOOLS::EnumeratePads(), PCBNEW_CONTROL::GridSetOrigin(), PCB_EDITOR_CONTROL::HighlightNetCursor(), ROUTER_TOOL::InlineDrag(), EDIT_TOOL::Main(), LENGTH_TUNER_TOOL::mainLoop(), ROUTER_TOOL::mainLoop(), EDIT_TOOL::MeasureTool(), POINT_EDITOR::OnSelectionChange(), MODULE_EDITOR_TOOLS::PasteItems(), DRAWING_TOOL::PlaceDXF(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), DRAWING_TOOL::SetAnchor(), ROUTER_TOOL::SettingsDialog(), and PCB_EDITOR_CONTROL::ShowLocalRatsnest().

50 {
52 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:220
TOOL_ID m_toolId
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:215
bool InvokeTool(TOOL_ID aToolId)
Function InvokeTool() Calls a tool by sending a tool activation event to tool of given ID...
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 54 of file tool_base.cpp.

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

Referenced by TOOL_MANAGER::RegisterTool().

55 {
56  m_toolMgr = aManager;
57  m_toolSettings = TOOL_SETTINGS( this );
58 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:220
TOOL_SETTINGS m_toolSettings
Definition: tool_base.h:221
friend class TOOL_SETTINGS
Definition: tool_base.h:160
void TOOL_BASE::deleteTraces ( ITEM aStartItem,
bool  aWholeTrack 
)
protected

Definition at line 281 of file pns_tool_base.cpp.

References PNS::TOPOLOGY::AssembleTrivialPath(), PNS::NODE::Branch(), PNS::ROUTER::CommitRouting(), PNS::ROUTER::GetWorld(), PNS::ITEM_SET::Items(), m_router, and PNS::NODE::Remove().

Referenced by ROUTER_TOOL::mainLoop().

282 {
283  NODE *node = m_router->GetWorld()->Branch();
284 
285  if( !aStartItem )
286  return;
287 
288  if( !aWholeTrack )
289  {
290  node->Remove( aStartItem );
291  }
292  else
293  {
294  TOPOLOGY topo( node );
295  ITEM_SET path = topo.AssembleTrivialPath( aStartItem );
296 
297  for( auto ent : path.Items() )
298  node->Remove( ent.item );
299  }
300 
301  m_router->CommitRouting( node );
302 }
NODE * Branch()
Function Branch()
Definition: pns_node.cpp:109
NODE * GetWorld() const
Definition: pns_router.h:134
ROUTER * m_router
Definition: pns_tool_base.h:85
void Remove(SOLID *aSolid)
Function Remove()
Definition: pns_node.cpp:729
void CommitRouting(NODE *aNode)
Definition: pns_router.cpp:317
const TOOL_EVENT TOOL_INTERACTIVE::evActivate ( std::string  aToolName = "")
protectedinherited

functions below are not yet implemented - their interface may change

const TOOL_EVENT TOOL_INTERACTIVE::evButtonDown ( int  aButton = BUT_ANY)
protectedinherited
const TOOL_EVENT TOOL_INTERACTIVE::evButtonUp ( int  aButton = BUT_ANY)
protectedinherited
const TOOL_EVENT TOOL_INTERACTIVE::evClick ( int  aButton = BUT_ANY)
protectedinherited
const TOOL_EVENT TOOL_INTERACTIVE::evCommand ( int  aCommandId = -1)
protectedinherited
const TOOL_EVENT TOOL_INTERACTIVE::evCommand ( std::string  aCommandStr = "")
protectedinherited
const TOOL_EVENT TOOL_INTERACTIVE::evDrag ( int  aButton = BUT_ANY)
protectedinherited
const TOOL_EVENT TOOL_INTERACTIVE::evMotion ( )
protectedinherited
template<typename T >
T* TOOL_BASE::getEditFrame ( ) const
inlineprotectedinherited

Function getEditFrame()

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

Definition at line 193 of file tool_base.h.

References TOOL_BASE::getEditFrameInt().

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

194  {
195  return static_cast<T*>( getEditFrameInt() );
196  }
T
enum T contains all this lexer's tokens.
wxWindow * getEditFrameInt() const
Definition: tool_base.cpp:42
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 122 of file tool_base.h.

References TOOL_BASE::m_toolId.

Referenced by TOOL_MANAGER::finishTool(), TOOL_MANAGER::InitTools(), TOOL_MANAGER::isActive(), TOOL_MANAGER::RegisterTool(), ACTION_MANAGER::RunHotKey(), and TOOL_MANAGER::runTool().

123  {
124  return m_toolId;
125  }
TOOL_ID m_toolId
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:215
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 144 of file tool_base.h.

References TOOL_BASE::m_toolMgr.

Referenced by BOARD_COMMIT::BOARD_COMMIT(), PCB_TOOL::doInteractiveItemPlacement(), CONTEXT_MENU::getToolManager(), EDIT_TOOL::MeasureTool(), and CONTEXT_MENU::onMenuEvent().

145  {
146  return m_toolMgr;
147  }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:220
template<typename T >
T* TOOL_BASE::getModel ( ) const
inlineprotectedinherited

Function getModel()

Returns the model object if it matches the requested type.

Definition at line 204 of file tool_base.h.

References TOOL_BASE::getModelInt().

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

205  {
206  EDA_ITEM* m = getModelInt();
207 
208  return static_cast<T*>( m );
209  }
T
enum T contains all this lexer's tokens.
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:151
EDA_ITEM * getModelInt() const
Definition: tool_base.cpp:48
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 133 of file tool_base.h.

References TOOL_BASE::m_toolName.

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

134  {
135  return m_toolName;
136  }
std::string m_toolName
Name of the tool.
Definition: tool_base.h:219
TOOL_SETTINGS & TOOL_BASE::GetSettings ( )
inherited

Definition at line 72 of file tool_base.cpp.

References TOOL_BASE::m_toolSettings.

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

73 {
74  return m_toolSettings;
75 }
TOOL_SETTINGS m_toolSettings
Definition: tool_base.h:221
TOOL_TYPE TOOL_BASE::GetType ( ) const
inlineinherited

Function GetType() Returns the type of the tool.

Returns
The type of the tool.

Definition at line 111 of file tool_base.h.

References TOOL_BASE::m_type.

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

112  {
113  return m_type;
114  }
TOOL_TYPE m_type
Stores the type of the tool.
Definition: tool_base.h:212
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 30 of file tool_base.cpp.

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

Referenced by PCB_EDITOR_CONTROL::CrossProbeSchToPcb(), PCBNEW_CONTROL::CursorControl(), SELECTION_TOOL::disambiguationMenu(), MICROWAVE_TOOL::drawMicrowaveInductor(), PCB_EDITOR_CONTROL::DrillOrigin(), MODULE_EDITOR_TOOLS::EnumeratePads(), SELECTION_TOOL::findCallback(), ROUTER_TOOL::getStartLayer(), PCBNEW_CONTROL::GridSetOrigin(), PCBNEW_CONTROL::HighContrastMode(), highlightNet(), PCBNEW_CONTROL::LayerAlphaDec(), PCBNEW_CONTROL::LayerAlphaInc(), EDIT_TOOL::Main(), EDIT_TOOL::MeasureTool(), MODULE_EDITOR_TOOLS::ModuleEdgeOutlines(), MODULE_EDITOR_TOOLS::ModuleTextOutlines(), EDIT_TOOL::MoveExact(), POINT_EDITOR::OnSelectionChange(), PCBNEW_CONTROL::PadDisplayMode(), PCBNEW_CONTROL::PanControl(), pickSingleItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), PCB_EDITOR_CONTROL::Reset(), PCBNEW_CONTROL::Reset(), Reset(), DRAWING_TOOL::Reset(), SELECTION_TOOL::Reset(), SELECTION_TOOL::selectable(), SELECTION_TOOL::selectionContains(), SELECTION_TOOL::selectMultiple(), ZOOM_TOOL::selectRegion(), PCBNEW_CONTROL::TrackDisplayMode(), POINT_EDITOR::updateEditedPoint(), COMMON_TOOLS::updateGrid(), PCBNEW_CONTROL::updateGrid(), POINT_EDITOR::updatePoints(), SELECTION_TOOL::updateSelection(), updateStartItem(), PCBNEW_CONTROL::ViaDisplayMode(), PCB_TOOL::view(), PCBNEW_CONTROL::ZoneDisplayMode(), COMMON_TOOLS::ZoomFitScreen(), SELECTION_TOOL::zoomFitSelection(), COMMON_TOOLS::ZoomInOutCenter(), and SELECTION_TOOL::~SELECTION_TOOL().

31 {
32  return m_toolMgr->GetView();
33 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:220
KIGFX::VIEW * GetView() const
Definition: tool_manager.h:243
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 36 of file tool_base.cpp.

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

Referenced by POINT_EDITOR::addCorner(), PCBNEW_CONTROL::AppendBoard(), PCB_TOOL::controls(), MODULE_EDITOR_TOOLS::CopyItems(), PCBNEW_CONTROL::CursorControl(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawZone(), MODULE_EDITOR_TOOLS::EnumeratePads(), SELECTION_TOOL::findMove(), EDIT_TOOL::getModificationPoint(), PCB_EDITOR_CONTROL::HighlightNet(), PICKER_TOOL::Main(), EDIT_TOOL::Main(), ROUTER_TOOL::mainLoop(), EDIT_TOOL::MeasureTool(), POINT_EDITOR::OnSelectionChange(), MODULE_EDITOR_TOOLS::PasteItems(), ROUTER_TOOL::performDragging(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), Reset(), DRAWING_TOOL::Reset(), PCBNEW_CONTROL::ResetCoords(), DRAWING_TOOL::runPolygonEventLoop(), SELECTION_TOOL::selectCursor(), SELECTION_TOOL::selectMultiple(), ZOOM_TOOL::selectRegion(), PICKER_TOOL::setControls(), POINT_EDITOR::setEditedPoint(), COMMON_TOOLS::ZoomCenter(), and COMMON_TOOLS::ZoomInOut().

37 {
38  return m_toolMgr->GetViewControls();
39 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:220
KIGFX::VIEW_CONTROLS * GetViewControls() const
Definition: tool_manager.h:248
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 122 of file tool_interactive.h.

References TOOL_INTERACTIVE::goInternal().

Referenced by LENGTH_TUNER_TOOL::Reset(), ZOOM_TOOL::SetTransitions(), LENGTH_TUNER_TOOL::SetTransitions(), ROUTER_TOOL::SetTransitions(), PAD_TOOL::SetTransitions(), MICROWAVE_TOOL::SetTransitions(), POINT_EDITOR::SetTransitions(), COMMON_TOOLS::SetTransitions(), ALIGN_DISTRIBUTE_TOOL::SetTransitions(), PCBNEW_CONTROL::SetTransitions(), POSITION_RELATIVE_TOOL::SetTransitions(), MODULE_EDITOR_TOOLS::SetTransitions(), PICKER_TOOL::SetTransitions(), PCB_EDITOR_CONTROL::SetTransitions(), EDIT_TOOL::SetTransitions(), SELECTION_TOOL::SetTransitions(), and DRAWING_TOOL::SetTransitions().

124 {
125  TOOL_STATE_FUNC sptr = std::bind( aStateFunc, static_cast<T*>( this ), std::placeholders::_1 );
126 
127  goInternal( sptr, aConditions );
128 }
std::function< int(const TOOL_EVENT &)> TOOL_STATE_FUNC
Definition: tool_base.h:59
void goInternal(TOOL_STATE_FUNC &aState, const TOOL_EVENT_LIST &aConditions)
void TOOL_BASE::highlightNet ( bool  aEnabled,
int  aNetcode = -1 
)
protectedvirtual

Definition at line 196 of file pns_tool_base.cpp.

References KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), TOOL_BASE::getView(), KIGFX::RENDER_SETTINGS::SetHighlight(), and KIGFX::VIEW::UpdateAllLayersColor().

Referenced by ROUTER_TOOL::finishInteractive(), ROUTER_TOOL::performDragging(), LENGTH_TUNER_TOOL::performTuning(), and ROUTER_TOOL::prepareInteractive().

197 {
199 
200  if( aNetcode >= 0 && aEnabled )
201  rs->SetHighlight( true, aNetcode );
202  else
203  rs->SetHighlight( false );
204 
206 }
Class RENDER_SETTINGS Contains all the knowledge about how graphical objects are drawn on any output ...
Definition: painter.h:56
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:196
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:30
virtual RENDER_SETTINGS * GetSettings()=0
Function GetSettings Returns pointer to current settings that are going to be used when drawing items...
void UpdateAllLayersColor()
Function UpdateAllLayersColor() Applies the new coloring scheme to all layers.
Definition: view.cpp:674
void SetHighlight(bool aEnabled, int aNetcode=-1)
Function SetHighlight Turns on/off highlighting - it may be done for the active layer or the specifie...
Definition: painter.h:140
virtual bool TOOL_BASE::Init ( )
inlinevirtualinherited

Function Init() Init() is called once upon a registration of the tool.

Returns
True if the initialization went fine, false - otherwise.

Reimplemented in SELECTION_TOOL, DRAWING_TOOL, EDIT_TOOL, POSITION_RELATIVE_TOOL, PCB_EDITOR_CONTROL, POINT_EDITOR, MICROWAVE_TOOL, PAD_TOOL, ALIGN_DISTRIBUTE_TOOL, and ROUTER_TOOL.

Definition at line 93 of file tool_base.h.

Referenced by TOOL_MANAGER::InitTools().

94  {
95  return true;
96  }
ITEM * TOOL_BASE::pickSingleItem ( const VECTOR2I aWhere,
int  aNet = -1,
int  aLayer = -1 
)
protectedvirtual

Definition at line 123 of file pns_tool_base.cpp.

References PCB_BASE_FRAME::GetDisplayOptions(), KIGFX::VIEW::GetTopLayer(), TOOL_BASE::getView(), IsCopperLayer(), PNS::ITEM_SET::Items(), PNS::ITEM::KindStr(), PNS::ITEM::Layers(), m_router, LAYER_RANGE::Overlaps(), PNS::ROUTER::QueryHoverItems(), PNS::ITEM::SOLID_T, LAYER_RANGE::Start(), and PNS::ITEM::VIA_T.

Referenced by updateEndItem(), and updateStartItem().

124 {
125  int tl = getView()->GetTopLayer();
126 
127  if( aLayer > 0 )
128  tl = aLayer;
129 
130  ITEM* prioritized[4];
131 
132  for( int i = 0; i < 4; i++ )
133  prioritized[i] = 0;
134 
135  ITEM_SET candidates = m_router->QueryHoverItems( aWhere );
136 
137  for( ITEM* item : candidates.Items() )
138  {
139  if( !IsCopperLayer( item->Layers().Start() ) )
140  continue;
141 
142  // fixme: this causes flicker with live loop removal...
143  //if( item->Parent() && !item->Parent()->ViewIsVisible() )
144  // continue;
145 
146  if( aNet < 0 || item->Net() == aNet )
147  {
148  if( item->OfKind( ITEM::VIA_T | ITEM::SOLID_T ) )
149  {
150  if( !prioritized[2] )
151  prioritized[2] = item;
152  if( item->Layers().Overlaps( tl ) )
153  prioritized[0] = item;
154  }
155  else
156  {
157  if( !prioritized[3] )
158  prioritized[3] = item;
159  if( item->Layers().Overlaps( tl ) )
160  prioritized[1] = item;
161  }
162  }
163  }
164 
165  ITEM* rv = NULL;
166  PCB_EDIT_FRAME* frame = getEditFrame<PCB_EDIT_FRAME>();
167  DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)frame->GetDisplayOptions();
168 
169  for( int i = 0; i < 4; i++ )
170  {
171  ITEM* item = prioritized[i];
172 
173  if( displ_opts->m_ContrastModeDisplay )
174  if( item && !item->Layers().Overlaps( tl ) )
175  item = NULL;
176 
177  if( item )
178  {
179  rv = item;
180  break;
181  }
182  }
183 
184  if( rv && aLayer >= 0 && !rv->Layers().Overlaps( aLayer ) )
185  rv = NULL;
186 
187  if( rv )
188  {
189  wxLogTrace( "PNS", "%s, layer : %d, tl: %d", rv->KindStr().c_str(), rv->Layers().Start(), tl );
190  }
191 
192  return rv;
193 }
int GetTopLayer() const
Definition: view.cpp:739
const ITEM_SET QueryHoverItems(const VECTOR2I &aP)
Definition: pns_router.cpp:118
void * GetDisplayOptions() override
Function GetDisplayOptions returns the display options current in use Display options are relative to...
ROUTER * m_router
Definition: pns_tool_base.h:85
Class DISPLAY_OPTIONS handles display options like enable/disable some optional drawings.
Definition: pcbstruct.h:62
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:30
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
const ROUTING_SETTINGS& PNS::TOOL_BASE::PNSSettings ( ) const
inline

Definition at line 54 of file pns_tool_base.h.

Referenced by EDIT_TOOL::invokeInlineRouter().

55  {
56  return m_savedSettings;
57  }
ROUTING_SETTINGS m_savedSettings
Stores routing settings between router invocations.
Definition: pns_tool_base.h:71
void TOOL_BASE::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.

Reimplemented in LENGTH_TUNER_TOOL, and ROUTER_TOOL.

Definition at line 97 of file pns_tool_base.cpp.

References PNS::ROUTER::ClearWorld(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), PNS::ROUTER::LoadSettings(), m_board, m_ctls, m_frame, m_gridHelper, m_iface, m_router, m_savedSettings, m_savedSizes, PNS_KICAD_IFACE::SetBoard(), PNS::ROUTER::SetInterface(), PNS::ROUTER::SyncWorld(), and PNS::ROUTER::UpdateSizes().

98 {
99  delete m_gridHelper;
100  delete m_iface;
101  delete m_router;
102 
103  m_frame = getEditFrame<PCB_EDIT_FRAME>();
105  m_board = getModel<BOARD>();
106 
107  m_iface = new PNS_KICAD_IFACE;
108  m_iface->SetBoard( m_board );
109  m_iface->SetView( getView() );
110  m_iface->SetHostFrame( m_frame );
111 
112  m_router = new ROUTER;
113  m_router->SetInterface(m_iface);
114  m_router->ClearWorld();
115  m_router->SyncWorld();
118 
120 }
GRID_HELPER * m_gridHelper
Definition: pns_tool_base.h:83
void LoadSettings(const ROUTING_SETTINGS &aSettings)
Changes routing settings to ones passed in the parameter.
Definition: pns_router.h:192
SIZES_SETTINGS m_savedSizes
Stores sizes settings between router invocations.
Definition: pns_tool_base.h:72
void SyncWorld()
Definition: pns_router.cpp:91
void ClearWorld()
Definition: pns_router.cpp:100
KIGFX::VIEW_CONTROLS * m_ctls
Definition: pns_tool_base.h:81
ROUTER * m_router
Definition: pns_tool_base.h:85
ROUTING_SETTINGS m_savedSettings
Stores routing settings between router invocations.
Definition: pns_tool_base.h:71
void SetInterface(ROUTER_IFACE *aIface)
Definition: pns_router.cpp:483
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:36
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:30
void UpdateSizes(const SIZES_SETTINGS &aSizes)
Applies stored settings.
Definition: pns_router.cpp:278
PCB_EDIT_FRAME * m_frame
Definition: pns_tool_base.h:80
void SetBoard(BOARD *aBoard)
PNS_KICAD_IFACE * m_iface
Definition: pns_tool_base.h:84
ROUTER * TOOL_BASE::Router ( ) const

Definition at line 305 of file pns_tool_base.cpp.

References m_router.

306 {
307  return m_router;
308 }
ROUTER * m_router
Definition: pns_tool_base.h:85
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 78 of file tool_interactive.cpp.

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

Referenced by DRAWING_TOOL::PlaceText().

79 {
80  m_toolMgr->RunMainStack( this, std::move( aFunc ) );
81 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:220
void RunMainStack(TOOL_BASE *aTool, std::function< void()> aFunc)
void TOOL_INTERACTIVE::SetContextMenu ( CONTEXT_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 67 of file tool_interactive.cpp.

References CMENU_OFF, TOOL_BASE::m_toolMgr, TOOL_MANAGER::ScheduleContextMenu(), and CONTEXT_MENU::SetTool().

Referenced by SELECTION_TOOL::disambiguationMenu(), LENGTH_TUNER_TOOL::mainLoop(), ROUTER_TOOL::mainLoop(), and TOOL_MENU::ShowContextMenu().

68 {
69  if( aMenu )
70  aMenu->SetTool( this );
71  else
72  aTrigger = CMENU_OFF;
73 
74  m_toolMgr->ScheduleContextMenu( this, aMenu, aTrigger );
75 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:220
void ScheduleContextMenu(TOOL_BASE *aTool, CONTEXT_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger)
Sets behaviour of the tool's context popup menu.
void SetTool(TOOL_INTERACTIVE *aTool)
Function SetTool() Sets a tool that is the creator of the menu.
virtual void TOOL_BASE::SetTransitions ( )
inlinevirtualinherited

Function SetTransitions() This method is meant to be overridden in order to specify handlers for events.

It is called every time tool is reset or finished.

Reimplemented in DRAWING_TOOL, SELECTION_TOOL, EDIT_TOOL, PCB_EDITOR_CONTROL, PICKER_TOOL, MODULE_EDITOR_TOOLS, POSITION_RELATIVE_TOOL, PCBNEW_CONTROL, ALIGN_DISTRIBUTE_TOOL, COMMON_TOOLS, POINT_EDITOR, MICROWAVE_TOOL, PAD_TOOL, ROUTER_TOOL, LENGTH_TUNER_TOOL, and ZOOM_TOOL.

Definition at line 154 of file tool_base.h.

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

154 {};
const VECTOR2I TOOL_BASE::snapToItem ( bool  aEnabled,
ITEM aItem,
VECTOR2I  aP 
)
protected

Definition at line 311 of file pns_tool_base.cpp.

References SEG::A, GRID_HELPER::Align(), GRID_HELPER::AlignToSegment(), SEG::B, PNS::ITEM::Kind(), m_gridHelper, PNS::SEGMENT::Seg(), PNS::ITEM::SEGMENT_T, PNS::ITEM::SOLID_T, PNS::ITEM::VIA_T, and PNS::SEGMENT::Width().

Referenced by updateEndItem(), and updateStartItem().

312 {
313  VECTOR2I anchor;
314 
315  if( !aItem || !aEnabled )
316  {
317  return m_gridHelper->Align( aP );
318  }
319 
320  switch( aItem->Kind() )
321  {
322  case ITEM::SOLID_T:
323  anchor = static_cast<SOLID*>( aItem )->Pos();
324  break;
325 
326  case ITEM::VIA_T:
327  anchor = static_cast<VIA*>( aItem )->Pos();
328  break;
329 
330  case ITEM::SEGMENT_T:
331  {
332  SEGMENT* seg = static_cast<SEGMENT*>( aItem );
333  const SEG& s = seg->Seg();
334  int w = seg->Width();
335 
336 
337  if( ( aP - s.A ).EuclideanNorm() < w / 2 )
338  anchor = s.A;
339  else if( ( aP - s.B ).EuclideanNorm() < w / 2 )
340  anchor = s.B;
341  else
342  anchor = m_gridHelper->AlignToSegment( aP, s );
343 
344  break;
345  }
346 
347  default:
348  break;
349  }
350 
351  return anchor;
352 }
GRID_HELPER * m_gridHelper
Definition: pns_tool_base.h:83
VECTOR2I Align(const VECTOR2I &aPoint) const
Definition: grid_helper.cpp:95
VECTOR2I AlignToSegment(const VECTOR2I &aPoint, const SEG &aSeg)
Definition: seg.h:37
VECTOR2I A
Definition: seg.h:47
Struct SEGMENT is a simple container used when filling areas with segments.
Definition: class_zone.h:57
VECTOR2I B
Definition: seg.h:48
void TOOL_BASE::updateEndItem ( const TOOL_EVENT aEvent)
protectedvirtual

Definition at line 237 of file pns_tool_base.cpp.

References KIGFX::VIEW_CONTROLS::ForceCursorPosition(), PNS::ROUTER::GetCurrentLayer(), PNS::ROUTER::GetCurrentNets(), KIGFX::VIEW_CONTROLS::GetMousePosition(), PNS::ROUTER::IsPlacingVia(), PNS::ITEM::KindStr(), PNS::ITEM::Layers(), m_ctls, m_endItem, m_endSnapPoint, m_router, MD_SHIFT, TOOL_EVENT::Modifier(), pickSingleItem(), snapToItem(), and LAYER_RANGE::Start().

Referenced by ROUTER_TOOL::InlineDrag(), ROUTER_TOOL::onViaCommand(), ROUTER_TOOL::performDragging(), and ROUTER_TOOL::performRouting().

238 {
240  int layer;
241  bool snapEnabled = !aEvent.Modifier( MD_SHIFT );
242 
243  if( m_router->GetCurrentNets().empty() || m_router->GetCurrentNets().front() < 0 )
244  {
245  m_endSnapPoint = snapToItem( snapEnabled, nullptr, p );
247  m_endItem = nullptr;
248 
249  return;
250  }
251 
252  if( m_router->IsPlacingVia() )
253  layer = -1;
254  else
255  layer = m_router->GetCurrentLayer();
256 
257  ITEM* endItem = nullptr;
258 
259  std::vector<int> nets = m_router->GetCurrentNets();
260 
261  for( int net : nets )
262  {
263  endItem = pickSingleItem( p, net, layer );
264 
265  if( endItem )
266  break;
267  }
268 
269  VECTOR2I cursorPos = snapToItem( snapEnabled, endItem, p );
270  m_ctls->ForceCursorPosition( true, cursorPos );
271  m_endItem = endItem;
272  m_endSnapPoint = cursorPos;
273 
274  if( m_endItem )
275  {
276  wxLogTrace( "PNS", "%s, layer : %d", m_endItem->KindStr().c_str(), m_endItem->Layers().Start() );
277  }
278 }
virtual VECTOR2D GetMousePosition(bool aWorldCoordinates=true) const =0
Function GetMousePosition() Returns the current mouse pointer position.
const LAYER_RANGE & Layers() const
Function Layers()
Definition: pns_item.h:207
int Modifier(int aMask=MD_MODIFIER_MASK) const
Returns information about key modifiers state (Ctrl, Alt, etc.)
Definition: tool_event.h:311
bool IsPlacingVia() const
Definition: pns_router.cpp:459
const std::vector< int > GetCurrentNets() const
Definition: pns_router.cpp:419
const VECTOR2I snapToItem(bool aEnabled, ITEM *aItem, VECTOR2I aP)
KIGFX::VIEW_CONTROLS * m_ctls
Definition: pns_tool_base.h:81
ROUTER * m_router
Definition: pns_tool_base.h:85
virtual void ForceCursorPosition(bool aEnabled, const VECTOR2D &aPosition=VECTOR2D(0, 0))
Function ForceCursorPosition() Places the cursor immediately at a given point.
int Start() const
Definition: pns_layerset.h:83
VECTOR2I m_endSnapPoint
Definition: pns_tool_base.h:78
virtual ITEM * pickSingleItem(const VECTOR2I &aWhere, int aNet=-1, int aLayer=-1)
int GetCurrentLayer() const
Definition: pns_router.cpp:428
const std::string KindStr() const
Function KindStr()
Definition: pns_item.cpp:63
void TOOL_BASE::updateStartItem ( TOOL_EVENT aEvent)
protectedvirtual

Definition at line 209 of file pns_tool_base.cpp.

References KIGFX::VIEW_CONTROLS::ForceCursorPosition(), KIGFX::VIEW_CONTROLS::GetCursorPosition(), KIGFX::VIEW::GetTopLayer(), TOOL_BASE::getView(), TOOL_EVENT::IsClick(), TOOL_EVENT::IsMotion(), PNS::ITEM::Layers(), m_ctls, m_startItem, m_startSnapPoint, MD_SHIFT, TOOL_EVENT::Modifier(), LAYER_RANGE::Overlaps(), pickSingleItem(), TOOL_EVENT::Position(), and snapToItem().

Referenced by LENGTH_TUNER_TOOL::mainLoop(), and ROUTER_TOOL::mainLoop().

210 {
211  int tl = getView()->GetTopLayer();
213  VECTOR2I p;
214 
215  bool snapEnabled = true;
216 
217  if( aEvent.IsMotion() || aEvent.IsClick() )
218  {
219  snapEnabled = !aEvent.Modifier( MD_SHIFT );
220  p = aEvent.Position();
221  }
222  else
223  {
224  p = cp;
225  }
226 
228 
229  if( !snapEnabled && m_startItem && !m_startItem->Layers().Overlaps( tl ) )
230  m_startItem = nullptr;
231 
232  m_startSnapPoint = snapToItem( snapEnabled, m_startItem, p );
234 }
int GetTopLayer() const
Definition: view.cpp:739
const LAYER_RANGE & Layers() const
Function Layers()
Definition: pns_item.h:207
bool IsMotion() const
Definition: tool_event.h:290
VECTOR2I m_startSnapPoint
Definition: pns_tool_base.h:75
int Modifier(int aMask=MD_MODIFIER_MASK) const
Returns information about key modifiers state (Ctrl, Alt, etc.)
Definition: tool_event.h:311
const VECTOR2D & Position() const
Returns mouse cursor position in world coordinates.
Definition: tool_event.h:248
const VECTOR2I snapToItem(bool aEnabled, ITEM *aItem, VECTOR2I aP)
KIGFX::VIEW_CONTROLS * m_ctls
Definition: pns_tool_base.h:81
virtual VECTOR2D GetCursorPosition() const =0
Function GetCursorPosition() Returns the current cursor position in world coordinates.
ITEM * m_startItem
Definition: pns_tool_base.h:73
virtual void ForceCursorPosition(bool aEnabled, const VECTOR2D &aPosition=VECTOR2D(0, 0))
Function ForceCursorPosition() Places the cursor immediately at a given point.
bool Overlaps(const LAYER_RANGE &aOther) const
Definition: pns_layerset.h:68
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:30
virtual ITEM * pickSingleItem(const VECTOR2I &aWhere, int aNet=-1, int aLayer=-1)
bool IsClick(int aButtonMask=BUT_ANY) const
Definition: tool_event.h:268
OPT_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 55 of file tool_interactive.cpp.

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

Referenced by MODULE_EDITOR_TOOLS::CopyItems(), PCBNEW_CONTROL::DeleteItemCursor(), SELECTION_TOOL::disambiguationMenu(), PCB_TOOL::doInteractiveItemPlacement(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), PCB_EDITOR_CONTROL::DrillOrigin(), MODULE_EDITOR_TOOLS::EnumeratePads(), PCBNEW_CONTROL::GridSetOrigin(), PCB_EDITOR_CONTROL::HighlightNetCursor(), ROUTER_TOOL::InlineDrag(), ZOOM_TOOL::Main(), PICKER_TOOL::Main(), EDIT_TOOL::Main(), SELECTION_TOOL::Main(), LENGTH_TUNER_TOOL::mainLoop(), ROUTER_TOOL::mainLoop(), EDIT_TOOL::MeasureTool(), POINT_EDITOR::OnSelectionChange(), MODULE_EDITOR_TOOLS::PasteItems(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), DRAWING_TOOL::PlaceDXF(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::runPolygonEventLoop(), SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectPoint(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), ZOOM_TOOL::selectRegion(), DRAWING_TOOL::SetAnchor(), and PCB_EDITOR_CONTROL::ShowLocalRatsnest().

56 {
57  return m_toolMgr->ScheduleWait( this, aEventList );
58 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:220
boost::optional< 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.

Member Data Documentation

TOOL_ACTION TOOL_BASE::ACT_RouterOptions
static
GRID_HELPER* PNS::TOOL_BASE::m_gridHelper
protected

Definition at line 83 of file pns_tool_base.h.

Referenced by Reset(), snapToItem(), TOOL_BASE(), and ~TOOL_BASE().

PNS_KICAD_IFACE* PNS::TOOL_BASE::m_iface
protected

Definition at line 84 of file pns_tool_base.h.

Referenced by Reset(), TOOL_BASE(), and ~TOOL_BASE().

MSG_PANEL_ITEMS PNS::TOOL_BASE::m_panelItems
protected

Definition at line 69 of file pns_tool_base.h.

ROUTING_SETTINGS PNS::TOOL_BASE::m_savedSettings
protected

Stores routing settings between router invocations.

Definition at line 71 of file pns_tool_base.h.

Referenced by ROUTER_TOOL::Init(), LENGTH_TUNER_TOOL::mainLoop(), ROUTER_TOOL::mainLoop(), Reset(), ROUTER_TOOL::SettingsDialog(), and ROUTER_TOOL::~ROUTER_TOOL().

SIZES_SETTINGS PNS::TOOL_BASE::m_savedSizes
protected

Stores sizes settings between router invocations.

Definition at line 72 of file pns_tool_base.h.

Referenced by ROUTER_TOOL::DpDimensionsDialog(), LENGTH_TUNER_TOOL::mainLoop(), ROUTER_TOOL::mainLoop(), and Reset().

int PNS::TOOL_BASE::m_startLayer
protected

Definition at line 74 of file pns_tool_base.h.

Referenced by TOOL_BASE().

TOOL_ID TOOL_BASE::m_toolId
protectedinherited

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

Definition at line 215 of file tool_base.h.

Referenced by TOOL_INTERACTIVE::Activate(), TOOL_BASE::GetId(), and EDIT_TOOL::getModificationPoint().

TOOL_MANAGER* TOOL_BASE::m_toolMgr
protectedinherited

Definition at line 220 of file tool_base.h.

Referenced by TOOL_INTERACTIVE::Activate(), PCBNEW_CONTROL::AppendBoard(), PAD_TOOL::applyPadSettings(), TOOL_BASE::attachManager(), SELECTION_TOOL::clearSelection(), MODULE_EDITOR_TOOLS::CopyItems(), PAD_TOOL::copyPadSettings(), PCB_EDITOR_CONTROL::CrossProbePcbToSch(), PCB_EDITOR_CONTROL::CrossProbeSchToPcb(), PCBNEW_CONTROL::CursorControl(), ROUTER_TOOL::CustomTrackWidthDialog(), PCBNEW_CONTROL::DeleteItemCursor(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawSegment(), DRAWING_TOOL::drawZone(), PCB_EDITOR_CONTROL::DrillOrigin(), EDIT_TOOL::Duplicate(), EDIT_TOOL::editFootprintInFpEditor(), MODULE_EDITOR_TOOLS::EnumeratePads(), EDIT_TOOL::ExchangeFootprints(), SELECTION_TOOL::findCallback(), SELECTION_TOOL::findMove(), EDIT_TOOL::Flip(), TOOL_BASE::getEditFrameInt(), TOOL_BASE::GetManager(), TOOL_BASE::getModelInt(), EDIT_TOOL::getModificationPoint(), DRAWING_TOOL::getSourceZoneForAction(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), TOOL_INTERACTIVE::goInternal(), PCBNEW_CONTROL::GridSetOrigin(), PCB_EDITOR_CONTROL::HighlightNet(), PCB_EDITOR_CONTROL::HighlightNetCursor(), ROUTER_TOOL::Init(), ALIGN_DISTRIBUTE_TOOL::Init(), PAD_TOOL::Init(), POINT_EDITOR::Init(), PCB_EDITOR_CONTROL::Init(), EDIT_TOOL::Init(), POSITION_RELATIVE_TOOL::Init(), ROUTER_TOOL::InlineDrag(), EDIT_TOOL::invokeInlineRouter(), ZOOM_TOOL::Main(), PICKER_TOOL::Main(), EDIT_TOOL::Main(), SELECTION_TOOL::Main(), LENGTH_TUNER_TOOL::mainLoop(), ROUTER_TOOL::mainLoop(), EDIT_TOOL::Mirror(), PCB_EDITOR_CONTROL::modifyLockSelected(), EDIT_TOOL::MoveExact(), POINT_EDITOR::OnSelectionChange(), MODULE_EDITOR_TOOLS::PasteItems(), DRAWING_TOOL::PlaceDXF(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), POSITION_RELATIVE_TOOL::PositionRelative(), EDIT_TOOL::Properties(), PAD_TOOL::pushPadSettings(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), EDIT_TOOL::Remove(), SELECTION_TOOL::RequestSelection(), EDIT_TOOL::Rotate(), TOOL_INTERACTIVE::RunMainStack(), SELECTION_TOOL::SanitizeSelection(), SELECTION_TOOL::selectConnection(), SELECTION_TOOL::selectCopper(), SELECTION_TOOL::SelectItem(), SELECTION_TOOL::SelectItems(), SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectNet(), SELECTION_TOOL::selectOnSheetFromEeschema(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), SELECTION_TOOL::selectSameSheet(), TOOL_INTERACTIVE::SetContextMenu(), PCB_EDITOR_CONTROL::ShowLocalRatsnest(), SELECTION_TOOL::toggleSelection(), PCB_EDITOR_CONTROL::TrackWidthDec(), PCB_EDITOR_CONTROL::TrackWidthInc(), SELECTION_TOOL::UnselectItem(), SELECTION_TOOL::UnselectItems(), PCB_EDITOR_CONTROL::ViaSizeDec(), PCB_EDITOR_CONTROL::ViaSizeInc(), TOOL_INTERACTIVE::Wait(), PCB_EDITOR_CONTROL::ZoneDuplicate(), PCB_EDITOR_CONTROL::ZoneFill(), PCB_EDITOR_CONTROL::ZoneMerge(), and PCB_EDITOR_CONTROL::ZoneUnfill().

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

Referenced by TOOL_BASE::GetName().

TOOL_SETTINGS TOOL_BASE::m_toolSettings
protectedinherited

Definition at line 221 of file tool_base.h.

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

TOOL_TYPE TOOL_BASE::m_type
protectedinherited

Stores the type of the tool.

Definition at line 212 of file tool_base.h.

Referenced by TOOL_BASE::GetType().


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