diff --git a/API_GdbGet.cpp b/API_GdbGet.cpp new file mode 100644 index 0000000..1ede5e0 --- /dev/null +++ b/API_GdbGet.cpp @@ -0,0 +1,86 @@ +//---------------------------------------------------------------------------- +// EgalTech 2020-2020 +//---------------------------------------------------------------------------- +// File : API_GdbGet.cpp Data : 30.03.20 Versione : 2.2c3 +// Contenuto : Funzioni di interrogazione geometrie varie per API. +// +// +// +// Modifiche : 30.03.20 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +//--------------------------- Include ---------------------------------------- +#include "stdafx.h" +#include "API.h" +#include "/EgtDev/Include/EInAPI.h" +#include "/EgtDev/Include/EXeExecutor.h" +#include "/EgtDev/Include/EgtStringConverter.h" +#include + +using namespace std ; + +//---------------------------------------------------------------------------- +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)) + return FALSE ; + // lo assegno + VEC_FROM_3D( vtNorm, vtTmp) + return TRUE ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtTextGetContent( int nId, wchar_t*& wsText) +{ + if ( &wsText == nullptr) + return FALSE ; + string sText ; + if ( ! ExeTextGetContent( nId, sText)) + return FALSE ; + wsText = _wcsdup( stringtoW( sText)) ; + return (( wsText == nullptr) ? FALSE : TRUE) ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtTextGetFont( int nId, wchar_t*& wsFont) +{ + if ( &wsFont == nullptr) + return FALSE ; + string sFont ; + if ( ! ExeTextGetFont( nId, sFont)) + return FALSE ; + wsFont = _wcsdup( stringtoW( sFont)) ; + return (( wsFont == nullptr) ? FALSE : TRUE) ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtTextGetHeight( int nId, double* pdH) +{ + if ( pdH == nullptr) + return FALSE ; + return ( ExeTextGetHeight( nId, *pdH) ? TRUE : FALSE) ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtTextGetItalic( int nId, BOOL* pbItl) +{ + if ( pbItl == nullptr) + return FALSE ; + bool bItl ; + if ( ! ExeTextGetItalic( nId, bItl)) + return FALSE ; + *pbItl = ( bItl ? TRUE : FALSE) ; + return TRUE ; +} diff --git a/API_GdbGetCurve.cpp b/API_GdbGetCurve.cpp new file mode 100644 index 0000000..d5e56cb --- /dev/null +++ b/API_GdbGetCurve.cpp @@ -0,0 +1,206 @@ +//---------------------------------------------------------------------------- +// EgalTech 2020-2020 +//---------------------------------------------------------------------------- +// File : API_GetCurve.cpp Data : 30.03.20 Versione : 2.2c3 +// Contenuto : Funzioni di interrogazione delle curve per API. +// +// +// +// Modifiche : 30.03.20 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 EgtCurveDomain( int nId, double* pdStart, double* pdEnd) +{ + return ( ExeCurveDomain( nId, pdStart, pdEnd) ? TRUE : FALSE) ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtCurveLength( int nId, double* pdLen) +{ + return ( ExeCurveLength( nId, pdLen) ? TRUE : FALSE) ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtCurveLengthAtPoint( int nId, const double ptOn[3], double dExtend, double* pdLen) +{ + return ( ExeCurveLengthAtPoint( nId, ptOn, dExtend, pdLen) ? TRUE : FALSE) ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtCurveIsClosed( int nId) +{ + return ( ExeCurveIsClosed( nId) ? TRUE : FALSE) ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtCurveIsFlat( int nId, double vtN[3], double* pdDist) +{ + if ( vtN == nullptr || pdDist == nullptr) + return FALSE ; + Plane3d Plane ; + if ( ! ExeCurveIsFlat( nId, Plane)) + return FALSE ; + VEC_FROM_3D( vtN, Plane.GetVersN()) + *pdDist = Plane.GetDist() ; + return TRUE ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtCurveAreaXY( int nId, double* pdArea) +{ + return ( ExeCurveAreaXY( nId, *pdArea) ? TRUE : FALSE) ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtCurveArea( int nId, double vtN[3], double* pdDist, double* pdArea) +{ + if ( vtN == nullptr || pdDist == nullptr || pdArea == nullptr) + return FALSE ; + Plane3d Plane ; + if ( ! ExeCurveArea( nId, Plane, *pdArea)) + return FALSE ; + VEC_FROM_3D( vtN, Plane.GetVersN()) + *pdDist = Plane.GetDist() ; + return TRUE ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtCurveNearestExtremityToPoint( int nId, const double ptP[3], BOOL* pbStart) +{ + if ( pbStart == nullptr) + return FALSE ; + bool bStart ; + if ( ! ExeCurveNearestExtremityToPoint( nId, ptP, bStart)) + return FALSE ; + *pbStart = ( bStart ? TRUE : FALSE) ; + return TRUE ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtCurveExtrusion( int nId, int nRefId, double vtExtr[3]) +{ + // recupero il vettore estrusione + Vector3d vtTmp ; + if ( ! ExeCurveExtrusion( nId, nRefId, vtTmp)) + return FALSE ; + // lo assegno + VEC_FROM_3D( vtExtr, vtTmp) + return TRUE ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtCurveThickness( int nId, double* pdThick) +{ + return ( ExeCurveThickness( nId, pdThick) ? TRUE : FALSE) ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtCurveSelfIntersCount( int nId, int* pnCount) +{ + return ( ExeCurveSelfIntersCount( nId, pnCount) ? TRUE : FALSE) ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtCurveMinAreaRectangleXY( int nId, int nRefId, + double ptOrig[3], double vtX[3], double vtY[3], double vtZ[3], double* pdDimX, double* pdDimY) +{ + // eseguo calcoli + Frame3d frRect ; + double dDimX, dDimY ; + if ( ! ExeCurveMinAreaRectangleXY( nId, nRefId, frRect, dDimX, dDimY)) + return FALSE ; + // assegno l'origine + if ( ptOrig != nullptr) + VEC_FROM_3D( ptOrig, frRect.Orig()) + // assegno il versore X + if ( vtX != nullptr) + VEC_FROM_3D( vtX, frRect.VersX()) + // assegno il versore Y + if ( vtY != nullptr) + VEC_FROM_3D( vtY, frRect.VersY()) + // assegno il versore Z + if ( vtZ != nullptr) + VEC_FROM_3D( vtZ, frRect.VersZ()) + if ( pdDimX != nullptr) + *pdDimX = dDimX ; + if ( pdDimY != nullptr) + *pdDimY = dDimY ; + return TRUE ; +} + +//---------------------------------------------------------------------------- +int +__stdcall EgtClosedCurveClassify( int nId1, int nId2) +{ + return ExeClosedCurveClassify( nId1, nId2) ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtArcRadius( int nId, double* pdRad) +{ + return ( ExeArcRadius( nId, pdRad) ? TRUE : FALSE) ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtArcAngCenter( int nId, double* pdAngDeg) +{ + return ( ExeArcAngCenter( nId, pdAngDeg) ? TRUE : FALSE) ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtArcDeltaN( int nId, double* pdDeltaN) +{ + return ( ExeArcDeltaN( nId, pdDeltaN) ? TRUE : FALSE) ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtArcNormVersor( int nId, int nRefId, double vtNorm[3]) +{ + // recupero il vettore normale + Vector3d vtTmp ; + if ( ! ExeArcNormVersor( nId, nRefId, vtTmp)) + return FALSE ; + // lo assegno + VEC_FROM_3D( vtNorm, vtTmp) + return TRUE ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtCurveCompoCenter( int nId, int nSimpCrv, int nRefId, double ptCen[3]) +{ + // recupero il centro + Point3d ptTmp ; + if ( ! ExeCurveCompoCenter( nId, nSimpCrv, nRefId, ptTmp)) + return FALSE ; + // lo assegno + VEC_FROM_3D( ptCen, ptTmp) + return TRUE ; +} diff --git a/API_GdbGetSurf.cpp b/API_GdbGetSurf.cpp new file mode 100644 index 0000000..7651988 --- /dev/null +++ b/API_GdbGetSurf.cpp @@ -0,0 +1,248 @@ +//---------------------------------------------------------------------------- +// EgalTech 2020-2020 +//---------------------------------------------------------------------------- +// File : API_GdbGetSurf.cpp Data : 30.03.20 Versione : 2.2c3 +// Contenuto : Funzioni di interrogazione delle superfici per API. +// +// +// +// Modifiche : 30.03.20 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 EgtSurfFrNormVersor( int nId, int nRefId, double vtNorm[3]) +{ + // recupero il vettore normale + Vector3d vtTmp ; + if ( ! ExeSurfFrNormVersor( nId, nRefId, vtTmp)) + return FALSE ; + // lo assegno + VEC_FROM_3D( vtNorm, vtTmp) + return TRUE ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtSurfFrGrossArea( int nId, double* pdArea) +{ + if ( pdArea == nullptr) + return FALSE ; + // recupero l'area approssimata + return ( ExeSurfFrGrossArea( nId, *pdArea) ? TRUE : FALSE) ; +} + +//---------------------------------------------------------------------------- +int +__stdcall EgtSurfFrChunkCount( int nId) +{ + return ExeSurfFrChunkCount( nId) ; +} + +//---------------------------------------------------------------------------- +int +__stdcall EgtSurfFrChunkSimpleClassify( int nId1, int nChunk1, int nId2, int nChunk2) +{ + return ExeSurfFrChunkSimpleClassify( nId1, nChunk1, nId2, nChunk2) ; +} + +//---------------------------------------------------------------------------- +int +__stdcall EgtExtractSurfFrChunkLoops( int nId, int nChunk, int nDestGrpId, int* pnCount) +{ + return ExeExtractSurfFrChunkLoops( nId, nChunk, nDestGrpId, pnCount) ; +} + +//---------------------------------------------------------------------------- +int +__stdcall EgtSurfTmFacetCount( int nId) +{ + return ExeSurfTmFacetCount( nId) ; +} + +//---------------------------------------------------------------------------- +int +__stdcall EgtSurfTmFacetFromTria( int nId, int nT) +{ + return ExeSurfTmFacetFromTria( nId, nT) ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtSurfTmFacetNearestEndPoint( int nId, int nFacet, const double ptNear[3], int nRefId, + double ptEnd[3], double vtNorm[3]) +{ + // recupero il punto e la normale + Point3d ptTmp ; + Vector3d vtN ; + if ( ! ExeSurfTmFacetNearestEndPoint( nId, nFacet, ptNear, nRefId, ptTmp, vtN)) + return FALSE ; + // li assegno + VEC_FROM_3D( ptEnd, ptTmp) + VEC_FROM_3D( vtNorm, vtN) + return TRUE ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtSurfTmFacetNearestMidPoint( int nId, int nFacet, const double ptNear[3], int nRefId, + double ptMid[3], double vtNorm[3]) +{ + // recupero il punto e la normale + Point3d ptTmp ; + Vector3d vtN ; + if ( ! ExeSurfTmFacetNearestMidPoint( nId, nFacet, ptNear, nRefId, ptTmp, vtN)) + return FALSE ; + // li assegno + VEC_FROM_3D( ptMid, ptTmp) + VEC_FROM_3D( vtNorm, vtN) + return TRUE ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtSurfTmFacetCenter( int nId, int nFacet, int nRefId, double ptCen[3], double vtNorm[3]) +{ + // recupero il centro e la normale + Point3d ptTmp ; + Vector3d vtN ; + if ( ! ExeSurfTmFacetCenter( nId, nFacet, nRefId, ptTmp, vtN)) + return FALSE ; + // li assegno + VEC_FROM_3D( ptCen, ptTmp) + VEC_FROM_3D( vtNorm, vtN) + return TRUE ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtSurfTmFacetNormVersor( int nId, int nFacet, int nRefId, double vtNorm[3]) +{ + // recupero il vettore normale + Vector3d vtTmp ; + if ( ! ExeSurfTmFacetNormVersor( nId, nFacet, nRefId, vtTmp)) + return FALSE ; + // lo assegno + VEC_FROM_3D( vtNorm, vtTmp) + return TRUE ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtSurfTmFacetOppositeSide( int nId, int nFacet, const double vtDir[3], int nRefId, + double ptP1[3], double ptP2[3]) +{ + // verifica parametri + if ( vtDir == nullptr || ptP1 == nullptr || ptP2 == nullptr) + return FALSE ; + // recupero gli estremi del lato opposto + Point3d ptMyP1, ptMyP2 ; + Vector3d vtMyIn1, vtMyOut2 ; + if ( ! ExeSurfTmFacetOppositeSide( nId, nFacet, vtDir, nRefId, ptMyP1, ptMyP2)) + return FALSE ; + // assegno risultati + VEC_FROM_3D( ptP1, ptMyP1) + VEC_FROM_3D( ptP2, ptMyP2) + 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 ; + int nCount = 0 ; + if ( nDim == 0) { + vAdj = nullptr ; + } + else { + vAdj = (int*) malloc( nDim * sizeof( int)) ; + if ( vAdj == nullptr) + return FALSE ; + 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 + bool bAdjac ; + Point3d ptMyP1, ptMyP2 ; + if ( ! ExeSurfTmFacetsContact( nId, nF1, nF2, nRefId, bAdjac, ptMyP1, ptMyP2, *pdAng)) + return FALSE ; + // assegno risultati + *pbAdjac = ( bAdjac ? TRUE : FALSE) ; + VEC_FROM_3D( ptP1, ptMyP1) + VEC_FROM_3D( ptP2, ptMyP2) + return TRUE ; +} + +//---------------------------------------------------------------------------- +int +__stdcall EgtGetSurfTmSilhouette( int nId, const double vtDir[3], int nDestGrpId, int nRefType, int* pnCount) +{ + return ExeGetSurfTmSilhouette( nId, vtDir, nDestGrpId, nRefType, pnCount) ; +} + +//---------------------------------------------------------------------------- +int +__stdcall EgtExtractSurfTmLoops( int nId, int nDestGrpId, int* pnCount) +{ + return ExeExtractSurfTmLoops( nId, nDestGrpId, pnCount) ; +} + +//---------------------------------------------------------------------------- +int +__stdcall EgtExtractSurfTmFacetLoops( int nId, int nFacet, int nDestGrpId, int* pnCount) +{ + return ExeExtractSurfTmFacetLoops( nId, nFacet, nDestGrpId, pnCount) ; +} + +//---------------------------------------------------------------------------- +int +__stdcall EgtCopySurfTmFacet( int nId, int nFacet, int nDestGrpId) +{ + return ExeCopySurfTmFacet( nId, nFacet, nDestGrpId) ; +} + +//---------------------------------------------------------------------------- +int +__stdcall EgtExtractSurfBezierLoops( int nId, int nDestGrpId, int* pnCount) +{ + return ExeExtractSurfBezierLoops( nId, nDestGrpId, pnCount) ; +} diff --git a/API_GdbModifySurf.cpp b/API_GdbModifySurf.cpp index fd66b47..6f7f482 100644 --- a/API_GdbModifySurf.cpp +++ b/API_GdbModifySurf.cpp @@ -63,41 +63,6 @@ __stdcall EgtSurfFrOffset( int nId, double dDist, int nType) return ( ExeSurfFrOffset( nId, dDist, nType) ? TRUE : FALSE) ; } -//---------------------------------------------------------------------------- -int -__stdcall EgtExtractSurfFrChunkLoops( int nId, int nChunk, int nDestGrpId, int* pnCount) -{ - return ExeExtractSurfFrChunkLoops( nId, nChunk, nDestGrpId, pnCount) ; -} - -//---------------------------------------------------------------------------- -int -__stdcall EgtGetSurfTmSilhouette( int nId, const double vtDir[3], int nDestGrpId, int nRefType, int* pnCount) -{ - return ExeGetSurfTmSilhouette( nId, vtDir, nDestGrpId, nRefType, pnCount) ; -} - -//---------------------------------------------------------------------------- -int -__stdcall EgtExtractSurfTmLoops( int nId, int nDestGrpId, int* pnCount) -{ - return ExeExtractSurfTmLoops( nId, nDestGrpId, pnCount) ; -} - -//---------------------------------------------------------------------------- -int -__stdcall EgtExtractSurfTmFacetLoops( int nId, int nFacet, int nDestGrpId, int* pnCount) -{ - return ExeExtractSurfTmFacetLoops( nId, nFacet, nDestGrpId, pnCount) ; -} - -//---------------------------------------------------------------------------- -int -__stdcall EgtCopySurfTmFacet( int nId, int nFacet, int nDestGrpId) -{ - return ExeCopySurfTmFacet( nId, nFacet, nDestGrpId) ; -} - //---------------------------------------------------------------------------- BOOL __stdcall EgtSurfTmAdd( int nId1, int nId2) diff --git a/API_GeoSnap.cpp b/API_GeoSnap.cpp index c39772e..7a4bc7c 100644 --- a/API_GeoSnap.cpp +++ b/API_GeoSnap.cpp @@ -16,8 +16,6 @@ #include "API.h" #include "/EgtDev/Include/EInAPI.h" #include "/EgtDev/Include/EXeExecutor.h" -#include "/EgtDev/Include/EgtStringConverter.h" -#include using namespace std ; @@ -196,442 +194,6 @@ __stdcall EgtFrame( int nId, int nRefId, double ptOrig[3], double vtX[3], double return TRUE ; } -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtCurveDomain( int nId, double* pdStart, double* pdEnd) -{ - return ( ExeCurveDomain( nId, pdStart, pdEnd) ? TRUE : FALSE) ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtCurveLength( int nId, double* pdLen) -{ - return ( ExeCurveLength( nId, pdLen) ? TRUE : FALSE) ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtCurveLengthAtPoint( int nId, const double ptOn[3], double dExtend, double* pdLen) -{ - return ( ExeCurveLengthAtPoint( nId, ptOn, dExtend, pdLen) ? TRUE : FALSE) ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtCurveIsClosed( int nId) -{ - return ( ExeCurveIsClosed( nId) ? TRUE : FALSE) ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtCurveIsFlat( int nId, double vtN[3], double* pdDist) -{ - if ( vtN == nullptr || pdDist == nullptr) - return FALSE ; - Plane3d Plane ; - if ( ! ExeCurveIsFlat( nId, Plane)) - return FALSE ; - VEC_FROM_3D( vtN, Plane.GetVersN()) - *pdDist = Plane.GetDist() ; - return TRUE ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtCurveAreaXY( int nId, double* pdArea) -{ - return ( ExeCurveAreaXY( nId, *pdArea) ? TRUE : FALSE) ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtCurveArea( int nId, double vtN[3], double* pdDist, double* pdArea) -{ - if ( vtN == nullptr || pdDist == nullptr || pdArea == nullptr) - return FALSE ; - Plane3d Plane ; - if ( ! ExeCurveArea( nId, Plane, *pdArea)) - return FALSE ; - VEC_FROM_3D( vtN, Plane.GetVersN()) - *pdDist = Plane.GetDist() ; - return TRUE ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtCurveNearestExtremityToPoint( int nId, const double ptP[3], BOOL* pbStart) -{ - if ( pbStart == nullptr) - return FALSE ; - bool bStart ; - if ( ! ExeCurveNearestExtremityToPoint( nId, ptP, bStart)) - return FALSE ; - *pbStart = ( bStart ? TRUE : FALSE) ; - return TRUE ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtCurveExtrusion( int nId, int nRefId, double vtExtr[3]) -{ - // recupero il vettore estrusione - Vector3d vtTmp ; - if ( ! ExeCurveExtrusion( nId, nRefId, vtTmp)) - return FALSE ; - // lo assegno - VEC_FROM_3D( vtExtr, vtTmp) - return TRUE ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtCurveThickness( int nId, double* pdThick) -{ - return ( ExeCurveThickness( nId, pdThick) ? TRUE : FALSE) ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtCurveSelfIntersCount( int nId, int* pnCount) -{ - return ( ExeCurveSelfIntersCount( nId, pnCount) ? TRUE : FALSE) ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtCurveMinAreaRectangleXY( int nId, int nRefId, - double ptOrig[3], double vtX[3], double vtY[3], double vtZ[3], double* pdDimX, double* pdDimY) -{ - // eseguo calcoli - Frame3d frRect ; - double dDimX, dDimY ; - if ( ! ExeCurveMinAreaRectangleXY( nId, nRefId, frRect, dDimX, dDimY)) - return FALSE ; - // assegno l'origine - if ( ptOrig != nullptr) - VEC_FROM_3D( ptOrig, frRect.Orig()) - // assegno il versore X - if ( vtX != nullptr) - VEC_FROM_3D( vtX, frRect.VersX()) - // assegno il versore Y - if ( vtY != nullptr) - VEC_FROM_3D( vtY, frRect.VersY()) - // assegno il versore Z - if ( vtZ != nullptr) - VEC_FROM_3D( vtZ, frRect.VersZ()) - if ( pdDimX != nullptr) - *pdDimX = dDimX ; - if ( pdDimY != nullptr) - *pdDimY = dDimY ; - return TRUE ; -} - -//---------------------------------------------------------------------------- -int -__stdcall EgtClosedCurveClassify( int nId1, int nId2) -{ - return ExeClosedCurveClassify( nId1, nId2) ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtArcRadius( int nId, double* pdRad) -{ - return ( ExeArcRadius( nId, pdRad) ? TRUE : FALSE) ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtArcAngCenter( int nId, double* pdAngDeg) -{ - return ( ExeArcAngCenter( nId, pdAngDeg) ? TRUE : FALSE) ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtArcDeltaN( int nId, double* pdDeltaN) -{ - return ( ExeArcDeltaN( nId, pdDeltaN) ? TRUE : FALSE) ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtArcNormVersor( int nId, int nRefId, double vtNorm[3]) -{ - // recupero il vettore normale - Vector3d vtTmp ; - if ( ! ExeArcNormVersor( nId, nRefId, vtTmp)) - return FALSE ; - // lo assegno - VEC_FROM_3D( vtNorm, vtTmp) - return TRUE ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtCurveCompoCenter( int nId, int nSimpCrv, int nRefId, double ptCen[3]) -{ - // recupero il centro - Point3d ptTmp ; - if ( ! ExeCurveCompoCenter( nId, nSimpCrv, nRefId, ptTmp)) - return FALSE ; - // lo assegno - VEC_FROM_3D( ptCen, ptTmp) - return TRUE ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtSurfFrNormVersor( int nId, int nRefId, double vtNorm[3]) -{ - // recupero il vettore normale - Vector3d vtTmp ; - if ( ! ExeSurfFrNormVersor( nId, nRefId, vtTmp)) - return FALSE ; - // lo assegno - VEC_FROM_3D( vtNorm, vtTmp) - return TRUE ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtSurfFrGrossArea( int nId, double* pdArea) -{ - if ( pdArea == nullptr) - return FALSE ; - // recupero l'area approssimata - return ( ExeSurfFrGrossArea( nId, *pdArea) ? TRUE : FALSE) ; -} - -//---------------------------------------------------------------------------- -int -__stdcall EgtSurfFrChunkCount( int nId) -{ - return ExeSurfFrChunkCount( nId) ; -} - -//---------------------------------------------------------------------------- -int -__stdcall EgtSurfFrChunkSimpleClassify( int nId1, int nChunk1, int nId2, int nChunk2) -{ - return ExeSurfFrChunkSimpleClassify( nId1, nChunk1, nId2, nChunk2) ; -} - -//---------------------------------------------------------------------------- -int -__stdcall EgtSurfTmFacetCount( int nId) -{ - return ExeSurfTmFacetCount( nId) ; -} - -//---------------------------------------------------------------------------- -int -__stdcall EgtSurfTmFacetFromTria( int nId, int nT) -{ - return ExeSurfTmFacetFromTria( nId, nT) ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtSurfTmFacetNearestEndPoint( int nId, int nFacet, const double ptNear[3], int nRefId, - double ptEnd[3], double vtNorm[3]) -{ - // recupero il punto e la normale - Point3d ptTmp ; - Vector3d vtN ; - if ( ! ExeSurfTmFacetNearestEndPoint( nId, nFacet, ptNear, nRefId, ptTmp, vtN)) - return FALSE ; - // li assegno - VEC_FROM_3D( ptEnd, ptTmp) - VEC_FROM_3D( vtNorm, vtN) - return TRUE ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtSurfTmFacetNearestMidPoint( int nId, int nFacet, const double ptNear[3], int nRefId, - double ptMid[3], double vtNorm[3]) -{ - // recupero il punto e la normale - Point3d ptTmp ; - Vector3d vtN ; - if ( ! ExeSurfTmFacetNearestMidPoint( nId, nFacet, ptNear, nRefId, ptTmp, vtN)) - return FALSE ; - // li assegno - VEC_FROM_3D( ptMid, ptTmp) - VEC_FROM_3D( vtNorm, vtN) - return TRUE ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtSurfTmFacetCenter( int nId, int nFacet, int nRefId, double ptCen[3], double vtNorm[3]) -{ - // recupero il centro e la normale - Point3d ptTmp ; - Vector3d vtN ; - if ( ! ExeSurfTmFacetCenter( nId, nFacet, nRefId, ptTmp, vtN)) - return FALSE ; - // li assegno - VEC_FROM_3D( ptCen, ptTmp) - VEC_FROM_3D( vtNorm, vtN) - return TRUE ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtSurfTmFacetNormVersor( int nId, int nFacet, int nRefId, double vtNorm[3]) -{ - // recupero il vettore normale - Vector3d vtTmp ; - if ( ! ExeSurfTmFacetNormVersor( nId, nFacet, nRefId, vtTmp)) - return FALSE ; - // lo assegno - VEC_FROM_3D( vtNorm, vtTmp) - return TRUE ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtSurfTmFacetOppositeSide( int nId, int nFacet, const double vtDir[3], int nRefId, - double ptP1[3], double ptP2[3]) -{ - // verifica parametri - if ( vtDir == nullptr || ptP1 == nullptr || ptP2 == nullptr) - return FALSE ; - // recupero gli estremi del lato opposto - Point3d ptMyP1, ptMyP2 ; - Vector3d vtMyIn1, vtMyOut2 ; - if ( ! ExeSurfTmFacetOppositeSide( nId, nFacet, vtDir, nRefId, ptMyP1, ptMyP2)) - return FALSE ; - // assegno risultati - VEC_FROM_3D( ptP1, ptMyP1) - VEC_FROM_3D( ptP2, ptMyP2) - 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 ; - int nCount = 0 ; - if ( nDim == 0) { - vAdj = nullptr ; - } - else { - vAdj = (int*) malloc( nDim * sizeof( int)) ; - if ( vAdj == nullptr) - return FALSE ; - 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 - bool bAdjac ; - Point3d ptMyP1, ptMyP2 ; - if ( ! ExeSurfTmFacetsContact( nId, nF1, nF2, nRefId, bAdjac, ptMyP1, ptMyP2, *pdAng)) - return FALSE ; - // assegno risultati - *pbAdjac = ( bAdjac ? TRUE : FALSE) ; - 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)) - return FALSE ; - // lo assegno - VEC_FROM_3D( vtNorm, vtTmp) - return TRUE ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtTextGetContent( int nId, wchar_t*& wsText) -{ - if ( &wsText == nullptr) - return FALSE ; - string sText ; - if ( ! ExeTextGetContent( nId, sText)) - return FALSE ; - wsText = _wcsdup( stringtoW( sText)) ; - return (( wsText == nullptr) ? FALSE : TRUE) ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtTextGetFont( int nId, wchar_t*& wsFont) -{ - if ( &wsFont == nullptr) - return FALSE ; - string sFont ; - if ( ! ExeTextGetFont( nId, sFont)) - return FALSE ; - wsFont = _wcsdup( stringtoW( sFont)) ; - return (( wsFont == nullptr) ? FALSE : TRUE) ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtTextGetHeight( int nId, double* pdH) -{ - if ( pdH == nullptr) - return FALSE ; - return ( ExeTextGetHeight( nId, *pdH) ? TRUE : FALSE) ; -} - -//---------------------------------------------------------------------------- -BOOL -__stdcall EgtTextGetItalic( int nId, BOOL* pbItl) -{ - if ( pbItl == nullptr) - return FALSE ; - bool bItl ; - if ( ! ExeTextGetItalic( nId, bItl)) - return FALSE ; - *pbItl = ( bItl ? TRUE : FALSE) ; - return TRUE ; -} - //------------------------------------------------------------------------------- BOOL __stdcall EgtPointToIdGlob( double ptP[3], int nId) diff --git a/EgtInterface.vcxproj b/EgtInterface.vcxproj index 666f9a8..cb779ad 100644 --- a/EgtInterface.vcxproj +++ b/EgtInterface.vcxproj @@ -148,7 +148,7 @@ copy $(TargetPath) \EgtProg\DllD64 Level3 Use - Full + MaxSpeed true true WIN32;I_AM_EIN;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) @@ -182,7 +182,7 @@ copy $(TargetPath) \EgtProg\Dll32 Level3 Use - Full + MaxSpeed true true WIN32;I_AM_EIN;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) @@ -214,6 +214,9 @@ copy $(TargetPath) \EgtProg\Dll64 + + + diff --git a/EgtInterface.vcxproj.filters b/EgtInterface.vcxproj.filters index be6ce9a..29407a0 100644 --- a/EgtInterface.vcxproj.filters +++ b/EgtInterface.vcxproj.filters @@ -131,6 +131,15 @@ File di origine\API + + File di origine\API + + + File di origine\API + + + File di origine\API +