KiCad PCB EDA Suite
PCB_INSPECTION_TOOL Class Reference

PCB_INSPECTION_TOOL. More...

#include <pcb_inspection_tool.h>

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

 PCB_INSPECTION_TOOL ()
 
bool Init () override
 Function Init() Init() is called once upon a registration of the tool. More...
 
void Reset (RESET_REASON aReason) override
 Function Reset() Brings the tool to a known, initial state. More...
 
int ShowStatisticsDialog (const TOOL_EVENT &aEvent)
 Function ShowStatisticDialog() More...
 
int CrossProbePcbToSch (const TOOL_EVENT &aEvent)
 

Notifies eeschema about the selected item.

More...
 
int HighlightNet (const TOOL_EVENT &aEvent)
 

Highlights net belonging to the item under the cursor.

More...
 
int ClearHighlight (const TOOL_EVENT &aEvent)
 

Clears all board highlights

More...
 
int HighlightNetTool (const TOOL_EVENT &aEvent)
 

Launches a tool to pick the item whose net is going to be highlighted.

More...
 
int HighlightItem (const TOOL_EVENT &aEvent)
 

Performs the appropriate action in response to an eeschema cross-probe.

More...
 
int UpdateSelectionRatsnest (const TOOL_EVENT &aEvent)
 

Updates ratsnest for selected items.

More...
 
int HideDynamicRatsnest (const TOOL_EVENT &aEvent)
 

Hides ratsnest for selected items. Called when there are no items selected.

More...
 
int LocalRatsnestTool (const TOOL_EVENT &aEvent)
 

Shows local ratsnest of a component

More...
 
int FlipPcbView (const TOOL_EVENT &aEvent)
 
int ListNets (const TOOL_EVENT &aEvent)
 
int HideNet (const TOOL_EVENT &aEvent)
 

Hide the ratsnest for a given net

More...
 
int ShowNet (const TOOL_EVENT &aEvent)
 

Show the ratsnest for a given net

More...
 
int InspectClearance (const TOOL_EVENT &aEvent)
 

Show the clearance resolution for two selected items

More...
 
int InspectConstraints (const TOOL_EVENT &aEvent)
 
void SetIsFootprintEditor (bool aEnabled)
 Function SetIsFootprintEditor() More...
 
bool IsFootprintEditor () const
 
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...
 
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...
 
bool IsToolActive () const
 

Protected Types

enum  INTERACTIVE_PLACEMENT_OPTIONS { IPO_ROTATE = 0x01, IPO_FLIP = 0x02, IPO_SINGLE_CLICK = 0x04, IPO_REPEAT = 0x08 }
 Options for placing items interactively. More...
 

Protected Member Functions

void doInteractiveItemPlacement (const std::string &aTool, INTERACTIVE_PLACER_BASE *aPlacer, const wxString &aCommitMessage, int aOptions=IPO_ROTATE|IPO_FLIP|IPO_REPEAT)
 Helper function for performing a common interactive idiom: wait for a left click, place an item there (perhaps with a dialog or other user interaction), then have it move with the mouse and respond to rotate/flip, etc. More...
 
KIGFX::PCB_VIEWview () const
 
KIGFX::VIEW_CONTROLScontrols () const
 
PCB_BASE_EDIT_FRAMEframe () const
 
BOARDboard () const
 
FOOTPRINTfootprint () const
 
const PCB_DISPLAY_OPTIONSdisplayOptions () const
 
PCB_DRAW_PANEL_GALcanvas () const
 
const PCBNEW_SELECTIONselection () const
 
PCBNEW_SELECTIONselection ()
 
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

bool m_isFootprintEditor
 
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
 

Private Member Functions

void ratsnestTimer (wxTimerEvent &aEvent)
 

Event handler to recalculate dynamic ratsnest

More...
 
void calculateSelectionRatsnest (const VECTOR2I &aDelta)
 

Recalculates dynamic ratsnest for the current selection

More...
 
bool highlightNet (const VECTOR2D &aPosition, bool aUseSelection)
 Look for a BOARD_CONNECTED_ITEM in a given spot and if one is found - it enables highlight for its net. More...
 
void doHideNet (int aNetCode, bool aHide)
 
void setTransitions () override
 

Bind handlers to corresponding TOOL_ACTIONs

More...
 
void onListNetsDialogClosed (wxCommandEvent &aEvent)
 
void onInspectClearanceDialogClosed (wxCommandEvent &aEvent)
 
void onInspectConstraintsDialogClosed (wxCommandEvent &aEvent)
 
void reportZoneConnection (ZONE *aZone, PAD *aPad, REPORTER *r)
 
void reportClearance (DRC_CONSTRAINT_TYPE_T aClearanceType, PCB_LAYER_ID aLayer, BOARD_ITEM *aA, BOARD_ITEM *aB, REPORTER *r)
 

Private Attributes

PCB_EDIT_FRAMEm_frame
 
bool m_probingSchToPcb
 
int m_lastNetcode
 
CONNECTIVITY_DATAm_dynamicData
 
std::unique_ptr< DIALOG_NET_INSPECTORm_listNetsDialog
 
DIALOG_NET_INSPECTOR::SETTINGS m_listNetsDialogSettings
 
std::unique_ptr< DIALOG_INSPECTION_REPORTERm_inspectClearanceDialog
 
std::unique_ptr< DIALOG_CONSTRAINTS_REPORTERm_inspectConstraintsDialog
 

Detailed Description

PCB_INSPECTION_TOOL.

Tool for pcb inspection.

Definition at line 58 of file pcb_inspection_tool.h.

Member Enumeration Documentation

◆ INTERACTIVE_PLACEMENT_OPTIONS

Options for placing items interactively.

Enumerator
IPO_ROTATE 

Handle the rotate action in the loop by calling the item's rotate method.

IPO_FLIP 

Handle flip action in the loop by calling the item's flip method.

IPO_SINGLE_CLICK 

Create an item immediately on placement starting, otherwise show the pencil cursor until the item is created.

IPO_REPEAT 

Allow repeat placement of the item.

Definition at line 111 of file pcb_tool_base.h.

111  {
113  IPO_ROTATE = 0x01,
114 
116  IPO_FLIP = 0x02,
117 
120  IPO_SINGLE_CLICK = 0x04,
121 
123  IPO_REPEAT = 0x08
124  };
Handle flip action in the loop by calling the item's flip method.
Allow repeat placement of the item.
Create an item immediately on placement starting, otherwise show the pencil cursor until the item is ...
Handle the rotate action in the loop by calling the item's rotate method.

◆ 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

◆ PCB_INSPECTION_TOOL()

PCB_INSPECTION_TOOL::PCB_INSPECTION_TOOL ( )

Definition at line 49 of file pcb_inspection_tool.cpp.

49  :
50  PCB_TOOL_BASE( "pcbnew.InspectionTool" ),
51  m_frame( nullptr )
52 {
53  m_probingSchToPcb = false;
54  m_lastNetcode = -1;
55  m_dynamicData = nullptr;
56 }
PCB_EDIT_FRAME * m_frame
CONNECTIVITY_DATA * m_dynamicData
PCB_TOOL_BASE(TOOL_ID aId, const std::string &aName)
Constructor.
Definition: pcb_tool_base.h:78

References m_dynamicData, m_lastNetcode, and m_probingSchToPcb.

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(), EDIT_TOOL::doMoveSelection(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::DrawRectangle(), 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(), HighlightNetTool(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), LocalRatsnestTool(), PL_EDIT_TOOL::Main(), EE_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), PL_POINT_EDITOR::Main(), SCH_MOVE_TOOL::Main(), PCBNEW_PICKER_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), LIB_TREE::onContextMenu(), POINT_EDITOR::OnSelectionChange(), GROUP_TOOL::PickNewMember(), 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_TOOL::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 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219

References TOOL_BASE::m_toolMgr.

Referenced by TOOL_MANAGER::RegisterTool().

◆ board()

BOARD* PCB_TOOL_BASE::board ( ) const
inlineprotectedinherited

Definition at line 160 of file pcb_tool_base.h.

160 { return getModel<BOARD>(); }

Referenced by PCBNEW_CONTROL::AppendBoard(), AUTOPLACE_TOOL::autoplace(), calculateSelectionRatsnest(), EDIT_TOOL::ChangeTrackWidth(), ZONE_FILLER_TOOL::CheckAllZones(), ClearHighlight(), EDIT_TOOL::copyToClipboard(), FOOTPRINT_EDITOR_TOOLS::CreateFootprint(), MICROWAVE_TOOL::createInductorBetween(), ROUTER_TOOL::CustomTrackWidthDialog(), PCBNEW_CONTROL::DeleteItemCursor(), PCB_TOOL_BASE::doInteractiveItemPlacement(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawSegment(), PAD_TOOL::EnumeratePads(), PAD_TOOL::explodePad(), ZONE_FILLER_TOOL::FillAllZones(), EDIT_TOOL::FilletTracks(), SELECTION_TOOL::filterSelection(), PCB_TOOL_BASE::footprint(), SELECTION_TOOL::GetBoard(), SELECTION_TOOL::getCollectorsGuide(), GROUP_TOOL::Group(), highlightNet(), PCBNEW_CONTROL::LayerNext(), PCBNEW_CONTROL::LayerPrev(), LocalRatsnestTool(), EDIT_TOOL::MoveExact(), FOOTPRINT_EDITOR_TOOLS::NewFootprint(), ROUTER_TOOL::onViaCommand(), PCBNEW_CONTROL::Paste(), PCBNEW_CONTROL::placeBoardItems(), PCB_EDITOR_CONTROL::PlaceModule(), PAD_TOOL::PlacePad(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), SELECTION_TOOL::RebuildSelection(), PAD_TOOL::recombinePad(), EDIT_TOOL::Remove(), PCB_EDITOR_CONTROL::RepairBoard(), PNS::TOOL_BASE::Reset(), PCBNEW_CONTROL::Reset(), SELECTION_TOOL::Selectable(), SELECTION_TOOL::selectAllItemsOnNet(), SELECTION_TOOL::selectAllItemsOnSheet(), SELECTION_TOOL::selectConnectedTracks(), SELECTION_TOOL::selectPoint(), PCBNEW_CONTROL::TrackDisplayMode(), GROUP_TOOL::Ungroup(), PCBNEW_CONTROL::ViaDisplayMode(), PCBNEW_CONTROL::ZoneDisplayMode(), ZONE_FILLER_TOOL::ZoneFill(), PCB_EDITOR_CONTROL::ZoneMerge(), and ZONE_FILLER_TOOL::ZoneUnfillAll().

◆ calculateSelectionRatsnest()

void PCB_INSPECTION_TOOL::calculateSelectionRatsnest ( const VECTOR2I aDelta)
private

Recalculates dynamic ratsnest for the current selection

Definition at line 987 of file pcb_inspection_tool.cpp.

988 {
989  SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<SELECTION_TOOL>();
990  SELECTION& selection = selectionTool->GetSelection();
991  std::shared_ptr<CONNECTIVITY_DATA> connectivity = board()->GetConnectivity();
992  std::vector<BOARD_ITEM*> items;
993  std::deque<EDA_ITEM*> queued_items( selection.begin(), selection.end() );
994 
995  for( std::size_t i = 0; i < queued_items.size(); ++i )
996  {
997  BOARD_ITEM* item = static_cast<BOARD_ITEM*>( queued_items[i] );
998 
999  if( item->Type() == PCB_FOOTPRINT_T )
1000  {
1001  for( PAD* pad : static_cast<FOOTPRINT*>( item )->Pads() )
1002  {
1003  if( pad->GetLocalRatsnestVisible() || displayOptions().m_ShowModuleRatsnest )
1004  items.push_back( pad );
1005  }
1006  }
1007  else if( item->Type() == PCB_GROUP_T )
1008  {
1009  PCB_GROUP *group = static_cast<PCB_GROUP*>( item );
1010  group->RunOnDescendants( [ &queued_items ]( BOARD_ITEM *aItem )
1011  {
1012  queued_items.push_back( aItem );
1013  } );
1014  }
1015  else if( BOARD_CONNECTED_ITEM* boardItem = dyn_cast<BOARD_CONNECTED_ITEM*>( item ) )
1016  {
1017  if( boardItem->GetLocalRatsnestVisible() || displayOptions().m_ShowModuleRatsnest )
1018  items.push_back( boardItem );
1019  }
1020  }
1021 
1022  if( items.empty() || std::none_of( items.begin(), items.end(),
1023  []( const BOARD_ITEM* aItem )
1024  {
1025  return( aItem->Type() == PCB_TRACE_T
1026  || aItem->Type() == PCB_PAD_T
1027  || aItem->Type() == PCB_ARC_T
1028  || aItem->Type() == PCB_ZONE_T
1029  || aItem->Type() == PCB_FOOTPRINT_T
1030  || aItem->Type() == PCB_VIA_T );
1031  } ) )
1032  {
1033  return;
1034  }
1035 
1036  if( !m_dynamicData )
1037  {
1038  m_dynamicData = new CONNECTIVITY_DATA( items, true );
1039  connectivity->BlockRatsnestItems( items );
1040  }
1041  else
1042  {
1043  m_dynamicData->Move( aDelta );
1044  }
1045 
1046  connectivity->ComputeDynamicRatsnest( items, m_dynamicData );
1047 }
BOARD * board() const
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
Definition: board_item.h:86
class PCB_GROUP, a set of BOARD_ITEMs
Definition: typeinfo.h:109
PCB_GROUP is a set of BOARD_ITEMs (i.e., without duplicates)
Definition: pcb_group.h:50
SELECTION_TOOL.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
ITER end()
Definition: selection.h:61
class ARC, an arc track segment on a copper layer
Definition: typeinfo.h:98
class PAD, a pad in a footprint
Definition: typeinfo.h:90
BOARD_CONNECTED_ITEM is a base class derived from BOARD_ITEM for items that can be connected and have...
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:96
PCBNEW_SELECTION & GetSelection()
Function GetSelection()
ITER begin()
Definition: selection.h:60
const PCBNEW_SELECTION & selection() const
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: board.h:382
CONNECTIVITY_DATA * m_dynamicData
class ZONE, a copper pour area
Definition: typeinfo.h:106
void RunOnDescendants(const std::function< void(BOARD_ITEM *)> &aFunction) const
Invokes a function on all descendents of the group.
Definition: pcb_group.cpp:327
const PCB_DISPLAY_OPTIONS & displayOptions() const
class FOOTPRINT, a footprint
Definition: typeinfo.h:89
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
Definition: pad.h:59
void Move(const VECTOR2I &aDelta)
Moves the connectivity list anchors.
KICAD_T Type() const
Function Type()
Definition: eda_item.h:181

References SELECTION::begin(), PCB_TOOL_BASE::board(), PCB_TOOL_BASE::displayOptions(), SELECTION::end(), BOARD::GetConnectivity(), SELECTION_TOOL::GetSelection(), TOOL_MANAGER::GetTool(), m_dynamicData, PCB_DISPLAY_OPTIONS::m_ShowModuleRatsnest, TOOL_BASE::m_toolMgr, CONNECTIVITY_DATA::Move(), PCB_ARC_T, PCB_FOOTPRINT_T, PCB_GROUP_T, PCB_PAD_T, PCB_TRACE_T, PCB_VIA_T, PCB_ZONE_T, PCB_GROUP::RunOnDescendants(), PCB_TOOL_BASE::selection(), and EDA_ITEM::Type().

Referenced by UpdateSelectionRatsnest().

◆ canvas()

◆ ClearHighlight()

int PCB_INSPECTION_TOOL::ClearHighlight ( const TOOL_EVENT aEvent)

Clears all board highlights

Definition at line 815 of file pcb_inspection_tool.cpp.

816 {
817  BOARD* board = static_cast<BOARD*>( m_toolMgr->GetModel() );
819 
821  settings->SetHighlight( false );
825  return 0;
826 }
KIGFX::VIEW * GetView() const
Definition: tool_manager.h:290
void SendCrossProbeNetName(const wxString &aNetName)
Sends a net name to eeschema for highlighting.
BOARD * board() const
RENDER_SETTINGS Contains all the knowledge about how graphical objects are drawn on any output surfac...
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
EDA_ITEM * GetModel() const
Definition: tool_manager.h:297
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:201
PCB_EDIT_FRAME * m_frame
void ResetNetHighLight()
Reset all high light data to the init state.
Definition: board.cpp:1959
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
virtual RENDER_SETTINGS * GetSettings()=0
Function GetAdapter Returns pointer to current settings that are going to be used when drawing items.
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:186
void UpdateAllLayersColor()
Function UpdateAllLayersColor() Applies the new coloring scheme to all layers.
Definition: view.cpp:776

References PCB_TOOL_BASE::board(), TOOL_MANAGER::GetModel(), KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), TOOL_MANAGER::GetView(), m_frame, TOOL_BASE::m_toolMgr, BOARD::ResetNetHighLight(), PCB_EDIT_FRAME::SendCrossProbeNetName(), EDA_DRAW_FRAME::SetMsgPanel(), and KIGFX::VIEW::UpdateAllLayersColor().

Referenced by setTransitions().

◆ controls()

◆ CrossProbePcbToSch()

int PCB_INSPECTION_TOOL::CrossProbePcbToSch ( const TOOL_EVENT aEvent)

Notifies eeschema about the selected item.

Definition at line 613 of file pcb_inspection_tool.cpp.

614 {
615  // Don't get in an infinite loop PCB -> SCH -> PCB -> SCH -> ...
616  if( m_probingSchToPcb )
617  return 0;
618 
620  const PCBNEW_SELECTION& selection = selTool->GetSelection();
621 
622  if( selection.Size() == 1 )
623  m_frame->SendMessageToEESCHEMA( static_cast<BOARD_ITEM*>( selection.Front() ) );
624  else
625  m_frame->SendMessageToEESCHEMA( nullptr );
626 
628 
629  return 0;
630 }
void Redraw3Dview()
Request a redraw of 3D-Viewer canvas.
SELECTION_TOOL.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
PCBNEW_SELECTION & GetSelection()
Function GetSelection()
PCB_EDIT_FRAME * m_frame
const PCBNEW_SELECTION & selection() const
void SendMessageToEESCHEMA(BOARD_ITEM *objectToSync)
Function SendMessageToEESCHEMA sends a message to the schematic editor so that it may move its cursor...
int Size() const
Returns the number of selected parts.
Definition: selection.h:126
EDA_ITEM * Front() const
Definition: selection.h:201

References SELECTION::Front(), SELECTION_TOOL::GetSelection(), TOOL_MANAGER::GetTool(), m_frame, m_probingSchToPcb, TOOL_BASE::m_toolMgr, PCB_BASE_FRAME::Redraw3Dview(), PCB_TOOL_BASE::selection(), PCB_EDIT_FRAME::SendMessageToEESCHEMA(), and SELECTION::Size().

Referenced by setTransitions().

◆ displayOptions()

const PCB_DISPLAY_OPTIONS & PCB_TOOL_BASE::displayOptions ( ) const
protectedinherited

Definition at line 280 of file pcb_tool_base.cpp.

281 {
282  return frame()->GetDisplayOptions();
283 }
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Function GetDisplayOptions Display options control the way tracks, vias, outlines and other things ar...
PCB_BASE_EDIT_FRAME * frame() const

References PCB_TOOL_BASE::frame(), and PCB_BASE_FRAME::GetDisplayOptions().

Referenced by calculateSelectionRatsnest(), PCBNEW_CONTROL::HighContrastMode(), PCBNEW_CONTROL::HighContrastModeCycle(), LocalRatsnestTool(), PNS::TOOL_BASE::pickSingleItem(), PCBNEW_CONTROL::ToggleRatsnest(), PCBNEW_CONTROL::TrackDisplayMode(), PCBNEW_CONTROL::ViaDisplayMode(), and PCBNEW_CONTROL::ZoneDisplayMode().

◆ doHideNet()

void PCB_INSPECTION_TOOL::doHideNet ( int  aNetCode,
bool  aHide 
)
private

Definition at line 1121 of file pcb_inspection_tool.cpp.

1122 {
1123  KIGFX::PCB_RENDER_SETTINGS* rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>(
1125 
1126  SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<SELECTION_TOOL>();
1127  SELECTION& selection = selectionTool->GetSelection();
1128 
1129  if( aNetCode <= 0 && !selection.Empty() )
1130  {
1131  for( EDA_ITEM* item : selection )
1132  {
1133  if( BOARD_CONNECTED_ITEM* bci = dynamic_cast<BOARD_CONNECTED_ITEM*>( item ) )
1134  {
1135  if( bci->GetNetCode() > 0 )
1136  doHideNet( bci->GetNetCode(), aHide );
1137  }
1138  }
1139 
1140  return;
1141  }
1142 
1143  if( aHide )
1144  rs->GetHiddenNets().insert( aNetCode );
1145  else
1146  rs->GetHiddenNets().erase( aNetCode );
1147 
1149  m_frame->GetCanvas()->Refresh();
1150 }
std::set< int > & GetHiddenNets()
Definition: pcb_painter.h:184
KIGFX::VIEW * GetView() const
Definition: tool_manager.h:290
SELECTION_TOOL.
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
BOARD_CONNECTED_ITEM is a base class derived from BOARD_ITEM for items that can be connected and have...
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:201
void RedrawRatsnest()
Forces refresh of the ratsnest visual representation
void doHideNet(int aNetCode, bool aHide)
PCB_RENDER_SETTINGS Stores PCB specific render settings.
Definition: pcb_painter.h:64
PCB_EDIT_FRAME * m_frame
const PCBNEW_SELECTION & selection() const
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...
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:120
virtual RENDER_SETTINGS * GetSettings()=0
Function GetAdapter Returns pointer to current settings that are going to be used when drawing items.
EDA_ITEM is a base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:148

References SELECTION::Empty(), PCB_BASE_FRAME::GetCanvas(), KIGFX::PCB_RENDER_SETTINGS::GetHiddenNets(), KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), TOOL_MANAGER::GetTool(), TOOL_MANAGER::GetView(), m_frame, TOOL_BASE::m_toolMgr, PCB_DRAW_PANEL_GAL::RedrawRatsnest(), EDA_DRAW_PANEL_GAL::Refresh(), and PCB_TOOL_BASE::selection().

Referenced by HideNet(), and ShowNet().

◆ doInteractiveItemPlacement()

void PCB_TOOL_BASE::doInteractiveItemPlacement ( const std::string &  aTool,
INTERACTIVE_PLACER_BASE aPlacer,
const wxString &  aCommitMessage,
int  aOptions = IPO_ROTATE | IPO_FLIP | IPO_REPEAT 
)
protectedinherited

Helper function for performing a common interactive idiom: wait for a left click, place an item there (perhaps with a dialog or other user interaction), then have it move with the mouse and respond to rotate/flip, etc.

More complex interactive processes are not supported here, you should implement a customised event loop for those.

Parameters
aItemCreatorthe callable that will attempt to create the item
aCommitMessagethe message used on a successful commit

Definition at line 36 of file pcb_tool_base.cpp.

39 {
40  using namespace std::placeholders;
41  std::unique_ptr<BOARD_ITEM> newItem;
42 
43  frame()->PushTool( aTool );
44  Activate();
45 
46  BOARD_COMMIT commit( frame() );
47 
49 
50  // do not capture or auto-pan until we start placing an item
51  controls()->ShowCursor( true );
52 
53  // Add a VIEW_GROUP that serves as a preview for the new item
54  PCBNEW_SELECTION preview;
55  view()->Add( &preview );
56 
57  aPlacer->m_board = board();
58  aPlacer->m_frame = frame();
59  aPlacer->m_modifiers = 0;
60 
61  auto makeNewItem =
62  [&]( VECTOR2I aPosition )
63  {
64  if( frame()->GetModel() )
65  newItem = aPlacer->CreateItem();
66 
67  if( newItem )
68  {
69  newItem->SetPosition( (wxPoint) aPosition );
70  preview.Add( newItem.get() );
71 
72  if( newItem->Type() == PCB_FOOTPRINT_T )
73  {
74  FOOTPRINT* fp = dyn_cast<FOOTPRINT*>( newItem.get() );
75 
76  // footprints have more drawable parts
77  fp->RunOnChildren( std::bind( &KIGFX::VIEW_GROUP::Add, &preview, _1 ) );
78  }
79  }
80  };
81 
82  if( aOptions & IPO_SINGLE_CLICK )
83  makeNewItem( controls()->GetCursorPosition() );
84 
85  auto setCursor =
86  [&]()
87  {
88  if( !newItem )
90  else
92  };
93 
94  // Set initial cursor
95  setCursor();
96 
97  // Main loop: keep receiving events
98  while( TOOL_EVENT* evt = Wait() )
99  {
100  setCursor();
101 
102  VECTOR2I cursorPos = controls()->GetCursorPosition();
103  aPlacer->m_modifiers = evt->Modifier();
104 
105  auto cleanup =
106  [&] ()
107  {
108  newItem = nullptr;
109  preview.Clear();
110  view()->Update( &preview );
111  controls()->SetAutoPan( false );
112  controls()->CaptureCursor( false );
113  controls()->ShowCursor( true );
114  };
115 
116  if( evt->IsCancelInteractive() )
117  {
118  if( aOptions & IPO_SINGLE_CLICK )
119  {
120  cleanup();
121  frame()->PopTool( aTool );
122  break;
123  }
124  else if( newItem )
125  cleanup();
126  else
127  {
128  frame()->PopTool( aTool );
129  break;
130  }
131  }
132  else if( evt->IsActivate() )
133  {
134  if( newItem )
135  cleanup();
136 
137  if( evt->IsPointEditor() )
138  {
139  // don't exit (the point editor runs in the background)
140  }
141  else if( evt->IsMoveTool() )
142  {
143  // leave ourselves on the stack so we come back after the move
144  break;
145  }
146  else
147  {
148  frame()->PopTool( aTool );
149  break;
150  }
151  }
152  else if( evt->IsClick( BUT_LEFT ) )
153  {
154  if( !newItem )
155  {
156  // create the item if possible
157  makeNewItem( cursorPos );
158 
159  // no item created, so wait for another click
160  if( !newItem )
161  continue;
162 
163  controls()->CaptureCursor( true );
164  controls()->SetAutoPan( true );
165  }
166  else
167  {
168  auto oldFlags = newItem->GetFlags();
169  newItem->ClearFlags();
170 
171  if( !aPlacer->PlaceItem( newItem.get(), commit ) )
172  {
173  newItem->SetFlags( oldFlags );
174  continue;
175  }
176 
177  preview.Clear();
178  newItem.release();
179  commit.Push( aCommitMessage );
180 
181  controls()->CaptureCursor( false );
182  controls()->SetAutoPan( false );
183  controls()->ShowCursor( true );
184 
185  if( !( aOptions & IPO_REPEAT ) )
186  break;
187 
188  if( aOptions & IPO_SINGLE_CLICK )
189  makeNewItem( controls()->GetCursorPosition() );
190 
191  setCursor();
192  }
193  }
194  else if( evt->IsClick( BUT_RIGHT ) )
195  {
197  }
198  else if( evt->IsAction( &PCB_ACTIONS::trackViaSizeChanged ) )
199  {
201  }
202  else if( newItem && evt->Category() == TC_COMMAND )
203  {
204  /*
205  * Handle any events that can affect the item as we move it around
206  */
207  if( TOOL_EVT_UTILS::IsRotateToolEvt( *evt ) && ( aOptions & IPO_ROTATE ) )
208  {
209  const int rotationAngle = TOOL_EVT_UTILS::GetEventRotationAngle( *frame(), *evt );
210  newItem->Rotate( newItem->GetPosition(), rotationAngle );
211  view()->Update( &preview );
212  }
213  else if( evt->IsAction( &PCB_ACTIONS::flip ) && ( aOptions & IPO_FLIP ) )
214  {
215  newItem->Flip( newItem->GetPosition(), frame()->Settings().m_FlipLeftRight );
216  view()->Update( &preview );
217  }
218  else if( evt->IsAction( &PCB_ACTIONS::viaSizeInc )
219  || evt->IsAction( &PCB_ACTIONS::viaSizeDec ) )
220  {
221  // Refresh preview after event runs
223  }
224  else if( evt->IsAction( &ACTIONS::refreshPreview ) )
225  {
226  preview.Clear();
227  newItem.release();
228 
229  makeNewItem( (wxPoint) cursorPos );
230  aPlacer->SnapItem( newItem.get() );
231  view()->Update( &preview );
232  }
233  }
234  else if( newItem && evt->IsMotion() )
235  {
236  // track the cursor
237  newItem->SetPosition( (wxPoint) cursorPos );
238  aPlacer->SnapItem( newItem.get() );
239 
240  // Show a preview of the item
241  view()->Update( &preview );
242  }
243  else
244  {
245  evt->SetPassEvent();
246  }
247  }
248 
249  view()->Remove( &preview );
251 }
static TOOL_ACTION selectionClear
Clears the current selection.
Definition: pcb_actions.h:62
virtual void ShowCursor(bool aEnabled)
Function ShowCursor() Enables or disables display of cursor.
TOOL_MENU m_menu
functions below are not yet implemented - their interface may change
virtual void Clear() override
Function Clear() Removes all the stored items from the group.
Definition: selection.h:94
TOOL_EVENT * Wait(const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
Function Wait()
virtual bool PlaceItem(BOARD_ITEM *aItem, BOARD_COMMIT &aCommit)
Handle flip action in the loop by calling the item's flip method.
BOARD * board() const
static TOOL_ACTION viaSizeInc
Definition: pcb_actions.h:296
virtual std::unique_ptr< BOARD_ITEM > CreateItem()=0
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
virtual void PushTool(const std::string &actionName)
NB: the definition of "tool" is different at the user level.
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:141
static TOOL_ACTION trackViaSizeChanged
Definition: pcb_actions.h:299
bool IsRotateToolEvt(const TOOL_EVENT &aEvt)
Function isRotateToolEvt()
void SetCurrentCursor(KICURSOR cursor)
Function SetCurrentCursor Set the current cursor shape for this panel.
virtual void Remove(VIEW_ITEM *aItem) override
Function Remove() Removes a VIEW_ITEM from the view.
Definition: pcb_view.cpp:76
virtual void Add(EDA_ITEM *aItem)
Definition: selection.h:75
TOOL_MANAGER * GetManager() const
Function GetManager() Returns the instance of TOOL_MANAGER that takes care of the tool.
Definition: tool_base.h:143
PCB_BASE_EDIT_FRAME * frame() const
virtual void SnapItem(BOARD_ITEM *aItem)
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const override
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: pcb_view.cpp:94
const PCBNEW_SELECTION & selection() const
Allow repeat placement of the item.
virtual void PopTool(const std::string &actionName)
virtual void CaptureCursor(bool aEnabled)
Function CaptureCursor() Forces the cursor to stay within the drawing panel area.
TOOL_EVENT.
Definition: tool_event.h:171
KIGFX::PCB_VIEW * view() const
Create an item immediately on placement starting, otherwise show the pencil cursor until the item is ...
virtual void Add(VIEW_ITEM *aItem)
Function Add() Adds an item to the group.
Definition: view_group.cpp:55
virtual void SetAutoPan(bool aEnabled)
Function SetAutoPan Turns on/off auto panning (this feature is used when there is a tool active (eg.
class FOOTPRINT, a footprint
Definition: typeinfo.h:89
virtual BOARD_ITEM_CONTAINER * GetModel() const =0
Function GetModel()
static TOOL_ACTION flip
Flipping of selected objects.
Definition: pcb_actions.h:108
Handle the rotate action in the loop by calling the item's rotate method.
KIGFX::VIEW_CONTROLS * controls() const
PCBNEW_SETTINGS & Settings()
void Activate()
Function Activate() Runs the tool.
void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction) const
Function RunOnChildren.
Definition: footprint.cpp:1066
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1) override
Function Add() Adds a VIEW_ITEM to the view.
Definition: pcb_view.cpp:59
PCB_BASE_EDIT_FRAME * m_frame
Definition: pcb_tool_base.h:65
int GetEventRotationAngle(const PCB_BASE_EDIT_FRAME &aFrame, const TOOL_EVENT &aEvt)
Function getEventRotationAngle()
void ShowContextMenu(SELECTION &aSelection)
Function ShowContextMenu.
Definition: tool_menu.cpp:59
static TOOL_ACTION viaSizeDec
Definition: pcb_actions.h:297
static TOOL_ACTION refreshPreview
Definition: actions.h:104
VECTOR2D GetCursorPosition() const
Returns the current cursor position in world coordinates.

References TOOL_INTERACTIVE::Activate(), KIGFX::PCB_VIEW::Add(), KIGFX::VIEW_GROUP::Add(), SELECTION::Add(), ARROW, PCB_TOOL_BASE::board(), BUT_LEFT, BUT_RIGHT, KIGFX::VIEW_CONTROLS::CaptureCursor(), SELECTION::Clear(), PCB_TOOL_BASE::controls(), INTERACTIVE_PLACER_BASE::CreateItem(), PCB_ACTIONS::flip, PCB_TOOL_BASE::frame(), PCB_BASE_FRAME::GetCanvas(), KIGFX::VIEW_CONTROLS::GetCursorPosition(), TOOL_EVT_UTILS::GetEventRotationAngle(), TOOL_BASE::GetManager(), PCB_BASE_FRAME::GetModel(), PCB_TOOL_BASE::IPO_FLIP, PCB_TOOL_BASE::IPO_REPEAT, PCB_TOOL_BASE::IPO_ROTATE, PCB_TOOL_BASE::IPO_SINGLE_CLICK, TOOL_EVT_UTILS::IsRotateToolEvt(), INTERACTIVE_PLACER_BASE::m_board, PCBNEW_SETTINGS::m_FlipLeftRight, INTERACTIVE_PLACER_BASE::m_frame, TOOL_INTERACTIVE::m_menu, INTERACTIVE_PLACER_BASE::m_modifiers, TOOL_BASE::m_toolMgr, PCB_FOOTPRINT_T, PENCIL, PLACE, INTERACTIVE_PLACER_BASE::PlaceItem(), TOOLS_HOLDER::PopTool(), BOARD_COMMIT::Push(), TOOLS_HOLDER::PushTool(), ACTIONS::refreshPreview, KIGFX::PCB_VIEW::Remove(), TOOL_MANAGER::RunAction(), FOOTPRINT::RunOnChildren(), PCB_TOOL_BASE::selection(), PCB_ACTIONS::selectionClear, KIGFX::VIEW_CONTROLS::SetAutoPan(), EDA_DRAW_PANEL_GAL::SetCurrentCursor(), PCB_BASE_FRAME::Settings(), TOOL_MENU::ShowContextMenu(), KIGFX::VIEW_CONTROLS::ShowCursor(), INTERACTIVE_PLACER_BASE::SnapItem(), TC_COMMAND, PCB_ACTIONS::trackViaSizeChanged, KIGFX::PCB_VIEW::Update(), PCB_ACTIONS::viaSizeDec, PCB_ACTIONS::viaSizeInc, PCB_TOOL_BASE::view(), and TOOL_INTERACTIVE::Wait().

Referenced by MICROWAVE_TOOL::addMicrowaveFootprint(), DRAWING_TOOL::DrawVia(), and PAD_TOOL::PlacePad().

◆ FlipPcbView()

int PCB_INSPECTION_TOOL::FlipPcbView ( const TOOL_EVENT aEvent)

◆ footprint()

◆ frame()

PCB_BASE_EDIT_FRAME* PCB_TOOL_BASE::frame ( ) const
inlineprotectedinherited

Definition at line 155 of file pcb_tool_base.h.

156  {
157  return getEditFrame<PCB_BASE_EDIT_FRAME>();
158  }

Referenced by POINT_EDITOR::addCorner(), AUTOPLACE_TOOL::autoplace(), PCB_TOOL_BASE::canvas(), ZONE_FILLER_TOOL::CheckAllZones(), PNS::TOOL_BASE::checkSnap(), PAD_TOOL::copyPadSettings(), EDIT_TOOL::copyToClipboard(), ROUTER_TOOL::CustomTrackWidthDialog(), FOOTPRINT_EDITOR_TOOLS::DeleteFootprint(), PCB_TOOL_BASE::displayOptions(), PCB_TOOL_BASE::doInteractiveItemPlacement(), ROUTER_TOOL::DpDimensionsDialog(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), DRAWING_TOOL::DrawVia(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EditPad(), PAD_TOOL::EnumeratePads(), PAD_TOOL::explodePad(), PCB_EDITOR_CONTROL::ExportSpecctraDSN(), ZONE_FILLER_TOOL::FillAllZones(), EDIT_TOOL::FilletTracks(), ROUTER_TOOL::finishInteractive(), EDIT_TOOL::Flip(), PCB_EDITOR_CONTROL::FlipPcbView(), GLOBAL_EDIT_TOOL::GlobalDeletions(), FOOTPRINT_EDITOR_TOOLS::ImportFootprint(), PCB_EDITOR_CONTROL::ImportSpecctraSession(), ROUTER_TOOL::Init(), SELECTION_TOOL::Init(), EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), PCBNEW_PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::meanderSettingsDialog(), EDIT_TOOL::MoveExact(), POINT_EDITOR::OnSelectionChange(), ROUTER_TOOL::onViaCommand(), PCBNEW_CONTROL::Paste(), PAD_TOOL::pastePadProperties(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), GROUP_TOOL::PickNewMember(), PCBNEW_CONTROL::placeBoardItems(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), ROUTER_TOOL::prepareInteractive(), PAD_TOOL::pushPadSettings(), PAD_TOOL::recombinePad(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), EDIT_TOOL::Remove(), POINT_EDITOR::removeCorner(), PNS::TOOL_BASE::Reset(), ROUTER_TOOL::SelectCopperLayerPair(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), POINT_EDITOR::setEditedPoint(), ROUTER_TOOL::SettingsDialog(), GLOBAL_EDIT_TOOL::swapBoardItem(), GLOBAL_EDIT_TOOL::SwapLayers(), ROUTER_TOOL::switchLayerOnViaPlacement(), PCB_EDITOR_CONTROL::UpdateSchematicFromPCB(), ZONE_FILLER_TOOL::ZoneFill(), and ZONE_FILLER_TOOL::ZoneFillAll().

◆ 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*>( getToolHolderInt() ) );
191 #endif
192  return static_cast<T*>( getToolHolderInt() );
193  }
TOOLS_HOLDER * getToolHolderInt() const
Definition: tool_base.cpp:48

References TOOL_BASE::getToolHolderInt().

Referenced by ZONE_CREATE_HELPER::createNewZone().

◆ GetId()

TOOL_ID TOOL_BASE::GetId ( ) const
inlineinherited

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

◆ 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
EDA_ITEM is a base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:148

References TOOL_BASE::getModelInt().

Referenced by ZONE_CREATE_HELPER::commitZone(), 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_MANAGER::InitTools(), TOOL_MANAGER::invokeTool(), and TOOL_MANAGER::RegisterTool().

◆ 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(), TOOL_MANAGER::runTool(), and TOOL_MANAGER::ShutdownTool().

◆ 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:290
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(), COMMON_TOOLS::CenterContents(), SCH_EDIT_TOOL::ChangeTextType(), EE_INSPECTION_TOOL::CheckSymbol(), PL_SELECTION_TOOL::ClearSelection(), EE_SELECTION_TOOL::ClearSelection(), EE_SELECTION_TOOL::collectHits(), SCH_LINE_WIRE_BUS_TOOL::computeBreakPoint(), COMMON_TOOLS::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(), COMMON_TOOLS::doZoomFit(), COMMON_TOOLS::doZoomInOut(), COMMON_TOOLS::doZoomToPreset(), MICROWAVE_TOOL::drawMicrowaveInductor(), PL_DRAWING_TOOLS::DrawShape(), PCB_EDITOR_CONTROL::DrillOrigin(), LIB_EDIT_TOOL::Duplicate(), PAD_TOOL::EnumeratePads(), SCH_EDITOR_CONTROL::FindComponentAndItem(), EE_SELECTION_TOOL::GetNode(), ROUTER_TOOL::getStartLayer(), 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(), highlightNet(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_MOVE_TOOL::moveItem(), PL_EDIT_TOOL::moveItem(), COMMON_TOOLS::OnGridChanged(), POINT_EDITOR::OnSelectionChange(), COMMON_TOOLS::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::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(), GERBVIEW_SELECTION_TOOL::selectable(), SELECTION_TOOL::Selectable(), SELECTION_TOOL::SelectAll(), EE_SELECTION_TOOL::SelectAll(), 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(), ZOOM_TOOL::selectRegion(), GERBVIEW_SELECTION_TOOL::selectVisually(), SCH_EDITOR_CONTROL::ToggleHiddenFields(), 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(), PL_POINT_EDITOR::updateItem(), POINT_EDITOR::updateItem(), EE_TOOL_BASE< SCH_BASE_FRAME >::updateItem(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), EE_POINT_EDITOR::updateParentItem(), EE_POINT_EDITOR::updatePoints(), PL_POINT_EDITOR::updatePoints(), POINT_EDITOR::updatePoints(), SELECTION_TOOL::updateSelection(), PNS::TOOL_BASE::updateStartItem(), PCB_VIEWER_TOOLS::view(), PCB_TOOL_BASE::view(), 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:292

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

Referenced by EE_POINT_EDITOR::addCorner(), POINT_EDITOR::addCorner(), EE_POINT_EDITOR::addCornerCondition(), SCH_EDITOR_CONTROL::AssignNetclass(), SCH_EDIT_TOOL::BreakWire(), PCB_TOOL_BASE::controls(), EDIT_TOOL::copyToClipboard(), SCH_DRAWING_TOOLS::createSheetPin(), COMMON_TOOLS::CursorControl(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), EDIT_TOOL::doMoveSelection(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), COMMON_TOOLS::doZoomToPreset(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::DrawRectangle(), 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(), HighlightNet(), SCH_EDITOR_CONTROL::HighlightNet(), HighlightNetTool(), FOOTPRINT_EDITOR_TOOLS::ImportFootprint(), PL_EDIT_TOOL::Main(), EE_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), PL_POINT_EDITOR::Main(), SCH_MOVE_TOOL::Main(), PCBNEW_PICKER_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), COMMON_TOOLS::OnGridChanged(), POINT_EDITOR::OnSelectionChange(), LIB_EDIT_TOOL::Paste(), ROUTER_TOOL::performDragging(), LENGTH_TUNER_TOOL::performTuning(), 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::Properties(), EDIT_TOOL::Properties(), EDIT_TOOL::Remove(), SCH_EDIT_TOOL::RepeatDrawItem(), PL_SELECTION_TOOL::RequestSelection(), EE_SELECTION_TOOL::RequestSelection(), POINT_EDITOR::Reset(), DRAWING_TOOL::Reset(), COMMON_TOOLS::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(), POINT_EDITOR::updateItem(), PL_EDIT_TOOL::updateModificationPoint(), EDIT_TOOL::updateModificationPoint(), and COMMON_TOOLS::ZoomCenter().

◆ Go()

template<class T >
void TOOL_INTERACTIVE::Go ( int(T::*)(const TOOL_EVENT &)  aStateFunc,
const TOOL_EVENT_LIST aConditions = TOOL_EVENTTC_ANYTA_ANY ) 
)
inherited

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 ZOOM_TOOL::setTransitions(), AUTOPLACE_TOOL::setTransitions(), LENGTH_TUNER_TOOL::setTransitions(), PCB_REANNOTATE_TOOL::setTransitions(), GERBVIEW_INSPECTION_TOOL::setTransitions(), ROUTER_TOOL::setTransitions(), LIB_PIN_TOOL::setTransitions(), SCH_NAVIGATE_TOOL::setTransitions(), LIB_MOVE_TOOL::setTransitions(), PL_DRAWING_TOOLS::setTransitions(), EE_POINT_EDITOR::setTransitions(), PL_POINT_EDITOR::setTransitions(), COMMON_CONTROL::setTransitions(), ZONE_FILLER_TOOL::setTransitions(), EE_INSPECTION_TOOL::setTransitions(), KICAD_MANAGER_CONTROL::setTransitions(), CONVERT_TOOL::setTransitions(), DRC_TOOL::setTransitions(), PCB_VIEWER_TOOLS::setTransitions(), POINT_EDITOR::setTransitions(), LIB_DRAWING_TOOLS::setTransitions(), MICROWAVE_TOOL::setTransitions(), GLOBAL_EDIT_TOOL::setTransitions(), GERBVIEW_CONTROL::setTransitions(), PAD_TOOL::setTransitions(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::setTransitions(), SCH_MOVE_TOOL::setTransitions(), GROUP_TOOL::setTransitions(), PL_EDITOR_CONTROL::setTransitions(), LIB_CONTROL::setTransitions(), LIB_EDIT_TOOL::setTransitions(), SCH_DRAWING_TOOLS::setTransitions(), PL_EDIT_TOOL::setTransitions(), FOOTPRINT_EDITOR_TOOLS::setTransitions(), GERBVIEW_SELECTION_TOOL::setTransitions(), SCH_EDIT_TOOL::setTransitions(), POSITION_RELATIVE_TOOL::setTransitions(), PCBNEW_CONTROL::setTransitions(), EDA_3D_CONTROLLER::setTransitions(), ALIGN_DISTRIBUTE_TOOL::setTransitions(), COMMON_TOOLS::setTransitions(), CVPCB_CONTROL::setTransitions(), CVPCB_ASSOCIATION_TOOL::setTransitions(), SCH_LINE_WIRE_BUS_TOOL::setTransitions(), PCBNEW_PICKER_TOOL::setTransitions(), PICKER_TOOL::setTransitions(), setTransitions(), PCB_EDITOR_CONTROL::setTransitions(), DRAWING_TOOL::setTransitions(), EDIT_TOOL::setTransitions(), SELECTION_TOOL::setTransitions(), PL_SELECTION_TOOL::setTransitions(), SCH_EDITOR_CONTROL::setTransitions(), and EE_SELECTION_TOOL::setTransitions().

◆ HideDynamicRatsnest()

int PCB_INSPECTION_TOOL::HideDynamicRatsnest ( const TOOL_EVENT aEvent)

Hides ratsnest for selected items. Called when there are no items selected.

Definition at line 977 of file pcb_inspection_tool.cpp.

978 {
979  getModel<BOARD>()->GetConnectivity()->ClearDynamicRatsnest();
980  delete m_dynamicData;
981  m_dynamicData = nullptr;
982 
983  return 0;
984 }
CONNECTIVITY_DATA * m_dynamicData

References m_dynamicData.

Referenced by setTransitions().

◆ HideNet()

int PCB_INSPECTION_TOOL::HideNet ( const TOOL_EVENT aEvent)

Hide the ratsnest for a given net

Definition at line 1107 of file pcb_inspection_tool.cpp.

1108 {
1109  doHideNet( aEvent.Parameter<intptr_t>(), true );
1110  return 0;
1111 }
void doHideNet(int aNetCode, bool aHide)
T Parameter() const
Function Parameter() Returns a non-standard parameter assigned to the event.
Definition: tool_event.h:435

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

Referenced by setTransitions().

◆ HighlightItem()

int PCB_INSPECTION_TOOL::HighlightItem ( const TOOL_EVENT aEvent)

Performs the appropriate action in response to an eeschema cross-probe.

Definition at line 633 of file pcb_inspection_tool.cpp.

634 {
635  BOARD_ITEM* item = aEvent.Parameter<BOARD_ITEM*>();
636 
637  m_probingSchToPcb = true; // recursion guard
638  {
640 
641  if( item )
642  m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, (void*) item );
643  }
644  m_probingSchToPcb = false;
645 
646  bool request3DviewRedraw = true;
647 
648  if( item && item->Type() != PCB_FOOTPRINT_T )
649  request3DviewRedraw = false;
650 
651  if( request3DviewRedraw )
653 
654  return 0;
655 }
static TOOL_ACTION selectionClear
Clears the current selection.
Definition: pcb_actions.h:62
void Redraw3Dview()
Request a redraw of 3D-Viewer canvas.
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
Definition: board_item.h:86
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:141
PCB_EDIT_FRAME * m_frame
T Parameter() const
Function Parameter() Returns a non-standard parameter assigned to the event.
Definition: tool_event.h:435
class FOOTPRINT, a footprint
Definition: typeinfo.h:89
static TOOL_ACTION selectItem
Selects an item (specified as the event parameter).
Definition: pcb_actions.h:65
KICAD_T Type() const
Function Type()
Definition: eda_item.h:181

References m_frame, m_probingSchToPcb, TOOL_BASE::m_toolMgr, TOOL_EVENT::Parameter(), PCB_FOOTPRINT_T, PCB_BASE_FRAME::Redraw3Dview(), TOOL_MANAGER::RunAction(), PCB_ACTIONS::selectionClear, PCB_ACTIONS::selectItem, and EDA_ITEM::Type().

Referenced by setTransitions().

◆ HighlightNet()

int PCB_INSPECTION_TOOL::HighlightNet ( const TOOL_EVENT aEvent)

Highlights net belonging to the item under the cursor.

Definition at line 787 of file pcb_inspection_tool.cpp.

788 {
789  int netcode = aEvent.Parameter<intptr_t>();
791  const std::set<int>& highlighted = settings->GetHighlightNetCodes();
792 
793  if( netcode > 0 )
794  {
795  m_lastNetcode = highlighted.empty() ? -1 : *highlighted.begin();
796  settings->SetHighlight( true, netcode );
798  }
799  else if( aEvent.IsAction( &PCB_ACTIONS::toggleLastNetHighlight ) )
800  {
801  int temp = highlighted.empty() ? -1 : *highlighted.begin();
802  settings->SetHighlight( true, m_lastNetcode );
804  m_lastNetcode = temp;
805  }
806  else // Highlight the net belonging to the item under the cursor
807  {
808  highlightNet( getViewControls()->GetMousePosition(), false );
809  }
810 
811  return 0;
812 }
KIGFX::VIEW * GetView() const
Definition: tool_manager.h:290
RENDER_SETTINGS Contains all the knowledge about how graphical objects are drawn on any output surfac...
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
bool highlightNet(const VECTOR2D &aPosition, bool aUseSelection)
Look for a BOARD_CONNECTED_ITEM in a given spot and if one is found - it enables highlight for its ne...
static TOOL_ACTION toggleLastNetHighlight
Definition: pcb_actions.h:443
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:201
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:67
T Parameter() const
Function Parameter() Returns a non-standard parameter assigned to the event.
Definition: tool_event.h:435
virtual RENDER_SETTINGS * GetSettings()=0
Function GetAdapter Returns pointer to current settings that are going to be used when drawing items.
const std::set< int > & GetHighlightNetCodes() const
Function GetHighlightNetCode Returns netcode of currently highlighted net.
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:42
void UpdateAllLayersColor()
Function UpdateAllLayersColor() Applies the new coloring scheme to all layers.
Definition: view.cpp:776

References KIGFX::RENDER_SETTINGS::GetHighlightNetCodes(), KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), TOOL_MANAGER::GetView(), TOOL_BASE::getViewControls(), highlightNet(), TOOL_EVENT::IsAction(), m_lastNetcode, TOOL_BASE::m_toolMgr, TOOL_EVENT::Parameter(), PCB_ACTIONS::toggleLastNetHighlight, and KIGFX::VIEW::UpdateAllLayersColor().

Referenced by setTransitions().

◆ highlightNet()

bool PCB_INSPECTION_TOOL::highlightNet ( const VECTOR2D aPosition,
bool  aUseSelection 
)
private

Look for a BOARD_CONNECTED_ITEM in a given spot and if one is found - it enables highlight for its net.

Parameters
aPositionis the point where an item is expected (world coordinates).
aUseSelectionis true if we should use the current selection to pick the netcode

Definition at line 665 of file pcb_inspection_tool.cpp.

666 {
667  BOARD* board = static_cast<BOARD*>( m_toolMgr->GetModel() );
669  SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<SELECTION_TOOL>();
670 
671  int net = -1;
672  bool enableHighlight = false;
673 
674  if( aUseSelection )
675  {
676  const PCBNEW_SELECTION& selection = selectionTool->GetSelection();
677 
678  for( auto item : selection )
679  {
680  if( auto ci = dyn_cast<BOARD_CONNECTED_ITEM*>( item ) )
681  {
682  int item_net = ci->GetNetCode();
683 
684  if( net < 0 )
685  net = item_net;
686  else if( net != item_net ) // more than one net selected: do nothing
687  return false;
688  }
689  }
690 
691  enableHighlight = ( net >= 0 && !settings->GetHighlightNetCodes().count( net ) );
692  }
693 
694  // If we didn't get a net to highlight from the selection, use the cursor
695  if( net < 0 )
696  {
698  GENERAL_COLLECTOR collector;
699 
700  PCB_LAYER_ID activeLayer = static_cast<PCB_LAYER_ID>( view()->GetTopLayer() );
701  guide.SetPreferredLayer( activeLayer );
702 
703  // Find a connected item for which we are going to highlight a net
704  collector.Collect( board, GENERAL_COLLECTOR::PadsOrTracks, (wxPoint) aPosition, guide );
705 
706  if( collector.GetCount() == 0 )
707  collector.Collect( board, GENERAL_COLLECTOR::Zones, (wxPoint) aPosition, guide );
708 
709  // Apply the active selection filter
710  selectionTool->FilterCollectedItems( collector );
711 
712  // Clear the previous highlight
713  m_frame->SendMessageToEESCHEMA( nullptr );
714 
715  bool highContrast = settings->GetHighContrast();
716  PCB_LAYER_ID contrastLayer = settings->GetPrimaryHighContrastLayer();
717 
718  for( int i = collector.GetCount() - 1; i >= 0; i-- )
719  {
720  LSET itemLayers = collector[i]->GetLayerSet();
721 
722  if( ( itemLayers & LSET::AllCuMask() ).none() ||
723  ( highContrast && !itemLayers.Contains( contrastLayer ) ) )
724  {
725  collector.Remove( i );
726  continue;
727  }
728  }
729 
730  enableHighlight = ( collector.GetCount() > 0 );
731 
732  // Obtain net code for the clicked item
733  if( enableHighlight )
734  {
735  BOARD_CONNECTED_ITEM* targetItem = static_cast<BOARD_CONNECTED_ITEM*>( collector[0] );
736 
737  if( targetItem->Type() == PCB_PAD_T )
738  m_frame->SendMessageToEESCHEMA( targetItem );
739 
740  net = targetItem->GetNetCode();
741  }
742  }
743 
744  auto& netcodes = settings->GetHighlightNetCodes();
745 
746  // Toggle highlight when the same net was picked
747  if( net > 0 && netcodes.count( net ) )
748  enableHighlight = !settings->IsHighlightEnabled();
749 
750  if( enableHighlight != settings->IsHighlightEnabled()
751  || !netcodes.count( net ) )
752  {
753  if( !netcodes.empty() )
754  m_lastNetcode = *netcodes.begin();
755 
756  settings->SetHighlight( enableHighlight, net );
758  }
759 
760  // Store the highlighted netcode in the current board (for dialogs for instance)
761  if( enableHighlight && net >= 0 )
762  {
763  board->SetHighLightNet( net );
764  board->HighLightON();
765 
766  NETINFO_ITEM* netinfo = board->FindNet( net );
767 
768  if( netinfo )
769  {
770  MSG_PANEL_ITEMS items;
771  netinfo->GetMsgPanelInfo( m_frame, items );
772  m_frame->SetMsgPanel( items );
774  }
775  }
776  else
777  {
781  }
782 
783  return true;
784 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:750
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
Definition: board.cpp:1234
KIGFX::VIEW * GetView() const
Definition: tool_manager.h:290
int GetNetCode() const
Function GetNetCode.
void FilterCollectedItems(GENERAL_COLLECTOR &aCollector)
Applies the SELECTION_FILTER_OPTIONS to a collection of items
void SendCrossProbeNetName(const wxString &aNetName)
Sends a net name to eeschema for highlighting.
BOARD * board() const
RENDER_SETTINGS Contains all the knowledge about how graphical objects are drawn on any output surfac...
void HighLightON(bool aValue=true)
Enable or disable net highlighting.
Definition: board.cpp:1981
void Collect(BOARD_ITEM *aItem, const KICAD_T aScanList[], const wxPoint &aRefPos, const COLLECTORS_GUIDE &aGuide)
Scan a BOARD_ITEM using this class's Inspector method, which does the collection.
Definition: collectors.cpp:560
SELECTION_TOOL.
bool Contains(PCB_LAYER_ID aLayer)
See if the layer set contains a PCB layer.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
class PAD, a pad in a footprint
Definition: typeinfo.h:90
static const KICAD_T PadsOrTracks[]
A scan list for PADs, TRACKs, or VIAs.
Definition: collectors.h:289
BOARD_CONNECTED_ITEM is a base class derived from BOARD_ITEM for items that can be connected and have...
EDA_ITEM * GetModel() const
Definition: tool_manager.h:297
void Remove(int aIndex)
Function Remove removes the item at aIndex (first position is 0);.
Definition: collector.h:133
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:201
PCBNEW_SELECTION & GetSelection()
Function GetSelection()
int GetCount() const
Function GetCount returns the number of objects in the list.
Definition: collector.h:104
PCB_EDIT_FRAME * m_frame
PCB_LAYER_ID
A quick note on layer IDs:
void SetPreferredLayer(PCB_LAYER_ID aLayer)
Definition: collectors.h:504
GENERAL_COLLECTORS_GUIDE GetCollectorsGuide()
Function GetCollectorsGuide.
LSET is a set of PCB_LAYER_IDs.
void ResetNetHighLight()
Reset all high light data to the init state.
Definition: board.cpp:1959
const PCBNEW_SELECTION & selection() const
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
KIGFX::PCB_VIEW * view() const
static const KICAD_T Zones[]
A scan list for zones outlines only.
Definition: collectors.h:273
const wxString & GetNetname() const
Function GetNetname.
Definition: netinfo.h:231
void SetHighLightNet(int aNetCode, bool aMulti=false)
Select the netcode to be highlighted.
Definition: board.cpp:1968
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
void SendMessageToEESCHEMA(BOARD_ITEM *objectToSync)
Function SendMessageToEESCHEMA sends a message to the schematic editor so that it may move its cursor...
virtual RENDER_SETTINGS * GetSettings()=0
Function GetAdapter Returns pointer to current settings that are going to be used when drawing items.
NETINFO_ITEM handles the data for a net.
Definition: netinfo.h:65
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:186
Used when the right click button is pressed, or when the select tool is in effect.
Definition: collectors.h:241
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
Definition: msgpanel.h:97
A general implementation of a COLLECTORS_GUIDE.
Definition: collectors.h:376
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Function GetMsgPanelInfo returns the information about the NETINFO_ITEM in aList to display in the me...
void UpdateAllLayersColor()
Function UpdateAllLayersColor() Applies the new coloring scheme to all layers.
Definition: view.cpp:776
KICAD_T Type() const
Function Type()
Definition: eda_item.h:181

References LSET::AllCuMask(), PCB_TOOL_BASE::board(), GENERAL_COLLECTOR::Collect(), LSET::Contains(), SELECTION_TOOL::FilterCollectedItems(), BOARD::FindNet(), PCB_BASE_FRAME::GetCollectorsGuide(), COLLECTOR::GetCount(), TOOL_MANAGER::GetModel(), NETINFO_ITEM::GetMsgPanelInfo(), BOARD_CONNECTED_ITEM::GetNetCode(), NETINFO_ITEM::GetNetname(), KIGFX::VIEW::GetPainter(), SELECTION_TOOL::GetSelection(), KIGFX::PAINTER::GetSettings(), TOOL_MANAGER::GetTool(), TOOL_BASE::getView(), TOOL_MANAGER::GetView(), BOARD::HighLightON(), m_frame, m_lastNetcode, TOOL_BASE::m_toolMgr, GENERAL_COLLECTOR::PadsOrTracks, PCB_PAD_T, COLLECTOR::Remove(), BOARD::ResetNetHighLight(), PCB_TOOL_BASE::selection(), PCB_EDIT_FRAME::SendCrossProbeNetName(), PCB_EDIT_FRAME::SendMessageToEESCHEMA(), BOARD::SetHighLightNet(), EDA_DRAW_FRAME::SetMsgPanel(), GENERAL_COLLECTORS_GUIDE::SetPreferredLayer(), EDA_ITEM::Type(), KIGFX::VIEW::UpdateAllLayersColor(), PCB_TOOL_BASE::view(), and GENERAL_COLLECTOR::Zones.

Referenced by HighlightNet(), and HighlightNetTool().

◆ HighlightNetTool()

int PCB_INSPECTION_TOOL::HighlightNetTool ( const TOOL_EVENT aEvent)

Launches a tool to pick the item whose net is going to be highlighted.

Definition at line 829 of file pcb_inspection_tool.cpp.

830 {
831  std::string tool = aEvent.GetCommandStr().get();
833 
834  // Deactivate other tools; particularly important if another PICKER is currently running
835  Activate();
836 
837  // If the keyboard hotkey was triggered and we are already in the highlight tool, behave
838  // the same as a left-click. Otherwise highlight the net of the selected item(s), or if
839  // there is no selection, then behave like a ctrl-left-click.
841  {
842  bool use_selection = m_frame->IsCurrentTool( PCB_ACTIONS::highlightNetTool );
843  highlightNet( getViewControls()->GetMousePosition(), use_selection );
844  }
845 
846  picker->SetClickHandler(
847  [this] ( const VECTOR2D& pt ) -> bool
848  {
849  highlightNet( pt, false );
850  return true;
851  } );
852 
853  picker->SetLayerSet( LSET::AllCuMask() );
854 
855  m_toolMgr->RunAction( ACTIONS::pickerTool, true, &tool );
856 
857  return 0;
858 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:750
bool IsCurrentTool(const TOOL_ACTION &aAction) const
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:141
bool highlightNet(const VECTOR2D &aPosition, bool aUseSelection)
Look for a BOARD_CONNECTED_ITEM in a given spot and if one is found - it enables highlight for its ne...
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:67
static TOOL_ACTION pickerTool
Definition: actions.h:153
static TOOL_ACTION highlightNetTool
Definition: pcb_actions.h:444
PCB_EDIT_FRAME * m_frame
Generic tool for picking a point.
OPT< std::string > GetCommandStr() const
Definition: tool_event.h:463
static TOOL_ACTION highlightNetSelection
Definition: pcb_actions.h:445
void SetLayerSet(LSET aLayerSet)
Function SetLayerSet() Sets the tool's snap layer set.
void Activate()
Function Activate() Runs the tool.
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:42
void SetClickHandler(CLICK_HANDLER aHandler)
Function SetClickHandler() Sets a handler for mouse click event.

References TOOL_INTERACTIVE::Activate(), LSET::AllCuMask(), TOOL_EVENT::GetCommandStr(), TOOL_MANAGER::GetTool(), TOOL_BASE::getViewControls(), highlightNet(), PCB_ACTIONS::highlightNetSelection, PCB_ACTIONS::highlightNetTool, TOOL_EVENT::IsAction(), TOOLS_HOLDER::IsCurrentTool(), m_frame, TOOL_BASE::m_toolMgr, ACTIONS::pickerTool, TOOL_MANAGER::RunAction(), PCBNEW_PICKER_TOOL::SetClickHandler(), and PCBNEW_PICKER_TOOL::SetLayerSet().

Referenced by setTransitions().

◆ Init()

bool PCB_INSPECTION_TOOL::Init ( void  )
overridevirtual

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

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

Reimplemented from PCB_TOOL_BASE.

Definition at line 80 of file pcb_inspection_tool.cpp.

81 {
82  SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<SELECTION_TOOL>();
83 
84  auto netSubMenu = std::make_shared<NET_CONTEXT_MENU>();
85  netSubMenu->SetTool( this );
86 
87  static KICAD_T connectedTypes[] = { PCB_TRACE_T, PCB_VIA_T, PCB_ARC_T, PCB_PAD_T,
88  PCB_ZONE_T, EOT };
89 
90  CONDITIONAL_MENU& menu = selectionTool->GetToolMenu().GetMenu();
91 
92  selectionTool->GetToolMenu().AddSubMenu( netSubMenu );
93 
94  menu.AddMenu( netSubMenu.get(), SELECTION_CONDITIONS::OnlyTypes( connectedTypes ), 200 );
96 
97  return true;
98 }
void AddMenu(ACTION_MENU *aMenu, const SELECTION_CONDITION &aCondition=SELECTION_CONDITIONS::ShowAlways, int aOrder=ANY_ORDER)
Adds a submenu to the menu.
static SELECTION_CONDITION OnlyTypes(const KICAD_T aTypes[])
Creates a functor that tests if the selected items are only of given types.
SELECTION_TOOL.
CONDITIONAL_MENU & GetMenu()
Function GetMenu.
Definition: tool_menu.cpp:46
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
TOOL_MENU & GetToolMenu()
class ARC, an arc track segment on a copper layer
Definition: typeinfo.h:98
class PAD, a pad in a footprint
Definition: typeinfo.h:90
static SELECTION_CONDITION Count(int aNumber)
Creates a functor that tests if the number of selected items is equal to the value given as parameter...
search types array terminator (End Of Types)
Definition: typeinfo.h:82
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:96
class ZONE, a copper pour area
Definition: typeinfo.h:106
static TOOL_ACTION inspectClearance
Definition: pcb_actions.h:436
void AddSubMenu(std::shared_ptr< ACTION_MENU > aSubMenu)
Function CreateSubMenu.
Definition: tool_menu.cpp:52
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
void AddItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Adds a menu entry to run a TOOL_ACTION on selected items.

References CONDITIONAL_MENU::AddItem(), CONDITIONAL_MENU::AddMenu(), TOOL_MENU::AddSubMenu(), SELECTION_CONDITIONS::Count(), EOT, TOOL_MENU::GetMenu(), TOOL_MANAGER::GetTool(), TOOL_INTERACTIVE::GetToolMenu(), PCB_ACTIONS::inspectClearance, TOOL_BASE::m_toolMgr, SELECTION_CONDITIONS::OnlyTypes(), PCB_ARC_T, PCB_PAD_T, PCB_TRACE_T, PCB_VIA_T, and PCB_ZONE_T.

◆ InspectClearance()

int PCB_INSPECTION_TOOL::InspectClearance ( const TOOL_EVENT aEvent)

Show the clearance resolution for two selected items

Definition at line 241 of file pcb_inspection_tool.cpp.

242 {
244  const PCBNEW_SELECTION& selection = selTool->GetSelection();
246 
247  if( selection.Size() != 2 )
248  {
249  m_frame->ShowInfoBarError( _( "Select two items for a clearance resolution report." ) );
250  return 0;
251  }
252 
253  if( m_inspectClearanceDialog == nullptr )
254  {
255  m_inspectClearanceDialog = std::make_unique<DIALOG_INSPECTION_REPORTER>( m_frame );
256  m_inspectClearanceDialog->SetTitle( _( "Clearance Report" ) );
257 
258  m_inspectClearanceDialog->Connect( wxEVT_CLOSE_WINDOW,
260  nullptr, this );
261  }
262 
264  r->SetUnits( m_frame->GetUserUnits() );
265  r->Clear();
266 
267  BOARD_ITEM* a = static_cast<BOARD_ITEM*>( selection.GetItem( 0 ) );
268  BOARD_ITEM* b = static_cast<BOARD_ITEM*>( selection.GetItem( 1 ) );
269 
270  if( a->Type() == PCB_TRACE_T || a->Type() == PCB_ARC_T )
271  layer = a->GetLayer();
272  else if( b->Type() == PCB_TRACE_T || b->Type() == PCB_ARC_T )
273  layer = b->GetLayer();
274  else if( a->Type() == PCB_PAD_T && static_cast<PAD*>( a )->GetAttribute() == PAD_ATTRIB_SMD )
275  {
276  PAD* pad = static_cast<PAD*>( a );
277 
278  if( pad->GetAttribute() == PAD_ATTRIB_SMD && pad->IsOnLayer( F_Cu ) )
279  layer = F_Cu;
280  else
281  layer = B_Cu;
282  }
283  else if( b->Type() == PCB_PAD_T )
284  {
285  PAD* pad = static_cast<PAD*>( b );
286 
287  if( pad->GetAttribute() == PAD_ATTRIB_SMD && pad->IsOnLayer( F_Cu ) )
288  layer = F_Cu;
289  else
290  layer = B_Cu;
291  }
292 
293  if( a->Type() != PCB_ZONE_T && b->Type() == PCB_ZONE_T )
294  std::swap( a, b );
295  else if( !a->IsConnected() && b->IsConnected() )
296  std::swap( a, b );
297 
298  auto getItemDescription =
299  [&]( BOARD_ITEM* aItem )
300  {
301  wxString s = aItem->GetSelectMenuText( r->GetUnits() );
302 
303  if( aItem->IsConnected() )
304  {
305  BOARD_CONNECTED_ITEM* cItem = static_cast<BOARD_CONNECTED_ITEM*>( aItem );
306  s += wxS( " " ) + wxString::Format( _( "[netclass %s]" ),
307  cItem->GetNetClassName() );
308  }
309 
310  return s;
311  };
312 
313  if( layer == F_SilkS || layer == B_SilkS )
314  {
315  r->Report( "<h7>" + _( "Silkscreen clearance resolution for:" ) + "</h7>" );
316 
317  r->Report( wxString::Format( "<ul><li>%s %s</li><li>%s</li><li>%s</li></ul>",
318  _( "Layer" ),
319  m_frame->GetBoard()->GetLayerName( layer ),
320  getItemDescription( a ),
321  getItemDescription( b ) ) );
322 
323  reportClearance( SILK_CLEARANCE_CONSTRAINT, layer, a, b, r );
324  }
325  else if( !( a->GetLayerSet() & LSET( 3, layer, Edge_Cuts, Margin ) ).any() )
326  {
327  r->Report( wxString::Format( _( "%s not present on layer %s. No clearance defined." ),
328  a->GetSelectMenuText( r->GetUnits() ),
329  m_frame->GetBoard()->GetLayerName( layer ) ) );
330  }
331  else if( !( b->GetLayerSet() & LSET( 3, layer, Edge_Cuts, Margin ) ).any() )
332  {
333  r->Report( wxString::Format( _( "%s not present on layer %s. No clearance defined." ),
334  b->GetSelectMenuText( r->GetUnits() ),
335  m_frame->GetBoard()->GetLayerName( layer ) ) );
336  }
337  else
338  {
339  r->Report( "<h7>" + _( "Clearance resolution for:" ) + "</h7>" );
340 
341  r->Report( wxString::Format( "<ul><li>%s %s</li><li>%s</li><li>%s</li></ul>",
342  _( "Layer" ),
343  m_frame->GetBoard()->GetLayerName( layer ),
344  getItemDescription( a ),
345  getItemDescription( b ) ) );
346 
347  BOARD_CONNECTED_ITEM* ac = a && a->IsConnected() ?
348  static_cast<BOARD_CONNECTED_ITEM*>( a ) : nullptr;
349  BOARD_CONNECTED_ITEM* bc = b && b->IsConnected() ?
350  static_cast<BOARD_CONNECTED_ITEM*>( b ) : nullptr;
351 
352  if( ac && bc && ac->GetNetCode() > 0 && ac->GetNetCode() == bc->GetNetCode() )
353  {
354  // Same nets....
355 
356  if( ac->Type() == PCB_ZONE_T && bc->Type() == PCB_PAD_T )
357  {
358  reportZoneConnection( static_cast<ZONE*>( ac ), static_cast<PAD*>( bc ), r );
359  }
360  else
361  {
362  r->Report( "" );
363  r->Report( _( "Items belong to the same net. Clearance is 0." ) );
364  }
365  }
366  else
367  {
368  // Different nets (or one or both unconnected)....
369  reportClearance( CLEARANCE_CONSTRAINT, layer, a, b, r );
370  }
371  }
372 
373  r->Flush();
374 
375  m_inspectClearanceDialog->Raise();
376  m_inspectClearanceDialog->Show( true );
377  return 0;
378 }
void SetUnits(EDA_UNITS aUnits)
void reportClearance(DRC_CONSTRAINT_TYPE_T aClearanceType, PCB_LAYER_ID aLayer, BOARD_ITEM *aA, BOARD_ITEM *aB, REPORTER *r)
int GetNetCode() const
Function GetNetCode.
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Definition: board.cpp:332
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
Definition: board_item.h:86
WX_HTML_REPORT_BOX.
REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Function Report is a pure virtual function to override in the derived object.
SELECTION_TOOL.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:81
class ARC, an arc track segment on a copper layer
Definition: typeinfo.h:98
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Function IsOnLayer tests to see if this object is on the given layer.
Definition: pad.h:544
class PAD, a pad in a footprint
Definition: typeinfo.h:90
bool IsConnected() const override
BOARD_CONNECTED_ITEM is a base class derived from BOARD_ITEM for items that can be connected and have...
virtual wxString GetNetClassName() const
Function GetNetClassName returns a pointer to the netclass of the zone.
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:96
PAD_ATTR_T GetAttribute() const
Definition: pad.h:348
PCBNEW_SELECTION & GetSelection()
Function GetSelection()
virtual PCB_LAYER_ID GetActiveLayer() const
PCB_EDIT_FRAME * m_frame
PCB_LAYER_ID
A quick note on layer IDs:
void reportZoneConnection(ZONE *aZone, PAD *aPad, REPORTER *r)
LSET is a set of PCB_LAYER_IDs.
const PCBNEW_SELECTION & selection() const
std::unique_ptr< DIALOG_INSPECTION_REPORTER > m_inspectClearanceDialog
class ZONE, a copper pour area
Definition: typeinfo.h:106
void ShowInfoBarError(const wxString &aErrorMsg)
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
Definition: selection.h:104
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
EDA_UNITS GetUnits() const override
#define _(s)
Definition: 3d_actions.cpp:33
virtual wxString GetSelectMenuText(EDA_UNITS aUnits) const
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Definition: eda_item.cpp:123
int Size() const
Returns the number of selected parts.
Definition: selection.h:126
virtual bool IsConnected() const
Function IsConnected() Returns information if the object is derived from BOARD_CONNECTED_ITEM.
Definition: board_item.h:146
void onInspectClearanceDialogClosed(wxCommandEvent &aEvent)
BOARD * GetBoard() const
Definition: pad.h:59
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
Definition: board_item.h:185
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
virtual LSET GetLayerSet() const
Function GetLayerSet returns a std::bitset of all layers on which the item physically resides.
Definition: board_item.h:191
KICAD_T Type() const
Function Type()
Definition: eda_item.h:181

References _, B_Cu, B_SilkS, WX_HTML_REPORT_BOX::Clear(), CLEARANCE_CONSTRAINT, Edge_Cuts, F_Cu, F_SilkS, WX_HTML_REPORT_BOX::Flush(), Format(), PCB_BASE_FRAME::GetActiveLayer(), PAD::GetAttribute(), PCB_BASE_FRAME::GetBoard(), SELECTION::GetItem(), BOARD_ITEM::GetLayer(), BOARD::GetLayerName(), BOARD_ITEM::GetLayerSet(), BOARD_CONNECTED_ITEM::GetNetClassName(), BOARD_CONNECTED_ITEM::GetNetCode(), SELECTION_TOOL::GetSelection(), EDA_ITEM::GetSelectMenuText(), TOOL_MANAGER::GetTool(), WX_HTML_REPORT_BOX::GetUnits(), EDA_BASE_FRAME::GetUserUnits(), BOARD_CONNECTED_ITEM::IsConnected(), BOARD_ITEM::IsConnected(), PAD::IsOnLayer(), m_frame, m_inspectClearanceDialog, TOOL_BASE::m_toolMgr, Margin, onInspectClearanceDialogClosed(), PAD_ATTRIB_SMD, PCB_ARC_T, PCB_PAD_T, PCB_TRACE_T, PCB_ZONE_T, WX_HTML_REPORT_BOX::Report(), reportClearance(), reportZoneConnection(), PCB_TOOL_BASE::selection(), WX_HTML_REPORT_BOX::SetUnits(), EDA_BASE_FRAME::ShowInfoBarError(), SILK_CLEARANCE_CONSTRAINT, SELECTION::Size(), and EDA_ITEM::Type().

Referenced by setTransitions().

◆ InspectConstraints()

int PCB_INSPECTION_TOOL::InspectConstraints ( const TOOL_EVENT aEvent)

Definition at line 381 of file pcb_inspection_tool.cpp.

382 {
384  const PCBNEW_SELECTION& selection = selTool->GetSelection();
385 
386  if( selection.Size() != 1 )
387  {
388  m_frame->ShowInfoBarError( _( "Select an item for a constraints resolution report." ) );
389  return 0;
390  }
391 
392  if( m_inspectConstraintsDialog == nullptr )
393  {
394  m_inspectConstraintsDialog = std::make_unique<DIALOG_CONSTRAINTS_REPORTER>( m_frame );
395  m_inspectConstraintsDialog->SetTitle( _( "Constraints Report" ) );
396 
397  m_inspectConstraintsDialog->Connect( wxEVT_CLOSE_WINDOW,
399  nullptr, this );
400  }
401 
402  m_inspectConstraintsDialog->DeleteAllPages();
403 
404  BOARD_ITEM* item = static_cast<BOARD_ITEM*>( selection.GetItem( 0 ) );
406  bool courtyardError = false;
407  bool compileError = false;
408 
409  try
410  {
411  drcEngine.InitEngine( m_frame->GetDesignRulesPath() );
412  }
413  catch( PARSE_ERROR& pe )
414  {
415  compileError = true;
416  }
417 
418  for( ZONE* zone : m_frame->GetBoard()->Zones() )
419  zone->CacheBoundingBox();
420 
422  {
423  for( ZONE* zone : footprint->Zones() )
424  zone->CacheBoundingBox();
425 
427 
428  if( ( footprint->GetFlags() & MALFORMED_COURTYARDS ) != 0 )
429  courtyardError = true;
430  }
431 
432  if( item->Type() == PCB_TRACE_T )
433  {
434  WX_HTML_REPORT_BOX* r = m_inspectConstraintsDialog->AddPage( _( "Track Width" ) );
435 
436  r->Report( "<h7>" + _( "Track width resolution for:" ) + "</h7>" );
437  r->Report( "<ul><li>" + item->GetSelectMenuText( r->GetUnits() ) + "</li></ul>" );
438  r->Report( "" );
439 
440  if( compileError )
441  {
442  r->Report( "" );
443  r->Report( _( "Report incomplete: could not compile design rules. " )
444  + "<a href='boardsetup'>" + _( "Show design rules." ) + "</a>" );
445  }
446  else
447  {
448  auto constraint = drcEngine.EvalRulesForItems( TRACK_WIDTH_CONSTRAINT, item, nullptr,
449  UNDEFINED_LAYER, r );
450 
451  wxString min = _( "undefined" );
452  wxString max = _( "undefined" );
453 
454  if( constraint.m_Value.HasMin() )
455  min = StringFromValue( r->GetUnits(), constraint.m_Value.Min(), true );
456 
457  if( constraint.m_Value.HasMax() )
458  max = StringFromValue( r->GetUnits(), constraint.m_Value.Max(), true );
459 
460  r->Report( "" );
461  r->Report( wxString::Format( _( "Width constraints: min %s max %s." ),
462  min,
463  max ) );
464  }
465 
466  r->Flush();
467  }
468 
469  if( item->Type() == PCB_VIA_T )
470  {
471  WX_HTML_REPORT_BOX* r = m_inspectConstraintsDialog->AddPage( _( "Via Diameter" ) );
472 
473  r->Report( "<h7>" + _( "Via diameter resolution for:" ) + "</h7>" );
474  r->Report( "<ul><li>" + item->GetSelectMenuText( r->GetUnits() ) + "</li></ul>" );
475  r->Report( "" );
476 
477  if( compileError )
478  {
479  r->Report( "" );
480  r->Report( _( "Report incomplete: could not compile design rules. " )
481  + "<a href='boardsetup'>" + _( "Show design rules." ) + "</a>" );
482  }
483  else
484  {
485  auto constraint = drcEngine.EvalRulesForItems( VIA_DIAMETER_CONSTRAINT, item, nullptr,
486  UNDEFINED_LAYER, r );
487 
488  wxString min = _( "undefined" );
489  wxString max = _( "undefined" );
490 
491  if( constraint.m_Value.HasMin() )
492  min = StringFromValue( r->GetUnits(), constraint.m_Value.Min(), true );
493 
494  if( constraint.m_Value.HasMax() )
495  max = StringFromValue( r->GetUnits(), constraint.m_Value.Max(), true );
496 
497  r->Report( "" );
498  r->Report( wxString::Format( _( "Diameter constraints: min %s max %s." ),
499  min,
500  max ) );
501  }
502 
503  r->Flush();
504 
505  r = m_inspectConstraintsDialog->AddPage( _( "Via Annular Width" ) );
506 
507  r->Report( "<h7>" + _( "Via annular width resolution for:" ) + "</h7>" );
508  r->Report( "<ul><li>" + item->GetSelectMenuText( r->GetUnits() ) + "</li></ul>" );
509  r->Report( "" );
510 
511  if( compileError )
512  {
513  r->Report( "" );
514  r->Report( _( "Report incomplete: could not compile design rules. " )
515  + "<a href='boardsetup'>" + _( "Show design rules." ) + "</a>" );
516  }
517  else
518  {
519  auto constraint = drcEngine.EvalRulesForItems( ANNULAR_WIDTH_CONSTRAINT, item, nullptr,
520  UNDEFINED_LAYER, r );
521 
522  wxString min = _( "undefined" );
523  wxString max = _( "undefined" );
524 
525  if( constraint.m_Value.HasMin() )
526  min = StringFromValue( r->GetUnits(), constraint.m_Value.Min(), true );
527 
528  if( constraint.m_Value.HasMax() )
529  max = StringFromValue( r->GetUnits(), constraint.m_Value.Max(), true );
530 
531  r->Report( "" );
532  r->Report( wxString::Format( _( "Annular width constraints: min %s max %s." ),
533  min,
534  max ) );
535  }
536 
537  r->Flush();
538  }
539 
540  if( ( item->Type() == PCB_PAD_T && static_cast<PAD*>( item )->GetDrillSize().x > 0 )
541  || item->Type() == PCB_VIA_T )
542  {
543  WX_HTML_REPORT_BOX* r = m_inspectConstraintsDialog->AddPage( _( "Hole Size" ) );
544 
545  r->Report( "<h7>" + _( "Hole diameter resolution for:" ) + "</h7>" );
546  r->Report( "<ul><li>" + item->GetSelectMenuText( r->GetUnits() ) + "</li></ul>" );
547  r->Report( "" );
548 
549  if( compileError )
550  {
551  r->Report( "" );
552  r->Report( _( "Report incomplete: could not compile design rules. " )
553  + "<a href='boardsetup'>" + _( "Show design rules." ) + "</a>" );
554  }
555  else
556  {
557  auto constraint = drcEngine.EvalRulesForItems( HOLE_SIZE_CONSTRAINT, item, nullptr,
558  UNDEFINED_LAYER, r );
559 
560  wxString min = _( "undefined" );
561 
562  if( constraint.m_Value.HasMin() )
563  min = StringFromValue( r->GetUnits(), constraint.m_Value.Min(), true );
564 
565  r->Report( "" );
566  r->Report( wxString::Format( _( "Hole constraint: min %s." ), min ) );
567  }
568 
569  r->Flush();
570  }
571 
572  WX_HTML_REPORT_BOX* r = m_inspectConstraintsDialog->AddPage( _( "Keepouts" ) );
573 
574  r->Report( "<h7>" + _( "Keepout resolution for:" ) + "</h7>" );
575  r->Report( "<ul><li>" + item->GetSelectMenuText( r->GetUnits() ) + "</li></ul>" );
576  r->Report( "" );
577 
578  if( compileError )
579  {
580  r->Report( "" );
581  r->Report( _( "Report incomplete: could not compile design rules. " )
582  + "<a href='boardsetup'>" + _( "Show design rules." ) + "</a>" );
583  }
584  else
585  {
586  if( courtyardError )
587  {
588  r->Report( "" );
589  r->Report( _( "Report may be incomplete: some footprint courtyards are malformed." )
590  + " <a href='drc'>" + _( "Run DRC for a full analysis." ) + "</a>" );
591  }
592 
593  auto constraint = drcEngine.EvalRulesForItems( DISALLOW_CONSTRAINT, item, nullptr,
594  UNDEFINED_LAYER, r );
595 
596  r->Report( "" );
597 
598  if( constraint.m_DisallowFlags )
599  r->Report( _( "Item <b>disallowed</b> at current location." ) );
600  else
601  r->Report( _( "Item allowed at current location." ) );
602  }
603 
604  r->Flush();
605 
606  m_inspectConstraintsDialog->FinishInitialization();
608  m_inspectConstraintsDialog->Show( true );
609  return 0;
610 }
void BuildPolyCourtyards(OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr)
Builds complex polygons of the courtyard areas from graphic items on the courtyard layers.
Definition: footprint.cpp:1696
Design Rule Checker object that performs all the DRC tests.
Definition: drc_engine.h:78
ZONES & Zones()
Definition: board.h:289
wxString GetDesignRulesPath()
Returns the absolute path to the design rules file for the currently-loaded board.
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
Definition: board_item.h:86
WX_HTML_REPORT_BOX.
REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Function Report is a pure virtual function to override in the derived object.
SELECTION_TOOL.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
void onInspectConstraintsDialogClosed(wxCommandEvent &aEvent)
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.h:559
class PAD, a pad in a footprint
Definition: typeinfo.h:90
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:96
PCBNEW_SELECTION & GetSelection()
Function GetSelection()
FP_ZONES & Zones()
Definition: footprint.h:188
PCB_EDIT_FRAME * m_frame
const PCBNEW_SELECTION & selection() const
FOOTPRINTS & Footprints()
Definition: board.h:283
FOOTPRINT * footprint() const
#define MALFORMED_COURTYARDS
Definition: eda_item.h:124
ZONE handles a list of polygons defining a copper zone.
Definition: zone.h:57
void ShowInfoBarError(const wxString &aErrorMsg)
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
Definition: selection.h:104
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
EDA_UNITS GetUnits() const override
Struct PARSE_ERROR contains a filename or source description, a problem input line,...
Definition: ki_exception.h:123
std::unique_ptr< DIALOG_CONSTRAINTS_REPORTER > m_inspectConstraintsDialog
#define _(s)
Definition: 3d_actions.cpp:33
virtual wxString GetSelectMenuText(EDA_UNITS aUnits) const
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Definition: eda_item.cpp:123
int Size() const
Returns the number of selected parts.
Definition: selection.h:126
wxString StringFromValue(EDA_UNITS aUnits, double aValue, bool aAddUnitSymbol, EDA_DATA_TYPE aType)
Function StringFromValue returns the string from aValue according to units (inch, mm ....
Definition: base_units.cpp:220
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
BOARD * GetBoard() const
STATUS_FLAGS GetFlags() const
Definition: eda_item.h:222
void InitEngine(const wxFileName &aRulePath)
Initializes the DRC engine.
Definition: drc_engine.cpp:587
KICAD_T Type() const
Function Type()
Definition: eda_item.h:181

References _, ANNULAR_WIDTH_CONSTRAINT, FOOTPRINT::BuildPolyCourtyards(), DISALLOW_CONSTRAINT, WX_HTML_REPORT_BOX::Flush(), PCB_TOOL_BASE::footprint(), BOARD::Footprints(), Format(), PCB_BASE_FRAME::GetBoard(), PCB_BASE_EDIT_FRAME::GetDesignRulesPath(), BOARD::GetDesignSettings(), EDA_ITEM::GetFlags(), SELECTION::GetItem(), SELECTION_TOOL::GetSelection(), EDA_ITEM::GetSelectMenuText(), TOOL_MANAGER::GetTool(), WX_HTML_REPORT_BOX::GetUnits(), HOLE_SIZE_CONSTRAINT, DRC_ENGINE::InitEngine(), m_frame, m_inspectConstraintsDialog, TOOL_BASE::m_toolMgr, MALFORMED_COURTYARDS, onInspectConstraintsDialogClosed(), PCB_PAD_T, PCB_TRACE_T, PCB_VIA_T, WX_HTML_REPORT_BOX::Report(), PCB_TOOL_BASE::selection(), EDA_BASE_FRAME::ShowInfoBarError(), SELECTION::Size(), StringFromValue(), TRACK_WIDTH_CONSTRAINT, EDA_ITEM::Type(), UNDEFINED_LAYER, VIA_DIAMETER_CONSTRAINT, FOOTPRINT::Zones(), and BOARD::Zones().

Referenced by setTransitions().

◆ IsFootprintEditor()

bool PCB_TOOL_BASE::IsFootprintEditor ( ) const
inlineinherited

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

Referenced by EDIT_TOOL::isRouterActive(), and ROUTER_TOOL::onViaCommand().

◆ ListNets()

int PCB_INSPECTION_TOOL::ListNets ( const TOOL_EVENT aEvent)

Definition at line 1050 of file pcb_inspection_tool.cpp.

1051 {
1052  if( m_listNetsDialog == nullptr )
1053  {
1055  std::make_unique<DIALOG_NET_INSPECTOR>( m_frame, m_listNetsDialogSettings );
1056 
1057  m_listNetsDialog->Connect( wxEVT_CLOSE_WINDOW,
1058  wxCommandEventHandler( PCB_INSPECTION_TOOL::onListNetsDialogClosed ), nullptr,
1059  this );
1060 
1061  m_listNetsDialog->Connect( wxEVT_BUTTON,
1062  wxCommandEventHandler( PCB_INSPECTION_TOOL::onListNetsDialogClosed ), nullptr,
1063  this );
1064  }
1065 
1066  m_listNetsDialog->Raise();
1067  m_listNetsDialog->Show( true );
1068  return 0;
1069 }
std::unique_ptr< DIALOG_NET_INSPECTOR > m_listNetsDialog
void onListNetsDialogClosed(wxCommandEvent &aEvent)
PCB_EDIT_FRAME * m_frame
DIALOG_NET_INSPECTOR::SETTINGS m_listNetsDialogSettings

References m_frame, m_listNetsDialog, m_listNetsDialogSettings, and onListNetsDialogClosed().

Referenced by setTransitions().

◆ LocalRatsnestTool()

int PCB_INSPECTION_TOOL::LocalRatsnestTool ( const TOOL_EVENT aEvent)

Shows local ratsnest of a component

Definition at line 861 of file pcb_inspection_tool.cpp.

862 {
863  std::string tool = aEvent.GetCommandStr().get();
865  BOARD* board = getModel<BOARD>();
866  auto& opt = displayOptions();
867 
868  // Deactivate other tools; particularly important if another PICKER is currently running
869  Activate();
870 
871  picker->SetClickHandler(
872  [this, board, opt]( const VECTOR2D& pt ) -> bool
873  {
874  SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<SELECTION_TOOL>();
875 
878  PCBNEW_SELECTION& selection = selectionTool->GetSelection();
879 
880  if( selection.Empty() )
881  {
884  selection = selectionTool->GetSelection();
885  }
886 
887  if( selection.Empty() )
888  {
889  // Clear the previous local ratsnest if we click off all items
890  for( FOOTPRINT* fp : board->Footprints() )
891  {
892  for( PAD* pad : fp->Pads() )
893  pad->SetLocalRatsnestVisible( opt.m_ShowGlobalRatsnest );
894  }
895  }
896  else
897  {
898  for( EDA_ITEM* item : selection )
899  {
900  if( PAD* pad = dyn_cast<PAD*>( item) )
901  {
902  pad->SetLocalRatsnestVisible( !pad->GetLocalRatsnestVisible() );
903  }
904  else if( FOOTPRINT* fp = dyn_cast<FOOTPRINT*>( item) )
905  {
906  if( !fp->Pads().empty() )
907  {
908  bool enable = !fp->Pads()[0]->GetLocalRatsnestVisible();
909 
910  for( PAD* childPad : fp->Pads() )
911  childPad->SetLocalRatsnestVisible( enable );
912  }
913  }
914  }
915  }
916 
918 
919  return true;
920  } );
921 
922  picker->SetFinalizeHandler(
923  [board, opt] ( int aCondition )
924  {
925  if( aCondition != PCBNEW_PICKER_TOOL::END_ACTIVATE )
926  {
927  for( FOOTPRINT* fp : board->Footprints() )
928  {
929  for( PAD* pad : fp->Pads() )
930  pad->SetLocalRatsnestVisible( opt.m_ShowGlobalRatsnest );
931  }
932  }
933  } );
934 
935  m_toolMgr->RunAction( ACTIONS::pickerTool, true, &tool );
936 
937  return 0;
938 }
static TOOL_ACTION selectionClear
Clears the current selection.
Definition: pcb_actions.h:62
KIGFX::VIEW * GetView() const
Definition: tool_manager.h:290
BOARD * board() const
SELECTION_TOOL.
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:141
void SetFinalizeHandler(FINALIZE_HANDLER aHandler)
Function SetFinalizeHandler() Sets a handler for the finalize event.
PCBNEW_SELECTION & GetSelection()
Function GetSelection()
static TOOL_ACTION pickerTool
Definition: actions.h:153
Generic tool for picking a point.
const PCBNEW_SELECTION & selection() const
void MarkTargetDirty(int aTarget)
Function MarkTargetDirty() Sets or clears target 'dirty' flag.
Definition: view.h:571
static void FootprintFilter(const VECTOR2I &, GENERAL_COLLECTOR &aCollector, SELECTION_TOOL *sTool)
Function FootprintFilter() A selection filter which prunes the selection to contain only items of typ...
Definition: edit_tool.cpp:1732
FOOTPRINTS & Footprints()
Definition: board.h:283
Items that may change while the view stays the same (noncached)
Definition: definitions.h:50
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:120
const PCB_DISPLAY_OPTIONS & displayOptions() const
OPT< std::string > GetCommandStr() const
Definition: tool_event.h:463
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:186
static void PadFilter(const VECTOR2I &, GENERAL_COLLECTOR &aCollector, SELECTION_TOOL *sTool)
Function PadFilter() A selection filter which prunes the selection to contain only items of type PCB_...
Definition: edit_tool.cpp:1720
EDA_ITEM is a base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:148
void Activate()
Function Activate() Runs the tool.
Definition: pad.h:59
static TOOL_ACTION selectionCursor
Select a single item under the cursor position.
Definition: pcb_actions.h:59
void SetClickHandler(CLICK_HANDLER aHandler)
Function SetClickHandler() Sets a handler for mouse click event.

References TOOL_INTERACTIVE::Activate(), PCB_TOOL_BASE::board(), PCB_TOOL_BASE::displayOptions(), SELECTION::Empty(), PCBNEW_PICKER_TOOL::END_ACTIVATE, EDIT_TOOL::FootprintFilter(), BOARD::Footprints(), TOOL_EVENT::GetCommandStr(), SELECTION_TOOL::GetSelection(), TOOL_MANAGER::GetTool(), TOOL_MANAGER::GetView(), TOOL_BASE::m_toolMgr, KIGFX::VIEW::MarkTargetDirty(), EDIT_TOOL::PadFilter(), ACTIONS::pickerTool, TOOL_MANAGER::RunAction(), PCB_TOOL_BASE::selection(), PCB_ACTIONS::selectionClear, PCB_ACTIONS::selectionCursor, PCBNEW_PICKER_TOOL::SetClickHandler(), PCBNEW_PICKER_TOOL::SetFinalizeHandler(), and KIGFX::TARGET_OVERLAY.

Referenced by setTransitions().

◆ onInspectClearanceDialogClosed()

void PCB_INSPECTION_TOOL::onInspectClearanceDialogClosed ( wxCommandEvent &  aEvent)
private

Definition at line 1087 of file pcb_inspection_tool.cpp.

1088 {
1089  m_inspectClearanceDialog->Disconnect( wxEVT_CLOSE_WINDOW,
1090  wxCommandEventHandler( PCB_INSPECTION_TOOL::onInspectClearanceDialogClosed ), nullptr, this );
1091 
1092  m_inspectClearanceDialog->Destroy();
1093  m_inspectClearanceDialog.release();
1094 }
std::unique_ptr< DIALOG_INSPECTION_REPORTER > m_inspectClearanceDialog
void onInspectClearanceDialogClosed(wxCommandEvent &aEvent)

References m_inspectClearanceDialog.

Referenced by InspectClearance().

◆ onInspectConstraintsDialogClosed()

void PCB_INSPECTION_TOOL::onInspectConstraintsDialogClosed ( wxCommandEvent &  aEvent)
private

Definition at line 1097 of file pcb_inspection_tool.cpp.

1098 {
1099  m_inspectConstraintsDialog->Disconnect( wxEVT_CLOSE_WINDOW,
1100  wxCommandEventHandler( PCB_INSPECTION_TOOL::onInspectConstraintsDialogClosed ), nullptr, this );
1101 
1102  m_inspectConstraintsDialog->Destroy();
1103  m_inspectConstraintsDialog.release();
1104 }
void onInspectConstraintsDialogClosed(wxCommandEvent &aEvent)
std::unique_ptr< DIALOG_CONSTRAINTS_REPORTER > m_inspectConstraintsDialog

References m_inspectConstraintsDialog.

Referenced by InspectConstraints().

◆ onListNetsDialogClosed()

void PCB_INSPECTION_TOOL::onListNetsDialogClosed ( wxCommandEvent &  aEvent)
private

Definition at line 1072 of file pcb_inspection_tool.cpp.

1073 {
1075 
1076  m_listNetsDialog->Disconnect( wxEVT_CLOSE_WINDOW,
1077  wxCommandEventHandler( PCB_INSPECTION_TOOL::onListNetsDialogClosed ), nullptr, this );
1078 
1079  m_listNetsDialog->Disconnect( wxEVT_BUTTON,
1080  wxCommandEventHandler( PCB_INSPECTION_TOOL::onListNetsDialogClosed ), nullptr, this );
1081 
1082  m_listNetsDialog->Destroy();
1083  m_listNetsDialog.release();
1084 }
std::unique_ptr< DIALOG_NET_INSPECTOR > m_listNetsDialog
void onListNetsDialogClosed(wxCommandEvent &aEvent)
DIALOG_NET_INSPECTOR::SETTINGS m_listNetsDialogSettings

References m_listNetsDialog, and m_listNetsDialogSettings.

Referenced by ListNets().

◆ ratsnestTimer()

void PCB_INSPECTION_TOOL::ratsnestTimer ( wxTimerEvent &  aEvent)
private

Event handler to recalculate dynamic ratsnest

◆ reportClearance()

void PCB_INSPECTION_TOOL::reportClearance ( DRC_CONSTRAINT_TYPE_T  aClearanceType,
PCB_LAYER_ID  aLayer,
BOARD_ITEM aA,
BOARD_ITEM aB,
REPORTER r 
)
private

Definition at line 195 of file pcb_inspection_tool.cpp.

198 {
199  r->Report( "" );
200 
202 
203  try
204  {
205  drcEngine.InitEngine( m_frame->GetDesignRulesPath() );
206  }
207  catch( PARSE_ERROR& pe )
208  {
209  r->Report( "" );
210  r->Report( _( "Report incomplete: could not compile design rules. " )
211  + "<a href='boardsetup'>" + _( "Show design rules." ) + "</a>" );
212  return;
213  }
214 
215  int clearance = 0;
216 
217  if( aClearanceType == CLEARANCE_CONSTRAINT )
218  {
219  if( ( aA && ( aA->GetLayerSet() & LSET( 2, Edge_Cuts, Margin ) ).any() )
220  || ( aB && ( aB->GetLayerSet() & LSET( 2, Edge_Cuts, Margin ) ).any() ) )
221  {
222  auto edgeConstraint = drcEngine.EvalRulesForItems( EDGE_CLEARANCE_CONSTRAINT, aA, aB,
223  aLayer, r );
224 
225  clearance = edgeConstraint.m_Value.HasMin() ? edgeConstraint.m_Value.Min() : 0;
226  }
227  }
228 
229  auto constraint = drcEngine.EvalRulesForItems( aClearanceType, aA, aB, aLayer, r );
230 
231  if( constraint.m_Value.HasMin() && constraint.m_Value.Min() > clearance )
232  clearance = constraint.m_Value.Min();
233 
234  wxString clearanceStr = StringFromValue( r->GetUnits(), clearance, true );
235 
236  r->Report( "" );
237  r->Report( wxString::Format( _( "Resolved clearance: %s." ), clearanceStr ) );
238 }
Design Rule Checker object that performs all the DRC tests.
Definition: drc_engine.h:78
wxString GetDesignRulesPath()
Returns the absolute path to the design rules file for the currently-loaded board.
virtual EDA_UNITS GetUnits() const
Definition: reporter.h:121
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.h:559
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Function Report is a pure virtual function to override in the derived object.
PCB_EDIT_FRAME * m_frame
LSET is a set of PCB_LAYER_IDs.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
Struct PARSE_ERROR contains a filename or source description, a problem input line,...
Definition: ki_exception.h:123
#define _(s)
Definition: 3d_actions.cpp:33
wxString StringFromValue(EDA_UNITS aUnits, double aValue, bool aAddUnitSymbol, EDA_DATA_TYPE aType)
Function StringFromValue returns the string from aValue according to units (inch, mm ....
Definition: base_units.cpp:220
BOARD * GetBoard() const
void InitEngine(const wxFileName &aRulePath)
Initializes the DRC engine.
Definition: drc_engine.cpp:587
virtual LSET GetLayerSet() const
Function GetLayerSet returns a std::bitset of all layers on which the item physically resides.
Definition: board_item.h:191

References _, CLEARANCE_CONSTRAINT, EDGE_CLEARANCE_CONSTRAINT, Edge_Cuts, Format(), PCB_BASE_FRAME::GetBoard(), PCB_BASE_EDIT_FRAME::GetDesignRulesPath(), BOARD::GetDesignSettings(), BOARD_ITEM::GetLayerSet(), REPORTER::GetUnits(), DRC_ENGINE::InitEngine(), m_frame, Margin, REPORTER::Report(), and StringFromValue().

Referenced by InspectClearance().

◆ reportZoneConnection()

void PCB_INSPECTION_TOOL::reportZoneConnection ( ZONE aZone,
PAD aPad,
REPORTER r 
)
private

Definition at line 115 of file pcb_inspection_tool.cpp.

116 {
118  wxString source;
119  ZONE_CONNECTION connection = aZone->GetPadConnection( aPad, &source );
120 
121  r->Report( "" );
122 
123  r->Report( wxString::Format( _( "Zone connection type: %s." ),
124  connectionEnum.ToString( aZone->GetPadConnection() ) ) );
125 
126  if( source != _( "zone" ) )
127  {
128  r->Report( wxString::Format( _( "Overridden by %s; connection type: %s." ),
129  source,
130  connectionEnum.ToString( connection ) ) );
131  }
132 
133  // Resolve complex connection types into simple types
134  if( connection == ZONE_CONNECTION::THT_THERMAL )
135  {
136  if( aPad->GetAttribute() == PAD_ATTRIB_PTH )
137  {
138  connection = ZONE_CONNECTION::THERMAL;
139  }
140  else
141  {
142  connection = ZONE_CONNECTION::FULL;
143  r->Report( wxString::Format( _( "Pad is not a PTH pad; connection will be: %s." ),
144  connectionEnum.ToString( ZONE_CONNECTION::FULL ) ) );
145  }
146  }
147 
148  r->Report( "" );
149 
150  // Process simple connection types
151  if( connection == ZONE_CONNECTION::THERMAL )
152  {
153  int gap = aZone->GetThermalReliefGap();
154 
155  r->Report( wxString::Format( _( "Zone thermal relief: %s." ),
156  StringFromValue( r->GetUnits(), gap, true ) ) );
157 
158  gap = aZone->GetThermalReliefGap( aPad, &source );
159 
160  if( source != _( "zone" ) )
161  {
162  r->Report( wxString::Format( _( "Overridden by %s; thermal relief: %s." ),
163  source,
164  StringFromValue( r->GetUnits(), gap, true ) ) );
165  }
166  }
167  else if( connection == ZONE_CONNECTION::NONE )
168  {
169  int clearance = aZone->GetLocalClearance();
170 
171  r->Report( wxString::Format( _( "Zone clearance: %s." ),
172  StringFromValue( r->GetUnits(), clearance, true ) ) );
173 
174  if( aZone->GetThermalReliefGap( aPad ) > clearance )
175  {
176  clearance = aZone->GetThermalReliefGap( aPad, &source );
177 
178  if( source != _( "zone" ) )
179  {
180  r->Report( wxString::Format( _( "Overridden by larger thermal relief from %s;"
181  "clearance: %s." ),
182  source,
183  StringFromValue( r->GetUnits(), clearance, true ) ) );
184  }
185  }
186  }
187  else
188  {
189  r->Report( wxString::Format( _( "Clearance: %s." ),
190  StringFromValue( r->GetUnits(), 0, true ) ) );
191  }
192 }
ZONE_CONNECTION
How pads are covered by copper in zone.
Definition: zones.h:41
virtual EDA_UNITS GetUnits() const
Definition: reporter.h:121
static ENUM_MAP< T > & Instance()
Definition: property.h:519
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Function Report is a pure virtual function to override in the derived object.
PAD_ATTR_T GetAttribute() const
Definition: pad.h:348
int GetThermalReliefGap() const
Definition: zone.h:190
pads are covered by copper
int GetLocalClearance(wxString *aSource) const override
Function GetLocalClearance returns any local clearances set in the "classic" (ie: pre-rule) system.
Definition: zone.cpp:470
Thermal relief only for THT pads.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
Use thermal relief for pads.
#define _(s)
Definition: 3d_actions.cpp:33
Plated through hole pad.
Definition: pad_shapes.h:80
Pads are not covered.
wxString StringFromValue(EDA_UNITS aUnits, double aValue, bool aAddUnitSymbol, EDA_DATA_TYPE aType)
Function StringFromValue returns the string from aValue according to units (inch, mm ....
Definition: base_units.cpp:220
ZONE_CONNECTION GetPadConnection(PAD *aPad, wxString *aSource=nullptr) const
Definition: zone.cpp:771
const wxString & ToString(T value) const
Definition: property.h:538

References _, Format(), FULL, PAD::GetAttribute(), ZONE::GetLocalClearance(), ZONE::GetPadConnection(), ZONE::GetThermalReliefGap(), REPORTER::GetUnits(), ENUM_MAP< T >::Instance(), NONE, PAD_ATTRIB_PTH, REPORTER::Report(), StringFromValue(), THERMAL, THT_THERMAL, and ENUM_MAP< T >::ToString().

Referenced by InspectClearance().

◆ Reset()

void PCB_INSPECTION_TOOL::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.

Reimplemented from PCB_TOOL_BASE.

Definition at line 101 of file pcb_inspection_tool.cpp.

102 {
103  m_frame = getEditFrame<PCB_EDIT_FRAME>();
104 }
PCB_EDIT_FRAME * m_frame

References m_frame.

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

◆ selection() [1/2]

const PCBNEW_SELECTION & PCB_TOOL_BASE::selection ( ) const
protectedinherited

Definition at line 291 of file pcb_tool_base.cpp.

292 {
294 
295  return selTool->GetSelection();
296 }
SELECTION_TOOL.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
PCBNEW_SELECTION & GetSelection()
Function GetSelection()

References SELECTION_TOOL::GetSelection(), TOOL_MANAGER::GetTool(), and TOOL_BASE::m_toolMgr.

Referenced by AUTOPLACE_TOOL::autoplaceSelected(), calculateSelectionRatsnest(), ROUTER_TOOL::CanInlineDrag(), EDIT_TOOL::ChangeTrackWidth(), PAD_TOOL::copyPadSettings(), EDIT_TOOL::copyToClipboard(), EDIT_TOOL::CreateArray(), CrossProbePcbToSch(), doHideNet(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), DRAWING_TOOL::DrawZone(), EDIT_TOOL::Duplicate(), PCB_EDITOR_CONTROL::EditFpInFpEditor(), PAD_TOOL::EditPad(), GROUP_TOOL::EnterGroup(), PAD_TOOL::EnumeratePads(), GLOBAL_EDIT_TOOL::ExchangeFootprints(), EDIT_TOOL::FilletTracks(), SELECTION_TOOL::filterSelection(), EDIT_TOOL::Flip(), DRAWING_TOOL::getSourceZoneForAction(), GROUP_TOOL::Group(), highlightNet(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), InspectClearance(), InspectConstraints(), LocalRatsnestTool(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), EDIT_TOOL::Mirror(), PCB_EDITOR_CONTROL::modifyLockSelected(), EDIT_TOOL::MoveExact(), POINT_EDITOR::OnSelectionChange(), PAD_TOOL::pastePadProperties(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), PCBNEW_CONTROL::placeBoardItems(), DRAWING_TOOL::PlaceImportedGraphics(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), POSITION_RELATIVE_TOOL::PositionRelative(), EDIT_TOOL::Properties(), PAD_TOOL::pushPadSettings(), GROUP_TOOL::RemoveFromGroup(), GLOBAL_EDIT_TOOL::RemoveUnusedPads(), EDIT_TOOL::Rotate(), SELECTION_TOOL::selectNet(), DRAWING_TOOL::SetAnchor(), PCB_EDITOR_CONTROL::TrackWidthDec(), PCB_EDITOR_CONTROL::TrackWidthInc(), GROUP_TOOL::Ungroup(), PCBNEW_CONTROL::UpdateMessagePanel(), UpdateSelectionRatsnest(), PCB_EDITOR_CONTROL::ViaSizeDec(), PCB_EDITOR_CONTROL::ViaSizeInc(), PCB_EDITOR_CONTROL::ZoneDuplicate(), ZONE_FILLER_TOOL::ZoneFill(), PCB_EDITOR_CONTROL::ZoneMerge(), and ZONE_FILLER_TOOL::ZoneUnfill().

◆ selection() [2/2]

PCBNEW_SELECTION & PCB_TOOL_BASE::selection ( )
protectedinherited

Definition at line 299 of file pcb_tool_base.cpp.

300 {
302 
303  return selTool->GetSelection();
304 }
SELECTION_TOOL.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
PCBNEW_SELECTION & GetSelection()
Function GetSelection()

References SELECTION_TOOL::GetSelection(), TOOL_MANAGER::GetTool(), and TOOL_BASE::m_toolMgr.

◆ 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)
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(), TOOL_MENU::ShowContextMenu(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ SetIsFootprintEditor()

void PCB_TOOL_BASE::SetIsFootprintEditor ( bool  aEnabled)
inlineinherited

Function SetIsFootprintEditor()

Toggles edit footprint mode. When enabled, one may select parts of footprints individually (graphics, pads, etc.), so they can be modified.

Parameters
aEnableddecides if the mode should be enabled.

Definition at line 104 of file pcb_tool_base.h.

104 { m_isFootprintEditor = aEnabled; }
bool m_isFootprintEditor

References PCB_TOOL_BASE::m_isFootprintEditor.

◆ setTransitions()

void PCB_INSPECTION_TOOL::setTransitions ( )
overrideprivatevirtual

Bind handlers to corresponding TOOL_ACTIONs

Reimplemented from PCB_TOOL_BASE.

Definition at line 1153 of file pcb_inspection_tool.cpp.

1154 {
1158 
1162 
1167 
1175 
1178 }
int UpdateSelectionRatsnest(const TOOL_EVENT &aEvent)
Updates ratsnest for selected items.
static const TOOL_EVENT SelectedEvent
Definition: actions.h:208
int HighlightNet(const TOOL_EVENT &aEvent)
Highlights net belonging to the item under the cursor.
static const TOOL_EVENT UnselectedEvent
Definition: actions.h:209
static TOOL_ACTION hideNet
Definition: pcb_actions.h:447
int InspectClearance(const TOOL_EVENT &aEvent)
Show the clearance resolution for two selected items
static TOOL_ACTION highlightItem
Definition: pcb_actions.h:446
static TOOL_ACTION boardStatistics
Definition: pcb_actions.h:433
int InspectConstraints(const TOOL_EVENT &aEvent)
static TOOL_ACTION cancelInteractive
Definition: actions.h:65
int HighlightNetTool(const TOOL_EVENT &aEvent)
Launches a tool to pick the item whose net is going to be highlighted.
int CrossProbePcbToSch(const TOOL_EVENT &aEvent)
Notifies eeschema about the selected item.
static TOOL_ACTION localRatsnestTool
Definition: pcb_actions.h:451
static TOOL_ACTION toggleLastNetHighlight
Definition: pcb_actions.h:443
int HideNet(const TOOL_EVENT &aEvent)
Hide the ratsnest for a given net
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Function Go()
int ShowStatisticsDialog(const TOOL_EVENT &aEvent)
Function ShowStatisticDialog()
static TOOL_ACTION inspectConstraints
Definition: pcb_actions.h:437
static TOOL_ACTION highlightNetTool
Definition: pcb_actions.h:444
int HighlightItem(const TOOL_EVENT &aEvent)
Performs the appropriate action in response to an eeschema cross-probe.
static const TOOL_EVENT ClearedEvent
Definition: actions.h:210
static TOOL_ACTION hideDynamicRatsnest
Definition: pcb_actions.h:452
static TOOL_ACTION inspectClearance
Definition: pcb_actions.h:436
static TOOL_ACTION clearHighlight
Definition: pcb_actions.h:441
int HideDynamicRatsnest(const TOOL_EVENT &aEvent)
Hides ratsnest for selected items. Called when there are no items selected.
static TOOL_ACTION showNet
Definition: pcb_actions.h:448
static TOOL_ACTION highlightNet
Definition: pcb_actions.h:442
static TOOL_ACTION highlightNetSelection
Definition: pcb_actions.h:445
int LocalRatsnestTool(const TOOL_EVENT &aEvent)
Shows local ratsnest of a component
static TOOL_ACTION listNets
Definition: pcb_actions.h:337
int ListNets(const TOOL_EVENT &aEvent)
static TOOL_ACTION updateLocalRatsnest
Definition: pcb_actions.h:453
int ClearHighlight(const TOOL_EVENT &aEvent)
Clears all board highlights
int ShowNet(const TOOL_EVENT &aEvent)
Show the ratsnest for a given net

References PCB_ACTIONS::boardStatistics, ACTIONS::cancelInteractive, EVENTS::ClearedEvent, ClearHighlight(), PCB_ACTIONS::clearHighlight, CrossProbePcbToSch(), TOOL_INTERACTIVE::Go(), HideDynamicRatsnest(), PCB_ACTIONS::hideDynamicRatsnest, HideNet(), PCB_ACTIONS::hideNet, HighlightItem(), PCB_ACTIONS::highlightItem, HighlightNet(), PCB_ACTIONS::highlightNet, PCB_ACTIONS::highlightNetSelection, HighlightNetTool(), PCB_ACTIONS::highlightNetTool, InspectClearance(), PCB_ACTIONS::inspectClearance, InspectConstraints(), PCB_ACTIONS::inspectConstraints, ListNets(), PCB_ACTIONS::listNets, LocalRatsnestTool(), PCB_ACTIONS::localRatsnestTool, EVENTS::SelectedEvent, ShowNet(), PCB_ACTIONS::showNet, ShowStatisticsDialog(), PCB_ACTIONS::toggleLastNetHighlight, EVENTS::UnselectedEvent, PCB_ACTIONS::updateLocalRatsnest, and UpdateSelectionRatsnest().

◆ ShowNet()

int PCB_INSPECTION_TOOL::ShowNet ( const TOOL_EVENT aEvent)

Show the ratsnest for a given net

Definition at line 1114 of file pcb_inspection_tool.cpp.

1115 {
1116  doHideNet( aEvent.Parameter<intptr_t>(), false );
1117  return 0;
1118 }
void doHideNet(int aNetCode, bool aHide)
T Parameter() const
Function Parameter() Returns a non-standard parameter assigned to the event.
Definition: tool_event.h:435

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

Referenced by setTransitions().

◆ ShowStatisticsDialog()

int PCB_INSPECTION_TOOL::ShowStatisticsDialog ( const TOOL_EVENT aEvent)

Function ShowStatisticDialog()

Shows dialog with board statistics

Definition at line 107 of file pcb_inspection_tool.cpp.

108 {
110  dialog.ShowModal();
111  return 0;
112 }
PCB_EDIT_FRAME * m_frame
DIALOG_BOARD_STATISTIC.

References m_frame.

Referenced by setTransitions().

◆ UpdateSelectionRatsnest()

int PCB_INSPECTION_TOOL::UpdateSelectionRatsnest ( const TOOL_EVENT aEvent)

Updates ratsnest for selected items.

Definition at line 941 of file pcb_inspection_tool.cpp.

942 {
943  VECTOR2I delta;
944 
945  // If we have passed the simple move vector, we can update without recalculation
946  if( aEvent.Parameter<VECTOR2I*>() )
947  {
948  delta = *aEvent.Parameter<VECTOR2I*>();
949  delete aEvent.Parameter<VECTOR2I*>();
950  }
951  else
952  {
953  // We can delete the existing map to force a recalculation
954  delete m_dynamicData;
955  m_dynamicData = nullptr;
956  }
957 
958  auto selectionTool = m_toolMgr->GetTool<SELECTION_TOOL>();
959  auto& selection = selectionTool->GetSelection();
960  auto connectivity = getModel<BOARD>()->GetConnectivity();
961 
962  if( selection.Empty() )
963  {
964  connectivity->ClearDynamicRatsnest();
965  delete m_dynamicData;
966  m_dynamicData = nullptr;
967  }
968  else
969  {
971  }
972 
973  return 0;
974 }
SELECTION_TOOL.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
const PCBNEW_SELECTION & selection() const
T Parameter() const
Function Parameter() Returns a non-standard parameter assigned to the event.
Definition: tool_event.h:435
CONNECTIVITY_DATA * m_dynamicData
void calculateSelectionRatsnest(const VECTOR2I &aDelta)
Recalculates dynamic ratsnest for the current selection
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:120

References calculateSelectionRatsnest(), SELECTION::Empty(), TOOL_MANAGER::GetTool(), m_dynamicData, TOOL_BASE::m_toolMgr, TOOL_EVENT::Parameter(), and PCB_TOOL_BASE::selection().

Referenced by setTransitions().

◆ view()

◆ 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(), EDIT_TOOL::doMoveSelection(), 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(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), SCH_MOVE_TOOL::Main(), PCBNEW_PICKER_TOOL::Main(), EDA_3D_CONTROLLER::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(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), POINT_EDITOR::OnSelectionChange(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), GROUP_TOOL::PickNewMember(), EDIT_TOOL::pickReferencePoint(), 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().

Member Data Documentation

◆ m_dynamicData

CONNECTIVITY_DATA* PCB_INSPECTION_TOOL::m_dynamicData
private

◆ m_frame

◆ m_inspectClearanceDialog

std::unique_ptr<DIALOG_INSPECTION_REPORTER> PCB_INSPECTION_TOOL::m_inspectClearanceDialog
private

Definition at line 149 of file pcb_inspection_tool.h.

Referenced by InspectClearance(), and onInspectClearanceDialogClosed().

◆ m_inspectConstraintsDialog

std::unique_ptr<DIALOG_CONSTRAINTS_REPORTER> PCB_INSPECTION_TOOL::m_inspectConstraintsDialog
private

Definition at line 150 of file pcb_inspection_tool.h.

Referenced by InspectConstraints(), and onInspectConstraintsDialogClosed().

◆ m_isFootprintEditor

◆ m_lastNetcode

int PCB_INSPECTION_TOOL::m_lastNetcode
private

Definition at line 142 of file pcb_inspection_tool.h.

Referenced by HighlightNet(), highlightNet(), and PCB_INSPECTION_TOOL().

◆ m_listNetsDialog

std::unique_ptr<DIALOG_NET_INSPECTOR> PCB_INSPECTION_TOOL::m_listNetsDialog
private

Definition at line 146 of file pcb_inspection_tool.h.

Referenced by ListNets(), and onListNetsDialogClosed().

◆ m_listNetsDialogSettings

DIALOG_NET_INSPECTOR::SETTINGS PCB_INSPECTION_TOOL::m_listNetsDialogSettings
private

Definition at line 147 of file pcb_inspection_tool.h.

Referenced by ListNets(), and onListNetsDialogClosed().

◆ 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(), ROUTER_TOOL::Init(), LENGTH_TUNER_TOOL::Init(), SCH_EDIT_TOOL::Init(), PICKER_TOOL::Init(), PL_EDIT_TOOL::Init(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Init(), LIB_CONTROL::Init(), LIB_DRAWING_TOOLS::Init(), FOOTPRINT_EDITOR_TOOLS::Init(), PCB_VIEWER_TOOLS::Init(), PL_DRAWING_TOOLS::Init(), PCB_EDITOR_CONTROL::Init(), SCH_DRAWING_TOOLS::Init(), EDA_3D_CONTROLLER::Init(), GERBVIEW_SELECTION_TOOL::Init(), PL_SELECTION_TOOL::Init(), DRAWING_TOOL::Init(), EE_SELECTION_TOOL::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), SELECTION_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), PCB_TOOL_BASE::Init(), PL_EDIT_TOOL::Main(), LIB_MOVE_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), SCH_MOVE_TOOL::Main(), PCBNEW_PICKER_TOOL::Main(), EDA_3D_CONTROLLER::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(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), 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_probingSchToPcb

bool PCB_INSPECTION_TOOL::m_probingSchToPcb
private

Definition at line 141 of file pcb_inspection_tool.h.

Referenced by CrossProbePcbToSch(), HighlightItem(), and PCB_INSPECTION_TOOL().

◆ 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(), SELECTION_TOOL::AddItemToSel(), EE_SELECTION_TOOL::AddItemToSel(), SCH_MOVE_TOOL::AlignElements(), SCH_EDITOR_CONTROL::AssignNetclass(), CVPCB_ASSOCIATION_TOOL::Associate(), TOOL_BASE::attachManager(), SCH_EDIT_TOOL::AutoplaceFields(), calculateSelectionRatsnest(), ROUTER_TOOL::CanInlineDrag(), SCH_EDIT_TOOL::ChangeTextType(), EDIT_TOOL::ChangeTrackWidth(), SCH_EDIT_TOOL::CleanupSheetPins(), GERBVIEW_CONTROL::ClearAllLayers(), 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(), EDIT_TOOL::copyToClipboard(), MICROWAVE_TOOL::createInductorBetween(), CrossProbePcbToSch(), COMMON_TOOLS::CursorControl(), 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(), doHideNet(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), COMMON_TOOLS::doZoomInOut(), COMMON_TOOLS::doZoomToPreset(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawRectangle(), DRAWING_TOOL::drawSegment(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), 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::EditField(), SCH_EDIT_TOOL::editFieldText(), PCB_EDITOR_CONTROL::EditFpInFpEditor(), LIB_EDIT_TOOL::editGraphicProperties(), PAD_TOOL::EditPad(), LIB_EDIT_TOOL::editSymbolProperties(), SCH_EDITOR_CONTROL::EditWithLibEdit(), GROUP_TOOL::EnterGroup(), SCH_NAVIGATE_TOOL::EnterSheet(), SCH_EDITOR_CONTROL::EnterSheet(), PAD_TOOL::EnumeratePads(), GLOBAL_EDIT_TOOL::ExchangeFootprints(), SELECTION_TOOL::expandConnection(), PAD_TOOL::explodePad(), 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::GetManager(), TOOL_BASE::getModelInt(), DRAWING_TOOL::getSourceZoneForAction(), TOOL_BASE::getToolHolderInt(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), TOOL_INTERACTIVE::goInternal(), COMMON_TOOLS::GridNext(), COMMON_TOOLS::GridPreset(), COMMON_TOOLS::GridPrev(), PCBNEW_CONTROL::GridSetOrigin(), GROUP_TOOL::Group(), EE_SELECTION_TOOL::GuessSelectionCandidates(), GERBVIEW_CONTROL::HighlightControl(), HighlightItem(), HighlightNet(), SCH_EDITOR_CONTROL::HighlightNet(), highlightNet(), SCH_EDITOR_CONTROL::HighlightNetCursor(), HighlightNetTool(), FOOTPRINT_EDITOR_TOOLS::ImportFootprint(), PL_EDIT_TOOL::ImportWorksheetContent(), LIB_EDIT_TOOL::Init(), PL_EDIT_TOOL::Init(), SCH_EDIT_TOOL::Init(), GROUP_TOOL::Init(), CONVERT_TOOL::Init(), GLOBAL_EDIT_TOOL::Init(), LIB_CONTROL::Init(), PAD_TOOL::Init(), ALIGN_DISTRIBUTE_TOOL::Init(), PL_DRAWING_TOOLS::Init(), PL_POINT_EDITOR::Init(), PCB_EDITOR_CONTROL::Init(), POINT_EDITOR::Init(), POSITION_RELATIVE_TOOL::Init(), Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), InspectClearance(), InspectConstraints(), EDIT_TOOL::invokeInlineRouter(), EDIT_TOOL::isInteractiveDragEnabled(), EDIT_TOOL::isRouterActive(), TOOL_BASE::IsToolActive(), GROUP_TOOL::LeaveGroup(), SCH_NAVIGATE_TOOL::LeaveSheet(), SCH_EDITOR_CONTROL::LeaveSheet(), COMMON_CONTROL::ListHotKeys(), LocalRatsnestTool(), PL_EDIT_TOOL::Main(), CVPCB_CONTROL::Main(), LIB_MOVE_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), SCH_MOVE_TOOL::Main(), PCBNEW_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(), PCB_VIEWER_TOOLS::MeasureTool(), LIB_EDIT_TOOL::Mirror(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::Mirror(), PCB_EDITOR_CONTROL::modifyLockSelected(), EDIT_TOOL::MoveExact(), LIB_CONTROL::OnDeMorgan(), COMMON_TOOLS::OnGridChanged(), POINT_EDITOR::OnSelectionChange(), LIB_EDIT_TOOL::Paste(), PL_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), PAD_TOOL::pastePadProperties(), GROUP_TOOL::PickNewMember(), EDIT_TOOL::pickReferencePoint(), 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(), GERBVIEW_CONTROL::ReloadAllLayers(), EDIT_TOOL::Remove(), POINT_EDITOR::removeCorner(), GROUP_TOOL::RemoveFromGroup(), PL_SELECTION_TOOL::RemoveItemFromSel(), EE_SELECTION_TOOL::RemoveItemFromSel(), 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(), COMMON_TOOLS::Reset(), PNS::TOOL_BASE::Reset(), EDA_3D_CONTROLLER::Reset(), COMMON_TOOLS::ResetLocalCoords(), TOOL_INTERACTIVE::resetTransitions(), LIB_EDIT_TOOL::Rotate(), SCH_EDIT_TOOL::Rotate(), EDIT_TOOL::Rotate(), TOOL_INTERACTIVE::RunMainStack(), DRC_TOOL::RunTests(), EE_SELECTION_TOOL::SelectConnection(), PCB_TOOL_BASE::selection(), COMMON_TOOLS::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(), EDA_3D_CONTROLLER::SetMaterial(), DRC_TOOL::ShowDRCDialog(), SCH_DRAWING_TOOLS::SingleClickPlace(), EDA_3D_CONTROLLER::ToggleVisibility(), PCB_EDITOR_CONTROL::TrackWidthDec(), PCB_EDITOR_CONTROL::TrackWidthInc(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), LIB_EDIT_TOOL::Undo(), SCH_EDITOR_CONTROL::Undo(), GROUP_TOOL::Ungroup(), GERBVIEW_SELECTION_TOOL::UnselectItem(), GERBVIEW_SELECTION_TOOL::UnselectItems(), SELECTION_TOOL::UnselectItems(), PNS::TOOL_BASE::updateEndItem(), EE_INSPECTION_TOOL::UpdateMessagePanel(), GERBVIEW_CONTROL::UpdateMessagePanel(), PL_EDITOR_CONTROL::UpdateMessagePanel(), PCBNEW_CONTROL::UpdateMessagePanel(), UpdateSelectionRatsnest(), PNS::TOOL_BASE::updateStartItem(), 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_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(), and BOARD_COMMIT::Push().


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