KiCad PCB EDA Suite
PNS::OPTIMIZER::CACHE_VISITOR Struct Reference

Public Member Functions

 CACHE_VISITOR (const ITEM *aOurItem, NODE *aNode, int aMask)
 
bool operator() (ITEM *aOtherItem)
 

Public Attributes

const ITEMm_ourItem
 
ITEMm_collidingItem
 
NODEm_node
 
int m_mask
 

Detailed Description

Definition at line 141 of file pns_optimizer.cpp.

Constructor & Destructor Documentation

PNS::OPTIMIZER::CACHE_VISITOR::CACHE_VISITOR ( const ITEM aOurItem,
NODE aNode,
int  aMask 
)
inline

Definition at line 143 of file pns_optimizer.cpp.

143  :
144  m_ourItem( aOurItem ),
145  m_collidingItem( NULL ),
146  m_node( aNode ),
147  m_mask( aMask )
148  {}

Member Function Documentation

bool PNS::OPTIMIZER::CACHE_VISITOR::operator() ( ITEM aOtherItem)
inline

Definition at line 150 of file pns_optimizer.cpp.

References PNS::ITEM::Collide(), PNS::NODE::GetClearance(), PNS::ITEM::Kind(), m_collidingItem, m_mask, m_node, and m_ourItem.

151  {
152  if( !( m_mask & aOtherItem->Kind() ) )
153  return true;
154 
155  int clearance = m_node->GetClearance( aOtherItem, m_ourItem );
156 
157  if( !aOtherItem->Collide( m_ourItem, clearance ) )
158  return true;
159 
160  m_collidingItem = aOtherItem;
161  return false;
162  }
int GetClearance(const ITEM *aA, const ITEM *aB) const
Returns the expected clearance between items a and b.
Definition: pns_node.cpp:100

Member Data Documentation

ITEM* PNS::OPTIMIZER::CACHE_VISITOR::m_collidingItem

Definition at line 165 of file pns_optimizer.cpp.

Referenced by PNS::OPTIMIZER::checkColliding(), and operator()().

int PNS::OPTIMIZER::CACHE_VISITOR::m_mask

Definition at line 167 of file pns_optimizer.cpp.

Referenced by operator()().

NODE* PNS::OPTIMIZER::CACHE_VISITOR::m_node

Definition at line 166 of file pns_optimizer.cpp.

Referenced by operator()().

const ITEM* PNS::OPTIMIZER::CACHE_VISITOR::m_ourItem

Definition at line 164 of file pns_optimizer.cpp.

Referenced by operator()().


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