KiCad PCB EDA Suite
SCH_EDIT_TOOL Class Reference

#include <sch_edit_tool.h>

Inheritance diagram for SCH_EDIT_TOOL:
EE_TOOL_BASE< SCH_EDIT_FRAME > TOOL_INTERACTIVE TOOL_BASE

Public Types

enum  RESET_REASON { RUN, MODEL_RELOAD, GAL_SWITCH }
 

Determines the reason of reset for a tool

More...
 

Public Member Functions

 SCH_EDIT_TOOL ()
 
 ~SCH_EDIT_TOOL ()
 
bool Init () override
 Function Init() Init() is called once upon a registration of the tool. More...
 
int Rotate (const TOOL_EVENT &aEvent)
 
int Mirror (const TOOL_EVENT &aEvent)
 
int Duplicate (const TOOL_EVENT &aEvent)
 
int RepeatDrawItem (const TOOL_EVENT &aEvent)
 
int Properties (const TOOL_EVENT &aEvent)
 
int EditField (const TOOL_EVENT &aEvent)
 
int AutoplaceFields (const TOOL_EVENT &aEvent)
 
int ConvertDeMorgan (const TOOL_EVENT &aEvent)
 
int ChangeShape (const TOOL_EVENT &aEvent)
 
int ChangeTextType (const TOOL_EVENT &aEvent)
 
int BreakWire (const TOOL_EVENT &aEvent)
 
int CleanupSheetPins (const TOOL_EVENT &aEvent)
 
int DoDelete (const TOOL_EVENT &aEvent)
 Function DoDelete() More...
 
int DeleteItemCursor (const TOOL_EVENT &aEvent)
 

Runs the deletion tool.

More...
 
void Reset (RESET_REASON aReason) override
 Function Reset() Brings the tool to a known, initial state. More...
 
TOOL_MENUGetToolMenu ()
 

Get the tool's top-level context menu

More...
 
void Activate ()
 Function Activate() Runs the tool. More...
 
void SetContextMenu (ACTION_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger=CMENU_BUTTON)
 Function SetContextMenu() More...
 
void RunMainStack (std::function< void()> aFunc)
 Function RunMainStack() More...
 
template<class T >
void Go (int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
 Function Go() More...
 
OPT_TOOL_EVENT Wait (const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
 Function Wait() More...
 
TOOL_TYPE GetType () const
 Function GetType() Returns the type of the tool. More...
 
TOOL_ID GetId () const
 Function GetId() Returns the unique identifier of the tool. More...
 
const std::string & GetName () const
 Function GetName() Returns the name of the tool. More...
 
TOOL_MANAGERGetManager () const
 Function GetManager() Returns the instance of TOOL_MANAGER that takes care of the tool. More...
 
TOOL_SETTINGSGetSettings ()
 
bool IsToolActive () const
 

Protected Member Functions

void updateView (EDA_ITEM *aItem) const
 

Similar to getView()->Update(), but handles items that are redrawn by their parents.

More...
 
void saveCopyInUndoList (EDA_ITEM *aItem, UNDO_REDO_T aType, bool aAppend=false)
 

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

More...
 
const TOOL_EVENT evActivate (std::string aToolName="")
 functions below are not yet implemented - their interface may change More...
 
const TOOL_EVENT evCommand (int aCommandId=-1)
 
const TOOL_EVENT evCommand (std::string aCommandStr="")
 
const TOOL_EVENT evMotion ()
 
const TOOL_EVENT evClick (int aButton=BUT_ANY)
 
const TOOL_EVENT evDrag (int aButton=BUT_ANY)
 
const TOOL_EVENT evButtonUp (int aButton=BUT_ANY)
 
const TOOL_EVENT evButtonDown (int aButton=BUT_ANY)
 
void attachManager (TOOL_MANAGER *aManager)
 Function attachManager() More...
 
KIGFX::VIEWgetView () const
 Function getView() More...
 
KIGFX::VIEW_CONTROLSgetViewControls () const
 Function getViewControls() More...
 
template<typename T >
T * getEditFrame () const
 Function getEditFrame() More...
 
template<typename T >
T * getModel () const
 Function getModel() More...
 

Protected Attributes

SCH_EDIT_FRAMEm_frame
 
KIGFX::SCH_VIEWm_view
 
EE_SELECTION_TOOLm_selectionTool
 
bool m_isLibEdit
 
TOOL_MENU m_menu
 Menu model displayed by the tool. More...
 
TOOL_TYPE m_type
 

Stores the type of the tool.

More...
 
TOOL_ID m_toolId
 

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

More...
 
std::string m_toolName
 

Name of the tool.

More...
 
TOOL_MANAGERm_toolMgr
 
TOOL_SETTINGS m_toolSettings
 

Private Member Functions

void setTransitions () override
 

Sets up handlers for various events.

More...
 

Detailed Description

Definition at line 35 of file sch_edit_tool.h.

Member Enumeration Documentation

◆ RESET_REASON

enum TOOL_BASE::RESET_REASON
inherited

Determines the reason of reset for a tool

Enumerator
RUN 

Tool is invoked after being inactive.

MODEL_RELOAD 

Model changes (required full reload)

GAL_SWITCH 

Rendering engine changes.

Definition at line 80 of file tool_base.h.

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

Constructor & Destructor Documentation

◆ SCH_EDIT_TOOL()

SCH_EDIT_TOOL::SCH_EDIT_TOOL ( )

Definition at line 237 of file sch_edit_tool.cpp.

237  :
238  EE_TOOL_BASE<SCH_EDIT_FRAME>( "eeschema.InteractiveEdit" )
239 {
240 }

◆ ~SCH_EDIT_TOOL()

SCH_EDIT_TOOL::~SCH_EDIT_TOOL ( )

Definition at line 243 of file sch_edit_tool.cpp.

244 {
245 }

Member Function Documentation

◆ Activate()

void TOOL_INTERACTIVE::Activate ( )
inherited

Function Activate() Runs the tool.

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

Definition at line 49 of file tool_interactive.cpp.

50 {
52 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
TOOL_ID m_toolId
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:211
bool InvokeTool(TOOL_ID aToolId)
Function InvokeTool() Calls a tool by sending a tool activation event to tool of given ID.

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

Referenced by AUTOPLACE_TOOL::autoplace(), LIB_EDIT_TOOL::DeleteItemCursor(), DeleteItemCursor(), PCBNEW_CONTROL::DeleteItemCursor(), EDIT_TOOL::doCopyToClipboard(), SCH_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), SCH_DRAWING_TOOLS::doPlaceComponent(), SCH_DRAWING_TOOLS::doSingleClickPlace(), LIB_DRAWING_TOOLS::doTwoClickPlace(), SCH_DRAWING_TOOLS::doTwoClickPlace(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), LIB_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::drawZone(), PCB_EDITOR_CONTROL::DrillOrigin(), MODULE_EDITOR_TOOLS::EnumeratePads(), PCBNEW_CONTROL::GridSetOrigin(), SCH_EDITOR_CONTROL::HighlightNetCursor(), PCB_EDITOR_CONTROL::HighlightNetCursor(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), SCH_MOVE_TOOL::Main(), EE_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), EDIT_TOOL::Main(), LENGTH_TUNER_TOOL::mainLoop(), ROUTER_TOOL::mainLoop(), CVPCB_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), POINT_EDITOR::OnSelectionChange(), EDIT_TOOL::pickCopyReferencePoint(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), EDIT_TOOL::Remove(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), DRAWING_TOOL::SetAnchor(), PCB_EDITOR_CONTROL::ShowLocalRatsnest(), SCH_WIRE_BUS_TOOL::StartBus(), SCH_WIRE_BUS_TOOL::StartWire(), and SCH_WIRE_BUS_TOOL::UnfoldBus().

◆ attachManager()

void TOOL_BASE::attachManager ( TOOL_MANAGER aManager)
protectedinherited

Function attachManager()

Sets the TOOL_MANAGER the tool will belong to. Called by TOOL_MANAGER::RegisterTool()

Definition at line 59 of file tool_base.cpp.

60 {
61  m_toolMgr = aManager;
62  m_toolSettings = TOOL_SETTINGS( this );
63 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
TOOL_SETTINGS m_toolSettings
Definition: tool_base.h:217
friend class TOOL_SETTINGS
Definition: tool_base.h:155

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

Referenced by TOOL_MANAGER::RegisterTool().

◆ AutoplaceFields()

int SCH_EDIT_TOOL::AutoplaceFields ( const TOOL_EVENT aEvent)

Definition at line 1053 of file sch_edit_tool.cpp.

1054 {
1056 
1057  if( selection.Empty() )
1058  return 0;
1059 
1060  SCH_COMPONENT* component = (SCH_COMPONENT*) selection.Front();
1061 
1062  if( !component->IsNew() )
1063  m_frame->SaveCopyInUndoList( component, UR_CHANGED );
1064 
1065  component->AutoplaceFields( m_frame->GetScreen(), /* aManual */ true );
1066 
1067  updateView( component );
1068  m_frame->OnModify();
1069 
1070  return 0;
1071 }
static const KICAD_T ComponentsOnly[]
Definition: ee_collectors.h:44
bool IsNew() const
Definition: base_struct.h:222
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void SaveCopyInUndoList(SCH_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, bool aAppend=false, const wxPoint &aTransformPoint=wxPoint(0, 0))
Create a copy of the current schematic item, and put it in the undo list.
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:143
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:119
void updateView(EDA_ITEM *aItem) const
Similar to getView()->Update(), but handles items that are redrawn by their parents.
Definition: ee_tool_base.h:107
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual)
Automatically orient all the fields in the component.
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:73
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
EDA_ITEM * Front() const
Definition: selection.h:155

References SCH_COMPONENT::AutoplaceFields(), EE_COLLECTOR::ComponentsOnly, SELECTION::Empty(), SELECTION::Front(), SCH_EDIT_FRAME::GetScreen(), EDA_ITEM::IsNew(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, SCH_EDIT_FRAME::OnModify(), EE_SELECTION_TOOL::RequestSelection(), SCH_EDIT_FRAME::SaveCopyInUndoList(), EE_TOOL_BASE< SCH_EDIT_FRAME >::updateView(), and UR_CHANGED.

Referenced by setTransitions().

◆ BreakWire()

int SCH_EDIT_TOOL::BreakWire ( const TOOL_EVENT aEvent)

Definition at line 1245 of file sch_edit_tool.cpp.

1246 {
1247  VECTOR2I cursorPos = getViewControls()->GetCursorPosition( !aEvent.Modifier( MD_ALT ) );
1248 
1249  if( m_frame->BreakSegments( (wxPoint) cursorPos ) )
1250  {
1252 
1253  m_frame->OnModify();
1254  m_frame->GetCanvas()->Refresh();
1255  }
1256 
1257  return 0;
1258 }
bool BreakSegments(const wxPoint &aPoint, SCH_SCREEN *aScreen=nullptr)
Checks every wire and bus for a intersection at aPoint and break into two segments at aPoint if an in...
bool TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
SCH_DRAW_PANEL * GetCanvas() const override
int Modifier(int aMask=MD_MODIFIER_MASK) const
Returns information about key modifiers state (Ctrl, Alt, etc.)
Definition: tool_event.h:316
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
Function getViewControls()
Definition: tool_base.cpp:41
VECTOR2D GetCursorPosition() const
Returns the current cursor position in world coordinates.

References SCH_EDIT_FRAME::BreakSegments(), SCH_BASE_FRAME::GetCanvas(), KIGFX::VIEW_CONTROLS::GetCursorPosition(), TOOL_BASE::getViewControls(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, MD_ALT, TOOL_EVENT::Modifier(), SCH_EDIT_FRAME::OnModify(), SCH_DRAW_PANEL::Refresh(), and SCH_EDIT_FRAME::TestDanglingEnds().

Referenced by setTransitions().

◆ ChangeShape()

int SCH_EDIT_TOOL::ChangeShape ( const TOOL_EVENT aEvent)

Definition at line 1181 of file sch_edit_tool.cpp.

1182 {
1183  SELECTION& selection = m_selectionTool->GetSelection();
1184  char shape;
1185 
1186  if( aEvent.IsAction( &EE_ACTIONS::toShapeSlash ) )
1187  shape = '/';
1188  else if( aEvent.IsAction( &EE_ACTIONS::toShapeBackslash ) )
1189  shape = '\\';
1190  else
1191  return 0;
1192 
1193  for( unsigned int i = 0; i < selection.GetSize(); ++i )
1194  {
1195  SCH_BUS_ENTRY_BASE* entry = dynamic_cast<SCH_BUS_ENTRY_BASE*>( selection.GetItem( i ) );
1196 
1197  if( entry )
1198  {
1199  if( entry->GetEditFlags() == 0 )
1201 
1202  entry->SetBusEntryShape( shape );
1204 
1205  updateView( entry );
1206  m_frame->OnModify( );
1207  }
1208  }
1209 
1210  g_lastBusEntryShape = shape;
1211 
1212  return 0;
1213 }
SELECTION & GetSelection()
Function GetSelection()
char g_lastBusEntryShape
Definition: ee_actions.cpp:29
static TOOL_ACTION toShapeBackslash
Definition: ee_actions.h:137
bool TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
bool IsAction(const TOOL_ACTION *aAction) const
Function IsAction() Tests if the event contains an action issued upon activation of the given TOOL_AC...
Definition: tool_event.cpp:54
Base class for a bus or wire entry.
Definition: sch_bus_entry.h:41
STATUS_FLAGS GetEditFlags() const
Definition: base_struct.h:263
void SaveCopyInUndoList(SCH_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, bool aAppend=false, const wxPoint &aTransformPoint=wxPoint(0, 0))
Create a copy of the current schematic item, and put it in the undo list.
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:143
void SetBusEntryShape(char aShape)
function SetBusEntryShape
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
Definition: selection.h:103
virtual unsigned int GetSize() const override
Function GetSize() Returns the number of stored items.
Definition: selection.h:98
void updateView(EDA_ITEM *aItem) const
Similar to getView()->Update(), but handles items that are redrawn by their parents.
Definition: ee_tool_base.h:107
size_t i
Definition: json11.cpp:597
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
static TOOL_ACTION toShapeSlash
Definition: ee_actions.h:136

References g_lastBusEntryShape, EDA_ITEM::GetEditFlags(), SELECTION::GetItem(), EE_SELECTION_TOOL::GetSelection(), SELECTION::GetSize(), i, TOOL_EVENT::IsAction(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, SCH_EDIT_FRAME::OnModify(), SCH_EDIT_FRAME::SaveCopyInUndoList(), SCH_BUS_ENTRY_BASE::SetBusEntryShape(), SCH_EDIT_FRAME::TestDanglingEnds(), EE_ACTIONS::toShapeBackslash, EE_ACTIONS::toShapeSlash, EE_TOOL_BASE< SCH_EDIT_FRAME >::updateView(), and UR_CHANGED.

Referenced by setTransitions().

◆ ChangeTextType()

int SCH_EDIT_TOOL::ChangeTextType ( const TOOL_EVENT aEvent)

Definition at line 1216 of file sch_edit_tool.cpp.

1217 {
1219  SELECTION& selection = m_selectionTool->RequestSelection( allTextTypes );
1220  KICAD_T convertTo;
1221 
1222  if( aEvent.IsAction( &EE_ACTIONS::toLabel ) )
1223  convertTo = SCH_LABEL_T;
1224  else if( aEvent.IsAction( &EE_ACTIONS::toHLabel ) )
1225  convertTo = SCH_HIER_LABEL_T;
1226  else if( aEvent.IsAction( &EE_ACTIONS::toGLabel ) )
1227  convertTo = SCH_GLOBAL_LABEL_T;
1228  else if( aEvent.IsAction( &EE_ACTIONS::toText ) )
1229  convertTo = SCH_TEXT_T;
1230  else
1231  return 0;
1232 
1233  for( unsigned int i = 0; i < selection.GetSize(); ++i )
1234  {
1235  SCH_TEXT* text = dynamic_cast<SCH_TEXT*>( selection.GetItem( i ) );
1236 
1237  if( text )
1238  m_frame->ConvertTextType( text, convertTo );
1239  }
1240 
1241  return 0;
1242 }
static TOOL_ACTION toText
Definition: ee_actions.h:141
search types array terminator (End Of Types)
Definition: typeinfo.h:82
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
bool IsAction(const TOOL_ACTION *aAction) const
Function IsAction() Tests if the event contains an action issued upon activation of the given TOOL_AC...
Definition: tool_event.cpp:54
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:143
void ConvertTextType(SCH_TEXT *aText, KICAD_T aType)
Change a text type to another one.
Definition: edit_label.cpp:105
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
Definition: selection.h:103
virtual unsigned int GetSize() const override
Function GetSize() Returns the number of stored items.
Definition: selection.h:98
size_t i
Definition: json11.cpp:597
static TOOL_ACTION toLabel
Definition: ee_actions.h:138
static TOOL_ACTION toHLabel
Definition: ee_actions.h:139
SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
static TOOL_ACTION toGLabel
Definition: ee_actions.h:140

References SCH_EDIT_FRAME::ConvertTextType(), EOT, SELECTION::GetItem(), SELECTION::GetSize(), i, TOOL_EVENT::IsAction(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, EE_SELECTION_TOOL::RequestSelection(), SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, SCH_TEXT_T, EE_ACTIONS::toGLabel, EE_ACTIONS::toHLabel, EE_ACTIONS::toLabel, and EE_ACTIONS::toText.

Referenced by setTransitions().

◆ CleanupSheetPins()

int SCH_EDIT_TOOL::CleanupSheetPins ( const TOOL_EVENT aEvent)

Definition at line 1261 of file sch_edit_tool.cpp.

1262 {
1264  SCH_SHEET* sheet = (SCH_SHEET*) selection.Front();
1265 
1266  if( !sheet )
1267  return 0;
1268 
1269  if( !sheet->HasUndefinedPins() )
1270  {
1271  DisplayInfoMessage( m_frame, _( "There are no unreferenced pins in this sheet to remove." ) );
1272  return 0;
1273  }
1274 
1275  if( !IsOK( m_frame, _( "Do you wish to delete the unreferenced pins from this sheet?" ) ) )
1276  return 0;
1277 
1279 
1280  sheet->CleanupSheet();
1281 
1282  updateView( sheet );
1283  m_frame->OnModify();
1284 
1285  return 0;
1286 }
static const KICAD_T SheetsOnly[]
Definition: ee_collectors.h:45
void SaveCopyInUndoList(SCH_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, bool aAppend=false, const wxPoint &aTransformPoint=wxPoint(0, 0))
Create a copy of the current schematic item, and put it in the undo list.
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:143
void CleanupSheet()
Delete sheet label which do not have a corresponding hierarchical label.
Definition: sch_sheet.cpp:340
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:201
bool HasUndefinedPins()
Check all sheet labels against schematic for undefined hierarchical labels.
Definition: sch_sheet.cpp:232
void updateView(EDA_ITEM *aItem) const
Similar to getView()->Update(), but handles items that are redrawn by their parents.
Definition: ee_tool_base.h:107
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Function DisplayInfoMessage displays an informational message box with aMessage.
Definition: confirm.cpp:276
SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Function IsOK displays a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:294
EDA_ITEM * Front() const
Definition: selection.h:155

References SCH_SHEET::CleanupSheet(), DisplayInfoMessage(), SELECTION::Front(), SCH_SHEET::HasUndefinedPins(), IsOK(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, SCH_EDIT_FRAME::OnModify(), EE_SELECTION_TOOL::RequestSelection(), SCH_EDIT_FRAME::SaveCopyInUndoList(), EE_COLLECTOR::SheetsOnly, EE_TOOL_BASE< SCH_EDIT_FRAME >::updateView(), and UR_CHANGED.

Referenced by setTransitions().

◆ ConvertDeMorgan()

int SCH_EDIT_TOOL::ConvertDeMorgan ( const TOOL_EVENT aEvent)

Definition at line 1074 of file sch_edit_tool.cpp.

1075 {
1077 
1078  if( selection.Empty() )
1079  return 0;
1080 
1081  SCH_COMPONENT* component = (SCH_COMPONENT*) selection.Front();
1082 
1083  if( component->IsNew() )
1085  else
1086  m_frame->SaveCopyInUndoList( component, UR_CHANGED );
1087 
1088  m_frame->ConvertPart( component );
1089 
1090  return 0;
1091 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
static TOOL_ACTION refreshPreview
Definition: ee_actions.h:168
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
static const KICAD_T ComponentsOnly[]
Definition: ee_collectors.h:44
bool IsNew() const
Definition: base_struct.h:222
void SaveCopyInUndoList(SCH_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, bool aAppend=false, const wxPoint &aTransformPoint=wxPoint(0, 0))
Create a copy of the current schematic item, and put it in the undo list.
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:143
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:119
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:73
void ConvertPart(SCH_COMPONENT *aComponent)
Definition: getpart.cpp:248
SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
EDA_ITEM * Front() const
Definition: selection.h:155

References EE_COLLECTOR::ComponentsOnly, SCH_EDIT_FRAME::ConvertPart(), SELECTION::Empty(), SELECTION::Front(), EDA_ITEM::IsNew(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, EE_ACTIONS::refreshPreview, EE_SELECTION_TOOL::RequestSelection(), TOOL_MANAGER::RunAction(), SCH_EDIT_FRAME::SaveCopyInUndoList(), and UR_CHANGED.

Referenced by setTransitions().

◆ DeleteItemCursor()

int SCH_EDIT_TOOL::DeleteItemCursor ( const TOOL_EVENT aEvent)

Runs the deletion tool.

Definition at line 994 of file sch_edit_tool.cpp.

995 {
996  Activate();
997 
999  wxCHECK( picker, 0 );
1000 
1001  m_frame->SetToolID( ID_DELETE_TOOL, wxCURSOR_BULLSEYE, _( "Delete item" ) );
1002  picker->SetClickHandler( std::bind( deleteItem, m_frame, std::placeholders::_1 ) );
1003  picker->Activate();
1004  Wait();
1005 
1006  return 0;
1007 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
OPT_TOOL_EVENT Wait(const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
Function Wait()
static bool deleteItem(SCH_BASE_FRAME *aFrame, const VECTOR2D &aPosition)
virtual void SetToolID(int aId, int aCursor, const wxString &aToolMsg)
Set the tool command ID to aId and sets the cursor to aCursor.
void SetClickHandler(CLICK_HANDLER aHandler)
Function SetClickHandler() Sets a handler for mouse click event.
void Activate()
Function Activate() Runs the tool.

References TOOL_INTERACTIVE::Activate(), deleteItem(), TOOL_MANAGER::GetTool(), ID_DELETE_TOOL, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, TOOL_BASE::m_toolMgr, EE_PICKER_TOOL::SetClickHandler(), EDA_DRAW_FRAME::SetToolID(), and TOOL_INTERACTIVE::Wait().

Referenced by setTransitions().

◆ DoDelete()

int SCH_EDIT_TOOL::DoDelete ( const TOOL_EVENT aEvent)

Function DoDelete()

Deletes the selected items, or the item under the cursor.

Definition at line 904 of file sch_edit_tool.cpp.

905 {
906  SCH_SCREEN* screen = m_frame->GetScreen();
907  auto items = m_selectionTool->RequestSelection().GetItems();
908  bool appendToUndo = false;
909 
910  if( items.empty() )
911  return 0;
912 
913  // Don't leave a freed pointer in the selection
915 
916  for( EDA_ITEM* item : items )
917  {
918  // Junctions, in particular, may have already been deleted if deleting wires made
919  // them redundant
920  if( item->GetEditFlags() & STRUCT_DELETED )
921  continue;
922 
923  if( item->Type() == SCH_JUNCTION_T )
924  {
925  m_frame->DeleteJunction( (SCH_ITEM*) item, appendToUndo );
926  appendToUndo = true;
927  }
928  else
929  {
930  item->SetFlags( STRUCT_DELETED );
931  saveCopyInUndoList( item, UR_DELETED, appendToUndo );
932  appendToUndo = true;
933 
934  updateView( item );
935 
936  SCH_ITEM* sch_item = dynamic_cast<SCH_ITEM*>( item );
937 
938  if( sch_item && sch_item->IsConnectable() )
939  {
940  std::vector< wxPoint > pts;
941  sch_item->GetConnectionPoints( pts );
942 
943  for( auto point : pts )
944  {
945  SCH_ITEM* junction = screen->GetItem( point, 0, SCH_JUNCTION_T );
946  if( junction && !screen->IsJunctionNeeded( point ) )
947  m_frame->DeleteJunction( junction, appendToUndo );
948  }
949  }
950 
951  if( item->Type() == SCH_SHEET_PIN_T )
952  static_cast<SCH_SHEET*>( item->GetParent() )->RemovePin( (SCH_SHEET_PIN*) item );
953  else
954  m_frame->RemoveFromScreen( item );
955  }
956  }
957 
959 
960  m_frame->GetCanvas()->Refresh();
961  m_frame->OnModify();
962 
963  return 0;
964 }
virtual bool IsConnectable() const
Function IsConnectable returns true if the schematic item can connect to another schematic item.
Definition: sch_item.h:299
bool IsJunctionNeeded(const wxPoint &aPosition, bool aNew=false)
Test if a junction is required for the items at aPosition on the screen.
Definition: sch_screen.cpp:350
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
virtual void GetConnectionPoints(std::vector< wxPoint > &aPoints) const
Function GetConnectionPoints add all the connection points for this item to aPoints.
Definition: sch_item.h:309
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
bool TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
void RemoveFromScreen(EDA_ITEM *aItem, SCH_SCREEN *aScreen=nullptr)
Remove an item from the screen (and view) aScreen is the screen the item is located on,...
void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
SCH_DRAW_PANEL * GetCanvas() const override
SCH_ITEM * GetItem(const wxPoint &aPosition, int aAccuracy=0, KICAD_T aType=SCH_LOCATE_ANY_T) const
Check aPosition within a distance of aAccuracy for items of type aFilter.
Definition: sch_screen.cpp:237
const std::deque< EDA_ITEM * > GetItems() const
Definition: selection.h:130
#define STRUCT_DELETED
flag indication structures to be erased
Definition: base_struct.h:123
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:143
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:56
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:57
void updateView(EDA_ITEM *aItem) const
Similar to getView()->Update(), but handles items that are redrawn by their parents.
Definition: ee_tool_base.h:107
void DeleteJunction(SCH_ITEM *aItem, bool aAppend=false)
Removes a given junction and heals any wire segments under the junction.
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO_T aType, bool aAppend=false)
Similar to m_frame->SaveCopyInUndoList(), but handles items that are owned by their parents.
Definition: ee_tool_base.h:120
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:157
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
Definition: sch_item.h:114

References EE_ACTIONS::clearSelection, SCH_EDIT_FRAME::DeleteJunction(), SCH_BASE_FRAME::GetCanvas(), SCH_ITEM::GetConnectionPoints(), SCH_SCREEN::GetItem(), SELECTION::GetItems(), SCH_EDIT_FRAME::GetScreen(), SCH_ITEM::IsConnectable(), SCH_SCREEN::IsJunctionNeeded(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, SCH_EDIT_FRAME::OnModify(), SCH_DRAW_PANEL::Refresh(), SCH_BASE_FRAME::RemoveFromScreen(), EE_SELECTION_TOOL::RequestSelection(), TOOL_MANAGER::RunAction(), EE_TOOL_BASE< SCH_EDIT_FRAME >::saveCopyInUndoList(), SCH_JUNCTION_T, SCH_SHEET_PIN_T, STRUCT_DELETED, SCH_EDIT_FRAME::TestDanglingEnds(), EE_TOOL_BASE< SCH_EDIT_FRAME >::updateView(), and UR_DELETED.

Referenced by setTransitions().

◆ Duplicate()

int SCH_EDIT_TOOL::Duplicate ( const TOOL_EVENT aEvent)

Definition at line 746 of file sch_edit_tool.cpp.

747 {
748  static KICAD_T duplicatableItems[] =
749  {
751  SCH_LINE_T,
754  SCH_TEXT_T,
755  SCH_LABEL_T,
759  SCH_SHEET_T,
761  EOT
762  };
763 
764  SELECTION& selection = m_selectionTool->RequestSelection( duplicatableItems );
765 
766  if( selection.GetSize() == 0 )
767  return 0;
768 
769  // Doing a duplicate of a new object doesn't really make any sense; we'd just end
770  // up dragging around a stack of objects...
771  if( selection.Front()->IsNew() )
772  return 0;
773 
774  EDA_ITEMS newItems;
775 
776  // Keep track of existing sheet paths. Duplicating a selection can modify this list
777  bool copiedSheets = false;
778  SCH_SHEET_LIST initial_sheetpathList( g_RootSheet );
779 
780  for( unsigned ii = 0; ii < selection.GetSize(); ++ii )
781  {
782  SCH_ITEM* oldItem = static_cast<SCH_ITEM*>( selection.GetItem( ii ) );
783  SCH_ITEM* newItem = oldItem->Duplicate();
784  newItem->SetFlags( IS_NEW );
785  newItems.push_back( newItem );
786  saveCopyInUndoList( newItem, UR_NEW, ii > 0 );
787 
788  switch( newItem->Type() )
789  {
790  case SCH_JUNCTION_T:
791  case SCH_LINE_T:
792  case SCH_BUS_BUS_ENTRY_T:
794  case SCH_TEXT_T:
795  case SCH_LABEL_T:
796  case SCH_GLOBAL_LABEL_T:
797  case SCH_HIER_LABEL_T:
798  case SCH_NO_CONNECT_T:
799  newItem->SetParent( m_frame->GetScreen() );
800  m_frame->AddToScreen( newItem );
801  break;
802 
803  case SCH_SHEET_T:
804  {
805  SCH_SHEET* sheet = (SCH_SHEET*) newItem;
806  // Duplicate sheet names and sheet time stamps are not valid. Use a time stamp
807  // based sheet name and update the time stamp for each sheet in the block.
808  timestamp_t timeStamp = GetNewTimeStamp();
809 
810  sheet->SetName( wxString::Format( wxT( "sheet%8.8lX" ), (unsigned long)timeStamp ) );
811  sheet->SetTimeStamp( timeStamp );
812 
813  sheet->SetParent( m_frame->GetScreen() );
814  m_frame->AddToScreen( sheet );
815 
816  copiedSheets = true;
817  break;
818  }
819 
820  case SCH_COMPONENT_T:
821  {
822  SCH_COMPONENT* component = (SCH_COMPONENT*) newItem;
823 
824  component->SetTimeStamp( GetNewTimeStamp() );
825  component->ClearAnnotation( NULL );
826 
827  component->SetParent( m_frame->GetScreen() );
828  m_frame->AddToScreen( component );
829  break;
830  }
831 
832  default:
833  break;
834  }
835  }
836 
837  if( copiedSheets )
838  {
839  // We clear annotation of new sheet paths.
840  // Annotation of new components added in current sheet is already cleared.
841  SCH_SCREENS screensList( g_RootSheet );
842  screensList.ClearAnnotationOfNewSheetPaths( initial_sheetpathList );
844  }
845 
847  m_toolMgr->RunAction( EE_ACTIONS::addItemsToSel, true, &newItems );
849 
850  return 0;
851 }
Class SCH_SHEET_LIST.
void SetTimeStamp(timestamp_t aNewTimeStamp)
Change the time stamp to aNewTimeStamp and updates the reference path.
SCH_ITEM * Duplicate(bool doClone=false)
Routine to create a new copy of given item.
Definition: sch_item.cpp:75
void AddToScreen(EDA_ITEM *aItem, SCH_SCREEN *aScreen=nullptr)
Add an item to the screen (and view) aScreen is the screen the item is located on,...
static TOOL_ACTION addItemsToSel
Selects a list of items (specified as the event parameter)
Definition: ee_actions.h:64
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
search types array terminator (End Of Types)
Definition: typeinfo.h:82
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
bool IsNew() const
Definition: base_struct.h:222
#define IS_NEW
New item, just created.
Definition: base_struct.h:114
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
timestamp_t GetNewTimeStamp()
Definition: common.cpp:217
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:259
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:56
void SetName(const wxString &aName)
Definition: sch_sheet.h:260
void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:219
std::vector< EDA_ITEM * > EDA_ITEMS
Define list of drawing items for screens.
Definition: base_struct.h:588
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:143
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:57
void ClearAnnotation(SCH_SHEET_PATH *aSheetPath)
Clear exiting component annotation.
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
Definition: selection.h:103
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:201
virtual unsigned int GetSize() const override
Function GetSize() Returns the number of stored items.
Definition: selection.h:98
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:73
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO_T aType, bool aAppend=false)
Similar to m_frame->SaveCopyInUndoList(), but handles items that are owned by their parents.
Definition: ee_tool_base.h:120
static TOOL_ACTION move
Definition: ee_actions.h:116
uint32_t timestamp_t
timestamp_t is our type to represent unique IDs for all kinds of elements; historically simply the ti...
Definition: common.h:53
SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
Definition: sch_item.h:114
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:493
EDA_ITEM * Front() const
Definition: selection.h:155
void SetTimeStamp(timestamp_t aNewTimeStamp)
Definition: base_struct.h:209

References EE_ACTIONS::addItemsToSel, SCH_BASE_FRAME::AddToScreen(), SCH_COMPONENT::ClearAnnotation(), SCH_SCREENS::ClearAnnotationOfNewSheetPaths(), EE_ACTIONS::clearSelection, SCH_ITEM::Duplicate(), EOT, Format(), SELECTION::Front(), g_RootSheet, SELECTION::GetItem(), GetNewTimeStamp(), SCH_EDIT_FRAME::GetScreen(), SELECTION::GetSize(), IS_NEW, EDA_ITEM::IsNew(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, EE_ACTIONS::move, EE_SELECTION_TOOL::RequestSelection(), TOOL_MANAGER::RunAction(), EE_TOOL_BASE< SCH_EDIT_FRAME >::saveCopyInUndoList(), SCH_BUS_BUS_ENTRY_T, SCH_BUS_WIRE_ENTRY_T, SCH_COMPONENT_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_JUNCTION_T, SCH_LABEL_T, SCH_LINE_T, SCH_NO_CONNECT_T, SCH_SHEET_T, SCH_TEXT_T, EDA_ITEM::SetFlags(), SCH_SHEET::SetName(), EDA_ITEM::SetParent(), SCH_EDIT_FRAME::SetSheetNumberAndCount(), EDA_ITEM::SetTimeStamp(), SCH_COMPONENT::SetTimeStamp(), and UR_NEW.

Referenced by setTransitions().

◆ EditField()

int SCH_EDIT_TOOL::EditField ( const TOOL_EVENT aEvent)

Definition at line 1010 of file sch_edit_tool.cpp.

1011 {
1012  static KICAD_T Nothing[] = { EOT };
1013  static KICAD_T CmpOrReference[] = { SCH_FIELD_LOCATE_REFERENCE_T, SCH_COMPONENT_T, EOT };
1014  static KICAD_T CmpOrValue[] = { SCH_FIELD_LOCATE_VALUE_T, SCH_COMPONENT_T, EOT };
1015  static KICAD_T CmpOrFootprint[] = { SCH_FIELD_LOCATE_FOOTPRINT_T, SCH_COMPONENT_T, EOT };
1016 
1017  KICAD_T* filter = Nothing;
1018 
1019  if( aEvent.IsAction( &EE_ACTIONS::editReference ) )
1020  filter = CmpOrReference;
1021  else if( aEvent.IsAction( &EE_ACTIONS::editValue ) )
1022  filter = CmpOrValue;
1023  else if( aEvent.IsAction( &EE_ACTIONS::editFootprint ) )
1024  filter = CmpOrFootprint;
1025 
1026  SELECTION& selection = m_selectionTool->RequestSelection( filter );
1027 
1028  if( selection.Empty() )
1029  return 0;
1030 
1031  SCH_ITEM* item = (SCH_ITEM*) selection.Front();
1032 
1033  if( item->Type() == SCH_COMPONENT_T )
1034  {
1035  SCH_COMPONENT* component = (SCH_COMPONENT*) item;
1036 
1037  if( aEvent.IsAction( &EE_ACTIONS::editReference ) )
1039  else if( aEvent.IsAction( &EE_ACTIONS::editValue ) )
1040  m_frame->EditComponentFieldText( component->GetField( VALUE ) );
1041  else if( aEvent.IsAction( &EE_ACTIONS::editFootprint ) )
1043  }
1044  else if( item->Type() == SCH_FIELD_T )
1045  {
1047  }
1048 
1049  return 0;
1050 }
Class SCH_FIELD instances are attached to a component and provide a place for the component's value,...
Definition: sch_field.h:52
void EditComponentFieldText(SCH_FIELD *aField)
Display the edit field dialog to edit the parameters of aField.
Field Name Module PCB, i.e. "16DIP300".
Field Reference of part, i.e. "IC21".
search types array terminator (End Of Types)
Definition: typeinfo.h:82
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
bool IsAction(const TOOL_ACTION *aAction) const
Function IsAction() Tests if the event contains an action issued upon activation of the given TOOL_AC...
Definition: tool_event.cpp:54
SCH_FIELD * GetField(int aFieldNdx) const
Returns a field in this symbol.
#define VALUE
static TOOL_ACTION editFootprint
Definition: ee_actions.h:127
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:143
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:119
static TOOL_ACTION editValue
Definition: ee_actions.h:126
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:73
static TOOL_ACTION editReference
Definition: ee_actions.h:125
SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
Definition: sch_item.h:114
EDA_ITEM * Front() const
Definition: selection.h:155
KICAD_T Type() const
Function Type()
Definition: base_struct.h:204

References SCH_EDIT_FRAME::EditComponentFieldText(), EE_ACTIONS::editFootprint, EE_ACTIONS::editReference, EE_ACTIONS::editValue, SELECTION::Empty(), EOT, FOOTPRINT, SELECTION::Front(), SCH_COMPONENT::GetField(), TOOL_EVENT::IsAction(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, REFERENCE, EE_SELECTION_TOOL::RequestSelection(), SCH_COMPONENT_T, SCH_FIELD_LOCATE_FOOTPRINT_T, SCH_FIELD_LOCATE_REFERENCE_T, SCH_FIELD_LOCATE_VALUE_T, SCH_FIELD_T, EDA_ITEM::Type(), and VALUE.

Referenced by setTransitions().

◆ evActivate()

const TOOL_EVENT TOOL_INTERACTIVE::evActivate ( std::string  aToolName = "")
protectedinherited

functions below are not yet implemented - their interface may change

◆ evButtonDown()

const TOOL_EVENT TOOL_INTERACTIVE::evButtonDown ( int  aButton = BUT_ANY)
protectedinherited

◆ evButtonUp()

const TOOL_EVENT TOOL_INTERACTIVE::evButtonUp ( int  aButton = BUT_ANY)
protectedinherited

◆ evClick()

const TOOL_EVENT TOOL_INTERACTIVE::evClick ( int  aButton = BUT_ANY)
protectedinherited

◆ evCommand() [1/2]

const TOOL_EVENT TOOL_INTERACTIVE::evCommand ( int  aCommandId = -1)
protectedinherited

◆ evCommand() [2/2]

const TOOL_EVENT TOOL_INTERACTIVE::evCommand ( std::string  aCommandStr = "")
protectedinherited

◆ evDrag()

const TOOL_EVENT TOOL_INTERACTIVE::evDrag ( int  aButton = BUT_ANY)
protectedinherited

◆ evMotion()

const TOOL_EVENT TOOL_INTERACTIVE::evMotion ( )
protectedinherited

◆ getEditFrame()

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

Function getEditFrame()

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

Definition at line 188 of file tool_base.h.

189  {
190  return static_cast<T*>( getEditFrameInt() );
191  }
wxWindow * getEditFrameInt() const
Definition: tool_base.cpp:47

References TOOL_BASE::getEditFrameInt().

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

◆ GetId()

TOOL_ID TOOL_BASE::GetId ( ) const
inlineinherited

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

The identifier is set by an instance of TOOL_MANAGER.

Returns
Identifier of the tool.

Definition at line 122 of file tool_base.h.

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

References TOOL_BASE::m_toolId.

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

◆ GetManager()

TOOL_MANAGER* TOOL_BASE::GetManager ( ) const
inlineinherited

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

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

Definition at line 144 of file tool_base.h.

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

References TOOL_BASE::m_toolMgr.

Referenced by BOARD_COMMIT::BOARD_COMMIT(), ZONE_CREATE_HELPER::createNewZone(), PCB_TOOL_BASE::doInteractiveItemPlacement(), ACTION_MENU::getToolManager(), ACTION_MENU::onMenuEvent(), and ZONE_CREATE_HELPER::performZoneCutout().

◆ getModel()

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

Function getModel()

Returns the model object if it matches the requested type.

Definition at line 199 of file tool_base.h.

200  {
201  EDA_ITEM* m = getModelInt();
202  wxASSERT( dynamic_cast<T*>( m ) );
203 
204  return static_cast<T*>( m );
205  }
EDA_ITEM * getModelInt() const
Definition: tool_base.cpp:53
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:157

References TOOL_BASE::getModelInt().

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

◆ GetName()

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

Function GetName() Returns the name of the tool.

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

Returns
The name of the tool.

Definition at line 133 of file tool_base.h.

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

References TOOL_BASE::m_toolName.

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

◆ GetSettings()

TOOL_SETTINGS & TOOL_BASE::GetSettings ( )
inherited

Definition at line 77 of file tool_base.cpp.

78 {
79  return m_toolSettings;
80 }
TOOL_SETTINGS m_toolSettings
Definition: tool_base.h:217

References TOOL_BASE::m_toolSettings.

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

◆ GetToolMenu()

TOOL_MENU& EE_TOOL_BASE< SCH_EDIT_FRAME >::GetToolMenu ( )
inlineinherited

Get the tool's top-level context menu

Definition at line 103 of file ee_tool_base.h.

103 { return m_menu; }
TOOL_MENU m_menu
Menu model displayed by the tool.
Definition: ee_tool_base.h:147

◆ GetType()

TOOL_TYPE TOOL_BASE::GetType ( ) const
inlineinherited

Function GetType() Returns the type of the tool.

Returns
The type of the tool.

Definition at line 111 of file tool_base.h.

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

References TOOL_BASE::m_type.

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

◆ getView()

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

Function getView()

Returns the instance of VIEW object used in the application. It allows tools to draw.

Returns
The instance of VIEW.

Definition at line 35 of file tool_base.cpp.

36 {
37  return m_toolMgr->GetView();
38 }
KIGFX::VIEW * GetView() const
Definition: tool_manager.h:252
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216

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(), EE_SELECTION_TOOL::clearSelection(), PCB_EDITOR_CONTROL::CrossProbeSchToPcb(), COMMON_TOOLS::CursorControl(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), COMMON_TOOLS::doGridPreset(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), MICROWAVE_TOOL::drawMicrowaveInductor(), PCB_EDITOR_CONTROL::DrillOrigin(), LIB_EDIT_TOOL::Duplicate(), MODULE_EDITOR_TOOLS::EnumeratePads(), SELECTION_TOOL::findCallback(), ROUTER_TOOL::getStartLayer(), PCBNEW_CONTROL::GridResetOrigin(), PCBNEW_CONTROL::GridSetOrigin(), SELECTION_TOOL::guessSelectionCandidates(), EE_SELECTION_TOOL::highlight(), SELECTION_TOOL::highlight(), GERBVIEW_CONTROL::HighlightControl(), PNS::TOOL_BASE::highlightNet(), PCBNEW_CONTROL::LayerAlphaDec(), PCBNEW_CONTROL::LayerAlphaInc(), EE_POINT_EDITOR::Main(), CVPCB_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), Mirror(), EDIT_TOOL::MoveExact(), POINT_EDITOR::OnSelectionChange(), COMMON_TOOLS::PanControl(), LIB_EDIT_TOOL::Paste(), PNS::TOOL_BASE::pickSingleItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), Properties(), EDIT_TOOL::Remove(), POINT_EDITOR::removeCorner(), PCB_EDITOR_CONTROL::Reset(), PNS::TOOL_BASE::Reset(), PCBNEW_CONTROL::Reset(), GERBVIEW_SELECTION_TOOL::Reset(), DRAWING_TOOL::Reset(), EE_SELECTION_TOOL::Reset(), SELECTION_TOOL::Reset(), EE_TOOL_BASE< SCH_BASE_FRAME >::Reset(), Rotate(), GERBVIEW_SELECTION_TOOL::select(), GERBVIEW_SELECTION_TOOL::selectable(), SELECTION_TOOL::selectable(), GERBVIEW_SELECTION_TOOL::selectionContains(), EE_SELECTION_TOOL::selectionContains(), SELECTION_TOOL::selectionContains(), GERBVIEW_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::SelectPoint(), ZOOM_TOOL::selectRegion(), GERBVIEW_SELECTION_TOOL::selectVisually(), COMMON_TOOLS::ToggleGrid(), SCH_EDITOR_CONTROL::ToggleHiddenPins(), EE_SELECTION_TOOL::unhighlight(), SELECTION_TOOL::unhighlight(), GERBVIEW_SELECTION_TOOL::unselect(), GERBVIEW_SELECTION_TOOL::unselectVisually(), EE_POINT_EDITOR::updateEditedPoint(), POINT_EDITOR::updateEditedPoint(), PCBNEW_CONTROL::updateGrid(), EE_POINT_EDITOR::updateItem(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), EE_POINT_EDITOR::updatePoints(), POINT_EDITOR::updatePoints(), SELECTION_TOOL::updateSelection(), PNS::TOOL_BASE::updateStartItem(), EE_TOOL_BASE< SCH_BASE_FRAME >::updateView(), PCB_TOOL_BASE::view(), COMMON_TOOLS::ZoomFitScreen(), GERBVIEW_SELECTION_TOOL::zoomFitSelection(), SELECTION_TOOL::zoomFitSelection(), CVPCB_SELECTION_TOOL::~CVPCB_SELECTION_TOOL(), EE_SELECTION_TOOL::~EE_SELECTION_TOOL(), GERBVIEW_SELECTION_TOOL::~GERBVIEW_SELECTION_TOOL(), and SELECTION_TOOL::~SELECTION_TOOL().

◆ getViewControls()

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

Function getViewControls()

Returns the instance of VIEW_CONTROLS object used in the application. It allows tools to read & modify user input and its settings (eg. show cursor, enable snapping to grid, etc.)

Returns
The instance of VIEW_CONTROLS.

Definition at line 41 of file tool_base.cpp.

42 {
43  return m_toolMgr->GetViewControls();
44 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
KIGFX::VIEW_CONTROLS * GetViewControls() const
Definition: tool_manager.h:257

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

Referenced by EE_POINT_EDITOR::addCorner(), POINT_EDITOR::addCorner(), EE_POINT_EDITOR::addCornerCondition(), BreakWire(), PCB_TOOL_BASE::controls(), COMMON_TOOLS::CursorControl(), SCH_WIRE_BUS_TOOL::doDrawSegments(), SCH_DRAWING_TOOLS::doPlaceComponent(), SCH_DRAWING_TOOLS::doSingleClickPlace(), LIB_DRAWING_TOOLS::doTwoClickPlace(), SCH_DRAWING_TOOLS::doTwoClickPlace(), COMMON_TOOLS::doZoomToPreset(), MICROWAVE_TOOL::drawMicrowaveInductor(), LIB_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), MODULE_EDITOR_TOOLS::EnumeratePads(), SELECTION_TOOL::findMove(), SCH_WIRE_BUS_TOOL::finishSegments(), SCH_EDITOR_CONTROL::HighlightNet(), PCB_EDITOR_CONTROL::HighlightNet(), PCB_EDITOR_CONTROL::HighlightNetCursor(), SCH_MOVE_TOOL::Main(), EE_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), EE_PICKER_TOOL::Main(), PICKER_TOOL::Main(), CVPCB_SELECTION_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), EDIT_TOOL::Main(), ROUTER_TOOL::mainLoop(), CVPCB_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), POINT_EDITOR::OnSelectionChange(), ROUTER_TOOL::performDragging(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceImage(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), RepeatDrawItem(), EE_SELECTION_TOOL::RequestSelection(), POINT_EDITOR::Reset(), DRAWING_TOOL::Reset(), CVPCB_CONTROL::ResetCoords(), GERBVIEW_CONTROL::ResetCoords(), PCBNEW_CONTROL::ResetCoords(), GERBVIEW_SELECTION_TOOL::selectCursor(), SELECTION_TOOL::selectCursor(), GERBVIEW_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::SelectNode(), ZOOM_TOOL::selectRegion(), ALIGN_DISTRIBUTE_TOOL::selectTarget(), EE_PICKER_TOOL::setControls(), PICKER_TOOL::setControls(), EE_POINT_EDITOR::setEditedPoint(), POINT_EDITOR::setEditedPoint(), LIB_MOVE_TOOL::updateModificationPoint(), SCH_MOVE_TOOL::updateModificationPoint(), EDIT_TOOL::updateModificationPoint(), and COMMON_TOOLS::ZoomCenter().

◆ Go()

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

Function Go()

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

Definition at line 135 of file tool_interactive.h.

137 {
138  TOOL_STATE_FUNC sptr = std::bind( aStateFunc, static_cast<T*>( this ), std::placeholders::_1 );
139 
140  goInternal( sptr, aConditions );
141 }
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(), MICROWAVE_TOOL::setTransitions(), ROUTER_TOOL::setTransitions(), PAD_TOOL::setTransitions(), EE_INSPECTION_TOOL::setTransitions(), EE_POINT_EDITOR::setTransitions(), LIB_CONTROL::setTransitions(), LIB_PIN_TOOL::setTransitions(), ZONE_FILLER_TOOL::setTransitions(), CVPCB_CONTROL::setTransitions(), LIB_DRAWING_TOOLS::setTransitions(), LIB_MOVE_TOOL::setTransitions(), POINT_EDITOR::setTransitions(), GERBVIEW_CONTROL::setTransitions(), SCH_MOVE_TOOL::setTransitions(), LIB_EDIT_TOOL::setTransitions(), setTransitions(), POSITION_RELATIVE_TOOL::setTransitions(), COMMON_TOOLS::setTransitions(), CVPCB_SELECTION_TOOL::setTransitions(), SCH_DRAWING_TOOLS::setTransitions(), MODULE_EDITOR_TOOLS::setTransitions(), SCH_WIRE_BUS_TOOL::setTransitions(), ALIGN_DISTRIBUTE_TOOL::setTransitions(), PCBNEW_CONTROL::setTransitions(), GERBVIEW_SELECTION_TOOL::setTransitions(), SCH_EDITOR_CONTROL::setTransitions(), EE_PICKER_TOOL::setTransitions(), PICKER_TOOL::setTransitions(), PCB_EDITOR_CONTROL::setTransitions(), SELECTION_TOOL::setTransitions(), EDIT_TOOL::setTransitions(), DRAWING_TOOL::setTransitions(), and EE_SELECTION_TOOL::setTransitions().

◆ Init()

bool SCH_EDIT_TOOL::Init ( )
overridevirtual

Function Init() 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 248 of file sch_edit_tool.cpp.

249 {
251 
254 
255  wxASSERT_MSG( drawingTools, "eeshema.InteractiveDrawing tool is not available" );
256 
257  auto sheetTool = [ this ] ( const SELECTION& aSel ) {
258  return ( m_frame->GetToolId() == ID_SHEET_TOOL );
259  };
260 
261  auto anyTextTool = [ this ] ( const SELECTION& aSel ) {
262  return ( m_frame->GetToolId() == ID_LABEL_TOOL
266  };
267 
268  auto duplicateCondition = [] ( const SELECTION& aSel ) {
270  return false;
271 
272  return true;
273  };
274 
275  auto orientCondition = [] ( const SELECTION& aSel ) {
276  if( aSel.Empty() )
277  return false;
278 
280  return false;
281 
282  SCH_ITEM* item = (SCH_ITEM*) aSel.Front();
283 
284  if( aSel.GetSize() > 1 )
285  return true;
286 
287  switch( item->Type() )
288  {
289  case SCH_MARKER_T:
290  case SCH_JUNCTION_T:
291  case SCH_NO_CONNECT_T:
293  case SCH_BUS_BUS_ENTRY_T:
294  case SCH_LINE_T:
295  case SCH_SHEET_PIN_T:
296  case SCH_PIN_T:
297  return false;
298  default:
299  return true;
300  }
301  };
302 
303  auto propertiesCondition = [] ( const SELECTION& aSel ) {
304  if( aSel.GetSize() != 1 )
305  return false;
306 
307  switch( static_cast<EDA_ITEM*>( aSel.Front() )->Type() )
308  {
309  case SCH_MARKER_T:
310  case SCH_JUNCTION_T:
311  case SCH_NO_CONNECT_T:
313  case SCH_BUS_BUS_ENTRY_T:
314  case SCH_LINE_T:
315  case SCH_SHEET_PIN_T:
316  case SCH_PIN_T:
317  return false;
318  default:
319  return true;
320  }
321  };
322 
323  KICAD_T toLabelTypes[] = { SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_TEXT_T, EOT };
324  auto toLabelCondition = EE_CONDITIONS::Count( 1 )
325  && EE_CONDITIONS::OnlyTypes( toLabelTypes );
326 
327  KICAD_T toHLableTypes[] = { SCH_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_TEXT_T, EOT };
328  auto toHLabelCondition = EE_CONDITIONS::Count( 1 )
329  && EE_CONDITIONS::OnlyTypes( toHLableTypes);
330 
331  KICAD_T toGLableTypes[] = { SCH_LABEL_T, SCH_HIER_LABEL_T, SCH_TEXT_T, EOT };
332  auto toGLabelCondition = EE_CONDITIONS::Count( 1 )
333  && EE_CONDITIONS::OnlyTypes( toGLableTypes);
334 
336  auto toTextlCondition = EE_CONDITIONS::Count( 1 )
337  && EE_CONDITIONS::OnlyTypes( toTextTypes);
338 
340  auto entryCondition = EE_CONDITIONS::MoreThan( 0 )
341  && EE_CONDITIONS::OnlyTypes( entryTypes );
342 
343  auto singleComponentCondition = EE_CONDITIONS::Count( 1 )
345 
346  auto wireSelectionCondition = EE_CONDITIONS::MoreThan( 0 )
348 
349  auto busSelectionCondition = EE_CONDITIONS::MoreThan( 0 )
351 
352  auto singleSheetCondition = EE_CONDITIONS::Count( 1 )
354 
355  //
356  // Add edit actions to the move tool menu
357  //
358  if( moveTool )
359  {
360  CONDITIONAL_MENU& moveMenu = moveTool->GetToolMenu().GetMenu();
361 
363  moveMenu.AddItem( EE_ACTIONS::rotateCCW, orientCondition );
364  moveMenu.AddItem( EE_ACTIONS::rotateCW, orientCondition );
365  moveMenu.AddItem( EE_ACTIONS::mirrorX, orientCondition );
366  moveMenu.AddItem( EE_ACTIONS::mirrorY, orientCondition );
367  moveMenu.AddItem( EE_ACTIONS::duplicate, duplicateCondition );
369 
370  moveMenu.AddItem( EE_ACTIONS::properties, propertiesCondition );
371  moveMenu.AddItem( EE_ACTIONS::editReference, singleComponentCondition );
372  moveMenu.AddItem( EE_ACTIONS::editValue, singleComponentCondition );
373  moveMenu.AddItem( EE_ACTIONS::editFootprint, singleComponentCondition );
375 
376  std::shared_ptr<SYMBOL_UNIT_MENU> symUnitMenu = std::make_shared<SYMBOL_UNIT_MENU>();
377  symUnitMenu->SetTool( this );
378  m_menu.AddSubMenu( symUnitMenu );
379  moveMenu.AddMenu( symUnitMenu.get(), EE_CONDITIONS::SingleMultiUnitSymbol, 1 );
380 
384  }
385 
386  //
387  // Add editing actions to the drawing tool menu
388  //
389  CONDITIONAL_MENU& drawMenu = drawingTools->GetToolMenu().GetMenu();
390 
391  drawMenu.AddSeparator( EE_CONDITIONS::NotEmpty, 200 );
392  drawMenu.AddItem( EE_ACTIONS::rotateCCW, orientCondition, 200 );
393  drawMenu.AddItem( EE_ACTIONS::rotateCW, orientCondition, 200 );
394  drawMenu.AddItem( EE_ACTIONS::mirrorX, orientCondition, 200 );
395  drawMenu.AddItem( EE_ACTIONS::mirrorY, orientCondition, 200 );
396 
397  drawMenu.AddItem( EE_ACTIONS::properties, propertiesCondition, 200 );
398  drawMenu.AddItem( EE_ACTIONS::editReference, singleComponentCondition, 200 );
399  drawMenu.AddItem( EE_ACTIONS::editValue, singleComponentCondition, 200 );
400  drawMenu.AddItem( EE_ACTIONS::editFootprint, singleComponentCondition, 200 );
402 
403  std::shared_ptr<SYMBOL_UNIT_MENU> symUnitMenu2 = std::make_shared<SYMBOL_UNIT_MENU>();
404  symUnitMenu2->SetTool( drawingTools );
405  drawingTools->GetToolMenu().AddSubMenu( symUnitMenu2 );
406  drawMenu.AddMenu( symUnitMenu2.get(), EE_CONDITIONS::SingleMultiUnitSymbol, 1 );
407 
409  singleComponentCondition && EE_CONDITIONS::Idle, 200 );
410 
411  drawMenu.AddItem( EE_ACTIONS::toShapeSlash, entryCondition, 200 );
412  drawMenu.AddItem( EE_ACTIONS::toShapeBackslash, entryCondition, 200 );
413  drawMenu.AddItem( EE_ACTIONS::toLabel, anyTextTool && EE_CONDITIONS::Idle, 200 );
414  drawMenu.AddItem( EE_ACTIONS::toHLabel, anyTextTool && EE_CONDITIONS::Idle, 200 );
415  drawMenu.AddItem( EE_ACTIONS::toGLabel, anyTextTool && EE_CONDITIONS::Idle, 200 );
416  drawMenu.AddItem( EE_ACTIONS::toText, anyTextTool && EE_CONDITIONS::Idle, 200 );
417  drawMenu.AddItem( EE_ACTIONS::cleanupSheetPins, sheetTool && EE_CONDITIONS::Idle, 200 );
418 
419  //
420  // Add editing actions to the selection tool menu
421  //
423 
424  selToolMenu.AddItem( EE_ACTIONS::rotateCCW, orientCondition, 200 );
425  selToolMenu.AddItem( EE_ACTIONS::rotateCW, orientCondition, 200 );
426  selToolMenu.AddItem( EE_ACTIONS::mirrorX, orientCondition, 200 );
427  selToolMenu.AddItem( EE_ACTIONS::mirrorY, orientCondition, 200 );
428  selToolMenu.AddItem( EE_ACTIONS::duplicate, duplicateCondition, 200 );
430 
431  selToolMenu.AddItem( EE_ACTIONS::properties, propertiesCondition, 200 );
435  selToolMenu.AddItem( EE_ACTIONS::autoplaceFields, singleComponentCondition, 200 );
437 
438  std::shared_ptr<SYMBOL_UNIT_MENU> symUnitMenu3 = std::make_shared<SYMBOL_UNIT_MENU>();
439  symUnitMenu3->SetTool( m_selectionTool );
440  m_selectionTool->GetToolMenu().AddSubMenu( symUnitMenu3 );
441  selToolMenu.AddMenu( symUnitMenu3.get(), EE_CONDITIONS::SingleMultiUnitSymbol, 1 );
442 
444  singleComponentCondition && EE_CONDITIONS::Idle, 200 );
445 
446  selToolMenu.AddItem( EE_ACTIONS::toShapeSlash, entryCondition, 200 );
447  selToolMenu.AddItem( EE_ACTIONS::toShapeBackslash, entryCondition, 200 );
448  selToolMenu.AddItem( EE_ACTIONS::toLabel, toLabelCondition, 200 );
449  selToolMenu.AddItem( EE_ACTIONS::toHLabel, toHLabelCondition, 200 );
450  selToolMenu.AddItem( EE_ACTIONS::toGLabel, toGLabelCondition, 200 );
451  selToolMenu.AddItem( EE_ACTIONS::toText, toTextlCondition, 200 );
452  selToolMenu.AddItem( EE_ACTIONS::cleanupSheetPins, singleSheetCondition, 200 );
453 
454  selToolMenu.AddSeparator( EE_CONDITIONS::Idle, 200 );
457  selToolMenu.AddItem( ACTIONS::paste, EE_CONDITIONS::Idle, 200 );
458 
459  return true;
460 }
void AddMenu(ACTION_MENU *aMenu, const SELECTION_CONDITION &aCondition=SELECTION_CONDITIONS::ShowAlways, int aOrder=ANY_ORDER)
Function AddMenu()
static TOOL_ACTION properties
Definition: ee_actions.h:124
static SELECTION_CONDITION SingleSymbol
static TOOL_ACTION duplicate
Definition: ee_actions.h:118
TOOL_MENU & GetToolMenu()
Class SCH_DRAWING_TOOLS.
static TOOL_ACTION toShapeBackslash
Definition: ee_actions.h:137
static SELECTION_CONDITION MoreThan(int aNumber)
Function MoreThan Creates a functor that tests if the number of selected items is greater than the va...
void AddSeparator(const SELECTION_CONDITION &aCondition=SELECTION_CONDITIONS::ShowAlways, int aOrder=ANY_ORDER)
Function AddSeparator()
static SELECTION_CONDITION OnlyTypes(const KICAD_T aTypes[])
Function OnlyTypes Creates a functor that tests if the selected items are only of given types.
CONDITIONAL_MENU & GetMenu()
Function GetMenu.
Definition: tool_menu.cpp:46
static TOOL_ACTION mirrorY
Definition: ee_actions.h:123
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
static SELECTION_CONDITION IdleSelection
static TOOL_ACTION toText
Definition: ee_actions.h:141
static TOOL_ACTION autoplaceFields
Definition: ee_actions.h:128
static SELECTION_CONDITION Idle
static SELECTION_CONDITION Count(int aNumber)
Function Count Creates a functor that tests if the number of selected items is equal to the value giv...
TOOL_MENU & GetToolMenu()
Get the tool's top-level context menu
Definition: ee_tool_base.h:103
static TOOL_ACTION convertDeMorgan
Definition: ee_actions.h:129
static bool NotEmpty(const SELECTION &aSelection)
Function NotEmpty Tests if there are any items selected.
search types array terminator (End Of Types)
Definition: typeinfo.h:82
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
static TOOL_ACTION rotateCW
Definition: ee_actions.h:120
bool Init() override
Function Init() Init() is called once upon a registration of the tool.
Definition: ee_tool_base.h:69
static SELECTION_CONDITION SingleDeMorganSymbol
static TOOL_ACTION copy
Definition: actions.h:53
static TOOL_ACTION cleanupSheetPins
Definition: ee_actions.h:163
static TOOL_ACTION rotateCCW
Definition: ee_actions.h:121
static TOOL_ACTION editFootprint
Definition: ee_actions.h:127
static TOOL_ACTION cut
Definition: actions.h:52
static bool IsDrawingLineWireOrBus(const SELECTION &aSelection)
static TOOL_ACTION mirrorX
Definition: ee_actions.h:122
static TOOL_ACTION doDelete
Definition: ee_actions.h:131
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:143
static SELECTION_CONDITION SingleMultiUnitSymbol
TOOL_MENU m_menu
Menu model displayed by the tool.
Definition: ee_tool_base.h:147
static TOOL_ACTION editValue
Definition: ee_actions.h:126
void AddSubMenu(std::shared_ptr< ACTION_MENU > aSubMenu)
Function CreateSubMenu.
Definition: tool_menu.cpp:52
static SELECTION_CONDITION OnlyType(KICAD_T aType)
Function OnlyType Creates a functor that tests if the selected items are only of given type.
static TOOL_ACTION toLabel
Definition: ee_actions.h:138
static TOOL_ACTION toHLabel
Definition: ee_actions.h:139
static TOOL_ACTION editReference
Definition: ee_actions.h:125
void AddItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Function AddItem()
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
Definition: sch_item.h:114
static TOOL_ACTION toGLabel
Definition: ee_actions.h:140
static TOOL_ACTION editWithSymbolEditor
Definition: ee_actions.h:151
static TOOL_ACTION paste
Definition: actions.h:54
int GetToolId() const
Definition: draw_frame.h:524
static TOOL_ACTION toShapeSlash
Definition: ee_actions.h:136
KICAD_T Type() const
Function Type()
Definition: base_struct.h:204

References CONDITIONAL_MENU::AddItem(), CONDITIONAL_MENU::AddMenu(), CONDITIONAL_MENU::AddSeparator(), TOOL_MENU::AddSubMenu(), EE_ACTIONS::autoplaceFields, EE_ACTIONS::cleanupSheetPins, EE_ACTIONS::convertDeMorgan, ACTIONS::copy, SELECTION_CONDITIONS::Count(), ACTIONS::cut, EE_ACTIONS::doDelete, EE_ACTIONS::duplicate, EE_ACTIONS::editFootprint, EE_ACTIONS::editReference, EE_ACTIONS::editValue, EE_ACTIONS::editWithSymbolEditor, EOT, TOOL_MENU::GetMenu(), TOOL_MANAGER::GetTool(), EDA_DRAW_FRAME::GetToolId(), EE_SELECTION_TOOL::GetToolMenu(), EE_TOOL_BASE< T >::GetToolMenu(), ID_GLOBALLABEL_TOOL, ID_HIERLABEL_TOOL, ID_LABEL_TOOL, ID_SCHEMATIC_TEXT_TOOL, ID_SHEET_TOOL, EE_CONDITIONS::Idle, EE_CONDITIONS::IdleSelection, EE_TOOL_BASE< T >::Init(), SCH_WIRE_BUS_TOOL::IsDrawingLineWireOrBus(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_menu, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, EE_ACTIONS::mirrorX, EE_ACTIONS::mirrorY, SELECTION_CONDITIONS::MoreThan(), SELECTION_CONDITIONS::NotEmpty(), SELECTION_CONDITIONS::OnlyType(), SELECTION_CONDITIONS::OnlyTypes(), ACTIONS::paste, EE_ACTIONS::properties, EE_ACTIONS::rotateCCW, EE_ACTIONS::rotateCW, SCH_BUS_BUS_ENTRY_T, SCH_BUS_WIRE_ENTRY_T, SCH_COMPONENT_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_JUNCTION_T, SCH_LABEL_T, SCH_LINE_LOCATE_BUS_T, SCH_LINE_LOCATE_WIRE_T, SCH_LINE_T, SCH_MARKER_T, SCH_NO_CONNECT_T, SCH_PIN_T, SCH_SHEET_PIN_T, SCH_SHEET_T, SCH_TEXT_T, EE_CONDITIONS::SingleDeMorganSymbol, EE_CONDITIONS::SingleMultiUnitSymbol, EE_CONDITIONS::SingleSymbol, EE_ACTIONS::toGLabel, EE_ACTIONS::toHLabel, EE_ACTIONS::toLabel, EE_ACTIONS::toShapeBackslash, EE_ACTIONS::toShapeSlash, EE_ACTIONS::toText, and EDA_ITEM::Type().

◆ IsToolActive()

bool TOOL_BASE::IsToolActive ( ) const
inherited

Definition at line 30 of file tool_base.cpp.

31 {
32  return m_toolMgr->IsToolActive( m_toolId );
33 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
TOOL_ID m_toolId
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:211
bool IsToolActive(TOOL_ID aId) const
Function IsToolActive() Returns true if a tool with given id is active (executing)

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

◆ Mirror()

int SCH_EDIT_TOOL::Mirror ( const TOOL_EVENT aEvent)

Definition at line 603 of file sch_edit_tool.cpp.

604 {
606 
607  if( selection.GetSize() == 0 )
608  return 0;
609 
610  wxPoint mirrorPoint;
611  bool xAxis = ( aEvent.Matches( EE_ACTIONS::mirrorX.MakeEvent() ) );
612  SCH_ITEM* item = static_cast<SCH_ITEM*>( selection.Front() );
613  bool connections = false;
614  bool moving = item->IsMoving();
615 
616  if( selection.GetSize() == 1 )
617  {
618  if( !moving )
620 
621  switch( item->Type() )
622  {
623  case SCH_COMPONENT_T:
624  {
625  SCH_COMPONENT* component = static_cast<SCH_COMPONENT*>( item );
626 
627  if( xAxis )
628  component->SetOrientation( CMP_MIRROR_X );
629  else
630  component->SetOrientation( CMP_MIRROR_Y );
631 
632  if( m_frame->GetAutoplaceFields() )
633  component->AutoAutoplaceFields( m_frame->GetScreen() );
634 
635  break;
636  }
637 
638  case SCH_TEXT_T:
639  case SCH_LABEL_T:
640  case SCH_GLOBAL_LABEL_T:
641  case SCH_HIER_LABEL_T:
642  {
643  SCH_TEXT* textItem = static_cast<SCH_TEXT*>( item );
644  int spin = textItem->GetLabelSpinStyle();
645 
646  if( xAxis && spin % 2 )
647  textItem->SetLabelSpinStyle( ( spin + 2 ) % 4 );
648  else if ( !xAxis && !( spin % 2 ) )
649  textItem->SetLabelSpinStyle( ( spin + 2 ) % 4 );
650  break;
651  }
652 
653  case SCH_BUS_BUS_ENTRY_T:
655  if( xAxis )
656  item->MirrorX( item->GetPosition().y );
657  else
658  item->MirrorY( item->GetPosition().x );
659  break;
660 
661  case SCH_FIELD_T:
662  {
663  SCH_FIELD* field = static_cast<SCH_FIELD*>( item );
664 
665  if( xAxis )
667  else
669 
670  // Now that we're re-justifying a field, they're no longer autoplaced.
671  if( item->GetParent()->Type() == SCH_COMPONENT_T )
672  {
673  SCH_COMPONENT *parent = static_cast<SCH_COMPONENT*>( item->GetParent() );
674  parent->ClearFieldsAutoplaced();
675  }
676 
677  break;
678  }
679 
680  case SCH_BITMAP_T:
681  if( xAxis )
682  item->MirrorX( item->GetPosition().y );
683  else
684  item->MirrorY( item->GetPosition().x );
685 
686  // The bitmap is cached in Opengl: clear the cache to redraw
688  break;
689 
690  case SCH_SHEET_T:
691  // Mirror the sheet on itself. Sheets do not have a anchor point.
692  mirrorPoint = m_frame->GetNearestGridPosition( item->GetBoundingBox().Centre() );
693 
694  if( xAxis )
695  item->MirrorX( mirrorPoint.y );
696  else
697  item->MirrorY( mirrorPoint.x );
698 
699  break;
700 
701  default:
702  break;
703  }
704 
705  connections = item->IsConnectable();
706  m_frame->RefreshItem( item );
707  }
708  else if( selection.GetSize() > 1 )
709  {
710  mirrorPoint = m_frame->GetNearestGridPosition( (wxPoint)selection.GetCenter() );
711 
712  for( unsigned ii = 0; ii < selection.GetSize(); ii++ )
713  {
714  item = static_cast<SCH_ITEM*>( selection.GetItem( ii ) );
715 
716  if( !moving )
717  saveCopyInUndoList( item, UR_CHANGED, ii > 0 );
718 
719  if( xAxis )
720  item->MirrorX( mirrorPoint.y );
721  else
722  item->MirrorY( mirrorPoint.x );
723 
724  connections |= item->IsConnectable();
725  m_frame->RefreshItem( item );
726  }
727  }
728 
730 
731  if( !item->IsMoving() )
732  {
733  if( selection.IsHover() )
735 
736  if( connections )
738 
739  m_frame->OnModify();
740  }
741 
742  return 0;
743 }
Class SCH_FIELD instances are attached to a component and provide a place for the component's value,...
Definition: sch_field.h:52
void AutoAutoplaceFields(SCH_SCREEN *aScreen)
Autoplace fields only if correct to do so automatically.
virtual bool IsConnectable() const
Function IsConnectable returns true if the schematic item can connect to another schematic item.
Definition: sch_item.h:299
VECTOR2I GetCenter() const
Returns the center point of the selection area bounding box.
EDA_TEXT_HJUSTIFY_T
Definition: eda_text.h:63
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:208
bool IsHover() const
Definition: selection.h:69
virtual void SetLabelSpinStyle(int aSpinStyle)
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
Definition: sch_text.cpp:248
bool IsMoving() const
Definition: base_struct.h:224
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
void RecacheAllItems()
Function RecacheAllItems() Rebuilds GAL display lists.
Definition: view.cpp:1401
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
bool TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
bool GetAutoplaceFields() const
static const TOOL_EVENT SelectedItemsModified
Definition: actions.h:136
void ClearFieldsAutoplaced()
Set fields automatically placed flag false.
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
int GetLabelSpinStyle() const
Definition: sch_text.h:119
virtual wxPoint GetPosition() const =0
Function GetPosition.
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:207
void SetVertJustify(EDA_TEXT_VJUSTIFY_T aType)
Definition: eda_text.h:211
EDA_ITEM * GetParent() const
Definition: base_struct.h:214
static TOOL_ACTION mirrorX
Definition: ee_actions.h:122
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:143
bool Matches(const TOOL_EVENT &aEvent) const
Function Matches() Tests whether two events match in terms of category & action or command.
Definition: tool_event.h:338
virtual void MirrorX(int aXaxis_position)=0
Function MirrorX mirrors item relative to the X axis about aXaxis_position.
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:57
virtual void MirrorY(int aYaxis_position)=0
Function MirrorY mirrors item relative to the Y axis about aYaxis_position.
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
Definition: selection.h:103
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:35
EDA_TEXT_VJUSTIFY_T
Definition: eda_text.h:70
virtual unsigned int GetSize() const override
Function GetSize() Returns the number of stored items.
Definition: selection.h:98
static const KICAD_T RotatableItems[]
Definition: ee_collectors.h:43
wxPoint GetNearestGridPosition(const wxPoint &aPosition, wxRealPoint *aGridSize=NULL) const
Return the nearest aGridSize location to aPosition.
void RefreshItem(EDA_ITEM *aItem, bool isAddOrDelete=false)
Mark an item for refresh.
void SetHorizJustify(EDA_TEXT_HJUSTIFY_T aType)
Definition: eda_text.h:210
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:73
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO_T aType, bool aAppend=false)
Similar to m_frame->SaveCopyInUndoList(), but handles items that are owned by their parents.
Definition: ee_tool_base.h:120
wxPoint Centre() const
Definition: eda_rect.h:60
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
virtual const EDA_RECT GetBoundingBox() const
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
void PostEvent(const TOOL_EVENT &aEvent)
Puts an event to the event queue to be processed at the end of event processing cycle.
Definition: tool_manager.h:238
SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
Definition: sch_item.h:114
EDA_ITEM * Front() const
Definition: selection.h:155
KICAD_T Type() const
Function Type()
Definition: base_struct.h:204
void SetOrientation(int aOrientation)
Compute the new transform matrix based on aOrientation for the symbol which is applied to the current...

References SCH_COMPONENT::AutoAutoplaceFields(), EDA_RECT::Centre(), SCH_COMPONENT::ClearFieldsAutoplaced(), EE_ACTIONS::clearSelection, CMP_MIRROR_X, CMP_MIRROR_Y, SELECTION::Front(), SCH_EDIT_FRAME::GetAutoplaceFields(), EDA_ITEM::GetBoundingBox(), SELECTION::GetCenter(), EDA_TEXT::GetHorizJustify(), SELECTION::GetItem(), SCH_TEXT::GetLabelSpinStyle(), EDA_DRAW_FRAME::GetNearestGridPosition(), EDA_ITEM::GetParent(), SCH_ITEM::GetPosition(), SCH_EDIT_FRAME::GetScreen(), SELECTION::GetSize(), EDA_TEXT::GetVertJustify(), TOOL_BASE::getView(), SCH_ITEM::IsConnectable(), SELECTION::IsHover(), EDA_ITEM::IsMoving(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, TOOL_EVENT::Matches(), EE_ACTIONS::mirrorX, SCH_ITEM::MirrorX(), SCH_ITEM::MirrorY(), SCH_EDIT_FRAME::OnModify(), TOOL_MANAGER::PostEvent(), KIGFX::VIEW::RecacheAllItems(), SCH_BASE_FRAME::RefreshItem(), EE_SELECTION_TOOL::RequestSelection(), EE_COLLECTOR::RotatableItems, TOOL_MANAGER::RunAction(), EE_TOOL_BASE< SCH_EDIT_FRAME >::saveCopyInUndoList(), SCH_BITMAP_T, SCH_BUS_BUS_ENTRY_T, SCH_BUS_WIRE_ENTRY_T, SCH_COMPONENT_T, SCH_FIELD_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, SCH_SHEET_T, SCH_TEXT_T, EVENTS::SelectedItemsModified, EDA_TEXT::SetHorizJustify(), SCH_TEXT::SetLabelSpinStyle(), SCH_COMPONENT::SetOrientation(), EDA_TEXT::SetVertJustify(), SCH_EDIT_FRAME::TestDanglingEnds(), EDA_ITEM::Type(), and UR_CHANGED.

Referenced by setTransitions().

◆ Properties()

int SCH_EDIT_TOOL::Properties ( const TOOL_EVENT aEvent)

Definition at line 1094 of file sch_edit_tool.cpp.

1095 {
1097 
1098  if( selection.Empty() )
1099  return 0;
1100 
1101  SCH_ITEM* item = (SCH_ITEM*) selection.Front();
1102 
1103  switch( item->Type() )
1104  {
1105  case SCH_COMPONENT_T:
1106  m_frame->EditComponent( (SCH_COMPONENT*) item );
1107  break;
1108 
1109  case SCH_SHEET_T:
1110  {
1111  bool doClearAnnotation;
1112  bool doRefresh = false;
1113  // Keep track of existing sheet paths. EditSheet() can modify this list
1114  SCH_SHEET_LIST initial_sheetpathList( g_RootSheet );
1115 
1116  doRefresh = m_frame->EditSheet( (SCH_SHEET*) item, g_CurrentSheet, &doClearAnnotation );
1117 
1118  if( doClearAnnotation ) // happens when the current sheet load a existing file
1119  { // we must clear "new" components annotation
1120  SCH_SCREENS screensList( g_RootSheet );
1121  // We clear annotation of new sheet paths here:
1122  screensList.ClearAnnotationOfNewSheetPaths( initial_sheetpathList );
1123  // Clear annotation of g_CurrentSheet itself, because its sheetpath
1124  // is not a new path, but components managed by its sheet path must have
1125  // their annotation cleared, becuase they are new:
1126  ((SCH_SHEET*) item)->GetScreen()->ClearAnnotation( g_CurrentSheet );
1127  }
1128 
1129  if( doRefresh )
1130  {
1132  m_frame->GetCanvas()->Refresh();
1133  }
1134 
1135  break;
1136  }
1137 
1138  case SCH_SHEET_PIN_T:
1139  m_frame->EditSheetPin( (SCH_SHEET_PIN*) item, true );
1140  break;
1141 
1142  case SCH_TEXT_T:
1143  case SCH_LABEL_T:
1144  case SCH_GLOBAL_LABEL_T:
1145  case SCH_HIER_LABEL_T:
1146  m_frame->EditSchematicText( (SCH_TEXT*) item );
1147  break;
1148 
1149  case SCH_FIELD_T:
1151  break;
1152 
1153  case SCH_BITMAP_T:
1154  if( m_frame->EditImage( (SCH_BITMAP*) item ) )
1155  {
1156  // The bitmap is cached in Opengl: clear the cache in case it has become invalid
1157  getView()->RecacheAllItems();
1158  }
1159 
1160  break;
1161 
1162  case SCH_LINE_T:
1163  m_frame->EditLine( (SCH_LINE*) item, true );
1164  break;
1165 
1166  case SCH_MARKER_T: // These items have no properties to edit
1167  case SCH_JUNCTION_T:
1168  case SCH_NO_CONNECT_T:
1169  break;
1170 
1171  default: // Unexpected item
1172  wxFAIL_MSG( wxString( "Cannot edit schematic item type " ) + item->GetClass() );
1173  }
1174 
1175  updateView( item );
1176 
1177  return 0;
1178 }
Class SCH_SHEET_LIST.
Class SCH_FIELD instances are attached to a component and provide a place for the component's value,...
Definition: sch_field.h:52
void EditComponent(SCH_COMPONENT *aComponent)
Display the edit component dialog to edit the parameters of aComponent.
int EditLine(SCH_LINE *aLine, bool aRedraw)
Function EditLine displays the dialog for editing the parameters of aLine.
Definition: sch_line.cpp:816
wxString GetClass() const override
Function GetClass returns the class name.
Definition: sch_line.h:60
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
void RecacheAllItems()
Function RecacheAllItems() Rebuilds GAL display lists.
Definition: view.cpp:1401
void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
void EditComponentFieldText(SCH_FIELD *aField)
Display the edit field dialog to edit the parameters of aField.
bool EditSheet(SCH_SHEET *aSheet, SCH_SHEET_PATH *aHierarchy, bool *aClearAnnotationNewItems)
Edit an existing sheet or add a new sheet to the schematic.
Definition: sheet.cpp:49
static const TOOL_EVENT SelectedItemsModified
Definition: actions.h:136
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:56
SCH_SHEET_PATH * g_CurrentSheet
With the new connectivity algorithm, many more places than before want to know what the current sheet...
SCH_DRAW_PANEL * GetCanvas() const override
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:143
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:56
Object to handle a bitmap image that can be inserted in a schematic.
Definition: sch_bitmap.h:42
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:35
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:119
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:201
void EditSchematicText(SCH_TEXT *aText)
Launches the "Edit Text/Label" dialog.
void updateView(EDA_ITEM *aItem) const
Similar to getView()->Update(), but handles items that are redrawn by their parents.
Definition: ee_tool_base.h:107
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:37
bool EditImage(SCH_BITMAP *aItem)
Launches the "Edit Image" dialog to modify an image.
Definition: edit_bitmap.cpp:35
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:73
int EditSheetPin(SCH_SHEET_PIN *aSheetPin, bool aRedraw)
Display the dialog for editing the parameters of aSheetPin.
Definition: sheet.cpp:328
void PostEvent(const TOOL_EVENT &aEvent)
Puts an event to the event queue to be processed at the end of event processing cycle.
Definition: tool_manager.h:238
SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
Definition: sch_item.h:114
static const KICAD_T EditableItems[]
Definition: ee_collectors.h:42
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:493
EDA_ITEM * Front() const
Definition: selection.h:155
KICAD_T Type() const
Function Type()
Definition: base_struct.h:204

References SCH_SCREENS::ClearAnnotationOfNewSheetPaths(), EE_COLLECTOR::EditableItems, SCH_EDIT_FRAME::EditComponent(), SCH_EDIT_FRAME::EditComponentFieldText(), SCH_EDIT_FRAME::EditImage(), SCH_EDIT_FRAME::EditLine(), SCH_EDIT_FRAME::EditSchematicText(), SCH_EDIT_FRAME::EditSheet(), SCH_EDIT_FRAME::EditSheetPin(), SELECTION::Empty(), SELECTION::Front(), g_CurrentSheet, g_RootSheet, SCH_BASE_FRAME::GetCanvas(), SCH_LINE::GetClass(), TOOL_BASE::getView(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, TOOL_MANAGER::PostEvent(), KIGFX::VIEW::RecacheAllItems(), SCH_DRAW_PANEL::Refresh(), EE_SELECTION_TOOL::RequestSelection(), SCH_BITMAP_T, SCH_COMPONENT_T, SCH_FIELD_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_JUNCTION_T, SCH_LABEL_T, SCH_LINE_T, SCH_MARKER_T, SCH_NO_CONNECT_T, SCH_SHEET_PIN_T, SCH_SHEET_T, SCH_TEXT_T, EVENTS::SelectedItemsModified, EDA_ITEM::Type(), and EE_TOOL_BASE< SCH_EDIT_FRAME >::updateView().

Referenced by setTransitions().

◆ RepeatDrawItem()

int SCH_EDIT_TOOL::RepeatDrawItem ( const TOOL_EVENT aEvent)

Definition at line 854 of file sch_edit_tool.cpp.

855 {
856  SCH_ITEM* sourceItem = m_frame->GetRepeatItem();
857 
858  if( !sourceItem )
859  return 0;
860 
862 
863  SCH_ITEM* newItem = (SCH_ITEM*) sourceItem->Clone();
864  bool performDrag = false;
865 
866  // If cloning a component then put into 'move' mode.
867  if( newItem->Type() == SCH_COMPONENT_T )
868  {
869  ( (SCH_COMPONENT*) newItem )->SetTimeStamp( GetNewTimeStamp() );
870 
871  wxPoint cursorPos = (wxPoint) getViewControls()->GetCursorPosition( true );
872  newItem->Move( cursorPos - newItem->GetPosition() );
873  performDrag = true;
874  }
875  else
876  {
877  if( newItem->CanIncrementLabel() )
878  ( (SCH_TEXT*) newItem )->IncrementLabel( m_frame->GetRepeatDeltaLabel() );
879 
880  newItem->Move( m_frame->GetRepeatStep() );
881  }
882 
883  newItem->SetFlags( IS_NEW );
884  m_frame->AddToScreen( newItem );
885  m_frame->SaveCopyInUndoList( newItem, UR_NEW );
886 
887  m_selectionTool->AddItemToSel( newItem );
888 
889  if( performDrag )
891 
892  newItem->ClearFlags();
893 
894  if( newItem->IsConnectable() )
896 
897  // newItem newItem, now that it has been moved, thus saving new position.
898  m_frame->SaveCopyForRepeatItem( newItem );
899 
900  return 0;
901 }
virtual bool IsConnectable() const
Function IsConnectable returns true if the schematic item can connect to another schematic item.
Definition: sch_item.h:299
void AddToScreen(EDA_ITEM *aItem, SCH_SCREEN *aScreen=nullptr)
Add an item to the screen (and view) aScreen is the screen the item is located on,...
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
virtual bool CanIncrementLabel() const
Definition: sch_item.h:360
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
bool TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
virtual EDA_ITEM * Clone() const
Function Clone creates a duplicate of this item with linked list members set to NULL.
#define IS_NEW
New item, just created.
Definition: base_struct.h:114
timestamp_t GetNewTimeStamp()
Definition: common.cpp:217
virtual wxPoint GetPosition() const =0
Function GetPosition.
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:259
void SaveCopyInUndoList(SCH_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, bool aAppend=false, const wxPoint &aTransformPoint=wxPoint(0, 0))
Create a copy of the current schematic item, and put it in the undo list.
void SaveCopyForRepeatItem(SCH_ITEM *aItem)
Clone aItem and owns that clone in this container.
const wxPoint GetRepeatStep() const
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:143
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:57
SCH_ITEM * GetRepeatItem() const
Return the item which is to be repeated with the insert key.
int AddItemToSel(const TOOL_EVENT &aEvent)
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:73
int GetRepeatDeltaLabel() const
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:260
static TOOL_ACTION move
Definition: ee_actions.h:116
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:41
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
Definition: sch_item.h:114
VECTOR2D GetCursorPosition() const
Returns the current cursor position in world coordinates.
KICAD_T Type() const
Function Type()
Definition: base_struct.h:204
void SetTimeStamp(timestamp_t aNewTimeStamp)
Definition: base_struct.h:209
virtual void Move(const wxPoint &aMoveVector)=0
Function Move moves the item by aMoveVector to a new position.

References EE_SELECTION_TOOL::AddItemToSel(), SCH_BASE_FRAME::AddToScreen(), SCH_ITEM::CanIncrementLabel(), EDA_ITEM::ClearFlags(), EE_ACTIONS::clearSelection, EDA_ITEM::Clone(), KIGFX::VIEW_CONTROLS::GetCursorPosition(), GetNewTimeStamp(), SCH_ITEM::GetPosition(), SCH_BASE_FRAME::GetRepeatDeltaLabel(), SCH_EDIT_FRAME::GetRepeatItem(), SCH_BASE_FRAME::GetRepeatStep(), TOOL_BASE::getViewControls(), IS_NEW, SCH_ITEM::IsConnectable(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, EE_ACTIONS::move, SCH_ITEM::Move(), TOOL_MANAGER::RunAction(), SCH_EDIT_FRAME::SaveCopyForRepeatItem(), SCH_EDIT_FRAME::SaveCopyInUndoList(), SCH_COMPONENT_T, EDA_ITEM::SetFlags(), EDA_ITEM::SetTimeStamp(), SCH_EDIT_FRAME::TestDanglingEnds(), EDA_ITEM::Type(), and UR_NEW.

Referenced by setTransitions().

◆ Reset()

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

Function Reset() Brings the tool to a known, initial state.

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

Parameters
aReasoncontains information about the reason of tool reset.

Implements TOOL_BASE.

Definition at line 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_isLibEdit = dynamic_cast<LIB_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:83
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:35

◆ Rotate()

int SCH_EDIT_TOOL::Rotate ( const TOOL_EVENT aEvent)

Definition at line 463 of file sch_edit_tool.cpp.

464 {
466 
467  if( selection.GetSize() == 0 )
468  return 0;
469 
470  wxPoint rotPoint;
471  bool clockwise = ( aEvent.Matches( EE_ACTIONS::rotateCW.MakeEvent() ) );
472  SCH_ITEM* item = static_cast<SCH_ITEM*>( selection.Front() );
473  bool connections = false;
474  bool moving = item->IsMoving();
475 
476  if( selection.GetSize() == 1 )
477  {
478  if( !moving )
480 
481  switch( item->Type() )
482  {
483  case SCH_COMPONENT_T:
484  {
485  SCH_COMPONENT* component = static_cast<SCH_COMPONENT*>( item );
486 
487  if( clockwise )
488  component->SetOrientation( CMP_ROTATE_CLOCKWISE );
489  else
491 
492  if( m_frame->GetAutoplaceFields() )
493  component->AutoAutoplaceFields( m_frame->GetScreen() );
494 
495  break;
496  }
497 
498  case SCH_TEXT_T:
499  case SCH_LABEL_T:
500  case SCH_GLOBAL_LABEL_T:
501  case SCH_HIER_LABEL_T:
502  {
503  SCH_TEXT* textItem = static_cast<SCH_TEXT*>( item );
504  textItem->SetLabelSpinStyle( ( textItem->GetLabelSpinStyle() + 1 ) & 3 );
505  break;
506  }
507 
508  case SCH_BUS_BUS_ENTRY_T:
510  item->Rotate( item->GetPosition() );
511  break;
512 
513  case SCH_FIELD_T:
514  {
515  SCH_FIELD* field = static_cast<SCH_FIELD*>( item );
516 
517  if( field->GetTextAngle() == TEXT_ANGLE_HORIZ )
518  field->SetTextAngle( TEXT_ANGLE_VERT );
519  else
520  field->SetTextAngle( TEXT_ANGLE_HORIZ );
521 
522  // Now that we're moving a field, they're no longer autoplaced.
523  if( item->GetParent()->Type() == SCH_COMPONENT_T )
524  {
525  SCH_COMPONENT *parent = static_cast<SCH_COMPONENT*>( item->GetParent() );
526  parent->ClearFieldsAutoplaced();
527  }
528 
529  break;
530  }
531 
532  case SCH_BITMAP_T:
533  item->Rotate( item->GetPosition() );
534 
535  // The bitmap is cached in Opengl: clear the cache to redraw
537  break;
538 
539  case SCH_SHEET_T:
540  // Rotate the sheet on itself. Sheets do not have a anchor point.
541  rotPoint = m_frame->GetNearestGridPosition( item->GetBoundingBox().Centre() );
542 
543  for( int i = 0; clockwise ? i < 1 : i < 3; ++i )
544  item->Rotate( rotPoint );
545 
546  break;
547 
548  default:
549  break;
550  }
551 
552  connections = item->IsConnectable();
553  m_frame->RefreshItem( item );
554  }
555  else if( selection.GetSize() > 1 )
556  {
557  rotPoint = m_frame->GetNearestGridPosition( (wxPoint)selection.GetCenter() );
558 
559  for( unsigned ii = 0; ii < selection.GetSize(); ii++ )
560  {
561  item = static_cast<SCH_ITEM*>( selection.GetItem( ii ) );
562 
563  if( !moving )
564  saveCopyInUndoList( item, UR_CHANGED, ii > 0 );
565 
566  if( item->Type() == SCH_LINE_T )
567  {
568  SCH_LINE* line = (SCH_LINE*) item;
569 
570  if( item->GetFlags() & STARTPOINT )
571  line->RotateStart( rotPoint );
572 
573  if( item->GetFlags() & ENDPOINT )
574  line->RotateEnd( rotPoint );
575  }
576  else
577  {
578  item->Rotate( rotPoint );
579  }
580 
581  connections |= item->IsConnectable();
582  m_frame->RefreshItem( item );
583  }
584  }
585 
587 
588  if( !item->IsMoving() )
589  {
590  if( selection.IsHover() )
592 
593  if( connections )
595 
596  m_frame->OnModify();
597  }
598 
599  return 0;
600 }
void SetTextAngle(double aAngle)
Definition: eda_text.h:173
#define TEXT_ANGLE_HORIZ
Class SCH_FIELD instances are attached to a component and provide a place for the component's value,...
Definition: sch_field.h:52
void AutoAutoplaceFields(SCH_SCREEN *aScreen)
Autoplace fields only if correct to do so automatically.
virtual bool IsConnectable() const
Function IsConnectable returns true if the schematic item can connect to another schematic item.
Definition: sch_item.h:299
VECTOR2I GetCenter() const
Returns the center point of the selection area bounding box.
bool IsHover() const
Definition: selection.h:69
#define TEXT_ANGLE_VERT
void RotateEnd(wxPoint aPosition)
Definition: sch_line.cpp:361
virtual void SetLabelSpinStyle(int aSpinStyle)
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
Definition: sch_text.cpp:248
bool IsMoving() const
Definition: base_struct.h:224
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
void RecacheAllItems()
Function RecacheAllItems() Rebuilds GAL display lists.
Definition: view.cpp:1401
double GetTextAngle() const
Definition: eda_text.h:181
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
bool TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
bool GetAutoplaceFields() const
static const TOOL_EVENT SelectedItemsModified
Definition: actions.h:136
void RotateStart(wxPoint aPosition)
Definition: sch_line.cpp:355
static TOOL_ACTION rotateCW
Definition: ee_actions.h:120
void ClearFieldsAutoplaced()
Set fields automatically placed flag false.
virtual void Rotate(wxPoint aPosition)=0
Function Rotate rotates the item around aPosition 90 degrees in the clockwise direction.
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
int GetLabelSpinStyle() const
Definition: sch_text.h:119
virtual wxPoint GetPosition() const =0
Function GetPosition.
EDA_ITEM * GetParent() const
Definition: base_struct.h:214
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:143
bool Matches(const TOOL_EVENT &aEvent) const
Function Matches() Tests whether two events match in terms of category & action or command.
Definition: tool_event.h:338
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:57
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
Definition: selection.h:103
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:35
virtual unsigned int GetSize() const override
Function GetSize() Returns the number of stored items.
Definition: selection.h:98
static const KICAD_T RotatableItems[]
Definition: ee_collectors.h:43
wxPoint GetNearestGridPosition(const wxPoint &aPosition, wxRealPoint *aGridSize=NULL) const
Return the nearest aGridSize location to aPosition.
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:37
void RefreshItem(EDA_ITEM *aItem, bool isAddOrDelete=false)
Mark an item for refresh.
size_t i
Definition: json11.cpp:597
#define ENDPOINT
ends. (Used to support dragging.)
Definition: base_struct.h:120
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:73
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO_T aType, bool aAppend=false)
Similar to m_frame->SaveCopyInUndoList(), but handles items that are owned by their parents.
Definition: ee_tool_base.h:120
wxPoint Centre() const
Definition: eda_rect.h:60
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
virtual const EDA_RECT GetBoundingBox() const
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
STATUS_FLAGS GetFlags() const
Definition: base_struct.h:261
void PostEvent(const TOOL_EVENT &aEvent)
Puts an event to the event queue to be processed at the end of event processing cycle.
Definition: tool_manager.h:238
SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
Definition: sch_item.h:114
EDA_ITEM * Front() const
Definition: selection.h:155
KICAD_T Type() const
Function Type()
Definition: base_struct.h:204
#define STARTPOINT
When a line is selected, these flags indicate which.
Definition: base_struct.h:119
void SetOrientation(int aOrientation)
Compute the new transform matrix based on aOrientation for the symbol which is applied to the current...

References SCH_COMPONENT::AutoAutoplaceFields(), EDA_RECT::Centre(), SCH_COMPONENT::ClearFieldsAutoplaced(), EE_ACTIONS::clearSelection, CMP_ROTATE_CLOCKWISE, CMP_ROTATE_COUNTERCLOCKWISE, ENDPOINT, SELECTION::Front(), SCH_EDIT_FRAME::GetAutoplaceFields(), EDA_ITEM::GetBoundingBox(), SELECTION::GetCenter(), EDA_ITEM::GetFlags(), SELECTION::GetItem(), SCH_TEXT::GetLabelSpinStyle(), EDA_DRAW_FRAME::GetNearestGridPosition(), EDA_ITEM::GetParent(), SCH_ITEM::GetPosition(), SCH_EDIT_FRAME::GetScreen(), SELECTION::GetSize(), EDA_TEXT::GetTextAngle(), TOOL_BASE::getView(), i, SCH_ITEM::IsConnectable(), SELECTION::IsHover(), EDA_ITEM::IsMoving(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, TOOL_EVENT::Matches(), SCH_EDIT_FRAME::OnModify(), TOOL_MANAGER::PostEvent(), KIGFX::VIEW::RecacheAllItems(), SCH_BASE_FRAME::RefreshItem(), EE_SELECTION_TOOL::RequestSelection(), EE_COLLECTOR::RotatableItems, SCH_ITEM::Rotate(), EE_ACTIONS::rotateCW, SCH_LINE::RotateEnd(), SCH_LINE::RotateStart(), TOOL_MANAGER::RunAction(), EE_TOOL_BASE< SCH_EDIT_FRAME >::saveCopyInUndoList(), SCH_BITMAP_T, SCH_BUS_BUS_ENTRY_T, SCH_BUS_WIRE_ENTRY_T, SCH_COMPONENT_T, SCH_FIELD_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, SCH_LINE_T, SCH_SHEET_T, SCH_TEXT_T, EVENTS::SelectedItemsModified, SCH_TEXT::SetLabelSpinStyle(), SCH_COMPONENT::SetOrientation(), EDA_TEXT::SetTextAngle(), STARTPOINT, SCH_EDIT_FRAME::TestDanglingEnds(), TEXT_ANGLE_HORIZ, TEXT_ANGLE_VERT, EDA_ITEM::Type(), and UR_CHANGED.

Referenced by setTransitions().

◆ RunMainStack()

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

Function RunMainStack()

Calls a function using the main stack.

Parameters
aFuncis the function to be calls.

Definition at line 85 of file tool_interactive.cpp.

86 {
87  m_toolMgr->RunMainStack( this, std::move( aFunc ) );
88 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
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_T  aType,
bool  aAppend = false 
)
inlineprotectedinherited

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

Definition at line 120 of file ee_tool_base.h.

121  {
122  KICAD_T itemType = aItem->Type();
123 
124  if( m_isLibEdit )
125  {
126  LIB_EDIT_FRAME* editFrame = dynamic_cast<LIB_EDIT_FRAME*>( m_frame );
127  editFrame->SaveCopyInUndoList( (LIB_ITEM*) aItem, aType, aAppend );
128  }
129  else
130  {
131  SCH_EDIT_FRAME* editFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
132 
133  if( itemType == SCH_PIN_T || itemType == SCH_FIELD_T || itemType == SCH_SHEET_PIN_T )
134  editFrame->SaveCopyInUndoList( (SCH_ITEM*) aItem->GetParent(), UR_CHANGED, aAppend );
135  else
136  editFrame->SaveCopyInUndoList( (SCH_ITEM*) aItem, aType, aAppend );
137  }
138  }
Schematic editor (Eeschema) main window.
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
The base class for drawable items used by schematic library components.
Definition: lib_draw_item.h:67
void SaveCopyInUndoList(SCH_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, bool aAppend=false, 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: base_struct.h:214
The symbol library editor main window.
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
Definition: sch_item.h:114
void SaveCopyInUndoList(EDA_ITEM *ItemToCopy, UNDO_REDO_T undoType=UR_LIBEDIT, bool aAppend=false)
Create a copy of the current component, and save it in the undo list.
KICAD_T Type() const
Function Type()
Definition: base_struct.h:204

◆ SetContextMenu()

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

Function SetContextMenu()

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

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

Definition at line 74 of file tool_interactive.cpp.

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

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

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), LENGTH_TUNER_TOOL::mainLoop(), ROUTER_TOOL::mainLoop(), TOOL_MENU::ShowContextMenu(), and SCH_WIRE_BUS_TOOL::UnfoldBus().

◆ setTransitions()

void SCH_EDIT_TOOL::setTransitions ( )
overrideprivatevirtual

Sets up handlers for various events.

Implements TOOL_INTERACTIVE.

Definition at line 1289 of file sch_edit_tool.cpp.

1290 {
1295  Go( &SCH_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorX.MakeEvent() );
1296  Go( &SCH_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorY.MakeEvent() );
1299 
1306 
1313 
1316 
1318 }
static TOOL_ACTION properties
Definition: ee_actions.h:124
static TOOL_ACTION deleteItemCursor
Definition: ee_actions.h:167
static TOOL_ACTION breakBus
Definition: ee_actions.h:143
static TOOL_ACTION duplicate
Definition: ee_actions.h:118
static TOOL_ACTION toShapeBackslash
Definition: ee_actions.h:137
int Rotate(const TOOL_EVENT &aEvent)
static TOOL_ACTION mirrorY
Definition: ee_actions.h:123
int BreakWire(const TOOL_EVENT &aEvent)
static TOOL_ACTION toText
Definition: ee_actions.h:141
static TOOL_ACTION autoplaceFields
Definition: ee_actions.h:128
int Properties(const TOOL_EVENT &aEvent)
static TOOL_ACTION convertDeMorgan
Definition: ee_actions.h:129
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Function Go()
static TOOL_ACTION breakWire
Definition: ee_actions.h:142
static TOOL_ACTION rotateCW
Definition: ee_actions.h:120
int Duplicate(const TOOL_EVENT &aEvent)
static TOOL_ACTION cleanupSheetPins
Definition: ee_actions.h:163
static TOOL_ACTION rotateCCW
Definition: ee_actions.h:121
static TOOL_ACTION editFootprint
Definition: ee_actions.h:127
int ChangeShape(const TOOL_EVENT &aEvent)
int AutoplaceFields(const TOOL_EVENT &aEvent)
static TOOL_ACTION repeatDrawItem
Definition: ee_actions.h:119
static TOOL_ACTION mirrorX
Definition: ee_actions.h:122
static TOOL_ACTION doDelete
Definition: ee_actions.h:131
int CleanupSheetPins(const TOOL_EVENT &aEvent)
int DeleteItemCursor(const TOOL_EVENT &aEvent)
Runs the deletion tool.
int Mirror(const TOOL_EVENT &aEvent)
int RepeatDrawItem(const TOOL_EVENT &aEvent)
static TOOL_ACTION editValue
Definition: ee_actions.h:126
int EditField(const TOOL_EVENT &aEvent)
static TOOL_ACTION toLabel
Definition: ee_actions.h:138
static TOOL_ACTION toHLabel
Definition: ee_actions.h:139
static TOOL_ACTION editReference
Definition: ee_actions.h:125
int DoDelete(const TOOL_EVENT &aEvent)
Function DoDelete()
static TOOL_ACTION toGLabel
Definition: ee_actions.h:140
int ConvertDeMorgan(const TOOL_EVENT &aEvent)
int ChangeTextType(const TOOL_EVENT &aEvent)
static TOOL_ACTION toShapeSlash
Definition: ee_actions.h:136

References AutoplaceFields(), EE_ACTIONS::autoplaceFields, EE_ACTIONS::breakBus, BreakWire(), EE_ACTIONS::breakWire, ChangeShape(), ChangeTextType(), CleanupSheetPins(), EE_ACTIONS::cleanupSheetPins, ConvertDeMorgan(), EE_ACTIONS::convertDeMorgan, DeleteItemCursor(), EE_ACTIONS::deleteItemCursor, DoDelete(), EE_ACTIONS::doDelete, Duplicate(), EE_ACTIONS::duplicate, EditField(), EE_ACTIONS::editFootprint, EE_ACTIONS::editReference, EE_ACTIONS::editValue, TOOL_INTERACTIVE::Go(), Mirror(), EE_ACTIONS::mirrorX, EE_ACTIONS::mirrorY, Properties(), EE_ACTIONS::properties, RepeatDrawItem(), EE_ACTIONS::repeatDrawItem, Rotate(), EE_ACTIONS::rotateCCW, EE_ACTIONS::rotateCW, EE_ACTIONS::toGLabel, EE_ACTIONS::toHLabel, EE_ACTIONS::toLabel, EE_ACTIONS::toShapeBackslash, EE_ACTIONS::toShapeSlash, and EE_ACTIONS::toText.

◆ updateView()

void EE_TOOL_BASE< SCH_EDIT_FRAME >::updateView ( EDA_ITEM aItem) const
inlineprotectedinherited

Similar to getView()->Update(), but handles items that are redrawn by their parents.

Definition at line 107 of file ee_tool_base.h.

108  {
109  KICAD_T itemType = aItem->Type();
110 
111  if( itemType == SCH_PIN_T || itemType == SCH_FIELD_T || itemType == SCH_SHEET_PIN_T )
112  getView()->Update( aItem->GetParent() );
113 
114  getView()->Update( aItem );
115  }
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
EDA_ITEM * GetParent() const
Definition: base_struct.h:214
virtual void Update(VIEW_ITEM *aItem, int aUpdateFlags)
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1539
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:35
KICAD_T Type() const
Function Type()
Definition: base_struct.h:204

◆ Wait()

OPT_TOOL_EVENT TOOL_INTERACTIVE::Wait ( const TOOL_EVENT_LIST aEventList = TOOL_EVENTTC_ANYTA_ANY ))
inherited

Function Wait()

Suspends execution of the tool until an event specified in aEventList arrives. No parameters means waiting for any event.

Definition at line 55 of file tool_interactive.cpp.

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

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

Referenced by LIB_EDIT_TOOL::DeleteItemCursor(), DeleteItemCursor(), PCBNEW_CONTROL::DeleteItemCursor(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), SCH_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), SCH_DRAWING_TOOLS::doPlaceComponent(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), SCH_DRAWING_TOOLS::doSingleClickPlace(), LIB_DRAWING_TOOLS::doTwoClickPlace(), SCH_DRAWING_TOOLS::doTwoClickPlace(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), LIB_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::drawZone(), PCB_EDITOR_CONTROL::DrillOrigin(), MODULE_EDITOR_TOOLS::EnumeratePads(), PCBNEW_CONTROL::GridSetOrigin(), SCH_EDITOR_CONTROL::HighlightNetCursor(), PCB_EDITOR_CONTROL::HighlightNetCursor(), ROUTER_TOOL::InlineDrag(), ZOOM_TOOL::Main(), SCH_MOVE_TOOL::Main(), EE_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), EE_PICKER_TOOL::Main(), PICKER_TOOL::Main(), CVPCB_SELECTION_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), EDIT_TOOL::Main(), SELECTION_TOOL::Main(), LENGTH_TUNER_TOOL::mainLoop(), ROUTER_TOOL::mainLoop(), CVPCB_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), POINT_EDITOR::OnSelectionChange(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), EDIT_TOOL::pickCopyReferencePoint(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), EDIT_TOOL::Remove(), GERBVIEW_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), GERBVIEW_SELECTION_TOOL::selectPoint(), SELECTION_TOOL::selectPoint(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), ZOOM_TOOL::selectRegion(), DRAWING_TOOL::SetAnchor(), PCB_EDITOR_CONTROL::ShowLocalRatsnest(), and SCH_WIRE_BUS_TOOL::UnfoldBus().

Member Data Documentation

◆ m_frame

SCH_EDIT_FRAME * EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame
protectedinherited

Definition at line 141 of file ee_tool_base.h.

◆ m_isLibEdit

bool EE_TOOL_BASE< SCH_EDIT_FRAME >::m_isLibEdit
protectedinherited

Definition at line 144 of file ee_tool_base.h.

◆ m_menu

TOOL_MENU EE_TOOL_BASE< SCH_EDIT_FRAME >::m_menu
protectedinherited

Menu model displayed by the tool.

Definition at line 147 of file ee_tool_base.h.

◆ m_selectionTool

EE_SELECTION_TOOL* EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool
protectedinherited

Definition at line 143 of file ee_tool_base.h.

◆ m_toolId

TOOL_ID TOOL_BASE::m_toolId
protectedinherited

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

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

Referenced by TOOL_INTERACTIVE::Activate(), EE_SELECTION_TOOL::AddItemsToSel(), EE_SELECTION_TOOL::AddItemToSel(), SCH_DRAWING_TOOLS::AddJunction(), SCH_DRAWING_TOOLS::AddLabel(), TOOL_BASE::attachManager(), PCB_EDITOR_CONTROL::calculateSelectionRatsnest(), ROUTER_TOOL::CanInlineDrag(), SCH_EDITOR_CONTROL::ClearHighlight(), PCB_EDITOR_CONTROL::ClearHighlight(), GERBVIEW_SELECTION_TOOL::clearSelection(), EE_SELECTION_TOOL::clearSelection(), SELECTION_TOOL::clearSelection(), ConvertDeMorgan(), LIB_EDIT_TOOL::Copy(), PAD_TOOL::copyPadSettings(), MODULE_EDITOR_TOOLS::CreatePadFromShapes(), PCB_EDITOR_CONTROL::CrossProbePcbToSch(), PCB_EDITOR_CONTROL::CrossProbeSchToPcb(), COMMON_TOOLS::CursorControl(), ROUTER_TOOL::CustomTrackWidthDialog(), SCH_EDITOR_CONTROL::Cut(), LIB_EDIT_TOOL::DeleteItemCursor(), DeleteItemCursor(), PCBNEW_CONTROL::DeleteItemCursor(), SCH_EDITOR_CONTROL::doCopy(), SCH_EDITOR_CONTROL::doCrossProbeSchToPcb(), LIB_EDIT_TOOL::DoDelete(), DoDelete(), SCH_WIRE_BUS_TOOL::doDrawSegments(), SCH_DRAWING_TOOLS::doPlaceComponent(), SCH_DRAWING_TOOLS::doSingleClickPlace(), LIB_DRAWING_TOOLS::doTwoClickPlace(), SCH_DRAWING_TOOLS::doTwoClickPlace(), DRAWING_TOOL::drawArc(), SCH_WIRE_BUS_TOOL::DrawBusses(), DRAWING_TOOL::DrawDimension(), SCH_WIRE_BUS_TOOL::DrawLines(), DRAWING_TOOL::drawSegment(), LIB_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_WIRE_BUS_TOOL::DrawWires(), DRAWING_TOOL::drawZone(), PCB_EDITOR_CONTROL::DrillOrigin(), LIB_EDIT_TOOL::Duplicate(), Duplicate(), EDIT_TOOL::Duplicate(), EDIT_TOOL::editFootprintInFpEditor(), LIB_EDIT_TOOL::editSymbolProperties(), SCH_EDITOR_CONTROL::EditWithSymbolEditor(), SCH_EDITOR_CONTROL::EnterSheet(), MODULE_EDITOR_TOOLS::EnumeratePads(), EDIT_TOOL::ExchangeFootprints(), SELECTION_TOOL::expandConnection(), MODULE_EDITOR_TOOLS::ExplodePadToShapes(), SELECTION_TOOL::findCallback(), SELECTION_TOOL::findMove(), SCH_WIRE_BUS_TOOL::finishSegments(), EDIT_TOOL::Flip(), TOOL_BASE::getEditFrameInt(), TOOL_BASE::GetManager(), TOOL_BASE::getModelInt(), DRAWING_TOOL::getSourceZoneForAction(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), TOOL_INTERACTIVE::goInternal(), PCBNEW_CONTROL::GridSetOrigin(), GERBVIEW_CONTROL::HighlightControl(), SCH_EDITOR_CONTROL::HighlightNet(), PCB_EDITOR_CONTROL::HighlightNet(), SCH_EDITOR_CONTROL::HighlightNetCursor(), PCB_EDITOR_CONTROL::HighlightNetCursor(), LIB_EDIT_TOOL::Init(), Init(), PAD_TOOL::Init(), ALIGN_DISTRIBUTE_TOOL::Init(), PCB_EDITOR_CONTROL::Init(), POINT_EDITOR::Init(), POSITION_RELATIVE_TOOL::Init(), EDIT_TOOL::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), EDIT_TOOL::invokeInlineRouter(), EDIT_TOOL::isInteractiveDragEnabled(), TOOL_BASE::IsToolActive(), ZOOM_TOOL::Main(), SCH_MOVE_TOOL::Main(), EE_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), EE_PICKER_TOOL::Main(), PICKER_TOOL::Main(), EDIT_TOOL::Main(), EE_SELECTION_TOOL::Main(), SELECTION_TOOL::Main(), LENGTH_TUNER_TOOL::mainLoop(), ROUTER_TOOL::mainLoop(), LIB_EDIT_TOOL::Mirror(), Mirror(), EDIT_TOOL::Mirror(), PCB_EDITOR_CONTROL::modifyLockSelected(), EDIT_TOOL::MoveExact(), POINT_EDITOR::OnSelectionChange(), LIB_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), PAD_TOOL::pastePadProperties(), EDIT_TOOL::pickCopyReferencePoint(), LIB_EDIT_TOOL::PinTable(), PCBNEW_CONTROL::placeBoardItems(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), LIB_EDIT_TOOL::Properties(), Properties(), EDIT_TOOL::Properties(), PAD_TOOL::pushPadSettings(), SCH_EDITOR_CONTROL::Redo(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), EDIT_TOOL::Remove(), POINT_EDITOR::removeCorner(), EE_SELECTION_TOOL::RemoveItemFromSel(), EE_SELECTION_TOOL::RemoveItemsFromSel(), RepeatDrawItem(), LIB_DRAWING_TOOLS::RepeatDrawItem(), SELECTION_TOOL::RequestSelection(), CVPCB_CONTROL::ResetCoords(), PCBNEW_CONTROL::ResetCoords(), TOOL_INTERACTIVE::resetTransitions(), LIB_EDIT_TOOL::Rotate(), Rotate(), EDIT_TOOL::Rotate(), TOOL_INTERACTIVE::RunMainStack(), EE_SELECTION_TOOL::SelectConnection(), SELECTION_TOOL::selectCopper(), PCB_TOOL_BASE::selection(), GERBVIEW_SELECTION_TOOL::SelectItem(), SELECTION_TOOL::SelectItem(), GERBVIEW_SELECTION_TOOL::SelectItems(), SELECTION_TOOL::SelectItems(), GERBVIEW_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectNet(), EE_SELECTION_TOOL::SelectPoint(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), SELECTION_TOOL::selectSameSheet(), SELECTION_TOOL::selectSheetContents(), TOOL_INTERACTIVE::SetContextMenu(), PCB_EDITOR_CONTROL::ShowLocalRatsnest(), SCH_WIRE_BUS_TOOL::StartBus(), SCH_WIRE_BUS_TOOL::StartLine(), SCH_WIRE_BUS_TOOL::StartWire(), GERBVIEW_SELECTION_TOOL::toggleSelection(), EE_SELECTION_TOOL::toggleSelection(), SELECTION_TOOL::toggleSelection(), PCB_EDITOR_CONTROL::TrackWidthDec(), PCB_EDITOR_CONTROL::TrackWidthInc(), SCH_EDITOR_CONTROL::Undo(), SCH_WIRE_BUS_TOOL::UnfoldBus(), GERBVIEW_SELECTION_TOOL::UnselectItem(), SELECTION_TOOL::UnselectItem(), GERBVIEW_SELECTION_TOOL::UnselectItems(), SELECTION_TOOL::UnselectItems(), EE_INSPECTION_TOOL::UpdateMessagePanel(), PCB_EDITOR_CONTROL::UpdateSelectionRatsnest(), PCB_EDITOR_CONTROL::ViaSizeDec(), PCB_EDITOR_CONTROL::ViaSizeInc(), TOOL_INTERACTIVE::Wait(), PCB_EDITOR_CONTROL::ZoneDuplicate(), and PCB_EDITOR_CONTROL::ZoneMerge().

◆ m_toolName

std::string TOOL_BASE::m_toolName
protectedinherited

Name of the tool.

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

Definition at line 215 of file tool_base.h.

Referenced by TOOL_BASE::GetName().

◆ m_toolSettings

TOOL_SETTINGS TOOL_BASE::m_toolSettings
protectedinherited

Definition at line 217 of file tool_base.h.

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

◆ m_type

TOOL_TYPE TOOL_BASE::m_type
protectedinherited

Stores the type of the tool.

Definition at line 208 of file tool_base.h.

Referenced by TOOL_BASE::GetType().

◆ m_view

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

Definition at line 142 of file ee_tool_base.h.


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