diff --git a/AutoNester.cpp b/AutoNester.cpp index 748c6df..0cc35bc 100644 --- a/AutoNester.cpp +++ b/AutoNester.cpp @@ -165,6 +165,27 @@ AutoNester::AddPart( int nPartId, const PolyArc& Outline, bool bCanFlip, bool bC return true ; } +//---------------------------------------------------------------------------- +bool +AutoNester::AddHoleToPart( int nPartId, const PolyArc& Hole) +{ + if ( m_pOrder == nullptr) + return false ; + // verifico buco + if ( Hole.GetArcNbr() == 0 || ! Hole.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 buco al pezzo + vector vElem ; + GetCNSPath( Hole, vElem) ; + CNS_AddHoleToPart( pPart, int( vElem.size()), vElem.data()) ; + return true ; +} + //---------------------------------------------------------------------------- bool AutoNester::AddAnotherOutlineToPart( int nPartId, const PolyArc& AnotherOutline) diff --git a/AutoNester.h b/AutoNester.h index c7caead..19f71d7 100644 --- a/AutoNester.h +++ b/AutoNester.h @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- -// EgalTech 2019-2019 +// EgalTech 2019-2020 //---------------------------------------------------------------------------- -// File : AutoNester.h Data : 28.11.19 Versione : 2.1k6 +// File : AutoNester.h Data : 29.01.20 Versione : 2.2a2 // Contenuto : Dichiarazione della classe AutoNester. // // @@ -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 AddHoleToPart( int nPartId, const PolyArc& Hole) override ; bool AddAnotherOutlineToPart( int nPartId, const PolyArc& AnotherOutline) override ; bool AddToolOutlineToPart( int nPartId, const PolyArc& ToolOutline) override ; bool SetInterpartGap( double dGap) override ; diff --git a/EgtNesting.rc b/EgtNesting.rc index 872c5ce..4b6ba75 100644 Binary files a/EgtNesting.rc and b/EgtNesting.rc differ