63 const BOX2I& aWorldBounds )
80 return circle.Intersect( aWorldBounds );
103 const std::vector<const BOARD_ITEM*>& aBoundaries )
115 double bestDistance = std::numeric_limits<double>::infinity();
118 double sourceSweep = 0.0;
119 double sourceRadius = 0.0;
120 bool sourceClockwise =
false;
126 if( fixed == selected )
162 if( !boundaryGeometry )
165 std::vector<VECTOR2I> intersections;
168 std::visit(
INTERSECTION_VISITOR( *boundaryGeometry, intersections, contact ), sourceGeometry );
174 for(
const VECTOR2I& point : intersections )
232 result.m_Geometry.push_back( closed );
260 result.m_Geometry.push_back( extended );
261 result.m_Boundaries.push_back( bestBoundary );
267 const BOX2I& aWorldBounds )
274 const std::vector<const BOARD_ITEM*>& aBoundaries )
std::optional< INTERSECTABLE_GEOM > BoardItemIntersectable(const BOARD_ITEM &aItem)
The kimath primitive a board item is made of.
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
constexpr void SetOrigin(const Vec &pos)
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
const VECTOR2I & GetStart() const
Get the start point of the ray.
EDA_ANGLE GetCentralAngle() const
Get the "central angle" of the arc - this is the angle at the point of the "pie slice".
const VECTOR2I & GetArcMid() const
SHAPE_ARC & ConstructFromStartEndCenter(const VECTOR2I &aStart, const VECTOR2I &aEnd, const VECTOR2I &aCenter, bool aClockwise=false, double aWidth=0)
Constructs this arc from the given start, end and center.
const VECTOR2I & GetP1() const
const VECTOR2I & GetP0() const
const VECTOR2I & GetCenter() const
const BOX2I BBox(int aClearance=0) const override
Compute a bounding box of the shape, with a margin of aClearance a collision.
double Distance(const VECTOR2< extended_type > &aVector) const
Compute the distance between two vectors.
SHAPE_ARC GraphicEditArc(const PCB_SHAPE &aShape)
bool IsGraphicEditArcUsable(const SHAPE_ARC &aArc)
False for radii and sweeps the planners refuse. Check before planning an arc.
const PCB_SHAPE * GraphicEditBoundary(const BOARD_ITEM *aBoundary, const PCB_SHAPE &aSource)
A boundary usable against aSource. Null if it is the source, off-layer or unusable.
const PCB_SHAPE * GraphicEditSource(const BOARD_ITEM &aSource, bool(*aAccepts)(const PCB_SHAPE &), GRAPHIC_EDIT_RESULT &aResult)
The shape to edit, or null with the reason in aResult. aAccepts decides the kinds.
bool GraphicEditCoincident(const VECTOR2I &aA, const VECTOR2I &aB)
Points built by different routes land a rounding step apart.
bool IsGraphicExtendSource(const PCB_SHAPE &aShape)
Extend needs two ends to work with.
const PCB_SHAPE * GraphicEditShape(const EDA_ITEM *aItem)
Any graphical shape a planner or a boundary search might use. Anything else gives null.
constexpr double GRAPHIC_EDIT_ANGLE_EPSILON
Sweeps this near zero or a full turn are ambiguous.
static HALF_LINE extensionRay(const PCB_SHAPE &aSource, GRAPHIC_ENDPOINT aEndpoint)
The ray the shape grows along.
std::variant< LINE, HALF_LINE, SEG, CIRCLE, SHAPE_ARC, SHAPE_ELLIPSE, BOX2I > INTERSECTABLE_GEOM
A variant type that can hold any of the supported geometry types for intersection calculations.
BOX2I QueryBounds(const BOARD_ITEM &aSource, GRAPHIC_ENDPOINT aEndpoint, const BOX2I &aWorldBounds)
GRAPHIC_ENDPOINT NearestEndpoint(const BOARD_ITEM &aSource, const VECTOR2I &aPointer)
GRAPHIC_EDIT_RESULT Plan(const BOARD_ITEM &aSource, GRAPHIC_ENDPOINT aEndpoint, const std::vector< const BOARD_ITEM * > &aBoundaries)
std::optional< SEG > ClipHalfLineToBox(const HALF_LINE &aRay, const BOX2I &aBox)
Get the segment of a half-line that is inside a box, if any.
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
static float distance(const SFVEC2UI &a, const SFVEC2UI &b)
Utility functions for working with shapes.
SHAPE_T m_Shape
A result need not be the same kind as the source.
VECTOR2I m_Mid
Arcs only. Everything else leaves it default.
A visitor that visits INTERSECTABLE_GEOM variant objects with another (which is held as state: m_othe...
SHAPE_CIRCLE circle(c.m_circle_center, c.m_circle_radius)
wxString result
Test unit parsing edge cases and error handling.
VECTOR2< int32_t > VECTOR2I