KiCad PCB EDA Suite
|
#include <pcb_grid_helper.h>
Public Types | |
enum | ANCHOR_FLAGS { CORNER = 1 , OUTLINE = 2 , SNAPPABLE = 4 , ORIGIN = 8 , VERTICAL = 16 , HORIZONTAL = 32 , CONSTRUCTED = 64 , ALL = CORNER | OUTLINE | SNAPPABLE | ORIGIN | VERTICAL | HORIZONTAL | CONSTRUCTED } |
Public Member Functions | |
PCB_GRID_HELPER () | |
PCB_GRID_HELPER (TOOL_MANAGER *aToolMgr, MAGNETIC_SETTINGS *aMagneticSettings) | |
~PCB_GRID_HELPER () override | |
BOARD_ITEM * | GetSnapped () const |
Function GetSnapped If the PCB_GRID_HELPER has highlighted a snap point (target shown), this function will return a pointer to the item to which it snapped. | |
VECTOR2I | AlignToSegment (const VECTOR2I &aPoint, const SEG &aSeg) |
VECTOR2I | BestDragOrigin (const VECTOR2I &aMousePos, std::vector< BOARD_ITEM * > &aItem, GRID_HELPER_GRIDS aGrid=GRID_HELPER_GRIDS::GRID_CURRENT, const PCB_SELECTION_FILTER_OPTIONS *aSelectionFilter=nullptr) |
VECTOR2I | AlignToArc (const VECTOR2I &aPoint, const SHAPE_ARC &aSeg) |
VECTOR2I | SnapToPad (const VECTOR2I &aMousePos, std::deque< PAD * > &aPads) |
virtual void | OnBoardItemRemoved (BOARD &aBoard, BOARD_ITEM *aBoardItem) override |
VECTOR2I | BestSnapAnchor (const VECTOR2I &aOrigin, BOARD_ITEM *aReferenceItem, GRID_HELPER_GRIDS aGrid=GRID_HELPER_GRIDS::GRID_CURRENT) |
Chooses the "best" snap anchor around the given point, optionally taking layers from the reference item. | |
VECTOR2I | BestSnapAnchor (const VECTOR2I &aOrigin, const LSET &aLayers, GRID_HELPER_GRIDS aGrid=GRID_HELPER_GRIDS::GRID_CURRENT, const std::vector< BOARD_ITEM * > &aSkip={}) |
GRID_HELPER_GRIDS | GetItemGrid (const EDA_ITEM *aItem) const override |
Get the coarsest grid that applies to an item. | |
VECTOR2D | GetGridSize (GRID_HELPER_GRIDS aGrid) const override |
Return the size of the specified grid. | |
void | AddConstructionItems (std::vector< BOARD_ITEM * > aItems, bool aExtensionOnly, bool aIsPersistent) |
Add construction geometry for a set of board items. | |
virtual VECTOR2I | Align (const VECTOR2I &aPoint, GRID_HELPER_GRIDS aGrid) const |
virtual VECTOR2I | Align (const VECTOR2I &aPoint) const |
virtual VECTOR2I | Align (const VECTOR2I &aPoint, const VECTOR2D &aGrid, const VECTOR2D &aOffset) const |
virtual VECTOR2I | AlignGrid (const VECTOR2I &aPoint, GRID_HELPER_GRIDS aGrid) const |
VECTOR2I | AlignGrid (const VECTOR2I &aPoint) const |
VECTOR2I | AlignGrid (const VECTOR2I &aPoint, const VECTOR2D &aGrid, const VECTOR2D &aOffset) const |
VECTOR2I | GetGrid () const |
VECTOR2D | GetVisibleGrid () const |
VECTOR2I | GetOrigin () const |
void | SetGridSize (const VECTOR2D &aGrid) |
void | SetVisibleGridSize (const VECTOR2D &aGrid) |
void | SetOrigin (const VECTOR2I &aOrigin) |
void | SetGridSnapping (bool aEnable) |
void | SetAuxAxes (bool aEnable, const VECTOR2I &aOrigin=VECTOR2I(0, 0)) |
virtual GRID_HELPER_GRIDS | GetSelectionGrid (const SELECTION &aSelection) const |
Gets the coarsest grid that applies to a selecion of items. | |
void | SetSkipPoint (const VECTOR2I &aPoint) |
void | ClearSkipPoint () |
Clear the skip point by setting it to an unreachable position, thereby preventing matching. | |
void | SetSnap (bool aSnap) |
bool | GetSnap () const |
void | SetUseGrid (bool aSnapToGrid) |
bool | GetUseGrid () const |
void | SetSnapLine (bool aSnap) |
void | SetSnapLineDirections (const std::vector< VECTOR2I > &aDirections) |
void | SetSnapLineOrigin (const VECTOR2I &aOrigin) |
void | SetSnapLineEnd (const std::optional< VECTOR2I > &aEnd) |
void | ClearSnapLine () |
std::optional< VECTOR2I > | SnapToConstructionLines (const VECTOR2I &aPoint, const VECTOR2I &aNearestGrid, const VECTOR2D &aGrid, double aSnapRange) const |
void | SetMask (int aMask) |
void | SetMaskFlag (int aFlag) |
void | ClearMaskFlag (int aFlag) |
std::optional< VECTOR2I > | GetSnappedPoint () const |
virtual void | OnBoardItemAdded (BOARD &aBoard, BOARD_ITEM *aBoardItem) |
virtual void | OnBoardItemsAdded (BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItem) |
virtual void | OnBoardItemsRemoved (BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItem) |
virtual void | OnBoardNetSettingsChanged (BOARD &aBoard) |
virtual void | OnBoardItemChanged (BOARD &aBoard, BOARD_ITEM *aBoardItem) |
virtual void | OnBoardItemsChanged (BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItem) |
virtual void | OnBoardHighlightNetChanged (BOARD &aBoard) |
virtual void | OnBoardRatsnestChanged (BOARD &aBoard) |
virtual void | OnBoardCompositeUpdate (BOARD &aBoard, std::vector< BOARD_ITEM * > &aAddedItems, std::vector< BOARD_ITEM * > &aRemovedItems, std::vector< BOARD_ITEM * > &aChangedItems) |
Protected Member Functions | |
void | addAnchor (const VECTOR2I &aPos, int aFlags, EDA_ITEM *aItem, int aPointTypes=POINT_TYPE::PT_NONE) |
void | addAnchor (const VECTOR2I &aPos, int aFlags, std::vector< EDA_ITEM * > aItems, int aPointTypes) |
void | clearAnchors () |
bool | canUseGrid () const |
Check whether it is possible to use the grid – this depends both on local grid helper settings and global (tool manager) KiCad settings. | |
VECTOR2I | computeNearest (const VECTOR2I &aPoint, const VECTOR2I &aGrid, const VECTOR2I &aOffset) const |
void | showConstructionGeometry (bool aShow) |
SNAP_MANAGER & | getSnapManager () |
void | updateSnapPoint (const TYPED_POINT2I &aPoint) |
KIGFX::ANCHOR_DEBUG * | enableAndGetAnchorDebug () |
Enable the anchor debug if permitted and return it. | |
Protected Attributes | |
std::vector< ANCHOR > | m_anchors |
TOOL_MANAGER * | m_toolMgr |
std::optional< VECTOR2I > | m_auxAxis |
int | m_maskTypes |
bool | m_enableSnap |
bool | m_enableGrid |
bool | m_enableSnapLine |
std::optional< ANCHOR > | m_snapItem |
VECTOR2I | m_skipPoint |
KIGFX::SNAP_INDICATOR | m_viewSnapPoint |
KIGFX::ORIGIN_VIEWITEM | m_viewAxis |
VECTOR2D | m_manualGrid |
VECTOR2D | m_manualVisibleGrid |
VECTOR2I | m_manualOrigin |
bool | m_manualGridSnapping |
Private Member Functions | |
std::vector< BOARD_ITEM * > | queryVisible (const BOX2I &aArea, const std::vector< BOARD_ITEM * > &aSkip) const |
ANCHOR * | nearestAnchor (const VECTOR2I &aPos, int aFlags) |
Find the nearest anchor point to the given position with matching flags. | |
void | computeAnchors (const std::vector< BOARD_ITEM * > &aItems, const VECTOR2I &aRefPos, bool aFrom, const PCB_SELECTION_FILTER_OPTIONS *aSelectionFilter, const LSET *aLayers, bool aForDrag) |
computeAnchors inserts the local anchor points in to the grid helper for the specified container of board items, including points implied by intersections or other relationships between the items. | |
void | computeAnchors (BOARD_ITEM *aItem, const VECTOR2I &aRefPos, bool aFrom, const PCB_SELECTION_FILTER_OPTIONS *aSelectionFilter) |
computeAnchors inserts the local anchor points in to the grid helper for the specified board item, given the reference point and the direction of use for the point. | |
Private Attributes | |
MAGNETIC_SETTINGS * | m_magneticSettings |
std::vector< NEARABLE_GEOM > | m_pointOnLineCandidates |
KIGFX::CONSTRUCTION_GEOM | m_constructionGeomPreview |
Show construction geometry (if any) on the canvas. | |
SNAP_MANAGER | m_snapManager |
Manage the construction geometry, snap lines, reference points, etc. | |
std::unique_ptr< KIGFX::ANCHOR_DEBUG > | m_anchorDebug |
#VIEW_ITEM for visualising anchor points, if enabled. | |
Friends | |
class | PCBGridHelperTestFixture |
Definition at line 44 of file pcb_grid_helper.h.
|
inherited |
Enumerator | |
---|---|
CORNER | |
OUTLINE | |
SNAPPABLE | |
ORIGIN | |
VERTICAL | |
HORIZONTAL | |
CONSTRUCTED | |
ALL |
Definition at line 143 of file grid_helper.h.
PCB_GRID_HELPER::PCB_GRID_HELPER | ( | ) |
Definition at line 148 of file pcb_grid_helper.cpp.
References GRID_HELPER::GRID_HELPER(), and m_magneticSettings.
PCB_GRID_HELPER::PCB_GRID_HELPER | ( | TOOL_MANAGER * | aToolMgr, |
MAGNETIC_SETTINGS * | aMagneticSettings ) |
Definition at line 155 of file pcb_grid_helper.cpp.
References KIGFX::VIEW::Add(), KIGFX::ORIGIN_VIEWITEM::CIRCLE_CROSS, KIGFX::ORIGIN_VIEWITEM::CROSS, KIGFX::RENDER_SETTINGS::GetLayerColor(), KIGFX::VIEW::GetPainter(), GRID_HELPER::GRID_HELPER(), LAYER_ANCHOR, LAYER_AUX_ITEMS, m_magneticSettings, GRID_HELPER::m_toolMgr, GRID_HELPER::m_viewAxis, GRID_HELPER::m_viewSnapPoint, KIGFX::VIEW::SetVisible(), and KIGFX::COLOR4D::WithAlpha().
|
override |
Definition at line 182 of file pcb_grid_helper.cpp.
References GRID_HELPER::m_toolMgr, GRID_HELPER::m_viewAxis, GRID_HELPER::m_viewSnapPoint, and KIGFX::VIEW::Remove().
|
inlineprotectedinherited |
Definition at line 196 of file grid_helper.h.
References addAnchor(), and PT_NONE.
Referenced by addAnchor(), EE_GRID_HELPER::computeAnchors(), PCB_GRID_HELPER::computeAnchors(), and PCB_GRID_HELPER::computeAnchors().
|
inlineprotectedinherited |
Definition at line 202 of file grid_helper.h.
References m_anchors, and m_maskTypes.
void PCB_GRID_HELPER::AddConstructionItems | ( | std::vector< BOARD_ITEM * > | aItems, |
bool | aExtensionOnly, | ||
bool | aIsPersistent ) |
Add construction geometry for a set of board items.
aItems | The items for which to add construction geometry |
aExtensionOnly | If true, the construction geometry only includes extensions of the items, if false it also overlays the items themselves. |
aIsPersistent | If true, the construction geometry is considered "persistent" and will always be shown and won't be replaced by later temporary geometry. |
Definition at line 194 of file pcb_grid_helper.cpp.
References ARC, KIGEOM::BoxToSegs(), CIRCLE, CONSTRUCTION_MANAGER::FROM_ITEMS, EDA_SHAPE::GetArcMid(), REFERENCE_IMAGE::GetBoundingBox(), PCB_SHAPE::GetCenter(), ADVANCED_CFG::GetCfg(), SNAP_MANAGER::GetConstructionManager(), EDA_SHAPE::GetEnd(), REFERENCE_IMAGE::GetPosition(), EDA_SHAPE::GetRadius(), PCB_REFERENCE_IMAGE::GetReferenceImage(), EDA_SHAPE::GetShape(), GRID_HELPER::getSnapManager(), EDA_SHAPE::GetStart(), REFERENCE_IMAGE::GetTransformOriginOffset(), PCB_REFERENCE_IMAGE_T, PCB_SHAPE_T, CONSTRUCTION_MANAGER::ProposeConstructionItems(), RECTANGLE, SEGMENT, SNAP_MANAGER::SetReferenceOnlyPoints(), and EDA_ITEM::Type().
Referenced by BestSnapAnchor().
Reimplemented from GRID_HELPER.
Definition at line 85 of file grid_helper.cpp.
|
virtual |
Reimplemented from GRID_HELPER.
Definition at line 86 of file grid_helper.cpp.
References GRID_HELPER::m_manualGrid.
|
inlinevirtual |
Reimplemented from GRID_HELPER.
Definition at line 75 of file grid_helper.h.
Referenced by AlignToArc(), AlignToSegment(), BestSnapAnchor(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
Definition at line 89 of file grid_helper.cpp.
References GRID_HELPER::m_manualVisibleGrid.
VECTOR2I GRID_HELPER::AlignGrid | ( | const VECTOR2I & | aPoint, |
const VECTOR2D & | aGrid, | ||
const VECTOR2D & | aOffset ) const |
Definition at line 90 of file grid_helper.cpp.
References GRID_HELPER::m_manualGridSnapping, and GRID_HELPER::m_manualOrigin.
|
inlinevirtual |
Reimplemented from GRID_HELPER.
Definition at line 80 of file grid_helper.h.
Definition at line 391 of file pcb_grid_helper.cpp.
References Align(), VECTOR2< int32_t >::ECOORD_MAX, SHAPE_ARC::GetP0(), SHAPE_ARC::GetP1(), SHAPE_ARC::IntersectLine(), and GRID_HELPER::m_enableSnap.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
Definition at line 336 of file pcb_grid_helper.cpp.
References SEG::A, Align(), SEG::B, VECTOR2< int32_t >::ECOORD_MAX, SEG::IntersectLines(), GRID_HELPER::m_enableSnap, and SEG::SquaredDistance().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and DRAWING_TOOL::DrawVia().
VECTOR2I PCB_GRID_HELPER::BestDragOrigin | ( | const VECTOR2I & | aMousePos, |
std::vector< BOARD_ITEM * > & | aItem, | ||
GRID_HELPER_GRIDS | aGrid = GRID_HELPER_GRIDS::GRID_CURRENT, | ||
const PCB_SELECTION_FILTER_OPTIONS * | aSelectionFilter = nullptr ) |
Definition at line 467 of file pcb_grid_helper.cpp.
References GRID_HELPER::clearAnchors(), computeAnchors(), GRID_HELPER::CORNER, GRID_HELPER::ANCHOR::Distance(), GRID_HELPER::m_toolMgr, nearestAnchor(), GRID_HELPER::ORIGIN, GRID_HELPER::OUTLINE, and GRID_HELPER::ANCHOR::pos.
VECTOR2I PCB_GRID_HELPER::BestSnapAnchor | ( | const VECTOR2I & | aOrigin, |
BOARD_ITEM * | aReferenceItem, | ||
GRID_HELPER_GRIDS | aGrid = GRID_HELPER_GRIDS::GRID_CURRENT ) |
Chooses the "best" snap anchor around the given point, optionally taking layers from the reference item.
The reference item will not be snapped to (it is being dragged or created) and we choose the layers that can be snapped based on the reference item layer
aOrigin | Point we want to snap from |
aReferenceItem | Reference item for layer/type special casing |
Definition at line 513 of file pcb_grid_helper.cpp.
References LSET::AllLayersMask(), BestSnapAnchor(), and BOARD_ITEM::GetLayerSet().
Referenced by BestSnapAnchor().
VECTOR2I PCB_GRID_HELPER::BestSnapAnchor | ( | const VECTOR2I & | aOrigin, |
const LSET & | aLayers, | ||
GRID_HELPER_GRIDS | aGrid = GRID_HELPER_GRIDS::GRID_CURRENT, | ||
const std::vector< BOARD_ITEM * > & | aSkip = {} ) |
Definition at line 533 of file pcb_grid_helper.cpp.
References AddConstructionItems(), Align(), anchor, BOX2ISafe(), CONSTRUCTION_MANAGER::CancelProposal(), GRID_HELPER::clearAnchors(), computeAnchors(), GRID_HELPER::CONSTRUCTED, GRID_HELPER::ANCHOR::Distance(), GRID_HELPER::enableAndGetAnchorDebug(), GRID_HELPER::ANCHOR::flags, KIGFX::GEOMETRY, ADVANCED_CFG::GetCfg(), SNAP_MANAGER::GetConstructionManager(), GetGridSize(), BOARD_ITEM::GetLayerSet(), GetNearestPoint(), SNAP_LINE_MANAGER::GetNearestSnapLinePoint(), SNAP_MANAGER::GetReferenceOnlyPoints(), SNAP_MANAGER::GetSnapLineManager(), GRID_HELPER::getSnapManager(), GRID_HELPER::GetVisibleGrid(), EDA_ITEM::HitTest(), KIGFX::VIEW_ITEM::IsBOARD_ITEM(), GRID_HELPER::ANCHOR::items, KiROUND(), GRID_HELPER::m_anchors, GRID_HELPER::m_enableGrid, GRID_HELPER::m_enableSnap, GRID_HELPER::m_enableSnapLine, ADVANCED_CFG::m_ExtensionSnapActivateOnHover, m_magneticSettings, m_pointOnLineCandidates, GRID_HELPER::m_skipPoint, GRID_HELPER::m_snapItem, GRID_HELPER::m_toolMgr, GRID_HELPER::m_viewSnapPoint, nearestAnchor(), GRID_HELPER::ANCHOR::pos, PT_NONE, PT_ON_ELEMENT, queryVisible(), SNAP_LINE_MANAGER::SetSnapLineEnd(), SNAP_LINE_MANAGER::SetSnapLineOrigin(), SNAP_LINE_MANAGER::SetSnappedAnchor(), GRID_HELPER::showConstructionGeometry(), GRID_HELPER::SNAPPABLE, GRID_HELPER::SnapToConstructionLines(), and GRID_HELPER::updateSnapPoint().
|
protectedinherited |
Check whether it is possible to use the grid – this depends both on local grid helper settings and global (tool manager) KiCad settings.
Definition at line 380 of file grid_helper.cpp.
References m_enableGrid, m_manualGridSnapping, and m_toolMgr.
Referenced by Align(), EE_GRID_HELPER::BestSnapAnchor(), and SnapToConstructionLines().
|
inlineprotectedinherited |
Definition at line 209 of file grid_helper.h.
References m_anchors.
Referenced by EE_GRID_HELPER::BestDragOrigin(), PCB_GRID_HELPER::BestDragOrigin(), EE_GRID_HELPER::BestSnapAnchor(), PCB_GRID_HELPER::BestSnapAnchor(), PCB_GRID_HELPER::SnapToPad(), and TEST_CLEAR_ANCHORS.
|
inlineinherited |
Definition at line 139 of file grid_helper.h.
References m_maskTypes.
Referenced by BOOST_AUTO_TEST_CASE().
|
inlineinherited |
Clear the skip point by setting it to an unreachable position, thereby preventing matching.
Definition at line 116 of file grid_helper.h.
References m_skipPoint.
Referenced by BOOST_AUTO_TEST_CASE().
|
inherited |
Definition at line 150 of file grid_helper.cpp.
References m_snapManager.
|
private |
computeAnchors inserts the local anchor points in to the grid helper for the specified board item, given the reference point and the direction of use for the point.
aItem | The board item for which to compute the anchors |
aRefPos | The point for which to compute the anchors (if used by the component) |
aFrom | Is this for an anchor that is designating a source point (aFrom=true) or not |
If we are getting a drag point, we don't want to center the edge of pads
Definition at line 1162 of file pcb_grid_helper.cpp.
References SEG::A, GRID_HELPER::addAnchor(), ANGLE_90, SHAPE_LINE_CHAIN::Append(), ARC, SEG::B, BEZIER, BOX2< VECTOR2I >::ByCorners(), SHAPE_SEGMENT::BySizeAndCenter(), CAPTURE_ALWAYS, SEG::Center(), center, BOX2< Vec >::Centre(), CHAMFERED_RECT, CIRCLE, circle(), SHAPE_POLY_SET::CIterateWithHoles(), computeAnchors(), GRID_HELPER::CORNER, PCB_SELECTION_FILTER_OPTIONS::dimensions, EDA_SHAPE::DupPolyPointsList(), end, ERROR_INSIDE, PCB_SELECTION_FILTER_OPTIONS::footprints, EDA_SHAPE::GetArcMid(), BOX2< Vec >::GetBottom(), FOOTPRINT::GetBoundingBox(), REFERENCE_IMAGE::GetBoundingBox(), BOARD_ITEM::GetCenter(), BOX2< Vec >::GetCenter(), PCB_SHAPE::GetCenter(), KIGEOM::GetCircleKeyPoints(), PCB_DIM_ALIGNED::GetCrossbarEnd(), PCB_DIM_ALIGNED::GetCrossbarStart(), PAD::GetDelta(), PAD::GetDrillSize(), PAD::GetEffectivePolygon(), BOX2< Vec >::GetEnd(), EDA_SHAPE::GetEnd(), PCB_DIMENSION_BASE::GetEnd(), PCB_TRACK::GetEnd(), GRID_HELPER::GetGrid(), KIGFX::RENDER_SETTINGS::GetHighContrast(), KIGFX::RENDER_SETTINGS::GetHighContrastLayers(), PCB_DIM_RADIAL::GetKnee(), BOARD_ITEM::GetLayerSet(), BOX2< Vec >::GetLeft(), PAD::GetOrientation(), BOX2< Vec >::GetOrigin(), KIGEOM::GetOvalKeyPoints(), KIGFX::VIEW::GetPainter(), EDA_ITEM::GetPosition(), FOOTPRINT::GetPosition(), PAD::GetPosition(), PCB_SHAPE::GetPosition(), KIGFX::RENDER_SETTINGS::GetPrimaryHighContrastLayer(), BOX2< Vec >::GetRight(), KIGFX::VIEW::GetScale(), SHAPE_LINE_CHAIN::GetSegment(), SHAPE_LINE_CHAIN::GetSegmentCount(), KIGFX::PAINTER::GetSettings(), EDA_SHAPE::GetShape(), PAD::GetShape(), PAD::GetSize(), PAD::GetSizeX(), EDA_SHAPE::GetStart(), PCB_DIMENSION_BASE::GetStart(), PCB_TRACK::GetStart(), EDA_TEXT::GetTextPos(), BOX2< Vec >::GetTop(), REFERENCE_IMAGE::GetTransformOriginOffset(), PCB_SELECTION_FILTER_OPTIONS::graphics, grid, PAD::HasHole(), image, KIGFX::VIEW::IsLayerVisible(), EDA_ITEM::IsMoving(), KIGFX::VIEW::IsVisible(), KI_FALLTHROUGH, LAYER_ANCHOR, m_magneticSettings, GRID_HELPER::m_toolMgr, SHAPE_LINE_CHAIN::Move(), SHAPE_LINE_CHAIN::NearestPoint(), GRID_HELPER::ORIGIN, GRID_HELPER::OUTLINE, OVAL, KIGEOM::OVAL_CAP_TIPS, KIGEOM::OVAL_CARDINAL_EXTREMES, KIGEOM::OVAL_CENTER, KIGEOM::OVAL_SIDE_MIDPOINTS, pad, FOOTPRINT::Pads(), PCB_SELECTION_FILTER_OPTIONS::pads, PadstackUniqueLayerAppliesToLayer(), PCB_ARC_T, PCB_DIM_ALIGNED_T, PCB_DIM_CENTER_T, PCB_DIM_LEADER_T, PCB_DIM_ORTHOGONAL_T, PCB_DIM_RADIAL_T, PCB_FIELD_T, PCB_FOOTPRINT_T, PCB_GROUP_T, PCB_MARKER_T, PCB_PAD_T, PCB_POINT_T, PCB_REFERENCE_IMAGE_T, PCB_SHAPE_T, PCB_TABLE_T, PCB_TARGET_T, PCB_TEXT_T, PCB_TEXTBOX_T, PCB_TRACE_T, PCB_VIA_T, PCB_ZONE_T, FOOTPRINT::Points(), PCB_SELECTION_FILTER_OPTIONS::points, POLY, PT_CENTER, PT_CORNER, PT_END, PT_MID, PT_QUADRANT, RECTANGLE, SHAPE_LINE_CHAIN::Rotate(), RotatePoint(), ROUNDRECT, SEGMENT, SHAPE_LINE_CHAIN::SetClosed(), PAD::ShapePos(), GRID_HELPER::SNAPPABLE, table, PCB_SELECTION_FILTER_OPTIONS::text, PCB_SELECTION_FILTER_OPTIONS::tracks, TRAPEZOID, EDA_ITEM::Type(), PCB_SELECTION_FILTER_OPTIONS::vias, KIGFX::VIEW_ITEM::ViewGetLOD(), VECTOR2< T >::x, VECTOR2< T >::y, and PCB_SELECTION_FILTER_OPTIONS::zones.
|
private |
computeAnchors inserts the local anchor points in to the grid helper for the specified container of board items, including points implied by intersections or other relationships between the items.
Definition at line 967 of file pcb_grid_helper.cpp.
References GRID_HELPER::addAnchor(), computeAnchors(), GRID_HELPER::CONSTRUCTED, CONSTRUCTION_MANAGER::CONSTRUCTION_ITEM::DRAWABLE_ENTRY::Drawable, PCB_INTERSECTABLE::Geometry, BOARD_ITEM::GetLayerSet(), GRID_HELPER::getSnapManager(), PCB_SELECTION_FILTER_OPTIONS::graphics, PCB_INTERSECTABLE::Item, m_magneticSettings, m_pointOnLineCandidates, PCB_ARC_T, PCB_REFERENCE_IMAGE_T, PCB_SHAPE_T, PCB_TRACE_T, PT_INTERSECTION, PT_NONE, GRID_HELPER::SNAPPABLE, PCB_SELECTION_FILTER_OPTIONS::tracks, and EDA_ITEM::Type().
Referenced by BestDragOrigin(), BestSnapAnchor(), computeAnchors(), computeAnchors(), and SnapToPad().
|
protectedinherited |
Definition at line 345 of file grid_helper.cpp.
References KiROUND(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by AlignGrid(), and AlignGrid().
|
protectedinherited |
Enable the anchor debug if permitted and return it.
Returns nullptr if not permitted by the advancd config
Definition at line 108 of file grid_helper.cpp.
References KIGFX::VIEW::Add(), ADVANCED_CFG::GetCfg(), m_anchorDebug, ADVANCED_CFG::m_EnableSnapAnchorsDebug, m_toolMgr, and KIGFX::VIEW::SetVisible().
Referenced by EE_GRID_HELPER::BestSnapAnchor(), and PCB_GRID_HELPER::BestSnapAnchor().
|
inherited |
Definition at line 266 of file grid_helper.cpp.
References KiROUND(), m_manualGrid, m_toolMgr, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by Align(), AlignGrid(), BOOST_AUTO_TEST_CASE(), and PCB_GRID_HELPER::computeAnchors().
|
overridevirtual |
Return the size of the specified grid.
Reimplemented from GRID_HELPER.
Definition at line 834 of file pcb_grid_helper.cpp.
References grid, GRID_CONNECTABLE, GRID_GRAPHICS, GRID_TEXT, GRID_VIAS, GRID_WIRES, GRID_HELPER::m_toolMgr, and pcbIUScale.
Referenced by BestSnapAnchor().
|
overridevirtual |
Get the coarsest grid that applies to an item.
Reimplemented from GRID_HELPER.
Definition at line 799 of file pcb_grid_helper.cpp.
References GRID_CONNECTABLE, GRID_CURRENT, GRID_GRAPHICS, GRID_TEXT, GRID_VIAS, GRID_WIRES, PCB_ARC_T, PCB_BARCODE_T, PCB_DIMENSION_T, PCB_FIELD_T, PCB_FOOTPRINT_T, PCB_PAD_T, PCB_REFERENCE_IMAGE_T, PCB_SHAPE_T, PCB_TEXT_T, PCB_TEXTBOX_T, PCB_TRACE_T, PCB_VIA_T, and EDA_ITEM::Type().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inherited |
Definition at line 279 of file grid_helper.cpp.
References m_manualOrigin, and m_toolMgr.
Referenced by Align(), Align(), AlignGrid(), AlignGrid(), and BOOST_AUTO_TEST_CASE().
|
virtualinherited |
Gets the coarsest grid that applies to a selecion of items.
Reimplemented in EE_GRID_HELPER.
Definition at line 291 of file grid_helper.cpp.
References SELECTION::Front(), GetGridSize(), GetItemGrid(), and grid.
|
inlineinherited |
Definition at line 122 of file grid_helper.h.
References m_enableSnap.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and DRAWING_TOOL::DrawVia().
|
inlineprotectedinherited |
Definition at line 226 of file grid_helper.h.
References m_snapManager.
Referenced by PCB_GRID_HELPER::AddConstructionItems(), EE_GRID_HELPER::BestSnapAnchor(), PCB_GRID_HELPER::BestSnapAnchor(), PCB_GRID_HELPER::computeAnchors(), and PCB_GRID_HELPER::nearestAnchor().
BOARD_ITEM * PCB_GRID_HELPER::GetSnapped | ( | ) | const |
Function GetSnapped If the PCB_GRID_HELPER has highlighted a snap point (target shown), this function will return a pointer to the item to which it snapped.
Definition at line 785 of file pcb_grid_helper.cpp.
References GRID_HELPER::m_snapItem.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inherited |
Definition at line 387 of file grid_helper.cpp.
References m_snapItem.
Referenced by BOOST_AUTO_TEST_CASE(), and PCB_PICKER_TOOL::SelectPointInteractively().
|
inlineinherited |
Definition at line 125 of file grid_helper.h.
References m_enableGrid.
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inherited |
Definition at line 273 of file grid_helper.cpp.
References m_manualVisibleGrid, and m_toolMgr.
Referenced by PCB_GRID_HELPER::BestSnapAnchor(), and BOOST_AUTO_TEST_CASE().
|
private |
Find the nearest anchor point to the given position with matching flags.
return | The nearest anchor point, or nullptr if none found |
Definition at line 1760 of file pcb_grid_helper.cpp.
References anchor, GRID_HELPER::CONSTRUCTED, ADVANCED_CFG::GetCfg(), SNAP_MANAGER::GetConstructionManager(), GRID_HELPER::getSnapManager(), CONSTRUCTION_MANAGER::InvolvesAllGivenRealItems(), KIGFX::VIEW_ITEM::IsBOARD_ITEM(), GRID_HELPER::m_anchors, and ADVANCED_CFG::m_EnableExtensionSnaps.
Referenced by BestDragOrigin(), and BestSnapAnchor().
|
inlinevirtualinherited |
Reimplemented in APPEARANCE_CONTROLS, DIALOG_FIND, DIALOG_GENERATORS, PCB_NET_INSPECTOR_PANEL, and PCB_SEARCH_PANE.
Definition at line 296 of file board.h.
Referenced by BOARD::OnItemsCompositeUpdate().
|
inlinevirtualinherited |
Reimplemented in PCB_NET_INSPECTOR_PANEL, and PCB_SEARCH_PANE.
Definition at line 294 of file board.h.
Referenced by BOARD::HighLightON(), BOARD::ResetNetHighLight(), and BOARD::SetHighLightNet().
|
inlinevirtualinherited |
Reimplemented in APPEARANCE_CONTROLS, DIALOG_FIND, DIALOG_GENERATORS, PCB_NET_INSPECTOR_PANEL, and PCB_SEARCH_PANE.
Definition at line 287 of file board.h.
Referenced by BOARD::Add().
|
inlinevirtualinherited |
Reimplemented in APPEARANCE_CONTROLS, DIALOG_FIND, DIALOG_GENERATORS, PCB_NET_INSPECTOR_PANEL, and PCB_SEARCH_PANE.
Definition at line 292 of file board.h.
Referenced by BOARD::OnItemChanged().
|
inlineoverridevirtual |
Reimplemented from BOARD_LISTENER.
Definition at line 75 of file pcb_grid_helper.h.
References GRID_HELPER::m_snapItem.
Referenced by BOOST_AUTO_TEST_CASE().
|
inlinevirtualinherited |
Reimplemented in APPEARANCE_CONTROLS, DIALOG_FIND, DIALOG_GENERATORS, PCB_NET_INSPECTOR_PANEL, and PCB_SEARCH_PANE.
Definition at line 288 of file board.h.
Referenced by BOARD::FinalizeBulkAdd().
|
inlinevirtualinherited |
Reimplemented in APPEARANCE_CONTROLS, DIALOG_FIND, DIALOG_GENERATORS, PCB_NET_INSPECTOR_PANEL, and PCB_SEARCH_PANE.
Definition at line 293 of file board.h.
Referenced by BOARD::OnItemsChanged().
|
inlinevirtualinherited |
Reimplemented in APPEARANCE_CONTROLS, DIALOG_FIND, DIALOG_GENERATORS, PCB_NET_INSPECTOR_PANEL, and PCB_SEARCH_PANE.
Definition at line 290 of file board.h.
Referenced by BOARD::FinalizeBulkRemove().
|
inlinevirtualinherited |
Reimplemented in APPEARANCE_CONTROLS, PCB_NET_INSPECTOR_PANEL, and PCB_SEARCH_PANE.
Definition at line 291 of file board.h.
Referenced by BOARD::SynchronizeNetsAndNetClasses().
|
inlinevirtualinherited |
Reimplemented in PCB_SEARCH_PANE.
Definition at line 295 of file board.h.
Referenced by BOARD::OnRatsnestChanged().
|
private |
Definition at line 888 of file pcb_grid_helper.cpp.
References KIGFX::RENDER_SETTINGS::GetHighContrast(), KIGFX::RENDER_SETTINGS::GetHighContrastLayers(), KIGFX::VIEW::GetPainter(), BOARD_ITEM::GetParentFootprint(), KIGFX::VIEW::GetScale(), KIGFX::PAINTER::GetSettings(), PCB_TOOL_BASE::IsFootprintEditor(), IsPcbLayer(), KIGFX::VIEW::IsVisible(), GRID_HELPER::m_toolMgr, PCB_FOOTPRINT_T, KIGFX::VIEW::Query(), RECURSE, BOARD_ITEM::RunOnChildren(), EDA_ITEM::Type(), and KIGFX::VIEW_ITEM::ViewGetLOD().
Referenced by BestSnapAnchor().
|
inherited |
Definition at line 314 of file grid_helper.cpp.
References m_auxAxis, m_toolMgr, and m_viewAxis.
Referenced by BOOST_AUTO_TEST_CASE().
|
inlineinherited |
Definition at line 68 of file grid_helper.h.
References m_manualGrid.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inlineinherited |
Definition at line 71 of file grid_helper.h.
References m_manualGridSnapping.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inlineinherited |
Definition at line 137 of file grid_helper.h.
References m_maskTypes.
Referenced by BOOST_AUTO_TEST_CASE().
|
inlineinherited |
Definition at line 138 of file grid_helper.h.
References m_maskTypes.
Referenced by BOOST_AUTO_TEST_CASE().
|
inlineinherited |
Definition at line 70 of file grid_helper.h.
References m_manualOrigin.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inlineinherited |
Definition at line 108 of file grid_helper.h.
References m_skipPoint.
Referenced by BOOST_AUTO_TEST_CASE().
|
inlineinherited |
Definition at line 121 of file grid_helper.h.
References m_enableSnap.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), DRAWING_TOOL::DrawVia(), and PCB_PICKER_TOOL::SelectPointInteractively().
|
inlineinherited |
Definition at line 127 of file grid_helper.h.
References m_enableSnapLine.
|
inherited |
Definition at line 134 of file grid_helper.cpp.
References m_snapManager.
|
inherited |
Definition at line 145 of file grid_helper.cpp.
References m_snapManager.
|
inherited |
Definition at line 140 of file grid_helper.cpp.
References m_snapManager.
|
inlineinherited |
Definition at line 124 of file grid_helper.h.
References m_enableGrid.
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inlineinherited |
Definition at line 69 of file grid_helper.h.
References m_manualVisibleGrid.
Referenced by BOOST_AUTO_TEST_CASE().
|
protectedinherited |
Definition at line 127 of file grid_helper.cpp.
References m_constructionGeomPreview, and m_toolMgr.
Referenced by EE_GRID_HELPER::BestSnapAnchor(), and PCB_GRID_HELPER::BestSnapAnchor().
|
inherited |
Definition at line 156 of file grid_helper.cpp.
References std::abs(), canUseGrid(), delta, VECTOR2< T >::EuclideanNorm(), SNAP_LINE_MANAGER::GetActiveDirection(), SNAP_LINE_MANAGER::GetDirections(), SNAP_LINE_MANAGER::GetSnapLineOrigin(), KiROUND(), m_skipPoint, m_snapManager, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by EE_GRID_HELPER::BestSnapAnchor(), and PCB_GRID_HELPER::BestSnapAnchor().
Definition at line 436 of file pcb_grid_helper.cpp.
References GRID_HELPER::clearAnchors(), computeAnchors(), EDA_ITEM::HitTest(), GRID_HELPER::m_anchors, GRID_HELPER::ORIGIN, and GRID_HELPER::ANCHOR::pos.
|
protectedinherited |
Definition at line 251 of file grid_helper.cpp.
References KIGFX::GEOMETRY, TYPED_POINT2I::m_point, m_toolMgr, TYPED_POINT2I::m_types, and m_viewSnapPoint.
Referenced by PCB_GRID_HELPER::BestSnapAnchor().
|
friend |
Definition at line 46 of file pcb_grid_helper.h.
References GRID_HELPER::Align(), GRID_HELPER::AlignGrid(), GRID_CURRENT, and PCBGridHelperTestFixture.
Referenced by PCBGridHelperTestFixture.
|
privateinherited |
#VIEW_ITEM for visualising anchor points, if enabled.
Definition at line 268 of file grid_helper.h.
Referenced by enableAndGetAnchorDebug(), and ~GRID_HELPER().
|
protectedinherited |
Definition at line 237 of file grid_helper.h.
Referenced by addAnchor(), EE_GRID_HELPER::BestSnapAnchor(), PCB_GRID_HELPER::BestSnapAnchor(), clearAnchors(), EE_GRID_HELPER::nearestAnchor(), PCB_GRID_HELPER::nearestAnchor(), and PCB_GRID_HELPER::SnapToPad().
|
protectedinherited |
Definition at line 240 of file grid_helper.h.
Referenced by Align(), and SetAuxAxes().
|
privateinherited |
Show construction geometry (if any) on the canvas.
Definition at line 262 of file grid_helper.h.
Referenced by EE_GRID_HELPER::GetGrid(), GRID_HELPER(), showConstructionGeometry(), and ~GRID_HELPER().
|
protectedinherited |
Definition at line 245 of file grid_helper.h.
Referenced by PCB_GRID_HELPER::BestSnapAnchor(), canUseGrid(), GetUseGrid(), GRID_HELPER(), and SetUseGrid().
|
protectedinherited |
Definition at line 244 of file grid_helper.h.
Referenced by PCB_GRID_HELPER::AlignToArc(), PCB_GRID_HELPER::AlignToSegment(), EE_GRID_HELPER::BestSnapAnchor(), PCB_GRID_HELPER::BestSnapAnchor(), GetSnap(), GRID_HELPER(), and SetSnap().
|
protectedinherited |
Definition at line 246 of file grid_helper.h.
Referenced by EE_GRID_HELPER::BestSnapAnchor(), PCB_GRID_HELPER::BestSnapAnchor(), GRID_HELPER(), and SetSnapLine().
|
private |
Definition at line 153 of file pcb_grid_helper.h.
Referenced by BestSnapAnchor(), computeAnchors(), computeAnchors(), PCB_GRID_HELPER(), and PCB_GRID_HELPER().
|
protectedinherited |
Definition at line 255 of file grid_helper.h.
Referenced by PCB_GRID_HELPER::Align(), GetGrid(), GetGridSize(), GRID_HELPER(), and SetGridSize().
|
protectedinherited |
Definition at line 258 of file grid_helper.h.
Referenced by PCB_GRID_HELPER::AlignGrid(), canUseGrid(), GRID_HELPER(), and SetGridSnapping().
|
protectedinherited |
Definition at line 257 of file grid_helper.h.
Referenced by PCB_GRID_HELPER::AlignGrid(), GetOrigin(), GRID_HELPER(), and SetOrigin().
|
protectedinherited |
Definition at line 256 of file grid_helper.h.
Referenced by PCB_GRID_HELPER::AlignGrid(), GetVisibleGrid(), GRID_HELPER(), and SetVisibleGridSize().
|
protectedinherited |
Definition at line 242 of file grid_helper.h.
Referenced by addAnchor(), ClearMaskFlag(), GRID_HELPER(), SetMask(), and SetMaskFlag().
|
private |
Definition at line 155 of file pcb_grid_helper.h.
Referenced by BestSnapAnchor(), and computeAnchors().
|
protectedinherited |
Definition at line 249 of file grid_helper.h.
Referenced by EE_GRID_HELPER::BestSnapAnchor(), PCB_GRID_HELPER::BestSnapAnchor(), ClearSkipPoint(), SetSkipPoint(), and SnapToConstructionLines().
|
protectedinherited |
Definition at line 247 of file grid_helper.h.
Referenced by EE_GRID_HELPER::BestSnapAnchor(), PCB_GRID_HELPER::BestSnapAnchor(), EE_GRID_HELPER::GetSnapped(), PCB_GRID_HELPER::GetSnapped(), GetSnappedPoint(), GRID_HELPER(), and PCB_GRID_HELPER::OnBoardItemRemoved().
|
privateinherited |
Manage the construction geometry, snap lines, reference points, etc.
Definition at line 265 of file grid_helper.h.
Referenced by ClearSnapLine(), EE_GRID_HELPER::GetGrid(), getSnapManager(), GRID_HELPER(), SetSnapLineDirections(), SetSnapLineEnd(), SetSnapLineOrigin(), and SnapToConstructionLines().
|
protectedinherited |
Definition at line 239 of file grid_helper.h.
Referenced by EE_GRID_HELPER::BestDragOrigin(), PCB_GRID_HELPER::BestDragOrigin(), EE_GRID_HELPER::BestSnapAnchor(), PCB_GRID_HELPER::BestSnapAnchor(), canUseGrid(), PCB_GRID_HELPER::computeAnchors(), EE_GRID_HELPER::EE_GRID_HELPER(), enableAndGetAnchorDebug(), EE_GRID_HELPER::GetGrid(), GetGrid(), EE_GRID_HELPER::GetGridSize(), GetGridSize(), PCB_GRID_HELPER::GetGridSize(), GetOrigin(), GetVisibleGrid(), GRID_HELPER(), GRID_HELPER(), PCB_GRID_HELPER::PCB_GRID_HELPER(), EE_GRID_HELPER::queryVisible(), PCB_GRID_HELPER::queryVisible(), SetAuxAxes(), showConstructionGeometry(), updateSnapPoint(), EE_GRID_HELPER::~EE_GRID_HELPER(), ~GRID_HELPER(), and PCB_GRID_HELPER::~PCB_GRID_HELPER().
|
protectedinherited |
Definition at line 252 of file grid_helper.h.
Referenced by EE_GRID_HELPER::EE_GRID_HELPER(), PCB_GRID_HELPER::PCB_GRID_HELPER(), SetAuxAxes(), EE_GRID_HELPER::~EE_GRID_HELPER(), and PCB_GRID_HELPER::~PCB_GRID_HELPER().
|
protectedinherited |
Definition at line 251 of file grid_helper.h.
Referenced by EE_GRID_HELPER::BestSnapAnchor(), PCB_GRID_HELPER::BestSnapAnchor(), EE_GRID_HELPER::EE_GRID_HELPER(), PCB_GRID_HELPER::PCB_GRID_HELPER(), updateSnapPoint(), EE_GRID_HELPER::~EE_GRID_HELPER(), and PCB_GRID_HELPER::~PCB_GRID_HELPER().