From 6e2b4036e8309157cfece9efe2f1cce391ef0f86 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 19 Mar 2018 18:24:17 +0000 Subject: [PATCH] EgtInterface 1.9c4 : - aggiunte interfacce per EgtSurfTmFacetAdjacencies e EgtSurfTmFacetsContact. --- API_GeoSnap.cpp | 51 ++++++++++++++++++++++++++++++++++++++++++++++++ EgtInterface.rc | Bin 11718 -> 11718 bytes 2 files changed, 51 insertions(+) diff --git a/API_GeoSnap.cpp b/API_GeoSnap.cpp index 33ad514..c376a88 100644 --- a/API_GeoSnap.cpp +++ b/API_GeoSnap.cpp @@ -504,10 +504,61 @@ __stdcall EgtSurfTmFacetNormVersor( int nId, int nFacet, int nRefId, double vtNo return TRUE ; } +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtSurfTmFacetAdjacencies( int nId, int nFacet, int*& vAdj, int* pnCount) +{ + // verifica parametri di ritorno + if ( &vAdj == nullptr || pnCount == nullptr) + return FALSE ; + // eseguo + INTMATRIX vTmp ; + if ( ! ExeSurfTmFacetAdjacencies( nId, nFacet, vTmp)) + return FALSE ; + // recupero il risultato + int nDim = 0 ; + for ( int i = 0 ; i < int( vTmp.size()) ; ++ i) + nDim += int( vTmp[i].size()) + 1 ; + vAdj = (int*) malloc( nDim * sizeof( int)) ; + if ( vAdj == nullptr) + return FALSE ; + int nCount = 0 ; + for ( int i = 0 ; i < int( vTmp.size()) ; ++ i) { + for ( int j = 0 ; j < int( vTmp[i].size()) ; ++ j) { + vAdj[nCount] = vTmp[i][j] ; + nCount ++ ; + } + vAdj[nCount] = - 2 ; + nCount ++ ; + } + *pnCount = nCount ; + return TRUE ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtSurfTmFacetsContact( int nId, int nF1, int nF2, int nRefId, bool* pbAdjac, double ptP1[3], double ptP2[3], double* pdAng) +{ + // verifica parametri di ritorno + if ( pbAdjac == nullptr || ptP1 == nullptr || ptP2 == nullptr || pdAng == nullptr) + return FALSE ; + // eseguo + Point3d ptMyP1, ptMyP2 ; + if ( ! ExeSurfTmFacetsContact( nId, nF1, nF2, nRefId, *pbAdjac, ptMyP1, ptMyP2, *pdAng)) + return FALSE ; + // assegno risultati + VEC_FROM_3D( ptP1, ptMyP1) + VEC_FROM_3D( ptP2, ptMyP2) + return TRUE ; +} + //---------------------------------------------------------------------------- BOOL __stdcall EgtTextNormVersor( int nId, int nRefId, double vtNorm[3]) { + // verifica parametro di ritorno + if ( vtNorm == nullptr) + return FALSE ; // recupero il vettore normale Vector3d vtTmp ; if ( ! ExeTextNormVersor( nId, nRefId, vtTmp)) diff --git a/EgtInterface.rc b/EgtInterface.rc index 782ca738e5e67933b4a184d6a99acea0764ec457..80bed40dd2b318ce5705bcc48ee7d1cf7934da91 100644 GIT binary patch delta 111 zcmX>WeJpyzFE&P#%^&$rGEF|hS;uHH`Jtfh<^rw;7OzIAO+TQQ4Xt~E@c}o07@$;z5oCK delta 111 zcmX>WeJpyzFE&Qw%^&$rGEF|hS;uHR`Jtfh<^rw;7OzIAO+TQQ4Xt~E@c}o07yS5wg3PC