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_ALGOGetDragger ()
 
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< VECTOR2IUndoLastSegment ()
 
void CommitRouting ()
 
void GetUpdatedItems (std::vector< PNS::ITEM * > &aRemoved, std::vector< PNS::ITEM * > &aAdded, std::vector< PNS::ITEM * > &aHeads)
 
void StopRouting ()
 
void ClearViewDecorations ()
 
NODEGetWorld () const
 
void FlipPosture ()
 
bool SwitchLayer (int layer)
 
void ToggleViaPlacement ()
 
void SetOrthoMode (bool aEnable)
 
void ToggleCornerMode ()
 
int GetCurrentLayer () const
 
const std::vector< NET_HANDLEGetCurrentNets () const
 
LOGGERLogger ()
 
RULE_RESOLVERGetRuleResolver () 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_SETTINGSSettings ()
 
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_SETTINGSSizes ()
 
void SetFailureReason (const wxString &aReason)
 
const wxString & FailureReason () const
 
PLACEMENT_ALGOPlacer ()
 
ROUTER_IFACEGetInterface () const
 
void SetVisibleViewArea (const BOX2I &aExtents)
 
const BOX2IVisibleViewArea () const
 
std::vector< PNS::ITEM * > GetLastCommittedLeaderSegments ()
 

Static Public Member Functions

static ROUTERGetInstance ()
 

Private Member Functions

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)
 
bool getNearestRatnestAnchor (VECTOR2I &aOtherEnd, PNS_LAYER_RANGE &aOtherEndLayers, ITEM *&aOtherEndItem)
 

Private Attributes

BOX2I m_visibleViewArea
 
RouterState m_state
 
std::unique_ptr< NODEm_world
 
NODEm_lastNode
 
std::unique_ptr< PLACEMENT_ALGOm_placer
 
std::unique_ptr< DRAG_ALGOm_dragger
 
std::unique_ptr< SHOVEm_shove
 
std::vector< PNS::ITEM * > m_leaderSegments
 
ROUTER_IFACEm_iface
 
int m_iterLimit
 
ROUTING_SETTINGSm_settings
 
SIZES_SETTINGS m_sizes
 
ROUTER_MODE m_mode
 
LOGGERm_logger
 
wxString m_toolStatusbarName
 
wxString m_failureReason
 

Detailed Description

Definition at line 124 of file pns_router.h.

Member Enumeration Documentation

◆ RouterState

Enumerator
IDLE 
DRAG_SEGMENT 
DRAG_COMPONENT 
ROUTE_TRACK 

Definition at line 127 of file pns_router.h.

Constructor & Destructor Documentation

◆ ROUTER()

◆ ~ROUTER()

PNS::ROUTER::~ROUTER ( )

Definition at line 87 of file pns_router.cpp.

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

Member Function Documentation

◆ BreakSegmentOrArc()

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

◆ ClearViewDecorations()

void PNS::ROUTER::ClearViewDecorations ( )

◆ ClearWorld()

void PNS::ROUTER::ClearWorld ( )

◆ CommitRouting() [1/2]

◆ CommitRouting() [2/2]

◆ ContinueFromEnd()

◆ FailureReason()

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

Definition at line 219 of file pns_router.h.

References m_failureReason.

Referenced by ROUTER_TOOL::performRouting(), and ROUTER_TOOL::prepareInteractive().

◆ Finish()

◆ FixRoute()

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

◆ FlipPosture()

void PNS::ROUTER::FlipPosture ( )

Definition at line 964 of file pns_router.cpp.

References m_placer, m_state, and ROUTE_TRACK.

Referenced by ROUTER_TOOL::performRouting().

◆ GetCurrentLayer()

◆ GetCurrentNets()

◆ GetDragger()

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

◆ GetInstance()

◆ GetInterface()

◆ GetIterLimit()

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

Definition at line 195 of file pns_router.h.

References m_iterLimit.

◆ GetLastCommittedLeaderSegments()

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

Definition at line 903 of file pns_router.cpp.

References m_leaderSegments.

Referenced by ROUTER_TOOL::InlineDrag().

◆ getNearestRatnestAnchor()

◆ GetRuleResolver()

◆ GetState()

◆ GetUpdatedItems()

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

◆ GetWorld()

◆ IsPlacingVia()

◆ 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 211 of file pns_router.h.

References m_settings.

Referenced by PNS::TOOL_BASE::Reset(), and GENERATOR_TOOL_PNS_PROXY::Reset().

◆ Logger()

LOGGER * PNS::ROUTER::Logger ( )

Definition at line 1017 of file pns_router.cpp.

References m_logger.

Referenced by ROUTER_TOOL::saveRouterDebugLog().

◆ markViolations()

◆ Mode()

◆ Move()

◆ moveDragging()

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

Definition at line 630 of file pns_router.cpp.

References PNS::ROUTER_IFACE::EraseView(), m_dragger, m_iface, m_leaderSegments, and updateView().

Referenced by Move().

◆ movePlacing()

◆ Placer()

◆ QueryHoverItems()

◆ RoutingInProgress()

◆ SetFailureReason()

void PNS::ROUTER::SetFailureReason ( const wxString &  aReason)
inline

◆ SetInterface()

void PNS::ROUTER::SetInterface ( ROUTER_IFACE aIface)

◆ SetIterLimit()

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

Definition at line 194 of file pns_router.h.

References m_iterLimit.

◆ SetMode()

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

◆ SetOrthoMode()

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

Definition at line 1048 of file pns_router.cpp.

References m_placer.

◆ Settings()

◆ SetVisibleViewArea()

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

Definition at line 225 of file pns_router.h.

References m_visibleViewArea.

Referenced by ROUTER_TOOL::handleCommonEvents(), and ROUTER_TOOL::InlineDrag().

◆ Sizes()

◆ StartDragging() [1/2]

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

◆ StartDragging() [2/2]

◆ StartRouting()

◆ StopRouting()

◆ SwitchLayer()

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

◆ SyncWorld()

◆ ToggleCornerMode()

◆ ToggleViaPlacement()

void PNS::ROUTER::ToggleViaPlacement ( )

◆ UndoLastSegment()

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

◆ UpdateSizes()

◆ 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 226 of file pns_router.h.

References m_visibleViewArea.

Referenced by PNS::ALGO_BASE::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 267 of file pns_router.h.

Referenced by FailureReason(), and SetFailureReason().

◆ m_iface

◆ m_iterLimit

int PNS::ROUTER::m_iterLimit
private

Definition at line 259 of file pns_router.h.

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

◆ m_lastNode

NODE* PNS::ROUTER::m_lastNode
private

Definition at line 250 of file pns_router.h.

Referenced by ROUTER().

◆ m_leaderSegments

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

Definition at line 255 of file pns_router.h.

Referenced by GetLastCommittedLeaderSegments(), moveDragging(), and StartDragging().

◆ m_logger

LOGGER* PNS::ROUTER::m_logger
private

◆ m_mode

ROUTER_MODE PNS::ROUTER::m_mode
private

Definition at line 263 of file pns_router.h.

Referenced by isStartingPointRoutable(), Mode(), ROUTER(), SetMode(), and StartRouting().

◆ m_placer

◆ m_settings

ROUTING_SETTINGS* PNS::ROUTER::m_settings
private

Definition at line 261 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 254 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 266 of file pns_router.h.

◆ m_visibleViewArea

BOX2I PNS::ROUTER::m_visibleViewArea
private

Definition at line 246 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: