KiCad PCB EDA Suite
SCH_DRAWING_TOOLS Class Reference

SCH_DRAWING_TOOLS. More...

#include <sch_drawing_tools.h>

Inheritance diagram for SCH_DRAWING_TOOLS:
EE_TOOL_BASE< SCH_EDIT_FRAME > 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

 SCH_DRAWING_TOOLS ()
 
 ~SCH_DRAWING_TOOLS () override
 
bool Init () override
 Init() is called once upon a registration of the tool. More...
 
int PlaceComponent (const TOOL_EVENT &aEvent)
 
int SingleClickPlace (const TOOL_EVENT &aEvent)
 
int TwoClickPlace (const TOOL_EVENT &aEvent)
 
int DrawSheet (const TOOL_EVENT &aEvent)
 
int PlaceImage (const TOOL_EVENT &aEvent)
 
void Reset (RESET_REASON aReason) override
 Bring the tool to a known, initial state. More...
 
void Activate ()
 Run the tool. More...
 
TOOL_MENUGetToolMenu ()
 
void SetContextMenu (ACTION_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger=CMENU_BUTTON)
 Assign a context menu and tells when it should be activated. More...
 
void RunMainStack (std::function< void()> aFunc)
 Call a function using the main stack. More...
 
template<class T >
void Go (int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
 Define which state (aStateFunc) to go when a certain event arrives (aConditions). More...
 
TOOL_EVENTWait (const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
 Suspend execution of the tool until an event specified in aEventList arrives. More...
 
TOOL_TYPE GetType () const
 Return the type of the tool. More...
 
TOOL_ID GetId () const
 Return the unique identifier of the tool. More...
 
const std::string & GetName () const
 Return the name of the tool. More...
 
TOOL_MANAGERGetManager () const
 Return the instance of TOOL_MANAGER that takes care of the tool. More...
 
bool IsToolActive () const
 

Protected Member Functions

void updateItem (EDA_ITEM *aItem, bool aUpdateRTree) const
 Similar to getView()->Update(), but handles items that are redrawn by their parents and updating the SCH_SCREEN's RTree. More...
 
void saveCopyInUndoList (EDA_ITEM *aItem, UNDO_REDO aType, bool aAppend=false)
 

Similar to m_frame->SaveCopyInUndoList(), but handles items that are owned by their parents.

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

SCH_EDIT_FRAMEm_frame
 
KIGFX::SCH_VIEWm_view
 
EE_SELECTION_TOOLm_selectionTool
 
bool m_isSymbolEditor
 
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

SCH_TEXTcreateNewText (const VECTOR2I &aPosition, int aType)
 Gets the next queued text item. More...
 
SCH_HIERLABELimportHierLabel (SCH_SHEET *aSheet)
 
SCH_SHEET_PINcreateSheetPin (SCH_SHEET *aSheet, SCH_HIERLABEL *aLabel)
 
void sizeSheet (SCH_SHEET *aSheet, VECTOR2I aPos)
 
void setTransitions () override
 

Sets up handlers for various events.

More...
 

Private Attributes

std::vector< PICKED_SYMBOLm_symbolHistoryList
 
std::vector< PICKED_SYMBOLm_powerHistoryList
 
PINSHEETLABEL_SHAPE m_lastSheetPinType
 
PINSHEETLABEL_SHAPE m_lastGlobalLabelShape
 
LABEL_SPIN_STYLE m_lastTextOrientation
 
bool m_lastTextBold
 
bool m_lastTextItalic
 
std::unique_ptr< STATUS_TEXT_POPUPm_statusPopup
 

Detailed Description

SCH_DRAWING_TOOLS.

Tool responsible for drawing/placing items (symbols, wires, buses, labels, etc.)

Definition at line 46 of file sch_drawing_tools.h.

Member Enumeration Documentation

◆ RESET_REASON

enum TOOL_BASE::RESET_REASON
inherited

Determine the reason of reset for a tool.

Enumerator
RUN 

Tool is invoked after being inactive.

MODEL_RELOAD 

Model changes (required full reload)

GAL_SWITCH 

Rendering engine changes.

Definition at line 78 of file tool_base.h.

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

Constructor & Destructor Documentation

◆ SCH_DRAWING_TOOLS()

SCH_DRAWING_TOOLS::SCH_DRAWING_TOOLS ( )

◆ ~SCH_DRAWING_TOOLS()

SCH_DRAWING_TOOLS::~SCH_DRAWING_TOOLS ( )
inlineoverride

Definition at line 50 of file sch_drawing_tools.h.

50 { }

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:215
TOOL_ID m_toolId
Name of the tool.
Definition: tool_base.h:210
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(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::DrawRectangle(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), DrawSheet(), DRAWING_TOOL::DrawZone(), BOARD_EDITOR_CONTROL::DrillOrigin(), PAD_TOOL::EnumeratePads(), PCB_CONTROL::GridSetOrigin(), SCH_EDITOR_CONTROL::HighlightNetCursor(), BOARD_INSPECTION_TOOL::HighlightNetTool(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), PL_EDIT_TOOL::Main(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), PCB_PICKER_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(), PlaceComponent(), PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), BOARD_EDITOR_CONTROL::PlaceModule(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), EDIT_TOOL::Remove(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), DRAWING_TOOL::SetAnchor(), DRC_TOOL::ShowDRCDialog(), SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ attachManager()

void TOOL_BASE::attachManager ( TOOL_MANAGER aManager)
protectedinherited

Set the TOOL_MANAGER the tool will belong to.

Called by TOOL_MANAGER::RegisterTool()

Definition at line 60 of file tool_base.cpp.

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

References TOOL_BASE::m_toolMgr.

Referenced by TOOL_MANAGER::RegisterTool().

◆ createNewText()

SCH_TEXT * SCH_DRAWING_TOOLS::createNewText ( const VECTOR2I aPosition,
int  aType 
)
private

Gets the next queued text item.

Returns
next SCH_TEXT* or nullptr if empty

Definition at line 696 of file sch_drawing_tools.cpp.

697 {
698  SCHEMATIC* schematic = getModel<SCHEMATIC>();
699  SCHEMATIC_SETTINGS& settings = schematic->Settings();
700  SCH_TEXT* textItem = nullptr;
701 
702  switch( aType )
703  {
704  case LAYER_NOTES:
705  textItem = new SCH_TEXT( (wxPoint) aPosition );
706  break;
707 
708  case LAYER_LOCLABEL:
709  textItem = new SCH_LABEL( (wxPoint) aPosition );
710  break;
711 
712  case LAYER_HIERLABEL:
713  textItem = new SCH_HIERLABEL( (wxPoint) aPosition );
714  textItem->SetShape( m_lastGlobalLabelShape );
715  break;
716 
717  case LAYER_GLOBLABEL:
718  textItem = new SCH_GLOBALLABEL( (wxPoint) aPosition );
719  textItem->SetShape( m_lastGlobalLabelShape );
720  break;
721 
722  default:
723  wxFAIL_MSG( "SCH_EDIT_FRAME::CreateNewText() unknown layer type" );
724  return nullptr;
725  }
726 
727  textItem->SetParent( schematic );
728  textItem->SetBold( m_lastTextBold );
729  textItem->SetItalic( m_lastTextItalic );
731  textItem->SetTextSize( wxSize( settings.m_DefaultTextSize, settings.m_DefaultTextSize ) );
732  textItem->SetFlags( IS_NEW | IS_MOVED );
733 
734  DIALOG_LABEL_EDITOR dlg( m_frame, textItem );
735 
736  // Must be quasi modal for syntax help
737  if( dlg.ShowQuasiModal() != wxID_OK || NoPrintableChars( textItem->GetText() ) )
738  {
739  delete textItem;
740  return nullptr;
741  }
742 
743  m_lastTextBold = textItem->IsBold();
744  m_lastTextItalic = textItem->IsItalic();
746 
747  if( textItem->Type() == SCH_GLOBAL_LABEL_T || textItem->Type() == SCH_HIER_LABEL_T )
748  m_lastGlobalLabelShape = textItem->GetShape();
749 
750  return textItem;
751 }
bool IsBold() const
Definition: eda_text.h:190
void SetShape(PINSHEETLABEL_SHAPE aShape)
Definition: sch_text.h:237
PINSHEETLABEL_SHAPE m_lastGlobalLabelShape
Holds all the data relating to one schematic A schematic may consist of one or more sheets (and one r...
Definition: schematic.h:44
SCHEMATIC_SETTINGS & Settings() const
Definition: schematic.cpp:125
void SetItalic(bool isItalic)
Definition: eda_text.h:186
void SetTextSize(const wxSize &aNewSize)
Definition: eda_text.h:244
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:164
bool IsItalic() const
Definition: eda_text.h:187
void SetFlags(STATUS_FLAGS aMask)
Definition: eda_item.h:201
LABEL_SPIN_STYLE GetLabelSpinStyle() const
Definition: sch_text.h:233
#define IS_MOVED
Item being moved.
Definition: eda_item.h:105
These settings were stored in SCH_BASE_FRAME previously.
LABEL_SPIN_STYLE m_lastTextOrientation
virtual void SetLabelSpinStyle(LABEL_SPIN_STYLE aSpinStyle)
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
Definition: sch_text.cpp:248
bool NoPrintableChars(wxString aString)
Return true if the string is empty or contains only whitespace.
Definition: string.cpp:370
void SetBold(bool aBold)
Definition: eda_text.h:189
#define IS_NEW
New item, just created.
Definition: eda_item.h:106
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:133
PINSHEETLABEL_SHAPE GetShape() const
Definition: sch_text.h:235
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:161

References SCH_TEXT::GetLabelSpinStyle(), SCH_TEXT::GetShape(), EDA_TEXT::GetText(), IS_MOVED, IS_NEW, EDA_TEXT::IsBold(), EDA_TEXT::IsItalic(), LAYER_GLOBLABEL, LAYER_HIERLABEL, LAYER_LOCLABEL, LAYER_NOTES, SCHEMATIC_SETTINGS::m_DefaultTextSize, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, m_lastGlobalLabelShape, m_lastTextBold, m_lastTextItalic, m_lastTextOrientation, NoPrintableChars(), SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, EDA_TEXT::SetBold(), EDA_ITEM::SetFlags(), EDA_TEXT::SetItalic(), SCH_TEXT::SetLabelSpinStyle(), EDA_ITEM::SetParent(), SCH_TEXT::SetShape(), EDA_TEXT::SetTextSize(), SCHEMATIC::Settings(), DIALOG_SHIM::ShowQuasiModal(), and EDA_ITEM::Type().

Referenced by TwoClickPlace().

◆ createSheetPin()

SCH_SHEET_PIN * SCH_DRAWING_TOOLS::createSheetPin ( SCH_SHEET aSheet,
SCH_HIERLABEL aLabel 
)
private

Definition at line 772 of file sch_drawing_tools.cpp.

773 {
774  SCHEMATIC_SETTINGS& settings = aSheet->Schematic()->Settings();
775  wxString text;
776  SCH_SHEET_PIN* sheetPin;
777 
778  if( aLabel )
779  {
780  text = aLabel->GetText();
781  m_lastSheetPinType = aLabel->GetShape();
782  }
783 
784  sheetPin = new SCH_SHEET_PIN( aSheet, wxPoint( 0, 0 ), text );
785  sheetPin->SetFlags( IS_NEW );
786  sheetPin->SetTextSize( wxSize( settings.m_DefaultTextSize, settings.m_DefaultTextSize ) );
787  sheetPin->SetShape( m_lastSheetPinType );
788 
789  if( !aLabel )
790  {
791  DIALOG_SHEET_PIN_PROPERTIES dlg( m_frame, sheetPin );
792 
793  if( dlg.ShowModal() != wxID_OK || NoPrintableChars( sheetPin->GetText() ) )
794  {
795  delete sheetPin;
796  return nullptr;
797  }
798  }
799 
800  m_lastSheetPinType = sheetPin->GetShape();
801 
802  sheetPin->SetPosition( (wxPoint) getViewControls()->GetCursorPosition() );
803 
804  return sheetPin;
805 }
void SetShape(PINSHEETLABEL_SHAPE aShape)
Definition: sch_text.h:237
SCHEMATIC_SETTINGS & Settings() const
Definition: schematic.cpp:125
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
Definition: sch_item.cpp:97
void SetTextSize(const wxSize &aNewSize)
Definition: eda_text.h:244
void SetFlags(STATUS_FLAGS aMask)
Definition: eda_item.h:201
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:85
void SetPosition(const wxPoint &aPosition) override
Definition: sch_sheet.h:206
These settings were stored in SCH_BASE_FRAME previously.
PINSHEETLABEL_SHAPE m_lastSheetPinType
KIGFX::VIEW_CONTROLS * getViewControls() const
Return the instance of VIEW_CONTROLS object used in the application.
Definition: tool_base.cpp:42
bool NoPrintableChars(wxString aString)
Return true if the string is empty or contains only whitespace.
Definition: string.cpp:370
#define IS_NEW
New item, just created.
Definition: eda_item.h:106
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:133
PINSHEETLABEL_SHAPE GetShape() const
Definition: sch_text.h:235

References SCH_TEXT::GetShape(), EDA_TEXT::GetText(), TOOL_BASE::getViewControls(), IS_NEW, SCHEMATIC_SETTINGS::m_DefaultTextSize, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, m_lastSheetPinType, NoPrintableChars(), SCH_ITEM::Schematic(), EDA_ITEM::SetFlags(), SCH_SHEET_PIN::SetPosition(), SCH_TEXT::SetShape(), EDA_TEXT::SetTextSize(), and SCHEMATIC::Settings().

Referenced by TwoClickPlace().

◆ DrawSheet()

int SCH_DRAWING_TOOLS::DrawSheet ( const TOOL_EVENT aEvent)

Definition at line 1040 of file sch_drawing_tools.cpp.

1041 {
1042  SCH_SHEET* sheet = nullptr;
1043 
1045  getViewControls()->ShowCursor( true );
1046 
1047  std::string tool = aEvent.GetCommandStr().get();
1048  m_frame->PushTool( tool );
1049  Activate();
1050 
1051  // Prime the pump
1052  if( aEvent.HasPosition() )
1054 
1055  auto setCursor =
1056  [&]()
1057  {
1059  };
1060 
1061  // Set initial cursor
1062  setCursor();
1063 
1064  // Main loop: keep receiving events
1065  while( TOOL_EVENT* evt = Wait() )
1066  {
1067  setCursor();
1068 
1069  VECTOR2I cursorPos = getViewControls()->GetCursorPosition( !evt->Modifier( MD_ALT ) );
1070 
1071  auto cleanup =
1072  [&] ()
1073  {
1075  m_view->ClearPreview();
1076  delete sheet;
1077  sheet = nullptr;
1078  };
1079 
1080  if( evt->IsCancelInteractive() )
1081  {
1082  if( sheet )
1083  {
1084  cleanup();
1085  }
1086  else
1087  {
1088  m_frame->PopTool( tool );
1089  break;
1090  }
1091  }
1092  else if( evt->IsActivate() )
1093  {
1094  if( sheet )
1095  cleanup();
1096 
1097  if( evt->IsPointEditor() )
1098  {
1099  // don't exit (the point editor runs in the background)
1100  }
1101  else if( evt->IsMoveTool() )
1102  {
1103  // leave ourselves on the stack so we come back after the move
1104  break;
1105  }
1106  else
1107  {
1108  m_frame->PopTool( tool );
1109  break;
1110  }
1111  }
1112  else if( !sheet && ( evt->IsClick( BUT_LEFT ) || evt->IsDblClick( BUT_LEFT ) ) )
1113  {
1115 
1117 
1118  sheet = new SCH_SHEET( m_frame->GetCurrentSheet().Last(),
1119  static_cast<wxPoint>( cursorPos ) );
1120  sheet->SetFlags( IS_NEW | IS_RESIZED );
1121  sheet->SetScreen( NULL );
1125  sheet->GetFields()[ SHEETNAME ].SetText( "Untitled Sheet" );
1126  sheet->GetFields()[ SHEETFILENAME ].SetText( "untitled.kicad_sch" );
1127  sizeSheet( sheet, cursorPos );
1128 
1129  m_view->ClearPreview();
1130  m_view->AddToPreview( sheet->Clone() );
1131  }
1132  else if( sheet && ( evt->IsClick( BUT_LEFT )
1133  || evt->IsDblClick( BUT_LEFT )
1134  || evt->IsAction( &EE_ACTIONS::finishSheet ) ) )
1135  {
1136  m_view->ClearPreview();
1137  getViewControls()->SetAutoPan( false );
1138  getViewControls()->CaptureCursor( false );
1139 
1140  if( m_frame->EditSheetProperties( static_cast<SCH_SHEET*>( sheet ),
1141  &m_frame->GetCurrentSheet(), nullptr ) )
1142  {
1143  sheet->AutoplaceFields( /* aScreen */ NULL, /* aManual */ false );
1144 
1145  m_frame->AddItemToScreenAndUndoList( m_frame->GetScreen(), sheet, false );
1147  m_selectionTool->AddItemToSel( sheet );
1148  }
1149  else
1150  {
1151  delete sheet;
1152  }
1153 
1154  sheet = nullptr;
1155  }
1156  else if( sheet && ( evt->IsAction( &ACTIONS::refreshPreview ) || evt->IsMotion() ) )
1157  {
1158  sizeSheet( sheet, cursorPos );
1159  m_view->ClearPreview();
1160  m_view->AddToPreview( sheet->Clone() );
1161  }
1162  else if( evt->IsClick( BUT_RIGHT ) )
1163  {
1164  // Warp after context menu only if dragging...
1165  if( !sheet )
1167 
1169  }
1170  else
1171  {
1172  evt->SetPassEvent();
1173  }
1174 
1175  // Enable autopanning and cursor capture only when there is a sheet to be placed
1176  getViewControls()->SetAutoPan( sheet != nullptr );
1177  getViewControls()->CaptureCursor( sheet != nullptr );
1178  }
1179 
1181  return 0;
1182 }
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.
static TOOL_ACTION finishSheet
Definition: ee_actions.h:98
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.
SCH_SHEET * Last() const
Return a pointer to the last SCH_SHEET of the list.
void AddToPreview(EDA_ITEM *aItem, bool aTakeOwnership=true)
Definition: view.cpp:1554
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:215
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
Definition: sch_sheet.cpp:154
virtual void PushTool(const std::string &actionName)
NB: the definition of "tool" is different at the user level.
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:141
#define IS_RESIZED
Item being resized.
Definition: eda_item.h:107
void SetCurrentCursor(KICURSOR cursor)
Set the current cursor shape for this panel.
void SetBorderWidth(int aWidth)
Definition: sch_sheet.h:291
EE_SELECTION & GetSelection()
Function GetSelection()
EESCHEMA_SETTINGS * eeconfig() const
std::vector< SCH_FIELD > & GetFields()
Definition: sch_sheet.h:270
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void SetBackgroundColor(KIGFX::COLOR4D aColor)
Definition: sch_sheet.h:297
void SetFlags(STATUS_FLAGS aMask)
Definition: eda_item.h:201
#define NULL
virtual void PopTool(const std::string &actionName)
virtual void CaptureCursor(bool aEnabled)
Force the cursor to stay within the drawing panel area.
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
Generic, UI-independent tool event.
Definition: tool_event.h:170
void ClearPreview()
Definition: view.cpp:1535
void UpdateHierarchyNavigator(bool aForceUpdate=false)
Run the Hierarchy Navigator dialog.
void SetBorderColor(KIGFX::COLOR4D aColor)
Definition: sch_sheet.h:294
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:181
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:56
virtual void SetAutoPan(bool aEnabled)
Turn on/off auto panning (this feature is used when there is a tool active (eg.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:219
OPT< std::string > GetCommandStr() const
Definition: tool_event.h:454
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_sheet.cpp:148
void AddItemToScreenAndUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItem, bool aUndoAppend)
Add an item to the schematic and adds the changes to the undo/redo container.
int AddItemToSel(const TOOL_EVENT &aEvent)
void VetoContextMenuMouseWarp()
Disable mouse warping after the current context menu is closed.
Definition: tool_manager.h:423
bool EditSheetProperties(SCH_SHEET *aSheet, SCH_SHEET_PATH *aHierarchy, bool *aClearAnnotationNewItems)
Edit an existing sheet or add a new sheet to the schematic.
Definition: sheet.cpp:465
void Activate()
Run the tool.
SCH_SHEET_PATH & GetCurrentSheet() const
bool HasPosition() const
Definition: tool_event.h:258
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
Definition: sch_sheet.cpp:502
KIGFX::VIEW_CONTROLS * getViewControls() const
Return the instance of VIEW_CONTROLS object used in the application.
Definition: tool_base.cpp:42
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
#define IS_NEW
New item, just created.
Definition: eda_item.h:106
static TOOL_ACTION refreshPreview
Definition: actions.h:109
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
static TOOL_ACTION cursorClick
Definition: actions.h:126
void sizeSheet(SCH_SHEET *aSheet, VECTOR2I aPos)

References TOOL_INTERACTIVE::Activate(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), EE_SELECTION_TOOL::AddItemToSel(), KIGFX::VIEW::AddToPreview(), ARROW, SCH_SHEET::AutoplaceFields(), BUT_LEFT, BUT_RIGHT, KIGFX::VIEW_CONTROLS::CaptureCursor(), KIGFX::VIEW::ClearPreview(), EE_ACTIONS::clearSelection, SCH_SHEET::Clone(), ACTIONS::cursorClick, EESCHEMA_SETTINGS::DRAWING::default_line_thickness, EESCHEMA_SETTINGS::DRAWING::default_sheet_background_color, EESCHEMA_SETTINGS::DRAWING::default_sheet_border_color, SCH_EDIT_FRAME::EditSheetProperties(), SCH_BASE_FRAME::eeconfig(), EE_ACTIONS::finishSheet, SCH_BASE_FRAME::GetCanvas(), TOOL_EVENT::GetCommandStr(), SCH_EDIT_FRAME::GetCurrentSheet(), KIGFX::VIEW_CONTROLS::GetCursorPosition(), SCH_SHEET::GetFields(), SCH_EDIT_FRAME::GetScreen(), EE_SELECTION_TOOL::GetSelection(), TOOL_BASE::getViewControls(), TOOL_EVENT::HasPosition(), IS_NEW, IS_RESIZED, SCH_SHEET_PATH::Last(), EESCHEMA_SETTINGS::m_Drawing, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, TOOL_INTERACTIVE::m_menu, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_view, MD_ALT, NULL, PENCIL, TOOLS_HOLDER::PopTool(), TOOLS_HOLDER::PushTool(), ACTIONS::refreshPreview, TOOL_MANAGER::RunAction(), KIGFX::VIEW_CONTROLS::SetAutoPan(), SCH_SHEET::SetBackgroundColor(), SCH_SHEET::SetBorderColor(), SCH_SHEET::SetBorderWidth(), EDA_DRAW_PANEL_GAL::SetCurrentCursor(), EDA_ITEM::SetFlags(), SCH_SHEET::SetScreen(), SHEETFILENAME, SHEETNAME, TOOL_MENU::ShowContextMenu(), KIGFX::VIEW_CONTROLS::ShowCursor(), sizeSheet(), SCH_EDIT_FRAME::UpdateHierarchyNavigator(), TOOL_MANAGER::VetoContextMenuMouseWarp(), and TOOL_INTERACTIVE::Wait().

Referenced by setTransitions().

◆ getEditFrame()

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

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

Definition at line 185 of file tool_base.h.

186  {
187 #if !defined( QA_TEST ) // Dynamic casts give the linker a siezure in the test framework
188  wxASSERT( dynamic_cast<T*>( getToolHolderInt() ) );
189 #endif
190  return static_cast<T*>( getToolHolderInt() );
191  }
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 121 of file tool_base.h.

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

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

145  {
146  return m_toolMgr;
147  }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:215

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

References TOOL_BASE::getModelInt().

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

◆ GetName()

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

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

135  {
136  return m_toolName;
137  }
std::string m_toolName
Definition: tool_base.h:214

References TOOL_BASE::m_toolName.

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

◆ GetToolMenu()

◆ GetType()

TOOL_TYPE TOOL_BASE::GetType ( ) const
inlineinherited

Return the type of the tool.

Returns
The type of the tool.

Definition at line 109 of file tool_base.h.

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

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

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(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), PL_DRAWING_TOOLS::DrawShape(), DRAWING_TOOL::DrawZone(), BOARD_EDITOR_CONTROL::DrillOrigin(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PAD_TOOL::EnumeratePads(), SCH_EDITOR_CONTROL::FindComponentAndItem(), EE_SELECTION_TOOL::GetNode(), ROUTER_TOOL::getStartLayer(), PCB_CONTROL::GridResetOrigin(), PCB_CONTROL::GridSetOrigin(), 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(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), PCB_PICKER_TOOL::Main(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_MOVE_TOOL::moveItem(), PL_EDIT_TOOL::moveItem(), COMMON_TOOLS::OnGridChanged(), PCB_POINT_EDITOR::OnSelectionChange(), COMMON_TOOLS::PanControl(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), PL_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), PNS::TOOL_BASE::pickSingleItem(), PL_DRAWING_TOOLS::PlaceItem(), BOARD_EDITOR_CONTROL::PlaceModule(), BOARD_EDITOR_CONTROL::PlaceTarget(), 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_EDITOR_CONTROL::ToggleHiddenFields(), SCH_EDITOR_CONTROL::ToggleHiddenPins(), 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:215
KIGFX::VIEW_CONTROLS * GetViewControls() const
Definition: tool_manager.h:286

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(), createSheetPin(), COMMON_TOOLS::CursorControl(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), EDIT_TOOL::doMoveSelection(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), COMMON_TOOLS::doZoomToPreset(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::DrawRectangle(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), DrawSheet(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PAD_TOOL::EnumeratePads(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), BOARD_INSPECTION_TOOL::HighlightNet(), SCH_EDITOR_CONTROL::HighlightNet(), BOARD_INSPECTION_TOOL::HighlightNetTool(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), PL_EDIT_TOOL::Main(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), PCB_PICKER_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(), PlaceComponent(), PlaceImage(), PL_DRAWING_TOOLS::PlaceItem(), BOARD_EDITOR_CONTROL::PlaceModule(), 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(), PICKER_TOOL::setControls(), PCB_PICKER_TOOL::setControls(), EE_POINT_EDITOR::setEditedPoint(), PL_POINT_EDITOR::setEditedPoint(), PCB_POINT_EDITOR::setEditedPoint(), SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), TwoClickPlace(), EE_POINT_EDITOR::updateEditedPoint(), PL_POINT_EDITOR::updateEditedPoint(), PCB_POINT_EDITOR::updateEditedPoint(), PCB_POINT_EDITOR::updateItem(), PL_EDIT_TOOL::updateModificationPoint(), EDIT_TOOL::updateModificationPoint(), and COMMON_TOOLS::ZoomCenter().

◆ Go()

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

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:59
void goInternal(TOOL_STATE_FUNC &aState, const TOOL_EVENT_LIST &aConditions)

References TOOL_INTERACTIVE::goInternal().

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

◆ importHierLabel()

SCH_HIERLABEL * SCH_DRAWING_TOOLS::importHierLabel ( SCH_SHEET aSheet)
private

Definition at line 754 of file sch_drawing_tools.cpp.

755 {
756  if( !aSheet->GetScreen() )
757  return nullptr;
758 
759  for( EDA_ITEM* item : aSheet->GetScreen()->Items().OfType( SCH_HIER_LABEL_T ) )
760  {
761  SCH_HIERLABEL* label = static_cast<SCH_HIERLABEL*>( item );
762 
763  /* A global label has been found: check if there a corresponding sheet label. */
764  if( !aSheet->HasPin( label->GetText() ) )
765  return label;
766  }
767 
768  return nullptr;
769 }
EE_TYPE OfType(KICAD_T aType) const
Definition: sch_rtree.h:219
SCH_SCREEN * GetScreen() const
Definition: sch_sheet.h:285
EE_RTREE & Items()
Definition: sch_screen.h:159
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:148
bool HasPin(const wxString &aName) const
Checks if the sheet already has a sheet pin named aName.
Definition: sch_sheet.cpp:311
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:133

References SCH_SHEET::GetScreen(), EDA_TEXT::GetText(), SCH_SHEET::HasPin(), SCH_SCREEN::Items(), EE_RTREE::OfType(), and SCH_HIER_LABEL_T.

Referenced by TwoClickPlace().

◆ Init()

bool SCH_DRAWING_TOOLS::Init ( )
overridevirtual

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

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

Reimplemented from TOOL_BASE.

Definition at line 64 of file sch_drawing_tools.cpp.

65 {
67 
68  auto belowRootSheetCondition =
69  [&]( const SELECTION& aSel )
70  {
71  return m_frame->GetCurrentSheet().Last() != &m_frame->Schematic().Root();
72  };
73 
74  CONDITIONAL_MENU& ctxMenu = m_menu.GetMenu();
75  ctxMenu.AddItem( EE_ACTIONS::leaveSheet, belowRootSheetCondition, 2 );
76 
77  return true;
78 }
TOOL_MENU m_menu
The functions below are not yet implemented - their interface may change.
SCH_SHEET * Last() const
Return a pointer to the last SCH_SHEET of the list.
CONDITIONAL_MENU & GetMenu()
Definition: tool_menu.cpp:46
static TOOL_ACTION leaveSheet
Definition: ee_actions.h:187
bool Init() override
Init() is called once upon a registration of the tool.
Definition: ee_tool_base.h:69
SCHEMATIC & Schematic() const
SCH_SHEET & Root() const
Definition: schematic.h:102
SCH_SHEET_PATH & GetCurrentSheet() const
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(), SCH_EDIT_FRAME::GetCurrentSheet(), TOOL_MENU::GetMenu(), EE_TOOL_BASE< T >::Init(), SCH_SHEET_PATH::Last(), EE_ACTIONS::leaveSheet, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, TOOL_INTERACTIVE::m_menu, SCHEMATIC::Root(), and SCH_EDIT_FRAME::Schematic().

◆ 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:215
TOOL_ID m_toolId
Name of the tool.
Definition: tool_base.h:210
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().

◆ PlaceComponent()

int SCH_DRAWING_TOOLS::PlaceComponent ( const TOOL_EVENT aEvent)

Definition at line 81 of file sch_drawing_tools.cpp.

82 {
83  SCH_COMPONENT* component = aEvent.Parameter<SCH_COMPONENT*>();
84  SCHLIB_FILTER filter;
85  std::vector<PICKED_SYMBOL>* historyList = nullptr;
86 
87  if( aEvent.IsAction( &EE_ACTIONS::placeSymbol ) )
88  {
89  historyList = &m_symbolHistoryList;
90  }
91  else if (aEvent.IsAction( &EE_ACTIONS::placePower ) )
92  {
93  historyList = &m_powerHistoryList;
94  filter.FilterPowerParts( true );
95  }
96  else
97  {
98  wxFAIL_MSG( "PlaceCompontent(): unexpected request" );
99  }
100 
101  getViewControls()->ShowCursor( true );
102 
103  // If a component was passed in get it ready for placement.
104  if( component )
105  {
106  component->SetFlags( IS_NEW | IS_MOVED );
107 
109  m_selectionTool->AddItemToSel( component );
110  }
111 
112  std::string tool = aEvent.GetCommandStr().get();
113  m_frame->PushTool( tool );
114  Activate();
115 
116  // Prime the pump
117  if( component )
118  {
119  getViewControls()->WarpCursor( getViewControls()->GetMousePosition( false ) );
121  }
122  else if( aEvent.HasPosition() )
123  {
125  }
126 
127  auto setCursor =
128  [&]()
129  {
132  };
133 
134  // Set initial cursor
135  setCursor();
136 
137  // Main loop: keep receiving events
138  while( TOOL_EVENT* evt = Wait() )
139  {
140  setCursor();
141  VECTOR2I cursorPos = getViewControls()->GetCursorPosition( !evt->Modifier( MD_ALT ) );
142 
143  auto cleanup =
144  [&] ()
145  {
147  m_view->ClearPreview();
148  delete component;
149  component = nullptr;
150  };
151 
152  if( evt->IsCancelInteractive() )
153  {
154  if( component )
155  {
156  cleanup();
157  }
158  else
159  {
160  m_frame->PopTool( tool );
161  break;
162  }
163  }
164  else if( evt->IsActivate() )
165  {
166  if( component )
167  cleanup();
168 
169  if( evt->IsMoveTool() )
170  {
171  // leave ourselves on the stack so we come back after the move
172  break;
173  }
174  else
175  {
176  m_frame->PopTool( tool );
177  break;
178  }
179  }
180  else if( evt->IsClick( BUT_LEFT ) || evt->IsDblClick( BUT_LEFT ) )
181  {
182  if( !component )
183  {
185 
186  // Pick the footprint to be placed
187  bool footprintPreviews = m_frame->eeconfig()->m_Appearance.footprint_preview;
188  PICKED_SYMBOL sel = m_frame->PickSymbolFromLibTree( &filter, *historyList, true,
189  1, 1, footprintPreviews );
190 
191  // Restore cursor after dialog
192  getViewControls()->WarpCursor( getViewControls()->GetCursorPosition(), true );
193 
194  LIB_PART* part = sel.LibId.IsValid() ? m_frame->GetLibPart( sel.LibId ) : nullptr;
195 
196  if( !part )
197  continue;
198 
199  component = new SCH_COMPONENT( *part, &m_frame->GetCurrentSheet(), sel,
200  (wxPoint) cursorPos );
201  component->SetParent( m_frame->GetCurrentSheet().LastScreen() );
202  component->SetFlags( IS_NEW | IS_MOVED );
203 
205  component->AutoplaceFields( /* aScreen */ NULL, /* aManual */ false );
206 
207  m_frame->SaveCopyForRepeatItem( component );
208 
209  m_view->ClearPreview();
210  m_view->AddToPreview( component->Clone() );
211  m_selectionTool->AddItemToSel( component );
212 
213  // Update cursor now that we have a component
214  setCursor();
215  }
216  else
217  {
218  SCH_COMPONENT* next_comp = nullptr;
219 
220  m_view->ClearPreview();
221  m_frame->AddItemToScreenAndUndoList( m_frame->GetScreen(), component, false );
222 
223  EE_SELECTION new_sel;
224  new_sel.Add( component );
225 
227  m_frame->OnModify();
228 
231  {
232  int new_unit = component->GetUnit();
233 
235  && component->GetUnit() < component->GetUnitCount() )
236  {
237  new_unit++;
238  }
239  else
240  {
241  new_unit = 1;
242  }
243 
244  // We are either stepping to the next unit or next component
245  if( m_frame->eeconfig()->m_SymChooserPanel.keep_symbol || new_unit > 1 )
246  {
247  // Deselect the last placed symbol: obviously we do not want to
248  // apply some changes (like rotation, mirror...) to previously placed
249  // symbols.
251 
252  next_comp = static_cast<SCH_COMPONENT*>( component->Duplicate() );
253  next_comp->SetFlags( IS_NEW | IS_MOVED );
254  next_comp->SetUnit( new_unit );
255  next_comp->SetUnitSelection( &m_frame->GetCurrentSheet(), new_unit );
256 
258  component->AutoplaceFields( /* aScreen */ NULL, /* aManual */ false );
259 
260  m_frame->SaveCopyForRepeatItem( next_comp );
261  m_view->AddToPreview( next_comp->Clone() );
262  m_selectionTool->AddItemToSel( next_comp );
263  }
264  }
265 
266  component = next_comp;
267  }
268  }
269  else if( evt->IsClick( BUT_RIGHT ) )
270  {
271  // Warp after context menu only if dragging...
272  if( !component )
274 
276  }
277  else if( evt->Category() == TC_COMMAND && evt->Action() == TA_CHOICE_MENU_CHOICE )
278  {
279  if( evt->GetCommandId().get() >= ID_POPUP_SCH_SELECT_UNIT_CMP
280  && evt->GetCommandId().get() <= ID_POPUP_SCH_SELECT_UNIT_CMP_MAX )
281  {
282  int unit = evt->GetCommandId().get() - ID_POPUP_SCH_SELECT_UNIT_CMP;
283 
284  if( component )
285  {
286  m_frame->SelectUnit( component, unit );
288  }
289  }
290  }
291  else if( component && ( evt->IsAction( &ACTIONS::refreshPreview ) || evt->IsMotion() ) )
292  {
293  component->SetPosition( (wxPoint)cursorPos );
294  m_view->ClearPreview();
295  m_view->AddToPreview( component->Clone() );
296  }
297  else
298  {
299  evt->SetPassEvent();
300  }
301 
302  // Enable autopanning and cursor capture only when there is a footprint to be placed
303  getViewControls()->SetAutoPan( component != nullptr );
304  getViewControls()->CaptureCursor( component != nullptr );
305  }
306 
308  return 0;
309 }
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.
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.
void AddToPreview(EDA_ITEM *aItem, bool aTakeOwnership=true)
Definition: view.cpp:1554
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:215
virtual void PushTool(const std::string &actionName)
NB: the definition of "tool" is different at the user level.
int GetUnitCount() const
Return the number of units per package of the symbol.
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:141
void SetPosition(const wxPoint &aPosition) override
LIB_PART * GetLibPart(const LIB_ID &aLibId, bool aUseCacheLib=false, bool aShowErrorMsg=false)
Load symbol from symbol library table.
bool IsValid() const
Check if this LID_ID is valid.
Definition: lib_id.h:168
PANEL_SYM_CHOOSER m_SymChooserPanel
std::vector< PICKED_SYMBOL > m_symbolHistoryList
void SetCurrentCursor(KICURSOR cursor)
Set the current cursor shape for this panel.
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:164
virtual void Add(EDA_ITEM *aItem)
Definition: selection.h:77
bool IsAction(const TOOL_ACTION *aAction) const
Test if the event contains an action issued upon activation of the given TOOL_ACTION.
Definition: tool_event.cpp:67
EE_SELECTION & GetSelection()
Function GetSelection()
EESCHEMA_SETTINGS * eeconfig() const
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
virtual void WarpCursor(const VECTOR2D &aPosition, bool aWorldCoordinates=false, bool aWarpView=false)=0
If enabled (.
int GetUnit() const
AUTOPLACE_FIELDS m_AutoplaceFields
static TOOL_ACTION placePower
Definition: ee_actions.h:78
void SetFlags(STATUS_FLAGS aMask)
Definition: eda_item.h:201
SCH_ITEM * Duplicate(bool doClone=false) const
Routine to create a new copy of given item.
Definition: sch_item.cpp:78
#define NULL
virtual void PopTool(const std::string &actionName)
virtual void CaptureCursor(bool aEnabled)
Force the cursor to stay within the drawing panel area.
PICKED_SYMBOL PickSymbolFromLibTree(const SCHLIB_FILTER *aFilter, std::vector< PICKED_SYMBOL > &aHistoryList, bool aUseLibBrowser, int aUnit, int aConvert, bool aShowFootprints, const LIB_ID *aHighlight=nullptr, bool aAllowFields=true)
Function PickSymbolFromLibTree Calls the library viewer to select component to import into schematic.
Definition: getpart.cpp:89
T Parameter() const
Return a non-standard parameter assigned to the event.
Definition: tool_event.h:426
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Generic, UI-independent tool event.
Definition: tool_event.h:170
void ClearPreview()
Definition: view.cpp:1535
Define a library symbol object.
void SaveCopyForRepeatItem(SCH_ITEM *aItem)
Clone aItem and owns that clone in this container.
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:181
void SetUnit(int aUnit)
Change the unit number to aUnit.
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:56
static TOOL_ACTION placeSymbol
Definition: ee_actions.h:77
static TOOL_ACTION addNeededJunctions
Definition: ee_actions.h:75
#define IS_MOVED
Item being moved.
Definition: eda_item.h:105
virtual void SetAutoPan(bool aEnabled)
Turn on/off auto panning (this feature is used when there is a tool active (eg.
void SelectUnit(SCH_COMPONENT *aComponent, int aUnit)
Definition: getpart.cpp:198
std::vector< PICKED_SYMBOL > m_powerHistoryList
OPT< std::string > GetCommandStr() const
Definition: tool_event.h:454
void SetUnitSelection(const SCH_SHEET_PATH *aSheet, int aUnitSelection)
void AddItemToScreenAndUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItem, bool aUndoAppend)
Add an item to the schematic and adds the changes to the undo/redo container.
int AddItemToSel(const TOOL_EVENT &aEvent)
SCH_SCREEN * LastScreen()
int ClearSelection(const TOOL_EVENT &aEvent)
Clear current selection event handler.
void VetoContextMenuMouseWarp()
Disable mouse warping after the current context menu is closed.
Definition: tool_manager.h:423
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
Automatically orient all the fields in the component.
Schematic symbol object.
Definition: sch_component.h:79
void Activate()
Run the tool.
SCH_SHEET_PATH & GetCurrentSheet() const
bool HasPosition() const
Definition: tool_event.h:258
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
KIGFX::VIEW_CONTROLS * getViewControls() const
Return the instance of VIEW_CONTROLS object used in the application.
Definition: tool_base.cpp:42
LIB_ID LibId
Definition: sch_screen.h:82
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
#define IS_NEW
New item, just created.
Definition: eda_item.h:106
static TOOL_ACTION refreshPreview
Definition: actions.h:109
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
static TOOL_ACTION cursorClick
Definition: actions.h:126

References TOOL_INTERACTIVE::Activate(), SELECTION::Add(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), EE_SELECTION_TOOL::AddItemToSel(), EE_ACTIONS::addNeededJunctions, KIGFX::VIEW::AddToPreview(), ARROW, SCH_COMPONENT::AutoplaceFields(), BUT_LEFT, BUT_RIGHT, KIGFX::VIEW_CONTROLS::CaptureCursor(), KIGFX::VIEW::ClearPreview(), EE_ACTIONS::clearSelection, EE_SELECTION_TOOL::ClearSelection(), SCH_COMPONENT::Clone(), COMPONENT, ACTIONS::cursorClick, SCH_ITEM::Duplicate(), SCH_BASE_FRAME::eeconfig(), EESCHEMA_SETTINGS::AUTOPLACE_FIELDS::enable, EESCHEMA_SETTINGS::APPEARANCE::footprint_preview, SCH_BASE_FRAME::GetCanvas(), TOOL_EVENT::GetCommandStr(), SCH_EDIT_FRAME::GetCurrentSheet(), KIGFX::VIEW_CONTROLS::GetCursorPosition(), SCH_BASE_FRAME::GetLibPart(), SCH_EDIT_FRAME::GetScreen(), EE_SELECTION_TOOL::GetSelection(), SCH_COMPONENT::GetUnit(), SCH_COMPONENT::GetUnitCount(), TOOL_BASE::getViewControls(), TOOL_EVENT::HasPosition(), ID_POPUP_SCH_SELECT_UNIT_CMP, ID_POPUP_SCH_SELECT_UNIT_CMP_MAX, IS_MOVED, IS_NEW, TOOL_EVENT::IsAction(), LIB_ID::IsValid(), EESCHEMA_SETTINGS::PANEL_SYM_CHOOSER::keep_symbol, SCH_SHEET_PATH::LastScreen(), PICKED_SYMBOL::LibId, EESCHEMA_SETTINGS::m_Appearance, EESCHEMA_SETTINGS::m_AutoplaceFields, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, TOOL_INTERACTIVE::m_menu, m_powerHistoryList, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, m_symbolHistoryList, EESCHEMA_SETTINGS::m_SymChooserPanel, TOOL_BASE::m_toolMgr, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_view, MD_ALT, MOVING, NULL, SCH_EDIT_FRAME::OnModify(), TOOL_EVENT::Parameter(), SCH_BASE_FRAME::PickSymbolFromLibTree(), EESCHEMA_SETTINGS::PANEL_SYM_CHOOSER::place_all_units, EE_ACTIONS::placePower, EE_ACTIONS::placeSymbol, TOOLS_HOLDER::PopTool(), TOOLS_HOLDER::PushTool(), ACTIONS::refreshPreview, TOOL_MANAGER::RunAction(), SCH_EDIT_FRAME::SaveCopyForRepeatItem(), SCH_EDIT_FRAME::SelectUnit(), KIGFX::VIEW_CONTROLS::SetAutoPan(), EDA_DRAW_PANEL_GAL::SetCurrentCursor(), EDA_ITEM::SetFlags(), EDA_ITEM::SetParent(), SCH_COMPONENT::SetPosition(), SCH_COMPONENT::SetUnit(), SCH_COMPONENT::SetUnitSelection(), TOOL_MENU::ShowContextMenu(), KIGFX::VIEW_CONTROLS::ShowCursor(), TA_CHOICE_MENU_CHOICE, TC_COMMAND, TOOL_MANAGER::VetoContextMenuMouseWarp(), TOOL_INTERACTIVE::Wait(), and KIGFX::VIEW_CONTROLS::WarpCursor().

Referenced by setTransitions().

◆ PlaceImage()

int SCH_DRAWING_TOOLS::PlaceImage ( const TOOL_EVENT aEvent)

Definition at line 312 of file sch_drawing_tools.cpp.

313 {
314  SCH_BITMAP* image = aEvent.Parameter<SCH_BITMAP*>();
315  bool immediateMode = image;
316  VECTOR2I cursorPos = getViewControls()->GetCursorPosition();
317 
319  getViewControls()->ShowCursor( true );
320 
321  // Add all the drawable parts to preview
322  if( image )
323  {
324  image->SetPosition( (wxPoint)cursorPos );
325  m_view->ClearPreview();
326  m_view->AddToPreview( image->Clone() );
327  }
328 
329  std::string tool = aEvent.GetCommandStr().get();
330  m_frame->PushTool( tool );
331  Activate();
332 
333  // Prime the pump
334  if( image )
336  else if( aEvent.HasPosition() )
338 
339  auto setCursor =
340  [&]()
341  {
342  if( image )
344  else
346  };
347 
348  // Set initial cursor
349  setCursor();
350 
351  // Main loop: keep receiving events
352  while( TOOL_EVENT* evt = Wait() )
353  {
354  setCursor();
355  cursorPos = getViewControls()->GetCursorPosition( !evt->Modifier( MD_ALT ) );
356 
357  auto cleanup =
358  [&] ()
359  {
361  m_view->ClearPreview();
362  delete image;
363  image = nullptr;
364  };
365 
366  if( evt->IsCancelInteractive() )
367  {
368  if( image )
369  {
370  cleanup();
371  }
372  else
373  {
374  m_frame->PopTool( tool );
375  break;
376  }
377 
378  if( immediateMode )
379  {
380  m_frame->PopTool( tool );
381  break;
382  }
383  }
384  else if( evt->IsActivate() )
385  {
386  if( image )
387  cleanup();
388 
389  if( evt->IsMoveTool() )
390  {
391  // leave ourselves on the stack so we come back after the move
392  break;
393  }
394  else
395  {
396  m_frame->PopTool( tool );
397  break;
398  }
399  }
400  else if( evt->IsClick( BUT_LEFT ) || evt->IsDblClick( BUT_LEFT ) )
401  {
402  if( !image )
403  {
405  wxFileDialog dlg( m_frame, _( "Choose Image" ), wxEmptyString, wxEmptyString,
406  _( "Image Files" ) + wxS( " " ) + wxImage::GetImageExtWildcard(),
407  wxFD_OPEN );
408 
409  if( dlg.ShowModal() != wxID_OK )
410  continue;
411 
412  // Restore cursor after dialog
413  getViewControls()->WarpCursor( getViewControls()->GetCursorPosition(), true );
414 
415  wxString fullFilename = dlg.GetPath();
416 
417  if( wxFileExists( fullFilename ) )
418  image = new SCH_BITMAP( (wxPoint)cursorPos );
419 
420  if( !image || !image->ReadImageFile( fullFilename ) )
421  {
422  wxMessageBox( _( "Couldn't load image from \"%s\"" ), fullFilename );
423  delete image;
424  image = nullptr;
425  continue;
426  }
427 
428  image->SetFlags( IS_NEW | IS_MOVED );
429 
430  m_frame->SaveCopyForRepeatItem( image );
431 
432  m_view->ClearPreview();
433  m_view->AddToPreview( image->Clone() );
434  m_view->RecacheAllItems(); // Bitmaps are cached in Opengl
435 
436  m_selectionTool->AddItemToSel( image );
437 
438  getViewControls()->SetCursorPosition( cursorPos, false );
439  setCursor();
440  }
441  else
442  {
444  image = nullptr;
446 
447  m_view->ClearPreview();
448 
449  if( immediateMode )
450  {
451  m_frame->PopTool( tool );
452  break;
453  }
454  }
455  }
456  else if( evt->IsClick( BUT_RIGHT ) )
457  {
458  // Warp after context menu only if dragging...
459  if( !image )
461 
463  }
464  else if( image && ( evt->IsAction( &ACTIONS::refreshPreview ) || evt->IsMotion() ) )
465  {
466  image->SetPosition( (wxPoint)cursorPos );
467  m_view->ClearPreview();
468  m_view->AddToPreview( image->Clone() );
469  m_view->RecacheAllItems(); // Bitmaps are cached in Opengl
470  }
471  else
472  {
473  evt->SetPassEvent();
474  }
475 
476  // Enable autopanning and cursor capture only when there is a footprint to be placed
477  getViewControls()->SetAutoPan( image != nullptr );
478  getViewControls()->CaptureCursor( image != nullptr );
479  }
480 
482  return 0;
483 }
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.
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 TOOL_ACTION activatePointEditor
Definition: actions.h:173
void AddToPreview(EDA_ITEM *aItem, bool aTakeOwnership=true)
Definition: view.cpp:1554
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:215
void RecacheAllItems()
Rebuild GAL display lists.
Definition: view.cpp:1377
virtual void PushTool(const std::string &actionName)
NB: the definition of "tool" is different at the user level.
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:141
virtual void SetCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true, bool aTriggeredByArrows=false, long aArrowCommand=0)=0
Move cursor to the requested position expressed in world coordinates.
void SetCurrentCursor(KICURSOR cursor)
Set the current cursor shape for this panel.
EE_SELECTION & GetSelection()
Function GetSelection()
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
virtual void WarpCursor(const VECTOR2D &aPosition, bool aWorldCoordinates=false, bool aWarpView=false)=0
If enabled (.
void SetFlags(STATUS_FLAGS aMask)
Definition: eda_item.h:201
virtual void PopTool(const std::string &actionName)
virtual void CaptureCursor(bool aEnabled)
Force the cursor to stay within the drawing panel area.
T Parameter() const
Return a non-standard parameter assigned to the event.
Definition: tool_event.h:426
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
Generic, UI-independent tool event.
Definition: tool_event.h:170
void ClearPreview()
Definition: view.cpp:1535
void SaveCopyForRepeatItem(SCH_ITEM *aItem)
Clone aItem and owns that clone in this container.
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:181
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:56
#define IS_MOVED
Item being moved.
Definition: eda_item.h:105
Object to handle a bitmap image that can be inserted in a schematic.
Definition: sch_bitmap.h:42
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:454
void AddItemToScreenAndUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItem, bool aUndoAppend)
Add an item to the schematic and adds the changes to the undo/redo container.
int AddItemToSel(const TOOL_EVENT &aEvent)
#define _(s)
Definition: 3d_actions.cpp:33
void VetoContextMenuMouseWarp()
Disable mouse warping after the current context menu is closed.
Definition: tool_manager.h:423
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_bitmap.cpp:89
void Activate()
Run the tool.
bool ReadImageFile(const wxString &aFullFilename)
Reads and stores an image file.
Definition: sch_bitmap.cpp:83
bool HasPosition() const
Definition: tool_event.h:258
KIGFX::VIEW_CONTROLS * getViewControls() const
Return the instance of VIEW_CONTROLS object used in the application.
Definition: tool_base.cpp:42
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
void SetPosition(const wxPoint &aPosition) override
Definition: sch_bitmap.h:141
#define IS_NEW
New item, just created.
Definition: eda_item.h:106
static TOOL_ACTION refreshPreview
Definition: actions.h:109
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
static TOOL_ACTION cursorClick
Definition: actions.h:126

References _, TOOL_INTERACTIVE::Activate(), ACTIONS::activatePointEditor, SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), EE_SELECTION_TOOL::AddItemToSel(), KIGFX::VIEW::AddToPreview(), ARROW, BUT_LEFT, BUT_RIGHT, KIGFX::VIEW_CONTROLS::CaptureCursor(), KIGFX::VIEW::ClearPreview(), EE_ACTIONS::clearSelection, SCH_BITMAP::Clone(), ACTIONS::cursorClick, SCH_BASE_FRAME::GetCanvas(), TOOL_EVENT::GetCommandStr(), KIGFX::VIEW_CONTROLS::GetCursorPosition(), SCH_EDIT_FRAME::GetScreen(), EE_SELECTION_TOOL::GetSelection(), TOOL_BASE::getViewControls(), TOOL_EVENT::HasPosition(), IS_MOVED, IS_NEW, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, TOOL_INTERACTIVE::m_menu, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_view, MD_ALT, MOVING, TOOL_EVENT::Parameter(), PENCIL, TOOLS_HOLDER::PopTool(), TOOLS_HOLDER::PushTool(), SCH_BITMAP::ReadImageFile(), KIGFX::VIEW::RecacheAllItems(), ACTIONS::refreshPreview, TOOL_MANAGER::RunAction(), SCH_EDIT_FRAME::SaveCopyForRepeatItem(), KIGFX::VIEW_CONTROLS::SetAutoPan(), EDA_DRAW_PANEL_GAL::SetCurrentCursor(), KIGFX::VIEW_CONTROLS::SetCursorPosition(), EDA_ITEM::SetFlags(), SCH_BITMAP::SetPosition(), TOOL_MENU::ShowContextMenu(), KIGFX::VIEW_CONTROLS::ShowCursor(), TOOL_MANAGER::VetoContextMenuMouseWarp(), TOOL_INTERACTIVE::Wait(), and KIGFX::VIEW_CONTROLS::WarpCursor().

Referenced by setTransitions().

◆ Reset()

void EE_TOOL_BASE< SCH_EDIT_FRAME >::Reset ( RESET_REASON  aReason)
inlineoverridevirtualinherited

Bring the tool to a known, initial state.

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

Parameters
aReasoncontains information about the reason of tool reset.

Implements TOOL_BASE.

Definition at line 90 of file ee_tool_base.h.

91  {
92  if( aReason == MODEL_RELOAD )
93  {
94  // Init variables used by every drawing tool
95  m_frame = getEditFrame<T>();
96  m_isSymbolEditor = dynamic_cast<SYMBOL_EDIT_FRAME*>( m_frame ) != nullptr;
97  }
98 
99  m_view = static_cast<KIGFX::SCH_VIEW*>( getView() );
100  }
Model changes (required full reload)
Definition: tool_base.h:81
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition: tool_base.cpp:36

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

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

Referenced by DRAWING_TOOL::PlaceText().

◆ saveCopyInUndoList()

void EE_TOOL_BASE< SCH_EDIT_FRAME >::saveCopyInUndoList ( EDA_ITEM aItem,
UNDO_REDO  aType,
bool  aAppend = false 
)
inlineprotectedinherited

Similar to m_frame->SaveCopyInUndoList(), but handles items that are owned by their parents.

Definition at line 138 of file ee_tool_base.h.

139  {
140  KICAD_T itemType = aItem->Type();
141  bool selected = aItem->IsSelected();
142 
143  // IS_SELECTED flag should not be set on undo items which were added for
144  // a drag operation.
145  if( selected && aItem->HasFlag( TEMP_SELECTED ) )
146  aItem->ClearSelected();
147 
148  if( m_isSymbolEditor )
149  {
150  SYMBOL_EDIT_FRAME* editFrame = dynamic_cast<SYMBOL_EDIT_FRAME*>( m_frame );
151  wxASSERT( editFrame );
152 
153  editFrame->SaveCopyInUndoList( static_cast<LIB_ITEM*>( aItem ), aType, aAppend );
154  }
155  else
156  {
157  SCH_EDIT_FRAME* editFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
158  wxASSERT( editFrame );
159 
160  if( itemType == SCH_PIN_T || itemType == SCH_FIELD_T || itemType == SCH_SHEET_PIN_T )
161  {
162  editFrame->SaveCopyInUndoList( editFrame->GetScreen(),
163  static_cast<SCH_ITEM*>( aItem->GetParent() ),
164  UNDO_REDO::CHANGED, aAppend );
165  }
166  else
167  {
168  editFrame->SaveCopyInUndoList( editFrame->GetScreen(),
169  static_cast<SCH_ITEM*>( aItem ),
170  aType, aAppend );
171  }
172  }
173 
174  if( selected && aItem->HasFlag( TEMP_SELECTED ) )
175  aItem->SetSelected();
176  }
bool IsSelected() const
Definition: eda_item.h:171
void ClearSelected()
Definition: eda_item.h:180
Schematic editor (Eeschema) main window.
#define TEMP_SELECTED
flag indicating that the structure has already selected
Definition: eda_item.h:114
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void SetSelected()
Definition: eda_item.h:177
void SaveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO aUndoType=UNDO_REDO::LIBEDIT, bool aAppend=false)
Create a copy of the current symbol, and save it in the undo list.
void SaveCopyInUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItemToCopy, UNDO_REDO aTypeCommand, bool aAppend, const wxPoint &aTransformPoint=wxPoint(0, 0))
Create a copy of the current schematic item, and put it in the undo list.
EDA_ITEM * GetParent() const
Definition: eda_item.h:163
bool HasFlag(STATUS_FLAGS aFlag) const
Definition: eda_item.h:204
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:161
The symbol library editor main window.

◆ 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:215
void SetTool(TOOL_INTERACTIVE *aTool)
Set a tool that is the creator of the menu.
void ScheduleContextMenu(TOOL_BASE *aTool, ACTION_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger)
Set behavior of the tool's context popup menu.

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

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

◆ setTransitions()

void SCH_DRAWING_TOOLS::setTransitions ( )
overrideprivatevirtual

Sets up handlers for various events.

Implements TOOL_INTERACTIVE.

Definition at line 1198 of file sch_drawing_tools.cpp.

1199 {
1212 }
int TwoClickPlace(const TOOL_EVENT &aEvent)
int PlaceComponent(const TOOL_EVENT &aEvent)
static TOOL_ACTION placeHierLabel
Definition: ee_actions.h:87
static TOOL_ACTION placeJunction
Definition: ee_actions.h:83
static TOOL_ACTION placeBusWireEntry
Definition: ee_actions.h:84
int PlaceImage(const TOOL_EVENT &aEvent)
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Define which state (aStateFunc) to go when a certain event arrives (aConditions).
static TOOL_ACTION drawSheet
Definition: ee_actions.h:88
static TOOL_ACTION placePower
Definition: ee_actions.h:78
int SingleClickPlace(const TOOL_EVENT &aEvent)
static TOOL_ACTION placeSchematicText
Definition: ee_actions.h:91
static TOOL_ACTION placeImage
Definition: ee_actions.h:93
static TOOL_ACTION importSheetPin
Definition: ee_actions.h:90
static TOOL_ACTION placeSymbol
Definition: ee_actions.h:77
static TOOL_ACTION placeLabel
Definition: ee_actions.h:85
static TOOL_ACTION placeNoConnect
Definition: ee_actions.h:82
static TOOL_ACTION placeGlobalLabel
Definition: ee_actions.h:86
int DrawSheet(const TOOL_EVENT &aEvent)

References DrawSheet(), EE_ACTIONS::drawSheet, TOOL_INTERACTIVE::Go(), EE_ACTIONS::importSheetPin, EE_ACTIONS::placeBusWireEntry, PlaceComponent(), EE_ACTIONS::placeGlobalLabel, EE_ACTIONS::placeHierLabel, PlaceImage(), EE_ACTIONS::placeImage, EE_ACTIONS::placeJunction, EE_ACTIONS::placeLabel, EE_ACTIONS::placeNoConnect, EE_ACTIONS::placePower, EE_ACTIONS::placeSchematicText, EE_ACTIONS::placeSymbol, SingleClickPlace(), and TwoClickPlace().

◆ SingleClickPlace()

int SCH_DRAWING_TOOLS::SingleClickPlace ( const TOOL_EVENT aEvent)

Definition at line 486 of file sch_drawing_tools.cpp.

487 {
488  wxPoint cursorPos;
489  KICAD_T type = aEvent.Parameter<KICAD_T>();
490 
491  if( type == SCH_JUNCTION_T && aEvent.HasPosition() )
492  {
493  EE_SELECTION& selection = m_selectionTool->GetSelection();
494  SCH_LINE* wire = dynamic_cast<SCH_LINE*>( selection.Front() );
495 
496  if( wire )
497  {
498  SEG seg( wire->GetStartPoint(), wire->GetEndPoint() );
499  VECTOR2I nearest = seg.NearestPoint( getViewControls()->GetCursorPosition() );
500  getViewControls()->SetCrossHairCursorPosition( nearest, false );
501  getViewControls()->WarpCursor( getViewControls()->GetCursorPosition(), true );
502  }
503  }
504 
506  getViewControls()->ShowCursor( true );
507 
508  SCH_ITEM* previewItem;
509  switch( type )
510  {
511  case SCH_NO_CONNECT_T:
512  previewItem = new SCH_NO_CONNECT( cursorPos );
513  break;
514  case SCH_JUNCTION_T:
515  previewItem = new SCH_JUNCTION( cursorPos );
516  break;
518  previewItem = new SCH_BUS_WIRE_ENTRY( cursorPos );
519  break;
520  default:
521  wxASSERT_MSG( false, "Unknown item type in SCH_DRAWING_TOOLS::SingleClickPlace" );
522  return 0;
523  }
524 
525  previewItem->SetParent( m_frame->GetScreen() );
526 
527  m_view->ClearPreview();
528  m_view->AddToPreview( previewItem->Clone() );
529 
530  std::string tool = aEvent.GetCommandStr().get();
531  m_frame->PushTool( tool );
532  Activate();
533 
534  // Prime the pump
535  if( aEvent.HasPosition() )
537  else
539 
540  auto setCursor =
541  [&]()
542  {
544  };
545 
546  // Set initial cursor
547  setCursor();
548 
549  // Main loop: keep receiving events
550  while( TOOL_EVENT* evt = Wait() )
551  {
552  setCursor();
553  cursorPos = (wxPoint) getViewControls()->GetCursorPosition( !evt->Modifier( MD_ALT ) );
554 
555  if( evt->IsCancelInteractive() )
556  {
557  m_frame->PopTool( tool );
558  break;
559  }
560  else if( evt->IsActivate() )
561  {
562  if( evt->IsMoveTool() )
563  {
564  // leave ourselves on the stack so we come back after the move
565  break;
566  }
567  else
568  {
569  m_frame->PopTool( tool );
570  break;
571  }
572  }
573  else if( evt->IsClick( BUT_LEFT ) || evt->IsDblClick( BUT_LEFT ) )
574  {
575  if( !m_frame->GetScreen()->GetItem( cursorPos, 0, type ) )
576  {
577  SCH_ITEM* newItem = static_cast<SCH_ITEM*>( previewItem->Clone() );
578  newItem->SetPosition( cursorPos );
579  newItem->SetFlags( IS_NEW );
580 
581  m_frame->AddItemToScreenAndUndoList( m_frame->GetScreen(), newItem, false );
582  m_frame->SaveCopyForRepeatItem( newItem );
583 
584  if( type == SCH_JUNCTION_T )
586  else
588 
589  m_frame->OnModify();
590  }
591 
592  if( evt->IsDblClick( BUT_LEFT ) ) // Finish tool.
593  {
594  m_frame->PopTool( tool );
595  break;
596  }
597  }
598  else if( evt->IsClick( BUT_RIGHT ) )
599  {
601  }
602  else if( evt->IsAction( &ACTIONS::refreshPreview ) || evt->IsMotion() )
603  {
604  previewItem->SetPosition( (wxPoint)cursorPos );
605  m_view->ClearPreview();
606  m_view->AddToPreview( previewItem->Clone() );
607  }
608  else if( evt->Category() == TC_COMMAND )
609  {
610  if( ( type == SCH_BUS_WIRE_ENTRY_T )
611  && ( evt->IsAction( &EE_ACTIONS::rotateCW )
612  || evt->IsAction( &EE_ACTIONS::rotateCCW )
613  || evt->IsAction( &EE_ACTIONS::mirrorX )
614  || evt->IsAction( &EE_ACTIONS::mirrorY ) ) )
615  {
616  SCH_BUS_ENTRY_BASE* busItem = static_cast<SCH_BUS_ENTRY_BASE*>( previewItem );
617 
618  // The bus entries only rotate in one direction
619  if( evt->IsAction( &EE_ACTIONS::rotateCW )
620  || evt->IsAction( &EE_ACTIONS::rotateCCW ) )
621  {
622  busItem->Rotate( busItem->GetPosition() );
623  }
624  else if( evt->IsAction( &EE_ACTIONS::mirrorX ) )
625  {
626  busItem->MirrorX( busItem->GetPosition().x );
627  }
628  else if( evt->IsAction( &EE_ACTIONS::mirrorY ) )
629  {
630  busItem->MirrorY( busItem->GetPosition().y );
631  }
632 
633  m_view->ClearPreview();
634  m_view->AddToPreview( previewItem->Clone() );
635  }
636  else if( evt->IsAction( &EE_ACTIONS::properties ) )
637  {
638  switch( type )
639  {
641  {
642  std::deque<SCH_ITEM*> strokeItems;
643  strokeItems.push_back( previewItem );
644 
645  DIALOG_EDIT_LINE_STYLE dlg( m_frame, strokeItems );
646 
647  if( dlg.ShowModal() == wxID_OK )
648  {
650  m_frame->OnModify();
651  }
652  }
653  break;
654 
655  case SCH_JUNCTION_T:
656  {
657  std::deque<SCH_JUNCTION*> junctions;
658  junctions.push_back( static_cast<SCH_JUNCTION*>( previewItem ) );
659 
660  DIALOG_JUNCTION_PROPS dlg( m_frame, junctions );
661 
662  if( dlg.ShowModal() == wxID_OK )
663  {
665  m_frame->OnModify();
666  }
667  }
668  break;
669  default:
670  // Do nothing
671  break;
672  }
673 
674  m_view->ClearPreview();
675  m_view->AddToPreview( previewItem->Clone() );
676  }
677  else
678  {
679  evt->SetPassEvent();
680  }
681  }
682  else
683  {
684  evt->SetPassEvent();
685  }
686  }
687 
688  delete previewItem;
689  m_view->ClearPreview();
690 
692  return 0;
693 }
virtual void ShowCursor(bool aEnabled)
Enable or disables display of cursor.
static TOOL_ACTION properties
Definition: ee_actions.h:121
bool SchematicCleanUp(SCH_SCREEN *aScreen=nullptr)
Performs routine schematic cleaning including breaking wire and buses and deleting identical objects ...
TOOL_MENU m_menu
The functions below are not yet implemented - their interface may change.
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.
wxPoint GetStartPoint() const
Definition: sch_line.h:94
virtual void SetPosition(const wxPoint &aPos)
Definition: eda_item.h:301
void AddToPreview(EDA_ITEM *aItem, bool aTakeOwnership=true)
Definition: view.cpp:1554
static TOOL_ACTION mirrorY
Definition: ee_actions.h:120
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:215
virtual void PushTool(const std::string &actionName)
NB: the definition of "tool" is different at the user level.
void Rotate(wxPoint aPosition) override
Rotate the item around aPosition 90 degrees in the clockwise direction.
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:141
void SetCurrentCursor(KICURSOR cursor)
Set the current cursor shape for this panel.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
Definition: actions.h:216
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:164
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
Definition: eda_item.cpp:97
static TOOL_ACTION rotateCW
Definition: ee_actions.h:117
Base class for a bus or wire entry.
Definition: sch_bus_entry.h:42
EE_SELECTION & GetSelection()
Function GetSelection()
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
virtual void WarpCursor(const VECTOR2D &aPosition, bool aWorldCoordinates=false, bool aWarpView=false)=0
If enabled (.
static TOOL_ACTION rotateCCW
Definition: ee_actions.h:118
void SetFlags(STATUS_FLAGS aMask)
Definition: eda_item.h:201
void TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
virtual void PopTool(const std::string &actionName)
T Parameter() const
Return a non-standard parameter assigned to the event.
Definition: tool_event.h:426
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
Generic, UI-independent tool event.
Definition: tool_event.h:170
void ClearPreview()
Definition: view.cpp:1535
void SaveCopyForRepeatItem(SCH_ITEM *aItem)
Clone aItem and owns that clone in this container.
static TOOL_ACTION mirrorX
Definition: ee_actions.h:119
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:181
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:56
virtual void SetCrossHairCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true)=0
Move the graphic crosshair cursor to the requested position expressed in world coordinates.
Definition: seg.h:39
OPT< std::string > GetCommandStr() const
Definition: tool_event.h:454
void AddItemToScreenAndUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItem, bool aUndoAppend)
Add an item to the schematic and adds the changes to the undo/redo container.
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:37
void MirrorX(int aXaxis_position) override
Mirror item relative to the X axis about aXaxis_position.
Class for a wire to bus entry.
void Activate()
Run the tool.
SCH_ITEM * GetItem(const wxPoint &aPosition, int aAccuracy=0, KICAD_T aType=SCH_LOCATE_ANY_T)
Check aPosition within a distance of aAccuracy for items of type aFilter.
Definition: sch_screen.cpp:310
bool HasPosition() const
Definition: tool_event.h:258
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
KIGFX::VIEW_CONTROLS * getViewControls() const
Return the instance of VIEW_CONTROLS object used in the application.
Definition: tool_base.cpp:42
void PostEvent(const TOOL_EVENT &aEvent)
Put an event to the event queue to be processed at the end of event processing cycle.
Definition: tool_manager.h:267
void MirrorY(int aYaxis_position) override
Mirror item relative to the Y axis about aYaxis_position.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194
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
#define IS_NEW
New item, just created.
Definition: eda_item.h:106
static TOOL_ACTION refreshPreview
Definition: actions.h:109
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
EDA_ITEM * Front() const
Definition: selection.h:203
static TOOL_ACTION cursorClick
Definition: actions.h:126
wxPoint GetPosition() const override
wxPoint GetEndPoint() const
Definition: sch_line.h:97

References TOOL_INTERACTIVE::Activate(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), KIGFX::VIEW::AddToPreview(), ARROW, BUT_LEFT, BUT_RIGHT, KIGFX::VIEW::ClearPreview(), EE_ACTIONS::clearSelection, EDA_ITEM::Clone(), ACTIONS::cursorClick, SELECTION::Front(), SCH_BASE_FRAME::GetCanvas(), TOOL_EVENT::GetCommandStr(), KIGFX::VIEW_CONTROLS::GetCursorPosition(), SCH_LINE::GetEndPoint(), SCH_SCREEN::GetItem(), SCH_BUS_ENTRY_BASE::GetPosition(), SCH_EDIT_FRAME::GetScreen(), EE_SELECTION_TOOL::GetSelection(), SCH_LINE::GetStartPoint(), TOOL_BASE::getViewControls(), TOOL_EVENT::HasPosition(), IS_NEW, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, TOOL_INTERACTIVE::m_menu, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_view, MD_ALT, SCH_BUS_ENTRY_BASE::MirrorX(), EE_ACTIONS::mirrorX, SCH_BUS_ENTRY_BASE::MirrorY(), EE_ACTIONS::mirrorY, SCH_EDIT_FRAME::OnModify(), TOOL_EVENT::Parameter(), PLACE, TOOLS_HOLDER::PopTool(), TOOL_MANAGER::PostEvent(), EE_ACTIONS::properties, TOOLS_HOLDER::PushTool(), ACTIONS::refreshPreview, SCH_BUS_ENTRY_BASE::Rotate(), EE_ACTIONS::rotateCCW, EE_ACTIONS::rotateCW, TOOL_MANAGER::RunAction(), SCH_EDIT_FRAME::SaveCopyForRepeatItem(), SCH_BUS_WIRE_ENTRY_T, SCH_JUNCTION_T, SCH_NO_CONNECT_T, SCH_EDIT_FRAME::SchematicCleanUp(), EVENTS::SelectedItemsModified, KIGFX::VIEW_CONTROLS::SetCrossHairCursorPosition(), EDA_DRAW_PANEL_GAL::SetCurrentCursor(), EDA_ITEM::SetFlags(), EDA_ITEM::SetParent(), EDA_ITEM::SetPosition(), TOOL_MENU::ShowContextMenu(), KIGFX::VIEW_CONTROLS::ShowCursor(), TC_COMMAND, SCH_EDIT_FRAME::TestDanglingEnds(), TOOL_INTERACTIVE::Wait(), and KIGFX::VIEW_CONTROLS::WarpCursor().

Referenced by setTransitions().

◆ sizeSheet()

void SCH_DRAWING_TOOLS::sizeSheet ( SCH_SHEET aSheet,
VECTOR2I  aPos 
)
private

Definition at line 1185 of file sch_drawing_tools.cpp.

1186 {
1187  wxPoint pos = aSheet->GetPosition();
1188  wxPoint size = (wxPoint) aPos - pos;
1189 
1190  size.x = std::max( size.x, MIN_SHEET_WIDTH );
1191  size.y = std::max( size.y, MIN_SHEET_HEIGHT );
1192 
1193  wxPoint grid = m_frame->GetNearestGridPosition( pos + size );
1194  aSheet->Resize( wxSize( grid.x - pos.x, grid.y - pos.y ) );
1195 }
wxPoint GetNearestGridPosition(const wxPoint &aPosition) const
Return the nearest aGridSize location to aPosition.
#define MIN_SHEET_WIDTH
Definition: sch_sheet.h:43
wxPoint GetPosition() const override
Definition: sch_sheet.h:572
#define MIN_SHEET_HEIGHT
Definition: sch_sheet.h:44
void Resize(const wxSize &aSize)
Resize this sheet to aSize and adjust all of the labels accordingly.
Definition: sch_sheet.cpp:778

References EDA_DRAW_FRAME::GetNearestGridPosition(), SCH_SHEET::GetPosition(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, MIN_SHEET_HEIGHT, MIN_SHEET_WIDTH, SCH_SHEET::Resize(), and VECTOR2< T >::x.

Referenced by DrawSheet().

◆ TwoClickPlace()

int SCH_DRAWING_TOOLS::TwoClickPlace ( const TOOL_EVENT aEvent)

Definition at line 808 of file sch_drawing_tools.cpp.

809 {
810  SCH_ITEM* item = nullptr;
812  EE_GRID_HELPER grid( m_toolMgr );
813 
814  bool isImportMode = aEvent.IsAction( &EE_ACTIONS::importSheetPin );
815  bool isText = aEvent.IsAction( &EE_ACTIONS::placeSchematicText );
816  bool isGlobalLabel = aEvent.IsAction( &EE_ACTIONS::placeGlobalLabel );
817  bool isHierLabel = aEvent.IsAction( &EE_ACTIONS::placeHierLabel );
818  bool isNetLabel = aEvent.IsAction( &EE_ACTIONS::placeLabel );
819  KICAD_T type = aEvent.Parameter<KICAD_T>();
820  int snapLayer = isText ? LAYER_GRAPHICS : LAYER_CONNECTABLE;
821 
823  controls->ShowCursor( true );
824 
825  std::string tool = aEvent.GetCommandStr().get();
826  m_frame->PushTool( tool );
827  Activate();
828 
829  // Prime the pump
830  if( aEvent.HasPosition() )
832 
833  auto setCursor =
834  [&]()
835  {
836  if( item )
838  else if( isText )
840  else if( isGlobalLabel )
842  else if( isNetLabel )
844  else if( isHierLabel )
846  else
848  };
849 
850  // Set initial cursor
851  setCursor();
852 
853  // Main loop: keep receiving events
854  while( TOOL_EVENT* evt = Wait() )
855  {
856  setCursor();
857  grid.SetSnap( !evt->Modifier( MD_SHIFT ) );
858  grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->Modifier( MD_ALT ) );
859 
860  VECTOR2I cursorPos = grid.BestSnapAnchor( controls->GetCursorPosition( false ), snapLayer,
861  item );
862 
863  auto cleanup =
864  [&] ()
865  {
867  m_view->ClearPreview();
868  delete item;
869  item = nullptr;
870  };
871 
872  if( evt->IsCancelInteractive() )
873  {
874  if( item )
875  {
876  cleanup();
877  }
878  else
879  {
880  m_frame->PopTool( tool );
881  break;
882  }
883  }
884  else if( evt->IsActivate() )
885  {
886  if( item )
887  cleanup();
888 
889  if( evt->IsPointEditor() )
890  {
891  // don't exit (the point editor runs in the background)
892  }
893  else if( evt->IsMoveTool() )
894  {
895  // leave ourselves on the stack so we come back after the move
896  break;
897  }
898  else
899  {
900  m_frame->PopTool( tool );
901  break;
902  }
903  }
904  else if( evt->IsClick( BUT_LEFT ) || evt->IsDblClick( BUT_LEFT ) )
905  {
906  // First click creates...
907  if( !item )
908  {
910 
911  switch( type )
912  {
913  case SCH_LABEL_T:
914  item = createNewText( cursorPos, LAYER_LOCLABEL );
915  break;
916  case SCH_HIER_LABEL_T:
917  item = createNewText( cursorPos, LAYER_HIERLABEL );
918  break;
919  case SCH_GLOBAL_LABEL_T:
920  item = createNewText( cursorPos, LAYER_GLOBLABEL );
921  break;
922  case SCH_TEXT_T:
923  item = createNewText( cursorPos, LAYER_NOTES );
924  break;
925  case SCH_SHEET_PIN_T:
926  {
927  EDA_ITEM* i;
928  SCH_HIERLABEL* label = nullptr;
929  SCH_SHEET* sheet = nullptr;
930 
931  if( m_selectionTool->SelectPoint( cursorPos, EE_COLLECTOR::SheetsOnly, &i ) )
932  sheet = dynamic_cast<SCH_SHEET*>( i );
933 
934  item = nullptr;
935 
936  if( !sheet )
937  {
938  m_statusPopup.reset( new STATUS_TEXT_POPUP( m_frame ) );
939  m_statusPopup->SetText( _( "Click over a sheet." ) );
940  m_statusPopup->Move( wxGetMousePosition() + wxPoint( 20, 20 ) );
941  m_statusPopup->PopupFor( 2000 );
942  break;
943  }
944 
945  if( isImportMode )
946  {
947  label = importHierLabel( sheet );
948 
949  if( !label )
950  {
951  m_statusPopup.reset( new STATUS_TEXT_POPUP( m_frame ) );
952  m_statusPopup->SetText( _( "No new hierarchical labels found." ) );
953  m_statusPopup->Move( wxGetMousePosition() + wxPoint( 20, 20 ) );
954  m_statusPopup->PopupFor( 2000 );
955  break;
956  }
957  }
958 
959  item = createSheetPin( sheet, label );
960  break;
961  }
962  default:
963  break;
964  }
965 
966  // Restore cursor after dialog
967  controls->WarpCursor( controls->GetCursorPosition(), true );
968 
969  if( item )
970  {
971  item->SetFlags( IS_NEW | IS_MOVED );
972  m_view->ClearPreview();
973  m_view->AddToPreview( item->Clone() );
974  m_selectionTool->AddItemToSel( item );
975 
976  // update the cursor so it looks correct before another event
977  setCursor();
978  }
979 
980  controls->SetCursorPosition( cursorPos, false );
981  }
982 
983  // ... and second click places:
984  else
985  {
986  item->ClearFlags( IS_MOVED );
987  item->AutoplaceFields( /* aScreen */ nullptr, /* aManual */ false );
988 
990  item = nullptr;
991 
992  m_view->ClearPreview();
993  }
994  }
995  else if( evt->IsClick( BUT_RIGHT ) )
996  {
997  // Warp after context menu only if dragging...
998  if( !item )
1000 
1002  }
1003  else if( item && evt->IsSelectionEvent() )
1004  {
1005  // This happens if our text was replaced out from under us by ConvertTextType()
1006  EE_SELECTION& selection = m_selectionTool->GetSelection();
1007 
1008  if( selection.GetSize() == 1 )
1009  {
1010  item = (SCH_ITEM*) selection.Front();
1011  m_view->ClearPreview();
1012  m_view->AddToPreview( item->Clone() );
1013  }
1014  else
1015  {
1016  item = nullptr;
1017  }
1018  }
1019  else if( item && ( evt->IsAction( &ACTIONS::refreshPreview ) || evt->IsMotion() ) )
1020  {
1021  static_cast<SCH_ITEM*>( item )->SetPosition( (wxPoint) cursorPos );
1022  m_view->ClearPreview();
1023  m_view->AddToPreview( item->Clone() );
1024  }
1025  else
1026  {
1027  evt->SetPassEvent();
1028  }
1029 
1030  // Enable autopanning and cursor capture only when there is a footprint to be placed
1031  controls->SetAutoPan( item != nullptr );
1032  controls->CaptureCursor( item != nullptr );
1033  }
1034 
1036  return 0;
1037 }
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.
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.
SCH_SHEET_PIN * createSheetPin(SCH_SHEET *aSheet, SCH_HIERLABEL *aLabel)
virtual void SetPosition(const wxPoint &aPos)
Definition: eda_item.h:301
void AddToPreview(EDA_ITEM *aItem, bool aTakeOwnership=true)
Definition: view.cpp:1554
Extension of STATUS_POPUP for displaying a single line text.
Definition: status_popup.h:79
static TOOL_ACTION placeHierLabel
Definition: ee_actions.h:87
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:215
virtual void PushTool(const std::string &actionName)
NB: the definition of "tool" is different at the user level.
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:141
virtual void SetCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true, bool aTriggeredByArrows=false, long aArrowCommand=0)=0
Move cursor to the requested position expressed in world coordinates.
static const KICAD_T SheetsOnly[]
Definition: ee_collectors.h:48
void SetCurrentCursor(KICURSOR cursor)
Set the current cursor shape for this panel.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
Definition: eda_item.cpp:97
bool IsAction(const TOOL_ACTION *aAction) const
Test if the event contains an action issued upon activation of the given TOOL_ACTION.
Definition: tool_event.cpp:67
EE_SELECTION & GetSelection()
Function GetSelection()
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
virtual void WarpCursor(const VECTOR2D &aPosition, bool aWorldCoordinates=false, bool aWarpView=false)=0
If enabled (.
void SetFlags(STATUS_FLAGS aMask)
Definition: eda_item.h:201
virtual void PopTool(const std::string &actionName)
virtual void CaptureCursor(bool aEnabled)
Force the cursor to stay within the drawing panel area.
T Parameter() const
Return a non-standard parameter assigned to the event.
Definition: tool_event.h:426
virtual void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual)
Definition: sch_item.h:473
static TOOL_ACTION placeSchematicText
Definition: ee_actions.h:91
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
Generic, UI-independent tool event.
Definition: tool_event.h:170
void ClearPreview()
Definition: view.cpp:1535
An interface for classes handling user events controlling the view behavior such as zooming,...
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:181
static TOOL_ACTION importSheetPin
Definition: ee_actions.h:90
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:56
#define IS_MOVED
Item being moved.
Definition: eda_item.h:105
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.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:219
virtual unsigned int GetSize() const override
Return the number of stored items.
Definition: selection.h:101
static TOOL_ACTION placeLabel
Definition: ee_actions.h:85
OPT< std::string > GetCommandStr() const
Definition: tool_event.h:454
void AddItemToScreenAndUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItem, bool aUndoAppend)
Add an item to the schematic and adds the changes to the undo/redo container.
int AddItemToSel(const TOOL_EVENT &aEvent)
bool SelectPoint(const VECTOR2I &aWhere, const KICAD_T *aFilterList=EE_COLLECTOR::AllItems, EDA_ITEM **aItem=nullptr, bool *aSelectionCancelledFlag=nullptr, bool aCheckLocked=false, bool aAdd=false, bool aSubtract=false, bool aExclusiveOr=false)
Function SelectPoint() This overload of SelectPoint will create an EE_COLLECTOR and collect hits at l...
SCH_HIERLABEL * importHierLabel(SCH_SHEET *aSheet)
#define _(s)
Definition: 3d_actions.cpp:33
void VetoContextMenuMouseWarp()
Disable mouse warping after the current context menu is closed.
Definition: tool_manager.h:423
SCH_TEXT * createNewText(const VECTOR2I &aPosition, int aType)
Gets the next queued text item.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:148
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: eda_item.h:202
void Activate()
Run the tool.
bool HasPosition() const
Definition: tool_event.h:258
KIGFX::VIEW_CONTROLS * getViewControls() const
Return the instance of VIEW_CONTROLS object used in the application.
Definition: tool_base.cpp:42
static TOOL_ACTION placeGlobalLabel
Definition: ee_actions.h:86
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194
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
#define IS_NEW
New item, just created.
Definition: eda_item.h:106
static TOOL_ACTION refreshPreview
Definition: actions.h:109
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
EDA_ITEM * Front() const
Definition: selection.h:203
static TOOL_ACTION cursorClick
Definition: actions.h:126
std::unique_ptr< STATUS_TEXT_POPUP > m_statusPopup

References _, TOOL_INTERACTIVE::Activate(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), EE_SELECTION_TOOL::AddItemToSel(), KIGFX::VIEW::AddToPreview(), ARROW, SCH_ITEM::AutoplaceFields(), EE_GRID_HELPER::BestSnapAnchor(), BUT_LEFT, BUT_RIGHT, KIGFX::VIEW_CONTROLS::CaptureCursor(), EDA_ITEM::ClearFlags(), KIGFX::VIEW::ClearPreview(), EE_ACTIONS::clearSelection, EDA_ITEM::Clone(), createNewText(), createSheetPin(), ACTIONS::cursorClick, SELECTION::Front(), SCH_BASE_FRAME::GetCanvas(), TOOL_EVENT::GetCommandStr(), KIGFX::VIEW_CONTROLS::GetCursorPosition(), SCH_EDIT_FRAME::GetScreen(), EE_SELECTION_TOOL::GetSelection(), SELECTION::GetSize(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), TOOL_EVENT::HasPosition(), importHierLabel(), EE_ACTIONS::importSheetPin, IS_MOVED, IS_NEW, TOOL_EVENT::IsAction(), LABEL_GLOBAL, LABEL_HIER, LABEL_NET, LAYER_CONNECTABLE, LAYER_GLOBLABEL, LAYER_GRAPHICS, LAYER_HIERLABEL, LAYER_LOCLABEL, LAYER_NOTES, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, TOOL_INTERACTIVE::m_menu, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, m_statusPopup, TOOL_BASE::m_toolMgr, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_view, MD_ALT, MD_SHIFT, TOOL_EVENT::Parameter(), PENCIL, PLACE, EE_ACTIONS::placeGlobalLabel, EE_ACTIONS::placeHierLabel, EE_ACTIONS::placeLabel, EE_ACTIONS::placeSchematicText, TOOLS_HOLDER::PopTool(), TOOLS_HOLDER::PushTool(), ACTIONS::refreshPreview, TOOL_MANAGER::RunAction(), SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, SCH_SHEET_PIN_T, SCH_TEXT_T, EE_SELECTION_TOOL::SelectPoint(), KIGFX::VIEW_CONTROLS::SetAutoPan(), EDA_DRAW_PANEL_GAL::SetCurrentCursor(), KIGFX::VIEW_CONTROLS::SetCursorPosition(), EDA_ITEM::SetFlags(), EDA_ITEM::SetPosition(), GRID_HELPER::SetSnap(), GRID_HELPER::SetUseGrid(), EE_COLLECTOR::SheetsOnly, TOOL_MENU::ShowContextMenu(), KIGFX::VIEW_CONTROLS::ShowCursor(), TEXT, TOOL_MANAGER::VetoContextMenuMouseWarp(), TOOL_INTERACTIVE::Wait(), and KIGFX::VIEW_CONTROLS::WarpCursor().

Referenced by setTransitions().

◆ updateItem()

void EE_TOOL_BASE< SCH_EDIT_FRAME >::updateItem ( EDA_ITEM aItem,
bool  aUpdateRTree 
) const
inlineprotectedinherited

Similar to getView()->Update(), but handles items that are redrawn by their parents and updating the SCH_SCREEN's RTree.

Definition at line 107 of file ee_tool_base.h.

108  {
109  switch( aItem->Type() )
110  {
111  case SCH_SHEET_PIN_T:
112  getView()->Update( aItem );
113  getView()->Update( aItem->GetParent() );
114 
115  // Moving sheet pins does not change the BBox.
116  break;
117 
118  case SCH_PIN_T:
119  case SCH_FIELD_T:
120  getView()->Update( aItem );
121  getView()->Update( aItem->GetParent() );
122 
123  if( aUpdateRTree )
124  m_frame->GetScreen()->Update( static_cast<SCH_ITEM*>( aItem->GetParent() ) );
125 
126  break;
127 
128  default:
129  getView()->Update( aItem );
130 
131  if( aUpdateRTree )
132  m_frame->GetScreen()->Update( static_cast<SCH_ITEM*>( aItem ) );
133  }
134  }
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
EDA_ITEM * GetParent() const
Definition: eda_item.h:163
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition: tool_base.cpp:36
void Update(SCH_ITEM *aItem)
Updates aItem's bounding box in the tree.
Definition: sch_screen.cpp:234
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
Definition: view.cpp:1513
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:161

◆ 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:215
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(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), ROUTER_TOOL::InlineDrag(), ZOOM_TOOL::Main(), PL_EDIT_TOOL::Main(), CVPCB_CONTROL::Main(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), SCH_MOVE_TOOL::Main(), PCB_PICKER_TOOL::Main(), EDA_3D_CONTROLLER::Main(), PL_SELECTION_TOOL::Main(), PICKER_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), PCB_SELECTION_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(), PlaceComponent(), PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), BOARD_EDITOR_CONTROL::PlaceModule(), 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(), SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

Member Data Documentation

◆ m_frame

SCH_EDIT_FRAME * EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame
protectedinherited

Definition at line 179 of file ee_tool_base.h.

◆ m_isSymbolEditor

bool EE_TOOL_BASE< SCH_EDIT_FRAME >::m_isSymbolEditor
protectedinherited

Definition at line 182 of file ee_tool_base.h.

◆ m_lastGlobalLabelShape

PINSHEETLABEL_SHAPE SCH_DRAWING_TOOLS::m_lastGlobalLabelShape
private

Definition at line 83 of file sch_drawing_tools.h.

Referenced by createNewText().

◆ m_lastSheetPinType

PINSHEETLABEL_SHAPE SCH_DRAWING_TOOLS::m_lastSheetPinType
private

Definition at line 82 of file sch_drawing_tools.h.

Referenced by createSheetPin().

◆ m_lastTextBold

bool SCH_DRAWING_TOOLS::m_lastTextBold
private

Definition at line 85 of file sch_drawing_tools.h.

Referenced by createNewText().

◆ m_lastTextItalic

bool SCH_DRAWING_TOOLS::m_lastTextItalic
private

Definition at line 86 of file sch_drawing_tools.h.

Referenced by createNewText().

◆ m_lastTextOrientation

LABEL_SPIN_STYLE SCH_DRAWING_TOOLS::m_lastTextOrientation
private

Definition at line 84 of file sch_drawing_tools.h.

Referenced by createNewText().

◆ 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(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), TOOL_INTERACTIVE::GetToolMenu(), ROUTER_TOOL::Init(), LENGTH_TUNER_TOOL::Init(), PL_EDIT_TOOL::Init(), SCH_EDIT_TOOL::Init(), PICKER_TOOL::Init(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Init(), PAD_TOOL::Init(), SYMBOL_EDITOR_CONTROL::Init(), SYMBOL_EDITOR_DRAWING_TOOLS::Init(), FOOTPRINT_EDITOR_CONTROL::Init(), PCB_VIEWER_TOOLS::Init(), PL_DRAWING_TOOLS::Init(), PL_SELECTION_TOOL::Init(), BOARD_EDITOR_CONTROL::Init(), Init(), EDA_3D_CONTROLLER::Init(), GERBVIEW_SELECTION_TOOL::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(), PL_EDIT_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), SCH_MOVE_TOOL::Main(), PCB_PICKER_TOOL::Main(), EDA_3D_CONTROLLER::Main(), PL_SELECTION_TOOL::Main(), PICKER_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), PCB_SELECTION_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), PlaceComponent(), PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), BOARD_EDITOR_CONTROL::PlaceModule(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::SetAnchor(), SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and TwoClickPlace().

◆ m_powerHistoryList

std::vector<PICKED_SYMBOL> SCH_DRAWING_TOOLS::m_powerHistoryList
private

Definition at line 80 of file sch_drawing_tools.h.

Referenced by PlaceComponent().

◆ m_selectionTool

EE_SELECTION_TOOL* EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool
protectedinherited

Definition at line 181 of file ee_tool_base.h.

◆ m_statusPopup

std::unique_ptr<STATUS_TEXT_POPUP> SCH_DRAWING_TOOLS::m_statusPopup
private

Definition at line 88 of file sch_drawing_tools.h.

Referenced by TwoClickPlace().

◆ m_symbolHistoryList

std::vector<PICKED_SYMBOL> SCH_DRAWING_TOOLS::m_symbolHistoryList
private

Definition at line 79 of file sch_drawing_tools.h.

Referenced by PlaceComponent().

◆ 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 210 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 215 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(), 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(), SYMBOL_EDITOR_EDIT_TOOL::Copy(), PL_EDIT_TOOL::Copy(), PAD_TOOL::copyPadSettings(), EDIT_TOOL::copyToClipboard(), MICROWAVE_TOOL::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(), DrawSheet(), DRAWING_TOOL::DrawZone(), BOARD_EDITOR_CONTROL::DrillOrigin(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), SCH_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::EditWithLibEdit(), GROUP_TOOL::EnterGroup(), SCH_NAVIGATE_TOOL::EnterSheet(), SCH_EDITOR_CONTROL::EnterSheet(), PAD_TOOL::EnumeratePads(), GLOBAL_EDIT_TOOL::ExchangeFootprints(), PCB_SELECTION_TOOL::expandConnection(), PAD_TOOL::explodePad(), PCB_SELECTION_TOOL::filterSelection(), PCB_SELECTION_TOOL::findCallback(), SCH_EDITOR_CONTROL::FindComponentAndItem(), PCB_POINT_EDITOR::finishItem(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), EDIT_TOOL::Flip(), EDIT_TOOL::GetAndPlace(), TOOL_BASE::GetManager(), TOOL_BASE::getModelInt(), DRAWING_TOOL::getSourceZoneForAction(), TOOL_BASE::getToolHolderInt(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), TOOL_INTERACTIVE::goInternal(), COMMON_TOOLS::GridNext(), COMMON_TOOLS::GridPreset(), COMMON_TOOLS::GridPrev(), 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(), BOARD_INSPECTION_TOOL::HighlightNetTool(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), PL_EDIT_TOOL::ImportWorksheetContent(), SYMBOL_EDITOR_EDIT_TOOL::Init(), PL_EDIT_TOOL::Init(), SCH_EDIT_TOOL::Init(), GROUP_TOOL::Init(), CONVERT_TOOL::Init(), PAD_TOOL::Init(), GLOBAL_EDIT_TOOL::Init(), SYMBOL_EDITOR_CONTROL::Init(), ALIGN_DISTRIBUTE_TOOL::Init(), PL_DRAWING_TOOLS::Init(), PL_POINT_EDITOR::Init(), BOARD_EDITOR_CONTROL::Init(), PCB_POINT_EDITOR::Init(), POSITION_RELATIVE_TOOL::Init(), BOARD_INSPECTION_TOOL::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), BOARD_INSPECTION_TOOL::InspectClearance(), BOARD_INSPECTION_TOOL::InspectConstraints(), 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(), PL_EDIT_TOOL::Main(), CVPCB_CONTROL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), SCH_MOVE_TOOL::Main(), PCB_PICKER_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(), PlaceComponent(), PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), BOARD_EDITOR_CONTROL::PlaceModule(), 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(), GERBVIEW_CONTROL::ReloadAllLayers(), 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(), SingleClickPlace(), EDA_3D_CONTROLLER::ToggleVisibility(), BOARD_EDITOR_CONTROL::TrackWidthDec(), BOARD_EDITOR_CONTROL::TrackWidthInc(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), 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(), 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 214 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 207 of file tool_base.h.

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

◆ m_view

KIGFX::SCH_VIEW* EE_TOOL_BASE< SCH_EDIT_FRAME >::m_view
protectedinherited

Definition at line 180 of file ee_tool_base.h.


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