pcbnew: Optimized zone filling algorithm: code cleanup

This commit is contained in:
Tomasz Włostowski 2017-12-01 16:53:58 +01:00
parent d1d9e57b86
commit 8df299a6bc
7 changed files with 33 additions and 58 deletions

View File

@ -478,7 +478,6 @@ include( CheckFindPackageResult )
find_package( OpenMP )
if( OPENMP_FOUND )
message( "FOUND OPENMP" )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" )
add_definitions( -DUSE_OPENMP )

View File

@ -1513,6 +1513,7 @@ void OPENGL_GAL::drawStrokedSemiCircle( const VECTOR2D& aCenterPoint, double aRa
Restore();
}
void OPENGL_GAL::drawPolygon( GLdouble* aPoints, int aPointCount )
{
currentManager->Shader( SHADER_NONE );

View File

@ -659,8 +659,6 @@ void SHAPE_POLY_SET::importTree( PolyTree* tree )
}
// Polygon fracturing code. Work in progress.
struct FractureEdge
{
FractureEdge( bool connected, SHAPE_LINE_CHAIN* owner, int index ) :

View File

@ -65,7 +65,9 @@ class SHAPE_POLY_SET : public SHAPE
struct TRI
{
TRI(){};
TRI()
{
}
int a, b, c;
};
@ -810,6 +812,8 @@ class SHAPE_POLY_SET : public SHAPE
///> For aFastMode meaning, see function booleanOp
void Fracture( POLYGON_MODE aFastMode );
///> Converts a single outline slitted ("fractured") polygon into a set ouf outlines
///> with holes.
void Unfracture( POLYGON_MODE aFastMode );
///> Returns true if the polygon set has any holes.

View File

@ -735,6 +735,7 @@ public:
const std::vector<SEG>& GetHatchLines() const { return m_HatchLines; }
#if defined(DEBUG)
virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
#endif
@ -815,7 +816,6 @@ private:
HATCH_STYLE m_hatchStyle; // hatch style, see enum above
int m_hatchPitch; // for DIAGONAL_EDGE, distance between 2 hatch lines
std::vector<SEG> m_HatchLines; // hatch lines
std::vector<int> m_insulatedIslands;
/**

View File

@ -293,11 +293,11 @@ bool CN_CONNECTIVITY_ALGO::Add( BOARD_ITEM* aItem )
return true;
}
void CN_CONNECTIVITY_ALGO::searchConnections( bool aIncludeZones )
{
std::mutex cnListLock;
//PROF_COUNTER cnt("search");
int totalDirtyCount = 0;
if( m_lastSearchWithZones != aIncludeZones )
@ -627,7 +627,6 @@ const CN_CONNECTIVITY_ALGO::CLUSTERS CN_CONNECTIVITY_ALGO::SearchClusters( CLUST
CN_ITEM* head = nullptr;
CLUSTERS clusters;
if( isDirty() )
searchConnections( includeZones );
@ -837,6 +836,7 @@ void CN_CONNECTIVITY_ALGO::PropagateNets()
propagateConnections();
}
void CN_CONNECTIVITY_ALGO::FindIsolatedCopperIslands( ZONE_CONTAINER* aZone, std::vector<int>& aIslands )
{
if( aZone->GetFilledPolysList().IsEmpty() )

View File

@ -1144,33 +1144,6 @@ void PCB_PAINTER::draw( const ZONE_CONTAINER* aZone, int aLayer )
}
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
}
}