![]() |
KiCad PCB EDA Suite
|
Describe ratsnest for a single net. More...
#include <ratsnest_data.h>
Classes | |
class | TRIANGULATOR_STATE |
Public Member Functions | |
RN_NET () | |
void | SetVisible (bool aEnabled) |
Set state of the visibility flag. More... | |
void | MarkDirty () |
Mark ratsnest for given net as 'dirty', i.e. More... | |
bool | IsDirty () const |
Return state of the 'dirty' flag, indicating that ratsnest for a given net is invalid and requires an update. More... | |
const std::vector< CN_EDGE > | GetUnconnected () const |
Return pointer to a vector of edges that makes ratsnest for a given net. More... | |
void | Update () |
Recompute ratsnest for a net. More... | |
void | Clear () |
void | AddCluster (std::shared_ptr< CN_CLUSTER > aCluster) |
unsigned int | GetNodeCount () const |
const std::vector< CN_EDGE > & | GetEdges () const |
bool | NearestBicoloredPair (const RN_NET &aOtherNet, CN_ANCHOR_PTR &aNode1, CN_ANCHOR_PTR &aNode2) const |
Protected Member Functions | |
void | compute () |
< Recompute ratsnest from scratch. More... | |
void | kruskalMST (const std::vector< CN_EDGE > &aEdges) |
Vector of nodes. More... | |
Protected Attributes | |
std::multiset< CN_ANCHOR_PTR, CN_PTR_CMP > | m_nodes |
Vector of edges that make pre-defined connections. More... | |
std::vector< CN_EDGE > | m_boardEdges |
Vector of edges that makes ratsnest for a given net. More... | |
std::vector< CN_EDGE > | m_rnEdges |
Flag indicating necessity of recalculation of ratsnest for a net. More... | |
bool | m_dirty |
std::shared_ptr< TRIANGULATOR_STATE > | m_triangulator |
Describe ratsnest for a single net.
Definition at line 61 of file ratsnest_data.h.
RN_NET::RN_NET | ( | ) |
Definition at line 270 of file ratsnest_data.cpp.
References m_triangulator.
void RN_NET::AddCluster | ( | std::shared_ptr< CN_CLUSTER > | aCluster | ) |
Definition at line 358 of file ratsnest_data.cpp.
References m_boardEdges, and m_nodes.
Referenced by CONNECTIVITY_DATA::addRatsnestCluster().
void RN_NET::Clear | ( | ) |
Definition at line 348 of file ratsnest_data.cpp.
References m_boardEdges, m_dirty, m_nodes, and m_rnEdges.
|
protected |
< Recompute ratsnest from scratch.
Compute the minimum spanning tree using Kruskal's algorithm
Definition at line 276 of file ratsnest_data.cpp.
References CN_EDGE::GetSourceNode(), kruskalMST(), m_boardEdges, m_nodes, m_rnEdges, m_triangulator, and PROF_COUNTER::Show().
Referenced by Update().
|
inline |
Definition at line 102 of file ratsnest_data.h.
References m_rnEdges.
Referenced by CONNECTIVITY_DATA::GetRatsnestForItems(), and CONNECTIVITY_DATA::GetRatsnestForPad().
|
inline |
Definition at line 100 of file ratsnest_data.h.
References m_nodes.
|
inline |
Return pointer to a vector of edges that makes ratsnest for a given net.
Definition at line 90 of file ratsnest_data.h.
References m_rnEdges.
Referenced by RATSNEST_VIEW_ITEM::ViewDraw().
|
inline |
Return state of the 'dirty' flag, indicating that ratsnest for a given net is invalid and requires an update.
Definition at line 85 of file ratsnest_data.h.
References m_dirty.
|
protected |
Vector of nodes.
Definition at line 110 of file ratsnest_data.cpp.
Referenced by compute().
|
inline |
Mark ratsnest for given net as 'dirty', i.e.
requiring recomputation.
Definition at line 77 of file ratsnest_data.h.
References m_dirty.
bool RN_NET::NearestBicoloredPair | ( | const RN_NET & | aOtherNet, |
CN_ANCHOR_PTR & | aNode1, | ||
CN_ANCHOR_PTR & | aNode2 | ||
) | const |
Sweep-line algorithm to cut the number of comparisons to find the closest point
Step 1: The outer loop needs to be the subset (selected nodes) as it is a linear search
Step 2: O( log n ) search to identify a close element ordered by x The fwd_it iterator will move forward through the elements while the rev_it iterator will move backward through the same set
As soon as the x distance (primary sort) is larger than the smallest distance, stop checking further elements
Step 3: using the same starting point, check points backwards for closer points
Definition at line 390 of file ratsnest_data.cpp.
References VECTOR2< T >::ECOORD_MAX, m_nodes, SEG::Square(), and VECTOR2< T >::SquaredEuclideanNorm().
Referenced by CONNECTIVITY_DATA::ComputeDynamicRatsnest().
void RN_NET::SetVisible | ( | bool | aEnabled | ) |
Set state of the visibility flag.
aEnabled | is new state. True if ratsnest for a given net is meant to be displayed, false otherwise. |
Definition at line 465 of file ratsnest_data.cpp.
References m_rnEdges.
void RN_NET::Update | ( | ) |
|
protected |
Vector of edges that makes ratsnest for a given net.
Definition at line 118 of file ratsnest_data.h.
Referenced by AddCluster(), Clear(), and compute().
|
protected |
Definition at line 124 of file ratsnest_data.h.
Referenced by Clear(), IsDirty(), MarkDirty(), and Update().
|
protected |
Vector of edges that make pre-defined connections.
Definition at line 115 of file ratsnest_data.h.
Referenced by AddCluster(), Clear(), compute(), GetNodeCount(), and NearestBicoloredPair().
|
protected |
Flag indicating necessity of recalculation of ratsnest for a net.
Definition at line 121 of file ratsnest_data.h.
Referenced by Clear(), compute(), GetEdges(), GetUnconnected(), and SetVisible().
|
protected |
Definition at line 126 of file ratsnest_data.h.