23#ifndef PCB_POINT_EDITOR_H
24#define PCB_POINT_EDITOR_H
36#include <unordered_set>
160 for(
unsigned i = 0; i <
m_editPoints->PointsSize(); ++i )
ARC_EDIT_MODE
Settings for arc editing.
The block drag gesture, with the state it holds while it runs.
A base class for most all the KiCad significant classes used in schematics and boards.
Represent a line connecting two EDIT_POINTs.
EDIT_POINTS is a VIEW_ITEM that manages EDIT_POINTs and EDIT_LINEs and draws them.
Represent a single point that can be used for modifying items.
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
friend class BLOCK_DRAG_SESSION
int changeArcEditMode(const TOOL_EVENT &aEvent)
Change the edit method for arcs.
void updateBlockHandlePoints()
Move those handles back onto their items after the geometry changed.
bool CanRemoveCorner(const SELECTION &aSelection)
Condition to display "Remove Corner" context menu entry.
void updateItem(BOARD_COMMIT &aCommit)
Update item's points with edit points.
void setPickedHandles(std::set< PCB_HANDLE_KEY > aPicked)
Replace the picked set and repaint the handles to match it.
VECTOR2I m_stickyDisplacement
void updateBlockHandleHover(const VECTOR2I &aPosition)
Highlight the handle under the cursor, if there is one.
int OnSelectionChange(const TOOL_EVENT &aEvent)
Change selection event handler.
void applyPickedFlags()
Paint the picked handles, dropping keys whose handle has gone.
void setAltConstraint(bool aEnabled)
Set up an alternative constraint (typically enabled upon a modifier key being pressed).
static const unsigned int COORDS_PADDING
bool HasBlockHandle() const
True when the cursor sits on a handle the user can pick.
EDIT_POINT * m_hoveredPoint
bool blockAnchorEditingEnabled() const
Whether the user has turned on anchor point handles for multi-selections.
int addCorner(const TOOL_EVENT &aEvent)
EDIT_POINTS * m_blockHoveredOwner
bool HasPoint()
Indicate the cursor is over an edit point.
EDIT_POINT m_original
Original pos for the current drag point.
bool HasBlockHandles() const
True while handles are shown for the members of a multi-selection or group.
static bool CanChamferCorner(const EDA_ITEM &aItem)
Check if a corner of the given item can be chamfered (zones, polys only).
EDIT_POINT get45DegConstrainer() const
Return a point that should be used as a constrainer for 45 degrees mode.
int modifiedSelection(const TOOL_EVENT &aEvent)
EDIT_POINT * m_blockHoveredPoint
std::unique_ptr< POINT_EDIT_BEHAVIOR > makeBehavior(EDA_ITEM *aItem, bool &aRejected)
Create the point edit behavior for an item.
void clearPickedHandles()
Unpick everything and redraw.
std::unique_ptr< POINT_EDIT_BEHAVIOR > m_editorBehavior
int removeCorner(const TOOL_EVENT &aEvent)
bool Init() override
Init() is called once upon a registration of the tool.
std::shared_ptr< BOARD_CONSTRAINT_DRAG_SESSION > m_constraintDragSession
std::unique_ptr< EDIT_RELATION > m_altConstraint
RECT_RADIUS_TEXT_ITEM * m_radiusHelper
std::set< PCB_HANDLE_KEY > m_pickedHandles
int bboxHandleInflation() const
Gap to leave between the scaling box handles and the shapes' own handles, in board units for the curr...
std::vector< BLOCK_HANDLE_ENTRY > m_blockHandles
int movePoint(const TOOL_EVENT &aEvent)
TOOL_ACTION handlers.
static bool CanAddCorner(const EDA_ITEM &aItem)
Check if a corner can be added to the given item (zones, polys, segments, arcs).
void setEditedPoint(EDIT_POINT *aPoint)
Set the current point being edited. NULL means none.
bool pickHandleAt(const VECTOR2I &aPosition, bool aAccumulate)
Pick the handle under aPosition. Returns false when there is no handle to pick.
EDIT_POINT m_altConstrainer
bool isModified(const EDIT_POINT &aPoint) const
Return true if aPoint is the currently modified point.
std::vector< EDIT_POINTS * > pickableCollections()
The handle collections the user can pick from.
ARC_EDIT_MODE m_arcEditMode
std::unique_ptr< KIGFX::PREVIEW::ANGLE_ITEM > m_angleItem
EDIT_POINT * m_editedPoint
void updateEditedPoint(const TOOL_EVENT &aEvent)
Update which point is being edited.
int getEditedPointIndex() const
void updatePoints()
Update edit points with item's points.
int chamferCorner(const TOOL_EVENT &aEvent)
void clearBlockHandles()
Take those handles off the view and throw them away.
std::vector< BOARD_ITEM * > m_expandedSelection
void setTransitions() override
Set up handlers for various events.
std::shared_ptr< EDIT_POINTS > m_editPoints
std::shared_ptr< EDIT_POINTS > makePoints(EDA_ITEM *aItem)
void buildBlockHandles(const PCB_SELECTION &aSelection)
Build the handles shown for every reshapeable item in a multi-selection or group.
std::function< void()> m_blockDragAbort
PCB_SELECTION_TOOL * m_selectionTool
A helper class interface to manage the edit points for a single item.
Represent a set of closed polygons.
The Cairo implementation of the graphics abstraction layer.
std::unique_ptr< POINT_EDIT_BEHAVIOR > behavior
std::shared_ptr< EDIT_POINTS > points
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
VECTOR2< int32_t > VECTOR2I