84 case 1: pt1.
y -= pad->
GetSize().y / 2;
break;
85 case 2: pt1.
y += pad->
GetSize().y / 2;
break;
86 case 3: pt1.
x -= pad->
GetSize().x / 2;
break;
87 case 4: pt1.
x += pad->
GetSize().x / 2;
break;
104 case 1: pt1.
y = INT_MIN / 2;
break;
105 case 2: pt1.
y = INT_MAX / 2;
break;
106 case 3: pt1.
x = INT_MIN / 2;
break;
107 case 4: pt1.
x = INT_MAX / 2;
break;
120 if( intersections.empty() )
128 return intersections[ intersections.size() - 1 ].p;
137 return static_cast<const TRACK*>(
m_parent )->GetStart();
139 return static_cast<const TRACK*>(
m_parent )->GetEnd();
142 return static_cast<const VIA*>(
m_parent )->GetStart();
155 wxLogDebug(
" valid: %d, connected: \n", !!
Valid());
159 TRACK* t = static_cast<TRACK*>( i->Parent() );
160 wxLogDebug(
" - %p %d\n", t, t->
Type() );
170 const ZONE* zone = static_cast<const ZONE*>(
Parent() );
182 const ZONE* zone = static_cast<const ZONE*>(
Parent() );
185 return outline.
CPoint( 0 );
193 if( !(*it)->Valid() )
206 auto item =
new CN_ITEM( pad,
false, 1 );
240 auto item =
new CN_ITEM( track,
true );
242 item->AddAnchor( track->
GetStart() );
243 item->AddAnchor( track->
GetEnd() );
244 item->SetLayer( track->
GetLayer() );
252 auto item =
new CN_ITEM( aArc,
true );
254 item->AddAnchor( aArc->
GetStart() );
255 item->AddAnchor( aArc->
GetEnd() );
279 std::vector<CN_ITEM*> rv;
281 for(
int j = 0; j < polys.OutlineCount(); j++ )
286 for(
int k = 0; k < outline.PointCount(); k++ )
292 rv.push_back( zitem );
309 aGarbage.push_back ( item );
319 item->RemoveInvalidRefs();
321 for(
auto item : aGarbage )
353 size_t minimal_count = 1;
358 return connected_count < 2;
361 return connected_count < minimal_count;
364 accuracy = ( static_cast<const TRACK*>(
Parent() )->GetWidth() + 1 )/ 2;
373 ZONE* zone = static_cast<ZONE*>( item->Parent() );
376 wxPoint(
Pos() ), accuracy ) )
379 else if( item->Parent()->HitTest( wxPoint(
Pos() ), accuracy ) )
383 return connected_count < minimal_count;
392 int connected_count = 0;
398 ZONE* zone = static_cast<ZONE*>( item->Parent() );
404 else if( item->Parent()->HitTest( (wxPoint)
Pos() ) )
408 return connected_count;
444 [ &aItem ] (
const CN_ITEM* item )
446 return item->Valid() && item->Parent() == aItem;
455 wxLogTrace(
"CN",
" - item : %p bitem : %p type : %d inet %s\n",
458 item->Parent()->Type(),
459 (
const char*) item->Parent()->GetNetname().c_str() );
460 wxLogTrace(
"CN",
"- item : %p bitem : %p type : %d inet %s\n",
463 item->Parent()->Type(),
464 (
const char*) item->Parent()->GetNetname().c_str() );
474 if( item->
Net() <= 0 )
void RemoveInvalidItems(std::vector< CN_ITEM * > &aGarbage)
const CONNECTED_ITEMS & ConnectedItems() const
bool Contains(const CN_ITEM *aItem)
std::vector< CN_ITEM * > m_items
int Intersect(const SEG &aSeg, INTERSECTIONS &aIp) const
Function Intersect()
std::vector< INTERSECTION > INTERSECTIONS
BOARD_CONNECTED_ITEM * m_parent
std::shared_ptr< CN_CLUSTER > m_cluster
const wxPoint & GetStart() const
void addItemtoTree(CN_ITEM *item)
bool m_valid
used to identify garbage items (we use lazy removal)
Smd pad, appears on the solder paste layer (default)
bool GetIsFree() const
Checks if the via is a free via (as opposed to one created on a track by the router).
class ARC, an arc track segment on a copper layer
wxString GetNetname() const
class PAD, a pad in a footprint
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
const SHAPE_POLY_SET & GetFilledPolysList(PCB_LAYER_ID aLayer) const
Function GetFilledPolysList returns a reference to the list of filled polygons.
PAD_SHAPE_T GetShape() const
BOARD_CONNECTED_ITEM * Parent() const
void RotatePoint(int *pX, int *pY, double angle)
like PAD_PTH, but not plated mechanical use only, no connection allowed
bool IsDangling() const
The anchor point is dangling if the parent is a track and this anchor point is not connected to anoth...
int PointCount() const
Function PointCount()
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
void SetDirty(bool aDirty=true)
int ConnectedItemsCount() const
bool HitTestFilledArea(PCB_LAYER_ID aLayer, const wxPoint &aRefPos, int aAccuracy=0) const
Function HitTestFilledArea tests if the given wxPoint is within the bounds of a filled area of this z...
int Net() const
allow parallel connection threads
class TRACK, a track segment (segment on a copper layer)
virtual int AnchorCount() const
PAD_ATTR_T GetAttribute() const
const VECTOR2I & CPoint(int aIndex) const
Function Point()
std::vector< CN_ITEM * > m_items
PCB_LAYER_ID
A quick note on layer IDs:
LSET is a set of PCB_LAYER_IDs.
double GetOrientation() const
Return the rotation angle of the pad in a variety of units (the basic call returns tenths of degrees)...
virtual int AnchorCount() const override
const wxSize & GetSize() const
ZONE handles a list of polygons defining a copper zone.
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
class ZONE, a copper pour area
bool IsOnCopperLayer() const override
Like smd, does not appear on the solder paste layer (default) note also has a special attribute in Ge...
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
virtual const VECTOR2I GetAnchor(int n) const
wxString OriginNetName() const
void AddAnchor(const VECTOR2I &aPos)
wxPoint GetPosition() const override
CN_ITEM * m_item
Tag for quick connection resolution.
void SetLayer(int aLayer)
Set the layers spanned by the item to a single layer aLayer.
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
BOARD_CONNECTED_ITEM * Parent() const
virtual const VECTOR2I GetAnchor(int n) const override
const std::shared_ptr< SHAPE_POLY_SET > & GetEffectivePolygon() const
PCB_LAYER_ID TopLayer() const
const wxPoint & GetEnd() const
void Remove(T aItem)
Function Remove() Removes an item from the tree.
const VECTOR2I & Pos() const
CONNECTED_ITEMS m_connected
list of items physically connected (touching)
class VIA, a via (like a track segment on a copper layer)
PCB_LAYER_ID BottomLayer() const
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Represent a contiguous set of PCB layers.
CN_RTREE< CN_ITEM * > m_index
KICAD_T Type() const
Returns the type of object.