67 && ( newLineVector.
x == 0 || newLineVector.
y == 0 ) )
71 if( newLineVector.
x == 0 )
92 if( newLineVector.
x == 0 )
152 m_prevOrigin( aPoints.Previous( aLine.GetOrigin(), false ) ),
153 m_nextEnd( aPoints.Next( aLine.GetEnd(), false ) )
172 const int alignAngle = 10;
244 end.SetPosition( *endIntersect );
257 end.SetPosition( *originEndIntersect );
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
const EDIT_POINT & m_constrainer
Point that imposes the constraint.
virtual void Apply(EDIT_POINT &aHandle, const GRID_HELPER &aGrid) override
Correct coordinates of the constrained edit handle.
const EDIT_POINT & m_constrainer
Point that imposes the constraint.
virtual void Apply(EDIT_POINT &aHandle, const GRID_HELPER &aGrid) override
Correct coordinates of the constrained edit handle.
const EDIT_POINT & m_end
Point that imposes the constraint (decides on the radius of the circle).
const EDIT_POINT & m_center
Point that imposes the constraint (center of the circle).
virtual void Apply(EDIT_POINT &aHandle, const GRID_HELPER &aGrid) override
Correct coordinates of the constrained edit handle.
std::unique_ptr< EDIT_CONSTRAINT< EDIT_POINT > > m_endSideConstraint
Constraint for end side segment.
EC_CONVERGING(EDIT_LINE &aLine, EDIT_POINTS &aPoints)
std::unique_ptr< EDIT_CONSTRAINT< EDIT_POINT > > m_originSideConstraint
Constraint for origin side segment.
EDIT_CONSTRAINT< EDIT_POINT > * m_colinearConstraint
Additional constraint, applied when at least two points are collinear.
VECTOR2I m_midVector
Vector from the convergence point to the mid-line point.
VECTOR2I m_draggedVector
Vector that represents the initial direction of the dragged segment.
EDIT_POINT * m_prevOrigin
Previous and next points to keep drag endpoints fixed.
bool m_originCollinear
Flags to indicate when dragged and neighbouring lines are (almost) collinear.
EDIT_POINTS & m_editPoints
EDIT_POINTS instance that stores currently modified lines.
virtual void Apply(EDIT_LINE &aHandle, const GRID_HELPER &aGrid) override
Correct coordinates of the constrained edit handle.
VECTOR2I m_convergencePoint
Original convergence point of adjacent segments.
const EDIT_POINT & m_constrainer
Point that imposes the constraint.
virtual void Apply(EDIT_POINT &aHandle, const GRID_HELPER &aGrid) override
Correct coordinates of the constrained edit handle.
const EDIT_POINT & m_constrainer
Point that imposes the constraint.
VECTOR2I m_line
Vector representing the constraining line.
virtual void Apply(EDIT_POINT &aHandle, const GRID_HELPER &aGrid) override
Correct coordinates of the constrained edit handle.
EC_LINE(EDIT_POINT &aConstrained, const EDIT_POINT &aConstrainer)
EC_PERPLINE(EDIT_LINE &aLine)
virtual void Apply(EDIT_LINE &aHandle, const GRID_HELPER &aGrid) override
Correct coordinates of the constrained edit handle.
virtual void Apply(EDIT_POINT &aHandle, const GRID_HELPER &aGrid) override
Correct coordinates of the constrained edit handle.
const EDIT_POINT & m_constrainer
Point that imposes the constraint.
EDIT_POINT & m_constrained
EDIT_CONSTRAINT(EDIT_POINT &aConstrained)
Represent a line connecting two EDIT_POINTs.
virtual void SetPosition(const VECTOR2I &aPosition) override
Return coordinates of an EDIT_POINT.
EDIT_POINT & GetEnd()
Return the end EDIT_POINT.
EDIT_POINT & GetOrigin()
Return the origin EDIT_POINT.
virtual VECTOR2I GetPosition() const override
Return coordinates of an EDIT_POINT.
EDIT_POINTS is a VIEW_ITEM that manages EDIT_POINTs and EDIT_LINEs and draws them.
Represent a single point that can be used for modifying items.
virtual void SetPosition(const VECTOR2I &aPosition)
Set new coordinates for an EDIT_POINT.
virtual VECTOR2I GetPosition() const
Return coordinates of an EDIT_POINT.
GRID_CONSTRAINT_TYPE GetGridConstraint() const
virtual VECTOR2I AlignGrid(const VECTOR2I &aPoint, GRID_HELPER_GRIDS aGrid) const
OPT_VECTOR2I Intersect(const SEG &aSeg, bool aIgnoreEndpoints=false, bool aLines=false) const
Compute intersection point of segment (this) with segment aSeg.
OPT_VECTOR2I IntersectLines(const SEG &aSeg) const
Compute the intersection point of lines passing through ends of (this) and aSeg.
EDA_ANGLE Angle(const SEG &aOther) const
Determine the smallest angle between two segments.
T EuclideanNorm() const
Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2).
constexpr extended_type Dot(const VECTOR2< T > &aVector) const
Compute dot product of self with aVector.
a few functions useful in geometry calculations.
VECTOR2< T > GetVectorSnapped45(const VECTOR2< T > &aVec, bool only45=false)
Snap a vector onto the nearest 0, 45 or 90 degree line.
VECTOR2< T > GetVectorSnapped90(const VECTOR2< T > &aVec)
Snap a vector onto the nearest horizontal or vertical line.
static bool intersect(const SEGMENT_WITH_NORMALS &aSeg, const SFVEC2F &aStart, const SFVEC2F &aEnd)
std::optional< VECTOR2I > OPT_VECTOR2I
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D