Files
EgtInterface/API_GeomDB.cpp
T
Dario Sassi 8bc0e986b2 EgtInterface 1.6e2 :
- esecutore e lua scorporato in EgtExecutor.
2015-05-05 22:14:56 +00:00

177 lines
5.1 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2014-2014
//----------------------------------------------------------------------------
// File : API_GeomDB.cpp Data : 01.09.14 Versione : 1.5i1
// Contenuto : Funzioni DB geometrico per API.
//
//
//
// Modifiche : 01.09.14 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
//--------------------------- Include ----------------------------------------
#include "stdafx.h"
#include "API.h"
#include "/EgtDev/Include/EInAPI.h"
#include "/EgtDev/Include/EXeExecutor.h"
#include "/EgtDev/Include/EGnStringConverter.h"
using namespace std ;
//-----------------------------------------------------------------------------
int
__stdcall EgtInitGeomDB( void)
{
return ExeInitGeomDB() ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSetCurrentContext( int nGseCtx)
{
return ( ExeSetCurrentContext( nGseCtx) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtResetCurrentContext( void)
{
return ( ExeResetCurrentContext() ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
int
__stdcall EgtGetCurrentContext( void)
{
return ExeGetCurrentContext() ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSetDefaultMaterial( const int vCol[4])
{
return ( ExeSetDefaultMaterial( vCol) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSetGridFrame( const double ptOrig[3], const double vX[3], const double vY[3], const double vZ[3])
{
// costruisco il riferimento
Frame3d frFrame ;
if ( ! frFrame.Set( ptOrig, vX, vY, vZ))
return FALSE ;
// imposto il riferimento della griglia
return ( ExeSetGridFrame( frFrame) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtGetGridFrame( double ptOrig[3], double vX[3], double vY[3], double vZ[3])
{
// recupero il riferimento della griglia
Frame3d frGrid ;
if ( ExeGetGridFrame( GDB_ID_ROOT, frGrid)) {
// assegno i valori di ritorno
VEC_FROM_3D( ptOrig, frGrid.Orig())
VEC_FROM_3D( vX, frGrid.VersX())
VEC_FROM_3D( vY, frGrid.VersY())
VEC_FROM_3D( vZ, frGrid.VersZ())
return TRUE ;
}
else
return FALSE ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSetCurrFilePath( const wchar_t* wsFilePath)
{
return ( ExeSetCurrFilePath( wstrztoA( wsFilePath)) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtGetCurrFilePath( wchar_t*& wsFilePath)
{
if ( &wsFilePath == nullptr)
return false ;
string sFilePath ;
if ( ! ExeGetCurrFilePath( sFilePath))
return FALSE ;
wsFilePath = _wcsdup( stringtoW( sFilePath)) ;
return (( wsFilePath == nullptr) ? FALSE : TRUE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtEnableModified( void)
{
return ( ExeEnableModified() ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtDisableModified( void)
{
return ( ExeDisableModified() ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSetModified( void)
{
return ( ExeSetModified() ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtResetModified( void)
{
return ( ExeResetModified() ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtGetModified( void)
{
return ( ExeGetModified() ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtNewFile( void)
{
return ( ExeNewFile() ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtOpenFile( const wchar_t* wsFilePath)
{
return ( ExeOpenFile( wstrztoA( wsFilePath)) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtInsertFile( const wchar_t* wsFilePath)
{
return ( ExeInsertFile( wstrztoA( wsFilePath)) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSaveFile( const wchar_t* wsFilePath, int nFlag)
{
return ( ExeSaveFile( wstrztoA( wsFilePath), nFlag) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSaveObjToFile( int nId, const wchar_t* wsFilePath, int nFlag)
{
return ( ExeSaveObjToFile( nId, wstrztoA( wsFilePath), nFlag) ? TRUE : FALSE) ;
}