Formatting and spelling tweaks

This commit is contained in:
Jon Evans 2021-07-03 15:43:40 -04:00
parent cee5920d5c
commit ddc20dadc0
3 changed files with 45 additions and 40 deletions

View File

@ -140,11 +140,14 @@ public:
/** /**
* Initialize an empty line chain. * Initialize an empty line chain.
*/ */
SHAPE_LINE_CHAIN() : SHAPE_LINE_CHAIN_BASE( SH_LINE_CHAIN ), m_closed( false ), m_width( 0 ) SHAPE_LINE_CHAIN() :
SHAPE_LINE_CHAIN_BASE( SH_LINE_CHAIN ),
m_closed( false ),
m_width( 0 )
{} {}
SHAPE_LINE_CHAIN( const SHAPE_LINE_CHAIN& aShape ) SHAPE_LINE_CHAIN( const SHAPE_LINE_CHAIN& aShape ) :
: SHAPE_LINE_CHAIN_BASE( SH_LINE_CHAIN ), SHAPE_LINE_CHAIN_BASE( SH_LINE_CHAIN ),
m_points( aShape.m_points ), m_points( aShape.m_points ),
m_shapes( aShape.m_shapes ), m_shapes( aShape.m_shapes ),
m_arcs( aShape.m_arcs ), m_arcs( aShape.m_arcs ),
@ -155,8 +158,10 @@ public:
SHAPE_LINE_CHAIN( const std::vector<int>& aV ); SHAPE_LINE_CHAIN( const std::vector<int>& aV );
SHAPE_LINE_CHAIN( const std::vector<wxPoint>& aV, bool aClosed = false ) SHAPE_LINE_CHAIN( const std::vector<wxPoint>& aV, bool aClosed = false ) :
: SHAPE_LINE_CHAIN_BASE( SH_LINE_CHAIN ), m_closed( aClosed ), m_width( 0 ) SHAPE_LINE_CHAIN_BASE( SH_LINE_CHAIN ),
m_closed( aClosed ),
m_width( 0 )
{ {
m_points.reserve( aV.size() ); m_points.reserve( aV.size() );
@ -166,15 +171,17 @@ public:
m_shapes = std::vector<std::pair<ssize_t, ssize_t>>( aV.size(), SHAPES_ARE_PT ); m_shapes = std::vector<std::pair<ssize_t, ssize_t>>( aV.size(), SHAPES_ARE_PT );
} }
SHAPE_LINE_CHAIN( const std::vector<VECTOR2I>& aV, bool aClosed = false ) SHAPE_LINE_CHAIN( const std::vector<VECTOR2I>& aV, bool aClosed = false ) :
: SHAPE_LINE_CHAIN_BASE( SH_LINE_CHAIN ), m_closed( aClosed ), m_width( 0 ) SHAPE_LINE_CHAIN_BASE( SH_LINE_CHAIN ),
m_closed( aClosed ),
m_width( 0 )
{ {
m_points = aV; m_points = aV;
m_shapes = std::vector<std::pair<ssize_t, ssize_t>>( aV.size(), SHAPES_ARE_PT ); m_shapes = std::vector<std::pair<ssize_t, ssize_t>>( aV.size(), SHAPES_ARE_PT );
} }
SHAPE_LINE_CHAIN( const SHAPE_ARC& aArc, bool aClosed = false ) SHAPE_LINE_CHAIN( const SHAPE_ARC& aArc, bool aClosed = false ) :
: SHAPE_LINE_CHAIN_BASE( SH_LINE_CHAIN ), SHAPE_LINE_CHAIN_BASE( SH_LINE_CHAIN ),
m_closed( aClosed ), m_closed( aClosed ),
m_width( 0 ) m_width( 0 )
{ {
@ -183,7 +190,8 @@ public:
m_shapes = std::vector<std::pair<ssize_t, ssize_t>>( m_points.size(), SHAPES_ARE_PT ); m_shapes = std::vector<std::pair<ssize_t, ssize_t>>( m_points.size(), SHAPES_ARE_PT );
} }
SHAPE_LINE_CHAIN( const ClipperLib::Path& aPath, const std::vector<CLIPPER_Z_VALUE>& aZValueBuffer, SHAPE_LINE_CHAIN( const ClipperLib::Path& aPath,
const std::vector<CLIPPER_Z_VALUE>& aZValueBuffer,
const std::vector<SHAPE_ARC>& aArcBuffer ); const std::vector<SHAPE_ARC>& aArcBuffer );
virtual ~SHAPE_LINE_CHAIN() virtual ~SHAPE_LINE_CHAIN()
@ -838,19 +846,16 @@ protected:
*/ */
void splitArc( ssize_t aPtIndex, bool aCoincident = false ); void splitArc( ssize_t aPtIndex, bool aCoincident = false );
void amendArc( size_t aArcIndex, const VECTOR2I& aNewStart, const VECTOR2I& aNewEnd );
void ammendArc( size_t aArcIndex, const VECTOR2I& aNewStart, const VECTOR2I& aNewEnd ); void amendArcStart( size_t aArcIndex, const VECTOR2I& aNewStart )
void ammendArcStart( size_t aArcIndex, const VECTOR2I& aNewStart )
{ {
ammendArc( aArcIndex, aNewStart, m_arcs[aArcIndex].GetP1() ); amendArc( aArcIndex, aNewStart, m_arcs[aArcIndex].GetP1() );
} }
void amendArcEnd( size_t aArcIndex, const VECTOR2I& aNewEnd )
void ammendArcEnd( size_t aArcIndex, const VECTOR2I& aNewEnd )
{ {
ammendArc( aArcIndex, m_arcs[aArcIndex].GetP0(), aNewEnd ); amendArc( aArcIndex, m_arcs[aArcIndex].GetP0(), aNewEnd );
} }
/** /**

View File

@ -150,7 +150,7 @@ void SHAPE_LINE_CHAIN::convertArc( ssize_t aArcIndex )
} }
void SHAPE_LINE_CHAIN::ammendArc( size_t aArcIndex, const VECTOR2I& aNewStart, void SHAPE_LINE_CHAIN::amendArc( size_t aArcIndex, const VECTOR2I& aNewStart,
const VECTOR2I& aNewEnd ) const VECTOR2I& aNewEnd )
{ {
wxCHECK_MSG( aArcIndex < m_arcs.size(), /* void */, wxCHECK_MSG( aArcIndex < m_arcs.size(), /* void */,
@ -185,9 +185,9 @@ void SHAPE_LINE_CHAIN::splitArc( ssize_t aPtIndex, bool aCoincident )
ssize_t firstArcIndex = m_shapes[aPtIndex].first; ssize_t firstArcIndex = m_shapes[aPtIndex].first;
const VECTOR2I& newStart = m_arcs[firstArcIndex].GetP0(); //don't ammend the start const VECTOR2I& newStart = m_arcs[firstArcIndex].GetP0(); // don't amend the start
const VECTOR2I& newEnd = m_points[aPtIndex - 1]; const VECTOR2I& newEnd = m_points[aPtIndex - 1];
ammendArc( firstArcIndex, newStart, newEnd ); amendArc( firstArcIndex, newStart, newEnd );
if( IsSharedPt( aPtIndex ) ) if( IsSharedPt( aPtIndex ) )
{ {

View File

@ -628,7 +628,7 @@ void SHAPE_POLY_SET::booleanOp( ClipperLib::ClipType aType, const SHAPE_POLY_SET
newIntersectPoints.insert( { VECTOR2I( pt.X, pt.Y ), newZval } ); newIntersectPoints.insert( { VECTOR2I( pt.X, pt.Y ), newZval } );
pt.Z = z_value_ptr; pt.Z = z_value_ptr;
//@todo ammend X,Y values to true intersection between arcs or arc and segment //@todo amend X,Y values to true intersection between arcs or arc and segment
}; };
c.ZFillFunction( callback ); // register callback c.ZFillFunction( callback ); // register callback
@ -637,7 +637,7 @@ void SHAPE_POLY_SET::booleanOp( ClipperLib::ClipType aType, const SHAPE_POLY_SET
importTree( &solution, zValues, arcBuffer ); importTree( &solution, zValues, arcBuffer );
// Ammend arcs for the intersection points // amend arcs for the intersection points
for( auto& poly : m_polys ) for( auto& poly : m_polys )
{ {
for( size_t i = 0; i < poly.size(); i++ ) for( size_t i = 0; i < poly.size(); i++ )
@ -655,16 +655,16 @@ void SHAPE_POLY_SET::booleanOp( ClipperLib::ClipType aType, const SHAPE_POLY_SET
//@todo consider editing the intersection point to be the "true" arc intersection //@todo consider editing the intersection point to be the "true" arc intersection
if( poly[i].IsSharedPt( j ) ) if( poly[i].IsSharedPt( j ) )
{ {
poly[i].ammendArcEnd( shape.first, pt ); poly[i].amendArcEnd( shape.first, pt );
poly[i].ammendArcStart( shape.second, pt ); poly[i].amendArcStart( shape.second, pt );
} }
else if( poly[i].IsArcStart( j ) ) else if( poly[i].IsArcStart( j ) )
{ {
poly[i].ammendArcStart( shape.first, pt ); poly[i].amendArcStart( shape.first, pt );
} }
else if( poly[i].IsArcEnd( j ) ) else if( poly[i].IsArcEnd( j ) )
{ {
poly[i].ammendArcEnd( shape.first, pt ); poly[i].amendArcEnd( shape.first, pt );
} }
else else
{ {