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 481 of file pns_node.cpp.

Constructor & Destructor Documentation

◆ HIT_VISITOR()

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

Definition at line 486 of file pns_node.cpp.

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

Member Function Documentation

◆ operator()()

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

Implements PNS::OBSTACLE_VISITOR.

Definition at line 491 of file pns_node.cpp.

492  {
493  SHAPE_CIRCLE cp( m_point, 0 );
494 
495  int cl = 0;
496 
497  if( aItem->Shape()->Collide( &cp, cl ) )
498  m_items.Add( aItem );
499 
500  return true;
501  }
void Add(const LINE &aLine)
Definition: pns_itemset.cpp:32
ITEM_SET & m_items
Definition: pns_node.cpp:483
const VECTOR2I & m_point
Definition: pns_node.cpp:484

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

◆ SetWorld()

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

Definition at line 161 of file pns_node.cpp.

162 {
163  m_node = aNode;
164  m_override = aOverride;
165 }
const NODE * m_node
node we are searching in (either root or a branch)
Definition: pns_node.h:115
const NODE * m_override
node that overrides root entries
Definition: pns_node.h:118

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

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

◆ visit()

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

Definition at line 168 of file pns_node.cpp.

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

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

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

Member Data Documentation

◆ m_extraClearance

int PNS::OBSTACLE_VISITOR::m_extraClearance
protectedinherited

additional clearance

Definition at line 121 of file pns_node.h.

◆ m_item

const ITEM* PNS::OBSTACLE_VISITOR::m_item
protectedinherited

the item we are looking for collisions with

Definition at line 112 of file pns_node.h.

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

◆ m_items

ITEM_SET& PNS::HIT_VISITOR::m_items

Definition at line 483 of file pns_node.cpp.

Referenced by operator()().

◆ m_node

const NODE* PNS::OBSTACLE_VISITOR::m_node
protectedinherited

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

Definition at line 115 of file pns_node.h.

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

◆ m_override

const NODE* PNS::OBSTACLE_VISITOR::m_override
protectedinherited

node that overrides root entries

Definition at line 118 of file pns_node.h.

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

◆ m_point

const VECTOR2I& PNS::HIT_VISITOR::m_point

Definition at line 484 of file pns_node.cpp.

Referenced by operator()().


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