KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PNS::ROUTER Class Reference

#include <pns_router.h>

Public Types

enum  RouterState { IDLE , DRAG_SEGMENT , DRAG_COMPONENT , ROUTE_TRACK }
 

Public Member Functions

 ROUTER ()
 
 ~ROUTER ()
 
void SetInterface (ROUTER_IFACE *aIface)
 
void SetMode (ROUTER_MODE aMode)
 
ROUTER_MODE Mode () const
 
RouterState GetState () const
 
DRAG_ALGO * GetDragger ()
 
void ClearWorld ()
 
void SyncWorld ()
 
bool RoutingInProgress () const
 
bool StartRouting (const VECTOR2I &aP, ITEM *aItem, int aLayer)
 
bool Move (const VECTOR2I &aP, ITEM *aItem)
 
bool Finish ()
 
bool ContinueFromEnd (ITEM **aNewStartItem)
 
bool FixRoute (const VECTOR2I &aP, ITEM *aItem, bool aForceFinish, bool aForceCommit)
 
void BreakSegmentOrArc (ITEM *aItem, const VECTOR2I &aP)
 
std::optional< VECTOR2I > UndoLastSegment ()
 
void CommitRouting ()
 
void GetUpdatedItems (std::vector< PNS::ITEM * > &aRemoved, std::vector< PNS::ITEM * > &aAdded, std::vector< PNS::ITEM * > &aHeads)
 
void AbortPlacement ()
 
void StopRouting ()
 
void ClearViewDecorations ()
 
NODE * GetWorld () const
 
void FlipPosture ()
 
bool SwitchLayer (int layer)
 
void ToggleViaPlacement ()
 
void SetOrthoMode (bool aEnable)
 
void ToggleCornerMode ()
 
int GetCurrentLayer () const
 
const std::vector< NET_HANDLE > GetCurrentNets () const
 
LOGGER * Logger ()
 
RULE_RESOLVER * GetRuleResolver () const
 
bool IsPlacingVia () const
 
const ITEM_SET QueryHoverItems (const VECTOR2I &aP, int aSlopRadius=0)
 
bool StartDragging (const VECTOR2I &aP, ITEM *aItem, int aDragMode=DM_ANY)
 
bool StartDragging (const VECTOR2I &aP, ITEM_SET aItems, int aDragMode=DM_COMPONENT)
 
void SetIterLimit (int aX)
 
int GetIterLimit () const
 
ROUTING_SETTINGS & Settings ()
 
void CommitRouting (NODE *aNode)
 
void UpdateSizes (const SIZES_SETTINGS &aSizes)
 Applies stored settings.
 
void LoadSettings (ROUTING_SETTINGS *aSettings)
 Changes routing settings to ones passed in the parameter.
 
SIZES_SETTINGS & Sizes ()
 
void SetFailureReason (const wxString &aReason)
 
const wxString & FailureReason () const
 
PLACEMENT_ALGO * Placer ()
 
ROUTER_IFACE * GetInterface () const
 
void SetVisibleViewArea (const BOX2I &aExtents)
 
const BOX2I & VisibleViewArea () const
 
std::vector< PNS::ITEM * > GetLastCommittedLeaderSegments ()
 
bool GetNearestRatnestAnchor (VECTOR2I &aOtherEnd, PNS_LAYER_RANGE &aOtherEndLayers, ITEM *&aOtherEndItem)
 

Static Public Member Functions

static ROUTER * GetInstance ()
 

Private Member Functions

DEBUG_DECORATOR * dbg () const
 
bool areWeLengthTuning () const
 
bool hasDiffPairMembers (const ITEM_SET &aItems) const
 
bool movePlacing (const VECTOR2I &aP, ITEM *aItem)
 
bool moveDragging (const VECTOR2I &aP, ITEM *aItem)
 
void updateView (NODE *aNode, ITEM_SET &aCurrent, bool aDragging=false)
 
void markViolations (NODE *aNode, ITEM_SET &aCurrent, NODE::ITEM_VECTOR &aRemoved)
 
bool isStartingPointRoutable (const VECTOR2I &aWhere, ITEM *aItem, int aLayer)
 

Private Attributes

BOX2I m_visibleViewArea
 
RouterState m_state
 
std::unique_ptr< NODE > m_world
 
NODE * m_lastNode
 
std::unique_ptr< PLACEMENT_ALGO > m_placer
 
std::unique_ptr< DRAG_ALGO > m_dragger
 
std::unique_ptr< SHOVE > m_shove
 
std::vector< PNS::ITEM * > m_leaderSegments
 
ROUTER_IFACE * m_iface
 
int m_iterLimit
 
ROUTING_SETTINGS * m_settings
 
SIZES_SETTINGS m_sizes
 
ROUTER_MODE m_mode
 
LOGGER * m_logger
 
wxString m_toolStatusbarName
 
wxString m_failureReason
 

Detailed Description

Definition at line 161 of file pns_router.h.

Member Enumeration Documentation

◆ RouterState

Enumerator
IDLE 
DRAG_SEGMENT 
DRAG_COMPONENT 
ROUTE_TRACK 

Definition at line 164 of file pns_router.h.

Constructor & Destructor Documentation

◆ ROUTER()

◆ ~ROUTER()

PNS::ROUTER::~ROUTER ( )

Definition at line 90 of file pns_router.cpp.

References ClearWorld(), m_logger, and PNS::theRouter.

Member Function Documentation

◆ AbortPlacement()

void PNS::ROUTER::AbortPlacement ( )

Definition at line 1174 of file pns_router.cpp.

References m_placer.

◆ areWeLengthTuning()

bool PNS::ROUTER::areWeLengthTuning ( ) const
private

◆ BreakSegmentOrArc()

void PNS::ROUTER::BreakSegmentOrArc ( ITEM * aItem,
const VECTOR2I & aP )

◆ ClearViewDecorations()

void PNS::ROUTER::ClearViewDecorations ( )

Definition at line 1041 of file pns_router.cpp.

References m_iface.

◆ ClearWorld()

◆ CommitRouting() [1/2]

◆ CommitRouting() [2/2]

void PNS::ROUTER::CommitRouting ( NODE * aNode)

Definition at line 908 of file pns_router.cpp.

References PNS::NODE::GetUpdatedItems(), m_iface, m_placer, m_state, m_world, and ROUTE_TRACK.

◆ ContinueFromEnd()

◆ dbg()

DEBUG_DECORATOR * PNS::ROUTER::dbg ( ) const
inlineprivate

Definition at line 274 of file pns_router.h.

References PNS::ROUTER_IFACE::GetDebugDecorator(), and GetInterface().

Referenced by hasDiffPairMembers(), and StartDragging().

◆ FailureReason()

const wxString & PNS::ROUTER::FailureReason ( ) const
inline

Definition at line 257 of file pns_router.h.

References m_failureReason.

Referenced by BOOST_FIXTURE_TEST_CASE().

◆ Finish()

◆ FixRoute()

bool PNS::ROUTER::FixRoute ( const VECTOR2I & aP,
ITEM * aItem,
bool aForceFinish,
bool aForceCommit )

◆ FlipPosture()

void PNS::ROUTER::FlipPosture ( )

Definition at line 1047 of file pns_router.cpp.

References m_placer, m_state, and ROUTE_TRACK.

◆ GetCurrentLayer()

int PNS::ROUTER::GetCurrentLayer ( ) const

Definition at line 1089 of file pns_router.cpp.

References m_dragger, and m_placer.

Referenced by ContinueFromEnd(), and Finish().

◆ GetCurrentNets()

const std::vector< NET_HANDLE > PNS::ROUTER::GetCurrentNets ( ) const

Definition at line 1078 of file pns_router.cpp.

References m_dragger, and m_placer.

Referenced by GetNearestRatnestAnchor().

◆ GetDragger()

DRAG_ALGO * PNS::ROUTER::GetDragger ( )
inline

Definition at line 182 of file pns_router.h.

References m_dragger.

Referenced by markViolations().

◆ GetInstance()

◆ GetInterface()

◆ GetIterLimit()

int PNS::ROUTER::GetIterLimit ( ) const
inline

Definition at line 233 of file pns_router.h.

References m_iterLimit.

◆ GetLastCommittedLeaderSegments()

std::vector< PNS::ITEM * > PNS::ROUTER::GetLastCommittedLeaderSegments ( )

Definition at line 986 of file pns_router.cpp.

References m_leaderSegments.

◆ GetNearestRatnestAnchor()

◆ GetRuleResolver()

◆ GetState()

RouterState PNS::ROUTER::GetState ( ) const
inline

Definition at line 180 of file pns_router.h.

References m_state.

Referenced by BOARD_EDITOR_CONTROL::TrackWidthDec(), and BOARD_EDITOR_CONTROL::TrackWidthInc().

◆ GetUpdatedItems()

void PNS::ROUTER::GetUpdatedItems ( std::vector< PNS::ITEM * > & aRemoved,
std::vector< PNS::ITEM * > & aAdded,
std::vector< PNS::ITEM * > & aHeads )

◆ GetWorld()

◆ hasDiffPairMembers()

bool PNS::ROUTER::hasDiffPairMembers ( const ITEM_SET & aItems) const
private

◆ IsPlacingVia()

bool PNS::ROUTER::IsPlacingVia ( ) const

Definition at line 1106 of file pns_router.cpp.

References m_placer.

Referenced by BOOST_FIXTURE_TEST_CASE(), and BOOST_FIXTURE_TEST_CASE().

◆ isStartingPointRoutable()

◆ LoadSettings()

void PNS::ROUTER::LoadSettings ( ROUTING_SETTINGS * aSettings)
inline

Changes routing settings to ones passed in the parameter.

Parameters
aSettingsare the new settings.

Definition at line 249 of file pns_router.h.

References m_settings.

Referenced by BOOST_FIXTURE_TEST_CASE(), and BOOST_FIXTURE_TEST_CASE().

◆ Logger()

LOGGER * PNS::ROUTER::Logger ( )

Definition at line 1100 of file pns_router.cpp.

References m_logger.

◆ markViolations()

◆ Mode()

ROUTER_MODE PNS::ROUTER::Mode ( ) const
inline

Definition at line 178 of file pns_router.h.

References m_mode.

Referenced by BOARD_EDITOR_CONTROL::TrackWidthDec(), and BOARD_EDITOR_CONTROL::TrackWidthInc().

◆ Move()

◆ moveDragging()

bool PNS::ROUTER::moveDragging ( const VECTOR2I & aP,
ITEM * aItem )
private

Definition at line 691 of file pns_router.cpp.

References m_dragger, m_iface, m_leaderSegments, and updateView().

Referenced by Move().

◆ movePlacing()

◆ Placer()

◆ QueryHoverItems()

◆ RoutingInProgress()

bool PNS::ROUTER::RoutingInProgress ( ) const

◆ SetFailureReason()

◆ SetInterface()

◆ SetIterLimit()

void PNS::ROUTER::SetIterLimit ( int aX)
inline

Definition at line 232 of file pns_router.h.

References m_iterLimit.

◆ SetMode()

void PNS::ROUTER::SetMode ( ROUTER_MODE aMode)

Definition at line 1140 of file pns_router.cpp.

References m_mode.

Referenced by BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and PCB_TUNING_PATTERN::Update().

◆ SetOrthoMode()

void PNS::ROUTER::SetOrthoMode ( bool aEnable)

Definition at line 1131 of file pns_router.cpp.

References m_placer.

◆ Settings()

◆ SetVisibleViewArea()

void PNS::ROUTER::SetVisibleViewArea ( const BOX2I & aExtents)
inline

Definition at line 263 of file pns_router.h.

References m_visibleViewArea.

◆ Sizes()

◆ StartDragging() [1/2]

bool PNS::ROUTER::StartDragging ( const VECTOR2I & aP,
ITEM * aItem,
int aDragMode = DM_ANY )

Definition at line 226 of file pns_router.cpp.

References m_leaderSegments, and StartDragging().

Referenced by StartDragging().

◆ StartDragging() [2/2]

◆ StartRouting()

◆ StopRouting()

◆ SwitchLayer()

bool PNS::ROUTER::SwitchLayer ( int layer)

Definition at line 1056 of file pns_router.cpp.

References m_placer, m_state, and ROUTE_TRACK.

◆ SyncWorld()

◆ ToggleCornerMode()

void PNS::ROUTER::ToggleCornerMode ( )

◆ ToggleViaPlacement()

void PNS::ROUTER::ToggleViaPlacement ( )

◆ UndoLastSegment()

std::optional< VECTOR2I > PNS::ROUTER::UndoLastSegment ( )

Definition at line 992 of file pns_router.cpp.

References PNS::LOGGER::EVT_UNFIX, m_logger, m_placer, and RoutingInProgress().

◆ UpdateSizes()

void PNS::ROUTER::UpdateSizes ( const SIZES_SETTINGS & aSizes)

Applies stored settings.

See also
Settings()

Definition at line 825 of file pns_router.cpp.

References m_placer, m_sizes, m_state, and ROUTE_TRACK.

Referenced by BOOST_FIXTURE_TEST_CASE(), and BOOST_FIXTURE_TEST_CASE().

◆ updateView()

void PNS::ROUTER::updateView ( NODE * aNode,
ITEM_SET & aCurrent,
bool aDragging = false )
private

◆ VisibleViewArea()

const BOX2I & PNS::ROUTER::VisibleViewArea ( ) const
inline

Definition at line 264 of file pns_router.h.

References m_visibleViewArea.

Member Data Documentation

◆ m_dragger

std::unique_ptr<DRAG_ALGO> PNS::ROUTER::m_dragger
private

◆ m_failureReason

wxString PNS::ROUTER::m_failureReason
private

Definition at line 315 of file pns_router.h.

Referenced by FailureReason(), and SetFailureReason().

◆ m_iface

◆ m_iterLimit

int PNS::ROUTER::m_iterLimit
private

Definition at line 307 of file pns_router.h.

Referenced by GetIterLimit(), ROUTER(), and SetIterLimit().

◆ m_lastNode

NODE* PNS::ROUTER::m_lastNode
private

Definition at line 298 of file pns_router.h.

Referenced by ROUTER().

◆ m_leaderSegments

std::vector<PNS::ITEM*> PNS::ROUTER::m_leaderSegments
private

◆ m_logger

LOGGER* PNS::ROUTER::m_logger
private

◆ m_mode

ROUTER_MODE PNS::ROUTER::m_mode
private

◆ m_placer

◆ m_settings

ROUTING_SETTINGS* PNS::ROUTER::m_settings
private

Definition at line 309 of file pns_router.h.

Referenced by LoadSettings(), ROUTER(), Settings(), and ToggleCornerMode().

◆ m_shove

std::unique_ptr<SHOVE> PNS::ROUTER::m_shove
private

Definition at line 302 of file pns_router.h.

◆ m_sizes

SIZES_SETTINGS PNS::ROUTER::m_sizes
private

◆ m_state

◆ m_toolStatusbarName

wxString PNS::ROUTER::m_toolStatusbarName
private

Definition at line 314 of file pns_router.h.

◆ m_visibleViewArea

BOX2I PNS::ROUTER::m_visibleViewArea
private

Definition at line 294 of file pns_router.h.

Referenced by ROUTER(), SetVisibleViewArea(), and VisibleViewArea().

◆ m_world

std::unique_ptr<NODE> PNS::ROUTER::m_world
private

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