EgtInterface 1.6c7 :

- aggiunto richiamo di EgtMachKernel
- possibilità di estendere curva in EgtCurveLengthAtPoint.
This commit is contained in:
Dario Sassi
2015-03-23 11:41:00 +00:00
parent 0966f86f9d
commit a7a5ed461c
4 changed files with 36 additions and 8 deletions
+9 -4
View File
@@ -17,9 +17,10 @@
#include "LUA_Base.h"
#include "/EgtDev/Include/EInAPI.h"
#include "/EgtDev/Include/EInDllMain.h"
#include "/EgtDev/Include/EGkDllMain.h"
#include "/EgtDev/Include/ENkDllMain.h"
#include "/EgtDev/Include/EGnDllMain.h"
#include "/EgtDev/Include/ENkDllMain.h"
#include "/EgtDev/Include/EMkDllMain.h"
#include "/EgtDev/Include/EGkDllMain.h"
#include "/EgtDev/Include/EExDllMain.h"
#include "/EgtDev/Include/EGrDllMain.h"
#include "/EgtDev/Include/EGnStringUtils.h"
@@ -55,6 +56,7 @@ __stdcall EgtInit( int nDebug, const wchar_t* sLogFile, const wchar_t* sLogMsg)
SetEGnLogger( s_pGenLog) ;
SetENkLogger( s_pGenLog) ;
SetEGkLogger( s_pGenLog) ;
SetEMkLogger( s_pGenLog) ;
SetEExLogger( s_pGenLog) ;
SetEGrLogger( s_pGenLog) ;
@@ -69,6 +71,7 @@ __stdcall EgtInit( int nDebug, const wchar_t* sLogFile, const wchar_t* sLogMsg)
LOG_INFO( s_pGenLog, GetEGnVersion())
LOG_INFO( s_pGenLog, GetENkVersion())
LOG_INFO( s_pGenLog, GetEGkVersion())
LOG_INFO( s_pGenLog, GetEMkVersion())
LOG_INFO( s_pGenLog, GetEExVersion())
LOG_INFO( s_pGenLog, GetEGrVersion())
// Info sul sistema
@@ -116,9 +119,11 @@ __stdcall EgtExit( void)
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSetKey( const wchar_t* sKey)
__stdcall EgtSetKey( const wchar_t* swKey)
{
SetEGkKey( LPSTR( WtoA( sKey))) ;
string sKey = WtoA( swKey) ;
SetEGkKey( sKey) ;
SetEMkKey( sKey) ;
return TRUE ;
}
+26 -4
View File
@@ -761,7 +761,7 @@ __stdcall EgtCurveLength( int nId, double* pdLen)
//----------------------------------------------------------------------------
BOOL
__stdcall EgtCurveLengthAtPoint( int nId, double ptOn[3], double* pdLen)
__stdcall EgtCurveLengthAtPoint( int nId, double ptOn[3], double dExtend, double* pdLen)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
@@ -769,7 +769,7 @@ __stdcall EgtCurveLengthAtPoint( int nId, double ptOn[3], double* pdLen)
if ( pdLen == nullptr)
return FALSE ;
// recupero la curva
ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ;
const ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ;
if ( pCurve == nullptr)
return FALSE ;
// determino la posizione parametrica del punto sulla curva (con tolleranza)
@@ -777,8 +777,30 @@ __stdcall EgtCurveLengthAtPoint( int nId, double ptOn[3], double* pdLen)
double dU ;
if ( ! DistPointCurve( ptOn, *pCurve).GetParamAtMinDistPoint( 0, dU, nFlag) || nFlag != MDPCI_NORMAL)
return FALSE ;
// recupero la lunghezza alla posizione parametrica
return ( pCurve->GetLengthAtParam( dU, *pdLen) ? TRUE : FALSE) ;
// se non richiesta estensione o punto interno alla curva, recupero la lunghezza alla posizione parametrica
if ( dExtend < EPS_SMALL ||
( ! pCurve->IsStartParam( dU) && ! pCurve->IsEndParam( dU)))
return ( pCurve->GetLengthAtParam( dU, *pdLen) ? TRUE : FALSE) ;
// allungo la curva dalla parte del punto
PtrOwner<ICurve> pCopy( pCurve->Clone()) ;
if ( IsNull( pCopy))
return FALSE ;
double dDeltaIni ;
if ( pCopy->IsStartParam( dU)) {
pCopy->ExtendStartByLen( dExtend) ;
dDeltaIni = dExtend ;
}
else {
pCopy->ExtendEndByLen( dExtend) ;
dDeltaIni = 0 ;
}
if ( ! DistPointCurve( ptOn, *pCopy).GetParamAtMinDistPoint( 0, dU, nFlag) || nFlag != MDPCI_NORMAL)
return FALSE ;
if ( pCopy->GetLengthAtParam( dU, *pdLen)) {
*pdLen -= dDeltaIni ;
return TRUE ;
}
return FALSE ;
}
//----------------------------------------------------------------------------
BIN
View File
Binary file not shown.
+1
View File
@@ -31,6 +31,7 @@
#pragma comment(lib, EGTLIBDIR "EgtGeneral" EGTLIBVER ".lib")
#pragma comment(lib, EGTLIBDIR "EgtNumKernel" EGTLIBVER ".lib")
#pragma comment(lib, EGTLIBDIR "EgtGeomKernel" EGTLIBVER ".lib")
#pragma comment(lib, EGTLIBDIR "EgtMachKernel" EGTLIBVER ".lib")
#pragma comment(lib, EGTLIBDIR "EgtExchange" EGTLIBVER ".lib")
#pragma comment(lib, EGTLIBDIR "EgtGraphics" EGTLIBVER ".lib")
#pragma comment(lib, EGTEXTDIR "Lua/Lib/Lua52" EGTLIBVER ".lib")