pcbnew: Optimized zone filling algorithm: code cleanup
This commit is contained in:
parent
d1d9e57b86
commit
8df299a6bc
|
@ -478,7 +478,6 @@ include( CheckFindPackageResult )
|
||||||
find_package( OpenMP )
|
find_package( OpenMP )
|
||||||
|
|
||||||
if( OPENMP_FOUND )
|
if( OPENMP_FOUND )
|
||||||
message( "FOUND OPENMP" )
|
|
||||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" )
|
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" )
|
||||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" )
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" )
|
||||||
add_definitions( -DUSE_OPENMP )
|
add_definitions( -DUSE_OPENMP )
|
||||||
|
|
|
@ -1513,6 +1513,7 @@ void OPENGL_GAL::drawStrokedSemiCircle( const VECTOR2D& aCenterPoint, double aRa
|
||||||
Restore();
|
Restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void OPENGL_GAL::drawPolygon( GLdouble* aPoints, int aPointCount )
|
void OPENGL_GAL::drawPolygon( GLdouble* aPoints, int aPointCount )
|
||||||
{
|
{
|
||||||
currentManager->Shader( SHADER_NONE );
|
currentManager->Shader( SHADER_NONE );
|
||||||
|
|
|
@ -659,8 +659,6 @@ void SHAPE_POLY_SET::importTree( PolyTree* tree )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Polygon fracturing code. Work in progress.
|
|
||||||
|
|
||||||
struct FractureEdge
|
struct FractureEdge
|
||||||
{
|
{
|
||||||
FractureEdge( bool connected, SHAPE_LINE_CHAIN* owner, int index ) :
|
FractureEdge( bool connected, SHAPE_LINE_CHAIN* owner, int index ) :
|
||||||
|
|
|
@ -65,7 +65,9 @@ class SHAPE_POLY_SET : public SHAPE
|
||||||
|
|
||||||
struct TRI
|
struct TRI
|
||||||
{
|
{
|
||||||
TRI(){};
|
TRI()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
int a, b, c;
|
int a, b, c;
|
||||||
};
|
};
|
||||||
|
@ -810,6 +812,8 @@ class SHAPE_POLY_SET : public SHAPE
|
||||||
///> For aFastMode meaning, see function booleanOp
|
///> For aFastMode meaning, see function booleanOp
|
||||||
void Fracture( POLYGON_MODE aFastMode );
|
void Fracture( POLYGON_MODE aFastMode );
|
||||||
|
|
||||||
|
///> Converts a single outline slitted ("fractured") polygon into a set ouf outlines
|
||||||
|
///> with holes.
|
||||||
void Unfracture( POLYGON_MODE aFastMode );
|
void Unfracture( POLYGON_MODE aFastMode );
|
||||||
|
|
||||||
///> Returns true if the polygon set has any holes.
|
///> Returns true if the polygon set has any holes.
|
||||||
|
|
|
@ -735,6 +735,7 @@ public:
|
||||||
|
|
||||||
const std::vector<SEG>& GetHatchLines() const { return m_HatchLines; }
|
const std::vector<SEG>& GetHatchLines() const { return m_HatchLines; }
|
||||||
|
|
||||||
|
|
||||||
#if defined(DEBUG)
|
#if defined(DEBUG)
|
||||||
virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
|
virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
|
||||||
#endif
|
#endif
|
||||||
|
@ -815,7 +816,6 @@ private:
|
||||||
HATCH_STYLE m_hatchStyle; // hatch style, see enum above
|
HATCH_STYLE m_hatchStyle; // hatch style, see enum above
|
||||||
int m_hatchPitch; // for DIAGONAL_EDGE, distance between 2 hatch lines
|
int m_hatchPitch; // for DIAGONAL_EDGE, distance between 2 hatch lines
|
||||||
std::vector<SEG> m_HatchLines; // hatch lines
|
std::vector<SEG> m_HatchLines; // hatch lines
|
||||||
|
|
||||||
std::vector<int> m_insulatedIslands;
|
std::vector<int> m_insulatedIslands;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -293,11 +293,11 @@ bool CN_CONNECTIVITY_ALGO::Add( BOARD_ITEM* aItem )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CN_CONNECTIVITY_ALGO::searchConnections( bool aIncludeZones )
|
void CN_CONNECTIVITY_ALGO::searchConnections( bool aIncludeZones )
|
||||||
{
|
{
|
||||||
std::mutex cnListLock;
|
std::mutex cnListLock;
|
||||||
|
|
||||||
//PROF_COUNTER cnt("search");
|
|
||||||
int totalDirtyCount = 0;
|
int totalDirtyCount = 0;
|
||||||
|
|
||||||
if( m_lastSearchWithZones != aIncludeZones )
|
if( m_lastSearchWithZones != aIncludeZones )
|
||||||
|
@ -627,7 +627,6 @@ const CN_CONNECTIVITY_ALGO::CLUSTERS CN_CONNECTIVITY_ALGO::SearchClusters( CLUST
|
||||||
CN_ITEM* head = nullptr;
|
CN_ITEM* head = nullptr;
|
||||||
CLUSTERS clusters;
|
CLUSTERS clusters;
|
||||||
|
|
||||||
|
|
||||||
if( isDirty() )
|
if( isDirty() )
|
||||||
searchConnections( includeZones );
|
searchConnections( includeZones );
|
||||||
|
|
||||||
|
@ -837,6 +836,7 @@ void CN_CONNECTIVITY_ALGO::PropagateNets()
|
||||||
propagateConnections();
|
propagateConnections();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CN_CONNECTIVITY_ALGO::FindIsolatedCopperIslands( ZONE_CONTAINER* aZone, std::vector<int>& aIslands )
|
void CN_CONNECTIVITY_ALGO::FindIsolatedCopperIslands( ZONE_CONTAINER* aZone, std::vector<int>& aIslands )
|
||||||
{
|
{
|
||||||
if( aZone->GetFilledPolysList().IsEmpty() )
|
if( aZone->GetFilledPolysList().IsEmpty() )
|
||||||
|
|
|
@ -1144,33 +1144,6 @@ void PCB_PAINTER::draw( const ZONE_CONTAINER* aZone, int aLayer )
|
||||||
}
|
}
|
||||||
|
|
||||||
m_gal->DrawPolygon( polySet );
|
m_gal->DrawPolygon( polySet );
|
||||||
|
|
||||||
#if 0
|
|
||||||
for( int i = 0; i < polySet.OutlineCount(); i++ )
|
|
||||||
{
|
|
||||||
const SHAPE_LINE_CHAIN& outline = polySet.COutline( i );
|
|
||||||
// fixme: GAL drawing API that accepts SHAPEs directly (this fiddling with double<>int conversion
|
|
||||||
// is just a performance hog)
|
|
||||||
|
|
||||||
for( int j = 0; j < outline.PointCount(); j++ )
|
|
||||||
corners.push_back ( (VECTOR2D) outline.CPoint( j ) );
|
|
||||||
|
|
||||||
corners.push_back( (VECTOR2D) outline.CPoint( 0 ) );
|
|
||||||
|
|
||||||
if( displayMode == PCB_RENDER_SETTINGS::DZ_SHOW_FILLED )
|
|
||||||
{
|
|
||||||
m_gal->DrawPolygon( corners );
|
|
||||||
m_gal->DrawPolyline( corners );
|
|
||||||
}
|
|
||||||
else if( displayMode == PCB_RENDER_SETTINGS::DZ_SHOW_OUTLINED )
|
|
||||||
{
|
|
||||||
m_gal->DrawPolyline( corners );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
corners.clear();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue