|
KiCad PCB EDA Suite
|
#include <eda_shape.h>#include <geometry/shape_arc.h>#include <math/vector2d.h>#include <limits>#include <vector>Go to the source code of this file.
Classes | |
| struct | GRAPHIC_EDIT_GEOMETRY |
| struct | GRAPHIC_EDIT_RESULT |
Enumerations | |
| enum class | GRAPHIC_EDIT_REFUSAL { NONE , UNSUPPORTED_SOURCE , LOCKED_SOURCE , NO_INTERSECTION , AMBIGUOUS , DEGENERATE } |
| Why a planner refused. Each one gets its own message. More... | |
Functions | |
| const PCB_SHAPE * | GraphicEditShape (const EDA_ITEM *aItem) |
| Any graphical shape a planner or a boundary search might use. Anything else gives null. | |
| bool | IsGraphicExtendSource (const PCB_SHAPE &aShape) |
| Extend needs two ends to work with. | |
| bool | IsGraphicTrimSource (const PCB_SHAPE &aShape) |
| Trim also takes the closed shapes, which it opens up. | |
| 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. | |
| 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. | |
| 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. | |
| bool | GraphicEditCoincident (const VECTOR2I &aA, const VECTOR2I &aB) |
| Points built by different routes land a rounding step apart. | |
Variables | |
| constexpr int | MAX_GRAPHIC_EDIT_ARC_RADIUS = std::numeric_limits<int>::max() / 2 |
| Larger arcs overflow the boundary search box. | |
| constexpr double | GRAPHIC_EDIT_ANGLE_EPSILON = 1e-6 |
| Sweeps this near zero or a full turn are ambiguous. | |
|
strong |
Why a planner refused. Each one gets its own message.
| Enumerator | |
|---|---|
| NONE | |
| UNSUPPORTED_SOURCE | |
| LOCKED_SOURCE | |
| NO_INTERSECTION | |
| AMBIGUOUS | |
| DEGENERATE | |
Definition at line 41 of file graphic_edit.h.
Definition at line 90 of file graphic_edit.cpp.
References EDA_SHAPE::GetArcMid(), EDA_SHAPE::GetEnd(), and EDA_SHAPE::GetStart().
Referenced by buildCarrier(), outlineProximity(), GRAPHIC_EXTEND_PLANNER::Plan(), and GRAPHIC_EXTEND_PLANNER::QueryBounds().
| 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.
Definition at line 79 of file graphic_edit.cpp.
References PCB_SHAPE::GetLayer(), and GraphicEditShape().
Referenced by GRAPHIC_EXTEND_PLANNER::Plan(), and GRAPHIC_TRIM_PLANNER::Plan().
Points built by different routes land a rounding step apart.
Definition at line 105 of file graphic_edit.cpp.
References VECTOR2< T >::SquaredDistance().
Referenced by arcParameter(), and GRAPHIC_EXTEND_PLANNER::Plan().
Any graphical shape a planner or a boundary search might use. Anything else gives null.
Definition at line 28 of file graphic_edit.cpp.
References ARC, CIRCLE, EDA_SHAPE::GetShape(), PCB_SHAPE_T, RECTANGLE, SEGMENT, and EDA_ITEM::Type().
Referenced by GraphicEditBoundary(), GraphicEditSource(), IsGraphicTrimSource(), GRAPHIC_EXTEND_PLANNER::NearestEndpoint(), outlineProximity(), GRAPHIC_EXTEND_PLANNER::QueryBounds(), and GRAPHIC_EDIT_TOOL::runInteractive().
| 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.
Definition at line 58 of file graphic_edit.cpp.
References GraphicEditShape(), BOARD_ITEM::IsLocked(), LOCKED_SOURCE, GRAPHIC_EDIT_RESULT::m_Refusal, and UNSUPPORTED_SOURCE.
Referenced by GRAPHIC_EXTEND_PLANNER::Plan(), and GRAPHIC_TRIM_PLANNER::Plan().
| bool IsGraphicEditArcUsable | ( | const SHAPE_ARC & | aArc | ) |
False for radii and sweeps the planners refuse. Check before planning an arc.
Definition at line 96 of file graphic_edit.cpp.
References std::abs(), EDA_ANGLE::AsDegrees(), SHAPE_ARC::GetCentralAngle(), SHAPE_ARC::GetRadius(), GRAPHIC_EDIT_ANGLE_EPSILON, and MAX_GRAPHIC_EDIT_ARC_RADIUS.
Referenced by buildCarrier(), GRAPHIC_EXTEND_PLANNER::Plan(), and GRAPHIC_EXTEND_PLANNER::QueryBounds().
| bool IsGraphicExtendSource | ( | const PCB_SHAPE & | aShape | ) |
Extend needs two ends to work with.
Definition at line 46 of file graphic_edit.cpp.
References ARC, EDA_SHAPE::GetShape(), and SEGMENT.
Referenced by GRAPHIC_EDIT_TOOL::Extend(), GRAPHIC_EXTEND_PLANNER::Plan(), and GRAPHIC_EXTEND_PLANNER::QueryBounds().
| bool IsGraphicTrimSource | ( | const PCB_SHAPE & | aShape | ) |
Trim also takes the closed shapes, which it opens up.
Definition at line 52 of file graphic_edit.cpp.
References GraphicEditShape().
Referenced by GRAPHIC_TRIM_PLANNER::Plan(), and GRAPHIC_EDIT_TOOL::Trim().
|
constexpr |
Sweeps this near zero or a full turn are ambiguous.
Definition at line 38 of file graphic_edit.h.
Referenced by IsGraphicEditArcUsable(), and GRAPHIC_EXTEND_PLANNER::Plan().
|
constexpr |
Larger arcs overflow the boundary search box.
Definition at line 35 of file graphic_edit.h.
Referenced by buildCarrier(), and IsGraphicEditArcUsable().