diff --git a/API_General.cpp b/API_General.cpp index c56579e..3c0dc92 100644 --- a/API_General.cpp +++ b/API_General.cpp @@ -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 ; } diff --git a/API_GeoSnap.cpp b/API_GeoSnap.cpp index 4912904..d882e79 100644 --- a/API_GeoSnap.cpp +++ b/API_GeoSnap.cpp @@ -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 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 ; } //---------------------------------------------------------------------------- diff --git a/EgtInterface.rc b/EgtInterface.rc index 1420cf0..0686295 100644 Binary files a/EgtInterface.rc and b/EgtInterface.rc differ diff --git a/stdafx.h b/stdafx.h index 3938875..b3681f3 100644 --- a/stdafx.h +++ b/stdafx.h @@ -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")