EgtMachKernel :
- nella lavorazione di Finitura Superfici è ora specificare quali superfici considerare (se non si specificano sono considerate tutte).
This commit is contained in:
+43
-19
@@ -840,28 +840,39 @@ bool
|
||||
SurfFinishing::VerifyGeometry( SelData Id, int& nSubs)
|
||||
{
|
||||
// ammessi : curve o superfici
|
||||
|
||||
// per ora accetto solo curve
|
||||
const ICurve* pCurve = nullptr ;
|
||||
const IGeoObj* pGObj = m_pGeomDB->GetGeoObj( Id.nId) ;
|
||||
// se direttamente la curva
|
||||
if ( Id.nSub == SEL_SUB_ALL) {
|
||||
pCurve = ::GetCurve( pGObj) ;
|
||||
if ( pCurve != nullptr) {
|
||||
if ( pCurve->GetType() == CRV_COMPO)
|
||||
nSubs = ::GetCurveComposite( pCurve)->GetCurveCount() ;
|
||||
else
|
||||
nSubs = 0 ;
|
||||
if ( pGObj == nullptr)
|
||||
return false ;
|
||||
// se curva
|
||||
if ( ( pGObj->GetType() & GEO_CURVE) != 0) {
|
||||
const ICurve* pCurve = nullptr ;
|
||||
// se direttamente la curva
|
||||
if ( Id.nSub == SEL_SUB_ALL) {
|
||||
pCurve = ::GetCurve( pGObj) ;
|
||||
if ( pCurve != nullptr) {
|
||||
if ( pCurve->GetType() == CRV_COMPO)
|
||||
nSubs = ::GetCurveComposite( pCurve)->GetCurveCount() ;
|
||||
else
|
||||
nSubs = 0 ;
|
||||
}
|
||||
}
|
||||
// altrimenti sottocurva di composita
|
||||
else {
|
||||
const ICurveComposite* pCompo = GetCurveComposite( pGObj) ;
|
||||
if ( pCompo != nullptr)
|
||||
pCurve = pCompo->GetCurve( Id.nSub) ;
|
||||
nSubs = 0 ;
|
||||
}
|
||||
return ( pCurve != nullptr) ;
|
||||
}
|
||||
// altrimenti sottocurva di composita
|
||||
else {
|
||||
const ICurveComposite* pCompo = GetCurveComposite( pGObj) ;
|
||||
if ( pCompo != nullptr)
|
||||
pCurve = pCompo->GetCurve( Id.nSub) ;
|
||||
nSubs = 0 ;
|
||||
// se altrimenti è superficie trimesh
|
||||
else if ( pGObj->GetType() == SRF_TRIMESH) {
|
||||
const ISurfTriMesh* pSurf = ::GetSurfTriMesh( pGObj) ;
|
||||
return ( pSurf != nullptr && pSurf->GetFacetCount() >= 1) ;
|
||||
}
|
||||
return ( pCurve != nullptr) ;
|
||||
// altrimenti errore
|
||||
else
|
||||
return false ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -921,6 +932,10 @@ SurfFinishing::GetCurves( SelData Id, ICURVEPLIST& lstPC)
|
||||
lstPC.emplace_back( Release( pCurve)) ;
|
||||
return true ;
|
||||
}
|
||||
// se altrimenti superficie
|
||||
else if ( pGObj->GetType() == SRF_TRIMESH)
|
||||
return true ;
|
||||
// altrimenti errore
|
||||
else
|
||||
return false ;
|
||||
}
|
||||
@@ -1222,7 +1237,16 @@ SurfFinishing::GetActiveSurfaces( INTVECTOR& vSurfId) const
|
||||
// verifiche
|
||||
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// ciclo sui grezzi attivi nella fase
|
||||
// cerco tra gli oggetti selezionati
|
||||
for ( const auto& Id : m_vId) {
|
||||
int nEntId = Id.nId ;
|
||||
if ( m_pGeomDB->GetGeoType( nEntId) == SRF_TRIMESH)
|
||||
vSurfId.emplace_back( nEntId) ;
|
||||
}
|
||||
// se trovate superfici, considero solo queste ed esco
|
||||
if ( ! vSurfId.empty())
|
||||
return true ;
|
||||
// altrimenti considero tutte le superfici dei pezzi nei grezzi attivi della fase
|
||||
int nRawId = m_pMchMgr->GetFirstRawPart() ;
|
||||
while ( nRawId != GDB_ID_NULL) {
|
||||
if ( m_pMchMgr->VerifyRawPartPhase(nRawId, m_nPhase)) {
|
||||
|
||||
Reference in New Issue
Block a user