26using namespace std::placeholders;
131 KiROUND( (
double) ( aPoint.
y - aOffset.
y ) / aGrid.
y ) * aGrid.
y + aOffset.
y );
A base class for most all the KiCad significant classes used in schematics and boards.
std::optional< VECTOR2I > m_auxAxis
VECTOR2I computeNearest(const VECTOR2I &aPoint, const VECTOR2I &aGrid, const VECTOR2I &aOffset) const
GRID_HELPER(TOOL_MANAGER *aToolMgr)
virtual GRID_HELPER_GRIDS GetItemGrid(const EDA_ITEM *aItem) const
Gets the coarsest grid that applies to an item.
virtual GRID_HELPER_GRIDS GetSelectionGrid(const SELECTION &aSelection) const
Gets the coarsest grid that applies to a selecion of items.
void SetAuxAxes(bool aEnable, const VECTOR2I &aOrigin=VECTOR2I(0, 0))
VECTOR2D GetVisibleGrid() const
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...
virtual VECTOR2I Align(const VECTOR2I &aPoint, GRID_HELPER_GRIDS aGrid) const
KIGFX::ORIGIN_VIEWITEM m_viewAxis
virtual VECTOR2I AlignGrid(const VECTOR2I &aPoint, GRID_HELPER_GRIDS aGrid) const
const VECTOR2D & GetGridOrigin() const
VECTOR2D GetVisibleGridSize() const
Return the visible grid size in x and y directions.
const VECTOR2D & GetGridSize() const
Return the grid size.
bool GetGridSnapping() const
void SetPosition(const VECTOR2I &aPosition) override
GAL * GetGAL() const
Return the #GAL this view is using to draw graphical primitives.
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Set the item visibility.
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".