KiCad PCB EDA Suite
EE_POINT_EDITOR Class Reference

Tool that displays edit points allowing to modify items by dragging the points. 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 }
 Determine the reason of reset for a tool. More...
 

Public Member Functions

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

Protected Member Functions

void updateItem (EDA_ITEM *aItem, bool aUpdateRTree) const
 Similar to getView()->Update(), but handles items that are redrawn by their parents and updating the SCH_SCREEN's RTree. More...
 
void saveCopyInUndoList (EDA_ITEM *aItem, UNDO_REDO aType, bool aAppend=false)
 
void attachManager (TOOL_MANAGER *aManager)
 Set the TOOL_MANAGER the tool will belong to. More...
 
KIGFX::VIEWgetView () const
 Returns the instance of #VIEW object used in the application. More...
 
KIGFX::VIEW_CONTROLSgetViewControls () const
 Return the instance of VIEW_CONTROLS object used in the application. More...
 
template<typename T >
T * getEditFrame () const
 Return the application window object, casted to requested user type. More...
 
template<typename T >
T * getModel () const
 Return the model object if it matches the requested type. More...
 

Protected Attributes

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

Private Member Functions

void updateParentItem () const
 < Update item's points with edit points. More...
 
void updatePoints ()
 Update which point is being edited. More...
 
void updateEditedPoint (const TOOL_EVENT &aEvent)
 Set the current point being edited. NULL means none. More...
 
void setEditedPoint (EDIT_POINT *aPoint)
 Return true if aPoint is the currently modified point. More...
 
bool isModified (const EDIT_POINT &aPoint) const
 
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
 

Detailed Description

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

Definition at line 38 of file ee_point_editor.h.

Member Enumeration Documentation

◆ RESET_REASON

enum TOOL_BASE::RESET_REASON
inherited

Determine the reason of reset for a tool.

Enumerator
RUN 

Tool is invoked after being inactive.

MODEL_RELOAD 

Model changes (required full reload)

GAL_SWITCH 

Rendering engine changes.

Definition at line 77 of file tool_base.h.

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

Constructor & Destructor Documentation

◆ EE_POINT_EDITOR()

EE_POINT_EDITOR::EE_POINT_EDITOR ( )

Definition at line 203 of file ee_point_editor.cpp.

203  :
204  EE_TOOL_BASE<SCH_BASE_FRAME>( "eeschema.PointEditor" ),
205  m_editedPoint( nullptr )
206 {
207 }
EDIT_POINT * m_editedPoint
< Currently edited point, NULL if there is none.

Member Function Documentation

◆ Activate()

void TOOL_INTERACTIVE::Activate ( )
inherited

Run the tool.

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

Definition at line 51 of file tool_interactive.cpp.

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

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

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

◆ addCorner()

int EE_POINT_EDITOR::addCorner ( const TOOL_EVENT aEvent)
private

TOOL_ACTION handlers.

Definition at line 826 of file ee_point_editor.cpp.

827 {
828  if( !m_editPoints )
829  return 0;
830 
831  LIB_POLYLINE* polyLine = dynamic_cast<LIB_POLYLINE*>( m_editPoints->GetParent() );
832 
833  if( !polyLine )
834  return false;
835 
837  polyLine->AddCorner( mapCoords( cursorPos ) );
838 
839  updateItem( polyLine, true );
840  updatePoints();
841 
842  return 0;
843 }
void AddCorner(const wxPoint &aPosition)
void updatePoints()
Update which point is being edited.
bool DisableGridSnapping() const
Definition: tool_event.h:341
static VECTOR2D mapCoords(const wxPoint &aCoord)
void updateItem(EDA_ITEM *aItem, bool aUpdateRTree) const
Similar to getView()->Update(), but handles items that are redrawn by their parents and updating the ...
Definition: ee_tool_base.h:103
std::shared_ptr< EDIT_POINTS > m_editPoints
KIGFX::VIEW_CONTROLS * getViewControls() const
Return the instance of VIEW_CONTROLS object used in the application.
Definition: tool_base.cpp:42
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.

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

Referenced by setTransitions().

◆ addCornerCondition()

bool EE_POINT_EDITOR::addCornerCondition ( const SELECTION aSelection)
private

Definition at line 809 of file ee_point_editor.cpp.

810 {
811  if( !m_editPoints || !m_editedPoint )
812  return false;
813 
814  LIB_POLYLINE* polyLine = dynamic_cast<LIB_POLYLINE*>( m_editPoints->GetParent() );
815 
816  if( !polyLine )
817  return false;
818 
819  VECTOR2I cursorPos = getViewControls()->GetCursorPosition();
820  double threshold = getView()->ToWorld( EDIT_POINT::POINT_SIZE );
821 
822  return polyLine->HitTest( mapCoords( cursorPos ), (int) threshold );
823 }
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Converts a screen space point/vector to a point/vector in world space coordinates.
Definition: view.cpp:452
EDIT_POINT * m_editedPoint
< Currently edited point, NULL if there is none.
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
static VECTOR2D mapCoords(const wxPoint &aCoord)
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition: tool_base.cpp:36
std::shared_ptr< EDIT_POINTS > m_editPoints
static const int POINT_SIZE
Border size when not hovering.
Definition: edit_points.h:186
KIGFX::VIEW_CONTROLS * getViewControls() const
Return the instance of VIEW_CONTROLS object used in the application.
Definition: tool_base.cpp:42
VECTOR2D GetCursorPosition() const
Return 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

Set the TOOL_MANAGER the tool will belong to.

Called by TOOL_MANAGER::RegisterTool()

Definition at line 60 of file tool_base.cpp.

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

References TOOL_BASE::m_toolMgr.

Referenced by TOOL_MANAGER::RegisterTool().

◆ getEditedPointIndex()

int EE_POINT_EDITOR::getEditedPointIndex ( ) const
inlineprivate

Definition at line 79 of file ee_point_editor.h.

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

References m_editedPoint, and m_editPoints.

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

◆ getEditFrame()

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

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

Definition at line 184 of file tool_base.h.

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

References TOOL_BASE::getToolHolderInt().

Referenced by ZONE_CREATE_HELPER::createNewZone().

◆ GetId()

TOOL_ID TOOL_BASE::GetId ( ) const
inlineinherited

Return the unique identifier of the tool.

The identifier is set by an instance of TOOL_MANAGER.

Returns
Identifier of the tool.

Definition at line 120 of file tool_base.h.

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

References TOOL_BASE::m_toolId.

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

◆ GetManager()

TOOL_MANAGER* TOOL_BASE::GetManager ( ) const
inlineinherited

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

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

Definition at line 143 of file tool_base.h.

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

References TOOL_BASE::m_toolMgr.

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

◆ getModel()

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

Return the model object if it matches the requested type.

Store the type of the tool.

Definition at line 196 of file tool_base.h.

References TOOL_BASE::getModelInt().

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

◆ GetName()

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

Return the name of the tool.

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

Returns
The name of the tool.

Definition at line 133 of file tool_base.h.

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

References TOOL_BASE::m_toolName.

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

◆ GetToolMenu()

◆ GetType()

TOOL_TYPE TOOL_BASE::GetType ( ) const
inlineinherited

Return the type of the tool.

Returns
The type of the tool.

Definition at line 108 of file tool_base.h.

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

References TOOL_BASE::m_type.

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

◆ getView()

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

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

It allows tools to draw.

Returns
The instance of VIEW.

Definition at line 36 of file tool_base.cpp.

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

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

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

◆ getViewControls()

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

Return the instance of VIEW_CONTROLS object used in the application.

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

Returns
The instance of VIEW_CONTROLS.

Definition at line 42 of file tool_base.cpp.

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

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

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

◆ Go()

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

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

No conditions means any event.

Definition at line 147 of file tool_interactive.h.

149 {
150  TOOL_STATE_FUNC sptr = std::bind( aStateFunc, static_cast<T*>( this ), std::placeholders::_1 );
151 
152  goInternal( sptr, aConditions );
153 }
std::function< int(const TOOL_EVENT &)> TOOL_STATE_FUNC
Definition: tool_base.h:58
void goInternal(TOOL_STATE_FUNC &aState, const TOOL_EVENT_LIST &aConditions)

References TOOL_INTERACTIVE::goInternal().

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

◆ HasPoint()

bool EE_POINT_EDITOR::HasPoint ( )
inline

Indicate the cursor is over an edit point.

Used to coordinate cursor shapes with other tools.Set up handlers for various events.

Definition at line 55 of file ee_point_editor.h.

References m_editedPoint.

◆ Init()

bool EE_POINT_EDITOR::Init ( )
overridevirtual

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

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

Reimplemented from TOOL_BASE.

Definition at line 218 of file ee_point_editor.cpp.

219 {
221 
222  auto& menu = m_selectionTool->GetToolMenu().GetMenu();
224  std::bind( &EE_POINT_EDITOR::addCornerCondition, this, _1 ) );
226  std::bind( &EE_POINT_EDITOR::removeCornerCondition, this, _1 ) );
227 
228  return true;
229 }
static TOOL_ACTION pointEditorAddCorner
Definition: ee_actions.h:132
CONDITIONAL_MENU & GetMenu()
Definition: tool_menu.cpp:46
TOOL_MENU & GetToolMenu()
bool Init() override
Init() is called once upon a registration of the tool.
Definition: ee_tool_base.h:66
bool addCornerCondition(const SELECTION &aSelection)
static TOOL_ACTION pointEditorRemoveCorner
Definition: ee_actions.h:133
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:177
bool removeCornerCondition(const SELECTION &aSelection)
void AddItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Add a menu entry to run a TOOL_ACTION on selected items.

References 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

Definition at line 74 of file ee_point_editor.h.

75  {
76  return m_editedPoint == &aPoint;
77  }
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:214
TOOL_ID m_toolId
Name of the tool.
Definition: tool_base.h:209
bool IsToolActive(TOOL_ID aId) const
Return true if a tool with given id is active (executing)

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

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

◆ Main()

int EE_POINT_EDITOR::Main ( const TOOL_EVENT aEvent)

Definition at line 254 of file ee_point_editor.cpp.

255 {
256  static KICAD_T supportedTypes[] = {
257  LIB_ARC_T,
258  LIB_CIRCLE_T,
261  SCH_SHEET_T,
263  SCH_BITMAP_T,
264  EOT
265  };
266 
267  if( !m_selectionTool )
268  return 0;
269 
270  const EE_SELECTION& selection = m_selectionTool->GetSelection();
271 
272  if( selection.Size() != 1 || !selection.Front()->IsType( supportedTypes ) )
273  return 0;
274 
275  // Wait till drawing tool is done
276  if( selection.Front()->IsNew() )
277  return 0;
278 
279  Activate();
280 
282  KIGFX::VIEW* view = getView();
283  EDA_ITEM* item = (EDA_ITEM*) selection.Front();
284 
285  controls->ShowCursor( true );
286 
288  view->Add( m_editPoints.get() );
289  setEditedPoint( nullptr );
290  updateEditedPoint( aEvent );
291  bool inDrag = false;
292  bool modified = false;
293 
294  // Main loop: keep receiving events
295  while( TOOL_EVENT* evt = Wait() )
296  {
297  if( !m_editPoints || evt->IsSelectionEvent() )
298  break;
299 
300  if ( !inDrag )
301  updateEditedPoint( *evt );
302 
303  if( evt->IsDrag( BUT_LEFT ) && m_editedPoint )
304  {
305  if( !inDrag )
306  {
307  saveItemsToUndo();
308  controls->ForceCursorPosition( false );
309  inDrag = true;
310  modified = true;
311  }
312 
313  bool snap = !evt->DisableGridSnapping();
314 
315  if( item->Type() == LIB_ARC_T && getEditedPointIndex() == ARC_CENTER )
316  snap = false;
317 
318  m_editedPoint->SetPosition( controls->GetCursorPosition( snap ) );
319 
321  updatePoints();
322  }
323  else if( inDrag && evt->IsMouseUp( BUT_LEFT ) )
324  {
325  if( modified )
326  {
327  m_frame->OnModify();
328  modified = false;
329  }
330 
331  controls->SetAutoPan( false );
332  inDrag = false;
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  {
345  break;
346  }
347 
348  if( evt->IsActivate() )
349  break;
350  }
351  else
352  {
353  evt->SetPassEvent();
354  }
355 
356  controls->SetAutoPan( inDrag );
357  controls->CaptureCursor( inDrag );
358  }
359 
360  controls->SetAutoPan( false );
361  controls->CaptureCursor( false );
362 
363  if( m_editPoints )
364  {
365  view->Remove( m_editPoints.get() );
366 
367  if( modified )
368  m_frame->OnModify();
369 
370  m_editPoints.reset();
371  m_frame->GetCanvas()->Refresh();
372  }
373 
374  return 0;
375 }
virtual void ShowCursor(bool aEnabled)
Enable or disables display of cursor.
TOOL_EVENT * Wait(const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
Suspend execution of the tool until an event specified in aEventList arrives.
void updateEditedPoint(const TOOL_EVENT &aEvent)
Set the current point being edited. NULL means none.
virtual void Remove(VIEW_ITEM *aItem)
Remove a VIEW_ITEM from the view.
Definition: view.cpp:353
EDIT_POINT * m_editedPoint
< Currently edited point, NULL if there is none.
void updatePoints()
Update which point is being edited.
search types array terminator (End Of Types)
Definition: typeinfo.h:81
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
bool IsNew() const
Definition: eda_item.h:119
EE_SELECTION & GetSelection()
Return the set of currently selected items.
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)
Force the cursor to stay within the drawing panel area.
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
Generic, UI-independent tool event.
Definition: tool_event.h:152
An interface for classes handling user events controlling the view behavior such as zooming,...
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:177
virtual void ForceCursorPosition(bool aEnabled, const VECTOR2D &aPosition=VECTOR2D(0, 0))
Place the cursor immediately at a given point.
virtual bool IsType(const KICAD_T aScanTypes[]) const
Check whether the item is one of the listed types.
Definition: eda_item.h:183
void updateParentItem() const
< Update item's points with edit points.
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition: tool_base.cpp:36
virtual void SetAutoPan(bool aEnabled)
Turn on/off auto panning (this feature is used when there is a tool active (eg.
std::shared_ptr< EDIT_POINTS > m_editPoints
int getEditedPointIndex() const
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
int Size() const
Returns the number of selected parts.
Definition: selection.h:103
void setEditedPoint(EDIT_POINT *aPoint)
Return true if aPoint is the currently modified point.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100
void Activate()
Run the tool.
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
Definition: view.cpp:323
KIGFX::VIEW_CONTROLS * getViewControls() const
Return the instance of VIEW_CONTROLS object used in the application.
Definition: tool_base.cpp:42
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:68
static std::shared_ptr< EDIT_POINTS > Make(EDA_ITEM *aItem, SCH_BASE_FRAME *frame)
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
EDA_ITEM * Front() const
Definition: selection.h:144
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113
virtual void SetPosition(const VECTOR2I &aPosition)
Set new coordinates for an EDIT_POINT.
Definition: edit_points.h:106

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(), 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(), updateParentItem(), updatePoints(), and TOOL_INTERACTIVE::Wait().

Referenced by setTransitions().

◆ modifiedSelection()

int EE_POINT_EDITOR::modifiedSelection ( const TOOL_EVENT aEvent)
private

Definition at line 865 of file ee_point_editor.cpp.

866 {
867  updatePoints();
868  return 0;
869 }
void updatePoints()
Update which point is being edited.

References updatePoints().

Referenced by setTransitions().

◆ removeCorner()

int EE_POINT_EDITOR::removeCorner ( const TOOL_EVENT aEvent)
private

Definition at line 846 of file ee_point_editor.cpp.

847 {
848  if( !m_editPoints || !m_editedPoint )
849  return 0;
850 
851  LIB_POLYLINE* polyLine = dynamic_cast<LIB_POLYLINE*>( m_editPoints->GetParent() );
852 
853  if( !polyLine || polyLine->GetCornerCount() < 3 )
854  return 0;
855 
856  polyLine->RemoveCorner( getEditedPointIndex() );
857 
858  updateItem( polyLine, true );
859  updatePoints();
860 
861  return 0;
862 }
EDIT_POINT * m_editedPoint
< Currently edited point, NULL if there is none.
void updatePoints()
Update which point is being edited.
unsigned GetCornerCount() const
Definition: lib_polyline.h:67
void updateItem(EDA_ITEM *aItem, bool aUpdateRTree) const
Similar to getView()->Update(), but handles items that are redrawn by their parents and updating the ...
Definition: ee_tool_base.h:103
std::shared_ptr< EDIT_POINTS > m_editPoints
int getEditedPointIndex() const
void RemoveCorner(int aIdx)

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

Referenced by setTransitions().

◆ removeCornerCondition()

bool EE_POINT_EDITOR::removeCornerCondition ( const SELECTION aSelection)
private

Definition at line 787 of file ee_point_editor.cpp.

788 {
789  if( !m_editPoints || !m_editedPoint )
790  return false;
791 
792  LIB_POLYLINE* polyLine = dynamic_cast<LIB_POLYLINE*>( m_editPoints->GetParent() );
793 
794  if( !polyLine || polyLine->GetCornerCount() < 3 )
795  return false;
796 
797  const std::vector<wxPoint>& pts = polyLine->GetPolyPoints();
798 
799  for( unsigned i = 0; i < polyLine->GetCornerCount(); ++i )
800  {
801  if( pts[i] == mapCoords( m_editedPoint->GetPosition() ) )
802  return true;
803  }
804 
805  return false;
806 }
EDIT_POINT * m_editedPoint
< Currently edited point, NULL if there is none.
unsigned GetCornerCount() const
Definition: lib_polyline.h:67
const std::vector< wxPoint > & GetPolyPoints() const
Definition: lib_polyline.h:54
virtual VECTOR2I GetPosition() const
Return coordinates of an EDIT_POINT.
Definition: edit_points.h:70
static VECTOR2D mapCoords(const wxPoint &aCoord)
std::shared_ptr< EDIT_POINTS > m_editPoints

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

Bring the tool to a known, initial state.

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

Parameters
aReasoncontains information about the reason of tool reset.

Implements TOOL_BASE.

Definition at line 210 of file ee_point_editor.cpp.

211 {
212  EE_TOOL_BASE::Reset( aReason );
213 
214  m_editPoints.reset();
215 }
void Reset(RESET_REASON aReason) override
Bring the tool to a known, initial state.
Definition: ee_tool_base.h:86
std::shared_ptr< EDIT_POINTS > m_editPoints

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

◆ rollbackFromUndo()

void EE_POINT_EDITOR::rollbackFromUndo ( )
private

Definition at line 898 of file ee_point_editor.cpp.

899 {
900  if( m_isSymbolEditor )
901  static_cast<SYMBOL_EDIT_FRAME*>( m_frame )->RollbackSymbolFromUndo();
902  else
903  static_cast<SCH_EDIT_FRAME*>( m_frame )->RollbackSchematicFromUndo();
904 }

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

Referenced by Main().

◆ RunMainStack()

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

Call a function using the main stack.

Parameters
aFuncis the function to be calls.

Definition at line 87 of file tool_interactive.cpp.

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

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

Referenced by DRAWING_TOOL::PlaceText().

◆ saveCopyInUndoList()

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

Definition at line 134 of file ee_tool_base.h.

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

◆ saveItemsToUndo()

void EE_POINT_EDITOR::saveItemsToUndo ( )
private

Definition at line 872 of file ee_point_editor.cpp.

873 {
874  if( m_isSymbolEditor )
875  {
876  saveCopyInUndoList( m_editPoints->GetParent()->GetParent(), UNDO_REDO::LIBEDIT );
877  }
878  else
879  {
881 
882  if( m_editPoints->GetParent()->Type() == SCH_LINE_T )
883  {
884  std::pair<EDA_ITEM*, int> connected = m_editPoints->Point( LINE_START ).GetConnected();
885 
886  if( connected.first )
887  saveCopyInUndoList( (SCH_ITEM*) connected.first, UNDO_REDO::CHANGED, true );
888 
889  connected = m_editPoints->Point( LINE_END ).GetConnected();
890 
891  if( connected.first )
892  saveCopyInUndoList( (SCH_ITEM*) connected.first, UNDO_REDO::CHANGED, true );
893  }
894  }
895 }
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO aType, bool aAppend=false)
Definition: ee_tool_base.h:134
std::shared_ptr< EDIT_POINTS > m_editPoints
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:193

References CHANGED, LIBEDIT, LINE_END, LINE_START, m_editPoints, EE_TOOL_BASE< SCH_BASE_FRAME >::m_isSymbolEditor, 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

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

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

Definition at line 76 of file tool_interactive.cpp.

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

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

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

◆ setEditedPoint()

void EE_POINT_EDITOR::setEditedPoint ( EDIT_POINT aPoint)
private

Return true if aPoint is the currently modified point.

Definition at line 765 of file ee_point_editor.cpp.

766 {
768 
769  if( aPoint )
770  {
772  controls->ForceCursorPosition( true, aPoint->GetPosition() );
773  controls->ShowCursor( true );
774  }
775  else
776  {
777  if( m_frame->ToolStackIsEmpty() )
778  controls->ShowCursor( false );
779 
780  controls->ForceCursorPosition( false );
781  }
782 
783  m_editedPoint = aPoint;
784 }
virtual void ShowCursor(bool aEnabled)
Enable or disables display of cursor.
void SetCurrentCursor(KICURSOR aCursor)
Set the current cursor shape for this panel.
EDIT_POINT * m_editedPoint
< Currently edited point, NULL if there is none.
virtual VECTOR2I GetPosition() const
Return coordinates of an EDIT_POINT.
Definition: edit_points.h:70
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
bool ToolStackIsEmpty()
Definition: tools_holder.h:116
An interface for classes handling user events controlling the view behavior such as zooming,...
virtual void ForceCursorPosition(bool aEnabled, const VECTOR2D &aPosition=VECTOR2D(0, 0))
Place the cursor immediately at a given point.
KIGFX::VIEW_CONTROLS * getViewControls() const
Return the instance of VIEW_CONTROLS object used in the application.
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

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

It is called every time tool is reset or finished.

Implements TOOL_INTERACTIVE.

Definition at line 907 of file ee_point_editor.cpp.

908 {
914 }
int Main(const TOOL_EVENT &aEvent)
static const TOOL_EVENT SelectedEvent
Definition: actions.h:199
static TOOL_ACTION activatePointEditor
Definition: actions.h:168
static TOOL_ACTION pointEditorAddCorner
Definition: ee_actions.h:132
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))
Define which state (aStateFunc) to go when a certain event arrives (aConditions).
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
Definition: actions.h:204
static TOOL_ACTION pointEditorRemoveCorner
Definition: ee_actions.h:133
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

Set the current point being edited. NULL means none.

Definition at line 232 of file ee_point_editor.cpp.

233 {
234  EDIT_POINT* point = m_editedPoint;
235 
236  if( aEvent.IsMotion() )
237  {
238  point = m_editPoints->FindPoint( aEvent.Position(), getView() );
239  }
240  else if( aEvent.IsDrag( BUT_LEFT ) )
241  {
242  point = m_editPoints->FindPoint( aEvent.DragOrigin(), getView() );
243  }
244  else
245  {
246  point = m_editPoints->FindPoint( getViewControls()->GetCursorPosition(), getView() );
247  }
248 
249  if( m_editedPoint != point )
250  setEditedPoint( point );
251 }
bool IsMotion() const
Definition: tool_event.h:300
EDIT_POINT * m_editedPoint
< Currently edited point, NULL if there is none.
bool IsDrag(int aButtonMask=BUT_ANY) const
Definition: tool_event.h:285
const VECTOR2D DragOrigin() const
Returns information about mouse buttons state.
Definition: tool_event.h:269
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition: tool_base.cpp:36
std::shared_ptr< EDIT_POINTS > m_editPoints
void setEditedPoint(EDIT_POINT *aPoint)
Return true if aPoint is the currently modified point.
Represent a single point that can be used for modifying items.
Definition: edit_points.h:47
KIGFX::VIEW_CONTROLS * getViewControls() const
Return the instance of VIEW_CONTROLS object used in the application.
Definition: tool_base.cpp:42
const VECTOR2D Position() const
Returns the point where dragging has started.
Definition: tool_event.h:263

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_TOOL_BASE< SCH_BASE_FRAME >::updateItem ( EDA_ITEM aItem,
bool  aUpdateRTree 
) const
inlineprotectedinherited

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

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

Definition at line 103 of file ee_tool_base.h.

◆ updateParentItem()

void EE_POINT_EDITOR::updateParentItem ( ) const
private

< Update item's points with edit points.

Update edit points with item's points.

Definition at line 462 of file ee_point_editor.cpp.

463 {
464  EDA_ITEM* item = m_editPoints->GetParent();
465 
466  if( !item )
467  return;
468 
469  switch( item->Type() )
470  {
471  case LIB_ARC_T:
472  {
473  LIB_ARC* arc = (LIB_ARC*) item;
474  int i = getEditedPointIndex();
475 
476  if( i == ARC_CENTER )
477  {
478  arc->SetEditState( 4 );
479  arc->CalcEdit( mapCoords( m_editPoints->Point( ARC_CENTER ).GetPosition() ) );
480  }
481  else if( i == ARC_START )
482  {
483  arc->SetEditState( 2 );
484  arc->CalcEdit( mapCoords( m_editPoints->Point( ARC_START ).GetPosition() ) );
485  }
486  else if( i == ARC_END )
487  {
488  arc->SetEditState( 3 );
489  arc->CalcEdit( mapCoords( m_editPoints->Point( ARC_END ).GetPosition() ) );
490  }
491 
492  break;
493  }
494 
495  case LIB_CIRCLE_T:
496  {
497  LIB_CIRCLE* circle = (LIB_CIRCLE*) item;
498 
499  circle->SetPosition( mapCoords( m_editPoints->Point( CIRC_CENTER ).GetPosition() ) );
500  circle->SetEnd( mapCoords( m_editPoints->Point( CIRC_END ).GetPosition() ) );
501  break;
502  }
503 
504  case LIB_POLYLINE_T:
505  {
506  LIB_POLYLINE* lines = (LIB_POLYLINE*) item;
507 
508  lines->ClearPoints();
509 
510  for( unsigned i = 0; i < m_editPoints->PointsSize(); ++i )
511  lines->AddPoint( mapCoords( m_editPoints->Point( i ).GetPosition() ) );
512 
513  break;
514  }
515 
516  case LIB_RECTANGLE_T:
517  {
518  VECTOR2I topLeft = m_editPoints->Point( RECT_TOPLEFT ).GetPosition();
519  VECTOR2I topRight = m_editPoints->Point( RECT_TOPRIGHT ).GetPosition();
520  VECTOR2I botLeft = m_editPoints->Point( RECT_BOTLEFT ).GetPosition();
521  VECTOR2I botRight = m_editPoints->Point( RECT_BOTRIGHT ).GetPosition();
522 
523  pinEditedCorner( getEditedPointIndex(), Mils2iu( 1 ), Mils2iu( 1 ),
524  topLeft, topRight, botLeft, botRight );
525 
526  LIB_RECTANGLE* rect = (LIB_RECTANGLE*) item;
527  rect->SetPosition( mapCoords( topLeft ) );
528  rect->SetEnd( mapCoords( botRight ) );
529  break;
530  }
531 
532  case SCH_BITMAP_T:
533  {
534  SCH_BITMAP* bitmap = (SCH_BITMAP*) item;
535  VECTOR2I topLeft = m_editPoints->Point( RECT_TOPLEFT ).GetPosition();
536  VECTOR2I topRight = m_editPoints->Point( RECT_TOPRIGHT ).GetPosition();
537  VECTOR2I botLeft = m_editPoints->Point( RECT_BOTLEFT ).GetPosition();
538  VECTOR2I botRight = m_editPoints->Point( RECT_BOTRIGHT ).GetPosition();
539 
540  pinEditedCorner( getEditedPointIndex(), Mils2iu( 50 ), Mils2iu( 50 ),
541  topLeft, topRight, botLeft, botRight );
542 
543  double oldWidth = bitmap->GetSize().x;
544  double newWidth = topRight.x - topLeft.x;
545  double widthRatio = newWidth / oldWidth;
546 
547  double oldHeight = bitmap->GetSize().y;
548  double newHeight = botLeft.y - topLeft.y;
549  double heightRatio = newHeight / oldHeight;
550 
551  bitmap->SetImageScale( bitmap->GetImageScale() * std::min( widthRatio, heightRatio ) );
552  break;
553  }
554 
555  case SCH_SHEET_T:
556  {
557  SCH_SHEET* sheet = (SCH_SHEET*) item;
558  VECTOR2I topLeft = m_editPoints->Point( RECT_TOPLEFT ).GetPosition();
559  VECTOR2I topRight = m_editPoints->Point( RECT_TOPRIGHT ).GetPosition();
560  VECTOR2I botLeft = m_editPoints->Point( RECT_BOTLEFT ).GetPosition();
561  VECTOR2I botRight = m_editPoints->Point( RECT_BOTRIGHT ).GetPosition();
562 
563  // The grid size used to place connected items. because a sheet contains
564  // connected items (sheet pins), keep corners coordinates on this grid.
565  // Otherwise, some sheet pins can be moved off grid
566  int grid_size = Mils2iu( 50 );
567  int edited = getEditedPointIndex();
568 
570  sheet->GetMinWidth( edited == RECT_TOPRIGHT || edited == RECT_BOTRIGHT ),
571  sheet->GetMinHeight( edited == RECT_BOTLEFT || edited == RECT_BOTRIGHT ),
572  topLeft, topRight, botLeft, botRight, grid_size );
573 
574  // Pin positions are relative to origin. Attempt to leave them where they
575  // are if the origin moves.
576  wxPoint originDelta = sheet->GetPosition() - (wxPoint) topLeft;
577 
578  sheet->SetPosition( (wxPoint) topLeft );
579  sheet->SetSize( wxSize( botRight.x - topLeft.x, botRight.y - topLeft.y ) );
580 
581  // Update the fields if we're in autoplace mode
583  sheet->AutoplaceFields( /* aScreen */ nullptr, /* aManual */ false );
584 
585  // Keep sheet pins attached to edges:
586  for( SCH_SHEET_PIN* pin : sheet->GetPins() )
587  {
588  wxPoint pos = pin->GetPosition();
589 
590  pos += originDelta;
591 
592  switch( pin->GetEdge() )
593  {
594  case SHEET_SIDE::LEFT: pos.x = topLeft.x; break;
595  case SHEET_SIDE::RIGHT: pos.x = topRight.x; break;
596  case SHEET_SIDE::TOP: pos.y = topLeft.y; break;
597  case SHEET_SIDE::BOTTOM: pos.y = botLeft.y; break;
598  case SHEET_SIDE::UNDEFINED: break;
599  }
600 
601  pin->SetPosition( pos );
602  }
603 
604  break;
605  }
606 
607  case SCH_LINE_T:
608  {
609  SCH_LINE* line = (SCH_LINE*) item;
610 
611  line->SetStartPoint( (wxPoint) m_editPoints->Point( LINE_START ).GetPosition() );
612  line->SetEndPoint( (wxPoint) m_editPoints->Point( LINE_END ).GetPosition() );
613 
614  std::pair<EDA_ITEM*, int> connected = m_editPoints->Point( LINE_START ).GetConnected();
615 
616  if( connected.first )
617  {
618  if( connected.second == STARTPOINT )
619  static_cast<SCH_LINE*>( connected.first )->SetStartPoint( line->GetPosition() );
620  else if( connected.second == ENDPOINT )
621  static_cast<SCH_LINE*>( connected.first )->SetEndPoint( line->GetPosition() );
622 
623  getView()->Update( connected.first, KIGFX::GEOMETRY );
624  }
625 
626  connected = m_editPoints->Point( LINE_END ).GetConnected();
627 
628  if( connected.first )
629  {
630  if( connected.second == STARTPOINT )
631  static_cast<SCH_LINE*>( connected.first )->SetStartPoint( line->GetEndPoint() );
632  else if( connected.second == ENDPOINT )
633  static_cast<SCH_LINE*>( connected.first )->SetEndPoint( line->GetEndPoint() );
634 
635  getView()->Update( connected.first, KIGFX::GEOMETRY );
636  }
637 
638  break;
639  }
640 
641  default:
642  break;
643  }
644 
645  updateItem( item, true );
646  m_frame->SetMsgPanel( item );
647 }
#define STARTPOINT
When a line is selected, these flags indicate which.
int GetMinWidth(bool aFromLeft) const
Return the minimum width of the sheet based on the widths of the sheet pin text.
Definition: sch_sheet.cpp:403
int GetMinHeight(bool aFromTop) const
Return the minimum height that the sheet can be resized based on the sheet pin positions.
Definition: sch_sheet.cpp:437
#define ENDPOINT
ends. (Used to support dragging.)
FIELDS_AUTOPLACED GetFieldsAutoplaced() const
Return whether the fields have been automatically placed.
Definition: sch_item.h:429
void SetEndPoint(const wxPoint &aPosition)
Definition: sch_line.h:94
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, according to constraints and the moved corner.
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:91
void SetImageScale(double aScale)
Definition: sch_bitmap.h:71
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet_pin.h:65
void AddPoint(const wxPoint &aPoint)
static VECTOR2D mapCoords(const wxPoint &aCoord)
wxPoint GetPosition() const override
Definition: sch_sheet.h:380
Object to handle a bitmap image that can be inserted in a schematic.
Definition: sch_bitmap.h:40
void CalcEdit(const wxPoint &aPosition) override
Calculate the attributes of an item at aPosition when it is being edited.
Definition: lib_arc.cpp:427
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition: tool_base.cpp:36
void updateItem(EDA_ITEM *aItem, bool aUpdateRTree) const
Similar to getView()->Update(), but handles items that are redrawn by their parents and updating the ...
Definition: ee_tool_base.h:103
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:54
void SetSize(const wxSize &aSize)
Definition: sch_sheet.h:106
std::vector< SCH_SHEET_PIN * > & GetPins()
Definition: sch_sheet.h:184
void ClearPoints()
Definition: lib_polyline.h:50
void SetEnd(const wxPoint &aEnd)
Definition: lib_rectangle.h:81
std::shared_ptr< EDIT_POINTS > m_editPoints
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:217
void SetPosition(const wxPoint &aPosition) override
Definition: sch_sheet.cpp:801
double GetImageScale() const
Definition: sch_bitmap.h:66
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100
void SetPosition(const wxPoint &aPosition) override
Definition: lib_item.h:225
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
Definition: sch_sheet.cpp:521
void SetEnd(const wxPoint &aPosition)
Definition: lib_circle.h:68
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
Definition: view.cpp:1518
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113
Position or shape has changed.
Definition: view_item.h:54
void SetEditState(int aState)
Definition: lib_arc.h:65
wxPoint GetEndPoint() const
Definition: sch_line.h:93

References LIB_POLYLINE::AddPoint(), ARC_CENTER, ARC_END, ARC_START, SCH_SHEET::AutoplaceFields(), BOTTOM, 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_SHEET::GetPosition(), SCH_BITMAP::GetSize(), TOOL_BASE::getView(), LEFT, 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(), pin, pinEditedCorner(), RECT_BOTLEFT, RECT_BOTRIGHT, RECT_TOPLEFT, RECT_TOPRIGHT, RIGHT, 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(), STARTPOINT, TOP, EDA_ITEM::Type(), UNDEFINED, KIGFX::VIEW::Update(), EE_TOOL_BASE< SCH_BASE_FRAME >::updateItem(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by Main().

◆ updatePoints()

void EE_POINT_EDITOR::updatePoints ( )
private

Update which point is being edited.

Definition at line 650 of file ee_point_editor.cpp.

651 {
652  if( !m_editPoints )
653  return;
654 
655  EDA_ITEM* item = m_editPoints->GetParent();
656 
657  if( !item )
658  return;
659 
660  switch( item->Type() )
661  {
662  case LIB_ARC_T:
663  {
664  LIB_ARC* arc = (LIB_ARC*) item;
665 
666  m_editPoints->Point( ARC_CENTER ).SetPosition( mapCoords( arc->GetPosition() ) );
667  m_editPoints->Point( ARC_START ).SetPosition( mapCoords( arc->GetStart() ) );
668  m_editPoints->Point( ARC_END ).SetPosition( mapCoords( arc->GetEnd() ) );
669  break;
670  }
671 
672  case LIB_CIRCLE_T:
673  {
674  LIB_CIRCLE* circle = (LIB_CIRCLE*) item;
675 
676  m_editPoints->Point( CIRC_CENTER ).SetPosition( mapCoords( circle->GetPosition() ) );
677  m_editPoints->Point( CIRC_END ).SetPosition( mapCoords( circle->GetEnd() ) );
678  break;
679  }
680 
681  case LIB_POLYLINE_T:
682  {
683  LIB_POLYLINE* lines = (LIB_POLYLINE*) item;
684  const std::vector<wxPoint>& pts = lines->GetPolyPoints();
685 
686  if( m_editPoints->PointsSize() != (unsigned) pts.size() )
687  {
688  getView()->Remove( m_editPoints.get() );
689  m_editedPoint = nullptr;
691  getView()->Add(m_editPoints.get() );
692  }
693  else
694  {
695  for( unsigned i = 0; i < pts.size(); i++ )
696  m_editPoints->Point( i ).SetPosition( mapCoords( pts[i] ) );
697  }
698 
699  break;
700  }
701 
702  case LIB_RECTANGLE_T:
703  {
704  LIB_RECTANGLE* rect = (LIB_RECTANGLE*) item;
705  // point editor works only with rectangles having width and height > 0
706  // Some symbols can have rectangles with width or height < 0
707  // So normalize the size:
708  BOX2I dummy;
709  dummy.SetOrigin( mapCoords( rect->GetPosition() ) );
710  dummy.SetEnd( mapCoords( rect->GetEnd() ) );
711  dummy.Normalize();
712  VECTOR2I topLeft = dummy.GetPosition();
713  VECTOR2I botRight = dummy.GetEnd();
714 
715  m_editPoints->Point( RECT_TOPLEFT ).SetPosition( topLeft );
716  m_editPoints->Point( RECT_TOPRIGHT ).SetPosition( VECTOR2I( botRight.x, topLeft.y ) );
717  m_editPoints->Point( RECT_BOTLEFT ).SetPosition( VECTOR2I( topLeft.x, botRight.y ) );
718  m_editPoints->Point( RECT_BOTRIGHT ).SetPosition( botRight );
719  break;
720  }
721 
722  case SCH_BITMAP_T:
723  {
724  SCH_BITMAP* bitmap = (SCH_BITMAP*) item;
725  wxPoint topLeft = bitmap->GetPosition() - bitmap->GetSize() / 2;
726  wxPoint botRight = bitmap->GetPosition() + bitmap->GetSize() / 2;
727 
728  m_editPoints->Point( RECT_TOPLEFT ).SetPosition( topLeft );
729  m_editPoints->Point( RECT_TOPRIGHT ).SetPosition( botRight.x, topLeft.y );
730  m_editPoints->Point( RECT_BOTLEFT ).SetPosition( topLeft.x, botRight.y );
731  m_editPoints->Point( RECT_BOTRIGHT ).SetPosition( botRight );
732  break;
733  }
734 
735  case SCH_SHEET_T:
736  {
737  SCH_SHEET* sheet = (SCH_SHEET*) item;
738  wxPoint topLeft = sheet->GetPosition();
739  wxPoint botRight = sheet->GetPosition() + sheet->GetSize();
740 
741  m_editPoints->Point( RECT_TOPLEFT ).SetPosition( topLeft );
742  m_editPoints->Point( RECT_TOPRIGHT ).SetPosition( botRight.x, topLeft.y );
743  m_editPoints->Point( RECT_BOTLEFT ).SetPosition( topLeft.x, botRight.y );
744  m_editPoints->Point( RECT_BOTRIGHT ).SetPosition( botRight );
745  break;
746  }
747 
748  case SCH_LINE_T:
749  {
750  SCH_LINE* line = (SCH_LINE*) item;
751 
752  m_editPoints->Point( LINE_START ).SetPosition( line->GetStartPoint() );
753  m_editPoints->Point( LINE_END ).SetPosition( line->GetEndPoint() );
754  break;
755  }
756 
757  default:
758  break;
759  }
760 
761  getView()->Update( m_editPoints.get() );
762 }
wxPoint GetStartPoint() const
Definition: sch_line.h:90
wxPoint GetEnd() const
Definition: lib_rectangle.h:82
virtual void Remove(VIEW_ITEM *aItem)
Remove a VIEW_ITEM from the view.
Definition: view.cpp:353
wxPoint GetPosition() const override
Definition: lib_circle.h:66
EDIT_POINT * m_editedPoint
< Currently edited point, NULL if there is none.
virtual wxPoint GetPosition() const
Definition: eda_item.h:252
wxPoint GetPosition() const override
Definition: sch_bitmap.h:136
VECTOR2< int > VECTOR2I
Definition: vector2d.h:623
const std::vector< wxPoint > & GetPolyPoints() const
Definition: lib_polyline.h:54
static LIB_SYMBOL * dummy()
Used to draw a dummy shape when a LIB_SYMBOL is not found in library.
Definition: sch_symbol.cpp:72
wxPoint GetEnd() const
Definition: lib_circle.h:69
wxSize GetSize() const
Definition: sch_bitmap.cpp:125
wxPoint GetStart() const
Definition: lib_arc.h:92
static VECTOR2D mapCoords(const wxPoint &aCoord)
wxPoint GetPosition() const override
Definition: sch_sheet.h:380
Object to handle a bitmap image that can be inserted in a schematic.
Definition: sch_bitmap.h:40
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition: tool_base.cpp:36
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:54
std::shared_ptr< EDIT_POINTS > m_editPoints
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:37
wxSize GetSize() const
Definition: sch_sheet.h:105
wxPoint GetEnd() const
Definition: lib_arc.h:95
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
Definition: view.cpp:323
static std::shared_ptr< EDIT_POINTS > Make(EDA_ITEM *aItem, SCH_BASE_FRAME *frame)
wxPoint GetPosition() const override
Definition: lib_rectangle.h:69
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
Definition: view.cpp:1518
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113
wxPoint GetPosition() const override
Definition: lib_arc.h:71
wxPoint GetEndPoint() const
Definition: sch_line.h:93

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

◆ Wait()

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

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

No parameters means waiting for any event.

Definition at line 57 of file tool_interactive.cpp.

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

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

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

Member Data Documentation

◆ m_editedPoint

EDIT_POINT* EE_POINT_EDITOR::m_editedPoint
private

< Currently edited point, NULL if there is none.

Currently available edit points.

Definition at line 103 of file ee_point_editor.h.

Referenced by addCornerCondition(), getEditedPointIndex(), HasPoint(), isModified(), Main(), removeCorner(), removeCornerCondition(), setEditedPoint(), updateEditedPoint(), and updatePoints().

◆ m_editPoints

◆ m_frame

SCH_BASE_FRAME * EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame
protectedinherited

Definition at line 175 of file ee_tool_base.h.

◆ m_isSymbolEditor

bool EE_TOOL_BASE< SCH_BASE_FRAME >::m_isSymbolEditor
protectedinherited

Definition at line 178 of file ee_tool_base.h.

◆ m_menu

TOOL_MENU TOOL_INTERACTIVE::m_menu
protectedinherited

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

Definition at line 125 of file tool_interactive.h.

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

◆ m_selectionTool

EE_SELECTION_TOOL* EE_TOOL_BASE< SCH_BASE_FRAME >::m_selectionTool
protectedinherited

Definition at line 177 of file ee_tool_base.h.

◆ m_toolId

TOOL_ID TOOL_BASE::m_toolId
protectedinherited

Name of the tool.

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

Definition at line 209 of file tool_base.h.

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

◆ m_toolMgr

TOOL_MANAGER* TOOL_BASE::m_toolMgr
protectedinherited

Definition at line 214 of file tool_base.h.

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

◆ m_toolName

std::string TOOL_BASE::m_toolName
protectedinherited

Definition at line 213 of file tool_base.h.

Referenced by TOOL_BASE::GetName().

◆ m_type

TOOL_TYPE TOOL_BASE::m_type
protectedinherited

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

Definition at line 206 of file tool_base.h.

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

◆ m_view

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

Definition at line 176 of file ee_tool_base.h.


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