Deboostified ratsnest model in GAL

This commit is contained in:
Maciej Suminski 2016-09-19 17:25:31 +02:00
parent a2116ae070
commit 61e415bdb9
2 changed files with 15 additions and 16 deletions

View File

@ -125,7 +125,7 @@ static std::vector<RN_EDGE_MST_PTR>* kruskalMST( RN_LINKS::RN_EDGE_LIST& aEdges,
mst->reserve( mstExpectedSize );
// 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;
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;
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;
}
@ -355,7 +355,7 @@ void RN_NET::compute()
// Check if the only possible connection exists
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
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
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
// faster and may reduce the number of points for further checks
@ -1045,7 +1045,7 @@ void RN_NET::processPads()
LSET layers = pad->GetLayerSet();
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();
pointEnd = candidates.end();

View File

@ -35,10 +35,9 @@
#include <math/box2.h>
#include <boost/unordered_set.hpp>
#include <boost/unordered_map.hpp>
#include <deque>
#include <unordered_set>
#include <unordered_map>
class BOARD;
class BOARD_ITEM;
@ -200,7 +199,7 @@ class RN_LINKS
{
public:
// 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;
/**
@ -539,7 +538,7 @@ public:
* ratsnest line per node).
* @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;
}
@ -593,10 +592,10 @@ protected:
std::shared_ptr< std::vector<RN_EDGE_MST_PTR> > m_rnEdges;
///> 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.
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.
bool m_dirty;
@ -622,10 +621,10 @@ protected:
} RN_PAD_DATA;
///> Helper typedefs
typedef boost::unordered_map<const D_PAD*, RN_PAD_DATA> PAD_NODE_MAP;
typedef boost::unordered_map<const VIA*, RN_NODE_PTR> VIA_NODE_MAP;
typedef boost::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 D_PAD*, RN_PAD_DATA> PAD_NODE_MAP;
typedef std::unordered_map<const VIA*, RN_NODE_PTR> VIA_NODE_MAP;
typedef std::unordered_map<const TRACK*, RN_EDGE_MST_PTR> TRACK_EDGE_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.
PAD_NODE_MAP m_pads;