KiCad PCB EDA Suite
EE_POINT_EDITOR Class Reference

EE_POINT_EDITOR. More...

#include <ee_point_editor.h>

Inheritance diagram for EE_POINT_EDITOR:
EE_TOOL_BASE< SCH_BASE_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

 EE_POINT_EDITOR ()
 
void Reset (RESET_REASON aReason) override
 Function Reset() Brings the tool to a known, initial state. More...
 
bool Init () override
 Function Init() Init() is called once upon a registration of the tool. More...
 
int Main (const TOOL_EVENT &aEvent)
 
bool HasPoint ()
 Indicates the cursor is over an edit point. More...
 
void setTransitions () override
 

Sets up handlers for various events.

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

Protected 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 aType, bool aAppend=false)
 

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

More...
 
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_BASE_FRAMEm_frame
 
KIGFX::SCH_VIEWm_view
 
EE_SELECTION_TOOLm_selectionTool
 
bool m_isLibEdit
 
TOOL_MENU m_menu
 functions below are not yet implemented - their interface may change More...
 
TOOL_TYPE m_type
 

Stores the type of the tool.

More...
 
TOOL_ID m_toolId
 

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

More...
 
std::string m_toolName
 

Name of the tool.

More...
 
TOOL_MANAGERm_toolMgr
 

Private Member Functions

void updateItem () const
 

Updates item's points with edit points.

More...
 
void updatePoints ()
 

Updates edit points with item's points.

More...
 
void updateEditedPoint (const TOOL_EVENT &aEvent)
 

Updates which point is being edited.

More...
 
void setEditedPoint (EDIT_POINT *aPoint)
 

Sets the current point being edited. NULL means none.

More...
 
bool isModified (const EDIT_POINT &aPoint) const
 

Returns true if aPoint is the currently modified point.

More...
 
int getEditedPointIndex () const
 
bool addCornerCondition (const SELECTION &aSelection)
 
bool removeCornerCondition (const SELECTION &aSelection)
 
int addCorner (const TOOL_EVENT &aEvent)
 TOOL_ACTION handlers. More...
 
int removeCorner (const TOOL_EVENT &aEvent)
 
int modifiedSelection (const TOOL_EVENT &aEvent)
 
void saveItemsToUndo ()
 
void rollbackFromUndo ()
 

Private Attributes

EDIT_POINTm_editedPoint
 

Currently edited point, NULL if there is none.

More...
 
std::shared_ptr< EDIT_POINTSm_editPoints
 

Currently available edit points.

More...
 

Detailed Description

EE_POINT_EDITOR.

Tool that displays edit points allowing to modify items by dragging the points.

Definition at line 40 of file ee_point_editor.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 79 of file tool_base.h.

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

Constructor & Destructor Documentation

◆ EE_POINT_EDITOR()

EE_POINT_EDITOR::EE_POINT_EDITOR ( )

Definition at line 207 of file ee_point_editor.cpp.

207  :
208  EE_TOOL_BASE<SCH_BASE_FRAME>( "eeschema.PointEditor" ),
209  m_editedPoint( nullptr )
210 {
211 }
EDIT_POINT * m_editedPoint
Currently edited point, NULL if there is none.

Member Function Documentation

◆ Activate()

void TOOL_INTERACTIVE::Activate ( )
inherited

Function Activate() Runs the tool.

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

Definition at line 51 of file tool_interactive.cpp.

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

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

Referenced by AUTOPLACE_TOOL::autoplace(), EDIT_TOOL::copyToClipboard(), LIB_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCBNEW_CONTROL::DeleteItemCursor(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::DrawRectangle(), LIB_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PCB_EDITOR_CONTROL::DrillOrigin(), PAD_TOOL::EnumeratePads(), PCBNEW_CONTROL::GridSetOrigin(), SCH_EDITOR_CONTROL::HighlightNetCursor(), PCB_INSPECTION_TOOL::HighlightNetTool(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), PCB_INSPECTION_TOOL::LocalRatsnestTool(), PL_EDIT_TOOL::Main(), Main(), PL_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), PCBNEW_PICKER_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), LIB_TREE::onContextMenu(), POINT_EDITOR::OnSelectionChange(), GROUP_TOOL::PickNewMember(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), EDIT_TOOL::Remove(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), DRAWING_TOOL::SetAnchor(), DRC_TOOL::ShowDRCDialog(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ addCorner()

int EE_POINT_EDITOR::addCorner ( const TOOL_EVENT aEvent)
private

TOOL_ACTION handlers.

Definition at line 821 of file ee_point_editor.cpp.

822 {
823  if( !m_editPoints )
824  return 0;
825 
826  LIB_POLYLINE* polyLine = dynamic_cast<LIB_POLYLINE*>( m_editPoints->GetParent() );
827 
828  if( !polyLine )
829  return false;
830 
831  VECTOR2I cursorPos = getViewControls()->GetCursorPosition( !aEvent.Modifier( MD_ALT ) );
832  polyLine->AddCorner( mapCoords( cursorPos ) );
833 
834  updateView( polyLine );
835  updatePoints();
836 
837  return 0;
838 }
void AddCorner(const wxPoint &aPosition)
void updatePoints()
Updates edit points with item's points.
static VECTOR2D mapCoords(const wxPoint &aCoord)
int Modifier(int aMask=MD_MODIFIER_MASK) const
Returns information about key modifiers state (Ctrl, Alt, etc.)
Definition: tool_event.h:342
void updateView(EDA_ITEM *aItem) const
Similar to getView()->Update(), but handles items that are redrawn by their parents.
Definition: ee_tool_base.h:104
std::shared_ptr< EDIT_POINTS > m_editPoints
Currently available edit points.
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:42
VECTOR2D GetCursorPosition() const
Returns the current cursor position in world coordinates.

References LIB_POLYLINE::AddCorner(), KIGFX::VIEW_CONTROLS::GetCursorPosition(), TOOL_BASE::getViewControls(), m_editPoints, KIGFX::mapCoords(), MD_ALT, TOOL_EVENT::Modifier(), updatePoints(), and EE_TOOL_BASE< SCH_BASE_FRAME >::updateView().

Referenced by setTransitions().

◆ addCornerCondition()

bool EE_POINT_EDITOR::addCornerCondition ( const SELECTION aSelection)
private

Definition at line 804 of file ee_point_editor.cpp.

805 {
806  if( !m_editPoints || !m_editedPoint )
807  return false;
808 
809  LIB_POLYLINE* polyLine = dynamic_cast<LIB_POLYLINE*>( m_editPoints->GetParent() );
810 
811  if( !polyLine )
812  return false;
813 
814  VECTOR2I cursorPos = getViewControls()->GetCursorPosition();
815  double threshold = getView()->ToWorld( EDIT_POINT::POINT_SIZE );
816 
817  return polyLine->HitTest( mapCoords( cursorPos ), (int) threshold );
818 }
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Function ToWorld() Converts a screen space point/vector to a point/vector in world space coordinates.
Definition: view.cpp:456
EDIT_POINT * m_editedPoint
Currently edited point, NULL if there is none.
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Function HitTest tests if aPosition is contained within or on the bounding box of an item.
static VECTOR2D mapCoords(const wxPoint &aCoord)
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
std::shared_ptr< EDIT_POINTS > m_editPoints
Currently available edit points.
static const int POINT_SIZE
Single point size in pixels
Definition: edit_points.h:197
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:42
VECTOR2D GetCursorPosition() const
Returns the current cursor position in world coordinates.

References KIGFX::VIEW_CONTROLS::GetCursorPosition(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), LIB_POLYLINE::HitTest(), m_editedPoint, m_editPoints, KIGFX::mapCoords(), EDIT_POINT::POINT_SIZE, and KIGFX::VIEW::ToWorld().

Referenced by Init().

◆ attachManager()

void TOOL_BASE::attachManager ( TOOL_MANAGER aManager)
protectedinherited

Function attachManager()

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

Definition at line 60 of file tool_base.cpp.

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

References TOOL_BASE::m_toolMgr.

Referenced by TOOL_MANAGER::RegisterTool().

◆ getEditedPointIndex()

int EE_POINT_EDITOR::getEditedPointIndex ( ) const
inlineprivate

Definition at line 81 of file ee_point_editor.h.

82  {
83  for( unsigned i = 0; i < m_editPoints->PointsSize(); ++i )
84  {
85  if( m_editedPoint == &m_editPoints->Point( i ) )
86  return i;
87  }
88 
89  return wxNOT_FOUND;
90  }
EDIT_POINT * m_editedPoint
Currently edited point, NULL if there is none.
std::shared_ptr< EDIT_POINTS > m_editPoints
Currently available edit points.

References m_editedPoint, and m_editPoints.

Referenced by Main(), removeCorner(), and updateItem().

◆ getEditFrame()

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

Function getEditFrame()

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

Definition at line 187 of file tool_base.h.

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

References TOOL_BASE::getToolHolderInt().

Referenced by ZONE_CREATE_HELPER::createNewZone().

◆ GetId()

TOOL_ID TOOL_BASE::GetId ( ) const
inlineinherited

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

The identifier is set by an instance of TOOL_MANAGER.

Returns
Identifier of the tool.

Definition at line 121 of file tool_base.h.

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

References TOOL_BASE::m_toolId.

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

◆ GetManager()

TOOL_MANAGER* TOOL_BASE::GetManager ( ) const
inlineinherited

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

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

Definition at line 143 of file tool_base.h.

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

References TOOL_BASE::m_toolMgr.

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

◆ getModel()

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

Function getModel()

Returns the model object if it matches the requested type.

Definition at line 201 of file tool_base.h.

202  {
203  EDA_ITEM* m = getModelInt();
204 #if !defined( QA_TEST ) // Dynamic casts give the linker a siezure in the test framework
205  wxASSERT( dynamic_cast<T*>( m ) );
206 #endif
207  return static_cast<T*>( m );
208  }
EDA_ITEM * getModelInt() const
Definition: tool_base.cpp:54
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: eda_item.h:148

References TOOL_BASE::getModelInt().

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

◆ GetName()

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

Function GetName() Returns the name of the tool.

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

Returns
The name of the tool.

Definition at line 132 of file tool_base.h.

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

References TOOL_BASE::m_toolName.

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

◆ GetToolMenu()

◆ GetType()

TOOL_TYPE TOOL_BASE::GetType ( ) const
inlineinherited

Function GetType() Returns the type of the tool.

Returns
The type of the tool.

Definition at line 110 of file tool_base.h.

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

References TOOL_BASE::m_type.

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

◆ getView()

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

Function getView()

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

Returns
The instance of VIEW.

Definition at line 36 of file tool_base.cpp.

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

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

Referenced by addCornerCondition(), ALIGN_DISTRIBUTE_TOOL::AlignLeft(), ALIGN_DISTRIBUTE_TOOL::AlignRight(), COMMON_TOOLS::CenterContents(), SCH_EDIT_TOOL::ChangeTextType(), EE_INSPECTION_TOOL::checkPart(), PL_SELECTION_TOOL::ClearSelection(), EE_SELECTION_TOOL::ClearSelection(), EE_SELECTION_TOOL::collectHits(), SCH_LINE_WIRE_BUS_TOOL::computeBreakPoint(), COMMON_TOOLS::CursorControl(), LIB_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCBNEW_CONTROL::DeleteItemCursor(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), PL_EDIT_TOOL::DoDelete(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), COMMON_TOOLS::doZoomFit(), COMMON_TOOLS::doZoomInOut(), COMMON_TOOLS::doZoomToPreset(), MICROWAVE_TOOL::drawMicrowaveInductor(), PL_DRAWING_TOOLS::DrawShape(), PCB_EDITOR_CONTROL::DrillOrigin(), LIB_EDIT_TOOL::Duplicate(), PAD_TOOL::EnumeratePads(), SCH_EDITOR_CONTROL::FindComponentAndItem(), EE_SELECTION_TOOL::GetNode(), ROUTER_TOOL::getStartLayer(), PCBNEW_CONTROL::GridResetOrigin(), PCBNEW_CONTROL::GridSetOrigin(), SELECTION_TOOL::GuessSelectionCandidates(), PL_SELECTION_TOOL::highlight(), EE_SELECTION_TOOL::highlight(), SELECTION_TOOL::highlight(), GERBVIEW_CONTROL::HighlightControl(), PNS::TOOL_BASE::highlightNet(), PCB_INSPECTION_TOOL::highlightNet(), Main(), PL_POINT_EDITOR::Main(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_MOVE_TOOL::moveItem(), PL_EDIT_TOOL::moveItem(), COMMON_TOOLS::OnGridChanged(), POINT_EDITOR::OnSelectionChange(), COMMON_TOOLS::PanControl(), LIB_EDIT_TOOL::Paste(), PL_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), PNS::TOOL_BASE::pickSingleItem(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), EDIT_TOOL::Remove(), PCB_EDITOR_CONTROL::Reset(), PNS::TOOL_BASE::Reset(), PCBNEW_CONTROL::Reset(), GERBVIEW_SELECTION_TOOL::Reset(), DRAWING_TOOL::Reset(), EE_SELECTION_TOOL::Reset(), SELECTION_TOOL::Reset(), EE_TOOL_BASE< SCH_BASE_FRAME >::Reset(), SCH_EDIT_TOOL::Rotate(), GERBVIEW_SELECTION_TOOL::select(), GERBVIEW_SELECTION_TOOL::selectable(), SELECTION_TOOL::Selectable(), SELECTION_TOOL::SelectAll(), EE_SELECTION_TOOL::SelectAll(), PL_SELECTION_TOOL::selectionContains(), EE_SELECTION_TOOL::selectionContains(), SELECTION_TOOL::selectionContains(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), PL_SELECTION_TOOL::SelectPoint(), ZOOM_TOOL::selectRegion(), GERBVIEW_SELECTION_TOOL::selectVisually(), SCH_EDITOR_CONTROL::ToggleHiddenFields(), SCH_EDITOR_CONTROL::ToggleHiddenPins(), PL_SELECTION_TOOL::unhighlight(), EE_SELECTION_TOOL::unhighlight(), SELECTION_TOOL::unhighlight(), GERBVIEW_SELECTION_TOOL::unselect(), GERBVIEW_SELECTION_TOOL::unselectVisually(), updateEditedPoint(), PL_POINT_EDITOR::updateEditedPoint(), POINT_EDITOR::updateEditedPoint(), SCH_EDITOR_CONTROL::UpdateFind(), updateItem(), PL_POINT_EDITOR::updateItem(), POINT_EDITOR::updateItem(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), updatePoints(), PL_POINT_EDITOR::updatePoints(), POINT_EDITOR::updatePoints(), SELECTION_TOOL::updateSelection(), PNS::TOOL_BASE::updateStartItem(), EE_TOOL_BASE< SCH_BASE_FRAME >::updateView(), PCB_VIEWER_TOOLS::view(), PCB_TOOL_BASE::view(), SELECTION_TOOL::zoomFitSelection(), EE_SELECTION_TOOL::~EE_SELECTION_TOOL(), GERBVIEW_SELECTION_TOOL::~GERBVIEW_SELECTION_TOOL(), and SELECTION_TOOL::~SELECTION_TOOL().

◆ getViewControls()

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

Function getViewControls()

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

Returns
The instance of VIEW_CONTROLS.

Definition at line 42 of file tool_base.cpp.

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

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

Referenced by addCorner(), POINT_EDITOR::addCorner(), addCornerCondition(), SCH_EDITOR_CONTROL::AssignNetclass(), SCH_EDIT_TOOL::BreakWire(), PCB_TOOL_BASE::controls(), EDIT_TOOL::copyToClipboard(), COMMON_TOOLS::CursorControl(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), EDIT_TOOL::doMoveSelection(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), COMMON_TOOLS::doZoomToPreset(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::DrawRectangle(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), LIB_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), LIB_EDIT_TOOL::Duplicate(), PAD_TOOL::EnumeratePads(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), PCB_INSPECTION_TOOL::HighlightNet(), SCH_EDITOR_CONTROL::HighlightNet(), PCB_INSPECTION_TOOL::HighlightNetTool(), FOOTPRINT_EDITOR_TOOLS::ImportFootprint(), PL_EDIT_TOOL::Main(), Main(), LIB_MOVE_TOOL::Main(), PL_POINT_EDITOR::Main(), SCH_MOVE_TOOL::Main(), PCBNEW_PICKER_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), COMMON_TOOLS::OnGridChanged(), POINT_EDITOR::OnSelectionChange(), LIB_EDIT_TOOL::Paste(), ROUTER_TOOL::performDragging(), LENGTH_TUNER_TOOL::performTuning(), LIB_DRAWING_TOOLS::PlaceAnchor(), PCBNEW_CONTROL::placeBoardItems(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), EDIT_TOOL::Remove(), SCH_EDIT_TOOL::RepeatDrawItem(), PL_SELECTION_TOOL::RequestSelection(), EE_SELECTION_TOOL::RequestSelection(), POINT_EDITOR::Reset(), DRAWING_TOOL::Reset(), COMMON_TOOLS::ResetLocalCoords(), GERBVIEW_SELECTION_TOOL::selectCursor(), SELECTION_TOOL::selectCursor(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::SelectNode(), ZOOM_TOOL::selectRegion(), ALIGN_DISTRIBUTE_TOOL::selectTarget(), PICKER_TOOL::setControls(), PCBNEW_PICKER_TOOL::setControls(), setEditedPoint(), PL_POINT_EDITOR::setEditedPoint(), POINT_EDITOR::setEditedPoint(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), updateEditedPoint(), PL_POINT_EDITOR::updateEditedPoint(), POINT_EDITOR::updateEditedPoint(), POINT_EDITOR::updateItem(), LIB_MOVE_TOOL::updateModificationPoint(), PL_EDIT_TOOL::updateModificationPoint(), EDIT_TOOL::updateModificationPoint(), and COMMON_TOOLS::ZoomCenter().

◆ Go()

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

Function Go()

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

Definition at line 129 of file tool_interactive.h.

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

References TOOL_INTERACTIVE::goInternal().

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

◆ HasPoint()

bool EE_POINT_EDITOR::HasPoint ( )
inline

Indicates the cursor is over an edit point.

Used to coordinate cursor shapes with other tools.

Definition at line 57 of file ee_point_editor.h.

57 { return m_editedPoint != nullptr; }
EDIT_POINT * m_editedPoint
Currently edited point, NULL if there is none.

References m_editedPoint.

◆ Init()

bool EE_POINT_EDITOR::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 222 of file ee_point_editor.cpp.

223 {
225 
226  auto& menu = m_selectionTool->GetToolMenu().GetMenu();
228  std::bind( &EE_POINT_EDITOR::addCornerCondition, this, _1 ) );
230  std::bind( &EE_POINT_EDITOR::removeCornerCondition, this, _1 ) );
231 
232  return true;
233 }
static TOOL_ACTION pointEditorAddCorner
Definition: ee_actions.h:136
CONDITIONAL_MENU & GetMenu()
Function GetMenu.
Definition: tool_menu.cpp:46
TOOL_MENU & GetToolMenu()
bool Init() override
Function Init() Init() is called once upon a registration of the tool.
Definition: ee_tool_base.h:69
bool addCornerCondition(const SELECTION &aSelection)
static TOOL_ACTION pointEditorRemoveCorner
Definition: ee_actions.h:137
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:160
bool removeCornerCondition(const SELECTION &aSelection)
void AddItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Adds a menu entry to run a TOOL_ACTION on selected items.

References addCornerCondition(), CONDITIONAL_MENU::AddItem(), TOOL_MENU::GetMenu(), TOOL_INTERACTIVE::GetToolMenu(), EE_TOOL_BASE< T >::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::m_selectionTool, EE_ACTIONS::pointEditorAddCorner, EE_ACTIONS::pointEditorRemoveCorner, and removeCornerCondition().

◆ isModified()

bool EE_POINT_EDITOR::isModified ( const EDIT_POINT aPoint) const
inlineprivate

Returns true if aPoint is the currently modified point.

Definition at line 76 of file ee_point_editor.h.

77  {
78  return m_editedPoint == &aPoint;
79  }
EDIT_POINT * m_editedPoint
Currently edited point, NULL if there is none.

References m_editedPoint.

◆ IsToolActive()

bool TOOL_BASE::IsToolActive ( ) const
inherited

Definition at line 31 of file tool_base.cpp.

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

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

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

◆ Main()

int EE_POINT_EDITOR::Main ( const TOOL_EVENT aEvent)

Definition at line 258 of file ee_point_editor.cpp.

259 {
260  static KICAD_T supportedTypes[] = {
261  LIB_ARC_T,
262  LIB_CIRCLE_T,
265  SCH_SHEET_T,
267  SCH_BITMAP_T,
268  EOT
269  };
270 
271  if( !m_selectionTool )
272  return 0;
273 
274  const EE_SELECTION& selection = m_selectionTool->GetSelection();
275 
276  if( selection.Size() != 1 || !selection.Front()->IsType( supportedTypes ) )
277  return 0;
278 
279  // Wait till drawing tool is done
280  if( selection.Front()->IsNew() )
281  return 0;
282 
283  Activate();
284 
286  KIGFX::VIEW* view = getView();
287  EDA_ITEM* item = (EDA_ITEM*) selection.Front();
288 
289  controls->ShowCursor( true );
290 
292  view->Add( m_editPoints.get() );
293  setEditedPoint( nullptr );
294  updateEditedPoint( aEvent );
295  bool inDrag = false;
296  bool modified = false;
297 
298  // Main loop: keep receiving events
299  while( TOOL_EVENT* evt = Wait() )
300  {
301  if( !m_editPoints || evt->IsSelectionEvent() )
302  break;
303 
304  if ( !inDrag )
305  updateEditedPoint( *evt );
306 
307  if( evt->IsDrag( BUT_LEFT ) && m_editedPoint )
308  {
309  if( !inDrag )
310  {
311  saveItemsToUndo();
312  controls->ForceCursorPosition( false );
313  inDrag = true;
314  modified = true;
315  }
316 
317  bool snap = !evt->Modifier( MD_ALT );
318 
319  if( item->Type() == LIB_ARC_T && getEditedPointIndex() == ARC_CENTER )
320  snap = false;
321 
322  m_editedPoint->SetPosition( controls->GetCursorPosition( snap ) );
323 
324  updateItem();
325  updatePoints();
326  }
327 
328  else if( inDrag && evt->IsMouseUp( BUT_LEFT ) )
329  {
330  controls->SetAutoPan( false );
331  inDrag = false;
332  }
333 
334  else if( evt->IsCancelInteractive() || evt->IsActivate() )
335  {
336  if( inDrag ) // Restore the last change
337  {
339  inDrag = false;
340  modified = false;
341  break;
342  }
343  else if( evt->IsCancelInteractive() )
344  break;
345 
346  if( evt->IsActivate() && !evt->IsMoveTool() )
347  break;
348  }
349 
350  else
351  evt->SetPassEvent();
352 
353  controls->SetAutoPan( inDrag );
354  controls->CaptureCursor( inDrag );
355  }
356 
357  controls->SetAutoPan( false );
358  controls->CaptureCursor( false );
359 
360  if( m_editPoints )
361  {
362  view->Remove( m_editPoints.get() );
363 
364  if( modified )
365  m_frame->OnModify();
366 
367  m_editPoints.reset();
368  m_frame->GetCanvas()->Refresh();
369  }
370 
371  return 0;
372 }
virtual void ShowCursor(bool aEnabled)
Function ShowCursor() Enables or disables display of cursor.
TOOL_EVENT * Wait(const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
Function Wait()
void updateEditedPoint(const TOOL_EVENT &aEvent)
Updates which point is being edited.
virtual void Remove(VIEW_ITEM *aItem)
Function Remove() Removes a VIEW_ITEM from the view.
Definition: view.cpp:357
EDIT_POINT * m_editedPoint
Currently edited point, NULL if there is none.
void updatePoints()
Updates edit points with item's points.
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: eda_item.h:188
EE_SELECTION & GetSelection()
Function GetSelection()
virtual void OnModify()
Must be called after a model change in order to set the "modify" flag and do other frame-specific pro...
virtual void CaptureCursor(bool aEnabled)
Function CaptureCursor() Forces the cursor to stay within the drawing panel area.
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
TOOL_EVENT.
Definition: tool_event.h:171
VIEW_CONTROLS is an interface for classes handling user events controlling the view behaviour (such a...
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:160
virtual void ForceCursorPosition(bool aEnabled, const VECTOR2D &aPosition=VECTOR2D(0, 0))
Function ForceCursorPosition() Places the cursor immediately at a given point.
virtual bool IsType(const KICAD_T aScanTypes[]) const
Function IsType Checks whether the item is one of the listed types.
Definition: eda_item.h:251
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
virtual void SetAutoPan(bool aEnabled)
Function SetAutoPan Turns on/off auto panning (this feature is used when there is a tool active (eg.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
void updateItem() const
Updates item's points with edit points.
std::shared_ptr< EDIT_POINTS > m_editPoints
Currently available edit points.
int getEditedPointIndex() const
int Size() const
Returns the number of selected parts.
Definition: selection.h:127
void setEditedPoint(EDIT_POINT *aPoint)
Sets the current point being edited. NULL means none.
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: eda_item.h:148
void Activate()
Function Activate() Runs the tool.
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Function Add() Adds a VIEW_ITEM to the view.
Definition: view.cpp:327
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:42
VIEW.
Definition: view.h:63
static std::shared_ptr< EDIT_POINTS > Make(EDA_ITEM *aItem, SCH_BASE_FRAME *frame)
VECTOR2D GetCursorPosition() const
Returns the current cursor position in world coordinates.
EDA_ITEM * Front() const
Definition: selection.h:184
KICAD_T Type() const
Function Type()
Definition: eda_item.h:182
virtual void SetPosition(const VECTOR2I &aPosition)
Function SetPosition()
Definition: edit_points.h:108

References TOOL_INTERACTIVE::Activate(), KIGFX::VIEW::Add(), ARC_CENTER, BUT_LEFT, KIGFX::VIEW_CONTROLS::CaptureCursor(), EOT, KIGFX::VIEW_CONTROLS::ForceCursorPosition(), SELECTION::Front(), SCH_BASE_FRAME::GetCanvas(), KIGFX::VIEW_CONTROLS::GetCursorPosition(), getEditedPointIndex(), EE_SELECTION_TOOL::GetSelection(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), EDA_ITEM::IsNew(), EDA_ITEM::IsType(), LIB_ARC_T, LIB_CIRCLE_T, LIB_POLYLINE_T, LIB_RECTANGLE_T, m_editedPoint, m_editPoints, EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame, EE_TOOL_BASE< SCH_BASE_FRAME >::m_selectionTool, EDIT_POINTS_FACTORY::Make(), MD_ALT, SCH_BASE_FRAME::OnModify(), EDA_DRAW_PANEL_GAL::Refresh(), KIGFX::VIEW::Remove(), rollbackFromUndo(), saveItemsToUndo(), SCH_BITMAP_T, SCH_LINE_LOCATE_GRAPHIC_LINE_T, SCH_SHEET_T, KIGFX::VIEW_CONTROLS::SetAutoPan(), setEditedPoint(), EDIT_POINT::SetPosition(), KIGFX::VIEW_CONTROLS::ShowCursor(), SELECTION::Size(), EDA_ITEM::Type(), updateEditedPoint(), updateItem(), updatePoints(), and TOOL_INTERACTIVE::Wait().

Referenced by setTransitions().

◆ modifiedSelection()

int EE_POINT_EDITOR::modifiedSelection ( const TOOL_EVENT aEvent)
private

Definition at line 860 of file ee_point_editor.cpp.

861 {
862  updatePoints();
863  return 0;
864 }
void updatePoints()
Updates edit points with item's points.

References updatePoints().

Referenced by setTransitions().

◆ removeCorner()

int EE_POINT_EDITOR::removeCorner ( const TOOL_EVENT aEvent)
private

Definition at line 841 of file ee_point_editor.cpp.

842 {
843  if( !m_editPoints || !m_editedPoint )
844  return 0;
845 
846  LIB_POLYLINE* polyLine = dynamic_cast<LIB_POLYLINE*>( m_editPoints->GetParent() );
847 
848  if( !polyLine || polyLine->GetCornerCount() < 3 )
849  return 0;
850 
851  polyLine->RemoveCorner( getEditedPointIndex() );
852 
853  updateView( polyLine );
854  updatePoints();
855 
856  return 0;
857 }
EDIT_POINT * m_editedPoint
Currently edited point, NULL if there is none.
void updatePoints()
Updates edit points with item's points.
unsigned GetCornerCount() const
Definition: lib_polyline.h:73
void updateView(EDA_ITEM *aItem) const
Similar to getView()->Update(), but handles items that are redrawn by their parents.
Definition: ee_tool_base.h:104
std::shared_ptr< EDIT_POINTS > m_editPoints
Currently available edit points.
int getEditedPointIndex() const
void RemoveCorner(int aIdx)

References LIB_POLYLINE::GetCornerCount(), getEditedPointIndex(), m_editedPoint, m_editPoints, LIB_POLYLINE::RemoveCorner(), updatePoints(), and EE_TOOL_BASE< SCH_BASE_FRAME >::updateView().

Referenced by setTransitions().

◆ removeCornerCondition()

bool EE_POINT_EDITOR::removeCornerCondition ( const SELECTION aSelection)
private

Definition at line 782 of file ee_point_editor.cpp.

783 {
784  if( !m_editPoints || !m_editedPoint )
785  return false;
786 
787  LIB_POLYLINE* polyLine = dynamic_cast<LIB_POLYLINE*>( m_editPoints->GetParent() );
788 
789  if( !polyLine || polyLine->GetCornerCount() < 3 )
790  return false;
791 
792  const std::vector<wxPoint>& pts = polyLine->GetPolyPoints();
793 
794  for( unsigned i = 0; i < polyLine->GetCornerCount(); ++i )
795  {
796  if( pts[i] == mapCoords( m_editedPoint->GetPosition() ) )
797  return true;
798  }
799 
800  return false;
801 }
EDIT_POINT * m_editedPoint
Currently edited point, NULL if there is none.
unsigned GetCornerCount() const
Definition: lib_polyline.h:73
const std::vector< wxPoint > & GetPolyPoints() const
Definition: lib_polyline.h:60
virtual VECTOR2I GetPosition() const
Function GetPosition()
Definition: edit_points.h:71
static VECTOR2D mapCoords(const wxPoint &aCoord)
std::shared_ptr< EDIT_POINTS > m_editPoints
Currently available edit points.

References LIB_POLYLINE::GetCornerCount(), LIB_POLYLINE::GetPolyPoints(), EDIT_POINT::GetPosition(), m_editedPoint, m_editPoints, and KIGFX::mapCoords().

Referenced by Init().

◆ Reset()

void EE_POINT_EDITOR::Reset ( RESET_REASON  aReason)
overridevirtual

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

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

Parameters
aReasoncontains information about the reason of tool reset.

Implements TOOL_BASE.

Definition at line 214 of file ee_point_editor.cpp.

215 {
216  EE_TOOL_BASE::Reset( aReason );
217 
218  m_editPoints.reset();
219 }
void Reset(RESET_REASON aReason) override
Function Reset() Brings the tool to a known, initial state.
Definition: ee_tool_base.h:90
std::shared_ptr< EDIT_POINTS > m_editPoints
Currently available edit points.

References m_editPoints, and EE_TOOL_BASE< T >::Reset().

◆ rollbackFromUndo()

void EE_POINT_EDITOR::rollbackFromUndo ( )
private

Definition at line 893 of file ee_point_editor.cpp.

894 {
895  if( m_isLibEdit )
896  static_cast<LIB_EDIT_FRAME*>( m_frame )->RollbackPartFromUndo();
897  else
898  static_cast<SCH_EDIT_FRAME*>( m_frame )->RollbackSchematicFromUndo();
899 }

References EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame, and EE_TOOL_BASE< SCH_BASE_FRAME >::m_isLibEdit.

Referenced by Main().

◆ RunMainStack()

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

Function RunMainStack()

Calls a function using the main stack.

Parameters
aFuncis the function to be calls.

Definition at line 87 of file tool_interactive.cpp.

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

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

Referenced by DRAWING_TOOL::PlaceText().

◆ saveCopyInUndoList()

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

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

Definition at line 117 of file ee_tool_base.h.

118  {
119  KICAD_T itemType = aItem->Type();
120  bool selected = aItem->IsSelected();
121 
122  // IS_SELECTED flag should not be set on undo items which were added for
123  // a drag operation.
124  if( selected && aItem->HasFlag( TEMP_SELECTED ) )
125  aItem->ClearSelected();
126 
127  if( m_isLibEdit )
128  {
129  LIB_EDIT_FRAME* editFrame = dynamic_cast<LIB_EDIT_FRAME*>( m_frame );
130  wxASSERT( editFrame );
131 
132  editFrame->SaveCopyInUndoList( static_cast<LIB_ITEM*>( aItem ), aType, aAppend );
133  }
134  else
135  {
136  SCH_EDIT_FRAME* editFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
137  wxASSERT( editFrame );
138 
139  if( itemType == SCH_PIN_T || itemType == SCH_FIELD_T || itemType == SCH_SHEET_PIN_T )
140  {
141  editFrame->SaveCopyInUndoList( editFrame->GetScreen(),
142  static_cast<SCH_ITEM*>( aItem->GetParent() ),
143  UNDO_REDO::CHANGED, aAppend );
144  }
145  else
146  {
147  editFrame->SaveCopyInUndoList( editFrame->GetScreen(),
148  static_cast<SCH_ITEM*>( aItem ),
149  aType, aAppend );
150  }
151  }
152 
153  if( selected && aItem->HasFlag( TEMP_SELECTED ) )
154  aItem->SetSelected();
155  }
bool IsSelected() const
Definition: eda_item.h:192
void ClearSelected()
Definition: eda_item.h:200
void SaveCopyInUndoList(EDA_ITEM *ItemToCopy, UNDO_REDO undoType=UNDO_REDO::LIBEDIT, bool aAppend=false)
Create a copy of the current component, and save it in the undo list.
Schematic editor (Eeschema) main window.
#define TEMP_SELECTED
flag indicating that the structure has already selected
Definition: eda_item.h:114
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void SetSelected()
Definition: eda_item.h:197
void SaveCopyInUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItemToCopy, UNDO_REDO aTypeCommand, bool aAppend, const wxPoint &aTransformPoint=wxPoint(0, 0))
Create a copy of the current schematic item, and put it in the undo list.
EDA_ITEM * GetParent() const
Definition: eda_item.h:184
The symbol library editor main window.
bool HasFlag(STATUS_FLAGS aFlag)
Definition: eda_item.h:224
KICAD_T Type() const
Function Type()
Definition: eda_item.h:182

◆ saveItemsToUndo()

void EE_POINT_EDITOR::saveItemsToUndo ( )
private

Definition at line 867 of file ee_point_editor.cpp.

868 {
869  if( m_isLibEdit )
870  {
871  saveCopyInUndoList( m_editPoints->GetParent()->GetParent(), UNDO_REDO::LIBEDIT );
872  }
873  else
874  {
876 
877  if( m_editPoints->GetParent()->Type() == SCH_LINE_T )
878  {
879  EDA_ITEM* connection = m_editPoints->Point( LINE_START ).GetConnection();
880 
881  if( connection )
882  saveCopyInUndoList( (SCH_ITEM*) connection, UNDO_REDO::CHANGED, true );
883 
884  connection = m_editPoints->Point( LINE_END ).GetConnection();
885 
886  if( connection )
887  saveCopyInUndoList( (SCH_ITEM*) connection, UNDO_REDO::CHANGED, true );
888  }
889  }
890 }
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO aType, bool aAppend=false)
Similar to m_frame->SaveCopyInUndoList(), but handles items that are owned by their parents.
Definition: ee_tool_base.h:117
std::shared_ptr< EDIT_POINTS > m_editPoints
Currently available edit points.
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: eda_item.h:148
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194

References CHANGED, LIBEDIT, LINE_END, LINE_START, m_editPoints, EE_TOOL_BASE< SCH_BASE_FRAME >::m_isLibEdit, EE_TOOL_BASE< SCH_BASE_FRAME >::saveCopyInUndoList(), and SCH_LINE_T.

Referenced by Main().

◆ SetContextMenu()

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

Function SetContextMenu()

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

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

Definition at line 76 of file tool_interactive.cpp.

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

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

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

◆ setEditedPoint()

void EE_POINT_EDITOR::setEditedPoint ( EDIT_POINT aPoint)
private

Sets the current point being edited. NULL means none.

Definition at line 760 of file ee_point_editor.cpp.

761 {
763 
764  if( aPoint )
765  {
767  controls->ForceCursorPosition( true, aPoint->GetPosition() );
768  controls->ShowCursor( true );
769  }
770  else
771  {
772  if( m_frame->ToolStackIsEmpty() )
773  controls->ShowCursor( false );
774 
775  controls->ForceCursorPosition( false );
776  }
777 
778  m_editedPoint = aPoint;
779 }
virtual void ShowCursor(bool aEnabled)
Function ShowCursor() Enables or disables display of cursor.
EDIT_POINT * m_editedPoint
Currently edited point, NULL if there is none.
void SetCurrentCursor(KICURSOR cursor)
Function SetCurrentCursor Set the current cursor shape for this panel.
virtual VECTOR2I GetPosition() const
Function GetPosition()
Definition: edit_points.h:71
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
bool ToolStackIsEmpty()
Definition: tools_holder.h:136
VIEW_CONTROLS is an interface for classes handling user events controlling the view behaviour (such a...
virtual void ForceCursorPosition(bool aEnabled, const VECTOR2D &aPosition=VECTOR2D(0, 0))
Function ForceCursorPosition() Places the cursor immediately at a given point.
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:42

References ARROW, KIGFX::VIEW_CONTROLS::ForceCursorPosition(), SCH_BASE_FRAME::GetCanvas(), EDIT_POINT::GetPosition(), TOOL_BASE::getViewControls(), m_editedPoint, EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame, EDA_DRAW_PANEL_GAL::SetCurrentCursor(), KIGFX::VIEW_CONTROLS::ShowCursor(), and TOOLS_HOLDER::ToolStackIsEmpty().

Referenced by Main(), and updateEditedPoint().

◆ setTransitions()

void EE_POINT_EDITOR::setTransitions ( )
overridevirtual

Sets up handlers for various events.

Implements TOOL_INTERACTIVE.

Definition at line 902 of file ee_point_editor.cpp.

903 {
909 }
int Main(const TOOL_EVENT &aEvent)
static const TOOL_EVENT SelectedEvent
Definition: actions.h:208
static TOOL_ACTION activatePointEditor
Definition: actions.h:168
static TOOL_ACTION pointEditorAddCorner
Definition: ee_actions.h:136
int modifiedSelection(const TOOL_EVENT &aEvent)
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Function Go()
static const TOOL_EVENT SelectedItemsModified
Definition: actions.h:213
static TOOL_ACTION pointEditorRemoveCorner
Definition: ee_actions.h:137
int removeCorner(const TOOL_EVENT &aEvent)
int addCorner(const TOOL_EVENT &aEvent)
TOOL_ACTION handlers.

References ACTIONS::activatePointEditor, addCorner(), TOOL_INTERACTIVE::Go(), Main(), modifiedSelection(), EE_ACTIONS::pointEditorAddCorner, EE_ACTIONS::pointEditorRemoveCorner, removeCorner(), EVENTS::SelectedEvent, and EVENTS::SelectedItemsModified.

◆ updateEditedPoint()

void EE_POINT_EDITOR::updateEditedPoint ( const TOOL_EVENT aEvent)
private

Updates which point is being edited.

Definition at line 236 of file ee_point_editor.cpp.

237 {
238  EDIT_POINT* point = m_editedPoint;
239 
240  if( aEvent.IsMotion() )
241  {
242  point = m_editPoints->FindPoint( aEvent.Position(), getView() );
243  }
244  else if( aEvent.IsDrag( BUT_LEFT ) )
245  {
246  point = m_editPoints->FindPoint( aEvent.DragOrigin(), getView() );
247  }
248  else
249  {
250  point = m_editPoints->FindPoint( getViewControls()->GetCursorPosition(), getView() );
251  }
252 
253  if( m_editedPoint != point )
254  setEditedPoint( point );
255 }
bool IsMotion() const
Definition: tool_event.h:306
EDIT_POINT * m_editedPoint
Currently edited point, NULL if there is none.
bool IsDrag(int aButtonMask=BUT_ANY) const
Definition: tool_event.h:296
const VECTOR2D DragOrigin() const
Returns the point where dragging has started.
Definition: tool_event.h:280
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
std::shared_ptr< EDIT_POINTS > m_editPoints
Currently available edit points.
void setEditedPoint(EDIT_POINT *aPoint)
Sets the current point being edited. NULL means none.
EDIT_POINT.
Definition: edit_points.h:46
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:42
const VECTOR2D Position() const
Returns mouse cursor position in world coordinates.
Definition: tool_event.h:274

References BUT_LEFT, TOOL_EVENT::DragOrigin(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), TOOL_EVENT::IsDrag(), TOOL_EVENT::IsMotion(), m_editedPoint, m_editPoints, TOOL_EVENT::Position(), and setEditedPoint().

Referenced by Main().

◆ updateItem()

void EE_POINT_EDITOR::updateItem ( ) const
private

Updates item's points with edit points.

Definition at line 467 of file ee_point_editor.cpp.

468 {
469  EDA_ITEM* item = m_editPoints->GetParent();
470 
471  if( !item )
472  return;
473 
474  switch( item->Type() )
475  {
476  case LIB_ARC_T:
477  {
478  LIB_ARC* arc = (LIB_ARC*) item;
479  int i = getEditedPointIndex();
480 
481  if( i == ARC_CENTER )
482  {
483  arc->SetEditState( 4 );
484  arc->CalcEdit( mapCoords( m_editPoints->Point( ARC_CENTER ).GetPosition() ) );
485  }
486  else if( i == ARC_START )
487  {
488  arc->SetEditState( 2 );
489  arc->CalcEdit( mapCoords( m_editPoints->Point( ARC_START ).GetPosition() ) );
490  }
491  else if( i == ARC_END )
492  {
493  arc->SetEditState( 3 );
494  arc->CalcEdit( mapCoords( m_editPoints->Point( ARC_END ).GetPosition() ) );
495  }
496 
497  break;
498  }
499 
500  case LIB_CIRCLE_T:
501  {
502  LIB_CIRCLE* circle = (LIB_CIRCLE*) item;
503 
504  circle->SetPosition( mapCoords( m_editPoints->Point( CIRC_CENTER ).GetPosition() ) );
505  circle->SetEnd( mapCoords( m_editPoints->Point( CIRC_END ).GetPosition() ) );
506  break;
507  }
508 
509  case LIB_POLYLINE_T:
510  {
511  LIB_POLYLINE* lines = (LIB_POLYLINE*) item;
512 
513  lines->ClearPoints();
514 
515  for( unsigned i = 0; i < m_editPoints->PointsSize(); ++i )
516  lines->AddPoint( mapCoords( m_editPoints->Point( i ).GetPosition() ) );
517 
518  break;
519  }
520 
521  case LIB_RECTANGLE_T:
522  {
523  VECTOR2I topLeft = m_editPoints->Point( RECT_TOPLEFT ).GetPosition();
524  VECTOR2I topRight = m_editPoints->Point( RECT_TOPRIGHT ).GetPosition();
525  VECTOR2I botLeft = m_editPoints->Point( RECT_BOTLEFT ).GetPosition();
526  VECTOR2I botRight = m_editPoints->Point( RECT_BOTRIGHT ).GetPosition();
527 
528  pinEditedCorner( getEditedPointIndex(), Mils2iu( 1 ), Mils2iu( 1 ),
529  topLeft, topRight, botLeft, botRight );
530 
531  LIB_RECTANGLE* rect = (LIB_RECTANGLE*) item;
532  rect->SetPosition( mapCoords( topLeft ) );
533  rect->SetEnd( mapCoords( botRight ) );
534  break;
535  }
536 
537  case SCH_BITMAP_T:
538  {
539  SCH_BITMAP* bitmap = (SCH_BITMAP*) item;
540  VECTOR2I topLeft = m_editPoints->Point( RECT_TOPLEFT ).GetPosition();
541  VECTOR2I topRight = m_editPoints->Point( RECT_TOPRIGHT ).GetPosition();
542  VECTOR2I botLeft = m_editPoints->Point( RECT_BOTLEFT ).GetPosition();
543  VECTOR2I botRight = m_editPoints->Point( RECT_BOTRIGHT ).GetPosition();
544 
545  pinEditedCorner( getEditedPointIndex(), Mils2iu( 50 ), Mils2iu( 50 ),
546  topLeft, topRight, botLeft, botRight );
547 
548  double oldWidth = bitmap->GetSize().x;
549  double newWidth = topRight.x - topLeft.x;
550  double widthRatio = newWidth / oldWidth;
551 
552  double oldHeight = bitmap->GetSize().y;
553  double newHeight = botLeft.y - topLeft.y;
554  double heightRatio = newHeight / oldHeight;
555 
556  bitmap->SetImageScale( bitmap->GetImageScale() * std::min( widthRatio, heightRatio ) );
557  break;
558  }
559 
560  case SCH_SHEET_T:
561  {
562  SCH_SHEET* sheet = (SCH_SHEET*) item;
563  VECTOR2I topLeft = m_editPoints->Point( RECT_TOPLEFT ).GetPosition();
564  VECTOR2I topRight = m_editPoints->Point( RECT_TOPRIGHT ).GetPosition();
565  VECTOR2I botLeft = m_editPoints->Point( RECT_BOTLEFT ).GetPosition();
566  VECTOR2I botRight = m_editPoints->Point( RECT_BOTRIGHT ).GetPosition();
567 
568  // The grid size used to place connected items. because a sheet contains
569  // connected items (sheet pins), keep corners coordinates on this grid.
570  // Otherwise, some sheet pins can be moved off grid
571  int grid_size = Mils2iu( 50 );
573  topLeft, topRight, botLeft, botRight, grid_size );
574 
575  sheet->SetPosition( (wxPoint) topLeft );
576  sheet->SetSize( wxSize( botRight.x - topLeft.x, botRight.y - topLeft.y ) );
577 
578  // Update the fields if we're in autoplace mode
580  sheet->AutoplaceFields( /* aScreen */ NULL, /* aManual */ false );
581 
582  // Keep sheet pins attached to edges:
583  for( SCH_SHEET_PIN* pin : sheet->GetPins() )
584  {
585  wxPoint pos = pin->GetPosition();
586 
587  switch( pin->GetEdge() )
588  {
589  case SHEET_LEFT_SIDE: pos.x = topLeft.x; break;
590  case SHEET_RIGHT_SIDE: pos.x = topRight.x; break;
591  case SHEET_TOP_SIDE: pos.y = topLeft.y; break;
592  case SHEET_BOTTOM_SIDE: pos.y = botLeft.y; break;
593  case SHEET_UNDEFINED_SIDE: break;
594  }
595 
596  pin->SetPosition( pos );
597  }
598 
599  break;
600  }
601 
602  case SCH_LINE_T:
603  {
604  SCH_LINE* line = (SCH_LINE*) item;
605 
606  line->SetStartPoint( (wxPoint) m_editPoints->Point( LINE_START ).GetPosition() );
607  line->SetEndPoint( (wxPoint) m_editPoints->Point( LINE_END ).GetPosition() );
608 
609  SCH_LINE* connection = (SCH_LINE*) ( m_editPoints->Point( LINE_START ).GetConnection() );
610 
611  if( connection )
612  {
613  if( connection->HasFlag( STARTPOINT ) )
614  connection->SetStartPoint( line->GetPosition() );
615  else if( connection->HasFlag( ENDPOINT ) )
616  connection->SetEndPoint( line->GetPosition() );
617 
618  getView()->Update( connection, KIGFX::GEOMETRY );
619  }
620 
621  connection = (SCH_LINE*) ( m_editPoints->Point( LINE_END ).GetConnection() );
622 
623  if( connection )
624  {
625  if( connection->HasFlag( STARTPOINT ) )
626  connection->SetStartPoint( line->GetEndPoint() );
627  else if( connection->HasFlag( ENDPOINT ) )
628  connection->SetEndPoint( line->GetEndPoint() );
629 
630  getView()->Update( connection, KIGFX::GEOMETRY );
631  }
632 
633  break;
634  }
635 
636  default:
637  break;
638  }
639 
640  updateView( item );
641  m_frame->SetMsgPanel( item );
642 }
FIELDS_AUTOPLACED GetFieldsAutoplaced() const
Return whether the fields have been automatically placed.
Definition: sch_item.h:447
void SetEndPoint(const wxPoint &aPosition)
Definition: sch_line.h:98
wxSize GetSize() const
Definition: sch_bitmap.cpp:125
static void pinEditedCorner(int aEditedPointIndex, int minWidth, int minHeight, VECTOR2I &topLeft, VECTOR2I &topRight, VECTOR2I &botLeft, VECTOR2I &botRight, int aGridSize=0)
Update the coordinates of 4 corners of a rectangle, accordint to constraints and the moved corner.
#define NULL
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
void SetStartPoint(const wxPoint &aPosition)
Definition: sch_line.h:95
void SetImageScale(double aScale)
Definition: sch_bitmap.h:76
int GetMinHeight() const
Return the minimum height that the sheet can be resized based on the sheet pin positions.
Definition: sch_sheet.cpp:415
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:85
void AddPoint(const wxPoint &aPoint)
static VECTOR2D mapCoords(const wxPoint &aCoord)
Object to handle a bitmap image that can be inserted in a schematic.
Definition: sch_bitmap.h:42
void CalcEdit(const wxPoint &aPosition) override
Calculates the attributes of an item at aPosition when it is being edited.
Definition: lib_arc.cpp:431
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:219
void SetSize(const wxSize &aSize)
Definition: sch_sheet.h:290
std::vector< SCH_SHEET_PIN * > & GetPins()
Definition: sch_sheet.h:367
void ClearPoints()
Definition: lib_polyline.h:56
#define STARTPOINT
When a line is selected, these flags indicate which.
Definition: eda_item.h:111
int GetMinWidth() const
Return the minimum width of the sheet based on the widths of the sheet pin text.
Definition: sch_sheet.cpp:375
void updateView(EDA_ITEM *aItem) const
Similar to getView()->Update(), but handles items that are redrawn by their parents.
Definition: ee_tool_base.h:104
void SetEnd(const wxPoint &aEnd)
Definition: lib_rectangle.h:86
std::shared_ptr< EDIT_POINTS > m_editPoints
Currently available edit points.
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:37
int getEditedPointIndex() const
wxPoint GetPosition() const override
Definition: sch_line.h:231
void SetPosition(const wxPoint &aPosition) override
Definition: sch_sheet.cpp:786
double GetImageScale() const
Definition: sch_bitmap.h:71
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: eda_item.h:148
void SetPosition(const wxPoint &aPosition) override
Definition: lib_item.h:249
#define ENDPOINT
ends. (Used to support dragging.)
Definition: eda_item.h:112
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
Definition: sch_sheet.cpp:498
bool HasFlag(STATUS_FLAGS aFlag)
Definition: eda_item.h:224
void SetEnd(const wxPoint &aPosition)
Definition: lib_circle.h:74
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1513
KICAD_T Type() const
Function Type()
Definition: eda_item.h:182
Color has changed.
Definition: view_item.h:59
void SetEditState(int aState)
Definition: lib_arc.h:84
wxPoint GetEndPoint() const
Definition: sch_line.h:97

References LIB_POLYLINE::AddPoint(), ARC_CENTER, ARC_END, ARC_START, SCH_SHEET::AutoplaceFields(), LIB_ARC::CalcEdit(), CIRC_CENTER, CIRC_END, LIB_POLYLINE::ClearPoints(), ENDPOINT, FIELDS_AUTOPLACED_AUTO, KIGFX::GEOMETRY, getEditedPointIndex(), SCH_LINE::GetEndPoint(), SCH_ITEM::GetFieldsAutoplaced(), SCH_BITMAP::GetImageScale(), SCH_SHEET::GetMinHeight(), SCH_SHEET::GetMinWidth(), SCH_SHEET::GetPins(), SCH_LINE::GetPosition(), SCH_BITMAP::GetSize(), TOOL_BASE::getView(), EDA_ITEM::HasFlag(), LIB_ARC_T, LIB_CIRCLE_T, LIB_POLYLINE_T, LIB_RECTANGLE_T, LINE_END, LINE_START, m_editPoints, EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame, KIGFX::mapCoords(), NULL, pinEditedCorner(), RECT_BOTLEFT, RECT_BOTRIGHT, RECT_TOPLEFT, RECT_TOPRIGHT, SCH_BITMAP_T, SCH_LINE_T, SCH_SHEET_T, LIB_ARC::SetEditState(), LIB_CIRCLE::SetEnd(), LIB_RECTANGLE::SetEnd(), SCH_LINE::SetEndPoint(), SCH_BITMAP::SetImageScale(), EDA_DRAW_FRAME::SetMsgPanel(), LIB_ITEM::SetPosition(), SCH_SHEET::SetPosition(), SCH_SHEET::SetSize(), SCH_LINE::SetStartPoint(), SHEET_BOTTOM_SIDE, SHEET_LEFT_SIDE, SHEET_RIGHT_SIDE, SHEET_TOP_SIDE, SHEET_UNDEFINED_SIDE, STARTPOINT, EDA_ITEM::Type(), KIGFX::VIEW::Update(), EE_TOOL_BASE< SCH_BASE_FRAME >::updateView(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by Main().

◆ updatePoints()

void EE_POINT_EDITOR::updatePoints ( )
private

Updates edit points with item's points.

Definition at line 645 of file ee_point_editor.cpp.

646 {
647  if( !m_editPoints )
648  return;
649 
650  EDA_ITEM* item = m_editPoints->GetParent();
651 
652  if( !item )
653  return;
654 
655  switch( item->Type() )
656  {
657  case LIB_ARC_T:
658  {
659  LIB_ARC* arc = (LIB_ARC*) item;
660 
661  m_editPoints->Point( ARC_CENTER ).SetPosition( mapCoords( arc->GetPosition() ) );
662  m_editPoints->Point( ARC_START ).SetPosition( mapCoords( arc->GetStart() ) );
663  m_editPoints->Point( ARC_END ).SetPosition( mapCoords( arc->GetEnd() ) );
664  break;
665  }
666 
667  case LIB_CIRCLE_T:
668  {
669  LIB_CIRCLE* circle = (LIB_CIRCLE*) item;
670 
671  m_editPoints->Point( CIRC_CENTER ).SetPosition( mapCoords( circle->GetPosition() ) );
672  m_editPoints->Point( CIRC_END ).SetPosition( mapCoords( circle->GetEnd() ) );
673  break;
674  }
675 
676  case LIB_POLYLINE_T:
677  {
678  LIB_POLYLINE* lines = (LIB_POLYLINE*) item;
679  const std::vector<wxPoint>& pts = lines->GetPolyPoints();
680 
681  if( m_editPoints->PointsSize() != (unsigned) pts.size() )
682  {
683  getView()->Remove( m_editPoints.get() );
684  m_editedPoint = nullptr;
686  getView()->Add(m_editPoints.get() );
687  }
688  else
689  {
690  for( unsigned i = 0; i < pts.size(); i++ )
691  m_editPoints->Point( i ).SetPosition( mapCoords( pts[i] ) );
692  }
693 
694  break;
695  }
696 
697  case LIB_RECTANGLE_T:
698  {
699  LIB_RECTANGLE* rect = (LIB_RECTANGLE*) item;
700  // point editor works only with rectangles having width and height > 0
701  // Some symbols can have rectangles with width or height < 0
702  // So normalize the size:
703  BOX2I dummy;
704  dummy.SetOrigin( mapCoords( rect->GetPosition() ) );
705  dummy.SetEnd( mapCoords( rect->GetEnd() ) );
706  dummy.Normalize();
707  VECTOR2I topLeft = dummy.GetPosition();
708  VECTOR2I botRight = dummy.GetEnd();
709 
710  m_editPoints->Point( RECT_TOPLEFT ).SetPosition( topLeft );
711  m_editPoints->Point( RECT_TOPRIGHT ).SetPosition( VECTOR2I( botRight.x, topLeft.y ) );
712  m_editPoints->Point( RECT_BOTLEFT ).SetPosition( VECTOR2I( topLeft.x, botRight.y ) );
713  m_editPoints->Point( RECT_BOTRIGHT ).SetPosition( botRight );
714  break;
715  }
716 
717  case SCH_BITMAP_T:
718  {
719  SCH_BITMAP* bitmap = (SCH_BITMAP*) item;
720  wxPoint topLeft = bitmap->GetPosition() - bitmap->GetSize() / 2;
721  wxPoint botRight = bitmap->GetPosition() + bitmap->GetSize() / 2;
722 
723  m_editPoints->Point( RECT_TOPLEFT ).SetPosition( topLeft );
724  m_editPoints->Point( RECT_TOPRIGHT ).SetPosition( botRight.x, topLeft.y );
725  m_editPoints->Point( RECT_BOTLEFT ).SetPosition( topLeft.x, botRight.y );
726  m_editPoints->Point( RECT_BOTRIGHT ).SetPosition( botRight );
727  break;
728  }
729 
730  case SCH_SHEET_T:
731  {
732  SCH_SHEET* sheet = (SCH_SHEET*) item;
733  wxPoint topLeft = sheet->GetPosition();
734  wxPoint botRight = sheet->GetPosition() + sheet->GetSize();
735 
736  m_editPoints->Point( RECT_TOPLEFT ).SetPosition( topLeft );
737  m_editPoints->Point( RECT_TOPRIGHT ).SetPosition( botRight.x, topLeft.y );
738  m_editPoints->Point( RECT_BOTLEFT ).SetPosition( topLeft.x, botRight.y );
739  m_editPoints->Point( RECT_BOTRIGHT ).SetPosition( botRight );
740  break;
741  }
742 
743  case SCH_LINE_T:
744  {
745  SCH_LINE* line = (SCH_LINE*) item;
746 
747  m_editPoints->Point( LINE_START ).SetPosition( line->GetStartPoint() );
748  m_editPoints->Point( LINE_END ).SetPosition( line->GetEndPoint() );
749  break;
750  }
751 
752  default:
753  break;
754  }
755 
756  getView()->Update( m_editPoints.get() );
757 }
wxPoint GetStartPoint() const
Definition: sch_line.h:94
wxPoint GetEnd() const
Definition: lib_rectangle.h:87
virtual void Remove(VIEW_ITEM *aItem)
Function Remove() Removes a VIEW_ITEM from the view.
Definition: view.cpp:357
wxPoint GetPosition() const override
Definition: lib_circle.h:72
EDIT_POINT * m_editedPoint
Currently edited point, NULL if there is none.
virtual wxPoint GetPosition() const
Definition: eda_item.h:326
wxPoint GetPosition() const override
Definition: sch_bitmap.h:140
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
const std::vector< wxPoint > & GetPolyPoints() const
Definition: lib_polyline.h:60
wxPoint GetEnd() const
Definition: lib_circle.h:75
wxSize GetSize() const
Definition: sch_bitmap.cpp:125
wxPoint GetStart() const
Definition: lib_arc.h:111
static VECTOR2D mapCoords(const wxPoint &aCoord)
wxPoint GetPosition() const override
Definition: sch_sheet.h:572
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:36
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:219
std::shared_ptr< EDIT_POINTS > m_editPoints
Currently available edit points.
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:37
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
wxPoint GetEnd() const
Definition: lib_arc.h:114
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: eda_item.h:148
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Function Add() Adds a VIEW_ITEM to the view.
Definition: view.cpp:327
static std::shared_ptr< EDIT_POINTS > Make(EDA_ITEM *aItem, SCH_BASE_FRAME *frame)
wxSize GetSize()
Definition: sch_sheet.h:289
wxPoint GetPosition() const override
Definition: lib_rectangle.h:74
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1513
KICAD_T Type() const
Function Type()
Definition: eda_item.h:182
wxPoint GetPosition() const override
Definition: lib_arc.h:90
wxPoint GetEndPoint() const
Definition: sch_line.h:97

References KIGFX::VIEW::Add(), ARC_CENTER, ARC_END, ARC_START, CIRC_CENTER, CIRC_END, dummy(), LIB_CIRCLE::GetEnd(), LIB_RECTANGLE::GetEnd(), LIB_ARC::GetEnd(), SCH_LINE::GetEndPoint(), LIB_POLYLINE::GetPolyPoints(), LIB_CIRCLE::GetPosition(), LIB_RECTANGLE::GetPosition(), LIB_ARC::GetPosition(), SCH_BITMAP::GetPosition(), EDA_ITEM::GetPosition(), SCH_SHEET::GetPosition(), SCH_BITMAP::GetSize(), SCH_SHEET::GetSize(), LIB_ARC::GetStart(), SCH_LINE::GetStartPoint(), TOOL_BASE::getView(), LIB_ARC_T, LIB_CIRCLE_T, LIB_POLYLINE_T, LIB_RECTANGLE_T, LINE_END, LINE_START, m_editedPoint, m_editPoints, EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame, EDIT_POINTS_FACTORY::Make(), KIGFX::mapCoords(), RECT_BOTLEFT, RECT_BOTRIGHT, RECT_TOPLEFT, RECT_TOPRIGHT, KIGFX::VIEW::Remove(), SCH_BITMAP_T, SCH_LINE_T, SCH_SHEET_T, EDA_ITEM::Type(), KIGFX::VIEW::Update(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by addCorner(), Main(), modifiedSelection(), and removeCorner().

◆ updateView()

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

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

Definition at line 104 of file ee_tool_base.h.

105  {
106  KICAD_T itemType = aItem->Type();
107 
108  if( itemType == SCH_PIN_T || itemType == SCH_FIELD_T || itemType == SCH_SHEET_PIN_T )
109  getView()->Update( aItem->GetParent() );
110 
111  getView()->Update( aItem );
112  }
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: eda_item.h:184
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1513
KICAD_T Type() const
Function Type()
Definition: eda_item.h:182

◆ Wait()

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

Function Wait()

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

Definition at line 57 of file tool_interactive.cpp.

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

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

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), LIB_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), ROUTER_TOOL::InlineDrag(), ZOOM_TOOL::Main(), PL_EDIT_TOOL::Main(), CVPCB_CONTROL::Main(), Main(), PL_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), SCH_MOVE_TOOL::Main(), PCBNEW_PICKER_TOOL::Main(), EDA_3D_CONTROLLER::Main(), PICKER_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), PL_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), SELECTION_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), POINT_EDITOR::OnSelectionChange(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), GROUP_TOOL::PickNewMember(), EDIT_TOOL::pickReferencePoint(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), EDIT_TOOL::Remove(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), GERBVIEW_SELECTION_TOOL::selectPoint(), SELECTION_TOOL::selectPoint(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), ZOOM_TOOL::selectRegion(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

Member Data Documentation

◆ m_editedPoint

EDIT_POINT* EE_POINT_EDITOR::m_editedPoint
private

◆ m_editPoints

std::shared_ptr<EDIT_POINTS> EE_POINT_EDITOR::m_editPoints
private

◆ m_frame

SCH_BASE_FRAME * EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame
protectedinherited

Definition at line 158 of file ee_tool_base.h.

◆ m_isLibEdit

bool EE_TOOL_BASE< SCH_BASE_FRAME >::m_isLibEdit
protectedinherited

Definition at line 161 of file ee_tool_base.h.

◆ m_menu

TOOL_MENU TOOL_INTERACTIVE::m_menu
protectedinherited

functions below are not yet implemented - their interface may change

Definition at line 108 of file tool_interactive.h.

Referenced by SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), LIB_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), TOOL_INTERACTIVE::GetToolMenu(), ROUTER_TOOL::Init(), LENGTH_TUNER_TOOL::Init(), PICKER_TOOL::Init(), PL_EDIT_TOOL::Init(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Init(), SCH_EDIT_TOOL::Init(), LIB_CONTROL::Init(), LIB_DRAWING_TOOLS::Init(), FOOTPRINT_EDITOR_TOOLS::Init(), PCB_VIEWER_TOOLS::Init(), PL_DRAWING_TOOLS::Init(), PCB_EDITOR_CONTROL::Init(), SCH_DRAWING_TOOLS::Init(), EDA_3D_CONTROLLER::Init(), GERBVIEW_SELECTION_TOOL::Init(), PL_SELECTION_TOOL::Init(), DRAWING_TOOL::Init(), EE_SELECTION_TOOL::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), SELECTION_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), PCB_TOOL_BASE::Init(), PL_EDIT_TOOL::Main(), LIB_MOVE_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), SCH_MOVE_TOOL::Main(), PCBNEW_PICKER_TOOL::Main(), EDA_3D_CONTROLLER::Main(), PICKER_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), PL_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), SELECTION_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ m_selectionTool

EE_SELECTION_TOOL* EE_TOOL_BASE< SCH_BASE_FRAME >::m_selectionTool
protectedinherited

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

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

◆ m_toolMgr

TOOL_MANAGER* TOOL_BASE::m_toolMgr
protectedinherited

Definition at line 219 of file tool_base.h.

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

◆ m_toolName

std::string TOOL_BASE::m_toolName
protectedinherited

Name of the tool.

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

Definition at line 218 of file tool_base.h.

Referenced by TOOL_BASE::GetName().

◆ m_type

TOOL_TYPE TOOL_BASE::m_type
protectedinherited

Stores the type of the tool.

Definition at line 211 of file tool_base.h.

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

◆ m_view

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

Definition at line 159 of file ee_tool_base.h.


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