KiCad PCB EDA Suite
|
EDIT_CONSTRAINT for 3 segments: dragged and two adjacent ones, enforcing to keep their slopes and allows only to change ending points. More...
#include <edit_constraints.h>
Public Member Functions | |
EC_CONVERGING (EDIT_LINE &aLine, EDIT_POINTS &aPoints) | |
virtual | ~EC_CONVERGING () |
virtual void | Apply (EDIT_LINE &aHandle, const GRID_HELPER &aGrid) override |
Correct coordinates of the constrained edit handle. | |
void | Apply (const GRID_HELPER &aGrid) |
Correct coordinates of the constrained edit handle. | |
Protected Attributes | |
EDIT_LINE & | m_constrained |
Point that is constrained by rules implemented by Apply(). | |
Private Attributes | |
std::unique_ptr< EDIT_CONSTRAINT< EDIT_POINT > > | m_originSideConstraint |
Constraint for origin side segment. | |
std::unique_ptr< EDIT_CONSTRAINT< EDIT_POINT > > | m_endSideConstraint |
Constraint for end side segment. | |
EDIT_CONSTRAINT< EDIT_POINT > * | m_colinearConstraint |
Additional constraint, applied when at least two points are collinear. | |
EDIT_POINTS & | m_editPoints |
EDIT_POINTS instance that stores currently modified lines. | |
VECTOR2I | m_draggedVector |
Vector that represents the initial direction of the dragged segment. | |
bool | m_originCollinear |
Flags to indicate when dragged and neighbouring lines are (almost) collinear. | |
bool | m_endCollinear |
EDIT_POINT * | m_prevOrigin |
Previous and next points to keep drag endpoints fixed. | |
EDIT_POINT * | m_nextEnd |
VECTOR2I | m_convergencePoint |
Original convergence point of adjacent segments. | |
VECTOR2I | m_midVector |
Vector from the convergence point to the mid-line point. | |
EDIT_CONSTRAINT for 3 segments: dragged and two adjacent ones, enforcing to keep their slopes and allows only to change ending points.
Applied to zones.
Definition at line 236 of file edit_constraints.h.
EC_CONVERGING::EC_CONVERGING | ( | EDIT_LINE & | aLine, |
EDIT_POINTS & | aPoints ) |
Definition at line 148 of file edit_constraints.cpp.
References SEG::Angle(), EDA_ANGLE::AsDegrees(), EDIT_CONSTRAINT< EDIT_LINE >::EDIT_CONSTRAINT(), end, EDIT_LINE::GetEnd(), EDIT_LINE::GetOrigin(), EDIT_LINE::GetPosition(), EDIT_POINT::GetPosition(), intersect(), SEG::IntersectLines(), m_colinearConstraint, m_convergencePoint, m_draggedVector, m_editPoints, m_endCollinear, m_endSideConstraint, m_midVector, m_nextEnd, m_originCollinear, m_originSideConstraint, and m_prevOrigin.
|
virtual |
Definition at line 191 of file edit_constraints.cpp.
|
overridevirtual |
Correct coordinates of the constrained edit handle.
Implements EDIT_CONSTRAINT< EDIT_LINE >.
Definition at line 197 of file edit_constraints.cpp.
References VECTOR2< T >::Dot(), end, EDIT_LINE::GetEnd(), EDIT_LINE::GetOrigin(), EDIT_LINE::GetPosition(), EDIT_POINT::GetPosition(), SEG::Intersect(), SEG::IntersectLines(), KiROUND(), m_colinearConstraint, m_convergencePoint, m_draggedVector, m_editPoints, m_endCollinear, m_endSideConstraint, m_midVector, m_nextEnd, m_originCollinear, m_originSideConstraint, m_prevOrigin, EDIT_LINE::SetPosition(), EDIT_POINT::SetPosition(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
inlineinherited |
Correct coordinates of the constrained edit handle.
Definition at line 82 of file edit_constraints.h.
|
private |
Additional constraint, applied when at least two points are collinear.
It is a pointer to m_[origin/end]SideConstraint, so it should not be freed.
Definition at line 255 of file edit_constraints.h.
Referenced by Apply(), and EC_CONVERGING().
|
protectedinherited |
Point that is constrained by rules implemented by Apply().
Definition at line 88 of file edit_constraints.h.
|
private |
Original convergence point of adjacent segments.
Definition at line 272 of file edit_constraints.h.
Referenced by Apply(), and EC_CONVERGING().
|
private |
Vector that represents the initial direction of the dragged segment.
Definition at line 261 of file edit_constraints.h.
Referenced by Apply(), and EC_CONVERGING().
|
private |
EDIT_POINTS instance that stores currently modified lines.
Definition at line 258 of file edit_constraints.h.
Referenced by Apply(), and EC_CONVERGING().
|
private |
Definition at line 265 of file edit_constraints.h.
Referenced by Apply(), and EC_CONVERGING().
|
private |
Constraint for end side segment.
Definition at line 251 of file edit_constraints.h.
Referenced by Apply(), and EC_CONVERGING().
|
private |
Vector from the convergence point to the mid-line point.
Definition at line 275 of file edit_constraints.h.
Referenced by Apply(), and EC_CONVERGING().
|
private |
Definition at line 269 of file edit_constraints.h.
Referenced by Apply(), and EC_CONVERGING().
|
private |
Flags to indicate when dragged and neighbouring lines are (almost) collinear.
Definition at line 264 of file edit_constraints.h.
Referenced by Apply(), and EC_CONVERGING().
|
private |
Constraint for origin side segment.
Definition at line 248 of file edit_constraints.h.
Referenced by Apply(), and EC_CONVERGING().
|
private |
Previous and next points to keep drag endpoints fixed.
Definition at line 268 of file edit_constraints.h.
Referenced by Apply(), and EC_CONVERGING().