KiCad PCB EDA Suite
DRC_RTREE::DRC_LAYER Struct Reference

The DRC_LAYER struct provides a layer-specific auto-range iterator to the RTree. More...

#include <drc_rtree.h>

Public Member Functions

 DRC_LAYER (drc_rtree *aTree)
 
 DRC_LAYER (drc_rtree *aTree, const EDA_RECT aRect)
 
iterator begin ()
 
iterator end ()
 

Public Attributes

drc_rtree::Rect m_rect
 
drc_rtreelayer_tree
 

Detailed Description

The DRC_LAYER struct provides a layer-specific auto-range iterator to the RTree.

Using this struct, one can write lines like:

for( auto item : rtree.OnLayer( In1_Cu ) )

and iterate over only the RTree items that are on In1

Definition at line 477 of file drc_rtree.h.

Constructor & Destructor Documentation

◆ DRC_LAYER() [1/2]

DRC_RTREE::DRC_LAYER::DRC_LAYER ( drc_rtree aTree)
inline

Definition at line 479 of file drc_rtree.h.

479  : layer_tree( aTree )
480  {
481  m_rect = { { INT_MIN, INT_MIN }, { INT_MAX, INT_MAX } };
482  };
drc_rtree * layer_tree
Definition: drc_rtree.h:491
drc_rtree::Rect m_rect
Definition: drc_rtree.h:488

References m_rect.

◆ DRC_LAYER() [2/2]

DRC_RTREE::DRC_LAYER::DRC_LAYER ( drc_rtree aTree,
const EDA_RECT  aRect 
)
inline

Definition at line 484 of file drc_rtree.h.

484  : layer_tree( aTree )
485  {
486  m_rect = { { aRect.GetX(), aRect.GetY() },
487  { aRect.GetRight(), aRect.GetBottom() } };
488  };
int GetX() const
Definition: eda_rect.h:107
drc_rtree * layer_tree
Definition: drc_rtree.h:491
drc_rtree::Rect m_rect
Definition: drc_rtree.h:488
int GetBottom() const
Definition: eda_rect.h:123
int GetRight() const
Definition: eda_rect.h:120
int GetY() const
Definition: eda_rect.h:108

References EDA_RECT::GetBottom(), EDA_RECT::GetRight(), EDA_RECT::GetX(), EDA_RECT::GetY(), and m_rect.

Member Function Documentation

◆ begin()

iterator DRC_RTREE::DRC_LAYER::begin ( )
inline

Definition at line 493 of file drc_rtree.h.

494  {
495  return layer_tree->begin( m_rect );
496  }
drc_rtree * layer_tree
Definition: drc_rtree.h:491
drc_rtree::Rect m_rect
Definition: drc_rtree.h:488

References layer_tree, and m_rect.

◆ end()

iterator DRC_RTREE::DRC_LAYER::end ( )
inline

Definition at line 498 of file drc_rtree.h.

499  {
500  return layer_tree->end( m_rect );
501  }
drc_rtree * layer_tree
Definition: drc_rtree.h:491
drc_rtree::Rect m_rect
Definition: drc_rtree.h:488

References layer_tree, and m_rect.

Member Data Documentation

◆ layer_tree

drc_rtree* DRC_RTREE::DRC_LAYER::layer_tree

Definition at line 491 of file drc_rtree.h.

Referenced by begin(), and end().

◆ m_rect

drc_rtree::Rect DRC_RTREE::DRC_LAYER::m_rect

Definition at line 488 of file drc_rtree.h.

Referenced by begin(), DRC_LAYER(), and end().


The documentation for this struct was generated from the following file: