EgtGeomKernel :
- aggiunta gestione parti connesse in SurfTriMesh.
This commit is contained in:
@@ -2165,6 +2165,15 @@ GdbExecutor::ExecuteSurfTriMesh( const string& sCmd2, const STRVECTOR& vsParams)
|
||||
else if ( sCmd2 == "SEW" || sCmd2 == "DOSEWING") {
|
||||
return SurfTriMeshDoSewing( vsParams) ;
|
||||
}
|
||||
else if ( sCmd2 == "CHECKCONNECTION") {
|
||||
return SurfTrimeshCheckConnection( vsParams) ;
|
||||
}
|
||||
else if ( sCmd2 == "REMOVEPART") {
|
||||
return SurfTrimeshRemovePart( vsParams) ;
|
||||
}
|
||||
else if ( sCmd2 == "CLONEPART") {
|
||||
return SurfTrimeshClonePart( vsParams) ;
|
||||
}
|
||||
else
|
||||
return false ;
|
||||
}
|
||||
@@ -2575,6 +2584,71 @@ GdbExecutor::SurfTriMeshDoSewing( const STRVECTOR& vsParams)
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbExecutor::SurfTrimeshCheckConnection( const STRVECTOR& vsParams)
|
||||
{
|
||||
// Parametri: SurfId
|
||||
if ( vsParams.size() != 1)
|
||||
return false ;
|
||||
// recupero id superficie
|
||||
int nIdSurf = GetIdParam( vsParams[0]) ;
|
||||
ISurfTriMesh* pStmM = GetSurfTriMesh( m_pGDB->GetGeoObj( nIdSurf)) ;
|
||||
SurfTriMesh* pStmF = static_cast <SurfTriMesh*> ( pStmM) ;
|
||||
int nCompo = pStmF->GetPartCount() ;
|
||||
m_pGDB->SetInfo( nIdSurf, "CompoCount", nCompo) ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbExecutor::SurfTrimeshRemovePart( const STRVECTOR& vsParams)
|
||||
{
|
||||
// Parametri: SurfId, nPart
|
||||
if ( vsParams.size() != 2)
|
||||
return false ;
|
||||
// Recupero Id superficie
|
||||
int nIdSurf = GetIdParam( vsParams[0]) ;
|
||||
ISurfTriMesh* pStmM = GetSurfTriMesh( m_pGDB->GetGeoObj( nIdSurf)) ;
|
||||
SurfTriMesh* pStmF = static_cast <SurfTriMesh*> ( pStmM) ;
|
||||
// Recupero parte da rimuovere
|
||||
int nPart ;
|
||||
if ( ! FromString( vsParams[1], nPart))
|
||||
return false ;
|
||||
if ( ! pStmF->RemovePart( nPart))
|
||||
return false ;
|
||||
/*const*/ STRVECTOR vsNewParams ;
|
||||
vsNewParams.emplace_back( vsParams[0]) ;
|
||||
SurfTrimeshCheckConnection( vsNewParams) ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbExecutor::SurfTrimeshClonePart( const STRVECTOR& vsParams)
|
||||
{
|
||||
// Parametri : IdNew, IdOld, IdParent, nPart
|
||||
if ( vsParams.size() != 4)
|
||||
return false ;
|
||||
// Recupero il riferimento in cui è immerso
|
||||
Frame3d frRef ;
|
||||
if ( ! m_pGDB->GetGroupGlobFrame( GetIdParam( vsParams[2]), frRef))
|
||||
return false ;
|
||||
// Recupero parte da rimuovere
|
||||
int nPart ;
|
||||
if ( ! FromString( vsParams[3], nPart))
|
||||
return false ;
|
||||
// Recupero id superficie vecchia
|
||||
int nIdSurf = GetIdParam( vsParams[1]) ;
|
||||
SurfTriMesh* pSurf = GetBasicSurfTriMesh( m_pGDB->GetGeoObj( nIdSurf)) ;
|
||||
if ( pSurf == nullptr)
|
||||
return false ;
|
||||
// Clono la componente
|
||||
PtrOwner<SurfTriMesh> pNewSurf( pSurf->ClonePart( nPart)) ;
|
||||
// Inserisco nel DB
|
||||
return AddGeoObj(vsParams[0], vsParams[2], Release( pNewSurf)) ;
|
||||
}
|
||||
|
||||
/*
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
|
||||
Reference in New Issue
Block a user