156 bool pad_through =
false;
159 ZONE* zone =
nullptr;
165 switch( aTestItem->
Type() )
174 pad =
static_cast<PAD*
>( aTestItem );
197 boardItem =
static_cast<PCB_TRACK*
>( aTestItem );
201 zone =
static_cast<ZONE*
>( aTestItem );
210 shape =
static_cast<PCB_SHAPE*
>( aTestItem );
224 boardItem =
static_cast<BOARD_ITEM*
>( aTestItem );
236 boardItem = dimension;
243 boardItem =
static_cast<BOARD_ITEM*
>( aTestItem );
247 boardItem =
static_cast<BOARD_ITEM*
>( aTestItem );
254 field =
static_cast<PCB_FIELD*
>( aTestItem );
274 if(
text->GetParentFootprint() )
288 footprint =
static_cast<FOOTPRINT*
>( aTestItem );
289 boardItem = footprint;
298 marker =
static_cast<PCB_MARKER*
>( aTestItem );
304 boardItem =
static_cast<BOARD_ITEM*
>( aTestItem );
309 if( boardItem && !footprint )
360 auto type =
via->GetViaType();
389 else if( !
m_Guide->IgnoreZoneFills() )
401 else if( aTestItem == footprint )
421 if(
m_Guide->IsLayerVisible( layer ) )
439 if(
m_Guide->IncludeSecondary()
440 && ( !boardItem || !boardItem->
IsLocked() || !
m_Guide->IgnoreLockedItems() ) )
460 else if( !
m_Guide->IgnoreZoneFills() )
491 else if( boardItem &&
m_Guide->IsLayerVisible( boardItem->
GetLayer() ) )
527 wxCHECK_RET( aItem,
"" );
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.
bool IsLocked() const override
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Test to see if this object is on the given layer.
FOOTPRINT * GetParentFootprint() const
An abstract base class whose derivatives may be passed to a GENERAL_COLLECTOR telling it what should ...
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.
virtual bool IsVisible() const
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
static const int UNCONNECTED
Constant that holds the "unconnected net" number (typically 0) all items "connected" to this net are ...
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 ...
@ SMD
Smd pad, appears on the solder paste layer (default)
@ CONN
Like smd, does not appear on the solder paste layer (default) Note: also has a special attribute in G...
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_POINT_T
class PCB_POINT, a 0-dimensional point
@ 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
VECTOR2< int32_t > VECTOR2I