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

#include <connectivity_items.h>

Inheritance diagram for CN_ZONE_LAYER:
CN_ITEM

Public Member Functions

 CN_ZONE_LAYER (ZONE *aParent, PCB_LAYER_ID aLayer, int aSubpolyIndex)
 
void BuildRTree ()
 
int SubpolyIndex () const
 
PCB_LAYER_ID GetLayer () const
 
bool ContainsPoint (const VECTOR2I &p) const
 
PCB_LAYER_ID GetLayer ()
 
virtual int AnchorCount () const override
 
virtual const VECTOR2I GetAnchor (int n) const override
 
bool HasValidOutline () const
 
const SHAPE_LINE_CHAINGetOutline () const
 
int OutlinePointCount () const
 
const VECTOR2IOutlinePoint (int aIndex) const
 
bool Collide (SHAPE *aRefShape) const
 
bool HasSingleConnection ()
 
void Dump ()
 
std::shared_ptr< CN_ANCHORAddAnchor (const VECTOR2I &aPos)
 
std::vector< std::shared_ptr< CN_ANCHOR > > & Anchors ()
 
void SetValid (bool aValid)
 
bool Valid () const
 
void SetDirty (bool aDirty)
 
bool Dirty () const
 
void SetLayers (int aStartLayer, int aEndLayer)
 Set the layers spanned by the item to aStartLayer and aEndLayer.
 
void SetLayer (int aLayer)
 Set the layers spanned by the item to a single layer aLayer.
 
int StartLayer () const
 Return the contiguous set of layers spanned by the item.
 
int EndLayer () const
 
virtual int Layer () const
 Return the item's layer, for single-layered items only.
 
PCB_LAYER_ID GetBoardLayer () const
 When using CN_ITEM layers to compare against board items, use this function which correctly remaps the B_Cu layer.
 
const BOX2IBBox ()
 
BOARD_CONNECTED_ITEMParent () const
 
const std::vector< CN_ITEM * > & ConnectedItems () const
 
void ClearConnections ()
 
bool CanChangeNet () const
 
void Connect (CN_ITEM *b)
 
void RemoveInvalidRefs ()
 
int Net () const
 

Protected Attributes

std::atomic< bool > m_dirty
 used to identify recently added item not yet scanned into the connectivity search
 
int m_start_layer
 start layer of the item N.B. B_Cu is set to INT_MAX
 
int m_end_layer
 end layer of the item N.B. B_Cu is set to INT_MAX
 
BOX2I m_bbox
 bounding box for the item
 

Private Attributes

ZONEm_zone
 
int m_subpolyIndex
 
PCB_LAYER_ID m_layer
 
SHAPE_LINE_CHAIN m_outline
 Cached copy of the zone outline.
 
std::vector< std::unique_ptr< SHAPE_POLY_SET::TRIANGULATED_POLYGON > > m_triangulatedPolys
 
RTree< const SHAPE *, int, 2, double > m_rTree
 
BOARD_CONNECTED_ITEMm_parent
 
std::vector< CN_ITEM * > m_connected
 list of physically touching items
 
std::vector< std::shared_ptr< CN_ANCHOR > > m_anchors
 
bool m_canChangeNet
 can the net propagator modify the netcode?
 
bool m_valid
 used to identify garbage items (we use lazy removal)
 
std::mutex m_listLock
 mutex protecting this item's connected_items set to
 

Detailed Description

Definition at line 292 of file connectivity_items.h.

Constructor & Destructor Documentation

◆ CN_ZONE_LAYER()

CN_ZONE_LAYER::CN_ZONE_LAYER ( ZONE * aParent,
PCB_LAYER_ID aLayer,
int aSubpolyIndex )
inline

Member Function Documentation

◆ AddAnchor()

std::shared_ptr< CN_ANCHOR > CN_ITEM::AddAnchor ( const VECTOR2I & aPos)
inlineinherited

Definition at line 156 of file connectivity_items.h.

References m_anchors.

Referenced by CN_LIST::Add(), CN_LIST::Add(), CN_LIST::Add(), CN_LIST::Add(), and CN_LIST::Add().

◆ AnchorCount()

int CN_ZONE_LAYER::AnchorCount ( ) const
overridevirtual

Reimplemented from CN_ITEM.

Definition at line 97 of file connectivity_items.cpp.

References GetOutline(), HasValidOutline(), SHAPE_LINE_CHAIN::PointCount(), and CN_ITEM::Valid().

◆ Anchors()

std::vector< std::shared_ptr< CN_ANCHOR > > & CN_ITEM::Anchors ( )
inlineinherited

Definition at line 162 of file connectivity_items.h.

References m_anchors.

◆ BBox()

const BOX2I & CN_ITEM::BBox ( )
inlineinherited

◆ BuildRTree()

void CN_ZONE_LAYER::BuildRTree ( )
inline

◆ CanChangeNet()

bool CN_ITEM::CanChangeNet ( ) const
inlineinherited

Definition at line 243 of file connectivity_items.h.

References m_canChangeNet.

Referenced by CN_VISITOR::checkZoneItemConnection(), and CN_VISITOR::operator()().

◆ ClearConnections()

void CN_ITEM::ClearConnections ( )
inlineinherited

Definition at line 241 of file connectivity_items.h.

References m_connected.

◆ Collide()

bool CN_ZONE_LAYER::Collide ( SHAPE * aRefShape) const
inline

◆ Connect()

void CN_ITEM::Connect ( CN_ITEM * b)
inlineinherited

◆ ConnectedItems()

◆ ContainsPoint()

bool CN_ZONE_LAYER::ContainsPoint ( const VECTOR2I & p) const
inline

◆ Dirty()

bool CN_ITEM::Dirty ( ) const
inlineinherited

Definition at line 168 of file connectivity_items.h.

References m_dirty.

Referenced by CN_VISITOR::operator()().

◆ Dump()

void CN_ITEM::Dump ( )
inherited

Definition at line 85 of file connectivity_items.cpp.

References CN_ITEM(), m_connected, EDA_ITEM::Type(), and Valid().

◆ EndLayer()

int CN_ITEM::EndLayer ( ) const
inlineinherited

Definition at line 196 of file connectivity_items.h.

References m_end_layer.

Referenced by CN_LIST::FindNearby().

◆ GetAnchor()

const VECTOR2I CN_ZONE_LAYER::GetAnchor ( int n) const
overridevirtual

Reimplemented from CN_ITEM.

Definition at line 106 of file connectivity_items.cpp.

References SHAPE_LINE_CHAIN::CPoint(), GetOutline(), HasValidOutline(), and CN_ITEM::Valid().

◆ GetBoardLayer()

PCB_LAYER_ID CN_ITEM::GetBoardLayer ( ) const
inlineinherited

When using CN_ITEM layers to compare against board items, use this function which correctly remaps the B_Cu layer.

Definition at line 212 of file connectivity_items.h.

References B_Cu, Layer(), and ToLAYER_ID().

Referenced by RN_NET::OptimizeRNEdges().

◆ GetLayer() [1/2]

PCB_LAYER_ID CN_ZONE_LAYER::GetLayer ( )
inline

Definition at line 382 of file connectivity_items.h.

References m_layer.

◆ GetLayer() [2/2]

PCB_LAYER_ID CN_ZONE_LAYER::GetLayer ( ) const
inline

◆ GetOutline()

const SHAPE_LINE_CHAIN & CN_ZONE_LAYER::GetOutline ( ) const
inline

◆ HasSingleConnection()

bool CN_ZONE_LAYER::HasSingleConnection ( )

◆ HasValidOutline()

bool CN_ZONE_LAYER::HasValidOutline ( ) const
inline

Definition at line 387 of file connectivity_items.h.

References m_outline.

Referenced by AnchorCount(), CN_VISITOR::checkZoneZoneConnection(), and GetAnchor().

◆ Layer()

virtual int CN_ITEM::Layer ( ) const
inlinevirtualinherited

Return the item's layer, for single-layered items only.

N.B. This should only be used inside connectivity as B_Cu is mapped to a large int

Definition at line 203 of file connectivity_items.h.

References StartLayer().

Referenced by GetBoardLayer().

◆ Net()

◆ OutlinePoint()

const VECTOR2I & CN_ZONE_LAYER::OutlinePoint ( int aIndex) const
inline

Definition at line 402 of file connectivity_items.h.

References m_outline.

◆ OutlinePointCount()

int CN_ZONE_LAYER::OutlinePointCount ( ) const
inline

Definition at line 397 of file connectivity_items.h.

References m_outline.

◆ Parent()

◆ RemoveInvalidRefs()

void CN_ITEM::RemoveInvalidRefs ( )
inherited

Definition at line 132 of file connectivity_items.cpp.

References m_connected.

◆ SetDirty()

void CN_ITEM::SetDirty ( bool aDirty)
inlineinherited

Definition at line 167 of file connectivity_items.h.

References m_dirty.

Referenced by CN_LIST::Add(), CN_LIST::Add(), CN_LIST::Add(), CN_LIST::Add(), and CN_LIST::Add().

◆ SetLayer()

void CN_ITEM::SetLayer ( int aLayer)
inlineinherited

Set the layers spanned by the item to a single layer aLayer.

Definition at line 190 of file connectivity_items.h.

References SetLayers().

Referenced by CN_LIST::Add(), CN_LIST::Add(), and CN_LIST::Add().

◆ SetLayers()

void CN_ITEM::SetLayers ( int aStartLayer,
int aEndLayer )
inlineinherited

Set the layers spanned by the item to aStartLayer and aEndLayer.

Definition at line 173 of file connectivity_items.h.

References B_Cu, m_end_layer, and m_start_layer.

Referenced by CN_LIST::Add(), CN_ZONE_LAYER::CN_ZONE_LAYER(), and SetLayer().

◆ SetValid()

void CN_ITEM::SetValid ( bool aValid)
inlineinherited

Definition at line 164 of file connectivity_items.h.

References m_valid.

◆ StartLayer()

int CN_ITEM::StartLayer ( ) const
inlineinherited

Return the contiguous set of layers spanned by the item.

Definition at line 195 of file connectivity_items.h.

References m_start_layer.

Referenced by CN_LIST::FindNearby(), and Layer().

◆ SubpolyIndex()

int CN_ZONE_LAYER::SubpolyIndex ( ) const
inline

◆ Valid()

Member Data Documentation

◆ m_anchors

std::vector<std::shared_ptr<CN_ANCHOR> > CN_ITEM::m_anchors
privateinherited

Definition at line 278 of file connectivity_items.h.

Referenced by AddAnchor(), AnchorCount(), Anchors(), CN_ITEM(), GetAnchor(), and ~CN_ITEM().

◆ m_bbox

BOX2I CN_ITEM::m_bbox
protectedinherited

bounding box for the item

Definition at line 272 of file connectivity_items.h.

Referenced by BBox().

◆ m_canChangeNet

bool CN_ITEM::m_canChangeNet
privateinherited

can the net propagator modify the netcode?

Definition at line 280 of file connectivity_items.h.

Referenced by CanChangeNet(), and CN_ITEM().

◆ m_connected

std::vector<CN_ITEM*> CN_ITEM::m_connected
privateinherited

list of physically touching items

Definition at line 277 of file connectivity_items.h.

Referenced by ClearConnections(), CN_ITEM(), Connect(), ConnectedItems(), Dump(), and RemoveInvalidRefs().

◆ m_dirty

std::atomic<bool> CN_ITEM::m_dirty
protectedinherited

used to identify recently added item not yet scanned into the connectivity search

Definition at line 268 of file connectivity_items.h.

Referenced by BBox(), CN_ITEM(), Dirty(), and SetDirty().

◆ m_end_layer

int CN_ITEM::m_end_layer
protectedinherited

end layer of the item N.B. B_Cu is set to INT_MAX

Definition at line 271 of file connectivity_items.h.

Referenced by CN_ITEM(), EndLayer(), and SetLayers().

◆ m_layer

PCB_LAYER_ID CN_ZONE_LAYER::m_layer
private

Definition at line 442 of file connectivity_items.h.

Referenced by BuildRTree(), CN_ZONE_LAYER(), GetLayer(), and GetLayer().

◆ m_listLock

std::mutex CN_ITEM::m_listLock
privateinherited

mutex protecting this item's connected_items set to

Definition at line 284 of file connectivity_items.h.

Referenced by BBox(), and Connect().

◆ m_outline

SHAPE_LINE_CHAIN CN_ZONE_LAYER::m_outline
private

Cached copy of the zone outline.

Owned deep copies of triangulated polygons (includes vertex storage that TRI references)

Definition at line 443 of file connectivity_items.h.

Referenced by CN_ZONE_LAYER(), Collide(), ContainsPoint(), GetOutline(), HasValidOutline(), OutlinePoint(), and OutlinePointCount().

◆ m_parent

BOARD_CONNECTED_ITEM* CN_ITEM::m_parent
privateinherited

Definition at line 275 of file connectivity_items.h.

Referenced by AnchorCount(), BBox(), CN_ITEM(), GetAnchor(), Net(), and Parent().

◆ m_rTree

RTree<const SHAPE*, int, 2, double> CN_ZONE_LAYER::m_rTree
private

Definition at line 446 of file connectivity_items.h.

Referenced by BuildRTree(), Collide(), and ContainsPoint().

◆ m_start_layer

int CN_ITEM::m_start_layer
protectedinherited

start layer of the item N.B. B_Cu is set to INT_MAX

Definition at line 270 of file connectivity_items.h.

Referenced by CN_ITEM(), SetLayers(), and StartLayer().

◆ m_subpolyIndex

int CN_ZONE_LAYER::m_subpolyIndex
private

Definition at line 441 of file connectivity_items.h.

Referenced by BuildRTree(), CN_ZONE_LAYER(), and SubpolyIndex().

◆ m_triangulatedPolys

std::vector<std::unique_ptr<SHAPE_POLY_SET::TRIANGULATED_POLYGON> > CN_ZONE_LAYER::m_triangulatedPolys
private

Definition at line 445 of file connectivity_items.h.

Referenced by BuildRTree().

◆ m_valid

bool CN_ITEM::m_valid
privateinherited

used to identify garbage items (we use lazy removal)

Definition at line 282 of file connectivity_items.h.

Referenced by AnchorCount(), BBox(), CN_ITEM(), GetAnchor(), Net(), SetValid(), and Valid().

◆ m_zone

ZONE* CN_ZONE_LAYER::m_zone
private

Definition at line 440 of file connectivity_items.h.

Referenced by BuildRTree(), CN_ZONE_LAYER(), Collide(), and ContainsPoint().


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