diff --git a/EExImportBtl.h b/EExImportBtl.h new file mode 100644 index 0000000..68b3625 --- /dev/null +++ b/EExImportBtl.h @@ -0,0 +1,38 @@ +//---------------------------------------------------------------------------- +// EgalTech 2015-2015 +//---------------------------------------------------------------------------- +// File : EExImportBtl.h Data : 22.08.15 Versione : 1.6h5 +// Contenuto : Dichiarazione della interfaccia IImportBtl. +// +// +// +// Modifiche : 22.08.15 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EgkGeomDB.h" +#include + +//----------------------- Macro per import/export ---------------------------- +#undef EEK_EXPORT +#if defined( I_AM_EEX) // da definirsi solo nella DLL + #define EEX_EXPORT __declspec( dllexport) +#else + #define EEX_EXPORT __declspec( dllimport) +#endif + +//----------------------------------------------------------------------------- +class __declspec( novtable) IImportBtl +{ + public : + virtual ~IImportBtl( void) {} + virtual bool Import( const std::string& sFile, IGeomDB* pGDB) = 0 ; +} ; + +//----------------------------------------------------------------------------- +extern "C" { + EEX_EXPORT IImportBtl* CreateImportBtl( void) ; +} diff --git a/EGkPlane3d.h b/EGkPlane3d.h index 3f49888..195c222 100644 --- a/EGkPlane3d.h +++ b/EGkPlane3d.h @@ -23,6 +23,41 @@ class Plane3d double dDist ; public : + void Translate( const Vector3d& vtMove) + { Point3d ptP = ORIG + dDist * vtN ; + ptP.Translate( vtMove) ; + dDist = ( ptP - ORIG) * vtN ; } + bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dAngDeg) + { double dAngRad = dAngDeg * DEGTORAD ; + return Rotate( ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; } + bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng) + { Point3d ptP = ORIG + dDist * vtN ; + if ( ! ptP.Rotate( ptAx, vtAx, dCosAng, dSinAng) || ! vtN.Rotate( vtAx, dCosAng, dSinAng)) + return false ; + dDist = ( ptP - ORIG) * vtN ; + return true ; } + bool Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ) + { Point3d ptP = ORIG + dDist * vtN ; + Frame3d frOCS ; + if ( ! frOCS.Set( ptP, vtN) || ! frOCS.PseudoScale( frRef, dCoeffX, dCoeffY, dCoeffZ)) + return false ; + vtN = frOCS.VersZ() ; + dDist = ( frOCS.Orig() - ORIG) * vtN ; + return true ; } + bool Mirror( const Point3d& ptOn, const Vector3d& vtNorm) + { Point3d ptP = ORIG + dDist * vtN ; + if ( ! ptP.Mirror( ptOn, vtNorm) || ! vtN.Mirror( vtNorm)) + return false ; + dDist = ( ptP - ORIG) * vtN ; + return true ; } + bool Shear( const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff) + { Point3d ptP = ORIG + dDist * vtN ; + Frame3d frOCS ; + if ( ! frOCS.Set( ptP, vtN) || ! frOCS.PseudoShear( ptOn, vtNorm, vtDir, dCoeff)) + return false ; + vtN = frOCS.VersZ() ; + dDist = ( frOCS.Orig() - ORIG) * vtN ; + return true ; } bool ToGlob( const Frame3d& frRef) { Point3d ptP = ORIG + dDist * vtN ; if ( ! ptP.ToGlob( frRef) || ! vtN.ToGlob( frRef)) @@ -45,9 +80,9 @@ class Plane3d inline bool SetPlane( const Point3d& ptP, const Vector3d& vtN, Plane3d& plPlane) { - if ( vtN.IsSmall()) - return false ; plPlane.vtN = vtN ; + if ( ! plPlane.vtN.Normalize()) + return false ; plPlane.dDist = ( ptP - ORIG) * plPlane.vtN ; return true ; } diff --git a/EGkStmStandard.h b/EGkStmStandard.h index 9aabb75..6165c73 100644 --- a/EGkStmStandard.h +++ b/EGkStmStandard.h @@ -24,8 +24,8 @@ #endif //---------------------------------------------------------------------------- -EGK_EXPORT ISurfTriMesh* GetSurfTriMeshBox( double dWidth, double dLen, double dHeight) ; -EGK_EXPORT ISurfTriMesh* GetSurfTriMeshPyramid( double dWidth, double dLen, double dHeight) ; +EGK_EXPORT ISurfTriMesh* GetSurfTriMeshBox( double dDimX, double dDimY, double dHeight) ; +EGK_EXPORT ISurfTriMesh* GetSurfTriMeshPyramid( double dDimX, double dDimY, double dHeight) ; EGK_EXPORT ISurfTriMesh* GetSurfTriMeshCylinder( double dRadius, double dHeight, double dLinTol) ; EGK_EXPORT ISurfTriMesh* GetSurfTriMeshCone( double dRadius, double dHeight, double dLinTol) ; EGK_EXPORT ISurfTriMesh* GetSurfTriMeshSphere( double dRadius, double dLinTol) ; diff --git a/EInAPI.h b/EInAPI.h index f9f42f9..032920a 100644 --- a/EInAPI.h +++ b/EInAPI.h @@ -84,6 +84,7 @@ EIN_EXPORT BOOL __stdcall EgtImportDxf( const wchar_t* wsFilePath, double dScale EIN_EXPORT BOOL __stdcall EgtImportStl( const wchar_t* wsFilePath, double dScaleFactor) ; EIN_EXPORT BOOL __stdcall EgtImportCnc( const wchar_t* wsFilePath) ; EIN_EXPORT BOOL __stdcall EgtImportCsf( const wchar_t* wsFilePath) ; +EIN_EXPORT BOOL __stdcall EgtImportBtl( const wchar_t* wsFilePath) ; EIN_EXPORT BOOL __stdcall EgtExportDxf( int nId, const wchar_t* wsFilePath) ; EIN_EXPORT BOOL __stdcall EgtExportStl( int nId, const wchar_t* wsFilePath) ; diff --git a/EXeConst.h b/EXeConst.h index 91eaef1..3c74207 100644 --- a/EXeConst.h +++ b/EXeConst.h @@ -14,6 +14,18 @@ #pragma once +//----------------- Costanti per tipo di file ---------------------------------- +enum FileType { FT_NULL = 0, + FT_NGE = 1, + FT_NFE = 2, + FT_DXF = 11, + FT_STL = 12, + FT_CNC = 13, + FT_CSF = 14, + FT_BTL = 15, + FT_TSC = 101, + FT_LUA = 102} ; + //----------------- Costanti tipo di punto selezionato ------------------------- enum EinSep { SEP_STD = 0, SEP_TG = 1, diff --git a/EXeExecutor.h b/EXeExecutor.h index 640aa31..2ea7e71 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -85,6 +85,7 @@ EXE_EXPORT bool ExeImportDxf( const std::string& sFilePath, double dScaleFactor) EXE_EXPORT bool ExeImportStl( const std::string& sFilePath, double dScaleFactor) ; EXE_EXPORT bool ExeImportCnc( const std::string& sFilePath) ; EXE_EXPORT bool ExeImportCsf( const std::string& sFilePath) ; +EXE_EXPORT bool ExeImportBtl( const std::string& sFilePath) ; EXE_EXPORT bool ExeExportDxf( int nId, const std::string& sFilePath) ; EXE_EXPORT bool ExeExportStl( int nId, const std::string& sFilePath) ;