diff --git a/AutoNester.cpp b/AutoNester.cpp index 8c5bbbe..9fffcfa 100644 --- a/AutoNester.cpp +++ b/AutoNester.cpp @@ -102,7 +102,25 @@ AutoNester::SetGuillotineMode( void) { if ( m_pOrder == nullptr) return false ; - CNS_SetShearMode(m_pOrder, 1) ; + CNS_SetShearMode( m_pOrder, 1) ; + return true ; +} + +//---------------------------------------------------------------------------- +bool +AutoNester::SetStartCorner( int nCorner) +{ + if ( m_pOrder == nullptr) + return false ; + CNS_Origin cnsOrig ; + switch ( nCorner) { + case NST_CORNER_BL : cnsOrig = CNS_BottomLeft ; break ; + case NST_CORNER_TL : cnsOrig = CNS_TopLeft ; break ; + case NST_CORNER_BR : cnsOrig = CNS_BottomRight ; break ; + case NST_CORNER_TR : cnsOrig = CNS_TopRight ; break ; + default : return false ; + } + CNS_SetOrigin( m_pOrder, cnsOrig) ; return true ; } diff --git a/AutoNester.h b/AutoNester.h index 2095919..b48eeb4 100644 --- a/AutoNester.h +++ b/AutoNester.h @@ -28,6 +28,7 @@ class AutoNester : public IAutoNester ~AutoNester( void) override ; bool Start( void) override ; bool SetGuillotineMode( void) override ; + bool SetStartCorner( int nCorner) override ; bool AddSheet( int nSheetId, const PolyArc& Outline, double dKerf, int nPriority, int nCount, bool* pbIsRect = nullptr) 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 ; diff --git a/EgtNesting.rc b/EgtNesting.rc index fce1fae..94fd8d7 100644 Binary files a/EgtNesting.rc and b/EgtNesting.rc differ