Add priority level to zones.

This commit is contained in:
jean-pierre charras
2012-01-29 20:29:19 +01:00
parent c0d39da548
commit ee8d721c3c
15 changed files with 4196 additions and 3614 deletions
+26 -10
View File
@@ -27,13 +27,16 @@
* in order to have drawable (and plottable) filled polygons
* drawable filled polygons are polygons without hole
* @param aPcb: the current board (can be NULL for non copper zones)
* @param aCornerBuffer: A reference to a buffer to put polygon corners, or NULL
* if NULL (default), uses m_FilledPolysList and fill current zone.
* @return number of polygons
* This function does not add holes for pads and tracks but calls
* AddClearanceAreasPolygonsToPolysList() to do that for copper layers
*/
int ZONE_CONTAINER::BuildFilledPolysListData( BOARD* aPcb )
int ZONE_CONTAINER::BuildFilledPolysListData( BOARD* aPcb, std::vector <CPolyPt>* aCornerBuffer )
{
m_FilledPolysList.clear();
if( aCornerBuffer == NULL )
m_FilledPolysList.clear();
/* convert outlines + holes to outlines without holes (adding extra segments if necessary)
* m_Poly data is expected normalized, i.e. NormalizeAreaOutlines was used after building
@@ -74,13 +77,24 @@ int ZONE_CONTAINER::BuildFilledPolysListData( BOARD* aPcb )
corner.x = (int) smoothedPoly->GetKboolEngine()->GetPolygonXPoint();
corner.y = (int) smoothedPoly->GetKboolEngine()->GetPolygonYPoint();
corner.end_contour = false;
m_FilledPolysList.push_back( corner );
if( aCornerBuffer )
aCornerBuffer->push_back( corner );
else
m_FilledPolysList.push_back( corner );
count++;
}
corner.end_contour = true;
m_FilledPolysList.pop_back();
m_FilledPolysList.push_back( corner );
if( aCornerBuffer )
{
aCornerBuffer->pop_back();
aCornerBuffer->push_back( corner );
}
else
{
m_FilledPolysList.pop_back();
m_FilledPolysList.push_back( corner );
}
smoothedPoly->GetKboolEngine()->EndPolygonGet();
}
@@ -89,12 +103,14 @@ int ZONE_CONTAINER::BuildFilledPolysListData( BOARD* aPcb )
/* For copper layers, we now must add holes in the Polygon list.
* holes are pads and tracks with their clearance area
*/
if( ! aCornerBuffer )
{
if( IsOnCopperLayer() )
AddClearanceAreasPolygonsToPolysList( aPcb );
if( IsOnCopperLayer() )
AddClearanceAreasPolygonsToPolysList( aPcb );
if ( m_FillMode ) // if fill mode uses segments, create them:
Fill_Zone_Areas_With_Segments( );
if ( m_FillMode ) // if fill mode uses segments, create them:
Fill_Zone_Areas_With_Segments( );
}
return count;
}