KiCad PCB EDA Suite
PNS::OBSTACLE_VISITOR Class Referenceabstract

#include <pns_node.h>

Inheritance diagram for PNS::OBSTACLE_VISITOR:
PNS::HIT_VISITOR PNS::NODE::DEFAULT_OBSTACLE_VISITOR

Public Member Functions

 OBSTACLE_VISITOR (const ITEM *aItem)
 
virtual ~OBSTACLE_VISITOR ()
 
void SetWorld (const NODE *aNode, const NODE *aOverride=nullptr)
 
virtual bool operator() (ITEM *aCandidate)=0
 

Protected Member Functions

bool visit (ITEM *aCandidate)
 

Protected Attributes

const ITEMm_item
 the item we are looking for collisions with More...
 
const NODEm_node
 node we are searching in (either root or a branch) More...
 
const NODEm_override
 node that overrides root entries More...
 

Detailed Description

Definition at line 114 of file pns_node.h.

Constructor & Destructor Documentation

◆ OBSTACLE_VISITOR()

PNS::OBSTACLE_VISITOR::OBSTACLE_VISITOR ( const ITEM aItem)

Definition at line 182 of file pns_node.cpp.

182  :
183  m_item( aItem ),
184  m_node( nullptr ),
185  m_override( nullptr )
186 {
187 }
const NODE * m_node
node we are searching in (either root or a branch)
Definition: pns_node.h:133
const ITEM * m_item
the item we are looking for collisions with
Definition: pns_node.h:131
const NODE * m_override
node that overrides root entries
Definition: pns_node.h:134

◆ ~OBSTACLE_VISITOR()

virtual PNS::OBSTACLE_VISITOR::~OBSTACLE_VISITOR ( )
inlinevirtual

Definition at line 119 of file pns_node.h.

120  {
121  }

Member Function Documentation

◆ operator()()

virtual bool PNS::OBSTACLE_VISITOR::operator() ( ITEM aCandidate)
pure virtual

◆ SetWorld()

void PNS::OBSTACLE_VISITOR::SetWorld ( const NODE aNode,
const NODE aOverride = nullptr 
)

Definition at line 190 of file pns_node.cpp.

191 {
192  m_node = aNode;
193  m_override = aOverride;
194 }
const NODE * m_node
node we are searching in (either root or a branch)
Definition: pns_node.h:133
const NODE * m_override
node that overrides root entries
Definition: pns_node.h:134

References m_node, and m_override.

Referenced by PNS::NODE::HitTest(), and PNS::NODE::QueryColliding().

◆ visit()

bool PNS::OBSTACLE_VISITOR::visit ( ITEM aCandidate)
protected

Definition at line 197 of file pns_node.cpp.

198 {
199  // check if there is a more recent branch with a newer (possibly modified) version of this
200  // item.
201  if( m_override && m_override->Overrides( aCandidate ) )
202  return true;
203 
204  return false;
205 }
bool Overrides(ITEM *aItem) const
Definition: pns_node.h:380
const NODE * m_override
node that overrides root entries
Definition: pns_node.h:134

References m_override, and PNS::NODE::Overrides().

Referenced by PNS::NODE::DEFAULT_OBSTACLE_VISITOR::operator()().

Member Data Documentation

◆ m_item

const ITEM* PNS::OBSTACLE_VISITOR::m_item
protected

the item we are looking for collisions with

Definition at line 131 of file pns_node.h.

Referenced by PNS::NODE::DEFAULT_OBSTACLE_VISITOR::operator()().

◆ m_node

const NODE* PNS::OBSTACLE_VISITOR::m_node
protected

node we are searching in (either root or a branch)

Definition at line 133 of file pns_node.h.

Referenced by PNS::NODE::DEFAULT_OBSTACLE_VISITOR::operator()(), and SetWorld().

◆ m_override

const NODE* PNS::OBSTACLE_VISITOR::m_override
protected

node that overrides root entries

Definition at line 134 of file pns_node.h.

Referenced by SetWorld(), and visit().


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