diff --git a/EgtGeomKernel.rc b/EgtGeomKernel.rc index ca2995d..a74eb38 100644 Binary files a/EgtGeomKernel.rc and b/EgtGeomKernel.rc differ diff --git a/GeomDB.cpp b/GeomDB.cpp index 68094f1..cc36d75 100644 --- a/GeomDB.cpp +++ b/GeomDB.cpp @@ -1209,8 +1209,7 @@ GeomDB::Erase( int nId) return false ; // recupero l'oggetto - GdbObj* pGdbObj ; - pGdbObj = m_IdManager.FindObj( nId) ; + GdbObj* pGdbObj = m_IdManager.FindObj( nId) ; if ( pGdbObj == nullptr) return false ; @@ -1234,6 +1233,27 @@ GeomDB::Erase( GdbObj* pGdbObj) return true ; } +//---------------------------------------------------------------------------- +IGeoObj* +GeomDB::RemoveGeoObjAndErase( int nId) +{ + // non si può cancellare il gruppo radice (escludo anche Id non validi) + if ( nId <= GDB_ID_ROOT) + return nullptr ; + // recupero l'oggetto geometrico + GdbGeo* pGdbGeo = ::GetGdbGeo( m_IdManager.FindObj( nId)) ; + if ( pGdbGeo == nullptr) + return nullptr ; + IGeoObj* pGeoObj = pGdbGeo->m_pGeoObj ; + // annullo il riferimento alla geometria nell'entità + pGdbGeo->m_pGeoObj = nullptr ; + // tolgo dalla lista e disalloco + pGdbGeo->Remove() ; + delete pGdbGeo ; + + return pGeoObj ; +} + //---------------------------------------------------------------------------- bool GeomDB::EmptyGroup( int nId) diff --git a/GeomDB.h b/GeomDB.h index 03e6596..b3b94c9 100644 --- a/GeomDB.h +++ b/GeomDB.h @@ -81,8 +81,9 @@ class GeomDB : public IGeomDB virtual int GetNewId( void) const ; virtual bool ChangeId( int nId, int nNewId) ; virtual bool Erase( int nId) ; + virtual IGeoObj* RemoveGeoObjAndErase( int nId) ; virtual bool EmptyGroup( int nId) ; - // transformations + // Transformations virtual bool Translate( int nId, const Vector3d& vtMove) ; virtual bool TranslateGlob( int nId, const Vector3d& vtMove) ; virtual bool TranslateGroup( int nId, const Vector3d& vtMove) ; diff --git a/SfrCreate.cpp b/SfrCreate.cpp index 9bcdf49..a2a3a95 100644 --- a/SfrCreate.cpp +++ b/SfrCreate.cpp @@ -238,10 +238,23 @@ SurfFlatRegionByContours::GetSurf( void) bool SurfFlatRegionByContours::AllCurvesUsed( void) { - // verifico se cono rimaste delle curve + // verifico se sono rimaste delle curve for ( auto& pCrv : m_vpCrv) { if ( pCrv != nullptr) - return true ; + return false ; } - return false ; + return true ; +} + +//------------------------------------------------------------------------------- +bool +SurfFlatRegionByContours::GetUnusedCurveTempProps( INTVECTOR& vId) +{ + vId.clear() ; + // verifico se sono rimaste delle curve + for ( auto& pCrv : m_vpCrv) { + if ( pCrv != nullptr) + vId.push_back( pCrv->GetTempProp()) ; + } + return ( ! vId.empty()) ; } \ No newline at end of file