KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PCB_GRID_HELPER Class Reference

#include <pcb_grid_helper.h>

Inheritance diagram for PCB_GRID_HELPER:
GRID_HELPER BOARD_LISTENER

Classes

struct  ANCHOR_SPEC
 A single anchor point contributed by an item, before it is registered with the helper. More...
 

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_ITEMGetSnapped () 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)
 
void OnBoardItemRemoved (BOARD &aBoard, BOARD_ITEM *aRemovedItem) override
 
void OnBoardItemsRemoved (BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItems) override
 
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 item.
 
SNAP_RESULT ResolveSnap (const VECTOR2I &aOrigin, const LSET &aLayers, GRID_HELPER_GRIDS aGrid=GRID_HELPER_GRIDS::GRID_CURRENT, const std::vector< BOARD_ITEM * > &aSkip={}, std::optional< VECTOR2I > aMovingReferencePoint=std::nullopt)
 
void ClearSnapFeedback ()
 
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
 
virtual void FullReset ()
 Reset all internal state.
 
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< VECTOR2ISnapToConstructionLines (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< VECTOR2IGetSnappedPoint () const
 
void SetAngleRestriction (std::optional< VECTOR2I > aOrigin, double aStepDegrees)
 Restrict snapping to a set of angle branches emanating from an origin.
 
void SetPointEditProfile (bool aEnabled)
 
void SetStationarySelfGeometry (std::vector< VECTOR2I > aPoints, std::vector< SEG > aSegments)
 
void SetFeasibilityCallback (SNAP_RESOLVER::FEASIBILITY_CALLBACK aCallback)
 
virtual void OnBoardItemAdded (BOARD &aBoard, BOARD_ITEM *aBoardItem)
 
virtual void OnBoardItemsAdded (BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItems)
 
virtual void OnBoardNetSettingsChanged (BOARD &aBoard)
 
virtual void OnBoardItemChanged (BOARD &aBoard, BOARD_ITEM *aBoardItem)
 
virtual void OnBoardItemsChanged (BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItems)
 
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)
 

Static Public Member Functions

static std::vector< ANCHOR_SPECGetArcAnchors (const PCB_ARC &aArc, bool aFrom)
 Return the snap/drag anchor points that a track arc contributes.
 

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
 
SNAP_RANGES computeSnapRanges (bool aClampToVisibleGrid) const
 Compute the snap thresholds.
 
void emitAngleBranchCandidates (std::vector< SNAP_CANDIDATE > &aCandidates, const VECTOR2I &aOrigin, double aSnapScale) const
 Emit the angle-restriction snap candidates (the two branches bracketing the cursor angle) into the current frame.
 
void emitSelfAndGridCandidates (std::vector< SNAP_CANDIDATE > &aCandidates, const SNAP_SOURCE_CONTEXT &aContext, const VECTOR2I &aOrigin, const VECTOR2I &aNearestGrid, double aSnapScale, int aSnapRange, bool aUseGrid) const
 Emit the point editor's unchanged self-geometry and the independent grid axes.
 
SNAP_RESOLVER::TRACE_CALLBACK snapTraceCallback (const SNAP_SOURCE_CONTEXT &aContext) const
 
void retainAcceptedSnaps (const SNAP_RESULT &aResult)
 Record which snaps the resolver accepted so they can be re-biased on the next resolve, and separately track the accepted angle branch for the next frame.
 
void applySnapResultGuides (const SNAP_RESULT &aResult)
 
void showConstructionGeometry (bool aShow)
 
SNAP_MANAGERgetSnapManager ()
 
void updateSnapPoint (const TYPED_POINT2I &aPoint)
 
KIGFX::ANCHOR_DEBUGenableAndGetAnchorDebug ()
 Enable the anchor debug if permitted and return it.
 
void setLayoutReference (const VECTOR2I &aPoint, const std::optional< BOX2I > &aBounds, bool aAnchorPoint)
 Record the classified drag reference and trace it.
 

Static Protected Member Functions

static SNAP_REFERENCE_PREFERENCE classifyReference (const VECTOR2I &aPoint, const BOX2I &aBounds, bool aAnchorPoint)
 Classify the point a drag was started from against the moving object's bounds.
 

Protected Attributes

std::vector< ANCHORm_anchors
 
TOOL_MANAGERm_toolMgr
 
std::optional< VECTOR2Im_auxAxis
 
int m_maskTypes
 
bool m_enableSnap
 
bool m_enableGrid
 
bool m_enableSnapLine
 
std::optional< ANCHORm_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
 
std::optional< VECTOR2Im_angleOrigin
 
double m_angleStepDegrees = 0.0
 
std::optional< SNAP_STABLE_IDm_retainedAngleBranch
 
std::vector< SNAP_STABLE_IDm_stickySnapIds
 
SNAP_RESOLVER::FEASIBILITY_CALLBACK m_feasibilityCallback
 
std::vector< VECTOR2Im_stationarySelfPoints
 
std::vector< SEGm_stationarySelfSegments
 
bool m_pointEditProfile = false
 
SNAP_REFERENCE_PREFERENCE m_layoutReferencePreference
 

Private Member Functions

bool editingInsideFootprint () const
 True when the footprint's own contents are the layout objects.
 
SNAP_INFERENCE_SETTINGS snapInferenceSettings () const
 Snap inference settings for whichever editor owns this helper.
 
std::vector< BOARD_ITEM * > queryVisible (std::initializer_list< BOX2I > aAreas, const std::vector< BOARD_ITEM * > &aSkip) const
 
ANCHORnearestAnchor (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.
 

Static Private Member Functions

static BOX2I layoutBounds (const BOARD_ITEM &aItem)
 

Private Attributes

MAGNETIC_SETTINGSm_magneticSettings
 
std::vector< NEARABLE_GEOMm_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_DEBUGm_anchorDebug
 #VIEW_ITEM for visualising anchor points, if enabled.
 

Friends

class PCBGridHelperTestFixture
 

Detailed Description

Definition at line 44 of file pcb_grid_helper.h.

Member Enumeration Documentation

◆ ANCHOR_FLAGS

enum GRID_HELPER::ANCHOR_FLAGS
inherited
Enumerator
CORNER 
OUTLINE 
SNAPPABLE 
ORIGIN 
VERTICAL 
HORIZONTAL 
CONSTRUCTED 
ALL 

Definition at line 197 of file grid_helper.h.

Constructor & Destructor Documentation

◆ PCB_GRID_HELPER() [1/2]

PCB_GRID_HELPER::PCB_GRID_HELPER ( )

Definition at line 152 of file pcb_grid_helper.cpp.

References GRID_HELPER::GRID_HELPER(), and m_magneticSettings.

◆ PCB_GRID_HELPER() [2/2]

◆ ~PCB_GRID_HELPER()

PCB_GRID_HELPER::~PCB_GRID_HELPER ( )
override

Member Function Documentation

◆ addAnchor() [1/2]

void GRID_HELPER::addAnchor ( const VECTOR2I & aPos,
int aFlags,
EDA_ITEM * aItem,
int aPointTypes = POINT_TYPE::PT_NONE )
inlineprotectedinherited

◆ addAnchor() [2/2]

void GRID_HELPER::addAnchor ( const VECTOR2I & aPos,
int aFlags,
std::vector< EDA_ITEM * > aItems,
int aPointTypes )
inlineprotectedinherited

Definition at line 255 of file grid_helper.h.

References m_anchors, and m_maskTypes.

◆ AddConstructionItems()

void PCB_GRID_HELPER::AddConstructionItems ( std::vector< BOARD_ITEM * > aItems,
bool aExtensionOnly,
bool aIsPersistent )

Add construction geometry for a set of board items.

Parameters
aItemsThe items for which to add construction geometry
aExtensionOnlyIf true, the construction geometry only includes extensions of the items, if false it also overlays the items themselves.
aIsPersistentIf true, the construction geometry is considered "persistent" and will always be shown and won't be replaced by later temporary geometry.

Definition at line 206 of file pcb_grid_helper.cpp.

References ARC, KIGEOM::BoxToSegs(), CIRCLE, ELLIPSE, ELLIPSE_ARC, CONSTRUCTION_MANAGER::FROM_ITEMS, EDA_SHAPE::GetArcMid(), REFERENCE_IMAGE::GetBoundingBox(), PCB_SHAPE::GetCenter(), ADVANCED_CFG::GetCfg(), SNAP_MANAGER::GetConstructionManager(), EDA_SHAPE::GetEllipseCenter(), 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(), snapInferenceSettings(), and EDA_ITEM::Type().

Referenced by ResolveSnap().

◆ Align() [1/3]

VECTOR2I GRID_HELPER::Align ( const VECTOR2I & aPoint) const
virtual

Reimplemented from GRID_HELPER.

Definition at line 111 of file grid_helper.cpp.

References GRID_HELPER::m_constructionGeomPreview.

◆ Align() [2/3]

VECTOR2I GRID_HELPER::Align ( const VECTOR2I & aPoint,
const VECTOR2D & aGrid,
const VECTOR2D & aOffset ) const
virtual

Reimplemented from GRID_HELPER.

Definition at line 112 of file grid_helper.cpp.

References GRID_HELPER::m_anchorDebug.

◆ Align() [3/3]

virtual VECTOR2I GRID_HELPER::Align ( const VECTOR2I & aPoint,
GRID_HELPER_GRIDS aGrid ) const
inlinevirtual

Reimplemented from GRID_HELPER.

Definition at line 101 of file grid_helper.h.

Referenced by AlignToArc(), AlignToSegment(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and ResolveSnap().

◆ AlignGrid() [1/3]

VECTOR2I GRID_HELPER::AlignGrid ( const VECTOR2I & aPoint) const

Definition at line 115 of file grid_helper.cpp.

◆ AlignGrid() [2/3]

VECTOR2I GRID_HELPER::AlignGrid ( const VECTOR2I & aPoint,
const VECTOR2D & aGrid,
const VECTOR2D & aOffset ) const

Definition at line 116 of file grid_helper.cpp.

◆ AlignGrid() [3/3]

virtual VECTOR2I GRID_HELPER::AlignGrid ( const VECTOR2I & aPoint,
GRID_HELPER_GRIDS aGrid ) const
inlinevirtual

Reimplemented from GRID_HELPER.

Definition at line 106 of file grid_helper.h.

◆ AlignToArc()

◆ AlignToSegment()

◆ applySnapResultGuides()

◆ BestDragOrigin()

◆ canUseGrid()

bool GRID_HELPER::canUseGrid ( ) const
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 564 of file grid_helper.cpp.

References m_enableGrid, m_manualGridSnapping, and m_toolMgr.

Referenced by Align(), EE_GRID_HELPER::ResolveSnap(), and SnapToConstructionLines().

◆ classifyReference()

SNAP_REFERENCE_PREFERENCE GRID_HELPER::classifyReference ( const VECTOR2I & aPoint,
const BOX2I & aBounds,
bool aAnchorPoint )
staticprotectedinherited

Classify the point a drag was started from against the moving object's bounds.

Layout inference prefers a stationary feature matching the one the user grabbed, so a left-edge grab aligns to left edges and a centre grab aligns to centres. An anchor-point grab (a pad centre or a pin end) instead prefers the stationary anchor points of the same kind, which is what makes pad-to-pad and pin-to-pin alignment feel deliberate.

Parameters
aPointThe drag origin.
aBoundsThe bounds of everything being moved.
aAnchorPointTrue when the drag origin is a published anchor point.

Definition at line 197 of file grid_helper.cpp.

References std::abs(), ANCHOR_POINT, BOUNDS_FEATURE, BOX2< Vec >::Centre(), BOX2< Vec >::GetBottom(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetTop(), index, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PCBGridHelperTestFixture::ClassifyReference(), and setLayoutReference().

◆ clearAnchors()

void GRID_HELPER::clearAnchors ( )
inlineprotectedinherited

◆ ClearMaskFlag()

void GRID_HELPER::ClearMaskFlag ( int aFlag)
inlineinherited

Definition at line 165 of file grid_helper.h.

References m_maskTypes.

◆ ClearSkipPoint()

void GRID_HELPER::ClearSkipPoint ( )
inlineinherited

Clear the skip point by setting it to an unreachable position, thereby preventing matching.

Definition at line 142 of file grid_helper.h.

References m_skipPoint.

Referenced by BOOST_AUTO_TEST_CASE(), and GRID_HELPER().

◆ ClearSnapFeedback()

◆ ClearSnapLine()

void GRID_HELPER::ClearSnapLine ( )
inherited

Definition at line 160 of file grid_helper.cpp.

References m_snapManager.

◆ computeAnchors() [1/2]

void PCB_GRID_HELPER::computeAnchors ( BOARD_ITEM * aItem,
const VECTOR2I & aRefPos,
bool aFrom,
const PCB_SELECTION_FILTER_OPTIONS * aSelectionFilter )
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.

Parameters
aItemThe board item for which to compute the anchors
aRefPosThe point for which to compute the anchors (if used by the component)
aFromIs 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 1681 of file pcb_grid_helper.cpp.

References SEG::A, GRID_HELPER::addAnchor(), ANGLE_90, SHAPE_LINE_CHAIN::Append(), ARC, SEG::B, B_Cu, SHAPE_POLY_SET::BBox(), 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, EDA_ANGLE::Cos(), PCB_SELECTION_FILTER_OPTIONS::dimensions, ELLIPSE, ELLIPSE_ARC, end, ERROR_INSIDE, F_Cu, PCB_SELECTION_FILTER_OPTIONS::footprints, GetArcAnchors(), 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(), EDA_SHAPE::GetEllipseCenter(), EDA_SHAPE::GetEllipseMajorRadius(), EDA_SHAPE::GetEllipseMinorRadius(), EDA_SHAPE::GetEllipseRotation(), 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(), FOOTPRINT::GetLayer(), BOARD_ITEM::GetLayerSet(), BOX2< Vec >::GetLeft(), PAD::GetOrientation(), BOX2< Vec >::GetOrigin(), KIGEOM::GetOvalKeyPoints(), KIGFX::VIEW::GetPainter(), EDA_SHAPE::GetPolyPoints(), 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(), PCB_BARCODE::GetSymbolPoly(), PCB_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, KiROUND(), LAYER_ANCHOR, LAYER_FOOTPRINTS_BK, LAYER_FOOTPRINTS_FR, m_magneticSettings, GRID_HELPER::m_toolMgr, SHAPE_LINE_CHAIN::Move(), SHAPE_LINE_CHAIN::NearestPoint(), GRID_HELPER::ORIGIN, PCB_SELECTION_FILTER_OPTIONS::otherItems, 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_BARCODE_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(), EDA_ANGLE::Sin(), 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.

◆ computeAnchors() [2/2]

void PCB_GRID_HELPER::computeAnchors ( const std::vector< BOARD_ITEM * > & aItems,
const VECTOR2I & aRefPos,
bool aFrom,
const PCB_SELECTION_FILTER_OPTIONS * aSelectionFilter,
const LSET * aLayers,
bool aForDrag )
private

◆ computeNearest()

VECTOR2I GRID_HELPER::computeNearest ( const VECTOR2I & aPoint,
const VECTOR2I & aGrid,
const VECTOR2I & aOffset ) const
protectedinherited

Definition at line 529 of file grid_helper.cpp.

References KiROUND(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by AlignGrid(), and AlignGrid().

◆ computeSnapRanges()

◆ editingInsideFootprint()

bool PCB_GRID_HELPER::editingInsideFootprint ( ) const
private

True when the footprint's own contents are the layout objects.

The board arranges footprints, so a footprint's children collapse into it. The footprint editor arranges those children, where the same collapse would leave a single object and make alignment and equal spacing impossible.

Definition at line 526 of file pcb_grid_helper.cpp.

References BOARD::IsFootprintHolder(), and GRID_HELPER::m_toolMgr.

Referenced by queryVisible(), ResolveSnap(), and snapInferenceSettings().

◆ emitAngleBranchCandidates()

void GRID_HELPER::emitAngleBranchCandidates ( std::vector< SNAP_CANDIDATE > & aCandidates,
const VECTOR2I & aOrigin,
double aSnapScale ) const
protectedinherited

Emit the angle-restriction snap candidates (the two branches bracketing the cursor angle) into the current frame.

Shared by the derived helpers so the stringly-typed "angle" protocol lives in one place.

Definition at line 601 of file grid_helper.cpp.

References std::abs(), ANGLE, ANGLE_BRANCH, delta, SNAP_CANDIDATE::Line(), m_angleOrigin, m_angleStepDegrees, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by EE_GRID_HELPER::ResolveSnap(), and PCB_GRID_HELPER::ResolveSnap().

◆ emitSelfAndGridCandidates()

void GRID_HELPER::emitSelfAndGridCandidates ( std::vector< SNAP_CANDIDATE > & aCandidates,
const SNAP_SOURCE_CONTEXT & aContext,
const VECTOR2I & aOrigin,
const VECTOR2I & aNearestGrid,
double aSnapScale,
int aSnapRange,
bool aUseGrid ) const
protectedinherited

Emit the point editor's unchanged self-geometry and the independent grid axes.

The two editors disagree on when the grid may be used, so the caller supplies that gate rather than the base guessing at it.

Definition at line 659 of file grid_helper.cpp.

References std::abs(), SNAP_CANDIDATE::AxisX(), SNAP_CANDIDATE::AxisY(), GRID, GRID_AXIS, GRID_X, GRID_Y, INTRINSIC_ANCHOR, m_stationarySelfPoints, MakeDerivedSnapId(), SNAP_SOURCE_CONTEXT::movingItem, OBJECT, SNAP_CANDIDATE::Point(), POINT_EDIT, SNAP_SOURCE_CONTEXT::profile, SELF_ENDPOINT, SELF_POINT, SNAP_SOURCE_CONTEXT::stationarySourceLeg, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by EE_GRID_HELPER::ResolveSnap(), and PCB_GRID_HELPER::ResolveSnap().

◆ enableAndGetAnchorDebug()

KIGFX::ANCHOR_DEBUG * GRID_HELPER::enableAndGetAnchorDebug ( )
protectedinherited

Enable the anchor debug if permitted and return it.

Returns nullptr if not permitted by the advancd config

Definition at line 118 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::ResolveSnap(), and PCB_GRID_HELPER::ResolveSnap().

◆ FullReset()

virtual void GRID_HELPER::FullReset ( )
inlinevirtualinherited

Reset all internal state.

Used to remove any dangling pointers to items that have been deleted.

Definition at line 83 of file grid_helper.h.

References m_anchors, m_constructionGeomPreview, m_layoutReferencePreference, m_retainedAngleBranch, m_snapManager, and m_stickySnapIds.

◆ GetArcAnchors()

std::vector< PCB_GRID_HELPER::ANCHOR_SPEC > PCB_GRID_HELPER::GetArcAnchors ( const PCB_ARC & aArc,
bool aFrom )
static

Return the snap/drag anchor points that a track arc contributes.

The arc's derived geometric center is rarely grid-aligned, so it is never offered as the arc's own drag origin. The stored start/mid/end points (grid-aligned when the arc is) carry the drag-origin role instead, keeping pasted arcs on grid.

Parameters
aArcThe arc for which to compute anchors.
aFromTrue when the arc is the drag source (its own points may become the origin).

Definition at line 1662 of file pcb_grid_helper.cpp.

References GRID_HELPER::CORNER, PCB_ARC::GetCenter(), PCB_ARC::GetMid(), GRID_HELPER::ORIGIN, PT_CENTER, PT_MID, and GRID_HELPER::SNAPPABLE.

Referenced by BOOST_AUTO_TEST_CASE(), and computeAnchors().

◆ GetGrid()

◆ GetGridSize()

VECTOR2D PCB_GRID_HELPER::GetGridSize ( GRID_HELPER_GRIDS aGrid) const
overridevirtual

Return the size of the specified grid.

Reimplemented from GRID_HELPER.

Definition at line 1321 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 ResolveSnap().

◆ GetItemGrid()

◆ GetOrigin()

VECTOR2I GRID_HELPER::GetOrigin ( ) const
inherited

◆ GetSelectionGrid()

GRID_HELPER_GRIDS GRID_HELPER::GetSelectionGrid ( const SELECTION & aSelection) const
virtualinherited

Gets the coarsest grid that applies to a selecion of items.

Definition at line 471 of file grid_helper.cpp.

References SELECTION::Front(), GetGridSize(), GetItemGrid(), and grid.

◆ GetSnap()

bool GRID_HELPER::GetSnap ( ) const
inlineinherited

Definition at line 148 of file grid_helper.h.

References m_enableSnap.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and DRAWING_TOOL::DrawVia().

◆ getSnapManager()

◆ GetSnapped()

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.

Returns
NULL if not snapped. Pointer to snapped item otherwise

Definition at line 1262 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().

◆ GetSnappedPoint()

std::optional< VECTOR2I > GRID_HELPER::GetSnappedPoint ( ) const
inherited

Definition at line 571 of file grid_helper.cpp.

References m_snapItem.

Referenced by BOOST_AUTO_TEST_CASE(), and PCB_PICKER_TOOL::SelectPointInteractively().

◆ GetUseGrid()

bool GRID_HELPER::GetUseGrid ( ) const
inlineinherited

Definition at line 151 of file grid_helper.h.

References m_enableGrid.

Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ GetVisibleGrid()

VECTOR2D GRID_HELPER::GetVisibleGrid ( ) const
inherited

Definition at line 453 of file grid_helper.cpp.

References m_manualVisibleGrid, and m_toolMgr.

Referenced by BOOST_AUTO_TEST_CASE(), and computeSnapRanges().

◆ layoutBounds()

BOX2I PCB_GRID_HELPER::layoutBounds ( const BOARD_ITEM & aItem)
staticprivate

◆ nearestAnchor()

PCB_GRID_HELPER::ANCHOR * PCB_GRID_HELPER::nearestAnchor ( const VECTOR2I & aPos,
int aFlags )
private

Find the nearest anchor point to the given position with matching flags.

Parameters
returnThe nearest anchor point, or nullptr if none found

Definition at line 2343 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 ResolveSnap().

◆ OnBoardCompositeUpdate()

virtual void BOARD_LISTENER::OnBoardCompositeUpdate ( BOARD & aBoard,
std::vector< BOARD_ITEM * > & aAddedItems,
std::vector< BOARD_ITEM * > & aRemovedItems,
std::vector< BOARD_ITEM * > & aChangedItems )
inlinevirtualinherited

◆ OnBoardHighlightNetChanged()

virtual void BOARD_LISTENER::OnBoardHighlightNetChanged ( BOARD & aBoard)
inlinevirtualinherited

Reimplemented in PCB_NET_INSPECTOR_PANEL, and PCB_SEARCH_PANE.

Definition at line 345 of file board.h.

Referenced by BOARD::HighLightON(), BOARD::ResetNetHighLight(), and BOARD::SetHighLightNet().

◆ OnBoardItemAdded()

virtual void BOARD_LISTENER::OnBoardItemAdded ( BOARD & aBoard,
BOARD_ITEM * aBoardItem )
inlinevirtualinherited

◆ OnBoardItemChanged()

virtual void BOARD_LISTENER::OnBoardItemChanged ( BOARD & aBoard,
BOARD_ITEM * aBoardItem )
inlinevirtualinherited

◆ OnBoardItemRemoved()

void PCB_GRID_HELPER::OnBoardItemRemoved ( BOARD & aBoard,
BOARD_ITEM * aRemovedItem )
overridevirtual

◆ OnBoardItemsAdded()

virtual void BOARD_LISTENER::OnBoardItemsAdded ( BOARD & aBoard,
std::vector< BOARD_ITEM * > & aBoardItems )
inlinevirtualinherited

◆ OnBoardItemsChanged()

virtual void BOARD_LISTENER::OnBoardItemsChanged ( BOARD & aBoard,
std::vector< BOARD_ITEM * > & aBoardItems )
inlinevirtualinherited

◆ OnBoardItemsRemoved()

void PCB_GRID_HELPER::OnBoardItemsRemoved ( BOARD & aBoard,
std::vector< BOARD_ITEM * > & aBoardItems )
overridevirtual

Reimplemented from BOARD_LISTENER.

Definition at line 510 of file pcb_grid_helper.cpp.

References GRID_HELPER::m_snapItem.

◆ OnBoardNetSettingsChanged()

virtual void BOARD_LISTENER::OnBoardNetSettingsChanged ( BOARD & aBoard)
inlinevirtualinherited

Reimplemented in APPEARANCE_CONTROLS, PCB_NET_INSPECTOR_PANEL, and PCB_SEARCH_PANE.

Definition at line 342 of file board.h.

Referenced by BOARD::SynchronizeNetsAndNetClasses().

◆ OnBoardRatsnestChanged()

virtual void BOARD_LISTENER::OnBoardRatsnestChanged ( BOARD & aBoard)
inlinevirtualinherited

Reimplemented in PCB_SEARCH_PANE.

Definition at line 346 of file board.h.

Referenced by BOARD::OnRatsnestChanged().

◆ queryVisible()

◆ ResolveSnap() [1/2]

SNAP_RESULT PCB_GRID_HELPER::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 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

Parameters
aOriginPoint we want to snap from
aReferenceItemReference item for layer/type special casing
Returns
snapped screen point

Definition at line 658 of file pcb_grid_helper.cpp.

References LSET::AllLayersMask(), BOARD_ITEM::GetLayerSet(), PCB_BASE_FRAME::GetScreen(), GRID_HELPER::m_toolMgr, and ResolveSnap().

Referenced by ResolveSnap().

◆ ResolveSnap() [2/2]

SNAP_RESULT PCB_GRID_HELPER::ResolveSnap ( const VECTOR2I & aOrigin,
const LSET & aLayers,
GRID_HELPER_GRIDS aGrid = GRID_HELPER_GRIDS::GRID_CURRENT,
const std::vector< BOARD_ITEM * > & aSkip = {},
std::optional< VECTOR2I > aMovingReferencePoint = std::nullopt )

Definition at line 682 of file pcb_grid_helper.cpp.

References SNAP_INFERENCE_PROVIDER::AddAlignmentPoint(), SNAP_INFERENCE_PROVIDER::AddBounds(), AddConstructionItems(), SNAP_INFERENCE_PROVIDER::AddPath(), Align(), SNAP_INFERENCE_SETTINGS::alignmentDistribution, anchor, GRID_HELPER::applySnapResultGuides(), BOX2ISafe(), CONSTRUCTION_MANAGER::CancelProposal(), SNAP_FRAME_INPUT< Payload >::candidates, CAPTURE_ALWAYS, CONSTRUCTION_MANAGER::Clear(), GRID_HELPER::clearAnchors(), SNAP_INFERENCE_PROVIDER::CollectAlignment(), SNAP_INFERENCE_PROVIDER::CollectEqualSpacing(), SNAP_INFERENCE_PROVIDER::CollectObjectGeometry(), SNAP_INFERENCE_PROVIDER::CollectTangentNormal(), computeAnchors(), GRID_HELPER::computeSnapRanges(), GRID_HELPER::CONSTRUCTED, CONSTRUCTED_ANCHOR, CONSTRUCTED_POINT, CONSTRUCTION, SNAP_INFERENCE_SETTINGS::constructionExtensions, SNAP_FRAME_INPUT< Payload >::context, GRID_HELPER::ANCHOR::Distance(), editingInsideFootprint(), GRID_HELPER::emitAngleBranchCandidates(), GRID_HELPER::emitSelfAndGridCandidates(), GRID_HELPER::enableAndGetAnchorDebug(), SNAP_FRAME_INPUT< Payload >::feasibility, FINITE_MANIFOLD, GRID_HELPER::ANCHOR::flags, KIGFX::GEOMETRY, ADVANCED_CFG::GetCfg(), SNAP_MANAGER::GetConstructionManager(), EDA_SHAPE::GetEnd(), PCB_TRACK::GetEnd(), GetGridSize(), BOX2< Vec >::GetHeight(), BOARD_ITEM::GetLayerSet(), BOX2< Vec >::GetLeft(), GetNearestPoint(), SNAP_LINE_MANAGER::GetNearestSnapLinePoint(), GRID_HELPER::GetOrigin(), BOARD_ITEM::GetParent(), BOARD_ITEM::GetParentFootprint(), SNAP_MANAGER::GetReferenceOnlyPoints(), EDA_SHAPE::GetShape(), SNAP_MANAGER::GetSnapLineManager(), GRID_HELPER::getSnapManager(), EDA_SHAPE::GetStart(), PCB_TRACK::GetStart(), BOX2< Vec >::GetTop(), BOX2< Vec >::GetWidth(), EDA_ITEM::HitTest(), GRID_HELPER::SNAP_RANGES::in, BOX2< Vec >::Intersect(), INTRINSIC_ANCHOR, KIGFX::VIEW_ITEM::IsBOARD_ITEM(), ITEM_GEOMETRY, layoutBounds(), GRID_HELPER::m_anchors, ADVANCED_CFG::m_EnableExtensionSnaps, GRID_HELPER::m_enableGrid, GRID_HELPER::m_enableSnap, GRID_HELPER::m_enableSnapLine, ADVANCED_CFG::m_ExtensionSnapActivateOnHover, GRID_HELPER::m_feasibilityCallback, GRID_HELPER::m_layoutReferencePreference, m_magneticSettings, GRID_HELPER::m_pointEditProfile, m_pointOnLineCandidates, GRID_HELPER::m_retainedAngleBranch, GRID_HELPER::m_skipPoint, GRID_HELPER::m_snapItem, GRID_HELPER::m_stationarySelfSegments, GRID_HELPER::m_stickySnapIds, GRID_HELPER::m_toolMgr, EDA_ITEM::m_Uuid, GRID_HELPER::m_viewSnapPoint, MakeCompositeSnapId(), MakeDerivedSnapId(), MakePointSnapId(), SNAP_SOURCE_CONTEXT::movingBounds, SNAP_SOURCE_CONTEXT::movingItem, SNAP_SOURCE_CONTEXT::movingReferencePoint, nearestAnchor(), OBJECT, SNAP_INFERENCE_SETTINGS::objectGeometry, BOX2< Vec >::Offset(), GRID_HELPER::SNAP_RANGES::out, pad, PCB_ARC_T, PCB_FOOTPRINT_T, PCB_PAD_T, PCB_SHAPE_T, PCB_TRACE_T, PICKER, SNAP_CANDIDATE::Point(), POINT_EDIT, GRID_HELPER::ANCHOR::pos, SNAP_FRAME_INPUT< Payload >::presentation, SNAP_FRAME_OUTPUT< Payload >::presentation, SNAP_SOURCE_CONTEXT::profile, PT_NONE, PT_ON_ELEMENT, queryVisible(), GRID_HELPER::SNAP_RANGES::range, GRID_HELPER::SNAP_RANGES::rankingHysteresis, SNAP_FRAME_INPUT< Payload >::rankingHysteresis, SNAP_SOURCE_CONTEXT::referencePreference, ResolveSnapFrame(), result, SNAP_FRAME_OUTPUT< Payload >::result, GRID_HELPER::retainAcceptedSnaps(), SNAP_FRAME_INPUT< Payload >::retainedId, RIGID_PLACEMENT, GRID_HELPER::SNAP_RANGES::scale, SEGMENT, SELF_SEGMENT, SNAP_LINE_MANAGER::SetSnapLineEnd(), SNAP_LINE_MANAGER::SetSnapLineOrigin(), SNAP_LINE_MANAGER::SetSnappedAnchor(), GRID_HELPER::showConstructionGeometry(), snapInferenceSettings(), GRID_HELPER::SNAPPABLE, SnapTargetId(), GRID_HELPER::SnapToConstructionLines(), GRID_HELPER::snapTraceCallback(), SNAP_SOURCE_CONTEXT::sourcePoint, SNAP_SOURCE_CONTEXT::stationarySelfFeatures, SNAP_SOURCE_CONTEXT::stationarySourceLeg, SNAP_FRAME_INPUT< Payload >::stickyIds, SNAP_INFERENCE_SETTINGS::tangentNormal, SNAP_STABLE_ID::target, SNAP_FRAME_INPUT< Payload >::trace, traceSnap, EDA_ITEM::Type(), GRID_HELPER::updateSnapPoint(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ retainAcceptedSnaps()

void GRID_HELPER::retainAcceptedSnaps ( const SNAP_RESULT & aResult)
protectedinherited

Record which snaps the resolver accepted so they can be re-biased on the next resolve, and separately track the accepted angle branch for the next frame.

Definition at line 702 of file grid_helper.cpp.

References SNAP_RESULT::accepted, ANGLE_BRANCH, m_retainedAngleBranch, and m_stickySnapIds.

Referenced by EE_GRID_HELPER::ResolveSnap(), and PCB_GRID_HELPER::ResolveSnap().

◆ SetAngleRestriction()

void GRID_HELPER::SetAngleRestriction ( std::optional< VECTOR2I > aOrigin,
double aStepDegrees )
inlineinherited

Restrict snapping to a set of angle branches emanating from an origin.

Passing an empty origin clears the restriction and any retained branch so the next resolve starts fresh.

Definition at line 175 of file grid_helper.h.

References m_angleOrigin, m_angleStepDegrees, and m_retainedAngleBranch.

◆ SetAuxAxes()

void GRID_HELPER::SetAuxAxes ( bool aEnable,
const VECTOR2I & aOrigin = VECTOR2I( 0, 0 ) )
inherited

Definition at line 494 of file grid_helper.cpp.

References m_auxAxis, m_toolMgr, and m_viewAxis.

Referenced by BOOST_AUTO_TEST_CASE().

◆ SetFeasibilityCallback()

void GRID_HELPER::SetFeasibilityCallback ( SNAP_RESOLVER::FEASIBILITY_CALLBACK aCallback)
inlineinherited

Definition at line 192 of file grid_helper.h.

References m_feasibilityCallback.

◆ SetGridSize()

◆ SetGridSnapping()

◆ setLayoutReference()

void GRID_HELPER::setLayoutReference ( const VECTOR2I & aPoint,
const std::optional< BOX2I > & aBounds,
bool aAnchorPoint )
protectedinherited

Record the classified drag reference and trace it.

Definition at line 225 of file grid_helper.cpp.

References ANCHOR_POINT, BOUNDS_FEATURE, classifyReference(), and m_layoutReferencePreference.

Referenced by EE_GRID_HELPER::BestDragOrigin(), and PCB_GRID_HELPER::BestDragOrigin().

◆ SetMask()

void GRID_HELPER::SetMask ( int aMask)
inlineinherited

Definition at line 163 of file grid_helper.h.

References m_maskTypes.

◆ SetMaskFlag()

void GRID_HELPER::SetMaskFlag ( int aFlag)
inlineinherited

Definition at line 164 of file grid_helper.h.

References m_maskTypes.

◆ SetOrigin()

◆ SetPointEditProfile()

void GRID_HELPER::SetPointEditProfile ( bool aEnabled)
inlineinherited

Definition at line 184 of file grid_helper.h.

References m_pointEditProfile.

◆ SetSkipPoint()

void GRID_HELPER::SetSkipPoint ( const VECTOR2I & aPoint)
inlineinherited

Definition at line 134 of file grid_helper.h.

References m_skipPoint.

Referenced by BOOST_AUTO_TEST_CASE().

◆ SetSnap()

void GRID_HELPER::SetSnap ( bool aSnap)
inlineinherited

◆ SetSnapLine()

void GRID_HELPER::SetSnapLine ( bool aSnap)
inlineinherited

Definition at line 153 of file grid_helper.h.

References m_enableSnapLine.

◆ SetSnapLineDirections()

void GRID_HELPER::SetSnapLineDirections ( const std::vector< VECTOR2I > & aDirections)
inherited

Definition at line 144 of file grid_helper.cpp.

References m_snapManager.

Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ SetSnapLineEnd()

void GRID_HELPER::SetSnapLineEnd ( const std::optional< VECTOR2I > & aEnd)
inherited

Definition at line 155 of file grid_helper.cpp.

References m_snapManager.

◆ SetSnapLineOrigin()

void GRID_HELPER::SetSnapLineOrigin ( const VECTOR2I & aOrigin)
inherited

Definition at line 150 of file grid_helper.cpp.

References m_snapManager.

Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ SetStationarySelfGeometry()

void GRID_HELPER::SetStationarySelfGeometry ( std::vector< VECTOR2I > aPoints,
std::vector< SEG > aSegments )
inlineinherited

Definition at line 186 of file grid_helper.h.

References m_stationarySelfPoints, and m_stationarySelfSegments.

◆ SetUseGrid()

void GRID_HELPER::SetUseGrid ( bool aSnapToGrid)
inlineinherited

Definition at line 150 of file grid_helper.h.

References m_enableGrid.

Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ SetVisibleGridSize()

void GRID_HELPER::SetVisibleGridSize ( const VECTOR2D & aGrid)
inlineinherited

Definition at line 95 of file grid_helper.h.

References m_manualVisibleGrid.

Referenced by BOOST_AUTO_TEST_CASE().

◆ showConstructionGeometry()

void GRID_HELPER::showConstructionGeometry ( bool aShow)
protectedinherited

◆ snapInferenceSettings()

SNAP_INFERENCE_SETTINGS PCB_GRID_HELPER::snapInferenceSettings ( ) const
private

Snap inference settings for whichever editor owns this helper.

Definition at line 539 of file pcb_grid_helper.cpp.

References editingInsideFootprint(), and GRID_HELPER::m_toolMgr.

Referenced by AddConstructionItems(), and ResolveSnap().

◆ SnapToConstructionLines()

std::optional< VECTOR2I > GRID_HELPER::SnapToConstructionLines ( const VECTOR2I & aPoint,
const VECTOR2I & aNearestGrid,
const VECTOR2D & aGrid,
double aSnapRange ) const
inherited

◆ SnapToPad()

VECTOR2I PCB_GRID_HELPER::SnapToPad ( const VECTOR2I & aMousePos,
std::deque< PAD * > & aPads )

◆ snapTraceCallback()

◆ updateSnapPoint()

void GRID_HELPER::updateSnapPoint ( const TYPED_POINT2I & aPoint)
protectedinherited

Friends And Related Symbol Documentation

◆ PCBGridHelperTestFixture

Member Data Documentation

◆ m_anchorDebug

std::unique_ptr<KIGFX::ANCHOR_DEBUG> GRID_HELPER::m_anchorDebug
privateinherited

#VIEW_ITEM for visualising anchor points, if enabled.

Definition at line 397 of file grid_helper.h.

Referenced by PCB_GRID_HELPER::Align(), and enableAndGetAnchorDebug().

◆ m_anchors

◆ m_angleOrigin

std::optional<VECTOR2I> GRID_HELPER::m_angleOrigin
protectedinherited

Definition at line 361 of file grid_helper.h.

Referenced by emitAngleBranchCandidates(), and SetAngleRestriction().

◆ m_angleStepDegrees

double GRID_HELPER::m_angleStepDegrees = 0.0
protectedinherited

Definition at line 362 of file grid_helper.h.

Referenced by emitAngleBranchCandidates(), and SetAngleRestriction().

◆ m_auxAxis

std::optional<VECTOR2I> GRID_HELPER::m_auxAxis
protectedinherited

Definition at line 340 of file grid_helper.h.

Referenced by Align(), and SetAuxAxes().

◆ m_constructionGeomPreview

KIGFX::CONSTRUCTION_GEOM GRID_HELPER::m_constructionGeomPreview
privateinherited

Show construction geometry (if any) on the canvas.

Definition at line 391 of file grid_helper.h.

Referenced by PCB_GRID_HELPER::Align(), FullReset(), EE_GRID_HELPER::GetGrid(), GRID_HELPER(), GRID_HELPER(), and showConstructionGeometry().

◆ m_enableGrid

bool GRID_HELPER::m_enableGrid
protectedinherited

◆ m_enableSnap

bool GRID_HELPER::m_enableSnap
protectedinherited

◆ m_enableSnapLine

bool GRID_HELPER::m_enableSnapLine
protectedinherited

◆ m_feasibilityCallback

SNAP_RESOLVER::FEASIBILITY_CALLBACK GRID_HELPER::m_feasibilityCallback
protectedinherited

◆ m_layoutReferencePreference

SNAP_REFERENCE_PREFERENCE GRID_HELPER::m_layoutReferencePreference
protectedinherited

◆ m_magneticSettings

MAGNETIC_SETTINGS* PCB_GRID_HELPER::m_magneticSettings
private

◆ m_manualGrid

VECTOR2D GRID_HELPER::m_manualGrid
protectedinherited

Definition at line 355 of file grid_helper.h.

Referenced by GetGrid(), GetGridSize(), GRID_HELPER(), and SetGridSize().

◆ m_manualGridSnapping

bool GRID_HELPER::m_manualGridSnapping
protectedinherited

Definition at line 358 of file grid_helper.h.

Referenced by canUseGrid(), GRID_HELPER(), and SetGridSnapping().

◆ m_manualOrigin

VECTOR2I GRID_HELPER::m_manualOrigin
protectedinherited

Definition at line 357 of file grid_helper.h.

Referenced by GetOrigin(), GRID_HELPER(), and SetOrigin().

◆ m_manualVisibleGrid

VECTOR2D GRID_HELPER::m_manualVisibleGrid
protectedinherited

Definition at line 356 of file grid_helper.h.

Referenced by GetVisibleGrid(), GRID_HELPER(), and SetVisibleGridSize().

◆ m_maskTypes

int GRID_HELPER::m_maskTypes
protectedinherited

Definition at line 342 of file grid_helper.h.

Referenced by addAnchor(), ClearMaskFlag(), GRID_HELPER(), SetMask(), and SetMaskFlag().

◆ m_pointEditProfile

bool GRID_HELPER::m_pointEditProfile = false
protectedinherited

◆ m_pointOnLineCandidates

std::vector<NEARABLE_GEOM> PCB_GRID_HELPER::m_pointOnLineCandidates
private

Definition at line 179 of file pcb_grid_helper.h.

Referenced by computeAnchors(), and ResolveSnap().

◆ m_retainedAngleBranch

std::optional<SNAP_STABLE_ID> GRID_HELPER::m_retainedAngleBranch
protectedinherited

◆ m_skipPoint

VECTOR2I GRID_HELPER::m_skipPoint
protectedinherited

◆ m_snapItem

◆ m_snapManager

SNAP_MANAGER GRID_HELPER::m_snapManager
privateinherited

Manage the construction geometry, snap lines, reference points, etc.

Definition at line 394 of file grid_helper.h.

Referenced by applySnapResultGuides(), ClearSnapLine(), FullReset(), EE_GRID_HELPER::GetGrid(), getSnapManager(), GRID_HELPER(), SetSnapLineDirections(), SetSnapLineEnd(), SetSnapLineOrigin(), and SnapToConstructionLines().

◆ m_stationarySelfPoints

std::vector<VECTOR2I> GRID_HELPER::m_stationarySelfPoints
protectedinherited

Definition at line 366 of file grid_helper.h.

Referenced by emitSelfAndGridCandidates(), and SetStationarySelfGeometry().

◆ m_stationarySelfSegments

std::vector<SEG> GRID_HELPER::m_stationarySelfSegments
protectedinherited

◆ m_stickySnapIds

std::vector<SNAP_STABLE_ID> GRID_HELPER::m_stickySnapIds
protectedinherited

◆ m_toolMgr

◆ m_viewAxis

◆ m_viewSnapPoint


The documentation for this class was generated from the following files: