From c437ca16406e8b6d879fc29c13411b966297845b Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 12 Dec 2018 20:10:48 +0000 Subject: [PATCH] Fix some formatting issues. --- polygon/PolyLine.cpp | 28 ++++++++++++++++------------ polygon/polygon_test_point_inside.h | 13 +++++++------ 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/polygon/PolyLine.cpp b/polygon/PolyLine.cpp index 9d61a59ff3..8d7770b2c7 100644 --- a/polygon/PolyLine.cpp +++ b/polygon/PolyLine.cpp @@ -70,11 +70,13 @@ CPolyLine::~CPolyLine() UnHatch(); } -/* Removes corners which create a null segment edge + +/* + * Removes corners which create a null segment edge * (i.e. when 2 successive corners are at the same location) * returns the count of removed corners. */ - int CPolyLine::RemoveNullSegments() +int CPolyLine::RemoveNullSegments() { int removed = 0; unsigned startcountour = 0; @@ -169,6 +171,7 @@ int CPolyLine::NormalizeAreaOutlines( std::vector* aNewPolygonList ) return polySet.OutlineCount(); } + /** * Function ImportSettings * Copy settings (layer, hatch styles) from aPoly @@ -180,6 +183,7 @@ void CPolyLine::ImportSettings( const CPolyLine * aPoly ) SetHatchPitch( aPoly->GetHatchPitch() ); } + /* initialize a contour * set layer, hatch style, and starting point */ @@ -206,6 +210,7 @@ void CPolyLine::AppendCorner( int x, int y ) m_CornersList.Append( poly_pt ); } + // move corner of polyline // void CPolyLine::MoveCorner( int ic, int x, int y ) @@ -248,15 +253,12 @@ void CPolyLine::DeleteCorner( int ic ) } -/******************************************/ -void CPolyLine::RemoveContour( int icont ) -/******************************************/ - /** * Function RemoveContour * @param icont = contour number to remove * remove a contour only if there is more than 1 contour */ +void CPolyLine::RemoveContour( int icont ) { UnHatch(); int istart = GetContourStart( icont ); @@ -509,15 +511,12 @@ CPolyLine* CPolyLine::Fillet( unsigned int aRadius, unsigned int aSegments ) } -/******************************************/ -void CPolyLine::RemoveAllContours( void ) -/******************************************/ - /** * function RemoveAllContours * removes all corners from the list. * Others params are not changed */ +void CPolyLine::RemoveAllContours() { m_CornersList.RemoveAllContours(); } @@ -980,6 +979,7 @@ void CPolyLine::MoveOrigin( int x_off, int y_off ) Hatch(); } + /* * AppendArc: * adds segments to current contour to approximate the given arc @@ -1149,7 +1149,8 @@ int CPolyLine::Distance( const wxPoint& aPoint ) } -/* test is the point aPos is near (< aDistMax ) a vertex +/* + * test is the point aPos is near (< aDistMax ) a vertex * return int = the index of the first corner of the vertex, or -1 if not found. */ int CPolyLine::HitTestForEdge( const wxPoint& aPos, int aDistMax ) const @@ -1191,7 +1192,9 @@ int CPolyLine::HitTestForEdge( const wxPoint& aPos, int aDistMax ) const return corner; } -/* test is the point aPos is near (< aDistMax ) a corner + +/* + * test is the point aPos is near (< aDistMax ) a corner * return int = the index of corner of the, or -1 if not found. */ int CPolyLine::HitTestForCorner( const wxPoint& aPos, int aDistMax ) const @@ -1313,6 +1316,7 @@ bool CPolyLine::IsPolygonSelfIntersecting() return false; } + const SHAPE_POLY_SET ConvertPolyListToPolySet( const CPOLYGONS_LIST& aList ) { SHAPE_POLY_SET rv; diff --git a/polygon/polygon_test_point_inside.h b/polygon/polygon_test_point_inside.h index cbf8430f57..ee2ca40e9e 100644 --- a/polygon/polygon_test_point_inside.h +++ b/polygon/polygon_test_point_inside.h @@ -47,10 +47,12 @@ class CPOLYGONS_LIST; * @return true if the point is inside, false for outside */ bool TestPointInsidePolygon( const CPOLYGONS_LIST& aPolysList, - int aIdxstart, - int aIdxend, - int aRefx, - int aRefy); + int aIdxstart, + int aIdxend, + int aRefx, + int aRefy); +#endif + /** * Function TestPointInsidePolygon (overlaid) * same as previous, but mainly use wxPoint @@ -59,7 +61,6 @@ bool TestPointInsidePolygon( const CPOLYGONS_LIST& aPolysList, * @param aRefPoint: the point coordinate to test * @return true if the point is inside, false for outside */ -#endif bool TestPointInsidePolygon( const wxPoint* aPolysList, - int aCount, + int aCount, const wxPoint &aRefPoint );