Deboostified ratsnest model in GAL
This commit is contained in:
parent
a2116ae070
commit
61e415bdb9
|
@ -125,7 +125,7 @@ static std::vector<RN_EDGE_MST_PTR>* kruskalMST( RN_LINKS::RN_EDGE_LIST& aEdges,
|
||||||
mst->reserve( mstExpectedSize );
|
mst->reserve( mstExpectedSize );
|
||||||
|
|
||||||
// Set tags for marking cycles
|
// Set tags for marking cycles
|
||||||
boost::unordered_map<RN_NODE_PTR, int> tags;
|
std::unordered_map<RN_NODE_PTR, int> tags;
|
||||||
unsigned int tag = 0;
|
unsigned int tag = 0;
|
||||||
|
|
||||||
for( RN_NODE_PTR& node : aNodes )
|
for( RN_NODE_PTR& node : aNodes )
|
||||||
|
@ -311,7 +311,7 @@ const RN_NODE_PTR& RN_LINKS::AddNode( int aX, int aY )
|
||||||
RN_NODE_SET::iterator node;
|
RN_NODE_SET::iterator node;
|
||||||
bool wasNewElement;
|
bool wasNewElement;
|
||||||
|
|
||||||
boost::tie( node, wasNewElement ) = m_nodes.emplace( std::make_shared<RN_NODE>( aX, aY ) );
|
std::tie( node, wasNewElement ) = m_nodes.emplace( std::make_shared<RN_NODE>( aX, aY ) );
|
||||||
|
|
||||||
return *node;
|
return *node;
|
||||||
}
|
}
|
||||||
|
@ -355,7 +355,7 @@ void RN_NET::compute()
|
||||||
// Check if the only possible connection exists
|
// Check if the only possible connection exists
|
||||||
if( boardEdges.size() == 0 && boardNodes.size() == 2 )
|
if( boardEdges.size() == 0 && boardNodes.size() == 2 )
|
||||||
{
|
{
|
||||||
RN_LINKS::RN_NODE_SET::iterator last = ++boardNodes.begin();
|
RN_LINKS::RN_NODE_SET::const_iterator last = ++boardNodes.begin();
|
||||||
|
|
||||||
// There can be only one possible connection, but it is missing
|
// There can be only one possible connection, but it is missing
|
||||||
RN_EDGE_MST_PTR edge = std::make_shared<RN_EDGE_MST>( *boardNodes.begin(), *last );
|
RN_EDGE_MST_PTR edge = std::make_shared<RN_EDGE_MST>( *boardNodes.begin(), *last );
|
||||||
|
@ -993,7 +993,7 @@ void RN_NET::processZones()
|
||||||
|
|
||||||
// Compute new connections
|
// Compute new connections
|
||||||
RN_LINKS::RN_NODE_SET candidates = m_links.GetNodes();
|
RN_LINKS::RN_NODE_SET candidates = m_links.GetNodes();
|
||||||
RN_LINKS::RN_NODE_SET::iterator point, pointEnd;
|
RN_LINKS::RN_NODE_SET::const_iterator point, pointEnd;
|
||||||
|
|
||||||
// Sorting by area should speed up the processing, as smaller polygons are computed
|
// Sorting by area should speed up the processing, as smaller polygons are computed
|
||||||
// faster and may reduce the number of points for further checks
|
// faster and may reduce the number of points for further checks
|
||||||
|
@ -1045,7 +1045,7 @@ void RN_NET::processPads()
|
||||||
|
|
||||||
LSET layers = pad->GetLayerSet();
|
LSET layers = pad->GetLayerSet();
|
||||||
const RN_LINKS::RN_NODE_SET& candidates = m_links.GetNodes();
|
const RN_LINKS::RN_NODE_SET& candidates = m_links.GetNodes();
|
||||||
RN_LINKS::RN_NODE_SET::iterator point, pointEnd;
|
RN_LINKS::RN_NODE_SET::const_iterator point, pointEnd;
|
||||||
|
|
||||||
point = candidates.begin();
|
point = candidates.begin();
|
||||||
pointEnd = candidates.end();
|
pointEnd = candidates.end();
|
||||||
|
|
|
@ -35,10 +35,9 @@
|
||||||
|
|
||||||
#include <math/box2.h>
|
#include <math/box2.h>
|
||||||
|
|
||||||
#include <boost/unordered_set.hpp>
|
|
||||||
#include <boost/unordered_map.hpp>
|
|
||||||
|
|
||||||
#include <deque>
|
#include <deque>
|
||||||
|
#include <unordered_set>
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
class BOARD;
|
class BOARD;
|
||||||
class BOARD_ITEM;
|
class BOARD_ITEM;
|
||||||
|
@ -200,7 +199,7 @@ class RN_LINKS
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Helper typedefs
|
// Helper typedefs
|
||||||
typedef boost::unordered_set<RN_NODE_PTR, RN_NODE_HASH, RN_NODE_COMPARE> RN_NODE_SET;
|
typedef std::unordered_set<RN_NODE_PTR, RN_NODE_HASH, RN_NODE_COMPARE> RN_NODE_SET;
|
||||||
typedef std::list<RN_EDGE_PTR> RN_EDGE_LIST;
|
typedef std::list<RN_EDGE_PTR> RN_EDGE_LIST;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -539,7 +538,7 @@ public:
|
||||||
* ratsnest line per node).
|
* ratsnest line per node).
|
||||||
* @return list of nodes for which ratsnest is drawn in simple mode.
|
* @return list of nodes for which ratsnest is drawn in simple mode.
|
||||||
*/
|
*/
|
||||||
inline const boost::unordered_set<RN_NODE_PTR>& GetSimpleNodes() const
|
inline const std::unordered_set<RN_NODE_PTR>& GetSimpleNodes() const
|
||||||
{
|
{
|
||||||
return m_simpleNodes;
|
return m_simpleNodes;
|
||||||
}
|
}
|
||||||
|
@ -593,10 +592,10 @@ protected:
|
||||||
std::shared_ptr< std::vector<RN_EDGE_MST_PTR> > m_rnEdges;
|
std::shared_ptr< std::vector<RN_EDGE_MST_PTR> > m_rnEdges;
|
||||||
|
|
||||||
///> List of nodes which will not be used as ratsnest target nodes.
|
///> List of nodes which will not be used as ratsnest target nodes.
|
||||||
boost::unordered_set<RN_NODE_PTR> m_blockedNodes;
|
std::unordered_set<RN_NODE_PTR> m_blockedNodes;
|
||||||
|
|
||||||
///> Nodes to be displayed using the simplified ratsnest algorithm.
|
///> Nodes to be displayed using the simplified ratsnest algorithm.
|
||||||
boost::unordered_set<RN_NODE_PTR> m_simpleNodes;
|
std::unordered_set<RN_NODE_PTR> m_simpleNodes;
|
||||||
|
|
||||||
///> Flag indicating necessity of recalculation of ratsnest for a net.
|
///> Flag indicating necessity of recalculation of ratsnest for a net.
|
||||||
bool m_dirty;
|
bool m_dirty;
|
||||||
|
@ -622,10 +621,10 @@ protected:
|
||||||
} RN_PAD_DATA;
|
} RN_PAD_DATA;
|
||||||
|
|
||||||
///> Helper typedefs
|
///> Helper typedefs
|
||||||
typedef boost::unordered_map<const D_PAD*, RN_PAD_DATA> PAD_NODE_MAP;
|
typedef std::unordered_map<const D_PAD*, RN_PAD_DATA> PAD_NODE_MAP;
|
||||||
typedef boost::unordered_map<const VIA*, RN_NODE_PTR> VIA_NODE_MAP;
|
typedef std::unordered_map<const VIA*, RN_NODE_PTR> VIA_NODE_MAP;
|
||||||
typedef boost::unordered_map<const TRACK*, RN_EDGE_MST_PTR> TRACK_EDGE_MAP;
|
typedef std::unordered_map<const TRACK*, RN_EDGE_MST_PTR> TRACK_EDGE_MAP;
|
||||||
typedef boost::unordered_map<const ZONE_CONTAINER*, RN_ZONE_DATA> ZONE_DATA_MAP;
|
typedef std::unordered_map<const ZONE_CONTAINER*, RN_ZONE_DATA> ZONE_DATA_MAP;
|
||||||
|
|
||||||
///> Map that associates nodes in the ratsnest model to respective nodes.
|
///> Map that associates nodes in the ratsnest model to respective nodes.
|
||||||
PAD_NODE_MAP m_pads;
|
PAD_NODE_MAP m_pads;
|
||||||
|
|
Loading…
Reference in New Issue