//---------------------------------------------------------------------------- // 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 ; }