EgtExecutor 1.6f3 :

- eliminata ExeCreateCurveCompoByApprox
- le diverse ExeApproxCurve riunite in una sola
- aggiunta ExeMergeCurvesInCurveCompo
- riportate le medesime modifiche in lua.
This commit is contained in:
Dario Sassi
2015-06-21 17:01:26 +00:00
parent 7f9a18849b
commit ff53dcb8e3
8 changed files with 99 additions and 186 deletions
+6 -57
View File
@@ -929,6 +929,12 @@ ExeCreateCurveArc3P( int nParentId, const Point3d& ptP1,
bOk = bOk && ! ( IsNull( pCrv)) ;
// assegno il versore estrusione
bOk = bOk && pCrv->SetExtrusion( vtExtrL) ;
// se arco, verifico che normale al suo piano e versore estrusione non siano controversi
if ( bOk && pCrv->GetType() == CRV_ARC) {
ICurveArc* pArc = GetCurveArc( Get( pCrv)) ;
if ( ( pArc->GetNormVersor() * vtExtrL) < 0)
pArc->InvertN() ;
}
// inserisco l'arco nel DB
int nId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pCrv)) : GDB_ID_NULL) ;
ExeSetModified() ;
@@ -1658,63 +1664,6 @@ ExeCreateCurveCompoFromPointBulges( int nParentId, const PolyArc& PA, int nRefTy
return nId ;
}
//-------------------------------------------------------------------------------
int
ExeCreateCurveCompoByApprox( int nParentId, int nSouId, bool bArcsVsLines, double dLinTol)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
bool bOk = true ;
// recupero il riferimento di inserimento
Frame3d frEnt ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frEnt) ;
// recupero la curva in locale
CurveLocal CrvLoc( pGeomDB, nSouId, frEnt) ;
bOk = bOk && ( CrvLoc.Get() != nullptr) ;
// eseguo l'approssimazione
PtrOwner<ICurveComposite> pCC( CreateCurveComposite()) ;
bOk = bOk && ! IsNull( pCC) ;
const double ANG_TOL_STD_DEG = 15 ;
if ( ! bArcsVsLines) { // con linee
PolyLine PL ;
bOk = bOk && CrvLoc.Get()->ApproxWithLines( dLinTol, ANG_TOL_STD_DEG, PL) && pCC->FromPolyLine( PL) ;
}
else { // con bi-archi
PolyArc PA ;
bOk = bOk && CrvLoc.Get()->ApproxWithArcs( dLinTol, ANG_TOL_STD_DEG, PA) && pCC->FromPolyArc( PA) ;
}
// copio estrusione e spessore della curva sorgente
const ICurve* pSouCrv = GetCurve( pGeomDB->GetGeoObj( nSouId)) ;
if ( bOk && pSouCrv != nullptr) {
// recupero estrusione e spessore
Vector3d vtExtr ;
pSouCrv->GetExtrusion( vtExtr) ;
double dThick ;
pSouCrv->GetThickness( dThick) ;
// sistemo per eventuale cambio di riferimento
Frame3d frSou ;
bOk = bOk && pGeomDB->GetGlobFrame( nSouId, frSou) ;
vtExtr.LocToLoc( frSou, frEnt) ;
// assegno
pCC->SetExtrusion( vtExtr) ;
pCC->SetThickness( dThick) ;
}
// inserisco la curva composita nel DB
int nId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pCC)) : GDB_ID_NULL) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtCurveCompoByApprox(" + ToString( nParentId) + "," +
ToString( nSouId) + "," +
( bArcsVsLines ? "GDB_CA.ARCS" : "GDB_CA.LINES") + "," +
ToString( dLinTol) + ")" +
" -- Id=" + ToString( nId) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco l'identificativo della nuova entità
return nId ;
}
//-------------------------------------------------------------------------------
int
ExeCreateRectangle3P( int nParentId, const Point3d& ptIni,