From 5025c28adf78609b2347cd90b4fbaaee183a31d8 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Sun, 11 Oct 2015 18:02:31 +0000 Subject: [PATCH] EgtInterface 1.6j1 : - aggiunte funzioni per foto e textures. --- API_GdbObjAttribs.cpp | 55 +++++++++++++++++++++++++++++++++++ API_Photo.cpp | 51 ++++++++++++++++++++++++++++++++ API_Scene.cpp | 4 +-- EgtInterface.rc | Bin 11718 -> 11726 bytes EgtInterface.vcxproj | 1 + EgtInterface.vcxproj.filters | 3 ++ 6 files changed, 112 insertions(+), 2 deletions(-) create mode 100644 API_Photo.cpp diff --git a/API_GdbObjAttribs.cpp b/API_GdbObjAttribs.cpp index d1e1033..856958f 100644 --- a/API_GdbObjAttribs.cpp +++ b/API_GdbObjAttribs.cpp @@ -352,3 +352,58 @@ __stdcall EgtRemoveInfo( int nId, const wchar_t* wsKey) { return ( ExeRemoveInfo( nId, wstrztoA( wsKey)) ? TRUE : FALSE) ; } + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtSetTextureName( int nId, const wchar_t* wsTxrName) +{ + return ( ExeSetTextureName( nId, wstrztoA( wsTxrName)) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtSetTextureFrame( int nId, const double vOrig[3], + const double vX[3], const double vY[3], const double vZ[3], int nRefType) +{ + Frame3d frFrame ; + if ( ! frFrame.Set( vOrig, vX, vY, vZ)) + return GDB_ID_NULL ; + return ( ExeSetTextureFrame( nId, frFrame, nRefType) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtRemoveTextureData( int nId) +{ + return ( ExeRemoveTextureData( nId) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtGetTextureName( int nId, wchar_t*& wsTxrName) +{ + string sTemp ; + if ( ! ExeGetTextureName( nId, sTemp)) + return FALSE ; + wsTxrName = _wcsdup( stringtoW( sTemp)) ; + return (( wsTxrName == nullptr) ? FALSE : TRUE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtGetTextureFrame( int nId, int nRefId, double vOrig[3], double vX[3], double vY[3], double vZ[3]) +{ + // recupero il frame + Frame3d frFrame ; + if ( ! ExeGetTextureFrame( nId, nRefId, frFrame)) + return FALSE ; + // assegno l'origine + VEC_FROM_3D( vOrig, frFrame.Orig()) + // assegno il versore X + VEC_FROM_3D( vX, frFrame.VersX()) + // assegno il versore Y + VEC_FROM_3D( vY, frFrame.VersY()) + // assegno il versore Z + VEC_FROM_3D( vZ, frFrame.VersZ()) + return TRUE ; +} diff --git a/API_Photo.cpp b/API_Photo.cpp new file mode 100644 index 0000000..f670bbb --- /dev/null +++ b/API_Photo.cpp @@ -0,0 +1,51 @@ +//---------------------------------------------------------------------------- +// EgalTech 2015-2015 +//---------------------------------------------------------------------------- +// File : API_Photo.cpp Data : 05.10.15 Versione : 1.6j1 +// Contenuto : Funzioni gestione fotografie per API. +// +// +// +// Modifiche : 05.10.15 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" + +using namespace std ; + +//----------------------------------------------------------------------------- +int +__stdcall EgtAddPhoto( const wchar_t* wsName, const wchar_t* wsFile, + const double ptOri[3], const double ptCen[3], double dMMxPixel, + int nParentId, const double ptMin[3], const double ptMax[3]) +{ + return ExeAddPhoto( wstrztoA( wsName), wstrztoA( wsFile), + ptOri, ptCen, dMMxPixel, nParentId, ptMin, ptMax) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtGetPhotoPath( int nId, wchar_t*& wsFile) +{ + if ( &wsFile == nullptr) + return FALSE ; + string sName ; + if ( ! ExeGetPhotoPath( nId, sName)) + return FALSE ; + wsFile = _wcsdup( stringtoW( sName)) ; + return (( wsFile == nullptr) ? FALSE : TRUE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtChangePhotoPath( int nId, const wchar_t* wsFile) +{ + return ( ExeChangePhotoPath( nId, wstrztoA( wsFile)) ? TRUE : FALSE) ; +} diff --git a/API_Scene.cpp b/API_Scene.cpp index 917f925..c0078cb 100644 --- a/API_Scene.cpp +++ b/API_Scene.cpp @@ -424,10 +424,10 @@ __stdcall EgtUnProjectPoint( int nWinX, int nWinY, double ptP[3]) //----------------------------------------------------------------------------- BOOL __stdcall EgtLoadTexture( const wchar_t* wsName, const wchar_t* wsFile, - double dMMxPix, double dDimX, double dDimY, BOOL bRepeat) + double dMMxPix, double dDimX, double dDimY, int nRepeat) { return ( ExeLoadTexture( wstrztoA( wsName), wstrztoA( wsFile), - dMMxPix, dDimX, dDimY, ( bRepeat != FALSE)) ? TRUE : FALSE) ; + dMMxPix, dDimX, dDimY, nRepeat) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- diff --git a/EgtInterface.rc b/EgtInterface.rc index 838e6ca0ee0598138b30cd1e12ac897c7503609d..2d86b24cbb537b4eaac5caff7f2eae99f71aae8b 100644 GIT binary patch delta 143 zcmX>WeJ*;#H#T-d1_K5i2E)xC`A#xTKEheUoW)=``Jtfh<^rx779?3mW|++60xpZm m20S{G?{GcYyh>Py8A%n;j3tr?GXkWL%(y6r!;CIv8!iC5lq`|} delta 137 zcmX>XeJpyzH#SyF1|0^A%@4(HGEKh5nZumPU@`e4r|x7gC5z2{Qc{eYk8o=-!xf!m qn!Hc20;XuQmy#Fb<_*F~3S60Cl28*|SWq?dOkSr5w*_cG3pW5(lq@{} diff --git a/EgtInterface.vcxproj b/EgtInterface.vcxproj index 8226ab5..102713c 100644 --- a/EgtInterface.vcxproj +++ b/EgtInterface.vcxproj @@ -230,6 +230,7 @@ copy $(TargetPath) \EgtProg\Dll64 + diff --git a/EgtInterface.vcxproj.filters b/EgtInterface.vcxproj.filters index b3826c4..c8a5f10 100644 --- a/EgtInterface.vcxproj.filters +++ b/EgtInterface.vcxproj.filters @@ -116,6 +116,9 @@ File di origine\API + + File di origine\API +