EgtExecutor 1.6f1 :

- corretto errore in trim/extend di curve chiuse
- aggiunta ExeCurveDomain
- aggiunta ExeCurveNearestExtremityToPoint
- modificata ExeGetMinDistPointCurve (aggiunto un parametro).
This commit is contained in:
Dario Sassi
2015-06-06 17:55:02 +00:00
parent e2b54a993b
commit 487f2b68ce
5 changed files with 80 additions and 7 deletions
+37 -3
View File
@@ -573,6 +573,23 @@ ExeFrame( int nId, int nRefId, Frame3d& frFrame)
return false ;
}
//----------------------------------------------------------------------------
bool
ExeCurveDomain( int nId, double* pdStart, double* pdEnd)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// verifico i parametri
if ( pdStart == nullptr || pdEnd == nullptr)
return false ;
// recupero la curva
ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ;
if ( pCurve == nullptr)
return false ;
// recupero il dominio
return pCurve->GetDomain( *pdEnd, *pdEnd) ;
}
//----------------------------------------------------------------------------
bool
ExeCurveLength( int nId, double* pdLen)
@@ -634,6 +651,18 @@ ExeCurveLengthAtPoint( int nId, const Point3d& ptOn, double dExtend, double* pdL
return false ;
}
//----------------------------------------------------------------------------
bool
ExeCurveNearestExtremityToPoint( int nId, const Point3d& ptP, bool& bStart)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// recupero la curva
ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ;
// recupero quale estremo è più vicino al punto
return ( pCurve != nullptr && pCurve->GetNearestExtremityToPoint( ptP, bStart)) ;
}
//----------------------------------------------------------------------------
bool
ExeCurveExtrusion( int nId, int nRefId, Vector3d& vtExtr)
@@ -666,11 +695,11 @@ ExeCurveThickness( int nId, double* pdThick)
//----------------------------------------------------------------------------
bool
ExeGetMinDistPointCurve( const Point3d& ptP, int nId, double* pdDist)
ExeGetMinDistPointCurve( const Point3d& ptP, int nId, double* pdDist, double* pdU)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// verifico i parametri
// verifico il primo parametro di ritorno obbligatorio
if ( pdDist == nullptr)
return false ;
// recupero la curva
@@ -678,8 +707,13 @@ ExeGetMinDistPointCurve( const Point3d& ptP, int nId, double* pdDist)
if ( pCurve == nullptr)
return false ;
// calcolo la minima distanza
int nFlag ;
DistPointCurve distPC( ptP, *pCurve) ;
return distPC.GetDist( *pdDist) ;
if ( ! distPC.GetDist( *pdDist))
return false ;
if ( pdU != nullptr && ! distPC.GetParamAtMinDistPoint( 0, *pdU, nFlag))
return false ;
return true ;
}
//----------------------------------------------------------------------------