27 #ifndef PCB_POINT_EDITOR_H 28 #define PCB_POINT_EDITOR_H 99 for(
unsigned i = 0; i <
m_editPoints->PointsSize(); ++i )
int removeCorner(const TOOL_EVENT &aEvent)
void editArcEndpointKeepTangent(PCB_SHAPE *aArc, const VECTOR2I &aCenter, const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd, const VECTOR2I &aCursor) const
Move an end point of the arc, while keeping the tangent at the other endpoint.
void editArcMidKeepEndpoints(PCB_SHAPE *aArc, const VECTOR2I &aStart, const VECTOR2I &aEnd, const VECTOR2I &aCursor) const
Move the mid point of the arc, while keeping the two endpoints.
void setTransitions() override
< Set up handlers for various events.
EDIT_POINT get45DegConstrainer() const
Condition to display "Create corner" context menu entry.
void updatePoints()
Update which point is being edited.
void updateEditedPoint(const TOOL_EVENT &aEvent)
Set the current point being edited. NULL means none.
int addCorner(const TOOL_EVENT &aEvent)
TOOL_ACTION handlers.
bool removeCornerCondition(const SELECTION &aSelection)
void buildForPolyOutline(std::shared_ptr< EDIT_POINTS > points, const SHAPE_POLY_SET *aOutline)
void setEditedPoint(EDIT_POINT *aPoint)
std::unique_ptr< STATUS_TEXT_POPUP > m_statusPopup
std::shared_ptr< EDIT_POINTS > m_editPoints
int modifiedSelection(const TOOL_EVENT &aEvent)
bool HasPoint()
Indicate the cursor is over an edit point.
EDIT_POINT * m_editedPoint
EDIT_POINT m_altConstrainer
std::shared_ptr< EDIT_POINTS > makePoints(EDA_ITEM *aItem)
Update item's points with edit points.
int getEditedPointIndex() const
Return true if aPoint is the currently modified point.
static bool canAddCorner(const EDA_ITEM &aItem)
Condition to display "Remove corner" context menu entry.
void editArcEndpointKeepCenter(PCB_SHAPE *aArc, const VECTOR2I &aCenter, const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd, const VECTOR2I &aCursor) const
Move an end point of the arc around the circumference.
int OnSelectionChange(const TOOL_EVENT &aEvent)
Change selection event handler.
PCB_SELECTION_TOOL * m_selectionTool
Represent a set of closed polygons.
void setAltConstraint(bool aEnabled)
Return a point that should be used as a constrainer for 45 degrees mode.
int changeEditMethod(const TOOL_EVENT &aEvent)
std::shared_ptr< EDIT_CONSTRAINT< EDIT_POINT > > m_altConstraint
EDIT_POINT m_original
Original position for the current drag point.
bool Init() override
Init() is called once upon a registration of the tool.
Tool that displays edit points allowing to modify items by dragging the points.
void editArcMidKeepCenter(PCB_SHAPE *aArc, const VECTOR2I &aCenter, const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd, const VECTOR2I &aCursor) const
Move the mid point of the arc, while keeping the angle.
A base class for most all the KiCad significant classes used in schematics and boards.
bool isModified(const EDIT_POINT &aPoint) const
Set up an alternative constraint (typically enabled upon a modifier key being pressed).
void Reset(RESET_REASON aReason) override
Bring the tool to a known, initial state.
static bool addCornerCondition(const SELECTION &aSelection)
Determine if the tool can currently add a corner to the given item.
EDIT_POINT * m_hoveredPoint
Represent a single point that can be used for modifying items.
bool validatePolygon(SHAPE_POLY_SET &aModified) const
Validate a polygon and displays a popup warning if invalid.
void updateItem() const
Apply the last changes to the edited item.