diff --git a/AutoNester.cpp b/AutoNester.cpp index 56af780..748c6df 100644 --- a/AutoNester.cpp +++ b/AutoNester.cpp @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- // EgalTech 2019-2019 //---------------------------------------------------------------------------- -// File : AutoNester.cpp Data : 28.11.19 Versione : 2.1k6 +// File : AutoNester.cpp Data : 05.12.19 Versione : 2.1l2 // Contenuto : Implementazione della classe AutoNester. // // @@ -165,6 +165,27 @@ AutoNester::AddPart( int nPartId, const PolyArc& Outline, bool bCanFlip, bool bC return true ; } +//---------------------------------------------------------------------------- +bool +AutoNester::AddAnotherOutlineToPart( int nPartId, const PolyArc& AnotherOutline) +{ + if ( m_pOrder == nullptr) + return false ; + // verifico outline + if ( AnotherOutline.GetArcNbr() == 0 || ! AnotherOutline.IsClosed()) + return false ; + // cerco il pezzo + const auto Iter = m_IdPartPtr.find( nPartId) ; + if ( Iter == m_IdPartPtr.end()) + return false ; + CNS_PartPtr pPart = Iter->second ; + // aggiungo contorno aggiuntivo al pezzo + vector vElem ; + GetCNSPath( AnotherOutline, vElem) ; + CNS_AddExternalBoundaryToPart( pPart, int( vElem.size()), vElem.data()) ; + return true ; +} + //---------------------------------------------------------------------------- bool AutoNester::AddToolOutlineToPart( int nPartId, const PolyArc& ToolOutline) diff --git a/AutoNester.h b/AutoNester.h index e5fdb69..c7caead 100644 --- a/AutoNester.h +++ b/AutoNester.h @@ -30,6 +30,7 @@ class AutoNester : public IAutoNester bool AddSheet( int nSheetId, const PolyArc& Outline, double dKerf, int nPriority, int nCount) override ; bool AddDefectToSheet( int nSheetId, const PolyArc& Outline) override ; bool AddPart( int nPartId, const PolyArc& Outline, bool bCanFlip, bool bCanRotate, double dRotStep, int nPriority, int nCount) override ; + bool AddAnotherOutlineToPart( int nPartId, const PolyArc& AnotherOutline) override ; bool AddToolOutlineToPart( int nPartId, const PolyArc& ToolOutline) override ; bool SetInterpartGap( double dGap) override ; bool Compute( bool bMinimizeOnXvsY, int nMaxTime) override ;