diff --git a/MachMgr.h b/MachMgr.h index 56bc689..242ca96 100644 --- a/MachMgr.h +++ b/MachMgr.h @@ -298,7 +298,8 @@ class MachMgr : public IMachMgr bool MachiningUpdate( bool bPostApply = true) override ; bool PreparePreviewMachiningTool( void) const override ; bool RemovePreviewMachiningTool( void) const override ; - int PreviewMachiningTool( int nEntId, int nFlag) const override ; + int GetPreviewMachiningToolStepCount( void) const override ; + int PreviewMachiningTool( int nEntId, int nStep) const override ; bool GetMachiningParam( int nType, bool& bVal) const override ; bool GetMachiningParam( int nType, int& nVal) const override ; bool GetMachiningParam( int nType, double& dVal) const override ; diff --git a/MachMgrOperations.cpp b/MachMgrOperations.cpp index 2407be2..8622d99 100644 --- a/MachMgrOperations.cpp +++ b/MachMgrOperations.cpp @@ -1122,7 +1122,14 @@ MachMgr::RemovePreviewMachiningTool( void) const //---------------------------------------------------------------------------- int -MachMgr::PreviewMachiningTool( int nEntId, int nFlag) const +MachMgr::GetPreviewMachiningToolStepCount( void) const +{ + return -1 ; +} + +//---------------------------------------------------------------------------- +int +MachMgr::PreviewMachiningTool( int nEntId, int nStep) const { // recupero la lavorazione corrente int nCurrMchId = GetCurrMachining() ; @@ -1133,7 +1140,7 @@ MachMgr::PreviewMachiningTool( int nEntId, int nFlag) const if ( pMch == nullptr) return GDB_ID_NULL ; // eseguo - return pMch->ToolPreview( nEntId, nFlag) ; + return pMch->ToolPreview( nEntId, nStep) ; } //---------------------------------------------------------------------------- diff --git a/Machining.cpp b/Machining.cpp index 66afae6..c7ecaad 100644 --- a/Machining.cpp +++ b/Machining.cpp @@ -176,6 +176,13 @@ Machining::RemoveToolPreview( void) const //---------------------------------------------------------------------------- int +Machining::GetToolPreviewStepCount( void) const +{ + return -1 ; +} + +//---------------------------------------------------------------------------- +static int GetToolPreviewNext( IGeomDB* pGeomDB, int nEntId, int nParentId) { // recupero la successiva @@ -201,7 +208,7 @@ GetToolPreviewNext( IGeomDB* pGeomDB, int nEntId, int nParentId) } //---------------------------------------------------------------------------- -int +static int GetToolPreviewPrev( IGeomDB* pGeomDB, int nEntId, int nParentId) { // recupero la precedente @@ -228,7 +235,7 @@ GetToolPreviewPrev( IGeomDB* pGeomDB, int nEntId, int nParentId) //---------------------------------------------------------------------------- int -Machining::ToolPreview( int nEntId, int nFlag) const +Machining::ToolPreview( int nEntId, int nStep) const { // verifico validità gestori DB geometrico e CAM if ( m_pGeomDB == nullptr || m_pMchMgr == nullptr) @@ -248,10 +255,10 @@ Machining::ToolPreview( int nEntId, int nFlag) const // recupero il gruppo di appartenenza nParentId = m_pGeomDB->GetFirstGroupInGroup( nClId) ; // se richiesta successiva - if ( nFlag == MCH_TPM_AFTER) + if ( nStep > 0) nEntId = GetToolPreviewNext( m_pGeomDB, nEntId, nParentId) ; // se richiesta precedente - else if ( nFlag == MCH_TPM_BEFORE) + else if ( nStep < 0) nEntId = GetToolPreviewPrev( m_pGeomDB, nEntId, nParentId) ; // altrimenti richiesta corrente else @@ -263,10 +270,10 @@ Machining::ToolPreview( int nEntId, int nFlag) const nParentId = m_pGeomDB->GetParentId( nEntId) ; if ( m_pGeomDB->GetParentId( nParentId) == nClId) { // se richiesta successiva - if ( nFlag == MCH_TPM_AFTER) + if ( nStep > 0) nEntId = GetToolPreviewNext( m_pGeomDB, nEntId, nParentId) ; // se richiesta precedente - else if ( nFlag == MCH_TPM_BEFORE) + else if ( nStep < 0) nEntId = GetToolPreviewPrev( m_pGeomDB, nEntId, nParentId) ; } else diff --git a/Machining.h b/Machining.h index 1401b03..3979cc5 100644 --- a/Machining.h +++ b/Machining.h @@ -48,8 +48,9 @@ class Machining : public Operation bool GetStartPoint( Point3d& ptStart) const ; bool GetEndPoint( Point3d& ptEnd) const ; bool PrepareToolPreview( void) const ; - int ToolPreview( int nEntId, int nFlag) const ; bool RemoveToolPreview( void) const ; + int GetToolPreviewStepCount( void) const ; + int ToolPreview( int nEntId, int nStep) const ; protected : Machining( void) ; diff --git a/SawFinishing.cpp b/SawFinishing.cpp index 849b4ea..a249837 100644 --- a/SawFinishing.cpp +++ b/SawFinishing.cpp @@ -1880,7 +1880,6 @@ SawFinishing::ClassifySection( ICurve* pCrv, INTVECTOR& vnClass) { const ICurveComposite* pCompo = GetCurveComposite( pCrv) ; if ( pCompo != nullptr) { - int Ind = 0 ; const ICurve* pSimpCrv = pCompo->GetFirstCurve() ; while ( pSimpCrv != nullptr) { // analizzo la curva @@ -1898,7 +1897,6 @@ SawFinishing::ClassifySection( ICurve* pCrv, INTVECTOR& vnClass) else vnClass.push_back( CCL_FALL) ; // passo alla curva successiva - ++ Ind ; pSimpCrv = pCompo->GetNextCurve() ; } }