73 return wxString(
_(
"Via Stitching" ) );
78 wxString
GetPluralName()
const override {
return wxString(
_(
"Via Stitching" ) ); }
97 return m_outline.Collide( aPosition, aAccuracy );
169 std::vector<std::pair<wxString, const BOARD_ITEM*>>
GetTemplateItems()
const override;
170 void SetTemplateItem(
const wxString& aName, std::unique_ptr<BOARD_ITEM> aItem )
override;
278 static std::vector<VECTOR2I>
280 int aPitch,
const std::function<
bool(
const VECTOR2I& )>& aIsValid );
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.
KICAD_T Type() const
Returns the type of object.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Common, abstract interface for edit frames.
PCB_GENERATOR_POLY(BOARD_ITEM *aParent, PCB_LAYER_ID aLayer)
void ViewDraw(int aLayer, KIGFX::VIEW *aView) const override final
Draw the parts of the object belonging to layer aLayer.
PCB_VIA_STITCH_MODE m_mode
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
~PCB_VIA_STITCH() override
static std::vector< VECTOR2I > SampleGuardEnvelope(const SHAPE_POLY_SET &aEnvelope, const SHAPE_POLY_SET &aGuarded, int aPitch, const std::function< bool(const VECTOR2I &)> &aIsValid)
Determine via positions around the perimeter of a guard envelope.
void EditCancel(GENERATOR_TOOL *, BOARD *, BOARD_COMMIT *) override
wxString GetCommitMessage() const override
void SetTemplateItem(const wxString &aName, std::unique_ptr< BOARD_ITEM > aItem) override
Insert a template item (from board file loading)
wxString GetGeneratorType() const override
wxString GetPluralName() const override
std::set< VECTOR2I > m_excludedPositions
void SetGuardedNetCode(int aNetCode)
void SetMode(PCB_VIA_STITCH_MODE aVal)
void EditStart(GENERATOR_TOOL *, BOARD *, BOARD_COMMIT *) override
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
bool usesGridCells() const
PCB_VIA_STITCH_LAYOUT GetLayout() const
std::vector< ZONE * > GetZonesNeedingRefillAfterUpdate() const override
List of zones that cross out stitch zone, they'll need to be refilled for the punches.
PCB_VIA_STITCH & operator=(PCB_VIA_STITCH &&aOther) noexcept
PCB_VIA_STITCH(PCB_VIA_STITCH &&aOther) noexcept
void SetViaSize(int aVal)
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
std::unique_ptr< PCB_VIA > m_viaTemplate
PCB_VIA_STITCH & operator=(const PCB_VIA_STITCH &aOther)
std::vector< std::pair< wxString, const BOARD_ITEM * > > GetTemplateItems() const override
Named template items used by the generator.
PCB_VIA_STITCH(BOARD_ITEM *aParent=nullptr)
std::unique_ptr< ACTION_MENU > m_childContextMenu
static constexpr uint32_t POISSON_TILE_SEED
Fixed seed for baking the toroidal Poisson pattern.
int defaultPitch(BOARD *aBoard) const
void ShowPropertiesDialog(PCB_BASE_EDIT_FRAME *aEditFrame) override
std::vector< int > ViewGetLayers() const override
void ClearAllExclusions()
Drop all manual exclusions.
VECTOR2I cellForPosition(const VECTOR2I &aPos) const
Convert an absolute board position to a (col, row) grid cell index.
void ClearExclusion(const VECTOR2I &aPos)
Remove a board position from the exclusion list for the current layout/mode.
ACTION_MENU * GetChildContextMenu(TOOL_INTERACTIVE *aTool) const override
Get a context menu when interacting with a generator child.
bool HasExclusions() const
const STRING_ANY_MAP GetProperties() const override
void Move(const VECTOR2I &aMoveVector) override
This method is overrided to translate the stitch zone outline only on move.
const PCB_VIA * ViaTemplate() const
void SetViaDrill(int aVal)
PCB_VIA_STITCH_MODE GetMode() const
std::set< VECTOR2I > buildPlacementCells(BOARD *aBoard) const
Walk the placement grid, run DRC clearance tests, and return the set of (col, row) cells where a via ...
static std::vector< ZONE * > collectAllZones(const BOARD *aBoard)
Grabs all zones we need to consider for via placement.
static const std::vector< VECTOR2D > & bakedPoissonTile()
Helper method to cache the poisson tile we pattern.
VECTOR2I GetPosition() const override
static constexpr int POISSON_TILE_PITCHES
Tile size for the POISSON layout, in units of pitch.
bool Update(GENERATOR_TOOL *, BOARD *, BOARD_COMMIT *) override
int defaultViaSize(BOARD *aBoard) const
int GetGuardedNetCode() const
Net being guarded in GUARD mode.
void SetNetCode(int aNetCode)
static const wxString GENERATOR_TYPE
void EditFinish(GENERATOR_TOOL *, BOARD *, BOARD_COMMIT *) override
void swapData(BOARD_ITEM *aImage) override
int defaultViaDrill(BOARD *aBoard) const
std::set< PCB_VIA * > m_pendingRemovals
void Remove(GENERATOR_TOOL *, BOARD *, BOARD_COMMIT *) override
static const wxString DISPLAY_NAME
wxString m_lastGuardedNetName
void SetProperties(const STRING_ANY_MAP &aProps) override
bool m_lastUpdateChangedVias
void SetLayout(PCB_VIA_STITCH_LAYOUT aVal)
PCB_VIA_STITCH_LAYOUT m_layout
void ExcludePosition(const VECTOR2I &aPos)
Add a board position to the exclusion set so the next Update() skips it.
void OnZoneFillChanged(const std::vector< ZONE * > &aZones) override
Callback to be informed zones have changed.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
bool ChildrenAreIndividuallySelectable() const override
void SetSeed(uint32_t aVal)
GRID_CONFIG m_childGridConfig
void InitializeDefaults(BOARD *aBoard)
Fill in any unset via-template and pitch values from the board's design settings.
std::set< VECTOR2I > m_excludedCells
wxString GetFriendlyName() const override
VECTOR2I positionForCell(const VECTOR2I &aCell, int aPitch) const
Convert a (col, row) grid cell index to an absolute board position, including any stagger shift on od...
Represent a set of closed polygons.
A name/value tuple with unique names and wxAny values.
Some functions to handle hotkeys in KiCad.
@ LAYER_VIA_STITCHING
Outline of via stitching generators.
@ LAYER_ANCHOR
Anchor of items having an anchor point (texts, footprints).
@ LAYER_VIA_HOLES
Draw via holes (pad holes do not use this layer).
@ LAYER_VIAS
Meta control for all vias opacity/visibility.
@ STITCH
Fill the outline with vias with a pattern.
@ GUARD
Place vias to guard a net contained within.
@ POISSON
Tiled poisson distribution.
@ PLAIN
Regular row/column grid.
bool operator==(const GRID_CONFIG &aOther) const =default
PCB_VIA_STITCH_LAYOUT layout
@ PCB_GENERATOR_T
class PCB_GENERATOR, generator on a layer
VECTOR2< int32_t > VECTOR2I