108 m_skipPoint =
VECTOR2I( std::numeric_limits<int>::min(), std::numeric_limits<int>::min() );
153 ANCHOR(
const VECTOR2I& aPos,
int aFlags,
int aPointTypes, std::vector<EDA_ITEM*> aItems ) :
177 int aPointTypes = POINT_TYPE::PT_NONE )
179 addAnchor( aPos, aFlags, std::vector<EDA_ITEM*>{ aItem }, aPointTypes );
186 m_anchors.emplace_back(
ANCHOR( aPos, aFlags, aPointTypes, std::move( aItems ) ) );
A base class for most all the KiCad significant classes used in schematics and boards.
KIGFX::CONSTRUCTION_GEOM m_constructionGeomPreview
std::optional< VECTOR2I > m_auxAxis
VECTOR2I computeNearest(const VECTOR2I &aPoint, const VECTOR2I &aGrid, const VECTOR2I &aOffset) const
void addAnchor(const VECTOR2I &aPos, int aFlags, EDA_ITEM *aItem, int aPointTypes=POINT_TYPE::PT_NONE)
SNAP_MANAGER & getSnapManager()
virtual GRID_HELPER_GRIDS GetItemGrid(const EDA_ITEM *aItem) const
Gets the coarsest grid that applies to an item.
void SetSkipPoint(const VECTOR2I &aPoint)
void showConstructionGeometry(bool aShow)
SNAP_MANAGER m_snapManager
void addAnchor(const VECTOR2I &aPos, int aFlags, std::vector< EDA_ITEM * > aItems, int aPointTypes)
void ClearSkipPoint()
We clear the skip point by setting it to an unreachable position, thereby preventing matching.
virtual GRID_HELPER_GRIDS GetSelectionGrid(const SELECTION &aSelection) const
Gets the coarsest grid that applies to a selecion of items.
void SetUseGrid(bool aSnapToGrid)
std::optional< VECTOR2I > GetSnappedPoint() const
void SetAuxAxes(bool aEnable, const VECTOR2I &aOrigin=VECTOR2I(0, 0))
VECTOR2D GetVisibleGrid() const
std::unique_ptr< KIGFX::ANCHOR_DEBUG > m_anchorDebug
VIEW_ITEM for visualising anchor points, if enabled.
virtual VECTOR2D GetGridSize(GRID_HELPER_GRIDS aGrid) const
Return the size of the specified grid.
VECTOR2I GetOrigin() const
bool canUseGrid() const
Check whether it is possible to use the grid – this depends both on local grid helper settings and gl...
std::optional< ANCHOR > m_snapItem
KIGFX::ANCHOR_DEBUG * enableAndGetAnchorDebug()
Enable the anchor debug if permitted and return it.
void SetMaskFlag(int aFlag)
KIGFX::SNAP_INDICATOR m_viewSnapPoint
virtual VECTOR2I Align(const VECTOR2I &aPoint, GRID_HELPER_GRIDS aGrid) const
void updateSnapPoint(const TYPED_POINT2I &aPoint)
KIGFX::ORIGIN_VIEWITEM m_viewAxis
void ClearMaskFlag(int aFlag)
void SetSnapLine(bool aSnap)
std::vector< ANCHOR > m_anchors
virtual VECTOR2I AlignGrid(const VECTOR2I &aPoint, GRID_HELPER_GRIDS aGrid) const
View item to draw debug items for anchors.
Shows construction geometry for things like line extensions, arc centers, etc.
View item to draw an origin marker with an optional snap type indicator.
A SNAP_MANAGER glues together the snap line manager and construction manager., along with some other ...
T EuclideanNorm() const
Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2).
ANCHOR(const VECTOR2I &aPos, int aFlags, int aPointTypes, std::vector< EDA_ITEM * > aItems)
std::vector< EDA_ITEM * > items
double Distance(const VECTOR2I &aP) const
bool InvolvesItem(const EDA_ITEM &aItem) const
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D