diff --git a/EGkGeomDB.h b/EGkGeomDB.h new file mode 100644 index 0000000..15a309b --- /dev/null +++ b/EGkGeomDB.h @@ -0,0 +1,50 @@ +//---------------------------------------------------------------------------- +// EgalTech 2013-2013 +//---------------------------------------------------------------------------- +// File : EGkGeomDB.h Data : 24.11.13 Versione : 1.3a1 +// Contenuto : Dichiarazione della interfaccia IGeomDB. +// +// +// +// Modifiche : 24.11.13 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include +#include "/EgtDev/Include/EGkGeoObj.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 _declspec( novtable) IGeomDB +{ + public : + virtual ~IGeomDB( void) {} + virtual bool Init( void) = 0 ; + virtual bool Clear( void) = 0 ; + virtual bool Load( std::ifstream& osIn) = 0 ; + virtual bool Save( std::ofstream& osOut) = 0 ; + virtual bool ExistsObj( const std::string& sName) = 0 ; + virtual bool AddGeoObj( const std::string& sName, IGeoObj* pGeoObj) = 0 ; + virtual GeoObjType GetObjType( const std::string& sName) = 0 ; + virtual IGeoObj* GetGeoObj( const std::string& sName) = 0 ; + virtual bool Copy( const std::string& sNameSou, const std::string& sNameDest) = 0 ; + virtual bool Erase( const std::string& sName) = 0 ; + virtual bool Translate( const std::string& sName, const Vector3d& vtMove) = 0 ; + virtual bool Rotate( const std::string& sName, const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng) = 0 ; + virtual bool Rotate( const std::string& sName, const Point3d& ptAx, const Vector3d& vtAx, double dAngDeg) = 0 ; + virtual bool Scale( const std::string& sName, const Point3d& ptCen, double dCoeffX, double dCoeffY, double dCoeffZ) = 0 ; + virtual bool Mirror( const std::string& sName, const Point3d& ptOn, const Vector3d& vtNorm) = 0 ; +} ; + +//----------------------------------------------------------------------------- +EGK_EXPORT IGeomDB* CreateGeomDB( void) ; \ No newline at end of file diff --git a/EGnStringBase.h b/EGnStringBase.h new file mode 100644 index 0000000..f9176d3 --- /dev/null +++ b/EGnStringBase.h @@ -0,0 +1,20 @@ +//---------------------------------------------------------------------------- +// EgalTech 2013-2013 +//---------------------------------------------------------------------------- +// File : EgnStringBase.h Data : 25.11.13 Versione : 1.3a1 +// Contenuto : Dichiarazioni di base (costanti, tipi, ...) per le stringhe. +// +// +// +// Modifiche : 25.11.13 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include +#include + +//---------------------------------------------------------------------------- +typedef std::vector STRVECTOR ; diff --git a/EGnStringUtils.h b/EGnStringUtils.h index b82e151..3c6b5f1 100644 --- a/EGnStringUtils.h +++ b/EGnStringUtils.h @@ -13,9 +13,8 @@ #pragma once -#include -#include #include +#include "/EgtDev/Include/EgnStringBase.h" #include "/EgtDEv/Include/EGkPoint3d.h" //----------------------- Macro per import/export ----------------------------- diff --git a/EgkGdbExecutor.h b/EgkGdbExecutor.h new file mode 100644 index 0000000..f5a66cb --- /dev/null +++ b/EgkGdbExecutor.h @@ -0,0 +1,36 @@ +//---------------------------------------------------------------------------- +// EgalTech 2013-2013 +//---------------------------------------------------------------------------- +// File : EgkGdbExecutor.h Data : 25.11.13 Versione : 1.3a1 +// Contenuto : Dichiarazione della interfaccia IGdbExecutor. +// +// +// +// Modifiche : 25.11.13 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EgnCmdExecutor.h" +#include "/EgtDev/Include/EgkGeomDB.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 _declspec( novtable) IGdbExecutor : public ICmdExecutor +{ + public : + virtual ~IGdbExecutor( void) {} + virtual bool Set( IGeomDB* pGdb) = 0 ; +} ; + +//---------------------------------------------------------------------------- +EGK_EXPORT IGdbExecutor* CreateGdbExecutor( void) ; diff --git a/EgnCmdExecutor.h b/EgnCmdExecutor.h new file mode 100644 index 0000000..b0d29fc --- /dev/null +++ b/EgnCmdExecutor.h @@ -0,0 +1,23 @@ +//---------------------------------------------------------------------------- +// EgalTech 2013-2013 +//---------------------------------------------------------------------------- +// File : EgnCmdExecutor.h Data : 25.11.13 Versione : 1.3a1 +// Contenuto : Dichiarazione della interfaccia ICmdExecutor. +// +// +// +// Modifiche : 25.11.13 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EgnStringBase.h" + +//---------------------------------------------------------------------------- +class _declspec( novtable) ICmdExecutor +{ + public : + virtual bool Execute( const std::string& sCmd1, const std::string& sCmd2, const STRVECTOR& vsParams) = 0 ; +} ; diff --git a/EgnCmdParser.h b/EgnCmdParser.h new file mode 100644 index 0000000..83129ea --- /dev/null +++ b/EgnCmdParser.h @@ -0,0 +1,37 @@ +//---------------------------------------------------------------------------- +// EgalTech 2013-2013 +//---------------------------------------------------------------------------- +// File : EgnCmdParser.h Data : 25.11.13 Versione : 1.3a1 +// Contenuto : Dichiarazione della interfaccia ICmdParser. +// +// +// +// Modifiche : 25.11.13 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EgnStringBase.h" +#include "/EgtDev/Include/EgnCmdExecutor.h" + +//----------------------- Macro per import/export ----------------------------- +#undef EGN_EXPORT +#if defined( I_AM_EGN) // da definirsi solo nella DLL + #define EGN_EXPORT __declspec( dllexport) +#else + #define EGN_EXPORT __declspec( dllimport) +#endif + +//---------------------------------------------------------------------------- +class _declspec( novtable) ICmdParser +{ + public : + virtual ~ICmdParser( void) {} + virtual bool Initialize( std::wstring sCmdFile, ICmdExecutor* pCmdExec) = 0 ; + virtual bool Run( void) = 0 ; +} ; + +//----------------------------------------------------------------------------- +EGN_EXPORT ICmdParser* CreateCmdParser( void) ; \ No newline at end of file diff --git a/EgtReleasePointer.h b/EgtReleasePointer.h new file mode 100644 index 0000000..2daa6aa --- /dev/null +++ b/EgtReleasePointer.h @@ -0,0 +1,60 @@ +//---------------------------------------------------------------------------- +// EgalTech 2013-2013 +//---------------------------------------------------------------------------- +// File : EgtReleasePointer.h Data : 25.11.13 Versione : 1.3a1 +// Contenuto : Dichiarazione classe template per puntatore con auto rilascio. +// +// +// +// Modifiche : 25.11.13 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + + +//---------------------------------------------------------------------------- +template +class ReleasePtr +{ + public : + explicit ReleasePtr( T* pT) { m_pT = pT ; } + ~ReleasePtr( void) { if ( m_pT != nullptr) delete m_pT ; m_pT = nullptr ; } + T& operator*() const { return *m_pT ; } + T* operator->() const { return m_pT ; } + + private : + T* m_pT ; + + template friend bool IsValid( ReleasePtr& RPT) ; + template friend T* Get( ReleasePtr& RPT) ; + template friend T* Release( ReleasePtr& RPT) ; +} ; + +//---------------------------------------------------------------------------- +template +bool +IsValid( ReleasePtr& RPT) +{ + return ( RPT.m_pT != nullptr) ; +} + +//---------------------------------------------------------------------------- +template +T* +Get( ReleasePtr& RPT) +{ + return RPT.m_pT ; +} + +//---------------------------------------------------------------------------- +template +T* +Release( ReleasePtr& RPT) +{ + T* pT = RPT.m_pT ; + RPT.m_pT = nullptr ; + return pT ; +} +