|
KiCad PCB EDA Suite
|
Public Member Functions | |
| SHAPE_GROUP_POINT_EDIT_BEHAVIOR (PCB_GROUP &aGroup) | |
| SHAPE_GROUP_POINT_EDIT_BEHAVIOR (std::vector< PCB_SHAPE * > aShapes, BOARD_ITEM *aParent) | |
| void | MakePoints (EDIT_POINTS &aPoints) override |
| Construct the initial set of edit points for the item and append to the given list. | |
| bool | 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. | |
| BOARD_ITEM * | GetParent () const |
| virtual void | FinalizeItem (EDIT_POINTS &aPoints, COMMIT &aCommit) |
| Finalize the edit operation. | |
| virtual OPT_VECTOR2I | Get45DegreeConstrainer (const EDIT_POINT &aEditedPoint, EDIT_POINTS &aPoints) const |
| Get the 45-degree constrainer for the item, when the given point is moved. | |
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 Member Functions | |
| BOX2I | getBoundingBox () const |
Private Attributes | |
| PCB_GROUP * | m_group |
| std::vector< PCB_SHAPE * > | m_shapes |
| BOARD_ITEM * | m_parent |
| std::unordered_map< PCB_SHAPE *, double > | m_originalWidths |
Definition at line 1647 of file pcb_point_editor.cpp.
|
inline |
Definition at line 1650 of file pcb_point_editor.cpp.
References PCB_GROUP::GetBoardItems(), m_group, and m_parent.
|
inline |
Definition at line 1665 of file pcb_point_editor.cpp.
References m_group, m_originalWidths, m_parent, m_shapes, and move.
|
inlinevirtualinherited |
Finalize the edit operation.
(optional)
This is called once, after the user has finished editing a point (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.
|
inlinevirtualinherited |
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 in ALIGNED_DIMENSION_POINT_EDIT_BEHAVIOR, DIM_CENTER_POINT_EDIT_BEHAVIOR, DIM_RADIAL_POINT_EDIT_BEHAVIOR, EDA_ARC_POINT_EDIT_BEHAVIOR, EDA_CIRCLE_POINT_EDIT_BEHAVIOR, and EDA_SEGMENT_POINT_EDIT_BEHAVIOR.
Definition at line 108 of file point_editor_behavior.h.
|
inlineprivate |
Definition at line 1774 of file pcb_point_editor.cpp.
References m_shapes, and BOX2< Vec >::Merge().
|
inline |
Definition at line 1771 of file pcb_point_editor.cpp.
References m_parent.
|
inlinestaticprotectedinherited |
Checks if two points are the same instance - which means the point is being edited.
Definition at line 119 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().
|
inlineoverridevirtual |
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 1674 of file pcb_point_editor.cpp.
References EDIT_POINTS::AddIndicatorLine(), EDIT_POINTS::AddPoint(), BOX2< Vec >::Centre(), getBoundingBox(), BOX2< Vec >::GetEnd(), BOX2< Vec >::GetOrigin(), EDIT_POINTS::Point(), RECT_BOT_LEFT, RECT_BOT_RIGHT, RECT_TOP_LEFT, RECT_TOP_RIGHT, VECTOR2< T >::x, and VECTOR2< T >::y.
|
inlineoverridevirtual |
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 1706 of file pcb_point_editor.cpp.
References BOX2< Vec >::Centre(), delta, getBoundingBox(), BOX2< Vec >::GetHeight(), EDIT_POINT::GetPosition(), BOX2< Vec >::GetWidth(), POINT_EDIT_BEHAVIOR::isModified(), KiROUND(), m_group, m_originalWidths, m_shapes, COMMIT::Modify(), RECTANGLE_POINT_EDIT_BEHAVIOR::PinEditedCorner(), EDIT_POINTS::Point(), RECT_BOT_LEFT, RECT_BOT_RIGHT, RECT_CENTER, RECT_TOP_LEFT, RECT_TOP_RIGHT, RECURSE, scale, UpdatePoints(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
inlineoverridevirtual |
Update the list of the edit points for the item.
Be very careful not to overrun the list of points - this class knows how big they 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).
If the behavior itself must change (for instance, a rectangle is non-cardinallly rotated to a polygon), the method should return false.
| aPoints | The list of edit points to update. |
Implements POINT_EDIT_BEHAVIOR.
Definition at line 1692 of file pcb_point_editor.cpp.
References BOX2< Vec >::Centre(), getBoundingBox(), BOX2< Vec >::GetEnd(), BOX2< Vec >::GetOrigin(), EDIT_POINTS::Point(), RECT_BOT_LEFT, RECT_BOT_RIGHT, RECT_CENTER, RECT_TOP_LEFT, RECT_TOP_RIGHT, EDIT_POINT::SetPosition(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by UpdateItem().
|
private |
Definition at line 1785 of file pcb_point_editor.cpp.
Referenced by SHAPE_GROUP_POINT_EDIT_BEHAVIOR(), SHAPE_GROUP_POINT_EDIT_BEHAVIOR(), and UpdateItem().
|
private |
Definition at line 1788 of file pcb_point_editor.cpp.
Referenced by SHAPE_GROUP_POINT_EDIT_BEHAVIOR(), and UpdateItem().
|
private |
Definition at line 1787 of file pcb_point_editor.cpp.
Referenced by GetParent(), SHAPE_GROUP_POINT_EDIT_BEHAVIOR(), and SHAPE_GROUP_POINT_EDIT_BEHAVIOR().
|
private |
Definition at line 1786 of file pcb_point_editor.cpp.
Referenced by getBoundingBox(), SHAPE_GROUP_POINT_EDIT_BEHAVIOR(), and UpdateItem().