EgtInterface 1.6c3 :

- aggiunta gestione cambio inizio di curva chiusa
- corretta funzione lua EgtArc2PVNEx.
This commit is contained in:
Dario Sassi
2015-03-16 14:16:21 +00:00
parent 4fe226fd74
commit 10814a2d04
4 changed files with 62 additions and 3 deletions
+40
View File
@@ -103,6 +103,46 @@ __stdcall EgtOffsetCurve( int nId, double dDist, int nType)
return ( bOk ? TRUE : FALSE) ;
}
//----------------------------------------------------------------------------
BOOL
__stdcall EgtChangeClosedCurveStartPoint( int nId, const double ptP[3], int nRefType)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
bool bOk = true ;
// recupero la curva
ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ;
bOk = bOk && ( pCurve != nullptr) ;
// recupero il riferimento locale
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGlobFrame( nId, frLoc) ;
// porto in locale il punto vicino ad iniziale
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ;
// recupero la posizione parametrica della proiezione di questo punto sulla curva
DistPointCurve distPC( ptPL, *pCurve) ;
double dPar ;
int nFlag ;
bOk = bOk && distPC.GetParamAtMinDistPoint( 0, dPar, nFlag) ;
// cambio il punto iniziale
if ( bOk && pCurve->GetType() == CRV_ARC)
bOk = bOk && dynamic_cast<ICurveArc*>(pCurve)->ChangeStartPoint(dPar) ;
else if ( bOk && pCurve->GetType() == CRV_COMPO)
bOk = bOk && dynamic_cast<ICurveComposite*>(pCurve)->ChangeStartPoint(dPar) ;
else
bOk = false ;
EgtSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtChangeClosedCurveStartPoint(" + ToString( nId) + ",{" +
ToString( Point3d( ptP)) + "}," +
RefTypeToString( nRefType) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return ( bOk ? TRUE : FALSE) ;
}
//----------------------------------------------------------------------------
BOOL
__stdcall EgtModifyCurveStartPoint( int nId, const double ptP[3], int nRefType)