KiCad PCB EDA Suite
MICROWAVE_TOOL Class Reference

Tool responsible for adding microwave features to PCBs. More...

#include <microwave_tool.h>

Inheritance diagram for MICROWAVE_TOOL:
PCB_TOOL_BASE TOOL_INTERACTIVE TOOL_BASE

Public Types

enum  RESET_REASON { RUN, MODEL_RELOAD, GAL_SWITCH }
 Determine the reason of reset for a tool. More...
 

Public Member Functions

 MICROWAVE_TOOL ()
 
 ~MICROWAVE_TOOL ()
 React to model/view changes. More...
 
void Reset (RESET_REASON aReason) override
 Bind handlers to corresponding TOOL_ACTIONs. More...
 
void setTransitions () override
 This method is meant to be overridden in order to specify handlers for events. More...
 
virtual bool Init () override
 Init() is called once upon a registration of the tool. More...
 
void SetIsFootprintEditor (bool aEnabled)
 Function SetIsFootprintEditor() More...
 
bool IsFootprintEditor () const
 
void Activate ()
 Run the tool. More...
 
TOOL_MENUGetToolMenu ()
 
void SetContextMenu (ACTION_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger=CMENU_BUTTON)
 Assign a context menu and tells when it should be activated. More...
 
void RunMainStack (std::function< void()> aFunc)
 Call a function using the main stack. More...
 
template<class T >
void Go (int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
 Define which state (aStateFunc) to go when a certain event arrives (aConditions). More...
 
TOOL_EVENTWait (const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
 Suspend execution of the tool until an event specified in aEventList arrives. More...
 
TOOL_TYPE GetType () const
 Return the type of the tool. More...
 
TOOL_ID GetId () const
 Return the unique identifier of the tool. More...
 
const std::string & GetName () const
 Return the name of the tool. More...
 
TOOL_MANAGERGetManager () const
 Return the instance of TOOL_MANAGER that takes care of the tool. More...
 
bool IsToolActive () const
 

Protected 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 PCB_SELECTIONselection () const
 
PCB_SELECTIONselection ()
 
void attachManager (TOOL_MANAGER *aManager)
 Set the TOOL_MANAGER the tool will belong to. More...
 
KIGFX::VIEWgetView () const
 Returns the instance of #VIEW object used in the application. More...
 
KIGFX::VIEW_CONTROLSgetViewControls () const
 Return the instance of VIEW_CONTROLS object used in the application. More...
 
template<typename T >
T * getEditFrame () const
 Return the application window object, casted to requested user type. More...
 
template<typename T >
T * getModel () const
 Return the model object if it matches the requested type. More...
 

Protected Attributes

bool m_isFootprintEditor
 
TOOL_MENU m_menu
 The functions below are not yet implemented - their interface may change. More...
 
TOOL_TYPE m_type
 Unique identifier for the tool, assigned by a TOOL_MANAGER instance. More...
 
TOOL_ID m_toolId
 Name of the tool. More...
 
std::string m_toolName
 
TOOL_MANAGERm_toolMgr
 

Private Member Functions

int addMicrowaveFootprint (const TOOL_EVENT &aEvent)
 < Main interactive tool More...
 
void createInductorBetween (const VECTOR2I &aStart, const VECTOR2I &aEnd)
 Draw a microwave inductor interactively. More...
 
int drawMicrowaveInductor (const TOOL_EVENT &aEvent)
 
FOOTPRINTcreateFootprint (MICROWAVE_FOOTPRINT_SHAPE aFootprintShape)
 Create a footprint "GAP" or "STUB" used in micro wave designs. More...
 
FOOTPRINTcreatePolygonShape ()
 
FOOTPRINTcreateMicrowaveInductor (MICROWAVE_INDUCTOR_PATTERN &aPattern, wxString &aErrorMessage)
 Create an S-shaped coil footprint for microwave applications. More...
 
FOOTPRINTcreateBaseFootprint (const wxString &aValue, int aTextSize, int aPadCount)
 Create a basic footprint for micro wave applications. More...
 

Detailed Description

Tool responsible for adding microwave features to PCBs.

Definition at line 56 of file microwave_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 110 of file pcb_tool_base.h.

110  {
112  IPO_ROTATE = 0x01,
113 
115  IPO_FLIP = 0x02,
116 
119  IPO_SINGLE_CLICK = 0x04,
120 
122  IPO_REPEAT = 0x08
123  };
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

Determine the reason of reset for a tool.

Enumerator
RUN 

Tool is invoked after being inactive.

MODEL_RELOAD 

Model changes (required full reload)

GAL_SWITCH 

Rendering engine changes.

Definition at line 77 of file tool_base.h.

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

Constructor & Destructor Documentation

◆ MICROWAVE_TOOL()

MICROWAVE_TOOL::MICROWAVE_TOOL ( )

Definition at line 40 of file microwave_tool.cpp.

40  :
41  PCB_TOOL_BASE( "pcbnew.MicrowaveTool" )
42 {
43 }
PCB_TOOL_BASE(TOOL_ID aId, const std::string &aName)
Constructor.
Definition: pcb_tool_base.h:77

◆ ~MICROWAVE_TOOL()

MICROWAVE_TOOL::~MICROWAVE_TOOL ( )

React to model/view changes.

Definition at line 46 of file microwave_tool.cpp.

47 {}

Member Function Documentation

◆ Activate()

void TOOL_INTERACTIVE::Activate ( )
inherited

Run the tool.

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

Definition at line 51 of file tool_interactive.cpp.

52 {
54 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
TOOL_ID m_toolId
Name of the tool.
Definition: tool_base.h:209
bool InvokeTool(TOOL_ID aToolId)
Call a tool by sending a tool activation event to tool of given ID.

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

Referenced by AUTOPLACE_TOOL::autoplace(), EDIT_TOOL::copyToClipboard(), SYMBOL_EDITOR_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCB_CONTROL::DeleteItemCursor(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawLine(), drawMicrowaveInductor(), DRAWING_TOOL::DrawRectangle(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), BOARD_EDITOR_CONTROL::DrillOrigin(), PAD_TOOL::EnumeratePads(), PCB_CONTROL::GridSetOrigin(), SCH_EDITOR_CONTROL::HighlightNetCursor(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::InteractivePlaceWithPreview(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), PCB_PICKER_TOOL::Main(), PL_EDIT_TOOL::Main(), EE_POINT_EDITOR::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PL_POINT_EDITOR::Main(), SCH_MOVE_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), LIB_TREE::onContextMenu(), PCB_POINT_EDITOR::OnSelectionChange(), GROUP_TOOL::PickNewMember(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), EDIT_TOOL::Remove(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), DRAWING_TOOL::SetAnchor(), DRC_TOOL::ShowDRCDialog(), SCH_DRAWING_TOOLS::SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ addMicrowaveFootprint()

int MICROWAVE_TOOL::addMicrowaveFootprint ( const TOOL_EVENT aEvent)
private

< Main interactive tool

Create an inductor between the two points

Definition at line 55 of file microwave_tool.cpp.

56 {
57  struct MICROWAVE_PLACER : public INTERACTIVE_PLACER_BASE
58  {
59  MICROWAVE_PLACER( MICROWAVE_TOOL* aTool, MICROWAVE_FOOTPRINT_SHAPE aType ) :
60  m_tool( aTool ),
61  m_itemType( aType )
62  { };
63 
64  virtual ~MICROWAVE_PLACER()
65  {
66  }
67 
68  std::unique_ptr<BOARD_ITEM> CreateItem() override
69  {
70  switch( m_itemType )
71  {
75  return std::unique_ptr<FOOTPRINT>( m_tool->createFootprint( m_itemType ) );
76 
78  return std::unique_ptr<FOOTPRINT>( m_tool->createPolygonShape() );
79 
80  default:
81  return std::unique_ptr<FOOTPRINT>();
82  };
83  }
84 
85  private:
86  MICROWAVE_TOOL* m_tool;
87  MICROWAVE_FOOTPRINT_SHAPE m_itemType;
88  };
89 
90  MICROWAVE_PLACER placer( this, aEvent.Parameter<MICROWAVE_FOOTPRINT_SHAPE>() );
91 
92  doInteractiveItemPlacement( aEvent.GetCommandStr().get(), &placer,
93  _( "Place microwave feature" ),
95 
96  return 0;
97 }
Handle flip action in the loop by calling the item's flip method.
Tool responsible for adding microwave features to PCBs.
Allow repeat placement of the item.
T Parameter() const
Return a non-standard parameter assigned to the event.
Definition: tool_event.h:427
#define _(s)
OPT< std::string > GetCommandStr() const
Definition: tool_event.h:455
Handle the rotate action in the loop by calling the item's rotate method.
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...
MICROWAVE_FOOTPRINT_SHAPE

References _, PCB_TOOL_BASE::doInteractiveItemPlacement(), FUNCTION_SHAPE, GAP, TOOL_EVENT::GetCommandStr(), PCB_TOOL_BASE::IPO_FLIP, PCB_TOOL_BASE::IPO_REPEAT, PCB_TOOL_BASE::IPO_ROTATE, TOOL_EVENT::Parameter(), STUB, and STUB_ARC.

Referenced by setTransitions().

◆ attachManager()

void TOOL_BASE::attachManager ( TOOL_MANAGER aManager)
protectedinherited

Set the TOOL_MANAGER the tool will belong to.

Called by TOOL_MANAGER::RegisterTool()

Definition at line 60 of file tool_base.cpp.

61 {
62  m_toolMgr = aManager;
63 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214

References TOOL_BASE::m_toolMgr.

Referenced by TOOL_MANAGER::RegisterTool().

◆ board()

BOARD* PCB_TOOL_BASE::board ( ) const
inlineprotectedinherited

Definition at line 159 of file pcb_tool_base.h.

159 { return getModel<BOARD>(); }

Referenced by PCB_CONTROL::AppendBoard(), AUTOPLACE_TOOL::autoplace(), BOARD_INSPECTION_TOOL::calculateSelectionRatsnest(), EDIT_TOOL::ChangeTrackWidth(), ZONE_FILLER_TOOL::CheckAllZones(), BOARD_INSPECTION_TOOL::ClearHighlight(), EDIT_TOOL::copyToClipboard(), FOOTPRINT_EDITOR_CONTROL::CreateFootprint(), createInductorBetween(), ROUTER_TOOL::CustomTrackWidthDialog(), PCB_CONTROL::DeleteItemCursor(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawSegment(), PAD_TOOL::EnumeratePads(), PAD_TOOL::explodePad(), BOARD_EDITOR_CONTROL::ExportNetlist(), ZONE_FILLER_TOOL::FillAllZones(), EDIT_TOOL::FilletTracks(), PCB_SELECTION_TOOL::filterSelection(), PCB_TOOL_BASE::footprint(), PCB_SELECTION_TOOL::GetBoard(), PCB_SELECTION_TOOL::getCollectorsGuide(), GROUP_TOOL::Group(), ROUTER_TOOL::handleLayerSwitch(), BOARD_INSPECTION_TOOL::highlightNet(), DRAWING_TOOL::InteractivePlaceWithPreview(), PCB_CONTROL::LayerNext(), PCB_CONTROL::LayerPrev(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), EDIT_TOOL::MoveExact(), FOOTPRINT_EDITOR_CONTROL::NewFootprint(), PCB_CONTROL::Paste(), PCB_CONTROL::placeBoardItems(), BOARD_EDITOR_CONTROL::PlaceFootprint(), PAD_TOOL::PlacePad(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), PCB_SELECTION_TOOL::RebuildSelection(), PAD_TOOL::recombinePad(), BOARD_EDITOR_CONTROL::RepairBoard(), FOOTPRINT_EDITOR_CONTROL::RepairFootprint(), PNS::TOOL_BASE::Reset(), PCB_CONTROL::Reset(), PCB_SELECTION_TOOL::Selectable(), PCB_SELECTION_TOOL::selectAllItemsOnNet(), PCB_SELECTION_TOOL::selectAllItemsOnSheet(), PCB_SELECTION_TOOL::selectConnectedTracks(), PCB_SELECTION_TOOL::selectionContains(), PCB_SELECTION_TOOL::selectPoint(), PCB_CONTROL::TrackDisplayMode(), GROUP_TOOL::Ungroup(), ROUTER_TOOL::updateMessagePanel(), PCB_CONTROL::ViaDisplayMode(), PCB_CONTROL::ZoneDisplayMode(), ZONE_FILLER_TOOL::ZoneFill(), BOARD_EDITOR_CONTROL::ZoneMerge(), and ZONE_FILLER_TOOL::ZoneUnfillAll().

◆ canvas()

◆ controls()

◆ createBaseFootprint()

FOOTPRINT * MICROWAVE_TOOL::createBaseFootprint ( const wxString &  aValue,
int  aTextSize,
int  aPadCount 
)
private

Create a basic footprint for micro wave applications.

The default pad settings are: PAD_ATTRIB::SMD, rectangular, H size = V size = current track width.

Parameters
aValueis the text value.
aTextSizeis the size of ref and value texts ( <= 0 to use board default values ).
aPadCountis number of pads.
Returns
the new footprint.

Definition at line 186 of file microwave_footprint.cpp.

188 {
189  PCB_EDIT_FRAME& editFrame = *getEditFrame<PCB_EDIT_FRAME>();
190 
191  FOOTPRINT* footprint = editFrame.CreateNewFootprint( aValue );
192 
193  if( aTextSize > 0 )
194  {
195  footprint->Reference().SetTextSize( wxSize( aTextSize, aTextSize ) );
196  footprint->Reference().SetTextThickness( aTextSize / 5 );
197  footprint->Value().SetTextSize( wxSize( aTextSize, aTextSize ) );
198  footprint->Value().SetTextThickness( aTextSize / 5 );
199  }
200 
201  // Create 2 pads used in gaps and stubs. The gap is between these 2 pads
202  // the stub is the pad 2
203  wxString Line;
204  int pad_num = 1;
205 
206  while( aPadCount-- )
207  {
208  PAD* pad = new PAD( footprint );
209 
211 
212  int tw = editFrame.GetDesignSettings().GetCurrentTrackWidth();
213  pad->SetSize( wxSize( tw, tw ) );
214 
215  pad->SetPosition( footprint->GetPosition() );
216  pad->SetShape( PAD_SHAPE::RECT );
217  pad->SetAttribute( PAD_ATTRIB::SMD );
218  pad->SetLayerSet( F_Cu );
219 
220  Line.Printf( wxT( "%d" ), pad_num );
221  pad->SetName( Line );
222  pad_num++;
223  }
224 
225  return footprint;
226 }
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Returns the BOARD_DESIGN_SETTINGS for the open project.
Smd pad, appears on the solder paste layer (default)
void SetTextSize(const wxSize &aNewSize)
Definition: eda_text.h:237
FP_TEXT & Value()
read/write accessors:
Definition: footprint.h:457
FP_TEXT & Reference()
Definition: footprint.h:458
FOOTPRINT * footprint() const
FOOTPRINT * CreateNewFootprint(const wxString &aFootprintName)
Creates a new footprint, at position 0,0.
The main frame for Pcbnew.
wxPoint GetPosition() const override
Definition: footprint.h:177
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
Definition: eda_text.h:159
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT) override
Removes an item from the container.
Definition: footprint.cpp:472
Definition: pad.h:57

References FOOTPRINT::Add(), PCB_BASE_FRAME::CreateNewFootprint(), F_Cu, PCB_TOOL_BASE::footprint(), BOARD_DESIGN_SETTINGS::GetCurrentTrackWidth(), PCB_BASE_FRAME::GetDesignSettings(), FOOTPRINT::GetPosition(), INSERT, PAD, pad, RECT, FOOTPRINT::Reference(), EDA_TEXT::SetTextSize(), EDA_TEXT::SetTextThickness(), SMD, and FOOTPRINT::Value().

Referenced by createFootprint().

◆ createFootprint()

FOOTPRINT * MICROWAVE_TOOL::createFootprint ( MICROWAVE_FOOTPRINT_SHAPE  aFootprintShape)
private

Create a footprint "GAP" or "STUB" used in micro wave designs.

This footprint has 2 pads: PAD_ATTRIB::SMD, rectangular, H size = V size = current track width. the "gap" is isolation created between this 2 pads

Parameters
aComponentShapeis the component to create.
Returns
the new footprint.

Definition at line 34 of file microwave_footprint.cpp.

35 {
36  int oX;
37  PAD* pad;
39  wxString msg;
40  wxString cmp_name;
41  int pad_count = 2;
42  int angle = 0;
43 
44  PCB_EDIT_FRAME& editFrame = *getEditFrame<PCB_EDIT_FRAME>();
45 
46  // Ref and value text size (O = use board default value.
47  // will be set to a value depending on the footprint size, if possible
48  int text_size = 0;
49 
50  // Enter the size of the gap or stub
51  int gap_size = editFrame.GetDesignSettings().GetCurrentTrackWidth();
52 
53  switch( aFootprintShape )
54  {
56  msg = _( "Gap Size:" );
57  cmp_name = "muwave_gap";
58  text_size = gap_size;
59  break;
60 
62  msg = _( "Stub Size:" );
63  cmp_name = "muwave_stub";
64  text_size = gap_size;
65  pad_count = 2;
66  break;
67 
69  msg = _( "Arc Stub Radius Value:" );
70  cmp_name = "muwave_arcstub";
71  pad_count = 1;
72  break;
73 
74  default:
75  msg = wxT( "???" );
76  break;
77  }
78 
79  wxString value = StringFromValue( editFrame.GetUserUnits(), gap_size );
80  WX_TEXT_ENTRY_DIALOG dlg( &editFrame, msg, _( "Create microwave footprint" ), value );
81 
82  if( dlg.ShowQuasiModal() != wxID_OK )
83  return nullptr; // cancelled by user
84 
85  value = dlg.GetValue();
86  gap_size = ValueFromString( editFrame.GetUserUnits(), value );
87 
88  bool abort = false;
89 
90  if( aFootprintShape == MICROWAVE_FOOTPRINT_SHAPE::STUB_ARC )
91  {
92  double fcoeff = 10.0, fval;
93  msg.Printf( wxT( "%3.1f" ), angle / fcoeff );
94  WX_TEXT_ENTRY_DIALOG angledlg( &editFrame, _( "Angle in degrees:" ),
95  _( "Create microwave footprint" ), msg );
96 
97  if( angledlg.ShowQuasiModal() != wxID_OK )
98  return nullptr; // cancelled by user
99 
100  msg = angledlg.GetValue();
101 
102  if( !msg.ToDouble( &fval ) )
103  {
104  DisplayError( &editFrame, _( "Incorrect number, abort" ) );
105  abort = true;
106  }
107 
108  angle = std::abs( KiROUND( fval * fcoeff ) );
109 
110  if( angle > 1800 )
111  angle = 1800;
112  }
113 
114  if( abort )
115  return nullptr;
116 
117  footprint = createBaseFootprint( cmp_name, text_size, pad_count );
118  auto it = footprint->Pads().begin();
119  pad = *it;
120 
121  switch( aFootprintShape )
122  {
123  case MICROWAVE_FOOTPRINT_SHAPE::GAP: //Gap :
124  oX = -( gap_size + pad->GetSize().x ) / 2;
125  pad->SetX0( oX );
126 
127  pad->SetX( pad->GetPos0().x + pad->GetPosition().x );
128 
129  pad = *( it + 1 );
130 
131  pad->SetX0( oX + gap_size + pad->GetSize().x );
132  pad->SetX( pad->GetPos0().x + pad->GetPosition().x );
133  break;
134 
135  case MICROWAVE_FOOTPRINT_SHAPE::STUB: //Stub :
136  pad->SetName( wxT( "1" ) );
137  pad = *( it + 1 );
138  pad->SetY0( -( gap_size + pad->GetSize().y ) / 2 );
139  pad->SetSize( wxSize( pad->GetSize().x, gap_size ) );
140  pad->SetY( pad->GetPos0().y + pad->GetPosition().y );
141  break;
142 
143  case MICROWAVE_FOOTPRINT_SHAPE::STUB_ARC: // Arc Stub created by a polygonal approach:
144  {
145  pad->SetShape( PAD_SHAPE::CUSTOM );
146  pad->SetAnchorPadShape( PAD_SHAPE::RECT );
147 
148  int numPoints = ( angle / 50 ) + 3; // Note: angles are in 0.1 degrees
149  std::vector<wxPoint> polyPoints;
150  polyPoints.reserve( numPoints );
151 
152  polyPoints.emplace_back( wxPoint( 0, 0 ) );
153 
154  int theta = -angle / 2;
155 
156  for( int ii = 1; ii < numPoints - 1; ii++ )
157  {
158  wxPoint pt( 0, -gap_size );
159  RotatePoint( &pt.x, &pt.y, theta );
160  polyPoints.push_back( pt );
161 
162  theta += 50;
163 
164  if( theta > angle / 2 )
165  theta = angle / 2;
166  }
167 
168  // Close the polygon:
169  polyPoints.push_back( polyPoints[0] );
170 
171  pad->AddPrimitivePoly( polyPoints, 0, true ); // add a polygonal basic shape
172  break;
173  }
174 
175  default:
176  break;
177  }
178 
179  // Update the footprint and board
180  editFrame.OnModify();
181 
182  return footprint;
183 }
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:252
void OnModify() override
Must be called after a board change to set the modified flag.
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Returns the BOARD_DESIGN_SETTINGS for the open project.
A KICAD version of wxTextEntryDialog which supports the various improvements/work-arounds from DIALOG...
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:228
PADS & Pads()
Definition: footprint.h:159
long long int ValueFromString(EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType)
Function ValueFromString converts aTextValue in aUnits to internal units used by the application.
Definition: base_units.cpp:416
FOOTPRINT * footprint() const
#define _(s)
FOOTPRINT * createBaseFootprint(const wxString &aValue, int aTextSize, int aPadCount)
Create a basic footprint for micro wave applications.
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
The main frame for Pcbnew.
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:73
wxString StringFromValue(EDA_UNITS aUnits, double aValue, bool aAddUnitSymbol, EDA_DATA_TYPE aType)
Convert a value to a string using double notation.
Definition: base_units.cpp:204
Definition: pad.h:57
EDA_UNITS GetUserUnits() const
Return the user units currently in use.

References _, PNS::angle(), createBaseFootprint(), CUSTOM, DisplayError(), PCB_TOOL_BASE::footprint(), GAP, BOARD_DESIGN_SETTINGS::GetCurrentTrackWidth(), PCB_BASE_FRAME::GetDesignSettings(), EDA_BASE_FRAME::GetUserUnits(), WX_TEXT_ENTRY_DIALOG::GetValue(), KiROUND(), PCB_EDIT_FRAME::OnModify(), pad, FOOTPRINT::Pads(), RECT, RotatePoint(), DIALOG_SHIM::ShowQuasiModal(), StringFromValue(), STUB, STUB_ARC, and ValueFromString().

◆ createInductorBetween()

void MICROWAVE_TOOL::createInductorBetween ( const VECTOR2I aStart,
const VECTOR2I aEnd 
)
private

Draw a microwave inductor interactively.

Definition at line 292 of file microwave_inductor.cpp.

293 {
294  PCB_EDIT_FRAME& editFrame = *getEditFrame<PCB_EDIT_FRAME>();
295 
297 
299 
300  pattern.m_Start = { aStart.x, aStart.y };
301  pattern.m_End = { aEnd.x, aEnd.y };
302 
303  wxString errorMessage;
304 
305  auto inductorFP = std::unique_ptr<FOOTPRINT>( createMicrowaveInductor( pattern, errorMessage ) );
306 
307  // on any error, report if we can
308  if ( !inductorFP || !errorMessage.IsEmpty() )
309  {
310  if ( !errorMessage.IsEmpty() )
311  editFrame.ShowInfoBarError( errorMessage );
312  }
313  else
314  {
315  // at this point, we can save the footprint
316  m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, inductorFP.get() );
317 
318  BOARD_COMMIT commit( this );
319  commit.Add( inductorFP.release() );
320  commit.Push( _("Add microwave inductor" ) );
321  }
322 }
BOARD * board() const
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
FOOTPRINT * createMicrowaveInductor(MICROWAVE_INDUCTOR_PATTERN &aPattern, wxString &aErrorMessage)
Create an S-shaped coil footprint for microwave applications.
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:143
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:588
#define _(s)
static TOOL_ACTION selectItem
Select an item (specified as the event parameter).
Definition: pcb_actions.h:62
The main frame for Pcbnew.
void ShowInfoBarError(const wxString &aErrorMsg, bool aShowCloseButton=false)
Show the WX_INFOBAR displayed on the top of the canvas with a message and an error icon on the left o...
Parameters for construction of a microwave inductor.

References _, COMMIT::Add(), PCB_TOOL_BASE::board(), createMicrowaveInductor(), BOARD_DESIGN_SETTINGS::GetCurrentTrackWidth(), BOARD::GetDesignSettings(), MICROWAVE_INDUCTOR_PATTERN::m_End, MICROWAVE_INDUCTOR_PATTERN::m_Start, TOOL_BASE::m_toolMgr, MICROWAVE_INDUCTOR_PATTERN::m_Width, BOARD_COMMIT::Push(), TOOL_MANAGER::RunAction(), PCB_ACTIONS::selectItem, EDA_BASE_FRAME::ShowInfoBarError(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by drawMicrowaveInductor().

◆ createMicrowaveInductor()

FOOTPRINT * MICROWAVE_TOOL::createMicrowaveInductor ( MICROWAVE_INDUCTOR_PATTERN aPattern,
wxString &  aErrorMessage 
)
private

Create an S-shaped coil footprint for microwave applications.

Definition at line 325 of file microwave_inductor.cpp.

327 {
328  /* Build a microwave inductor footprint.
329  * - Length Mself.lng
330  * - Extremities Mself.m_Start and Mself.m_End
331  * We must determine:
332  * Mself.nbrin = number of segments perpendicular to the direction
333  * (The coil nbrin will demicercles + 1 + 2 1 / 4 circle)
334  * Mself.lbrin = length of a strand
335  * Mself.radius = radius of rounded parts of the coil
336  * Mself.delta = segments extremities connection between him and the coil even
337  *
338  * The equations are
339  * Mself.m_Size.x = 2 * Mself.radius + Mself.lbrin
340  * Mself.m_Size.y * Mself.delta = 2 + 2 * Mself.nbrin * Mself.radius
341  * Mself.lng = 2 * Mself.delta / / connections to the coil
342  + (Mself.nbrin-2) * Mself.lbrin / / length of the strands except 1st and last
343  + (Mself.nbrin 1) * (PI * Mself.radius) / / length of rounded
344  * Mself.lbrin + / 2 - Melf.radius * 2) / / length of 1st and last bit
345  *
346  * The constraints are:
347  * Nbrin >= 2
348  * Mself.radius < Mself.m_Size.x
349  * Mself.m_Size.y = Mself.radius * 4 + 2 * Mself.raccord
350  * Mself.lbrin> Mself.radius * 2
351  *
352  * The calculation is conducted in the following way:
353  * Initially:
354  * Nbrin = 2
355  * Radius = 4 * m_Size.x (arbitrarily fixed value)
356  * Then:
357  * Increasing the number of segments to the desired length
358  * (Radius decreases if necessary)
359  */
360 
361  PAD* pad;
362  wxString msg;
363 
364  PCB_EDIT_FRAME& editFrame = *getEditFrame<PCB_EDIT_FRAME>();
365 
366  auto pt = aInductorPattern.m_End - aInductorPattern.m_Start;
367  int min_len = KiROUND( EuclideanNorm( pt ) );
368  aInductorPattern.m_Length = min_len;
369 
370  // Enter the desired length.
371  msg = StringFromValue( editFrame.GetUserUnits(), aInductorPattern.m_Length );
372  WX_TEXT_ENTRY_DIALOG dlg( &editFrame, _( "Length of Trace:" ), wxEmptyString, msg );
373 
374  if( dlg.ShowQuasiModal() != wxID_OK )
375  return nullptr; // canceled by user
376 
377  msg = dlg.GetValue();
378  aInductorPattern.m_Length = ValueFromString( editFrame.GetUserUnits(), msg );
379 
380  // Control values (ii = minimum length)
381  if( aInductorPattern.m_Length < min_len )
382  {
383  aErrorMessage = _( "Requested length < minimum length" );
384  return nullptr;
385  }
386 
387  // Calculate the elements.
388  std::vector <wxPoint> buffer;
389  const INDUCTOR_S_SHAPE_RESULT res = BuildCornersList_S_Shape( buffer, aInductorPattern.m_Start,
390  aInductorPattern.m_End,
391  aInductorPattern.m_Length,
392  aInductorPattern.m_Width );
393 
394  switch( res )
395  {
397  aErrorMessage = _( "Requested length too large" );
398  return nullptr;
400  aErrorMessage = _( "Requested length too small" );
401  return nullptr;
403  aErrorMessage = _( "Requested length can't be represented" );
404  return nullptr;
406  break;
407  }
408 
409  // Generate footprint. the value is also used as footprint name.
410  msg = "L";
411  WX_TEXT_ENTRY_DIALOG cmpdlg( &editFrame, _( "Component Value:" ), wxEmptyString, msg );
412  cmpdlg.SetTextValidator( FOOTPRINT_NAME_VALIDATOR( &msg ) );
413 
414  if( ( cmpdlg.ShowQuasiModal() != wxID_OK ) || msg.IsEmpty() )
415  return nullptr; // Aborted by user
416 
417  FOOTPRINT* footprint = editFrame.CreateNewFootprint( msg );
418 
419  footprint->SetFPID( LIB_ID( wxEmptyString, wxT( "mw_inductor" ) ) );
422  footprint->SetPosition( aInductorPattern.m_End );
423 
424  // Generate segments
425  for( unsigned jj = 1; jj < buffer.size(); jj++ )
426  {
427  FP_SHAPE* seg;
428  seg = new FP_SHAPE( footprint );
429  seg->SetStart( buffer[jj - 1] );
430  seg->SetEnd( buffer[jj] );
431  seg->SetWidth( aInductorPattern.m_Width );
432  seg->SetLayer( footprint->GetLayer() );
433  seg->SetShape( SHAPE_T::SEGMENT );
434  seg->SetStart0( seg->GetStart() - footprint->GetPosition() );
435  seg->SetEnd0( seg->GetEnd() - footprint->GetPosition() );
436  footprint->Add( seg );
437  }
438 
439  // Place a pad on each end of coil.
440  pad = new PAD( footprint );
441 
442  footprint->Add( pad );
443 
444  pad->SetName( "1" );
445  pad->SetPosition( aInductorPattern.m_End );
446  pad->SetPos0( pad->GetPosition() - footprint->GetPosition() );
447 
448  pad->SetSize( wxSize( aInductorPattern.m_Width, aInductorPattern.m_Width ) );
449 
450  pad->SetLayerSet( LSET( footprint->GetLayer() ) );
451  pad->SetAttribute( PAD_ATTRIB::SMD );
452  pad->SetShape( PAD_SHAPE::CIRCLE );
453 
454  PAD* newpad = new PAD( *pad );
455  const_cast<KIID&>( newpad->m_Uuid ) = KIID();
456 
457  footprint->Add( newpad );
458 
459  pad = newpad;
460  pad->SetName( "2" );
461  pad->SetPosition( aInductorPattern.m_Start );
462  pad->SetPos0( pad->GetPosition() - footprint->GetPosition() );
463 
464  // Modify text positions.
465  wxPoint refPos( ( aInductorPattern.m_Start.x + aInductorPattern.m_End.x ) / 2,
466  ( aInductorPattern.m_Start.y + aInductorPattern.m_End.y ) / 2 );
467 
468  wxPoint valPos = refPos;
469 
470  refPos.y -= footprint->Reference().GetTextSize().y;
471  footprint->Reference().SetPosition( refPos );
472  valPos.y += footprint->Value().GetTextSize().y;
473  footprint->Value().SetPosition( valPos );
474 
475  return footprint;
476 }
double EuclideanNorm(const wxPoint &vector)
Euclidean norm of a 2D vector.
Definition: trigo.h:148
void SetEnd0(const wxPoint &aPoint)
Definition: fp_shape.h:114
virtual void SetPosition(const wxPoint &aPos) override
Definition: fp_text.h:93
void SetShape(SHAPE_T aShape)
Definition: pcb_shape.h:109
const wxPoint & GetEnd() const
Return the ending point of the graphic.
Definition: pcb_shape.h:134
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Definition: board_item.h:192
A KICAD version of wxTextEntryDialog which supports the various improvements/work-arounds from DIALOG...
Smd pad, appears on the solder paste layer (default)
usual segment : line with rounded ends
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
void SetAttributes(int aAttributes)
Definition: footprint.h:227
FP_TEXT & Value()
read/write accessors:
Definition: footprint.h:457
This class provides a custom wxValidator object for limiting the allowable characters when defining f...
Definition: validators.h:63
FP_TEXT & Reference()
Definition: footprint.h:458
static INDUCTOR_S_SHAPE_RESULT BuildCornersList_S_Shape(std::vector< wxPoint > &aBuffer, const wxPoint &aStartPoint, const wxPoint &aEndPoint, int aLength, int aWidth)
Function BuildCornersList_S_Shape Create a path like a S-shaped coil.
Definition: kiid.h:44
INDUCTOR_S_SHAPE_RESULT
LSET is a set of PCB_LAYER_IDs.
long long int ValueFromString(EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType)
Function ValueFromString converts aTextValue in aUnits to internal units used by the application.
Definition: base_units.cpp:416
const wxSize & GetTextSize() const
Definition: eda_text.h:238
const wxPoint & GetStart() const
Return the starting point of the graphic.
Definition: pcb_shape.h:124
FOOTPRINT * footprint() const
#define _(s)
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: eda_item.h:154
void SetStart0(const wxPoint &aPoint)
Definition: fp_shape.h:111
const KIID m_Uuid
Definition: eda_item.h:475
FOOTPRINT * CreateNewFootprint(const wxString &aFootprintName)
Creates a new footprint, at position 0,0.
void SetFPID(const LIB_ID &aFPID)
Definition: footprint.h:186
void SetStart(const wxPoint &aStart)
Definition: pcb_shape.h:127
The main frame for Pcbnew.
void SetWidth(int aWidth)
Definition: pcb_shape.h:96
Requested length too short.
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:73
wxPoint GetPosition() const override
Definition: footprint.h:177
wxString StringFromValue(EDA_UNITS aUnits, double aValue, bool aAddUnitSymbol, EDA_DATA_TYPE aType)
Convert a value to a string using double notation.
Definition: base_units.cpp:204
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT) override
Removes an item from the container.
Definition: footprint.cpp:472
Definition: pad.h:57
void SetPosition(const wxPoint &aPos) override
Definition: footprint.cpp:1452
Requested length too long.
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:171
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
void SetEnd(const wxPoint &aEnd)
Definition: pcb_shape.h:137

References _, FOOTPRINT::Add(), BuildCornersList_S_Shape(), CIRCLE, EDA_ITEM::ClearFlags(), PCB_BASE_FRAME::CreateNewFootprint(), EuclideanNorm(), PCB_TOOL_BASE::footprint(), FP_EXCLUDE_FROM_BOM, FP_EXCLUDE_FROM_POS_FILES, PCB_SHAPE::GetEnd(), BOARD_ITEM::GetLayer(), FOOTPRINT::GetPosition(), PCB_SHAPE::GetStart(), EDA_TEXT::GetTextSize(), EDA_BASE_FRAME::GetUserUnits(), KiROUND(), MICROWAVE_INDUCTOR_PATTERN::m_End, MICROWAVE_INDUCTOR_PATTERN::m_Length, MICROWAVE_INDUCTOR_PATTERN::m_Start, EDA_ITEM::m_Uuid, MICROWAVE_INDUCTOR_PATTERN::m_Width, NO_REPR, OK, PAD, pad, FOOTPRINT::Reference(), SEGMENT, FOOTPRINT::SetAttributes(), PCB_SHAPE::SetEnd(), FP_SHAPE::SetEnd0(), FOOTPRINT::SetFPID(), BOARD_ITEM::SetLayer(), FP_TEXT::SetPosition(), FOOTPRINT::SetPosition(), PCB_SHAPE::SetShape(), PCB_SHAPE::SetStart(), FP_SHAPE::SetStart0(), WX_TEXT_ENTRY_DIALOG::SetTextValidator(), PCB_SHAPE::SetWidth(), DIALOG_SHIM::ShowQuasiModal(), SMD, StringFromValue(), TOO_LONG, TOO_SHORT, FOOTPRINT::Value(), and ValueFromString().

Referenced by createInductorBetween().

◆ createPolygonShape()

FOOTPRINT * MICROWAVE_TOOL::createPolygonShape ( )
private

Definition at line 250 of file microwave_polygon.cpp.

251 {
252  PAD* pad1;
253  PAD* pad2;
255  wxString cmp_name;
256  int pad_count = 2;
257  FP_SHAPE* shape;
258 
259  PCB_EDIT_FRAME& editFrame = *getEditFrame<PCB_EDIT_FRAME>();
260 
261  MWAVE_POLYGONAL_SHAPE_DLG dlg( &editFrame, wxDefaultPosition );
262 
263  int ret = dlg.ShowModal();
264 
265  if( ret != wxID_OK )
266  {
267  PolyEdges.clear();
268  return nullptr;
269  }
270 
271  if( PolyShapeType == 2 ) // mirrored
273 
276 
277  if( ( ShapeSize.x ) == 0 || ( ShapeSize.y == 0 ) )
278  {
279  editFrame.ShowInfoBarError( _( "Shape has a null size." ) );
280  return nullptr;
281  }
282 
283  if( PolyEdges.size() == 0 )
284  {
285  editFrame.ShowInfoBarError( _( "Shape has no points." ) );
286  return nullptr;
287  }
288 
289  cmp_name = wxT( "muwave_polygon" );
290 
291  // Create a footprint with 2 pads, orientation = 0, pos 0
292  footprint = createBaseFootprint( cmp_name, 0, pad_count );
293 
294  // We try to place the footprint anchor to the middle of the shape len
295  wxPoint offset;
296  offset.x = -ShapeSize.x / 2;
297 
298  auto it = footprint->Pads().begin();
299 
300  pad1 = *it;
301  pad1->SetX0( offset.x );
302  pad1->SetX( pad1->GetPos0().x );
303 
304  pad2 = *( ++it );
305  pad2->SetX0( offset.x + ShapeSize.x );
306  pad2->SetX( pad2->GetPos0().x );
307 
308  // Add a polygonal edge (corners will be added later) on copper layer
309  shape = new FP_SHAPE( footprint );
310  shape->SetShape( SHAPE_T::POLY );
311  shape->SetFilled( true );
312  shape->SetLayer( F_Cu );
313 
314  footprint->Add( shape, ADD_MODE::INSERT );
315 
316  // Get the corner buffer of the polygonal edge
317  std::vector<wxPoint> polyPoints;
318  polyPoints.reserve( PolyEdges.size() + 2 );
319 
320  // Init start point coord:
321  polyPoints.emplace_back( wxPoint( offset.x, 0 ) );
322 
323  wxPoint last_coordinate;
324 
325  for( wxRealPoint& pt: PolyEdges ) // Copy points
326  {
327  last_coordinate.x = KiROUND( pt.x * ShapeScaleX );
328  last_coordinate.y = -KiROUND( pt.y * ShapeScaleY );
329  last_coordinate += offset;
330  polyPoints.push_back( last_coordinate );
331  }
332 
333  // finish the polygonal shape
334  if( last_coordinate.y != 0 )
335  polyPoints.emplace_back( wxPoint( last_coordinate.x, 0 ) );
336 
337  switch( PolyShapeType )
338  {
339  case 0: // shape from file
340  case 2: // shape from file, mirrored (the mirror is already done)
341  break;
342 
343  case 1: // Symmetric shape: add the symmetric (mirrored) shape
344  for( int ndx = (int) polyPoints.size() - 1; ndx >= 0; --ndx )
345  {
346  wxPoint pt = polyPoints[ndx];
347  pt.y = -pt.y; // mirror about X axis
348  polyPoints.push_back( pt );
349  }
350 
351  break;
352  }
353 
354  shape->SetPolyPoints( polyPoints );
355 
356  // Set the polygon outline thickness to 0, only the polygonal shape is filled
357  // without extra thickness.
358  shape->SetWidth( 0 );
359  PolyEdges.clear();
360 
361  editFrame.OnModify();
362  return footprint;
363 }
void OnModify() override
Must be called after a board change to set the modified flag.
void SetShape(SHAPE_T aShape)
Definition: pcb_shape.h:109
polygon (not yet used for tracks, but could be in microwave apps)
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Definition: board_item.h:192
void SetFilled(bool aFlag)
Definition: pcb_shape.h:73
PADS & Pads()
Definition: footprint.h:159
FOOTPRINT * footprint() const
#define _(s)
void SetX0(int x)
Definition: pad.h:226
static double ShapeScaleY
static int PolyShapeType
const wxPoint & GetPos0() const
Definition: pad.h:223
FOOTPRINT * createBaseFootprint(const wxString &aValue, int aTextSize, int aPadCount)
Create a basic footprint for micro wave applications.
static std::vector< wxRealPoint > PolyEdges
The main frame for Pcbnew.
void SetWidth(int aWidth)
Definition: pcb_shape.h:96
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:73
void ShowInfoBarError(const wxString &aErrorMsg, bool aShowCloseButton=false)
Show the WX_INFOBAR displayed on the top of the canvas with a message and an error icon on the left o...
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT) override
Removes an item from the container.
Definition: footprint.cpp:472
Definition: pad.h:57
void SetPolyPoints(const std::vector< wxPoint > &aPoints)
Definition: pcb_shape.cpp:1153
static double ShapeScaleX
static wxSize ShapeSize
void SetX(int x)
Definition: pad.h:220

References _, FOOTPRINT::Add(), F_Cu, PAD::GetPos0(), INSERT, KiROUND(), PCB_EDIT_FRAME::OnModify(), FOOTPRINT::Pads(), POLY, PolyEdges, PolyShapeType, PCB_SHAPE::SetFilled(), BOARD_ITEM::SetLayer(), PCB_SHAPE::SetPolyPoints(), PCB_SHAPE::SetShape(), PCB_SHAPE::SetWidth(), PAD::SetX(), PAD::SetX0(), ShapeScaleX, ShapeScaleY, ShapeSize, and EDA_BASE_FRAME::ShowInfoBarError().

◆ displayOptions()

const PCB_DISPLAY_OPTIONS & PCB_TOOL_BASE::displayOptions ( ) const
protectedinherited

Definition at line 294 of file pcb_tool_base.cpp.

295 {
296  return frame()->GetDisplayOptions();
297 }
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
PCB_BASE_EDIT_FRAME * frame() const

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

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

◆ 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 35 of file pcb_tool_base.cpp.

38 {
39  using namespace std::placeholders;
40  std::unique_ptr<BOARD_ITEM> newItem;
41 
42  frame()->PushTool( aTool );
43  Activate();
44 
45  BOARD_COMMIT commit( frame() );
46 
48 
49  // do not capture or auto-pan until we start placing an item
50  controls()->ShowCursor( true );
51 
52  // Add a VIEW_GROUP that serves as a preview for the new item
53  PCB_SELECTION preview;
54  view()->Add( &preview );
55 
56  aPlacer->m_board = board();
57  aPlacer->m_frame = frame();
58  aPlacer->m_modifiers = 0;
59 
60  auto makeNewItem =
61  [&]( VECTOR2I aPosition )
62  {
63  if( frame()->GetModel() )
64  newItem = aPlacer->CreateItem();
65 
66  if( newItem )
67  {
68  newItem->SetPosition( (wxPoint) aPosition );
69  preview.Add( newItem.get() );
70 
71  if( newItem->Type() == PCB_FOOTPRINT_T )
72  {
73  FOOTPRINT* fp = dyn_cast<FOOTPRINT*>( newItem.get() );
74 
75  // footprints have more drawable parts
76  fp->RunOnChildren( std::bind( &KIGFX::VIEW_GROUP::Add, &preview, _1 ) );
77  }
78  }
79  };
80 
81  if( aOptions & IPO_SINGLE_CLICK )
82  makeNewItem( controls()->GetCursorPosition() );
83 
84  auto setCursor =
85  [&]()
86  {
87  if( !newItem )
89  else
91  };
92 
93  // Set initial cursor
94  setCursor();
95 
96  // Main loop: keep receiving events
97  while( TOOL_EVENT* evt = Wait() )
98  {
99  setCursor();
100 
101  VECTOR2I cursorPos = controls()->GetCursorPosition();
102  aPlacer->m_modifiers = evt->Modifier();
103 
104  auto cleanup =
105  [&] ()
106  {
107  newItem = nullptr;
108  preview.Clear();
109  view()->Update( &preview );
110  controls()->SetAutoPan( false );
111  controls()->CaptureCursor( false );
112  controls()->ShowCursor( true );
113  };
114 
115  if( evt->IsCancelInteractive() )
116  {
117  if( aOptions & IPO_SINGLE_CLICK )
118  {
119  cleanup();
120  frame()->PopTool( aTool );
121  break;
122  }
123  else if( newItem )
124  {
125  cleanup();
126  }
127  else
128  {
129  frame()->PopTool( aTool );
130  break;
131  }
132  }
133  else if( evt->IsActivate() )
134  {
135  if( newItem )
136  cleanup();
137 
138  if( evt->IsPointEditor() )
139  {
140  // don't exit (the point editor runs in the background)
141  }
142  else if( evt->IsMoveTool() )
143  {
144  // leave ourselves on the stack so we come back after the move
145  break;
146  }
147  else
148  {
149  frame()->PopTool( aTool );
150  break;
151  }
152  }
153  else if( evt->IsClick( BUT_LEFT ) || evt->IsDblClick( BUT_LEFT ) )
154  {
155  if( !newItem )
156  {
157  // create the item if possible
158  makeNewItem( cursorPos );
159 
160  // no item created, so wait for another click
161  if( !newItem )
162  continue;
163 
164  controls()->CaptureCursor( true );
165  controls()->SetAutoPan( true );
166  }
167  else
168  {
169  auto oldFlags = newItem->GetFlags();
170  newItem->ClearFlags();
171 
172  if( !aPlacer->PlaceItem( newItem.get(), commit ) )
173  {
174  newItem->SetFlags( oldFlags );
175  continue;
176  }
177 
178  preview.Clear();
179  newItem.release();
180  commit.Push( aCommitMessage );
181 
182  controls()->CaptureCursor( false );
183  controls()->SetAutoPan( false );
184  controls()->ShowCursor( true );
185 
186  if( !( aOptions & IPO_REPEAT ) )
187  break;
188 
189  if( aOptions & IPO_SINGLE_CLICK )
190  makeNewItem( controls()->GetCursorPosition() );
191 
192  setCursor();
193  }
194  }
195  else if( evt->IsClick( BUT_RIGHT ) )
196  {
198  }
199  else if( evt->IsAction( &PCB_ACTIONS::trackViaSizeChanged ) )
200  {
202  }
203  else if( newItem && evt->Category() == TC_COMMAND )
204  {
205  /*
206  * Handle any events that can affect the item as we move it around
207  */
208  if( TOOL_EVT_UTILS::IsRotateToolEvt( *evt ) && ( aOptions & IPO_ROTATE ) )
209  {
210  const int rotationAngle = TOOL_EVT_UTILS::GetEventRotationAngle( *frame(), *evt );
211  newItem->Rotate( newItem->GetPosition(), rotationAngle );
212  view()->Update( &preview );
213  }
214  else if( evt->IsAction( &PCB_ACTIONS::flip ) && ( aOptions & IPO_FLIP ) )
215  {
216  newItem->Flip( newItem->GetPosition(), frame()->Settings().m_FlipLeftRight );
217  view()->Update( &preview );
218  }
219  else if( evt->IsAction( &PCB_ACTIONS::viaSizeInc )
220  || evt->IsAction( &PCB_ACTIONS::viaSizeDec ) )
221  {
222  // Refresh preview after event runs
224  }
225  else if( evt->IsAction( &PCB_ACTIONS::properties ) )
226  {
227  frame()->OnEditItemRequest( newItem.get() );
228 
229  // Notify other tools of the changes
231  }
232  else if( evt->IsAction( &ACTIONS::refreshPreview ) )
233  {
234  preview.Clear();
235  newItem.release();
236 
237  makeNewItem( (wxPoint) cursorPos );
238  aPlacer->SnapItem( newItem.get() );
239  view()->Update( &preview );
240  }
241  else
242  {
243  evt->SetPassEvent();
244  }
245  }
246  else if( newItem && evt->IsMotion() )
247  {
248  // track the cursor
249  newItem->SetPosition( (wxPoint) cursorPos );
250  aPlacer->SnapItem( newItem.get() );
251 
252  // Show a preview of the item
253  view()->Update( &preview );
254  }
255  else
256  {
257  evt->SetPassEvent();
258  }
259  }
260 
261  view()->Remove( &preview );
263  controls()->SetAutoPan( false );
264  controls()->CaptureCursor( false );
265 }
static TOOL_ACTION selectionClear
Clear the current selection.
Definition: pcb_actions.h:59
virtual void ShowCursor(bool aEnabled)
Enable or disables display of cursor.
TOOL_MENU m_menu
The functions below are not yet implemented - their interface may change.
virtual void Clear() override
Remove all the stored items from the group.
Definition: selection.h:82
void SetCurrentCursor(KICURSOR aCursor)
Set the current cursor shape for this panel.
TOOL_EVENT * Wait(const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
Suspend execution of the tool until an event specified in aEventList arrives.
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
virtual void Add(EDA_ITEM *aItem)
Definition: selection.cpp:31
static TOOL_ACTION viaSizeInc
Definition: pcb_actions.h:299
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:214
virtual void OnEditItemRequest(BOARD_ITEM *aItem)=0
Install the corresponding dialog editor for the given item.
virtual void PushTool(const std::string &actionName)
NB: the definition of "tool" is different at the user level.
static TOOL_ACTION properties
Activation of the edit tool.
Definition: pcb_actions.h:117
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:143
static TOOL_ACTION trackViaSizeChanged
Definition: pcb_actions.h:302
bool IsRotateToolEvt(const TOOL_EVENT &aEvt)
Function isRotateToolEvt()
virtual void Remove(VIEW_ITEM *aItem) override
Remove a VIEW_ITEM from the view.
Definition: pcb_view.cpp:75
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
Definition: actions.h:204
TOOL_MANAGER * GetManager() const
Return 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, inform the associated VIEW that the graphical representation of this item has chan...
Definition: pcb_view.cpp:92
const PCB_SELECTION & selection() const
Allow repeat placement of the item.
bool ProcessEvent(const TOOL_EVENT &aEvent)
Propagate an event to tools that requested events of matching type(s).
virtual void PopTool(const std::string &actionName)
virtual void CaptureCursor(bool aEnabled)
Force the cursor to stay within the drawing panel area.
Generic, UI-independent tool event.
Definition: tool_event.h:152
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)
Add an item to the group.
Definition: view_group.cpp:56
virtual void SetAutoPan(bool aEnabled)
Turn on/off auto panning (this feature is used when there is a tool active (eg.
class FOOTPRINT, a footprint
Definition: typeinfo.h:88
virtual BOARD_ITEM_CONTAINER * GetModel() const =0
static TOOL_ACTION flip
Flipping of selected objects.
Definition: pcb_actions.h:105
Handle the rotate action in the loop by calling the item's rotate method.
KIGFX::VIEW_CONTROLS * controls() const
PCBNEW_SETTINGS & Settings()
void Activate()
Run the tool.
void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction) const
Invoke a function on all BOARD_ITEMs that belong to the footprint (pads, drawings,...
Definition: footprint.cpp:1189
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1) override
Add a VIEW_ITEM to the view.
Definition: pcb_view.cpp:58
PCB_BASE_EDIT_FRAME * m_frame
Definition: pcb_tool_base.h:64
int GetEventRotationAngle(const PCB_BASE_EDIT_FRAME &aFrame, const TOOL_EVENT &aEvt)
Function getEventRotationAngle()
void ShowContextMenu(SELECTION &aSelection)
Helper function to set and immediately show a CONDITIONAL_MENU in concert with the given SELECTION.
Definition: tool_menu.cpp:59
static TOOL_ACTION viaSizeDec
Definition: pcb_actions.h:300
static TOOL_ACTION refreshPreview
Definition: actions.h:106
VECTOR2D GetCursorPosition() const
Return 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_BASE_EDIT_FRAME::OnEditItemRequest(), PCB_FOOTPRINT_T, PENCIL, PLACE, INTERACTIVE_PLACER_BASE::PlaceItem(), TOOLS_HOLDER::PopTool(), TOOL_MANAGER::ProcessEvent(), PCB_ACTIONS::properties, BOARD_COMMIT::Push(), TOOLS_HOLDER::PushTool(), ACTIONS::refreshPreview, KIGFX::PCB_VIEW::Remove(), TOOL_MANAGER::RunAction(), FOOTPRINT::RunOnChildren(), EVENTS::SelectedItemsModified, 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 addMicrowaveFootprint(), DRAWING_TOOL::DrawVia(), and PAD_TOOL::PlacePad().

◆ drawMicrowaveInductor()

int MICROWAVE_TOOL::drawMicrowaveInductor ( const TOOL_EVENT aEvent)
private

Definition at line 109 of file microwave_tool.cpp.

110 {
111  using namespace KIGFX::PREVIEW;
112 
113  KIGFX::VIEW& view = *getView();
115  PCB_EDIT_FRAME& frame = *getEditFrame<PCB_EDIT_FRAME>();
116 
117  std::string tool = aEvent.GetCommandStr().get();
118  frame.PushTool( tool );
119  Activate();
120 
121  TWO_POINT_GEOMETRY_MANAGER tpGeomMgr;
122 
123  CENTRELINE_RECT_ITEM previewRect( tpGeomMgr, inductorAreaAspect );
124 
125  previewRect.SetFillColor( inductorAreaFill );
126  previewRect.SetStrokeColor( inductorAreaStroke );
127  previewRect.SetLineWidth( inductorAreaStrokeWidth );
128 
129  bool originSet = false;
130 
131  controls.ShowCursor( true );
132  controls.CaptureCursor( false );
133  controls.SetAutoPan( false );
134 
135  view.Add( &previewRect );
136 
137  auto setCursor =
138  [&]()
139  {
141  };
142 
143  // Set initial cursor
144  setCursor();
145 
146  while( auto evt = Wait() )
147  {
148  setCursor();
149  VECTOR2I cursorPos = controls.GetCursorPosition();
150 
151  auto cleanup =
152  [&] ()
153  {
154  originSet = false;
155  controls.CaptureCursor( false );
156  controls.SetAutoPan( false );
157  view.SetVisible( &previewRect, false );
158  view.Update( &previewRect, KIGFX::GEOMETRY );
159  };
160 
161  if( evt->IsCancelInteractive() )
162  {
163  if( originSet )
164  cleanup();
165  else
166  {
167  frame.PopTool( tool );
168  break;
169  }
170  }
171  else if( evt->IsActivate() )
172  {
173  if( originSet )
174  cleanup();
175 
176  if( evt->IsMoveTool() )
177  {
178  // leave ourselves on the stack so we come back after the move
179  break;
180  }
181  else
182  {
183  frame.PopTool( tool );
184  break;
185  }
186  }
187  // A click or drag starts
188  else if( !originSet && ( evt->IsClick( BUT_LEFT ) || evt->IsDrag( BUT_LEFT ) ) )
189  {
190  tpGeomMgr.SetOrigin( cursorPos );
191  tpGeomMgr.SetEnd( cursorPos );
192 
193  originSet = true;
194  controls.CaptureCursor( true );
195  controls.SetAutoPan( true );
196  }
197  // another click after origin set is the end
198  // left up is also the end, as you'll only get that after a drag
199  else if( originSet && ( evt->IsClick( BUT_LEFT ) || evt->IsMouseUp( BUT_LEFT ) ) )
200  {
201  // second click, we're done:
202  // delegate to the point-to-point inductor creator function
203  createInductorBetween( tpGeomMgr.GetOrigin(), tpGeomMgr.GetEnd() );
204 
205  // start again if needed
206  originSet = false;
207  controls.CaptureCursor( false );
208  controls.SetAutoPan( false );
209 
210  view.SetVisible( &previewRect, false );
211  view.Update( &previewRect, KIGFX::GEOMETRY );
212  }
213  // any move or drag once the origin was set updates
214  // the end point
215  else if( originSet && ( evt->IsMotion() || evt->IsDrag( BUT_LEFT ) ) )
216  {
217  tpGeomMgr.SetAngleSnap( evt->Modifier( MD_SHIFT ) );
218  tpGeomMgr.SetEnd( cursorPos );
219 
220  view.SetVisible( &previewRect, true );
221  view.Update( &previewRect, KIGFX::GEOMETRY );
222  }
223  else if( evt->IsClick( BUT_RIGHT ) )
224  {
226  }
227  else
228  {
229  evt->SetPassEvent();
230  }
231  }
232 
233  view.Remove( &previewRect );
234 
236  controls.CaptureCursor( false );
237  controls.SetAutoPan( false );
238  return 0;
239 }
virtual void ShowCursor(bool aEnabled)
Enable or disables display of cursor.
static const double inductorAreaStrokeWidth
Aspect of the preview rectangle - this is hardcoded in the microwave backend for now.
Represent an area drawn by drawing a rectangle of a given aspect along a vector, with the midpoint of...
TOOL_MENU m_menu
The functions below are not yet implemented - their interface may change.
void SetCurrentCursor(KICURSOR aCursor)
Set the current cursor shape for this panel.
TOOL_EVENT * Wait(const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
Suspend execution of the tool until an event specified in aEventList arrives.
static const double inductorAreaAspect
Represent a very simple geometry manager for items that have a start and end point.
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
virtual void PushTool(const std::string &actionName)
NB: the definition of "tool" is different at the user level.
static const COLOR4D inductorAreaFill(0.3, 0.3, 0.5, 0.3)
virtual void Remove(VIEW_ITEM *aItem) override
Remove a VIEW_ITEM from the view.
Definition: pcb_view.cpp:75
PCB_BASE_EDIT_FRAME * frame() const
void createInductorBetween(const VECTOR2I &aStart, const VECTOR2I &aEnd)
Draw a microwave inductor interactively.
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const override
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
Definition: pcb_view.cpp:92
static const COLOR4D inductorAreaStroke(0.4, 1.0, 1.0, 1.0)
const PCB_SELECTION & selection() const
virtual void PopTool(const std::string &actionName)
virtual void CaptureCursor(bool aEnabled)
Force the cursor to stay within the drawing panel area.
void SetOrigin(const VECTOR2I &aOrigin)
< Set the origin of the ruler (the fixed end)
KIGFX::PCB_VIEW * view() const
An interface for classes handling user events controlling the view behavior such as zooming,...
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition: tool_base.cpp:36
virtual void SetAutoPan(bool aEnabled)
Turn on/off auto panning (this feature is used when there is a tool active (eg.
OPT< std::string > GetCommandStr() const
Definition: tool_event.h:455
KIGFX::VIEW_CONTROLS * controls() const
The main frame for Pcbnew.
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Set the item visibility.
Definition: view.cpp:1449
void Activate()
Run the tool.
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1) override
Add a VIEW_ITEM to the view.
Definition: pcb_view.cpp:58
KIGFX::VIEW_CONTROLS * getViewControls() const
Return the instance of VIEW_CONTROLS object used in the application.
Definition: tool_base.cpp:42
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:67
void ShowContextMenu(SELECTION &aSelection)
Helper function to set and immediately show a CONDITIONAL_MENU in concert with the given SELECTION.
Definition: tool_menu.cpp:59
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
void SetEnd(const VECTOR2I &aEnd)
Set the current end of the rectangle (the end that moves with the cursor.
Position or shape has changed.
Definition: view_item.h:54

References TOOL_INTERACTIVE::Activate(), KIGFX::PCB_VIEW::Add(), ARROW, BUT_LEFT, BUT_RIGHT, KIGFX::VIEW_CONTROLS::CaptureCursor(), PCB_TOOL_BASE::controls(), createInductorBetween(), PCB_TOOL_BASE::frame(), KIGFX::GEOMETRY, PCB_BASE_FRAME::GetCanvas(), TOOL_EVENT::GetCommandStr(), KIGFX::VIEW_CONTROLS::GetCursorPosition(), KIGFX::PREVIEW::TWO_POINT_GEOMETRY_MANAGER::GetEnd(), KIGFX::PREVIEW::TWO_POINT_GEOMETRY_MANAGER::GetOrigin(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), inductorAreaAspect, inductorAreaFill, inductorAreaStroke, inductorAreaStrokeWidth, TOOL_INTERACTIVE::m_menu, MD_SHIFT, PENCIL, TOOLS_HOLDER::PopTool(), TOOLS_HOLDER::PushTool(), KIGFX::PCB_VIEW::Remove(), PCB_TOOL_BASE::selection(), KIGFX::PREVIEW::TWO_POINT_GEOMETRY_MANAGER::SetAngleSnap(), KIGFX::VIEW_CONTROLS::SetAutoPan(), EDA_DRAW_PANEL_GAL::SetCurrentCursor(), KIGFX::PREVIEW::TWO_POINT_GEOMETRY_MANAGER::SetEnd(), KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM::SetFillColor(), KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM::SetLineWidth(), KIGFX::PREVIEW::TWO_POINT_GEOMETRY_MANAGER::SetOrigin(), KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM::SetStrokeColor(), KIGFX::VIEW::SetVisible(), TOOL_MENU::ShowContextMenu(), KIGFX::VIEW_CONTROLS::ShowCursor(), KIGFX::PCB_VIEW::Update(), PCB_TOOL_BASE::view(), and TOOL_INTERACTIVE::Wait().

Referenced by setTransitions().

◆ footprint()

◆ frame()

PCB_BASE_EDIT_FRAME* PCB_TOOL_BASE::frame ( ) const
inlineprotectedinherited

Definition at line 154 of file pcb_tool_base.h.

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

Referenced by PCB_POINT_EDITOR::addCorner(), AUTOPLACE_TOOL::autoplace(), PCB_TOOL_BASE::canvas(), ZONE_FILLER_TOOL::CheckAllZones(), PNS::TOOL_BASE::checkSnap(), PAD_TOOL::copyPadSettings(), EDIT_TOOL::copyToClipboard(), BOARD_INSPECTION_TOOL::CrossProbePcbToSch(), ROUTER_TOOL::CustomTrackWidthDialog(), FOOTPRINT_EDITOR_CONTROL::DeleteFootprint(), PCB_TOOL_BASE::displayOptions(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), ROUTER_TOOL::DpDimensionsDialog(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), DRAWING_TOOL::DrawVia(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EditPad(), PAD_TOOL::EnumeratePads(), PAD_TOOL::explodePad(), BOARD_EDITOR_CONTROL::ExportSpecctraDSN(), ZONE_FILLER_TOOL::FillAllZones(), EDIT_TOOL::FilletTracks(), ROUTER_TOOL::finishInteractive(), EDIT_TOOL::Flip(), PCB_CONTROL::FlipPcbView(), GLOBAL_EDIT_TOOL::GlobalDeletions(), ROUTER_TOOL::handleLayerSwitch(), BOARD_INSPECTION_TOOL::HighlightItem(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), BOARD_EDITOR_CONTROL::ImportSpecctraSession(), ROUTER_TOOL::Init(), SCRIPTING_TOOL::Init(), PCB_SELECTION_TOOL::Init(), EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::InteractivePlaceWithPreview(), PCB_PICKER_TOOL::Main(), PCB_SELECTION_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::meanderSettingsDialog(), EDIT_TOOL::MoveExact(), PCB_POINT_EDITOR::OnSelectionChange(), PCB_CONTROL::Paste(), PAD_TOOL::pastePadProperties(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), GROUP_TOOL::PickNewMember(), PCB_CONTROL::placeBoardItems(), BOARD_EDITOR_CONTROL::PlaceFootprint(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), ROUTER_TOOL::prepareInteractive(), PAD_TOOL::pushPadSettings(), PAD_TOOL::recombinePad(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), SCRIPTING_TOOL::reloadPlugins(), PCB_POINT_EDITOR::removeCorner(), PCB_SELECTION_TOOL::RequestSelection(), PNS::TOOL_BASE::Reset(), ROUTER_TOOL::SelectCopperLayerPair(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), PCB_POINT_EDITOR::setEditedPoint(), ROUTER_TOOL::SettingsDialog(), GLOBAL_EDIT_TOOL::swapBoardItem(), GLOBAL_EDIT_TOOL::SwapLayers(), ROUTER_TOOL::switchLayerOnViaPlacement(), ROUTER_TOOL::updateMessagePanel(), EDIT_TOOL::updateModificationPoint(), BOARD_EDITOR_CONTROL::UpdateSchematicFromPCB(), ZONE_FILLER_TOOL::ZoneFill(), and ZONE_FILLER_TOOL::ZoneFillAll().

◆ getEditFrame()

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

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

Definition at line 184 of file tool_base.h.

185  {
186 #if !defined( QA_TEST ) // Dynamic casts give the linker a seizure in the test framework
187  wxASSERT( dynamic_cast<T*>( getToolHolderInt() ) );
188 #endif
189  return static_cast<T*>( getToolHolderInt() );
190  }
TOOLS_HOLDER * getToolHolderInt() const
Definition: tool_base.cpp:48

References TOOL_BASE::getToolHolderInt().

Referenced by ZONE_CREATE_HELPER::createNewZone().

◆ GetId()

TOOL_ID TOOL_BASE::GetId ( ) const
inlineinherited

Return the unique identifier of the tool.

The identifier is set by an instance of TOOL_MANAGER.

Returns
Identifier of the tool.

Definition at line 120 of file tool_base.h.

121  {
122  return m_toolId;
123  }
TOOL_ID m_toolId
Name of the tool.
Definition: tool_base.h:209

References TOOL_BASE::m_toolId.

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

◆ GetManager()

TOOL_MANAGER* TOOL_BASE::GetManager ( ) const
inlineinherited

Return the instance of TOOL_MANAGER that takes care of the tool.

Returns
Instance of the TOOL_MANAGER or NULL if there is no associated tool manager.

Definition at line 143 of file tool_base.h.

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

References TOOL_BASE::m_toolMgr.

Referenced by BOARD_COMMIT::BOARD_COMMIT(), ZONE_CREATE_HELPER::commitZone(), ZONE_CREATE_HELPER::createNewZone(), PCB_TOOL_BASE::doInteractiveItemPlacement(), ACTION_MENU::getToolManager(), LIB_TREE::onContextMenu(), ZONE_CREATE_HELPER::OnFirstPoint(), ACTION_MENU::OnMenuEvent(), and ZONE_CREATE_HELPER::performZoneCutout().

◆ getModel()

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

Return the model object if it matches the requested type.

Store the type of the tool.

Definition at line 196 of file tool_base.h.

References TOOL_BASE::getModelInt().

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

◆ GetName()

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

Return the name of the tool.

Tool names are expected to obey the format: application.ToolName (eg. pcbnew.InteractiveSelection).

Returns
The name of the tool.

Definition at line 133 of file tool_base.h.

134  {
135  return m_toolName;
136  }
std::string m_toolName
Definition: tool_base.h:213

References TOOL_BASE::m_toolName.

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

◆ GetToolMenu()

◆ GetType()

TOOL_TYPE TOOL_BASE::GetType ( ) const
inlineinherited

Return the type of the tool.

Returns
The type of the tool.

Definition at line 108 of file tool_base.h.

109  {
110  return m_type;
111  }
TOOL_TYPE m_type
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:206

References TOOL_BASE::m_type.

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

◆ getView()

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

Returns the instance of #VIEW object used in the application.

It allows tools to draw.

Returns
The instance of VIEW.

Definition at line 36 of file tool_base.cpp.

37 {
38  return m_toolMgr->GetView();
39 }
KIGFX::VIEW * GetView() const
Definition: tool_manager.h:283
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214

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

Referenced by EE_POINT_EDITOR::addCornerCondition(), ALIGN_DISTRIBUTE_TOOL::AlignLeft(), ALIGN_DISTRIBUTE_TOOL::AlignRight(), COMMON_TOOLS::CenterContents(), SCH_EDIT_TOOL::ChangeTextType(), EE_INSPECTION_TOOL::CheckSymbol(), PL_SELECTION_TOOL::ClearSelection(), EE_SELECTION_TOOL::ClearSelection(), EE_SELECTION_TOOL::CollectHits(), SCH_LINE_WIRE_BUS_TOOL::computeBreakPoint(), COMMON_TOOLS::CursorControl(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCB_CONTROL::DeleteItemCursor(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), PL_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), EDIT_TOOL::doMoveSelection(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), PCB_SELECTION_TOOL::doSelectionMenu(), COMMON_TOOLS::doZoomFit(), COMMON_TOOLS::doZoomInOut(), COMMON_TOOLS::doZoomToPreset(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), PL_DRAWING_TOOLS::DrawShape(), DRAWING_TOOL::DrawZone(), BOARD_EDITOR_CONTROL::DrillOrigin(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PAD_TOOL::EnumeratePads(), SCH_EDITOR_CONTROL::FindSymbolAndItem(), ROUTER_TOOL::getStartLayer(), PCB_CONTROL::GridResetOrigin(), PCB_CONTROL::GridSetOrigin(), ROUTER_TOOL::handleCommonEvents(), PL_SELECTION_TOOL::highlight(), EE_SELECTION_TOOL::highlight(), PCB_SELECTION_TOOL::highlight(), GERBVIEW_CONTROL::HighlightControl(), PNS::TOOL_BASE::highlightNet(), BOARD_INSPECTION_TOOL::highlightNet(), PCB_SELECTION_TOOL::hitTestDistance(), SCH_EDIT_TOOL::Init(), EDIT_TOOL::Init(), ROUTER_TOOL::InlineDrag(), PCB_PICKER_TOOL::Main(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), SCH_MOVE_TOOL::Main(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_MOVE_TOOL::moveItem(), PL_EDIT_TOOL::moveItem(), COMMON_TOOLS::OnGridChanged(), PCB_POINT_EDITOR::OnSelectionChange(), COMMON_TOOLS::PanControl(), PL_EDIT_TOOL::Paste(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), ROUTER_TOOL::performRouting(), PNS::TOOL_BASE::pickSingleItem(), BOARD_EDITOR_CONTROL::PlaceFootprint(), PL_DRAWING_TOOLS::PlaceItem(), BOARD_EDITOR_CONTROL::PlaceTarget(), ROUTER_TOOL::prepareInteractive(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), EDIT_TOOL::Remove(), BOARD_EDITOR_CONTROL::Reset(), PNS::TOOL_BASE::Reset(), PCB_CONTROL::Reset(), GERBVIEW_SELECTION_TOOL::Reset(), DRAWING_TOOL::Reset(), EE_SELECTION_TOOL::Reset(), PCB_SELECTION_TOOL::Reset(), EE_TOOL_BASE< SCH_BASE_FRAME >::Reset(), SCH_EDIT_TOOL::Rotate(), GERBVIEW_SELECTION_TOOL::select(), GERBVIEW_SELECTION_TOOL::selectable(), PCB_SELECTION_TOOL::Selectable(), PCB_SELECTION_TOOL::SelectAll(), EE_SELECTION_TOOL::SelectAll(), PL_SELECTION_TOOL::selectionContains(), EE_SELECTION_TOOL::selectionContains(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), PL_SELECTION_TOOL::SelectPoint(), ZOOM_TOOL::selectRegion(), GERBVIEW_SELECTION_TOOL::selectVisually(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_EDITOR_CONTROL::ToggleHiddenFields(), SCH_EDITOR_CONTROL::ToggleHiddenPins(), SCH_DRAWING_TOOLS::TwoClickPlace(), PL_SELECTION_TOOL::unhighlight(), EE_SELECTION_TOOL::unhighlight(), PCB_SELECTION_TOOL::unhighlight(), GERBVIEW_SELECTION_TOOL::unselect(), GERBVIEW_SELECTION_TOOL::unselectVisually(), EE_POINT_EDITOR::updateEditedPoint(), PL_POINT_EDITOR::updateEditedPoint(), PCB_POINT_EDITOR::updateEditedPoint(), SCH_EDITOR_CONTROL::UpdateFind(), PL_POINT_EDITOR::updateItem(), PCB_POINT_EDITOR::updateItem(), EE_TOOL_BASE< SCH_BASE_FRAME >::updateItem(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), EE_POINT_EDITOR::updateParentItem(), EE_POINT_EDITOR::updatePoints(), PL_POINT_EDITOR::updatePoints(), PCB_POINT_EDITOR::updatePoints(), PCB_SELECTION_TOOL::updateSelection(), PNS::TOOL_BASE::updateStartItem(), PCB_VIEWER_TOOLS::view(), PCB_TOOL_BASE::view(), PCB_SELECTION_TOOL::zoomFitSelection(), EE_SELECTION_TOOL::~EE_SELECTION_TOOL(), GERBVIEW_SELECTION_TOOL::~GERBVIEW_SELECTION_TOOL(), and PCB_SELECTION_TOOL::~PCB_SELECTION_TOOL().

◆ getViewControls()

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

Return the instance of VIEW_CONTROLS object used in the application.

It allows tools to read & modify user input and its settings (eg. show cursor, enable snapping to grid, etc.).

Returns
The instance of VIEW_CONTROLS.

Definition at line 42 of file tool_base.cpp.

43 {
44  return m_toolMgr->GetViewControls();
45 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
KIGFX::VIEW_CONTROLS * GetViewControls() const
Definition: tool_manager.h:285

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

Referenced by EE_POINT_EDITOR::addCorner(), PCB_POINT_EDITOR::addCorner(), EE_POINT_EDITOR::addCornerCondition(), SCH_EDITOR_CONTROL::AssignNetclass(), SCH_EDIT_TOOL::BreakWire(), PCB_TOOL_BASE::controls(), EDIT_TOOL::copyToClipboard(), SCH_DRAWING_TOOLS::createSheetPin(), COMMON_TOOLS::CursorControl(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), EDIT_TOOL::doMoveSelection(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), COMMON_TOOLS::doZoomToPreset(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawLine(), drawMicrowaveInductor(), DRAWING_TOOL::DrawRectangle(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PAD_TOOL::EnumeratePads(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), SCH_DRAWING_TOOLS::GetCanvasFreeAreaPixels(), BOARD_INSPECTION_TOOL::HighlightNet(), SCH_EDITOR_CONTROL::HighlightNet(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), SCH_EDIT_TOOL::Init(), EDIT_TOOL::Init(), PCB_PICKER_TOOL::Main(), EE_POINT_EDITOR::Main(), PL_EDIT_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PL_POINT_EDITOR::Main(), SCH_MOVE_TOOL::Main(), EE_SELECTION_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), COMMON_TOOLS::OnGridChanged(), PCB_POINT_EDITOR::OnSelectionChange(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), ROUTER_TOOL::performDragging(), LENGTH_TUNER_TOOL::performTuning(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), PCB_CONTROL::placeBoardItems(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), BOARD_EDITOR_CONTROL::PlaceTarget(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), EDIT_TOOL::Remove(), SCH_EDIT_TOOL::RepeatDrawItem(), PL_SELECTION_TOOL::RequestSelection(), EE_SELECTION_TOOL::RequestSelection(), PCB_POINT_EDITOR::Reset(), DRAWING_TOOL::Reset(), COMMON_TOOLS::ResetLocalCoords(), GERBVIEW_SELECTION_TOOL::selectCursor(), PCB_SELECTION_TOOL::selectCursor(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::SelectNode(), ZOOM_TOOL::selectRegion(), ALIGN_DISTRIBUTE_TOOL::selectTarget(), PCB_PICKER_TOOL::setControls(), PICKER_TOOL::setControls(), EE_POINT_EDITOR::setEditedPoint(), PL_POINT_EDITOR::setEditedPoint(), PCB_POINT_EDITOR::setEditedPoint(), SCH_DRAWING_TOOLS::SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), EE_POINT_EDITOR::updateEditedPoint(), PL_POINT_EDITOR::updateEditedPoint(), PCB_POINT_EDITOR::updateEditedPoint(), PCB_POINT_EDITOR::updateItem(), PL_EDIT_TOOL::updateModificationPoint(), and COMMON_TOOLS::ZoomCenter().

◆ Go()

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

Define which state (aStateFunc) to go when a certain event arrives (aConditions).

No conditions means any event.

Definition at line 128 of file tool_interactive.h.

130 {
131  TOOL_STATE_FUNC sptr = std::bind( aStateFunc, static_cast<T*>( this ), std::placeholders::_1 );
132 
133  goInternal( sptr, aConditions );
134 }
std::function< int(const TOOL_EVENT &)> TOOL_STATE_FUNC
Definition: tool_base.h:58
void goInternal(TOOL_STATE_FUNC &aState, const TOOL_EVENT_LIST &aConditions)

References TOOL_INTERACTIVE::goInternal().

Referenced by AUTOPLACE_TOOL::setTransitions(), ZOOM_TOOL::setTransitions(), LENGTH_TUNER_TOOL::setTransitions(), BOARD_REANNOTATE_TOOL::setTransitions(), GERBVIEW_INSPECTION_TOOL::setTransitions(), ROUTER_TOOL::setTransitions(), PCB_PICKER_TOOL::setTransitions(), SCH_NAVIGATE_TOOL::setTransitions(), SYMBOL_EDITOR_PIN_TOOL::setTransitions(), SYMBOL_EDITOR_MOVE_TOOL::setTransitions(), SCRIPTING_TOOL::setTransitions(), PL_DRAWING_TOOLS::setTransitions(), EE_POINT_EDITOR::setTransitions(), PL_POINT_EDITOR::setTransitions(), KICAD_MANAGER_CONTROL::setTransitions(), COMMON_CONTROL::setTransitions(), CONVERT_TOOL::setTransitions(), SYMBOL_EDITOR_DRAWING_TOOLS::setTransitions(), ZONE_FILLER_TOOL::setTransitions(), setTransitions(), EE_INSPECTION_TOOL::setTransitions(), PCB_VIEWER_TOOLS::setTransitions(), PAD_TOOL::setTransitions(), PCB_POINT_EDITOR::setTransitions(), GERBVIEW_CONTROL::setTransitions(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::setTransitions(), GLOBAL_EDIT_TOOL::setTransitions(), GROUP_TOOL::setTransitions(), PL_EDITOR_CONTROL::setTransitions(), SYMBOL_EDITOR_CONTROL::setTransitions(), SYMBOL_EDITOR_EDIT_TOOL::setTransitions(), SCH_MOVE_TOOL::setTransitions(), PL_EDIT_TOOL::setTransitions(), POSITION_RELATIVE_TOOL::setTransitions(), GERBVIEW_SELECTION_TOOL::setTransitions(), SCH_DRAWING_TOOLS::setTransitions(), FOOTPRINT_EDITOR_CONTROL::setTransitions(), SCH_EDIT_TOOL::setTransitions(), ALIGN_DISTRIBUTE_TOOL::setTransitions(), COMMON_TOOLS::setTransitions(), PCB_CONTROL::setTransitions(), EDA_3D_CONTROLLER::setTransitions(), DRC_TOOL::setTransitions(), CVPCB_CONTROL::setTransitions(), SCH_LINE_WIRE_BUS_TOOL::setTransitions(), CVPCB_ASSOCIATION_TOOL::setTransitions(), BOARD_EDITOR_CONTROL::setTransitions(), PICKER_TOOL::setTransitions(), BOARD_INSPECTION_TOOL::setTransitions(), EDIT_TOOL::setTransitions(), PCB_SELECTION_TOOL::setTransitions(), PL_SELECTION_TOOL::setTransitions(), SCH_EDITOR_CONTROL::setTransitions(), DRAWING_TOOL::setTransitions(), and EE_SELECTION_TOOL::setTransitions().

◆ Init()

bool PCB_TOOL_BASE::Init ( void  )
overridevirtualinherited

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

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

Reimplemented from TOOL_BASE.

Reimplemented in EDIT_TOOL, BOARD_INSPECTION_TOOL, PCB_SELECTION_TOOL, DRAWING_TOOL, POSITION_RELATIVE_TOOL, BOARD_EDITOR_CONTROL, PCB_POINT_EDITOR, FOOTPRINT_EDITOR_CONTROL, GLOBAL_EDIT_TOOL, SCRIPTING_TOOL, GROUP_TOOL, PAD_TOOL, BOARD_REANNOTATE_TOOL, LENGTH_TUNER_TOOL, and ROUTER_TOOL.

Definition at line 268 of file pcb_tool_base.cpp.

269 {
270  // A basic context manu. Many (but not all) tools will choose to override this.
271  CONDITIONAL_MENU& ctxMenu = m_menu.GetMenu();
272 
273  // cancel current tool goes in main context menu at the top if present
275  ctxMenu.AddSeparator( 1 );
276 
277  // Finally, add the standard zoom/grid items
278  getEditFrame<PCB_BASE_FRAME>()->AddStandardSubMenus( m_menu );
279 
280  return true;
281 }
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
TOOL_MENU m_menu
The functions below are not yet implemented - their interface may change.
CONDITIONAL_MENU & GetMenu()
Definition: tool_menu.cpp:46
static TOOL_ACTION cancelInteractive
Definition: actions.h:62
void AddSeparator(int aOrder=ANY_ORDER)
Add a separator to the menu.
void AddItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Add a menu entry to run a TOOL_ACTION on selected items.

References CONDITIONAL_MENU::AddItem(), CONDITIONAL_MENU::AddSeparator(), ACTIONS::cancelInteractive, TOOL_MENU::GetMenu(), TOOL_INTERACTIVE::m_menu, and SELECTION_CONDITIONS::ShowAlways().

◆ IsFootprintEditor()

◆ IsToolActive()

bool TOOL_BASE::IsToolActive ( ) const
inherited

Definition at line 31 of file tool_base.cpp.

32 {
33  return m_toolMgr->IsToolActive( m_toolId );
34 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
TOOL_ID m_toolId
Name of the tool.
Definition: tool_base.h:209
bool IsToolActive(TOOL_ID aId) const
Return true if a tool with given id is active (executing)

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

Referenced by ROUTER_TOOL::handleLayerSwitch(), EDIT_TOOL::isRouterActive(), PCB_SELECTION_TOOL::Main(), BOARD_EDITOR_CONTROL::TrackWidthDec(), and BOARD_EDITOR_CONTROL::TrackWidthInc().

◆ Reset()

void MICROWAVE_TOOL::Reset ( RESET_REASON  aReason)
overridevirtual

Bind handlers to corresponding TOOL_ACTIONs.

Reimplemented from PCB_TOOL_BASE.

Definition at line 50 of file microwave_tool.cpp.

51 {
52 }

◆ RunMainStack()

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

Call a function using the main stack.

Parameters
aFuncis the function to be calls.

Definition at line 87 of file tool_interactive.cpp.

88 {
89  m_toolMgr->RunMainStack( this, std::move( aFunc ) );
90 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
void RunMainStack(TOOL_BASE *aTool, std::function< void()> aFunc)

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

Referenced by DRAWING_TOOL::PlaceText().

◆ selection() [1/2]

const PCB_SELECTION & PCB_TOOL_BASE::selection ( ) const
protectedinherited

Definition at line 305 of file pcb_tool_base.cpp.

306 {
308 
309  return selTool->GetSelection();
310 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
PCB_SELECTION & GetSelection()
Return the set of currently selected items.
The selection tool: currently supports:

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

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

◆ selection() [2/2]

PCB_SELECTION & PCB_TOOL_BASE::selection ( )
protectedinherited

Definition at line 313 of file pcb_tool_base.cpp.

314 {
316 
317  return selTool->GetSelection();
318 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
PCB_SELECTION & GetSelection()
Return the set of currently selected items.
The selection tool: currently supports:

References PCB_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

Assign a context menu and tells when it should be activated.

Parameters
aMenuis the menu to be assigned.
aTriggerdetermines conditions upon which the context menu is activated.

Definition at line 76 of file tool_interactive.cpp.

77 {
78  if( aMenu )
79  aMenu->SetTool( this );
80  else
81  aTrigger = CMENU_OFF;
82 
83  m_toolMgr->ScheduleContextMenu( this, aMenu, aTrigger );
84 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
void SetTool(TOOL_INTERACTIVE *aTool)
Set a tool that is the creator of the menu.
void ScheduleContextMenu(TOOL_BASE *aTool, ACTION_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger)
Set behavior of the tool's context popup menu.

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

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), PCB_SELECTION_TOOL::doSelectionMenu(), TOOL_MENU::ShowContextMenu(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ 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 103 of file pcb_tool_base.h.

103 { m_isFootprintEditor = aEnabled; }
bool m_isFootprintEditor

References PCB_TOOL_BASE::m_isFootprintEditor.

◆ setTransitions()

void MICROWAVE_TOOL::setTransitions ( )
overridevirtual

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

It is called every time tool is reset or finished.

Reimplemented from PCB_TOOL_BASE.

Definition at line 243 of file microwave_tool.cpp.

244 {
250 
252 }
static TOOL_ACTION microwaveCreateStubArc
Definition: pcb_actions.h:415
static TOOL_ACTION microwaveCreateLine
Definition: pcb_actions.h:419
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Define which state (aStateFunc) to go when a certain event arrives (aConditions).
static TOOL_ACTION microwaveCreateGap
Definition: pcb_actions.h:411
static TOOL_ACTION microwaveCreateStub
Definition: pcb_actions.h:413
int drawMicrowaveInductor(const TOOL_EVENT &aEvent)
static TOOL_ACTION microwaveCreateFunctionShape
Definition: pcb_actions.h:417
int addMicrowaveFootprint(const TOOL_EVENT &aEvent)
< Main interactive tool

References addMicrowaveFootprint(), drawMicrowaveInductor(), TOOL_INTERACTIVE::Go(), PCB_ACTIONS::microwaveCreateFunctionShape, PCB_ACTIONS::microwaveCreateGap, PCB_ACTIONS::microwaveCreateLine, PCB_ACTIONS::microwaveCreateStub, and PCB_ACTIONS::microwaveCreateStubArc.

◆ view()

◆ Wait()

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

Suspend execution of the tool until an event specified in aEventList arrives.

No parameters means waiting for any event.

Definition at line 57 of file tool_interactive.cpp.

58 {
59  return m_toolMgr->ScheduleWait( this, aEventList );
60 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
TOOL_EVENT * ScheduleWait(TOOL_BASE *aTool, const TOOL_EVENT_LIST &aConditions)
Pause execution of a given tool until one or more events matching aConditions arrives.

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

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), PCB_SELECTION_TOOL::doSelectionMenu(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::InteractivePlaceWithPreview(), ZOOM_TOOL::Main(), PCB_PICKER_TOOL::Main(), EE_POINT_EDITOR::Main(), PL_EDIT_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), CVPCB_CONTROL::Main(), PL_POINT_EDITOR::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), PL_SELECTION_TOOL::Main(), EDA_3D_CONTROLLER::Main(), GERBVIEW_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), PCB_SELECTION_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), PCB_POINT_EDITOR::OnSelectionChange(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), GROUP_TOOL::PickNewMember(), EDIT_TOOL::pickReferencePoint(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), GERBVIEW_SELECTION_TOOL::selectPoint(), PCB_SELECTION_TOOL::selectPoint(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), ZOOM_TOOL::selectRegion(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

Member Data Documentation

◆ m_isFootprintEditor

◆ m_menu

TOOL_MENU TOOL_INTERACTIVE::m_menu
protectedinherited

The functions below are not yet implemented - their interface may change.

Definition at line 106 of file tool_interactive.h.

Referenced by SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), TOOL_INTERACTIVE::GetToolMenu(), ROUTER_TOOL::Init(), LENGTH_TUNER_TOOL::Init(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Init(), PL_EDIT_TOOL::Init(), SCH_EDIT_TOOL::Init(), PAD_TOOL::Init(), PL_DRAWING_TOOLS::Init(), SYMBOL_EDITOR_DRAWING_TOOLS::Init(), SYMBOL_EDITOR_CONTROL::Init(), PCB_VIEWER_TOOLS::Init(), FOOTPRINT_EDITOR_CONTROL::Init(), PL_SELECTION_TOOL::Init(), SCH_DRAWING_TOOLS::Init(), BOARD_EDITOR_CONTROL::Init(), GERBVIEW_SELECTION_TOOL::Init(), EDA_3D_CONTROLLER::Init(), DRAWING_TOOL::Init(), EE_SELECTION_TOOL::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), PCB_SELECTION_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), PCB_TOOL_BASE::Init(), PICKER_TOOL::Init(), DRAWING_TOOL::InteractivePlaceWithPreview(), PCB_PICKER_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), PL_EDIT_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), PL_SELECTION_TOOL::Main(), EDA_3D_CONTROLLER::Main(), GERBVIEW_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), PCB_SELECTION_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ m_toolId

TOOL_ID TOOL_BASE::m_toolId
protectedinherited

Name of the tool.

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

Definition at line 209 of file tool_base.h.

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

◆ m_toolMgr

TOOL_MANAGER* TOOL_BASE::m_toolMgr
protectedinherited

Definition at line 214 of file tool_base.h.

Referenced by TOOL_INTERACTIVE::Activate(), PL_SELECTION_TOOL::AddItemsToSel(), EE_SELECTION_TOOL::AddItemsToSel(), PL_SELECTION_TOOL::AddItemToSel(), PCB_SELECTION_TOOL::AddItemToSel(), EE_SELECTION_TOOL::AddItemToSel(), SCH_MOVE_TOOL::AlignElements(), SCH_EDITOR_CONTROL::AssignNetclass(), CVPCB_ASSOCIATION_TOOL::Associate(), TOOL_BASE::attachManager(), SCH_EDIT_TOOL::AutoplaceFields(), SCH_EDIT_TOOL::BreakWire(), BOARD_INSPECTION_TOOL::calculateSelectionRatsnest(), ROUTER_TOOL::CanInlineDrag(), SCH_EDIT_TOOL::ChangeTextType(), EDIT_TOOL::ChangeTrackWidth(), SCH_EDIT_TOOL::CleanupSheetPins(), GERBVIEW_CONTROL::ClearAllLayers(), BOARD_INSPECTION_TOOL::ClearHighlight(), SCH_EDITOR_CONTROL::ClearHighlight(), PL_SELECTION_TOOL::ClearSelection(), PCB_SELECTION_TOOL::ClearSelection(), GERBVIEW_SELECTION_TOOL::clearSelection(), EE_SELECTION_TOOL::ClearSelection(), SCH_EDIT_TOOL::ConvertDeMorgan(), PL_EDIT_TOOL::Copy(), SYMBOL_EDITOR_EDIT_TOOL::Copy(), PAD_TOOL::copyPadSettings(), EDIT_TOOL::copyToClipboard(), createInductorBetween(), BOARD_INSPECTION_TOOL::CrossProbePcbToSch(), COMMON_TOOLS::CursorControl(), SCH_EDITOR_CONTROL::Cut(), SYMBOL_EDITOR_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCB_CONTROL::DeleteItemCursor(), SCH_EDITOR_CONTROL::doCopy(), SCH_EDITOR_CONTROL::doCrossProbeSchToPcb(), SYMBOL_EDITOR_EDIT_TOOL::DoDelete(), SCH_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), BOARD_INSPECTION_TOOL::doHideNet(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), COMMON_TOOLS::doZoomInOut(), COMMON_TOOLS::doZoomToPreset(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawRectangle(), DRAWING_TOOL::drawSegment(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), BOARD_EDITOR_CONTROL::DrillOrigin(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), EDIT_TOOL::Duplicate(), SCH_EDIT_TOOL::EditField(), SCH_EDIT_TOOL::editFieldText(), BOARD_EDITOR_CONTROL::EditFpInFpEditor(), SYMBOL_EDITOR_EDIT_TOOL::editGraphicProperties(), PAD_TOOL::EditPad(), SYMBOL_EDITOR_EDIT_TOOL::editSymbolProperties(), SCH_EDITOR_CONTROL::EditWithSymbolEditor(), GROUP_TOOL::EnterGroup(), SCH_NAVIGATE_TOOL::EnterSheet(), SCH_EDITOR_CONTROL::EnterSheet(), PAD_TOOL::EnumeratePads(), EE_INSPECTION_TOOL::ExcludeMarker(), PCB_SELECTION_TOOL::expandConnection(), PAD_TOOL::explodePad(), PCB_SELECTION_TOOL::filterSelection(), PCB_SELECTION_TOOL::findCallback(), SCH_EDITOR_CONTROL::FindSymbolAndItem(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), EDIT_TOOL::Flip(), EDIT_TOOL::GetAndPlace(), TOOL_BASE::GetManager(), TOOL_BASE::getModelInt(), EE_SELECTION_TOOL::GetNode(), DRAWING_TOOL::getSourceZoneForAction(), TOOL_BASE::getToolHolderInt(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), TOOL_INTERACTIVE::goInternal(), COMMON_TOOLS::GridNext(), COMMON_TOOLS::GridPreset(), COMMON_TOOLS::GridPrev(), PCB_CONTROL::GridSetOrigin(), GROUP_TOOL::Group(), EE_SELECTION_TOOL::GuessSelectionCandidates(), GERBVIEW_CONTROL::HighlightControl(), BOARD_INSPECTION_TOOL::HighlightItem(), BOARD_INSPECTION_TOOL::HighlightNet(), SCH_EDITOR_CONTROL::HighlightNet(), BOARD_INSPECTION_TOOL::highlightNet(), SCH_EDITOR_CONTROL::HighlightNetCursor(), PL_EDIT_TOOL::ImportDrawingSheetContent(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), BOARD_REANNOTATE_TOOL::Init(), SYMBOL_EDITOR_EDIT_TOOL::Init(), PL_EDIT_TOOL::Init(), SCH_EDIT_TOOL::Init(), GROUP_TOOL::Init(), PAD_TOOL::Init(), CONVERT_TOOL::Init(), PL_DRAWING_TOOLS::Init(), GLOBAL_EDIT_TOOL::Init(), SYMBOL_EDITOR_CONTROL::Init(), PL_POINT_EDITOR::Init(), ALIGN_DISTRIBUTE_TOOL::Init(), BOARD_EDITOR_CONTROL::Init(), PCB_POINT_EDITOR::Init(), POSITION_RELATIVE_TOOL::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), BOARD_INSPECTION_TOOL::Init(), EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), BOARD_INSPECTION_TOOL::InspectClearance(), BOARD_INSPECTION_TOOL::InspectConstraints(), DRAWING_TOOL::InteractivePlaceWithPreview(), EDIT_TOOL::invokeInlineRouter(), EDIT_TOOL::isInteractiveDragEnabled(), EDIT_TOOL::isRouterActive(), TOOL_BASE::IsToolActive(), GROUP_TOOL::LeaveGroup(), SCH_NAVIGATE_TOOL::LeaveSheet(), SCH_EDITOR_CONTROL::LeaveSheet(), COMMON_CONTROL::ListHotKeys(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), PCB_PICKER_TOOL::Main(), PL_EDIT_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), CVPCB_CONTROL::Main(), SCH_MOVE_TOOL::Main(), PL_SELECTION_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), PCB_SELECTION_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), PCB_VIEWER_TOOLS::MeasureTool(), SYMBOL_EDITOR_EDIT_TOOL::Mirror(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::Mirror(), BOARD_EDITOR_CONTROL::modifyLockSelected(), EDIT_TOOL::MoveExact(), SYMBOL_EDITOR_CONTROL::OnDeMorgan(), COMMON_TOOLS::OnGridChanged(), PCB_POINT_EDITOR::OnSelectionChange(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), PL_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), PAD_TOOL::pastePadProperties(), ROUTER_TOOL::performRouting(), GROUP_TOOL::PickNewMember(), EDIT_TOOL::pickReferencePoint(), SYMBOL_EDITOR_EDIT_TOOL::PinTable(), PCB_CONTROL::placeBoardItems(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), PCB_CONTROL::Print(), GERBVIEW_CONTROL::Print(), SYMBOL_EDITOR_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), PAD_TOOL::pushPadSettings(), EE_SELECTION_TOOL::RebuildSelection(), SYMBOL_EDITOR_EDIT_TOOL::Redo(), SCH_EDITOR_CONTROL::Redo(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), EDIT_TOOL::Remove(), PCB_POINT_EDITOR::removeCorner(), GROUP_TOOL::RemoveFromGroup(), PL_SELECTION_TOOL::RemoveItemFromSel(), EE_SELECTION_TOOL::RemoveItemFromSel(), PCB_SELECTION_TOOL::RemoveItemFromSel(), PL_SELECTION_TOOL::RemoveItemsFromSel(), EE_SELECTION_TOOL::RemoveItemsFromSel(), SCH_EDIT_TOOL::RepeatDrawItem(), SYMBOL_EDITOR_DRAWING_TOOLS::RepeatDrawItem(), EE_SELECTION_TOOL::RequestSelection(), PCB_SELECTION_TOOL::RequestSelection(), COMMON_TOOLS::Reset(), PNS::TOOL_BASE::Reset(), EDA_3D_CONTROLLER::Reset(), COMMON_TOOLS::ResetLocalCoords(), TOOL_INTERACTIVE::resetTransitions(), SYMBOL_EDITOR_EDIT_TOOL::Rotate(), SCH_EDIT_TOOL::Rotate(), EDIT_TOOL::Rotate(), TOOL_INTERACTIVE::RunMainStack(), DRC_TOOL::RunTests(), EE_SELECTION_TOOL::SelectConnection(), PCB_TOOL_BASE::selection(), COMMON_TOOLS::SelectionTool(), GERBVIEW_SELECTION_TOOL::SelectItem(), GERBVIEW_SELECTION_TOOL::SelectItems(), PCB_SELECTION_TOOL::SelectItems(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectNet(), PL_SELECTION_TOOL::SelectPoint(), GERBVIEW_SELECTION_TOOL::selectPoint(), EE_SELECTION_TOOL::selectPoint(), PCB_SELECTION_TOOL::selectPoint(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), PCB_SELECTION_TOOL::selectSameSheet(), PCB_SELECTION_TOOL::selectSheetContents(), DRAWING_TOOL::SetAnchor(), TOOL_INTERACTIVE::SetContextMenu(), EDA_3D_CONTROLLER::SetMaterial(), DRC_TOOL::ShowDRCDialog(), SCH_DRAWING_TOOLS::SingleClickPlace(), EDA_3D_CONTROLLER::ToggleVisibility(), BOARD_EDITOR_CONTROL::TrackWidthDec(), BOARD_EDITOR_CONTROL::TrackWidthInc(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_EDIT_TOOL::Undo(), SCH_EDITOR_CONTROL::Undo(), GROUP_TOOL::Ungroup(), GERBVIEW_SELECTION_TOOL::UnselectItem(), GERBVIEW_SELECTION_TOOL::UnselectItems(), PCB_SELECTION_TOOL::UnselectItems(), PNS::TOOL_BASE::updateEndItem(), EE_INSPECTION_TOOL::UpdateMessagePanel(), GERBVIEW_CONTROL::UpdateMessagePanel(), PL_EDITOR_CONTROL::UpdateMessagePanel(), PCB_CONTROL::UpdateMessagePanel(), EDIT_TOOL::updateModificationPoint(), BOARD_INSPECTION_TOOL::UpdateSelectionRatsnest(), PNS::TOOL_BASE::updateStartItem(), BOARD_EDITOR_CONTROL::ViaSizeDec(), BOARD_EDITOR_CONTROL::ViaSizeInc(), TOOL_INTERACTIVE::Wait(), BOARD_EDITOR_CONTROL::ZoneDuplicate(), and BOARD_EDITOR_CONTROL::ZoneMerge().

◆ m_toolName

std::string TOOL_BASE::m_toolName
protectedinherited

Definition at line 213 of file tool_base.h.

Referenced by TOOL_BASE::GetName().

◆ m_type

TOOL_TYPE TOOL_BASE::m_type
protectedinherited

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

Definition at line 206 of file tool_base.h.

Referenced by TOOL_BASE::GetType(), and BOARD_COMMIT::Push().


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