![]() |
KiCad PCB EDA Suite
|
Represent a line connecting two EDIT_POINTs. More...
#include <edit_points.h>
Public Member Functions | |
EDIT_LINE (EDIT_POINT &aOrigin, EDIT_POINT &aEnd) | |
Return coordinates of an EDIT_POINT. More... | |
virtual VECTOR2I | GetPosition () const override |
Return coordinates of an EDIT_POINT. More... | |
virtual void | SetPosition (const VECTOR2I &aPosition) override |
Correct coordinates of an EDIT_POINT by applying previously set constraint. More... | |
virtual void | ApplyConstraint () override |
Correct coordinates of an EDIT_POINT by applying previously set constraint. More... | |
void | SetConstraint (EDIT_CONSTRAINT< EDIT_LINE > *aConstraint) |
Set a constraint for and EDIT_POINT. More... | |
EDIT_CONSTRAINT< EDIT_LINE > * | GetConstraint () const |
Return the constraint imposed on an EDIT_POINT. More... | |
EDIT_POINT & | GetOrigin () |
Return the origin EDIT_POINT. More... | |
const EDIT_POINT & | GetOrigin () const |
EDIT_POINT & | GetEnd () |
Return the end EDIT_POINT. More... | |
const EDIT_POINT & | GetEnd () const |
bool | operator== (const EDIT_POINT &aOther) const |
bool | operator== (const EDIT_LINE &aOther) const |
virtual std::pair< EDA_ITEM *, int > | GetConnected () const |
Return a connected item record comprising an EDA_ITEM* and a STARTPOINT/ENDPOINT flag. More... | |
int | GetX () const |
Return X coordinate of an EDIT_POINT. More... | |
int | GetY () const |
Return Y coordinate of an EDIT_POINT. More... | |
virtual void | SetPosition (int x, int y) |
bool | WithinPoint (const VECTOR2I &aPoint, unsigned int aSize) const |
Check if given point is within a square centered in the EDIT_POINT position. More... | |
void | SetConstraint (EDIT_CONSTRAINT< EDIT_POINT > *aConstraint) |
Set a constraint for and EDIT_POINT. More... | |
void | ClearConstraint () |
Remove previously set constraint. More... | |
bool | IsConstrained () const |
Check if point is constrained. More... | |
bool | IsActive () const |
void | SetActive (bool aActive=true) |
bool | IsHover () const |
void | SetHover (bool aHover=true) |
GRID_CONSTRAINT_TYPE | GetGridConstraint () const |
void | SetGridConstraint (GRID_CONSTRAINT_TYPE aConstraint) |
Static Public Attributes | |
static const int | POINT_SIZE = 8 |
Border size when not hovering. More... | |
static const int | BORDER_SIZE = 2 |
Border size when hovering. More... | |
static const int | HOVER_SIZE = 5 |
Private Attributes | |
EDIT_POINT & | m_origin |
Origin point for a line. More... | |
EDIT_POINT & | m_end |
End point for a line. More... | |
std::shared_ptr< EDIT_CONSTRAINT< EDIT_LINE > > | m_constraint |
Represent a line connecting two EDIT_POINTs.
This allows one to move them both by dragging the EDIT_POINT in the middle. It uses references to EDIT_POINTs, all coordinates are automatically synchronized.
Definition at line 215 of file edit_points.h.
|
inline |
Return coordinates of an EDIT_POINT.
Definition at line 222 of file edit_points.h.
References EDIT_POINT::SetGridConstraint(), and SNAP_BY_GRID.
|
inlineoverridevirtual |
Correct coordinates of an EDIT_POINT by applying previously set constraint.
Reimplemented from EDIT_POINT.
Definition at line 246 of file edit_points.h.
References EDIT_POINT::ApplyConstraint(), m_constraint, m_end, and m_origin.
|
inlineinherited |
Remove previously set constraint.
Definition at line 147 of file edit_points.h.
References EDIT_POINT::m_constraint.
|
inlinevirtualinherited |
Return a connected item record comprising an EDA_ITEM* and a STARTPOINT/ENDPOINT flag.
Definition at line 78 of file edit_points.h.
References EDIT_POINT::m_connected.
|
inline |
Return the constraint imposed on an EDIT_POINT.
If there are no constraints, NULL is returned.
Definition at line 269 of file edit_points.h.
References m_constraint.
|
inline |
Return the end EDIT_POINT.
Definition at line 290 of file edit_points.h.
References m_end.
Referenced by EC_CONVERGING::Apply(), EC_SNAPLINE::Apply(), EC_PERPLINE::Apply(), EC_CONVERGING::EC_CONVERGING(), and EC_PERPLINE::EC_PERPLINE().
|
inline |
|
inlineinherited |
Definition at line 177 of file edit_points.h.
References EDIT_POINT::m_gridConstraint.
Referenced by PCB_POINT_EDITOR::OnSelectionChange().
|
inline |
Return the origin EDIT_POINT.
Definition at line 277 of file edit_points.h.
References m_origin.
Referenced by EC_CONVERGING::Apply(), EC_SNAPLINE::Apply(), EC_PERPLINE::Apply(), EC_CONVERGING::EC_CONVERGING(), and EC_PERPLINE::EC_PERPLINE().
|
inline |
|
inlineoverridevirtual |
Return coordinates of an EDIT_POINT.
Reimplemented from EDIT_POINT.
Definition at line 231 of file edit_points.h.
References EDIT_POINT::GetPosition(), m_end, and m_origin.
Referenced by EC_PERPLINE::Apply(), EC_PERPLINE::EC_PERPLINE(), operator==(), and SetPosition().
|
inlineinherited |
Return X coordinate of an EDIT_POINT.
Definition at line 86 of file edit_points.h.
References EDIT_POINT::GetPosition(), and VECTOR2< T >::x.
|
inlineinherited |
Return Y coordinate of an EDIT_POINT.
Definition at line 94 of file edit_points.h.
References EDIT_POINT::GetPosition(), and VECTOR2< T >::y.
|
inlineinherited |
Definition at line 171 of file edit_points.h.
References EDIT_POINT::m_isActive.
Referenced by EDIT_POINTS::ViewDraw().
|
inlineinherited |
Check if point is constrained.
Definition at line 157 of file edit_points.h.
References EDIT_POINT::m_constraint.
|
inlineinherited |
Definition at line 174 of file edit_points.h.
References EDIT_POINT::m_isHover.
Referenced by EDIT_POINTS::ViewDraw().
|
inline |
Definition at line 300 of file edit_points.h.
References EDIT_POINT::GetPosition(), and GetPosition().
|
inline |
Definition at line 305 of file edit_points.h.
|
inlineinherited |
Definition at line 172 of file edit_points.h.
References EDIT_POINT::m_isActive.
Referenced by PCB_POINT_EDITOR::OnSelectionChange().
|
inlineinherited |
Set a constraint for and EDIT_POINT.
aConstraint | is the constraint to be set. |
Definition at line 130 of file edit_points.h.
References EDIT_POINT::m_constraint.
|
inline |
Set a constraint for and EDIT_POINT.
aConstraint | is the constraint to be set. |
Definition at line 260 of file edit_points.h.
References m_constraint.
|
inlineinherited |
Definition at line 178 of file edit_points.h.
References EDIT_POINT::m_gridConstraint.
Referenced by EDIT_LINE().
|
inlineinherited |
Definition at line 175 of file edit_points.h.
References EDIT_POINT::m_isHover.
Referenced by PCB_POINT_EDITOR::updateEditedPoint().
|
inlinevirtualinherited |
Definition at line 111 of file edit_points.h.
References EDIT_POINT::m_position, VECTOR2< T >::x, and VECTOR2< T >::y.
|
inlineoverridevirtual |
Correct coordinates of an EDIT_POINT by applying previously set constraint.
Reimplemented from EDIT_POINT.
Definition at line 237 of file edit_points.h.
References EDIT_POINT::GetPosition(), GetPosition(), m_end, m_origin, and EDIT_POINT::SetPosition().
Referenced by EC_PERPLINE::Apply().
|
inherited |
Check if given point is within a square centered in the EDIT_POINT position.
aPoint | is point to be checked. |
aSize | is length of the square side. |
Definition at line 33 of file edit_points.cpp.
References EDIT_POINT::GetPosition(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
staticinherited |
Border size when hovering.
Definition at line 189 of file edit_points.h.
Referenced by EDIT_POINTS::ViewDraw().
|
staticinherited |
Definition at line 192 of file edit_points.h.
Referenced by EDIT_POINTS::ViewDraw().
|
private |
Definition at line 315 of file edit_points.h.
Referenced by ApplyConstraint(), GetConstraint(), and SetConstraint().
|
private |
End point for a line.
Constraint for the point, NULL if none
Definition at line 312 of file edit_points.h.
Referenced by ApplyConstraint(), GetEnd(), GetPosition(), operator==(), and SetPosition().
|
private |
Origin point for a line.
Definition at line 311 of file edit_points.h.
Referenced by ApplyConstraint(), GetOrigin(), GetPosition(), operator==(), and SetPosition().
|
staticinherited |
Border size when not hovering.
Definition at line 186 of file edit_points.h.
Referenced by EE_POINT_EDITOR::addCornerCondition(), EDIT_POINTS::FindPoint(), and EDIT_POINTS::ViewDraw().