Ratsnest: Keep connectivity data local
The dynamic ratsnest did not need to have a smart pointer to the temporary connectivity data.
This commit is contained in:
parent
b9a9fe6c9e
commit
a0e4e23c14
|
@ -40,6 +40,13 @@ CONNECTIVITY_DATA::CONNECTIVITY_DATA()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CONNECTIVITY_DATA::CONNECTIVITY_DATA( const std::vector<BOARD_ITEM*>& aItems )
|
||||||
|
{
|
||||||
|
Build( aItems );
|
||||||
|
m_progressReporter = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
CONNECTIVITY_DATA::~CONNECTIVITY_DATA()
|
CONNECTIVITY_DATA::~CONNECTIVITY_DATA()
|
||||||
{
|
{
|
||||||
Clear();
|
Clear();
|
||||||
|
@ -241,25 +248,22 @@ void CONNECTIVITY_DATA::FindIsolatedCopperIslands( std::vector<CN_ZONE_ISOLATED_
|
||||||
|
|
||||||
void CONNECTIVITY_DATA::ComputeDynamicRatsnest( const std::vector<BOARD_ITEM*>& aItems )
|
void CONNECTIVITY_DATA::ComputeDynamicRatsnest( const std::vector<BOARD_ITEM*>& aItems )
|
||||||
{
|
{
|
||||||
|
m_dynamicRatsnest.clear();
|
||||||
|
|
||||||
if( std::none_of( aItems.begin(), aItems.end(), []( const BOARD_ITEM* aItem )
|
if( std::none_of( aItems.begin(), aItems.end(), []( const BOARD_ITEM* aItem )
|
||||||
{ return( aItem->Type() == PCB_TRACE_T || aItem->Type() == PCB_PAD_T ||
|
{ return( aItem->Type() == PCB_TRACE_T || aItem->Type() == PCB_PAD_T ||
|
||||||
aItem->Type() == PCB_ZONE_AREA_T || aItem->Type() == PCB_MODULE_T ||
|
aItem->Type() == PCB_ZONE_AREA_T || aItem->Type() == PCB_MODULE_T ||
|
||||||
aItem->Type() == PCB_VIA_T ); } ) )
|
aItem->Type() == PCB_VIA_T ); } ) )
|
||||||
{
|
{
|
||||||
m_dynamicRatsnest.clear();
|
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_dynamicConnectivity.reset( new CONNECTIVITY_DATA );
|
CONNECTIVITY_DATA connData( aItems );
|
||||||
m_dynamicConnectivity->Build( aItems );
|
|
||||||
|
|
||||||
m_dynamicRatsnest.clear();
|
|
||||||
|
|
||||||
BlockRatsnestItems( aItems );
|
BlockRatsnestItems( aItems );
|
||||||
|
|
||||||
for( unsigned int nc = 1; nc < m_dynamicConnectivity->m_nets.size(); nc++ )
|
for( unsigned int nc = 1; nc < connData.m_nets.size(); nc++ )
|
||||||
{
|
{
|
||||||
auto dynNet = m_dynamicConnectivity->m_nets[nc];
|
auto dynNet = connData.m_nets[nc];
|
||||||
|
|
||||||
if( dynNet->GetNodeCount() != 0 )
|
if( dynNet->GetNodeCount() != 0 )
|
||||||
{
|
{
|
||||||
|
@ -278,7 +282,7 @@ void CONNECTIVITY_DATA::ComputeDynamicRatsnest( const std::vector<BOARD_ITEM*>&
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for( auto net : m_dynamicConnectivity->m_nets )
|
for( auto net : connData.m_nets )
|
||||||
{
|
{
|
||||||
if( !net )
|
if( !net )
|
||||||
continue;
|
continue;
|
||||||
|
@ -312,7 +316,6 @@ void CONNECTIVITY_DATA::ClearDynamicRatsnest()
|
||||||
|
|
||||||
void CONNECTIVITY_DATA::HideDynamicRatsnest()
|
void CONNECTIVITY_DATA::HideDynamicRatsnest()
|
||||||
{
|
{
|
||||||
m_dynamicConnectivity.reset();
|
|
||||||
m_dynamicRatsnest.clear();
|
m_dynamicRatsnest.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,7 @@ public:
|
||||||
CONNECTIVITY_DATA();
|
CONNECTIVITY_DATA();
|
||||||
~CONNECTIVITY_DATA();
|
~CONNECTIVITY_DATA();
|
||||||
|
|
||||||
|
CONNECTIVITY_DATA( const std::vector<BOARD_ITEM*>& aItems );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Build()
|
* Function Build()
|
||||||
|
@ -246,7 +247,6 @@ private:
|
||||||
void updateRatsnest();
|
void updateRatsnest();
|
||||||
void addRatsnestCluster( const std::shared_ptr<CN_CLUSTER>& aCluster );
|
void addRatsnestCluster( const std::shared_ptr<CN_CLUSTER>& aCluster );
|
||||||
|
|
||||||
std::unique_ptr<CONNECTIVITY_DATA> m_dynamicConnectivity;
|
|
||||||
std::shared_ptr<CN_CONNECTIVITY_ALGO> m_connAlgo;
|
std::shared_ptr<CN_CONNECTIVITY_ALGO> m_connAlgo;
|
||||||
|
|
||||||
std::vector<RN_DYNAMIC_LINE> m_dynamicRatsnest;
|
std::vector<RN_DYNAMIC_LINE> m_dynamicRatsnest;
|
||||||
|
|
Loading…
Reference in New Issue