KiCad PCB EDA Suite
|
"Standard" arc editing behavior. More...
#include <point_editor_behavior.h>
Public Member Functions | |
EDA_ARC_POINT_EDIT_BEHAVIOR (EDA_SHAPE &aArc, const ARC_EDIT_MODE &aArcEditMode, KIGFX::VIEW_CONTROLS &aViewContols) | |
void | MakePoints (EDIT_POINTS &aPoints) override |
Construct the initial set of edit points for the item and append to the given list. | |
void | UpdatePoints (EDIT_POINTS &aPoints) override |
Update the list of the edit points for the item. | |
void | UpdateItem (const EDIT_POINT &aEditedPoint, EDIT_POINTS &aPoints, COMMIT &aCommit, std::vector< EDA_ITEM * > &aUpdatedItems) override |
Update the item with the new positions of the edit points. | |
OPT_VECTOR2I | Get45DegreeConstrainer (const EDIT_POINT &aEditedPoint, EDIT_POINTS &aPoints) const override |
Get the 45-degree constrainer for the item, when the given point is moved. | |
virtual void | FinalizeItem (EDIT_POINTS &aPoints, COMMIT &aCommit) |
Finalize the edit operation. | |
Static Protected Member Functions | |
static bool | isModified (const EDIT_POINT &aEditedPoint, const EDIT_POINT &aPoint) |
Checks if two points are the same instance - which means the point is being edited. | |
Private Types | |
enum | ARC_POINTS { ARC_START , ARC_MID , ARC_END , ARC_CENTER } |
Private Attributes | |
EDA_SHAPE & | m_arc |
const ARC_EDIT_MODE & | m_arcEditMode |
KIGFX::VIEW_CONTROLS & | m_viewControls |
"Standard" arc editing behavior.
Definition at line 360 of file point_editor_behavior.h.
|
private |
Enumerator | |
---|---|
ARC_START | |
ARC_MID | |
ARC_END | |
ARC_CENTER |
Definition at line 376 of file point_editor_behavior.h.
EDA_ARC_POINT_EDIT_BEHAVIOR::EDA_ARC_POINT_EDIT_BEHAVIOR | ( | EDA_SHAPE & | aArc, |
const ARC_EDIT_MODE & | aArcEditMode, | ||
KIGFX::VIEW_CONTROLS & | aViewContols ) |
Definition at line 589 of file point_editor_behavior.cpp.
References ARC, m_arc, m_arcEditMode, and m_viewControls.
|
inlinevirtualinherited |
Finalize the edit operation.
(optional)
This is called once, after the user has finished editing (e.g. released the mouse button).
aPoints | The final positions of the edit points. |
aCommit | The commit object to use to modify the item. |
Reimplemented in POLYGON_POINT_EDIT_BEHAVIOR.
Definition at line 81 of file point_editor_behavior.h.
|
overridevirtual |
Get the 45-degree constrainer for the item, when the given point is moved.
Return std::nullopt if not, and the caller can decide.
If you want to actively disable constraining, return the aEditedPoint position.
Reimplemented from POINT_EDIT_BEHAVIOR.
Definition at line 685 of file point_editor_behavior.cpp.
References ARC_CENTER, EDIT_POINT::GetPosition(), and EDIT_POINTS::Point().
|
inlinestaticprotectedinherited |
Checks if two points are the same instance - which means the point is being edited.
Definition at line 120 of file point_editor_behavior.h.
Referenced by ALIGNED_DIMENSION_POINT_EDIT_BEHAVIOR::Get45DegreeConstrainer(), DIM_CENTER_POINT_EDIT_BEHAVIOR::Get45DegreeConstrainer(), DIM_RADIAL_POINT_EDIT_BEHAVIOR::Get45DegreeConstrainer(), RECTANGLE_POINT_EDIT_BEHAVIOR::PinEditedCorner(), ALIGNED_DIMENSION_POINT_EDIT_BEHAVIOR::updateAlignedDimension(), BITMAP_POINT_EDIT_BEHAVIOR::UpdateItem(), DIM_CENTER_POINT_EDIT_BEHAVIOR::UpdateItem(), DIM_LEADER_POINT_EDIT_BEHAVIOR::UpdateItem(), DIM_RADIAL_POINT_EDIT_BEHAVIOR::UpdateItem(), EDA_ARC_POINT_EDIT_BEHAVIOR::UpdateItem(), EDA_BEZIER_POINT_EDIT_BEHAVIOR::UpdateItem(), EDA_CIRCLE_POINT_EDIT_BEHAVIOR::UpdateItem(), EDA_SEGMENT_POINT_EDIT_BEHAVIOR::UpdateItem(), PAD_POINT_EDIT_BEHAVIOR::UpdateItem(), PCB_TABLECELL_POINT_EDIT_BEHAVIOR::UpdateItem(), RECTANGLE_POINT_EDIT_BEHAVIOR::UpdateItem(), RECTANGLE_POINT_EDIT_BEHAVIOR::UpdateItem(), RECTANGLE_POINT_EDIT_BEHAVIOR::UpdateItem(), REFERENCE_IMAGE_POINT_EDIT_BEHAVIOR::UpdateItem(), SCH_TABLECELL_POINT_EDIT_BEHAVIOR::UpdateItem(), SHAPE_GROUP_POINT_EDIT_BEHAVIOR::UpdateItem(), SHEET_POINT_EDIT_BEHAVIOR::UpdateItem(), ALIGNED_DIMENSION_POINT_EDIT_BEHAVIOR::updateOrthogonalDimension(), and POLYGON_POINT_EDIT_BEHAVIOR::UpdateOutlineFromPoints().
|
overridevirtual |
Construct the initial set of edit points for the item and append to the given list.
aPoints | The list of edit points to fill. |
Implements POINT_EDIT_BEHAVIOR.
Definition at line 597 of file point_editor_behavior.cpp.
References EDIT_POINTS::AddIndicatorLine(), EDIT_POINTS::AddPoint(), ARC_CENTER, ARC_END, ARC_START, m_arc, and EDIT_POINTS::Point().
|
overridevirtual |
Update the item with the new positions of the edit points.
This method should all commit and add to the update list anything that is NOT the parent item of the EDIT_POINTs. For example, connected lines, parent tables, etc. The item itself is already handled (most behaviors don't need more than that).
aEditedPoint | The point that was dragged. You can use this to check by address which point to update. |
aPoints | The new positions of the edit points. |
aCommit | The commit object to use to modify the item. |
aUpdatedItems | The list of items that were updated by the edit (not only the item that was being edited, but also any other items that were affected, e.g. by being conneted to the edited item). |
Implements POINT_EDIT_BEHAVIOR.
Definition at line 620 of file point_editor_behavior.cpp.
References ARC_CENTER, ARC_END, ARC_MID, ARC_START, center, CHECK_POINT_COUNT, editArcCenterKeepEndpoints(), editArcEndpointKeepCenter(), editArcEndpointKeepCenterAndRadius(), editArcEndpointKeepTangent(), editArcMidKeepCenter(), editArcMidKeepEndpoints(), end, EDIT_POINT::GetPosition(), POINT_EDIT_BEHAVIOR::isModified(), KEEP_CENTER_ADJUST_ANGLE_RADIUS, KEEP_CENTER_ENDS_ADJUST_ANGLE, KEEP_ENDPOINTS_OR_START_DIRECTION, m_arc, m_arcEditMode, m_viewControls, and EDIT_POINTS::Point().
|
overridevirtual |
Update the list of the edit points for the item.
Be very careful not to overrun the list of points - this class knows how bug there are because it made them in the first place.
If item has changed such that that number of points needs to change, this method has to handle that (probably by clearing the list and refilling it).
aPoints | The list of edit points to update. |
Implements POINT_EDIT_BEHAVIOR.
Definition at line 609 of file point_editor_behavior.cpp.
References ARC_CENTER, ARC_END, ARC_MID, ARC_START, CHECK_POINT_COUNT, m_arc, EDIT_POINTS::Point(), and EDIT_POINT::SetPosition().
|
private |
Definition at line 384 of file point_editor_behavior.h.
Referenced by EDA_ARC_POINT_EDIT_BEHAVIOR(), MakePoints(), UpdateItem(), and UpdatePoints().
|
private |
Definition at line 386 of file point_editor_behavior.h.
Referenced by EDA_ARC_POINT_EDIT_BEHAVIOR(), and UpdateItem().
|
private |
Definition at line 387 of file point_editor_behavior.h.
Referenced by EDA_ARC_POINT_EDIT_BEHAVIOR(), and UpdateItem().