Files
Include/EGkFrame3d.h
T
2013-11-21 17:16:59 +00:00

96 lines
3.3 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2013-2013
//----------------------------------------------------------------------------
// File : EgkFrame3d.h Data : 20.11.13 Versione : 1.3a1
// Contenuto : Dichiarazione della classe Reference Frame 3d.
//
//
//
// Modifiche : 04.01.12 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "/EgtDev/Include/EGKPoint3d.h"
//----------------------- Macro per import/export ----------------------------
#undef EGK_EXPORT
#if defined( I_AM_EGK) // da definirsi solo nella DLL
#define EGK_EXPORT __declspec( dllexport)
#else
#define EGK_EXPORT __declspec( dllimport)
#endif
//----------------------------------------------------------------------------
class EGK_EXPORT Frame3d
{
public :
enum Type { ERR = 0, TOP = 1, BOTTOM = 2, FRONT = 3,
BACK = 4, LEFT = 5, RIGHT = 6, GEN = 7} ;
public :
Frame3d( void) ;
bool Set( const Point3d& ptOrig, const Vector3d& vtDirX,
const Vector3d& vtDirY, const Vector3d& vtDirZ) ;
bool Set( const Point3d& ptOrig, const Point3d& ptOnX, const Point3d& ptNearY) ;
bool Set( const Point3d& ptOrig, Type nType) ;
bool Reset( void) ;
void Translate( const Vector3d& vtMove) ;
bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dAngRad) ;
// Scale non possibile (non previsti fattori di scala)
// Mirror non possibile (cambia il senso destrorso in sinistrorso)
bool ToGlob( const Frame3d& frRef) ;
bool ToLoc( const Frame3d& frRef) ;
inline const Frame3d operator*=( const Frame3d& frRef) { this->ToGlob( frRef) ; return *this ;}
inline const Frame3d operator/=( const Frame3d& frRef) { this->ToLoc( frRef) ; return *this ;}
inline int GetType( void) const { return m_nType ;}
inline int GetZType( void) const { return m_nZType ;}
inline const Point3d& Orig( void) const { return m_ptOrig ;}
inline const Vector3d& VersX( void) const { return m_vtVersX ;}
inline const Vector3d& VersY( void) const { return m_vtVersY ;}
inline const Vector3d& VersZ( void) const { return m_vtVersZ ;}
private :
void CalculateType( void) ;
private :
Type m_nType ;
Type m_nZType ;
Point3d m_ptOrig ;
Vector3d m_vtVersX ;
Vector3d m_vtVersY ;
Vector3d m_vtVersZ ;
} ;
//----------------------------------------------------------------------------
// Prodotto di due frame (porta il primo dal secondo nel globale)
//----------------------------------------------------------------------------
inline const Frame3d
operator*( const Frame3d& frRef1, const Frame3d& frRef2)
{
Frame3d frRefR ;
frRefR = frRef1 ;
frRefR.ToGlob( frRef2) ;
return frRefR ;
}
//----------------------------------------------------------------------------
// Divisione di due frame (porta il primo dal globale nel secondo)
//----------------------------------------------------------------------------
inline const Frame3d
operator/( const Frame3d& frRef1, const Frame3d& frRef2)
{
Frame3d frRefR ;
frRefR = frRef1 ;
frRefR.ToLoc( frRef2) ;
return frRefR ;
}