KiCad PCB EDA Suite
PNS::PLACEMENT_ALGO Class Referenceabstract

PLACEMENT_ALGO. More...

#include <pns_placement_algo.h>

Inheritance diagram for PNS::PLACEMENT_ALGO:
PNS::ALGO_BASE PNS::DIFF_PAIR_PLACER PNS::LINE_PLACER PNS::MEANDER_PLACER_BASE PNS::DP_MEANDER_PLACER PNS::MEANDER_PLACER PNS::MEANDER_SKEW_PLACER

Public Member Functions

 PLACEMENT_ALGO (ROUTER *aRouter)
 
virtual ~PLACEMENT_ALGO ()
 
virtual bool Start (const VECTOR2I &aP, ITEM *aStartItem)=0
 Function Start() More...
 
virtual bool Move (const VECTOR2I &aP, ITEM *aEndItem)=0
 Function Move() More...
 
virtual bool FixRoute (const VECTOR2I &aP, ITEM *aEndItem, bool aForceFinish=false)=0
 Function FixRoute() More...
 
virtual bool UnfixRoute ()
 
virtual bool CommitPlacement ()
 
virtual bool AbortPlacement ()
 
virtual bool HasPlacedAnything () const
 
virtual bool ToggleVia (bool aEnabled)
 Function ToggleVia() More...
 
virtual bool IsPlacingVia () const
 Function IsPlacingVia() More...
 
virtual bool SetLayer (int aLayer)
 Function SetLayer() More...
 
virtual const ITEM_SET Traces ()=0
 Function Traces() More...
 
virtual const VECTOR2ICurrentEnd () const =0
 Function CurrentEnd() More...
 
virtual const std::vector< int > CurrentNets () const =0
 Function CurrentNets() More...
 
virtual int CurrentLayer () const =0
 Function CurrentLayer() More...
 
virtual NODECurrentNode (bool aLoopsRemoved=false) const =0
 Function CurrentNode() More...
 
virtual void FlipPosture ()
 Function FlipPosture() More...
 
virtual void UpdateSizes (const SIZES_SETTINGS &aSizes)
 Function UpdateSizes() More...
 
virtual void SetOrthoMode (bool aOrthoMode)
 Function SetOrthoMode() More...
 
virtual void GetModifiedNets (std::vector< int > &aNets) const
 Function GetModifiedNets. More...
 
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

DEBUG_DECORATORm_debugDecorator
 
ROUTERm_router
 
LOGGERm_logger
 

Detailed Description

PLACEMENT_ALGO.

Abstract class for a P&S placement/dragging algorithm. All subtools (drag, single/diff pair routing and meandering) are derived from it.

Definition at line 45 of file pns_placement_algo.h.

Constructor & Destructor Documentation

◆ PLACEMENT_ALGO()

PNS::PLACEMENT_ALGO::PLACEMENT_ALGO ( ROUTER aRouter)
inline

Definition at line 48 of file pns_placement_algo.h.

48  :
49  ALGO_BASE( aRouter ) {};
ALGO_BASE(ROUTER *aRouter)
Definition: pns_algo_base.h:42

◆ ~PLACEMENT_ALGO()

virtual PNS::PLACEMENT_ALGO::~PLACEMENT_ALGO ( )
inlinevirtual

Definition at line 51 of file pns_placement_algo.h.

51 {};

Member Function Documentation

◆ AbortPlacement()

virtual bool PNS::PLACEMENT_ALGO::AbortPlacement ( )
inlinevirtual

Reimplemented in PNS::LINE_PLACER, PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, and PNS::MEANDER_PLACER.

Definition at line 85 of file pns_placement_algo.h.

85 { return false; };

◆ CommitPlacement()

virtual bool PNS::PLACEMENT_ALGO::CommitPlacement ( )
inlinevirtual

Reimplemented in PNS::LINE_PLACER, PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, and PNS::MEANDER_PLACER.

Definition at line 83 of file pns_placement_algo.h.

83 { return false; };

◆ CurrentEnd()

virtual const VECTOR2I& PNS::PLACEMENT_ALGO::CurrentEnd ( ) const
pure virtual

Function CurrentEnd()

Returns the current end of the line(s) being placed/tuned. It may not be equal to the cursor position due to collisions.

Implemented in PNS::LINE_PLACER, PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, and PNS::MEANDER_PLACER.

◆ CurrentLayer()

virtual int PNS::PLACEMENT_ALGO::CurrentLayer ( ) const
pure virtual

Function CurrentLayer()

Returns the layer of currently routed track.

Implemented in PNS::LINE_PLACER, PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, and PNS::MEANDER_PLACER.

◆ CurrentNets()

virtual const std::vector<int> PNS::PLACEMENT_ALGO::CurrentNets ( ) const
pure virtual

Function CurrentNets()

Returns the net code(s) of currently routed track(s).

Implemented in PNS::LINE_PLACER, PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, and PNS::MEANDER_PLACER.

◆ CurrentNode()

virtual NODE* PNS::PLACEMENT_ALGO::CurrentNode ( bool  aLoopsRemoved = false) const
pure virtual

Function CurrentNode()

Returns the most recent board state.

Implemented in PNS::LINE_PLACER, PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, and PNS::MEANDER_PLACER.

◆ Dbg()

◆ FixRoute()

virtual bool PNS::PLACEMENT_ALGO::FixRoute ( const VECTOR2I aP,
ITEM aEndItem,
bool  aForceFinish = false 
)
pure virtual

Function FixRoute()

Commits the currently routed items to the parent node, taking aP as the final end point and aEndItem as the final anchor (if provided).

Returns
true, if route has been commited. May return false if the routing result is violating design rules - in such case, the track is only committed if Settings.CanViolateDRC() is on.

Implemented in PNS::LINE_PLACER, PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, and PNS::MEANDER_PLACER.

◆ FlipPosture()

virtual void PNS::PLACEMENT_ALGO::FlipPosture ( )
inlinevirtual

Function FlipPosture()

Toggles the current posture (straight/diagonal) of the trace head.

Reimplemented in PNS::LINE_PLACER, and PNS::DIFF_PAIR_PLACER.

Definition at line 160 of file pns_placement_algo.h.

161  {
162  }

◆ GetModifiedNets()

virtual void PNS::PLACEMENT_ALGO::GetModifiedNets ( std::vector< int > &  aNets) const
inlinevirtual

Function GetModifiedNets.

Returns the net codes of all currently routed trace(s)

Reimplemented in PNS::LINE_PLACER, and PNS::DIFF_PAIR_PLACER.

Definition at line 191 of file pns_placement_algo.h.

192  {
193  }

◆ HasPlacedAnything()

virtual bool PNS::PLACEMENT_ALGO::HasPlacedAnything ( ) const
inlinevirtual

Reimplemented in PNS::LINE_PLACER, PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, and PNS::MEANDER_PLACER.

Definition at line 87 of file pns_placement_algo.h.

87 { return false; }

◆ IsPlacingVia()

virtual bool PNS::PLACEMENT_ALGO::IsPlacingVia ( ) const
inlinevirtual

Function IsPlacingVia()

Returns true if the placer is placing a via (or more vias).

Reimplemented in PNS::LINE_PLACER, and PNS::DIFF_PAIR_PLACER.

Definition at line 104 of file pns_placement_algo.h.

105  {
106  return false;
107  }

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

◆ Move()

virtual bool PNS::PLACEMENT_ALGO::Move ( const VECTOR2I aP,
ITEM aEndItem 
)
pure virtual

Function Move()

Moves the end of the currently routed primtive(s) to the point aP, taking aEndItem as the anchor (if not NULL). (unless NULL).

Implemented in PNS::LINE_PLACER, PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, PNS::MEANDER_PLACER, and PNS::MEANDER_SKEW_PLACER.

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

◆ SetLayer()

virtual bool PNS::PLACEMENT_ALGO::SetLayer ( int  aLayer)
inlinevirtual

Function SetLayer()

Sets the current routing layer.

Reimplemented in PNS::LINE_PLACER, and PNS::DIFF_PAIR_PLACER.

Definition at line 114 of file pns_placement_algo.h.

115  {
116  return false;
117  }

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

◆ SetOrthoMode()

virtual void PNS::PLACEMENT_ALGO::SetOrthoMode ( bool  aOrthoMode)
inlinevirtual

Function SetOrthoMode()

Forces the router to place a straight 90/45 degree trace (with the end as near to the cursor as possible) instead of a standard 135 degree two-segment bend.

Reimplemented in PNS::LINE_PLACER, and PNS::DIFF_PAIR_PLACER.

Definition at line 182 of file pns_placement_algo.h.

183  {
184  }

◆ Settings()

◆ Start()

virtual bool PNS::PLACEMENT_ALGO::Start ( const VECTOR2I aP,
ITEM aStartItem 
)
pure virtual

Function Start()

Starts placement/drag operation at point aP, taking item aStartItem as anchor (unless NULL).

Implemented in PNS::LINE_PLACER, PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, PNS::MEANDER_PLACER, and PNS::MEANDER_SKEW_PLACER.

◆ ToggleVia()

virtual bool PNS::PLACEMENT_ALGO::ToggleVia ( bool  aEnabled)
inlinevirtual

Function ToggleVia()

Enables/disables a via at the end of currently routed trace.

Reimplemented in PNS::LINE_PLACER, and PNS::DIFF_PAIR_PLACER.

Definition at line 94 of file pns_placement_algo.h.

95  {
96  return false;
97  }

◆ Traces()

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

Function Traces()

Returns all routed/tuned traces.

Implemented in PNS::LINE_PLACER, PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, and PNS::MEANDER_PLACER.

◆ UnfixRoute()

virtual bool PNS::PLACEMENT_ALGO::UnfixRoute ( )
inlinevirtual

Reimplemented in PNS::LINE_PLACER.

Definition at line 81 of file pns_placement_algo.h.

81 { return false; };

◆ UpdateSizes()

virtual void PNS::PLACEMENT_ALGO::UpdateSizes ( const SIZES_SETTINGS aSizes)
inlinevirtual

Function UpdateSizes()

Performs on-the-fly update of the width, via diameter & drill size from a settings class. Used to dynamically change these parameters as the track is routed.

Reimplemented in PNS::LINE_PLACER, and PNS::DIFF_PAIR_PLACER.

Definition at line 171 of file pns_placement_algo.h.

172  {
173  }

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


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