Formatting and spelling tweaks
This commit is contained in:
parent
cee5920d5c
commit
ddc20dadc0
|
@ -140,23 +140,28 @@ public:
|
|||
/**
|
||||
* 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_BASE( SH_LINE_CHAIN ),
|
||||
m_points( aShape.m_points ),
|
||||
m_shapes( aShape.m_shapes ),
|
||||
m_arcs( aShape.m_arcs ),
|
||||
m_closed( aShape.m_closed ),
|
||||
m_width( aShape.m_width ),
|
||||
m_bbox( aShape.m_bbox )
|
||||
SHAPE_LINE_CHAIN( const SHAPE_LINE_CHAIN& aShape ) :
|
||||
SHAPE_LINE_CHAIN_BASE( SH_LINE_CHAIN ),
|
||||
m_points( aShape.m_points ),
|
||||
m_shapes( aShape.m_shapes ),
|
||||
m_arcs( aShape.m_arcs ),
|
||||
m_closed( aShape.m_closed ),
|
||||
m_width( aShape.m_width ),
|
||||
m_bbox( aShape.m_bbox )
|
||||
{}
|
||||
|
||||
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_BASE( SH_LINE_CHAIN ), m_closed( aClosed ), m_width( 0 )
|
||||
SHAPE_LINE_CHAIN( const std::vector<wxPoint>& aV, bool aClosed = false ) :
|
||||
SHAPE_LINE_CHAIN_BASE( SH_LINE_CHAIN ),
|
||||
m_closed( aClosed ),
|
||||
m_width( 0 )
|
||||
{
|
||||
m_points.reserve( aV.size() );
|
||||
|
||||
|
@ -166,30 +171,33 @@ public:
|
|||
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_BASE( SH_LINE_CHAIN ), m_closed( aClosed ), m_width( 0 )
|
||||
SHAPE_LINE_CHAIN( const std::vector<VECTOR2I>& aV, bool aClosed = false ) :
|
||||
SHAPE_LINE_CHAIN_BASE( SH_LINE_CHAIN ),
|
||||
m_closed( aClosed ),
|
||||
m_width( 0 )
|
||||
{
|
||||
m_points = aV;
|
||||
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_BASE( SH_LINE_CHAIN ),
|
||||
m_closed( aClosed ),
|
||||
m_width( 0 )
|
||||
SHAPE_LINE_CHAIN( const SHAPE_ARC& aArc, bool aClosed = false ) :
|
||||
SHAPE_LINE_CHAIN_BASE( SH_LINE_CHAIN ),
|
||||
m_closed( aClosed ),
|
||||
m_width( 0 )
|
||||
{
|
||||
m_points = aArc.ConvertToPolyline().CPoints();
|
||||
m_arcs.emplace_back( aArc );
|
||||
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 );
|
||||
|
||||
virtual ~SHAPE_LINE_CHAIN()
|
||||
{}
|
||||
|
||||
SHAPE_LINE_CHAIN& operator=(const SHAPE_LINE_CHAIN&) = default;
|
||||
SHAPE_LINE_CHAIN& operator=( const SHAPE_LINE_CHAIN& ) = default;
|
||||
|
||||
SHAPE* Clone() const override;
|
||||
|
||||
|
@ -838,19 +846,16 @@ protected:
|
|||
*/
|
||||
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 ammendArcStart( size_t aArcIndex, const VECTOR2I& aNewStart )
|
||||
void amendArcStart( size_t aArcIndex, const VECTOR2I& aNewStart )
|
||||
{
|
||||
ammendArc( aArcIndex, aNewStart, m_arcs[aArcIndex].GetP1() );
|
||||
amendArc( aArcIndex, aNewStart, m_arcs[aArcIndex].GetP1() );
|
||||
}
|
||||
|
||||
|
||||
void ammendArcEnd( size_t aArcIndex, const VECTOR2I& aNewEnd )
|
||||
void amendArcEnd( size_t aArcIndex, const VECTOR2I& aNewEnd )
|
||||
{
|
||||
ammendArc( aArcIndex, m_arcs[aArcIndex].GetP0(), aNewEnd );
|
||||
amendArc( aArcIndex, m_arcs[aArcIndex].GetP0(), aNewEnd );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -150,8 +150,8 @@ void SHAPE_LINE_CHAIN::convertArc( ssize_t aArcIndex )
|
|||
}
|
||||
|
||||
|
||||
void SHAPE_LINE_CHAIN::ammendArc( size_t aArcIndex, const VECTOR2I& aNewStart,
|
||||
const VECTOR2I& aNewEnd )
|
||||
void SHAPE_LINE_CHAIN::amendArc( size_t aArcIndex, const VECTOR2I& aNewStart,
|
||||
const VECTOR2I& aNewEnd )
|
||||
{
|
||||
wxCHECK_MSG( aArcIndex < m_arcs.size(), /* void */,
|
||||
"Invalid arc index requested." );
|
||||
|
@ -185,13 +185,13 @@ void SHAPE_LINE_CHAIN::splitArc( ssize_t aPtIndex, bool aCoincident )
|
|||
|
||||
ssize_t firstArcIndex = m_shapes[aPtIndex].first;
|
||||
|
||||
const VECTOR2I& newStart = m_arcs[firstArcIndex].GetP0(); //don't ammend the start
|
||||
const VECTOR2I& newEnd = m_points[aPtIndex - 1];
|
||||
ammendArc( firstArcIndex, newStart, newEnd );
|
||||
const VECTOR2I& newStart = m_arcs[firstArcIndex].GetP0(); // don't amend the start
|
||||
const VECTOR2I& newEnd = m_points[aPtIndex - 1];
|
||||
amendArc( firstArcIndex, newStart, newEnd );
|
||||
|
||||
if( IsSharedPt( aPtIndex ) )
|
||||
{
|
||||
m_shapes[aPtIndex].first = m_shapes[aPtIndex].second;
|
||||
m_shapes[aPtIndex].first = m_shapes[aPtIndex].second;
|
||||
m_shapes[aPtIndex].second = SHAPE_IS_PT;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -628,7 +628,7 @@ void SHAPE_POLY_SET::booleanOp( ClipperLib::ClipType aType, const SHAPE_POLY_SET
|
|||
newIntersectPoints.insert( { VECTOR2I( pt.X, pt.Y ), newZval } );
|
||||
|
||||
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
|
||||
|
@ -637,7 +637,7 @@ void SHAPE_POLY_SET::booleanOp( ClipperLib::ClipType aType, const SHAPE_POLY_SET
|
|||
|
||||
importTree( &solution, zValues, arcBuffer );
|
||||
|
||||
// Ammend arcs for the intersection points
|
||||
// amend arcs for the intersection points
|
||||
for( auto& poly : m_polys )
|
||||
{
|
||||
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
|
||||
if( poly[i].IsSharedPt( j ) )
|
||||
{
|
||||
poly[i].ammendArcEnd( shape.first, pt );
|
||||
poly[i].ammendArcStart( shape.second, pt );
|
||||
poly[i].amendArcEnd( shape.first, pt );
|
||||
poly[i].amendArcStart( shape.second, pt );
|
||||
}
|
||||
else if( poly[i].IsArcStart( j ) )
|
||||
{
|
||||
poly[i].ammendArcStart( shape.first, pt );
|
||||
poly[i].amendArcStart( shape.first, pt );
|
||||
}
|
||||
else if( poly[i].IsArcEnd( j ) )
|
||||
{
|
||||
poly[i].ammendArcEnd( shape.first, pt );
|
||||
poly[i].amendArcEnd( shape.first, pt );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue