EgtInterface 1.9c4 :

- aggiunte interfacce per EgtSurfTmFacetAdjacencies e EgtSurfTmFacetsContact.
This commit is contained in:
Dario Sassi
2018-03-19 18:24:17 +00:00
parent 91c10b08bd
commit 6e2b4036e8
2 changed files with 51 additions and 0 deletions
+51
View File
@@ -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))