1a2eab8608
- aggiunta interfaccia funzione EgtTransform.
131 lines
4.5 KiB
C++
131 lines
4.5 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 "/EgtDev/Include/EInAPI.h"
|
|
#include "/EgtDev/Include/EXeExecutor.h"
|
|
|
|
using namespace std ;
|
|
|
|
//-------------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtTransform( int nId, const double ptOrig[3],
|
|
const double vX[3], const double vY[3], const double vZ[3], int nRefType)
|
|
{
|
|
INTVECTOR vIds ;
|
|
vIds.push_back( nId) ;
|
|
Frame3d frFrame ;
|
|
if ( ! frFrame.Set( ptOrig, vX, vY, vZ))
|
|
return GDB_ID_NULL ;
|
|
return ExeTransform( vIds, frFrame, nRefType) ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtMove( int nId, double vVtMove[3], int nRefType)
|
|
{
|
|
INTVECTOR vIds ;
|
|
vIds.push_back( nId) ;
|
|
return ( ExeMove( vIds, vVtMove, nRefType) ? TRUE : FALSE) ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtRotate( int nId, double vPtAx[3], double vVtAx[3], double dAngRotDeg, int nRefType)
|
|
{
|
|
INTVECTOR vIds ;
|
|
vIds.push_back( nId) ;
|
|
return ( ExeRotate( vIds, vPtAx, vVtAx, dAngRotDeg, nRefType) ? 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, int nRefType)
|
|
{
|
|
INTVECTOR vIds ;
|
|
vIds.push_back( nId) ;
|
|
// costruisco il riferimento di scalatura
|
|
Frame3d frFrame ;
|
|
if ( ! frFrame.Set( vOrig, vX, vY, vZ))
|
|
return FALSE ;
|
|
// eseguo
|
|
return ( ExeScale( vIds, frFrame, dCoeffX, dCoeffY, dCoeffZ, nRefType) ? TRUE : FALSE) ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtMirror( int nId, const double vPnt[3], const double vN[3], int nRefType)
|
|
{
|
|
INTVECTOR vIds ;
|
|
vIds.push_back( nId) ;
|
|
return ( ExeMirror( vIds, vPnt, vN, nRefType) ? TRUE : FALSE) ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtShear( int nId, const double vPnt[3], const double vN[3],
|
|
const double vDir[3], double dCoeff, int nRefType)
|
|
{
|
|
INTVECTOR vIds ;
|
|
vIds.push_back( nId) ;
|
|
return ( ExeShear( vIds, vPnt, vN, vDir, dCoeff, nRefType) ? TRUE : FALSE) ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtMoveGroup( int nId, double vVtMove[3])
|
|
{
|
|
return ( ExeMoveGroup( nId, vVtMove) ? TRUE : FALSE) ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtRotateGroup( int nId, double vPtAx[3], double vVtAx[3], double dAngRotDeg)
|
|
{
|
|
return ( ExeRotateGroup( nId, vPtAx, vVtAx, dAngRotDeg) ? 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)
|
|
{
|
|
// costruisco il riferimento di scalatura
|
|
Frame3d frFrame ;
|
|
if ( ! frFrame.Set( vOrig, vX, vY, vZ))
|
|
return FALSE ;
|
|
// eseguo
|
|
return ( ExeScaleGroup( nId, frFrame, dCoeffX, dCoeffY, dCoeffZ) ? TRUE : FALSE) ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtMirrorGroup( int nId, const double vPnt[3], const double vN[3])
|
|
{
|
|
return ( ExeMirrorGroup( nId, vPnt, vN) ? TRUE : FALSE) ;
|
|
}
|
|
|
|
|
|
//-------------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtShearGroup( int nId, const double vPnt[3], const double vN[3],
|
|
const double vDir[3], double dCoeff)
|
|
{
|
|
return ( ExeShearGroup( nId, vPnt, vN, vDir, dCoeff) ? TRUE : FALSE) ;
|
|
}
|