KiCad PCB EDA Suite
|
This covers both aligned and the orthogonal sub-type. More...
Public Member Functions | |
ALIGNED_DIMENSION_POINT_EDIT_BEHAVIOR (PCB_DIM_ALIGNED &aDimension) | |
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. | |
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 | |
void | updateAlignedDimension (const EDIT_POINT &aEditedPoint, EDIT_POINTS &aPoints) |
Update non-orthogonal dimension points. | |
void | updateOrthogonalDimension (const EDIT_POINT &aEditedPoint, EDIT_POINTS &aPoints) |
Update orthogonal dimension points. | |
Private Attributes | |
PCB_DIM_ALIGNED & | m_dimension |
This covers both aligned and the orthogonal sub-type.
Definition at line 1369 of file pcb_point_editor.cpp.
|
inline |
Definition at line 1372 of file pcb_point_editor.cpp.
|
inlineoverridevirtual |
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 1421 of file pcb_point_editor.cpp.
References DIM_END, DIM_START, EDIT_POINT::GetPosition(), POINT_EDIT_BEHAVIOR::isModified(), and EDIT_POINTS::Point().
|
inlinestaticprotectedinherited |
Checks if two points are the same instance - which means the point is being edited.
Definition at line 107 of file point_editor_behavior.h.
Referenced by Get45DegreeConstrainer(), DIM_CENTER_POINT_EDIT_BEHAVIOR::Get45DegreeConstrainer(), DIM_RADIAL_POINT_EDIT_BEHAVIOR::Get45DegreeConstrainer(), RECTANGLE_POINT_EDIT_BEHAVIOR::PinEditedCorner(), updateAlignedDimension(), ARC_POINT_EDIT_BEHAVIOR::UpdateItem(), BITMAP_POINT_EDIT_BEHAVIOR::UpdateItem(), SCH_TABLECELL_POINT_EDIT_BEHAVIOR::UpdateItem(), SHEET_POINT_EDIT_BEHAVIOR::UpdateItem(), EDA_SEGMENT_POINT_EDIT_BEHAVIOR::UpdateItem(), EDA_CIRCLE_POINT_EDIT_BEHAVIOR::UpdateItem(), EDA_BEZIER_POINT_EDIT_BEHAVIOR::UpdateItem(), REFERENCE_IMAGE_POINT_EDIT_BEHAVIOR::UpdateItem(), PCB_TABLECELL_POINT_EDIT_BEHAVIOR::UpdateItem(), PAD_POINT_EDIT_BEHAVIOR::UpdateItem(), DIM_CENTER_POINT_EDIT_BEHAVIOR::UpdateItem(), DIM_RADIAL_POINT_EDIT_BEHAVIOR::UpdateItem(), DIM_LEADER_POINT_EDIT_BEHAVIOR::UpdateItem(), RECTANGLE_POINT_EDIT_BEHAVIOR::UpdateItem(), 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 1376 of file pcb_point_editor.cpp.
References EDIT_POINTS::AddPoint(), ALL_LAYERS, DIM_CROSSBAREND, DIM_CROSSBARSTART, DIM_END, DIM_START, PCB_DIM_ALIGNED::GetCrossbarEnd(), PCB_DIM_ALIGNED::GetCrossbarStart(), PCB_DIMENSION_BASE::GetEnd(), PCB_DIMENSION_BASE::GetStart(), EDA_TEXT::GetTextPos(), m_dimension, PCB_DIM_ALIGNED_T, EDIT_POINTS::Point(), EDIT_POINT::SetConstraint(), EDIT_POINT::SetSnapConstraint(), and EDA_ITEM::Type().
|
inlineprivate |
Update non-orthogonal dimension points.
Definition at line 1439 of file pcb_point_editor.cpp.
References VECTOR2< T >::Cross(), DIM_CROSSBAREND, DIM_CROSSBARSTART, DIM_END, DIM_START, DIM_TEXT, VECTOR2< T >::EuclideanNorm(), PCB_DIMENSION_BASE::GetEnd(), EDIT_POINT::GetPosition(), PCB_DIMENSION_BASE::GetStart(), POINT_EDIT_BEHAVIOR::isModified(), m_dimension, EDIT_POINTS::Point(), EDIT_POINT::SetConstraint(), PCB_DIMENSION_BASE::SetEnd(), PCB_DIM_ALIGNED::SetHeight(), PCB_DIMENSION_BASE::SetStart(), EDA_TEXT::SetTextPos(), PCB_DIMENSION_BASE::SetTextPositionMode(), PCB_DIMENSION_BASE::Update(), and DIM_ALIGNED_TEXT_UPDATER::UpdateTextAfterChange().
Referenced by UpdateItem().
|
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 1410 of file pcb_point_editor.cpp.
References CHECK_POINT_COUNT, DIM_ALIGNED_MAX, m_dimension, PCB_DIM_ALIGNED_T, EDA_ITEM::Type(), updateAlignedDimension(), and updateOrthogonalDimension().
|
inlineprivate |
Update orthogonal dimension points.
Definition at line 1506 of file pcb_point_editor.cpp.
References std::abs(), BOX2< Vec >::Contains(), DIM_CROSSBAREND, DIM_CROSSBARSTART, DIM_END, DIM_START, DIM_TEXT, BOX2< Vec >::GetBottom(), PCB_DIMENSION_BASE::GetEnd(), BOX2< Vec >::GetHeight(), BOX2< Vec >::GetLeft(), PCB_DIM_ORTHOGONAL::GetOrientation(), EDIT_POINT::GetPosition(), BOX2< Vec >::GetRight(), PCB_DIMENSION_BASE::GetStart(), BOX2< Vec >::GetTop(), BOX2< Vec >::GetWidth(), PCB_DIM_ORTHOGONAL::HORIZONTAL, POINT_EDIT_BEHAVIOR::isModified(), m_dimension, EDIT_POINTS::Point(), PCB_DIMENSION_BASE::SetEnd(), PCB_DIM_ALIGNED::SetHeight(), PCB_DIM_ORTHOGONAL::SetOrientation(), PCB_DIMENSION_BASE::SetStart(), EDA_TEXT::SetTextPos(), PCB_DIMENSION_BASE::SetTextPositionMode(), PCB_DIMENSION_BASE::Update(), DIM_ALIGNED_TEXT_UPDATER::UpdateTextAfterChange(), PCB_DIM_ORTHOGONAL::VERTICAL, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by UpdateItem().
|
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 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 1399 of file pcb_point_editor.cpp.
References CHECK_POINT_COUNT, DIM_ALIGNED_MAX, DIM_CROSSBAREND, DIM_CROSSBARSTART, DIM_END, DIM_START, DIM_TEXT, PCB_DIM_ALIGNED::GetCrossbarEnd(), PCB_DIM_ALIGNED::GetCrossbarStart(), PCB_DIMENSION_BASE::GetEnd(), PCB_DIMENSION_BASE::GetStart(), EDA_TEXT::GetTextPos(), m_dimension, EDIT_POINTS::Point(), and EDIT_POINT::SetPosition().
|
private |
Definition at line 1573 of file pcb_point_editor.cpp.
Referenced by MakePoints(), updateAlignedDimension(), UpdateItem(), updateOrthogonalDimension(), and UpdatePoints().