Code formatting
This commit is contained in:
parent
a7cd62ad12
commit
1751e4631c
|
@ -797,13 +797,13 @@ void OPENGL_GAL::DrawPolygon( const VECTOR2D aPointList[], int aListSize )
|
||||||
drawPolygon( points.get(), aListSize );
|
drawPolygon( points.get(), aListSize );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void OPENGL_GAL::drawTriangulatedPolyset( const SHAPE_POLY_SET& aPolySet )
|
void OPENGL_GAL::drawTriangulatedPolyset( const SHAPE_POLY_SET& aPolySet )
|
||||||
{
|
{
|
||||||
currentManager->Shader( SHADER_NONE );
|
currentManager->Shader( SHADER_NONE );
|
||||||
currentManager->Color( fillColor.r, fillColor.g, fillColor.b, fillColor.a );
|
currentManager->Color( fillColor.r, fillColor.g, fillColor.b, fillColor.a );
|
||||||
|
|
||||||
|
if( isFillEnabled )
|
||||||
if ( isFillEnabled )
|
|
||||||
{
|
{
|
||||||
for( int j = 0; j < aPolySet.OutlineCount(); ++j )
|
for( int j = 0; j < aPolySet.OutlineCount(); ++j )
|
||||||
{
|
{
|
||||||
|
|
|
@ -1863,16 +1863,14 @@ SHAPE_POLY_SET &SHAPE_POLY_SET::operator=( const SHAPE_POLY_SET& aOther )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class SHAPE_POLY_SET::TRIANGULATION_CONTEXT
|
class SHAPE_POLY_SET::TRIANGULATION_CONTEXT
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TRIANGULATION_CONTEXT( TRIANGULATED_POLYGON* aResultPoly ) :
|
TRIANGULATION_CONTEXT( TRIANGULATED_POLYGON* aResultPoly ) :
|
||||||
m_triPoly( aResultPoly )
|
m_triPoly( aResultPoly )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddOutline( const SHAPE_LINE_CHAIN& outl, bool aIsHole = false )
|
void AddOutline( const SHAPE_LINE_CHAIN& outl, bool aIsHole = false )
|
||||||
{
|
{
|
||||||
|
@ -1887,9 +1885,7 @@ public:
|
||||||
if ( aIsHole )
|
if ( aIsHole )
|
||||||
m_cdt->AddHole( m_points );
|
m_cdt->AddHole( m_points );
|
||||||
else
|
else
|
||||||
{
|
|
||||||
m_cdt.reset( new p2t::CDT( m_points ) );
|
m_cdt.reset( new p2t::CDT( m_points ) );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Triangulate()
|
void Triangulate()
|
||||||
|
@ -2014,6 +2010,7 @@ void SHAPE_POLY_SET::triangulateSingle( const POLYGON& aPoly,
|
||||||
|
|
||||||
aResult.AllocateVertices( totalVertexCount( aPoly ) );
|
aResult.AllocateVertices( totalVertexCount( aPoly ) );
|
||||||
ctx.AddOutline( aPoly[0], false );
|
ctx.AddOutline( aPoly[0], false );
|
||||||
|
|
||||||
for( unsigned i = 1; i < aPoly.size(); i++ )
|
for( unsigned i = 1; i < aPoly.size(); i++ )
|
||||||
{
|
{
|
||||||
ctx.AddOutline( aPoly[i], true ); // add holes
|
ctx.AddOutline( aPoly[i], true ); // add holes
|
||||||
|
|
|
@ -609,7 +609,6 @@ class SHAPE_POLY_SET : public SHAPE
|
||||||
return m_triangulatedPolys[aIndex].get();
|
return m_triangulatedPolys[aIndex].get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const SHAPE_LINE_CHAIN& COutline( int aIndex ) const
|
const SHAPE_LINE_CHAIN& COutline( int aIndex ) const
|
||||||
{
|
{
|
||||||
return m_polys[aIndex][0];
|
return m_polys[aIndex][0];
|
||||||
|
|
|
@ -944,10 +944,10 @@ void ZONE_CONTAINER::Rotate( const wxPoint& centre, double angle )
|
||||||
|
|
||||||
for( unsigned ic = 0; ic < m_FillSegmList.size(); ic++ )
|
for( unsigned ic = 0; ic < m_FillSegmList.size(); ic++ )
|
||||||
{
|
{
|
||||||
wxPoint a ( m_FillSegmList[ic].A );
|
wxPoint a( m_FillSegmList[ic].A );
|
||||||
RotatePoint( &a, centre, angle );
|
RotatePoint( &a, centre, angle );
|
||||||
m_FillSegmList[ic].A = a;
|
m_FillSegmList[ic].A = a;
|
||||||
wxPoint b ( m_FillSegmList[ic].B );
|
wxPoint b( m_FillSegmList[ic].B );
|
||||||
RotatePoint( &b, centre, angle );
|
RotatePoint( &b, centre, angle );
|
||||||
m_FillSegmList[ic].B = a;
|
m_FillSegmList[ic].B = a;
|
||||||
}
|
}
|
||||||
|
@ -989,7 +989,7 @@ void ZONE_CONTAINER::Mirror( const wxPoint& mirror_ref )
|
||||||
for( unsigned ic = 0; ic < m_FillSegmList.size(); ic++ )
|
for( unsigned ic = 0; ic < m_FillSegmList.size(); ic++ )
|
||||||
{
|
{
|
||||||
MIRROR( m_FillSegmList[ic].A.y, mirror_ref.y );
|
MIRROR( m_FillSegmList[ic].A.y, mirror_ref.y );
|
||||||
MIRROR( m_FillSegmList[ic].B.y, mirror_ref.y );
|
MIRROR( m_FillSegmList[ic].B.y, mirror_ref.y );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1303,6 +1303,7 @@ BITMAP_DEF ZONE_CONTAINER::GetMenuImage() const
|
||||||
return add_zone_xpm;
|
return add_zone_xpm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ZONE_CONTAINER::SwapData( BOARD_ITEM* aImage )
|
void ZONE_CONTAINER::SwapData( BOARD_ITEM* aImage )
|
||||||
{
|
{
|
||||||
assert( aImage->Type() == PCB_ZONE_AREA_T );
|
assert( aImage->Type() == PCB_ZONE_AREA_T );
|
||||||
|
@ -1310,11 +1311,13 @@ void ZONE_CONTAINER::SwapData( BOARD_ITEM* aImage )
|
||||||
std::swap( *((ZONE_CONTAINER*) this), *((ZONE_CONTAINER*) aImage) );
|
std::swap( *((ZONE_CONTAINER*) this), *((ZONE_CONTAINER*) aImage) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ZONE_CONTAINER::CacheTriangulation()
|
void ZONE_CONTAINER::CacheTriangulation()
|
||||||
{
|
{
|
||||||
m_FilledPolysList.CacheTriangulation();
|
m_FilledPolysList.CacheTriangulation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool ZONE_CONTAINER::BuildSmoothedPoly( SHAPE_POLY_SET& aSmoothedPoly ) const
|
bool ZONE_CONTAINER::BuildSmoothedPoly( SHAPE_POLY_SET& aSmoothedPoly ) const
|
||||||
{
|
{
|
||||||
if( GetNumCorners() <= 2 ) // malformed zone. polygon calculations do not like it ...
|
if( GetNumCorners() <= 2 ) // malformed zone. polygon calculations do not like it ...
|
||||||
|
|
|
@ -551,10 +551,10 @@ public:
|
||||||
* Function SetFilledPolysList
|
* Function SetFilledPolysList
|
||||||
* sets the list of filled polygons.
|
* sets the list of filled polygons.
|
||||||
*/
|
*/
|
||||||
void SetRawPolysList( SHAPE_POLY_SET& aPolysList )
|
void SetRawPolysList( SHAPE_POLY_SET& aPolysList )
|
||||||
{
|
{
|
||||||
m_RawPolysList = aPolysList;
|
m_RawPolysList = aPolysList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue