152 bool pad_through =
false;
155 ZONE* zone =
nullptr;
160 switch( aTestItem->
Type() )
169 pad =
static_cast<PAD*
>( aTestItem );
172 if( (
pad->GetAttribute() != PAD_ATTRIB::SMD ) &&
173 (
pad->GetAttribute() != PAD_ATTRIB::CONN ) )
190 return INSPECT_RESULT::CONTINUE;
192 boardItem =
static_cast<PCB_TRACK*
>( aTestItem );
196 zone =
static_cast<ZONE*
>( aTestItem );
204 boardItem =
static_cast<BOARD_ITEM*
>( aTestItem );
213 boardItem = dimension;
217 boardItem =
static_cast<BOARD_ITEM*
>( aTestItem );
221 field =
static_cast<PCB_FIELD*
>( aTestItem );
224 return INSPECT_RESULT::CONTINUE;
227 return INSPECT_RESULT::CONTINUE;
235 if(
text->GetParentFootprint() )
239 if( !
text->IsVisible() )
240 return INSPECT_RESULT::CONTINUE;
243 return INSPECT_RESULT::CONTINUE;
246 return INSPECT_RESULT::CONTINUE;
252 footprint =
static_cast<FOOTPRINT*
>( aTestItem );
253 boardItem = footprint;
262 marker =
static_cast<PCB_MARKER*
>( aTestItem );
268 boardItem =
static_cast<BOARD_ITEM*
>( aTestItem );
273 if( boardItem && !footprint )
281 return INSPECT_RESULT::CONTINUE;
284 return INSPECT_RESULT::CONTINUE;
292 return INSPECT_RESULT::CONTINUE;
297 return INSPECT_RESULT::CONTINUE;
300 return INSPECT_RESULT::CONTINUE;
310 return INSPECT_RESULT::CONTINUE;
319 return INSPECT_RESULT::CONTINUE;
324 auto type =
via->GetViaType();
330 return INSPECT_RESULT::CONTINUE;
352 return INSPECT_RESULT::CONTINUE;
362 return INSPECT_RESULT::CONTINUE;
367 else if( aTestItem == footprint )
373 return INSPECT_RESULT::CONTINUE;
381 return INSPECT_RESULT::CONTINUE;
394 accuracy =
KiROUND( accuracy * 1.5 );
400 return INSPECT_RESULT::CONTINUE;
426 return INSPECT_RESULT::CONTINUE;
436 return INSPECT_RESULT::CONTINUE;
444 wxCHECK( footprint, INSPECT_RESULT::CONTINUE );
450 return INSPECT_RESULT::CONTINUE;
458 return INSPECT_RESULT::CONTINUE;
467 accuracy =
KiROUND( accuracy * 1.5 );
473 return INSPECT_RESULT::CONTINUE;
478 return INSPECT_RESULT::CONTINUE;
497 wxCHECK_RET( aItem,
"" );
514 return INSPECT_RESULT::CONTINUE;
532 return INSPECT_RESULT::CONTINUE;
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Test to see if this object is on the given layer.
FOOTPRINT * GetParentFootprint() const
virtual bool IsLocked() const
An abstract base class whose derivatives may be passed to a GENERAL_COLLECTOR telling it what should ...
virtual bool IgnoreThroughVias() const =0
virtual bool IsLayerVisible(PCB_LAYER_ID layer) const =0
virtual bool IgnoreFPTextOnFront() const =0
virtual bool IgnoreFPTextOnBack() const =0
virtual bool IgnoreLockedItems() const =0
virtual bool IgnoreZoneFills() const =0
virtual bool IgnoreMicroVias() const =0
virtual bool IgnoreFootprintsOnBack() const =0
virtual bool IgnoreBlindBuriedVias() const =0
virtual int Accuracy() const =0
virtual bool IgnorePadsOnBack() const =0
virtual bool IgnoreFPReferences() const =0
virtual bool IgnorePadsOnFront() const =0
virtual bool IgnoreFootprintsOnFront() const =0
virtual bool IgnorePads() const
virtual bool IgnoreTracks() const =0
virtual bool IncludeSecondary() const =0
Determine if the secondary criteria or 2nd choice items should be included.
virtual bool IgnoreFPValues() const =0
virtual PCB_LAYER_ID GetPreferredLayer() const =0
INSPECTOR_FUNC m_inspector
void Empty()
Clear the list.
void SetScanTypes(const std::vector< KICAD_T > &aTypes)
Record the list of KICAD_T types to consider for collection by the Inspect() function.
void SetRefPos(const VECTOR2I &aRefPos)
std::vector< KICAD_T > m_scanTypes
void Append(EDA_ITEM *item)
Add an item to the end of the list.
A base class for most all the KiCad significant classes used in schematics and boards.
KICAD_T Type() const
Returns the type of object.
virtual INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &aScanTypes)
May be re-implemented for each derived class in order to handle all the types given by its member dat...
virtual bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const
Test if aPosition is inside or on the boundary of this item.
static const std::vector< KICAD_T > BoardLevelItems
A scan list for all primary board items, omitting items which are subordinate to a FOOTPRINT,...
void SetGuide(const COLLECTORS_GUIDE *aGuide)
Record which COLLECTORS_GUIDE to use.
static const std::vector< KICAD_T > PadsOrTracks
A scan list for PADs, TRACKs, or VIAs.
void Append2nd(EDA_ITEM *item)
INSPECT_RESULT Inspect(EDA_ITEM *aTestItem, void *aTestData) override
The examining function within the INSPECTOR which is passed to the Iterate function.
std::vector< EDA_ITEM * > m_List2nd
A place to hold collected objects which don't match precisely the search criteria,...
static const std::vector< KICAD_T > Footprints
A scan list for only FOOTPRINTs.
static const std::vector< KICAD_T > AllBoardItems
A scan list for all editable board items.
static const std::vector< KICAD_T > Tracks
A scan list for only TRACKs and ARCs.
void Collect(BOARD_ITEM *aItem, const std::vector< KICAD_T > &aScanList, const VECTOR2I &aRefPos, const COLLECTORS_GUIDE &aGuide)
Scan a BOARD_ITEM using this class's Inspector method, which does the collection.
static const std::vector< KICAD_T > Dimensions
A scan list for dimensions.
static const std::vector< KICAD_T > FootprintItems
A scan list for primary footprint items.
const COLLECTORS_GUIDE * m_Guide
Determine which items are to be collected by Inspect().
static const std::vector< KICAD_T > DraggableItems
A scan list for items that can be dragged.
bool IsBOARD_ITEM() const
LSEQ Seq(const LSEQ &aSequence) const
Return an LSEQ from the union of this LSET and a desired sequence.
A set of BOARD_ITEMs (i.e., without duplicates).
void Collect(BOARD_ITEM *aBoard, const std::vector< KICAD_T > &aTypes)
Test a BOARD_ITEM using this class's Inspector method, which does the collection.
INSPECT_RESULT Inspect(EDA_ITEM *testItem, void *testData) override
The examining function within the INSPECTOR which is passed to the iterate function.
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
void Collect(BOARD_ITEM *aBoard, const std::vector< KICAD_T > &aTypes)
Collect BOARD_ITEM objects using this class's Inspector method, which does the collection.
INSPECT_RESULT Inspect(EDA_ITEM *testItem, void *testData) override
The examining function within the INSPECTOR which is passed to the Iterate function.
Handle a list of polygons defining a copper zone.
bool HitTestForCorner(const VECTOR2I &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX *aCornerHit=nullptr) const
Test if the given VECTOR2I is near a corner.
bool HitTestForEdge(const VECTOR2I &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX *aCornerHit=nullptr) const
Test if the given VECTOR2I is near a segment defined by 2 corners.
bool HitTestFilledArea(PCB_LAYER_ID aLayer, const VECTOR2I &aRefPos, int aAccuracy=0) const
Test if the given VECTOR2I is within the bounds of a filled area of this zone.
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
PCB_LAYER_ID
A quick note on layer IDs:
This file contains miscellaneous commonly used macros and functions.
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
Class to handle a set of BOARD_ITEMs.
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
@ PCB_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
@ PCB_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
@ PCB_GENERATOR_T
class PCB_GENERATOR, generator on a layer
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
@ PCB_ZONE_T
class ZONE, a copper pour area
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
@ PCB_REFERENCE_IMAGE_T
class PCB_REFERENCE_IMAGE, bitmap on a layer
@ PCB_FIELD_T
class PCB_FIELD, text associated with a footprint property
@ PCB_MARKER_T
class PCB_MARKER, a marker used to show something
@ PCB_TARGET_T
class PCB_TARGET, a target (graphic item)
@ PCB_TABLECELL_T
class PCB_TABLECELL, PCB_TEXTBOX for use in tables
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
@ PCB_PAD_T
class PAD, a pad in a footprint
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
@ PCB_TABLE_T
class PCB_TABLE, table of PCB_TABLECELLs
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
@ PCB_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension