KiCad PCB EDA Suite
PNS::HIT_VISITOR Struct Reference
Inheritance diagram for PNS::HIT_VISITOR:
PNS::OBSTACLE_VISITOR

Public Member Functions

 HIT_VISITOR (ITEM_SET &aTab, const VECTOR2I &aPoint)
 
bool operator() (ITEM *aItem) override
 
void SetWorld (const NODE *aNode, const NODE *aOverride=NULL)
 

Public Attributes

ITEM_SETm_items
 
const VECTOR2Im_point
 

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

Definition at line 480 of file pns_node.cpp.

Constructor & Destructor Documentation

PNS::HIT_VISITOR::HIT_VISITOR ( ITEM_SET aTab,
const VECTOR2I aPoint 
)
inline

Definition at line 485 of file pns_node.cpp.

485  :
486  OBSTACLE_VISITOR( NULL ),
487  m_items( aTab ), m_point( aPoint )
488  {}
ITEM_SET & m_items
Definition: pns_node.cpp:482
OBSTACLE_VISITOR(const ITEM *aItem)
Definition: pns_node.cpp:150
const VECTOR2I & m_point
Definition: pns_node.cpp:483

Member Function Documentation

bool PNS::HIT_VISITOR::operator() ( ITEM aItem)
inlineoverridevirtual

Implements PNS::OBSTACLE_VISITOR.

Definition at line 490 of file pns_node.cpp.

References PNS::ITEM_SET::Add(), SHAPE::Collide(), and PNS::ITEM::Shape().

491  {
492  SHAPE_CIRCLE cp( m_point, 0 );
493 
494  int cl = 0;
495 
496  if( aItem->Shape()->Collide( &cp, cl ) )
497  m_items.Add( aItem );
498 
499  return true;
500  }
void Add(const LINE &aLine)
Definition: pns_itemset.cpp:32
ITEM_SET & m_items
Definition: pns_node.cpp:482
const VECTOR2I & m_point
Definition: pns_node.cpp:483
void PNS::OBSTACLE_VISITOR::SetWorld ( const NODE aNode,
const NODE aOverride = NULL 
)
inherited

Definition at line 160 of file pns_node.cpp.

References PNS::OBSTACLE_VISITOR::m_node, and PNS::OBSTACLE_VISITOR::m_override.

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

161 {
162  m_node = aNode;
163  m_override = aOverride;
164 }
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)
protectedinherited

Definition at line 167 of file pns_node.cpp.

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

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

168 {
169  // check if there is a more recent branch with a newer
170  // (possibily modified) version of this item.
171  if( m_override && m_override->Overrides( aCandidate ) )
172  return true;
173 
174  return false;
175 }
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
protectedinherited

additional clearance

Definition at line 122 of file pns_node.h.

const ITEM* PNS::OBSTACLE_VISITOR::m_item
protectedinherited

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()().

ITEM_SET& PNS::HIT_VISITOR::m_items

Definition at line 482 of file pns_node.cpp.

const NODE* PNS::OBSTACLE_VISITOR::m_node
protectedinherited

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 PNS::OBSTACLE_VISITOR::SetWorld().

const NODE* PNS::OBSTACLE_VISITOR::m_override
protectedinherited

node that overrides root entries

Definition at line 119 of file pns_node.h.

Referenced by PNS::OBSTACLE_VISITOR::SetWorld(), and PNS::OBSTACLE_VISITOR::visit().

const VECTOR2I& PNS::HIT_VISITOR::m_point

Definition at line 483 of file pns_node.cpp.


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