EgtInterface 1.9l2 :
- modifiche a interfacce EgtPointCurveDist, EgtPointCurveDistSide (prima erano EgtGetMinDistPointCurve e EgtGetMinDistPntSidePointCurve) - aggiunta interfaccia per EgtPointSurfTmDist - modifiche a interfaccia EgtLineSurfTmInters (prima era EgtSurfTmLineInters).
This commit is contained in:
@@ -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 ;
|
||||
}
|
||||
@@ -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 ;
|
||||
}
|
||||
@@ -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])
|
||||
|
||||
Binary file not shown.
@@ -227,6 +227,8 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
|
||||
<ClCompile Include="API_General.cpp" />
|
||||
<ClCompile Include="API_GdbCreate.cpp" />
|
||||
<ClCompile Include="API_GeoBase.cpp" />
|
||||
<ClCompile Include="API_GeoDist.cpp" />
|
||||
<ClCompile Include="API_GeoInters.cpp" />
|
||||
<ClCompile Include="API_GeomDB.cpp" />
|
||||
<ClCompile Include="API_GeoSnap.cpp" />
|
||||
<ClCompile Include="API_GeoTransform.cpp" />
|
||||
|
||||
@@ -125,6 +125,12 @@
|
||||
<ClCompile Include="API_Image.cpp">
|
||||
<Filter>File di origine\API</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="API_GeoDist.cpp">
|
||||
<Filter>File di origine\API</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="API_GeoInters.cpp">
|
||||
<Filter>File di origine\API</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="EgtInterface.rc">
|
||||
|
||||
Reference in New Issue
Block a user