22#ifndef PCB_GRID_HELPER_H
23#define PCB_GRID_HELPER_H
25#include <initializer_list>
91 const std::vector<BOARD_ITEM*>& aSkip = {},
92 std::optional<VECTOR2I> aMovingReferencePoint = std::nullopt );
109 bool aIsPersistent );
146 std::vector<BOARD_ITEM*>
queryVisible( std::initializer_list<BOX2I> aAreas,
147 const std::vector<BOARD_ITEM*>& aSkip )
const;
163 const LSET* aLayers,
bool aForDrag );
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Information pertinent to a Pcbnew printed circuit board.
A base class for most all the KiCad significant classes used in schematics and boards.
virtual VECTOR2I Align(const VECTOR2I &aPoint, GRID_HELPER_GRIDS aGrid) const
virtual VECTOR2I AlignGrid(const VECTOR2I &aPoint, GRID_HELPER_GRIDS aGrid) const
LSET is a set of PCB_LAYER_IDs.
std::vector< NEARABLE_GEOM > m_pointOnLineCandidates
void OnBoardItemRemoved(BOARD &aBoard, BOARD_ITEM *aRemovedItem) override
std::vector< BOARD_ITEM * > queryVisible(std::initializer_list< BOX2I > aAreas, const std::vector< BOARD_ITEM * > &aSkip) const
static std::vector< ANCHOR_SPEC > GetArcAnchors(const PCB_ARC &aArc, bool aFrom)
Return the snap/drag anchor points that a track arc contributes.
SNAP_RESULT ResolveSnap(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 it...
SNAP_INFERENCE_SETTINGS snapInferenceSettings() const
Snap inference settings for whichever editor owns this helper.
~PCB_GRID_HELPER() override
VECTOR2I AlignToArc(const VECTOR2I &aPoint, const SHAPE_ARC &aSeg)
VECTOR2I SnapToPad(const VECTOR2I &aMousePos, std::deque< PAD * > &aPads)
void OnBoardItemsRemoved(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItems) override
BOARD_ITEM * GetSnapped() const
Function GetSnapped If the PCB_GRID_HELPER has highlighted a snap point (target shown),...
VECTOR2D GetGridSize(GRID_HELPER_GRIDS aGrid) const override
Return the size of the specified grid.
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)
bool editingInsideFootprint() const
True when the footprint's own contents are the layout objects.
void AddConstructionItems(std::vector< BOARD_ITEM * > aItems, bool aExtensionOnly, bool aIsPersistent)
Add construction geometry for a set of board items.
ANCHOR * nearestAnchor(const VECTOR2I &aPos, int aFlags)
Find the nearest anchor point to the given position with matching flags.
friend class PCBGridHelperTestFixture
static BOX2I layoutBounds(const BOARD_ITEM &aItem)
MAGNETIC_SETTINGS * m_magneticSettings
GRID_HELPER_GRIDS GetItemGrid(const EDA_ITEM *aItem) const override
Get the coarsest grid that applies to an item.
VECTOR2I AlignToSegment(const VECTOR2I &aPoint, const SEG &aSeg)
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 b...
A single anchor point contributed by an item, before it is registered with the helper.
This file contains data structures that are saved in the project file or project local settings file ...
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D