Files
EgtInterface/API_GeoTransform.cpp
T
Dario Sassi 46c5fce044 EgtInterface 1.5j4 :
- ora si imposta un context corrente anche per le API come per LUA
- il context corrente di LUA coincide con quello delle API.
2014-10-15 15:31:00 +00:00

190 lines
7.0 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2014-2014
//----------------------------------------------------------------------------
// File : API_GeoTransform.cpp Data : 30.09.14 Versione : 1.5i5
// Contenuto : Funzioni di trasformazione geometrica per API.
//
//
//
// Modifiche : 30.09.14 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
//--------------------------- Include ----------------------------------------
#include "stdafx.h"
#include "API.h"
#include "API_Macro.h"
#include "/EgtDev/Include/EInAPI.h"
using namespace std ;
//-------------------------------------------------------------------------------
BOOL
__stdcall EgtMove( int nId, double vVtMove[3])
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// eseguo traslazione
return ( pGeomDB->Translate( nId, Vector3d( vVtMove)) ? TRUE : FALSE) ;
}
//-------------------------------------------------------------------------------
BOOL
__stdcall EgtMoveGlob( int nId, double vVtMove[3])
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// eseguo traslazione
return ( pGeomDB->TranslateGlob( nId, Vector3d( vVtMove)) ? TRUE : FALSE) ;
}
//-------------------------------------------------------------------------------
BOOL
__stdcall EgtMoveGroup( int nId, double vVtMove[3])
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// eseguo traslazione
return ( pGeomDB->TranslateGroup( nId, Vector3d( vVtMove)) ? TRUE : FALSE) ;
}
//-------------------------------------------------------------------------------
BOOL
__stdcall EgtRotate( int nId, double vPtAx[3], double vVtAx[3], double dAngRotDeg)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// eseguo rotazione
return ( pGeomDB->Rotate( nId, Point3d( vPtAx), Vector3d( vVtAx), dAngRotDeg) ? TRUE : FALSE) ;
}
//-------------------------------------------------------------------------------
BOOL
__stdcall EgtRotateGlob( int nId, double vPtAx[3], double vVtAx[3], double dAngRotDeg)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// eseguo rotazione
return ( pGeomDB->RotateGlob( nId, Point3d( vPtAx), Vector3d( vVtAx), dAngRotDeg) ? TRUE : FALSE) ;
}
//-------------------------------------------------------------------------------
BOOL
__stdcall EgtRotateGroup( int nId, double vPtAx[3], double vVtAx[3], double dAngRotDeg)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// eseguo rotazione
return ( pGeomDB->RotateGroup( nId, Point3d( vPtAx), Vector3d( vVtAx), dAngRotDeg) ? TRUE : FALSE) ;
}
//-------------------------------------------------------------------------------
BOOL
__stdcall EgtScale( int nId, const double vOrig[3],
const double vX[3], const double vY[3], const double vZ[3],
double dCoeffX, double dCoeffY, double dCoeffZ)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// eseguo rotazione
Frame3d frFrame ;
if ( ! frFrame.Set( Point3d( vOrig), Vector3d( vX), Vector3d( vY), Vector3d( vZ)))
return FALSE ;
return ( pGeomDB->Scale( nId, frFrame, dCoeffX, dCoeffY, dCoeffZ) ? TRUE : FALSE) ;
}
//-------------------------------------------------------------------------------
BOOL
__stdcall EgtScaleGlob( int nId, const double vOrig[3],
const double vX[3], const double vY[3], const double vZ[3],
double dCoeffX, double dCoeffY, double dCoeffZ)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// eseguo rotazione
Frame3d frFrame ;
if ( ! frFrame.Set( Point3d( vOrig), Vector3d( vX), Vector3d( vY), Vector3d( vZ)))
return FALSE ;
return ( pGeomDB->ScaleGlob( nId, frFrame, dCoeffX, dCoeffY, dCoeffZ) ? TRUE : FALSE) ;
}
//-------------------------------------------------------------------------------
BOOL
__stdcall EgtScaleGroup( int nId, const double vOrig[3],
const double vX[3], const double vY[3], const double vZ[3],
double dCoeffX, double dCoeffY, double dCoeffZ)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// eseguo rotazione
Frame3d frFrame ;
if ( ! frFrame.Set( Point3d( vOrig), Vector3d( vX), Vector3d( vY), Vector3d( vZ)))
return FALSE ;
return ( pGeomDB->ScaleGroup( nId, frFrame, dCoeffX, dCoeffY, dCoeffZ) ? TRUE : FALSE) ;
}
//-------------------------------------------------------------------------------
BOOL
__stdcall EgtMirror( int nId, const double vPnt[3], const double vN[3])
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// eseguo specularità
return ( pGeomDB->Mirror( nId, Point3d( vPnt), Vector3d( vN)) ? TRUE : FALSE) ;
}
//-------------------------------------------------------------------------------
BOOL
__stdcall EgtMirrorGlob( int nId, const double vPnt[3], const double vN[3])
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// eseguo specularità
return ( pGeomDB->MirrorGlob( nId, Point3d( vPnt), Vector3d( vN)) ? TRUE : FALSE) ;
}
//-------------------------------------------------------------------------------
BOOL
__stdcall EgtMirrorGroup( int nId, const double vPnt[3], const double vN[3])
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// eseguo specularità
return ( pGeomDB->MirrorGroup( nId, Point3d( vPnt), Vector3d( vN)) ? TRUE : FALSE) ;
}
//-------------------------------------------------------------------------------
BOOL
__stdcall EgtShear( int nId, const double vPnt[3], const double vN[3],
const double vDir[3], double dCoeff)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// eseguo stiramento
return ( pGeomDB->Shear( nId, Point3d( vPnt), Vector3d( vN), Vector3d( vDir), dCoeff) ? TRUE : FALSE) ;
}
//-------------------------------------------------------------------------------
BOOL
__stdcall EgtShearGlob( int nId, const double vPnt[3], const double vN[3],
const double vDir[3], double dCoeff)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// eseguo stiramento
return ( pGeomDB->ShearGlob( nId, Point3d( vPnt), Vector3d( vN), Vector3d( vDir), dCoeff) ? TRUE : FALSE) ;
}
//-------------------------------------------------------------------------------
BOOL
__stdcall EgtShearGroup( int nId, const double vPnt[3], const double vN[3],
const double vDir[3], double dCoeff)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// eseguo stiramento
return ( pGeomDB->ShearGroup( nId, Point3d( vPnt), Vector3d( vN), Vector3d( vDir), dCoeff) ? TRUE : FALSE) ;
}