d7a307339e
- aggiunte ad interfacce.
60 lines
2.9 KiB
C++
60 lines
2.9 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2013-2014
|
|
//----------------------------------------------------------------------------
|
|
// File : EgkStringUtils3d.h Data : 10.03.14 Versione : 1.5c3
|
|
// Contenuto : Dichiarazione delle funzioni di utilità 3d per le stringhe.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 31.01.14 DS Creazione modulo.
|
|
// 10.03.14 DS Aggiunte lettura/scrittura Frame3d.
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "/EgtDev/Include/EGnStringUtils.h"
|
|
#include "/EgtDev/Include/EGkFrame3d.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
|
|
|
|
//----------------------------------------------------------------------------
|
|
EGK_EXPORT bool FromString( const std::string& sVal, Vector3d& vtVal) ;
|
|
EGK_EXPORT bool FromString( const std::string& sVal, Point3d& ptVal) ;
|
|
EGK_EXPORT bool FromString( const std::string& sVal, Point3d& ptVal, double& dW) ;
|
|
EGK_EXPORT bool FromString( const std::string& sVal, Frame3d& frFrame) ;
|
|
inline const std::string
|
|
ToString( const Vector3d& vtVal, int nPrec = 9)
|
|
{ std::string sBuff ;
|
|
sBuff.reserve( 3 * 32 + 2) ;
|
|
sBuff = ToString( vtVal.x, nPrec) + ',' + ToString( vtVal.y, nPrec) + ',' + ToString( vtVal.z, nPrec) ;
|
|
return sBuff ; }
|
|
inline const std::string
|
|
ToString( const Point3d& ptVal, int nPrec = 6)
|
|
{ std::string sBuff ;
|
|
sBuff.reserve( 3 * 32 + 2) ;
|
|
sBuff = ToString( ptVal.x, nPrec) + ',' + ToString( ptVal.y, nPrec) + ',' + ToString( ptVal.z, nPrec) ;
|
|
return sBuff ; }
|
|
inline const std::string
|
|
ToString( const Point3d& ptVal, double dW, int nPrec = 6)
|
|
{ std::string sBuff ;
|
|
sBuff.reserve( 3 * 32 + 2) ;
|
|
sBuff = ToString( ptVal.x, nPrec) + ',' + ToString( ptVal.y, nPrec) + ',' + ToString( ptVal.z, nPrec) +
|
|
',' + ToString( dW, nPrec) ;
|
|
return sBuff ; }
|
|
inline const std::string
|
|
ToString( const Frame3d& frF, int nPrecP = 6, int nPrecV = 9)
|
|
{ std::string sBuff ;
|
|
sBuff.reserve( 12 * 32 + 2) ;
|
|
sBuff = ToString( frF.Orig().x, nPrecP) + ',' + ToString( frF.Orig().y, nPrecP) + ',' + ToString( frF.Orig().z, nPrecP) + ',' +
|
|
ToString( frF.VersX().x, nPrecV) + ',' + ToString( frF.VersX().y, nPrecV) + ',' + ToString( frF.VersX().z, nPrecV) + ',' +
|
|
ToString( frF.VersY().x, nPrecV) + ',' + ToString( frF.VersY().y, nPrecV) + ',' + ToString( frF.VersY().z, nPrecV) + ',' +
|
|
ToString( frF.VersZ().x, nPrecV) + ',' + ToString( frF.VersZ().y, nPrecV) + ',' + ToString( frF.VersZ().z, nPrecV) ;
|
|
return sBuff ; }
|