KiCad PCB EDA Suite
PNS::DRAG_ALGO Class Referenceabstract

DRAG_ALGO. More...

#include <pns_drag_algo.h>

Inheritance diagram for PNS::DRAG_ALGO:
PNS::ALGO_BASE PNS::COMPONENT_DRAGGER PNS::DRAGGER

Public Member Functions

 DRAG_ALGO (ROUTER *aRouter)
 
 ~DRAG_ALGO ()
 
virtual void SetWorld (NODE *aWorld)
 Function SetWorld() More...
 
virtual bool Start (const VECTOR2I &aP, ITEM_SET &aPrimitives)=0
 Function Start() More...
 
virtual bool Drag (const VECTOR2I &aP)=0
 Function Drag() More...
 
virtual bool FixRoute ()=0
 Function FixRoute() More...
 
virtual NODECurrentNode () const =0
 Function CurrentNode() More...
 
virtual const ITEM_SET Traces ()=0
 Function Traces() More...
 
virtual void SetMode (int aDragMode)
 
ROUTERRouter () const
 

Returns the instance of our router

More...
 
ROUTING_SETTINGSSettings () const
 

Returns current router settings

More...
 
virtual LOGGERLogger ()
 

Returns the logger object, allowing to dump geometry to a file.

More...
 
void SetLogger (LOGGER *aLogger)
 
void SetDebugDecorator (DEBUG_DECORATOR *aDecorator)
 Function SetDebugDecorator. More...
 
DEBUG_DECORATORDbg () const
 

Protected Attributes

NODEm_world
 
DEBUG_DECORATORm_debugDecorator
 
ROUTERm_router
 
LOGGERm_logger
 

Detailed Description

DRAG_ALGO.

Base class for item dragging algorithms.

Definition at line 42 of file pns_drag_algo.h.

Constructor & Destructor Documentation

◆ DRAG_ALGO()

PNS::DRAG_ALGO::DRAG_ALGO ( ROUTER aRouter)
inline

Definition at line 45 of file pns_drag_algo.h.

45  :
46  ALGO_BASE( aRouter ), m_world( nullptr )
47  {
48  }
ALGO_BASE(ROUTER *aRouter)
Definition: pns_algo_base.h:42

◆ ~DRAG_ALGO()

PNS::DRAG_ALGO::~DRAG_ALGO ( )
inline

Definition at line 50 of file pns_drag_algo.h.

51  {
52  }

Member Function Documentation

◆ CurrentNode()

virtual NODE* PNS::DRAG_ALGO::CurrentNode ( ) const
pure virtual

Function CurrentNode()

Returns the most recent world state, including all items changed due to dragging operation.

Implemented in PNS::DRAGGER, and PNS::COMPONENT_DRAGGER.

◆ Dbg()

◆ Drag()

virtual bool PNS::DRAG_ALGO::Drag ( const VECTOR2I aP)
pure virtual

Function Drag()

Drags the current segment/corner/via to the point aP.

Returns
true, if dragging finished with success.

Implemented in PNS::DRAGGER, and PNS::COMPONENT_DRAGGER.

◆ FixRoute()

virtual bool PNS::DRAG_ALGO::FixRoute ( )
pure virtual

Function FixRoute()

Checks if the result of current dragging operation is correct and eventually commits it to the world.

Returns
true, if dragging finished with success.

Implemented in PNS::DRAGGER, and PNS::COMPONENT_DRAGGER.

◆ Logger()

LOGGER * PNS::ALGO_BASE::Logger ( )
virtualinherited

Returns the logger object, allowing to dump geometry to a file.

Reimplemented in PNS::SHOVE.

Definition at line 34 of file pns_algo_base.cpp.

35 {
36  return NULL;
37 }
#define NULL

References NULL.

Referenced by PNS::DRAGGER::dragWalkaround(), PNS::LINE_PLACER::rhShoveOnly(), PNS::LINE_PLACER::rhWalkOnly(), and PNS::DRAGGER::Start().

◆ Router()

◆ SetDebugDecorator()

void PNS::ALGO_BASE::SetDebugDecorator ( DEBUG_DECORATOR aDecorator)
inlineinherited

Function SetDebugDecorator.

Assign a debug decorator allowing this algo to draw extra graphics for visual debugging

Definition at line 72 of file pns_algo_base.h.

73  {
74  m_debugDecorator = aDecorator;
75  }
DEBUG_DECORATOR * m_debugDecorator
Definition: pns_algo_base.h:83

References PNS::ALGO_BASE::m_debugDecorator.

Referenced by PNS::DRAGGER::dragWalkaround(), PNS::LINE_PLACER::rhShoveOnly(), PNS::LINE_PLACER::rhWalkOnly(), and PNS::SHOVE::SHOVE().

◆ SetLogger()

void PNS::ALGO_BASE::SetLogger ( LOGGER aLogger)
inlineinherited

Definition at line 62 of file pns_algo_base.h.

63  {
64  m_logger = aLogger;
65  }
LOGGER * m_logger
Definition: pns_algo_base.h:85

References PNS::ALGO_BASE::m_logger.

Referenced by PNS::DRAGGER::dragWalkaround(), PNS::LINE_PLACER::rhShoveOnly(), and PNS::LINE_PLACER::rhWalkOnly().

◆ SetMode()

virtual void PNS::DRAG_ALGO::SetMode ( int  aDragMode)
inlinevirtual

Reimplemented in PNS::DRAGGER.

Definition at line 105 of file pns_drag_algo.h.

105 {};

◆ Settings()

◆ SetWorld()

virtual void PNS::DRAG_ALGO::SetWorld ( NODE aWorld)
inlinevirtual

Function SetWorld()

Sets the board to work on.

Definition at line 59 of file pns_drag_algo.h.

60  {
61  m_world = aWorld;
62  }

References m_world.

◆ Start()

virtual bool PNS::DRAG_ALGO::Start ( const VECTOR2I aP,
ITEM_SET aPrimitives 
)
pure virtual

Function Start()

Starts routing a single track at point aP, taking item aStartItem as anchor (unless NULL). Returns true if a dragging operation has started.

Implemented in PNS::DRAGGER, and PNS::COMPONENT_DRAGGER.

◆ Traces()

virtual const ITEM_SET PNS::DRAG_ALGO::Traces ( )
pure virtual

Function Traces()

Returns the set of dragged items.

Implemented in PNS::DRAGGER, and PNS::COMPONENT_DRAGGER.

Member Data Documentation

◆ m_debugDecorator

DEBUG_DECORATOR* PNS::ALGO_BASE::m_debugDecorator
protectedinherited

Definition at line 83 of file pns_algo_base.h.

Referenced by PNS::ALGO_BASE::Dbg(), and PNS::ALGO_BASE::SetDebugDecorator().

◆ m_logger

LOGGER* PNS::ALGO_BASE::m_logger
protectedinherited

Definition at line 85 of file pns_algo_base.h.

Referenced by PNS::ALGO_BASE::SetLogger(), and PNS::WALKAROUND::singleStep().

◆ m_router

ROUTER* PNS::ALGO_BASE::m_router
protectedinherited

Definition at line 84 of file pns_algo_base.h.

Referenced by PNS::ALGO_BASE::Router(), and PNS::ALGO_BASE::Settings().

◆ m_world


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