diff --git a/API_GdbGetSurf.cpp b/API_GdbGetSurf.cpp index 7fb70c4..dd265d4 100644 --- a/API_GdbGetSurf.cpp +++ b/API_GdbGetSurf.cpp @@ -112,11 +112,46 @@ __stdcall EgtSurfTmFacetFromTria( int nId, int nT) return ExeSurfTmFacetFromTria( nId, nT) ; } +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtSurfTmGetVertex( int nId, int nVert, int nRefId, double ptVert[3]) +{ + // verifica parametri + if ( ptVert == nullptr) + return FALSE ; + // recupero il vertice + Point3d ptV ; + if ( ! ExeSurfTmGetVertex( nId, nVert, nRefId, ptV)) + return FALSE ; + // lo assegno + VEC_FROM_3D( ptVert, ptV) + return TRUE ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtSurfTmGetNearestVertex( int nId, const double ptNear[3], int nRefId, int* pnVert, double ptVert[3]) +{ + // verifica parametri + if ( ptNear == nullptr || pnVert == nullptr || ptVert == nullptr) + return FALSE ; + // recupero indice del vertice e sue coordinate + Point3d ptTmp ; + if ( ! ExeSurfTmGetNearestVertex( nId, ptNear, nRefId, *pnVert, ptTmp)) + return FALSE ; + // le assegno + VEC_FROM_3D( ptVert, ptTmp) + return TRUE ; +} + //---------------------------------------------------------------------------- BOOL __stdcall EgtSurfTmFacetNearestEndPoint( int nId, int nFacet, const double ptNear[3], int nRefId, double ptEnd[3], double vtNorm[3]) { + // verifica parametri + if ( ptNear == nullptr || ptEnd == nullptr || vtNorm == nullptr) + return FALSE ; // recupero il punto e la normale Point3d ptTmp ; Vector3d vtN ; @@ -133,6 +168,9 @@ BOOL __stdcall EgtSurfTmFacetNearestMidPoint( int nId, int nFacet, const double ptNear[3], int nRefId, double ptMid[3], double vtNorm[3]) { + // verifica parametri + if ( ptNear == nullptr || ptMid == nullptr || vtNorm == nullptr) + return FALSE ; // recupero il punto e la normale Point3d ptTmp ; Vector3d vtN ; @@ -148,6 +186,9 @@ __stdcall EgtSurfTmFacetNearestMidPoint( int nId, int nFacet, const double ptNea BOOL __stdcall EgtSurfTmFacetCenter( int nId, int nFacet, int nRefId, double ptCen[3], double vtNorm[3]) { + // verifica parametri + if ( ptCen == nullptr || vtNorm == nullptr) + return FALSE ; // recupero il centro e la normale Point3d ptTmp ; Vector3d vtN ; @@ -163,6 +204,9 @@ __stdcall EgtSurfTmFacetCenter( int nId, int nFacet, int nRefId, double ptCen[3] BOOL __stdcall EgtSurfTmFacetNormVersor( int nId, int nFacet, int nRefId, double vtNorm[3]) { + // verifica parametri + if ( vtNorm == nullptr) + return FALSE ; // recupero il vettore normale Vector3d vtTmp ; if ( ! ExeSurfTmFacetNormVersor( nId, nFacet, nRefId, vtTmp)) diff --git a/API_GdbModifySurf.cpp b/API_GdbModifySurf.cpp index 6a3702c..a92a47e 100644 --- a/API_GdbModifySurf.cpp +++ b/API_GdbModifySurf.cpp @@ -70,6 +70,20 @@ __stdcall EgtSurfFrOffset( int nId, double dDist, int nType) return ( ExeSurfFrOffset( nId, dDist, nType) ? TRUE : FALSE) ; } +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtSurfTmMoveVertex( int nId, int nVert, const double ptNewVert[3], int nRefType, BOOL bUpdate) +{ + return ( ExeSurfTmMoveVertex( nId, nVert, ptNewVert, nRefType, ( bUpdate != FALSE)) ? TRUE : FALSE) ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtSurfTmMoveFacet( int nId, int nFacet, const double vtMove[3], int nRefType, BOOL bUpdate) +{ + return ( ExeSurfTmMoveFacet( nId, nFacet, vtMove, nRefType, ( bUpdate != FALSE)) ? TRUE : FALSE) ; +} + //---------------------------------------------------------------------------- int __stdcall EgtSurfTmToTriangles( int nId, int* pnCount)