KiCad PCB EDA Suite
|
Public Member Functions | |
RECTANGLE_POINT_EDIT_BEHAVIOR (SCH_SHAPE &aRect, EDA_DRAW_FRAME &aFrame) | |
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. | |
RECTANGLE_POINT_EDIT_BEHAVIOR (PCB_SHAPE &aRectangle) | |
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. | |
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 Public Member Functions | |
static void | MakePoints (SCH_SHAPE &aRect, EDIT_POINTS &aPoints) |
static void | UpdatePoints (SCH_SHAPE &aRect, EDIT_POINTS &aPoints) |
static void | PinEditedCorner (const EDIT_POINT &aEditedPoint, const EDIT_POINTS &aPoints, int minWidth, int minHeight, VECTOR2I &topLeft, VECTOR2I &topRight, VECTOR2I &botLeft, VECTOR2I &botRight) |
Update the coordinates of 4 corners of a rectangle, according to constraints and the moved corner. | |
static void | UpdateItem (SCH_SHAPE &aRect, const EDIT_POINT &aEditedPoint, EDIT_POINTS &aPoints) |
static void | MakePoints (const PCB_SHAPE &aRectangle, EDIT_POINTS &aPoints) |
Standard rectangle points construction utility (other shapes may use this as well) | |
static void | UpdateItem (PCB_SHAPE &aRectangle, const EDIT_POINT &aEditedPoint, EDIT_POINTS &aPoints) |
static void | UpdatePoints (PCB_SHAPE &aRectangle, EDIT_POINTS &aPoints) |
static void | PinEditedCorner (const EDIT_POINT &aEditedPoint, const EDIT_POINTS &aEditPoints, VECTOR2I &aTopLeft, VECTOR2I &aTopRight, VECTOR2I &aBotLeft, VECTOR2I &aBotRight, const VECTOR2I &aHole={ 0, 0 }, const VECTOR2I &aHoleSize={ 0, 0 }) |
Update the coordinates of 4 corners of a rectangle, according to pad constraints and the moved corner. | |
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 | dragPinsOnEdge (const std::vector< SEG > &aOldEdges, const std::vector< VECTOR2I > &aMoveVecs, int aEdgeUnit, COMMIT &aCommit, std::vector< EDA_ITEM * > &aUpdatedItems) const |
Private Attributes | |
SCH_SHAPE & | m_rect |
EDA_DRAW_FRAME & | m_frame |
PCB_SHAPE & | m_rectangle |
Definition at line 433 of file ee_point_editor.cpp.
|
inline |
Definition at line 436 of file ee_point_editor.cpp.
|
inline |
Definition at line 111 of file pcb_point_editor.cpp.
References EDA_SHAPE::GetShape(), and m_rectangle.
|
inlineprivate |
Definition at line 671 of file ee_point_editor.cpp.
References editor, FRAME_SCH_SYMBOL_EDITOR, LIB_SYMBOL::GetPins(), EDA_BASE_FRAME::IsType(), m_frame, COMMIT::Modify(), and pin.
Referenced by UpdateItem().
|
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 EDA_SEGMENT_POINT_EDIT_BEHAVIOR, EDA_CIRCLE_POINT_EDIT_BEHAVIOR, ARC_POINT_EDIT_BEHAVIOR, ALIGNED_DIMENSION_POINT_EDIT_BEHAVIOR, DIM_CENTER_POINT_EDIT_BEHAVIOR, and DIM_RADIAL_POINT_EDIT_BEHAVIOR.
Definition at line 96 of file point_editor_behavior.h.
|
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 ALIGNED_DIMENSION_POINT_EDIT_BEHAVIOR::Get45DegreeConstrainer(), DIM_CENTER_POINT_EDIT_BEHAVIOR::Get45DegreeConstrainer(), DIM_RADIAL_POINT_EDIT_BEHAVIOR::Get45DegreeConstrainer(), PinEditedCorner(), ALIGNED_DIMENSION_POINT_EDIT_BEHAVIOR::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(), UpdateItem(), ALIGNED_DIMENSION_POINT_EDIT_BEHAVIOR::updateOrthogonalDimension(), and POLYGON_POINT_EDIT_BEHAVIOR::UpdateOutlineFromPoints().
|
inlinestatic |
Standard rectangle points construction utility (other shapes may use this as well)
Definition at line 120 of file pcb_point_editor.cpp.
References EDIT_POINTS::AddLine(), EDIT_POINTS::AddPoint(), EDA_SHAPE::GetBotRight(), PCB_SHAPE::GetCenter(), EDA_SHAPE::GetShape(), EDA_SHAPE::GetTopLeft(), EDIT_POINTS::Line(), EDIT_POINTS::Point(), RECT_BOT, RECT_BOT_LEFT, RECT_BOT_RIGHT, RECT_LEFT, RECT_RIGHT, RECT_TOP, RECT_TOP_LEFT, RECT_TOP_RIGHT, EDIT_LINE::SetConstraint(), EDIT_POINTS::SetSwapX(), EDIT_POINTS::SetSwapY(), EDIT_POINTS::SwapX(), EDIT_POINTS::SwapY(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
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 590 of file ee_point_editor.cpp.
References m_rect, MakePoints(), and SCH_SHAPE::Normalize().
|
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 252 of file pcb_point_editor.cpp.
References m_rectangle, and MakePoints().
|
inlinestatic |
Definition at line 441 of file ee_point_editor.cpp.
References EDIT_POINTS::AddLine(), EDIT_POINTS::AddPoint(), SCH_SHAPE::GetCenter(), EDA_SHAPE::GetEnd(), SCH_SHAPE::GetPosition(), EDIT_POINTS::Line(), EDIT_POINTS::Point(), RECT_BOT, RECT_BOTLEFT, RECT_BOTRIGHT, RECT_LEFT, RECT_RIGHT, RECT_TOP, RECT_TOPLEFT, RECT_TOPRIGHT, EDIT_LINE::SetConstraint(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by MakePoints(), and TEXTBOX_POINT_EDIT_BEHAVIOR::MakePoints().
|
inlinestatic |
Update the coordinates of 4 corners of a rectangle, according to pad constraints and the moved corner.
aPoints | the points list |
aTopLeft | [in/out] is the RECT_TOPLEFT to constraint |
aTopRight | [in/out] is the RECT_TOPRIGHT to constraint |
aBotLeft | [in/out] is the RECT_BOTLEFT to constraint |
aBotRight | [in/out] is the RECT_BOTRIGHT to constraint |
aHole | the location of the pad's hole |
aHoleSize | the pad's hole size (or {0,0} if it has no hole) |
Definition at line 282 of file pcb_point_editor.cpp.
|
inlinestatic |
Update the coordinates of 4 corners of a rectangle, according to constraints and the moved corner.
minWidth | is the minimal width constraint |
minHeight | is the minimal height constraint |
topLeft | is the RECT_TOPLEFT to constraint |
topRight | is the RECT_TOPRIGHT to constraint |
botLeft | is the RECT_BOTLEFT to constraint |
botRight | is the RECT_BOTRIGHT to constraint |
Definition at line 484 of file ee_point_editor.cpp.
References POINT_EDIT_BEHAVIOR::isModified(), EDIT_POINTS::Line(), EDIT_POINTS::Point(), RECT_BOT, RECT_BOTLEFT, RECT_BOTRIGHT, RECT_LEFT, RECT_RIGHT, RECT_TOP, RECT_TOPLEFT, RECT_TOPRIGHT, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by SHEET_POINT_EDIT_BEHAVIOR::UpdateItem(), PAD_POINT_EDIT_BEHAVIOR::UpdateItem(), and 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 602 of file ee_point_editor.cpp.
References BOX2< VECTOR2I >::ByCorners(), dragPinsOnEdge(), DIRECTION_45::E, BOX2< Vec >::GetBottom(), BOX2< Vec >::GetCenter(), EDA_SHAPE::GetEnd(), BOX2< Vec >::GetLeft(), EDIT_POINT::GetPosition(), BOX2< Vec >::GetRight(), KIGEOM::GetSegsInDirection(), EDA_SHAPE::GetStart(), BOX2< Vec >::GetTop(), SCH_ITEM::GetUnit(), POINT_EDIT_BEHAVIOR::isModified(), EDIT_POINTS::Line(), EDIT_POINTS::LinesSize(), m_rect, EDA_IU_SCALE::MilsToIU(), SCH_SHAPE::Move(), DIRECTION_45::N, PinEditedCorner(), EDIT_POINTS::Point(), RECT_BOT, RECT_BOTLEFT, RECT_BOTRIGHT, RECT_CENTER, RECT_LEFT, RECT_RIGHT, RECT_TOP, RECT_TOPLEFT, RECT_TOPRIGHT, DIRECTION_45::S, schIUScale, EDIT_LINE::SetConstraint(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetEndX(), EDA_SHAPE::SetEndY(), SCH_SHAPE::SetPosition(), EDA_SHAPE::SetStartX(), EDA_SHAPE::SetStartY(), DIRECTION_45::W, 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 263 of file pcb_point_editor.cpp.
References m_rectangle, and UpdateItem().
|
inlinestatic |
Definition at line 152 of file pcb_point_editor.cpp.
References CHECK_POINT_COUNT_GE, PCB_SHAPE::GetCenter(), EDIT_POINT::GetPosition(), POINT_EDIT_BEHAVIOR::isModified(), left, EDIT_POINTS::Line(), EDIT_POINTS::LinesSize(), PCB_SHAPE::Move(), PinEditedCorner(), EDIT_POINTS::Point(), RECT_BOT, RECT_BOT_LEFT, RECT_BOT_RIGHT, RECT_CENTER, RECT_LEFT, RECT_MAX_POINTS, RECT_RIGHT, RECT_TOP, RECT_TOP_LEFT, RECT_TOP_RIGHT, right, EDA_SHAPE::SetBottom(), EDIT_LINE::SetConstraint(), EDA_SHAPE::SetLeft(), EDA_SHAPE::SetRight(), EDA_SHAPE::SetTop(), EDIT_POINTS::SwapX(), EDIT_POINTS::SwapY(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
inlinestatic |
Definition at line 546 of file ee_point_editor.cpp.
References EDIT_POINT::GetPosition(), POINT_EDIT_BEHAVIOR::isModified(), EDIT_POINTS::Line(), EDIT_POINTS::LinesSize(), EDA_IU_SCALE::MilsToIU(), PinEditedCorner(), EDIT_POINTS::Point(), RECT_BOT, RECT_BOTLEFT, RECT_BOTRIGHT, RECT_LEFT, RECT_RIGHT, RECT_TOP, RECT_TOPLEFT, RECT_TOPRIGHT, schIUScale, EDIT_LINE::SetConstraint(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetEndX(), EDA_SHAPE::SetEndY(), SCH_SHAPE::SetPosition(), EDA_SHAPE::SetStartX(), EDA_SHAPE::SetStartY(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by TEXTBOX_POINT_EDIT_BEHAVIOR::UpdateItem(), and 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 596 of file ee_point_editor.cpp.
References m_rect, SCH_SHAPE::Normalize(), and UpdatePoints().
|
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 258 of file pcb_point_editor.cpp.
References m_rectangle, and UpdatePoints().
|
inlinestatic |
Definition at line 229 of file pcb_point_editor.cpp.
References EDA_SHAPE::GetBotRight(), PCB_SHAPE::GetCenter(), EDA_SHAPE::GetTopLeft(), EDIT_POINTS::Point(), EDIT_POINTS::PointsSize(), RECT_BOT_LEFT, RECT_BOT_RIGHT, RECT_CENTER, RECT_MAX_POINTS, RECT_TOP_LEFT, RECT_TOP_RIGHT, EDIT_POINT::SetPosition(), EDIT_POINTS::SetSwapX(), EDIT_POINTS::SetSwapY(), EDIT_POINTS::SwapX(), EDIT_POINTS::SwapY(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
inlinestatic |
Definition at line 462 of file ee_point_editor.cpp.
References SCH_SHAPE::GetCenter(), EDA_SHAPE::GetEnd(), SCH_SHAPE::GetPosition(), EDIT_POINTS::Point(), RECT_BOTLEFT, RECT_BOTRIGHT, RECT_CENTER, RECT_TOPLEFT, RECT_TOPRIGHT, EDIT_POINT::SetPosition(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by UpdatePoints(), and TEXTBOX_POINT_EDIT_BEHAVIOR::UpdatePoints().
|
private |
Definition at line 741 of file ee_point_editor.cpp.
Referenced by dragPinsOnEdge().
|
private |
Definition at line 740 of file ee_point_editor.cpp.
Referenced by MakePoints(), UpdateItem(), and UpdatePoints().
|
private |
Definition at line 385 of file pcb_point_editor.cpp.
Referenced by MakePoints(), RECTANGLE_POINT_EDIT_BEHAVIOR(), UpdateItem(), and UpdatePoints().