6c607bde1b
- aggiunta interfaccia per EgtChangePhotoCenterAsFlatScan.
138 lines
4.5 KiB
C++
138 lines
4.5 KiB
C++
//----------------------------------------------------------------------------
|
|
// 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) ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtAddPhoto2( const wchar_t* wsName, const wchar_t* wsFile,
|
|
const double ptOri[3], const double ptCen[3], double dDimX, double dDimY,
|
|
int nParentId, const double ptMin[3], const double ptMax[3])
|
|
{
|
|
return ExeAddPhoto( wstrztoA( wsName), wstrztoA( wsFile),
|
|
ptOri, ptCen, dDimX, dDimY, nParentId, ptMin, ptMax) ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtMovePhoto( int nId, const double vtMove[3])
|
|
{
|
|
return ( ExeMovePhoto( nId, vtMove) ? TRUE : FALSE) ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtRotatePhoto( int nId, const double ptAx[3], const double vtAx[3], double dAngDeg)
|
|
{
|
|
return ( ExeRotatePhoto( nId, ptAx, vtAx, dAngDeg) ? TRUE : FALSE) ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
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) ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtGetPhotoOrigin( int nId, double ptOri[3])
|
|
{
|
|
if ( ptOri == nullptr)
|
|
return FALSE ;
|
|
Point3d ptTmp ;
|
|
if ( ! ExeGetPhotoOrigin( nId, ptTmp))
|
|
return FALSE ;
|
|
VEC_FROM_3D( ptOri, ptTmp)
|
|
return TRUE ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtGetPhotoCenter( int nId, double ptCen[3])
|
|
{
|
|
if ( ptCen == nullptr)
|
|
return FALSE ;
|
|
Point3d ptTmp ;
|
|
if ( ! ExeGetPhotoCenter( nId, ptTmp))
|
|
return FALSE ;
|
|
VEC_FROM_3D( ptCen, ptTmp)
|
|
return TRUE ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtChangePhotoCenterAsFlatScan( int nId)
|
|
{
|
|
return ( ExeChangePhotoCenterAsFlatScan( nId) ? TRUE : FALSE) ;
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtGetPhotoDimensions( int nId, double* pdDimX, double* pdDimY)
|
|
{
|
|
if ( pdDimX == nullptr || pdDimY == nullptr)
|
|
return FALSE ;
|
|
return ( ExeGetPhotoDimensions( nId, *pdDimX, *pdDimY) ? TRUE : FALSE) ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtGetPhotoPixels( int nId, int* pnPixelX, int* pnPixelY)
|
|
{
|
|
if ( pnPixelX == nullptr || pnPixelY == nullptr)
|
|
return FALSE ;
|
|
return ( ExeGetPhotoPixels( nId, *pnPixelX, *pnPixelY) ? TRUE : FALSE) ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtGetPhotoImagePixels( int nId, int* pnPixelX, int* pnPixelY)
|
|
{
|
|
if ( pnPixelX == nullptr || pnPixelY == nullptr)
|
|
return FALSE ;
|
|
return ( ExeGetPhotoImagePixels( nId, *pnPixelX, *pnPixelY) ? TRUE : FALSE) ;
|
|
}
|