From 0c50ffc3309ff97cd130d5d125a5a9d0763cc1ca Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 17 Dec 2018 11:31:29 +0000 Subject: [PATCH] EgtInterface 1.9l2 : - modifiche a interfacce EgtPointCurveDist, EgtPointCurveDistSide (prima erano EgtGetMinDistPointCurve e EgtGetMinDistPntSidePointCurve) - aggiunta interfaccia per EgtPointSurfTmDist - modifiche a interfaccia EgtLineSurfTmInters (prima era EgtSurfTmLineInters). --- API_GeoDist.cpp | 55 ++++++++++++++++++++++++++++++++++ API_GeoInters.cpp | 55 ++++++++++++++++++++++++++++++++++ API_GeoSnap.cpp | 56 ----------------------------------- EgtInterface.rc | Bin 11726 -> 11726 bytes EgtInterface.vcxproj | 2 ++ EgtInterface.vcxproj.filters | 6 ++++ 6 files changed, 118 insertions(+), 56 deletions(-) create mode 100644 API_GeoDist.cpp create mode 100644 API_GeoInters.cpp diff --git a/API_GeoDist.cpp b/API_GeoDist.cpp new file mode 100644 index 0000000..581011d --- /dev/null +++ b/API_GeoDist.cpp @@ -0,0 +1,55 @@ +//---------------------------------------------------------------------------- +// EgalTech 2018-2018 +//---------------------------------------------------------------------------- +// File : API_GeoDist.cpp Data : 15.12.18 Versione : 1.9l2 +// Contenuto : Funzioni di distanza tra oggetti del DB geometrico per API. +// +// +// +// Modifiche : 15.12.18 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +//--------------------------- Include ---------------------------------------- +#include "stdafx.h" +#include "API.h" +#include "/EgtDev/Include/EInAPI.h" +#include "/EgtDev/Include/EXeExecutor.h" + +using namespace std ; + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtPointCurveDist( const double ptP[3], int nId, int nRefType, double* pdDist, double* pdU) +{ + Point3d ptTemp ; + return ( ExePointCurveDist( ptP, nId, nRefType, pdDist, ptTemp, pdU) ? TRUE : FALSE) ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtPointCurveDistSide( const double ptP[3], int nId, const double vtN[3], int nRefType, + double* pdDist, double ptMin[3], int* pnSide) +{ + if ( pdDist == nullptr || ptMin == nullptr || pnSide == nullptr) + return FALSE ; + Point3d ptTmp ; + if ( ! ExePointCurveDistSide( ptP, nId, vtN, nRefType, pdDist, ptTmp, pnSide)) + return FALSE ; + VEC_FROM_3D( ptMin, ptTmp) + return TRUE ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtPointSurfTmDist( const double ptP[3], int nId, int nRefType, double* pdDist, double ptMin[3], int* pnTria) +{ + if ( pdDist == nullptr || ptMin == nullptr || pnTria == nullptr) + return FALSE ; + Point3d ptTmp ; + if ( ! ExePointSurfTmDist( ptP, nId, nRefType, pdDist, ptTmp, pnTria)) + return FALSE ; + VEC_FROM_3D( ptMin, ptTmp) + return TRUE ; +} diff --git a/API_GeoInters.cpp b/API_GeoInters.cpp new file mode 100644 index 0000000..08ef8f5 --- /dev/null +++ b/API_GeoInters.cpp @@ -0,0 +1,55 @@ +//---------------------------------------------------------------------------- +// EgalTech 2018-2018 +//---------------------------------------------------------------------------- +// File : API_GeoInters.cpp Data : 15.12.18 Versione : 1.9l2 +// Contenuto : Funzioni intersezione tra oggetti del DB geometrico per API. +// +// +// +// Modifiche : 15.12.18 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +//--------------------------- Include ---------------------------------------- +#include "stdafx.h" +#include "API.h" +#include "/EgtDev/Include/EInAPI.h" +#include "/EgtDev/Include/EXeExecutor.h" + +using namespace std ; + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtLineSurfTmInters( const double ptP[3], const double vtDir[3], int nId, int nRefType, int*& vFlagInters, double*& vParInters, int* pnCount) +{ + // verifica parametri + if ( ptP == nullptr || vtDir == nullptr || &vFlagInters == nullptr || &vParInters == nullptr || pnCount == nullptr) + return FALSE ; + // eseguo intersezione + INTDBLVECTOR vInters ; + if ( ! ExeLineSurfTmInters( ptP, vtDir, nId, nRefType, vInters)) + return FALSE ; + // assegno risultati + int nDim = int( vInters.size()) ; + if ( nDim == 0) { + vFlagInters = nullptr ; + vParInters = nullptr ; + } + else { + vFlagInters = (int*) malloc( nDim * sizeof( int)) ; + if ( vFlagInters == nullptr) + return FALSE ; + vParInters = (double*) malloc( nDim * sizeof( double)) ; + if ( vParInters == nullptr) { + free( vFlagInters) ; + return FALSE ; + } + for ( int i = 0 ; i < nDim ; ++ i) { + vFlagInters[i] = vInters[i].first ; + vParInters[i] = vInters[i].second ; + } + } + *pnCount = nDim ; + return TRUE ; +} diff --git a/API_GeoSnap.cpp b/API_GeoSnap.cpp index 3c7ce21..be8e105 100644 --- a/API_GeoSnap.cpp +++ b/API_GeoSnap.cpp @@ -335,27 +335,6 @@ __stdcall EgtClosedCurveClassify( int nId1, int nId2) return ExeClosedCurveClassify( nId1, nId2) ; } -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtGetMinDistPointCurve( const double ptP[3], int nId, double* pdDist, double* pdU) -{ - return ( ExeGetMinDistPointCurve( ptP, nId, pdDist, pdU) ? TRUE : FALSE) ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtGetMinDistPntSidePointCurve( const double ptP[3], int nId, const double vtN[3], - double* pdDist, double ptMin[3], int* pnSide) -{ - if ( pdDist == nullptr || ptMin == nullptr || pnSide == nullptr) - return FALSE ; - Point3d ptTmp ; - if ( ! ExeGetMinDistPntSidePointCurve( ptP, nId, vtN, pdDist, ptTmp, pnSide)) - return FALSE ; - VEC_FROM_3D( ptMin, ptTmp) - return TRUE ; -} - //---------------------------------------------------------------------------- BOOL __stdcall EgtArcRadius( int nId, double* pdRad) @@ -576,41 +555,6 @@ __stdcall EgtSurfTmFacetsContact( int nId, int nF1, int nF2, int nRefId, bool* p return TRUE ; } -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtSurfTmLineInters( int nId, const double ptP[3], const double vtDir[3], int nRefType, int*& vFlagInters, double*& vParInters, int* pnCount) -{ - // verifica parametri - if ( ptP == nullptr || vtDir == nullptr || &vFlagInters == nullptr || &vParInters == nullptr || pnCount == nullptr) - return FALSE ; - // eseguo intersezione - INTDBLVECTOR vInters ; - if ( ! ExeSurfTmLineInters( nId, ptP, vtDir, nRefType, vInters)) - return FALSE ; - // assegno risultati - int nDim = int( vInters.size()) ; - if ( nDim == 0) { - vFlagInters = nullptr ; - vParInters = nullptr ; - } - else { - vFlagInters = (int*) malloc( nDim * sizeof( int)) ; - if ( vFlagInters == nullptr) - return FALSE ; - vParInters = (double*) malloc( nDim * sizeof( double)) ; - if ( vParInters == nullptr) { - free( vFlagInters) ; - return FALSE ; - } - for ( int i = 0 ; i < nDim ; ++ i) { - vFlagInters[i] = vInters[i].first ; - vParInters[i] = vInters[i].second ; - } - } - *pnCount = nDim ; - return TRUE ; -} - //---------------------------------------------------------------------------- BOOL __stdcall EgtTextNormVersor( int nId, int nRefId, double vtNorm[3]) diff --git a/EgtInterface.rc b/EgtInterface.rc index 6caac59be6871bd4b983767f6d785287082da202..baa0b3861a96dbe315154df714809018ce4dcd09 100644 GIT binary patch delta 113 zcmX>XeJ*;#A2vp#%@4(HGEKh5na5}}`6H+9WG^L)&3#f*jGK>e8!&^VPclv3Cs+lM i-t491#khHcFjUGNr~*ls7YjlI&*XKAP&0v=TDSp?WhmtU delta 113 zcmX>XeJ*;#A2vqA%@4(HGEKh5na5~2`6H+9WG^L)&3#f*jGK>e8!&^VPclv3Cs+lM i-t491#khHcFjUGNr~*ls7YjlI&*XKAP&0v=TDSp=n<(7? diff --git a/EgtInterface.vcxproj b/EgtInterface.vcxproj index a710b71..e084fe3 100644 --- a/EgtInterface.vcxproj +++ b/EgtInterface.vcxproj @@ -227,6 +227,8 @@ copy $(TargetPath) \EgtProg\Dll64 + + diff --git a/EgtInterface.vcxproj.filters b/EgtInterface.vcxproj.filters index 8a0061d..be6ce9a 100644 --- a/EgtInterface.vcxproj.filters +++ b/EgtInterface.vcxproj.filters @@ -125,6 +125,12 @@ File di origine\API + + File di origine\API + + + File di origine\API +