KiCad PCB EDA Suite
PNS::OBSTACLE_VISITOR Class Referenceabstract

Struct OBSTACLE_VISITOR. More...

#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)
 
void SetWorld (const NODE *aNode, const NODE *aOverride=NULL)
 
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...
 
int m_extraClearance
 

additional clearance

More...
 

Detailed Description

Struct OBSTACLE_VISITOR.

Definition at line 98 of file pns_node.h.

Constructor & Destructor Documentation

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

Definition at line 152 of file pns_node.cpp.

152  :
153  m_item( aItem ),
154  m_node( NULL ),
155  m_override( NULL ),
156  m_extraClearance( 0 )
157 {
158 
159 }
const NODE * m_node
node we are searching in (either root or a branch)
Definition: pns_node.h:116
int m_extraClearance
additional clearance
Definition: pns_node.h:122
const ITEM * m_item
the item we are looking for collisions with
Definition: pns_node.h:113
const NODE * m_override
node that overrides root entries
Definition: pns_node.h:119

Member Function Documentation

virtual bool PNS::OBSTACLE_VISITOR::operator() ( ITEM aCandidate)
pure virtual
void PNS::OBSTACLE_VISITOR::SetWorld ( const NODE aNode,
const NODE aOverride = NULL 
)

Definition at line 162 of file pns_node.cpp.

References m_node, and m_override.

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

163 {
164  m_node = aNode;
165  m_override = aOverride;
166 }
const NODE * m_node
node we are searching in (either root or a branch)
Definition: pns_node.h:116
const NODE * m_override
node that overrides root entries
Definition: pns_node.h:119
bool PNS::OBSTACLE_VISITOR::visit ( ITEM aCandidate)
protected

Definition at line 169 of file pns_node.cpp.

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

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

170 {
171  // check if there is a more recent branch with a newer
172  // (possibily modified) version of this item.
173  if( m_override && m_override->Overrides( aCandidate ) )
174  return true;
175 
176  return false;
177 }
bool Overrides(ITEM *aItem) const
checks if this branch contains an updated version of the m_item from the root branch.
Definition: pns_node.h:416
const NODE * m_override
node that overrides root entries
Definition: pns_node.h:119

Member Data Documentation

int PNS::OBSTACLE_VISITOR::m_extraClearance
protected

additional clearance

Definition at line 122 of file pns_node.h.

const ITEM* PNS::OBSTACLE_VISITOR::m_item
protected

the item we are looking for collisions with

Definition at line 113 of file pns_node.h.

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

const NODE* PNS::OBSTACLE_VISITOR::m_node
protected

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

Definition at line 116 of file pns_node.h.

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

const NODE* PNS::OBSTACLE_VISITOR::m_override
protected

node that overrides root entries

Definition at line 119 of file pns_node.h.

Referenced by SetWorld(), and visit().


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