From 278594d35a7ff45b1a1145d0fe2a08b3bc6a6e9b Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 12 Aug 2014 07:51:33 +0000 Subject: [PATCH] Include : - aggiornamenti interfacce - aggiunti export DXF e STL. --- EExExportConst.h | 26 ++++++++++++++++++++++++++ EExExportDxf.h | 38 ++++++++++++++++++++++++++++++++++++++ EExExportStl.h | 38 ++++++++++++++++++++++++++++++++++++++ EGkGdbIterator.h | 2 +- EGkPolyLine.h | 2 +- EGkVector3d.h | 2 ++ EgkCurveAux.h | 4 ++-- EgkSurfTriMesh.h | 20 ++++++++++++-------- 8 files changed, 120 insertions(+), 12 deletions(-) create mode 100644 EExExportConst.h create mode 100644 EExExportDxf.h create mode 100644 EExExportStl.h diff --git a/EExExportConst.h b/EExExportConst.h new file mode 100644 index 0000000..f7f10e4 --- /dev/null +++ b/EExExportConst.h @@ -0,0 +1,26 @@ +//---------------------------------------------------------------------------- +// EgalTech 2014-2014 +//---------------------------------------------------------------------------- +// File : EExExportConst.h Data : 07.08.14 Versione : 1.5h2 +// Contenuto : Costanti per esportazione. +// +// +// +// Modifiche : 07.08.14 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +//----------------------------------------------------------------------------- +enum EExFilter { EEXFLT_NONE = 0x0000, + EEXFLT_LEVUSER = 0x0001, EEXFLT_LEVSYSTEM = 0x0002, EEXFLT_LEVTEMP = 0x0004, + EEXFLT_MODESTD = 0x0008, EEXFLT_MODELOCKED = 0x0010, EEXFLT_MODEHIDDEN = 0x00020, + EEXFLT_STAOFF = 0x0040, EEXFLT_STAON = 0x0080, EEXFLT_STASEL = 0x00100} ; +const int EEXFLT_DEFAULT = EEXFLT_LEVUSER | EEXFLT_MODESTD | EEXFLT_STAON | EEXFLT_STASEL ; + +//----------------------------------------------------------------------------- +enum EExFlag { EEXFLAG_NONE = 0x0000, + EEXFLAG_COMP_LAYER = 0x0001, + EEXFLAG_COL_BY_LAYER = 0x0002} ; diff --git a/EExExportDxf.h b/EExExportDxf.h new file mode 100644 index 0000000..b3c225a --- /dev/null +++ b/EExExportDxf.h @@ -0,0 +1,38 @@ +//---------------------------------------------------------------------------- +// EgalTech 2014-2014 +//---------------------------------------------------------------------------- +// File : EExExportDxf.h Data : 07.08.14 Versione : 1.5h2 +// Contenuto : Dichiarazione della interfaccia IExportDxf. +// +// +// +// Modifiche : 07.08.14 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EgkGeomDB.h" +#include "/EgtDev/Include/EExExportConst.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) IExportDxf +{ + public : + virtual ~IExportDxf( void) {} + virtual bool SetOptions( int nFilter, int nFlag) = 0 ; + virtual bool Export( IGeomDB* pGDB, int nId, const std::string& sFile) = 0 ; +} ; + +//----------------------------------------------------------------------------- +EEX_EXPORT IExportDxf* CreateExportDxf( void) ; diff --git a/EExExportStl.h b/EExExportStl.h new file mode 100644 index 0000000..3a3629a --- /dev/null +++ b/EExExportStl.h @@ -0,0 +1,38 @@ +//---------------------------------------------------------------------------- +// EgalTech 2014-2014 +//---------------------------------------------------------------------------- +// File : EExExportStl.h Data : 07.08.14 Versione : 1.5h2 +// Contenuto : Dichiarazione della interfaccia IExportStl. +// +// +// +// Modifiche : 07.08.14 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EgkGeomDB.h" +#include "/EgtDev/Include/EExExportConst.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) IExportStl +{ + public : + virtual ~IExportStl( void) {} + virtual bool SetOptions( int nFilter) = 0 ; + virtual bool Export( IGeomDB* pGDB, int nId, const std::string& sFile) = 0 ; +} ; + +//----------------------------------------------------------------------------- +EEX_EXPORT IExportStl* CreateExportStl( void) ; diff --git a/EGkGdbIterator.h b/EGkGdbIterator.h index c0bafd7..aad88bb 100644 --- a/EGkGdbIterator.h +++ b/EGkGdbIterator.h @@ -29,7 +29,7 @@ class __declspec( novtable) IGdbIterator public : virtual ~IGdbIterator( void) {} virtual bool SetGDB( IGeomDB* pGDB) = 0 ; - virtual IGeomDB* GetGDB( void) = 0 ; + virtual IGeomDB* GetGDB( void) const = 0 ; virtual bool GoTo( int nId) = 0 ; virtual bool GoToFirstInGroup( int nIdGroup) = 0 ; virtual bool GoToFirstInGroup( const IGdbIterator& iIter) = 0 ; diff --git a/EGkPolyLine.h b/EGkPolyLine.h index 5598d48..65bdb31 100644 --- a/EGkPolyLine.h +++ b/EGkPolyLine.h @@ -86,7 +86,7 @@ class PolyLine { return GetLastULine( nullptr, &ptIni, nullptr, &ptFin) ; } EGK_EXPORT bool GetPrevLine( Point3d& ptIni, Point3d& ptFin) const { return GetPrevULine( nullptr, &ptIni, nullptr, &ptFin) ; } - EGK_EXPORT bool IsPlanar( Plane3d& plPlane, double& dArea, double dToler = EPS_SMALL) const ; + EGK_EXPORT bool IsFlat( Plane3d& plPlane, double& dArea, double dToler = EPS_SMALL) const ; EGK_EXPORT bool GetApproxLength( double& dLen) const ; EGK_EXPORT bool GetLength( double& dLen) const ; EGK_EXPORT bool GetAreaXY( double& dArea) const ; diff --git a/EGkVector3d.h b/EGkVector3d.h index 6002c35..b20797a 100644 --- a/EGkVector3d.h +++ b/EGkVector3d.h @@ -141,6 +141,8 @@ class EGK_EXPORT Vector3d //---------------------------------------------------------------------------- // Vettori notevoli //---------------------------------------------------------------------------- +//! Vettore nullo +const Vector3d V_NULL( 0, 0, 0) ; //! Versore asse X const Vector3d X_AX( 1, 0, 0) ; //! Versore asse Y diff --git a/EgkCurveAux.h b/EgkCurveAux.h index 1729471..146ce3f 100644 --- a/EgkCurveAux.h +++ b/EgkCurveAux.h @@ -42,7 +42,7 @@ struct CNurbsData //---------------------------------------------------------------------------- // Trasforma un arco in una curva di Bezier semplice o composta -EGK_EXPORT bool ArcToBezierCurve( const ICurve* pArc, ICurve*& pCrvNew) ; +EGK_EXPORT ICurve* ArcToBezierCurve( const ICurve* pArc) ; //---------------------------------------------------------------------------- // Rende canonica la rappresentazione della curva Nurbs @@ -50,4 +50,4 @@ EGK_EXPORT bool NurbsCurveCanonicalize( CNurbsData& cnData) ; //---------------------------------------------------------------------------- // Trasforma una curva Nurbs standard in una curva di Bezier semplice o composta -EGK_EXPORT bool NurbsToBezierCurve( const CNurbsData& cnData, ICurve*& pCrvNew) ; +EGK_EXPORT ICurve* NurbsToBezierCurve( const CNurbsData& cnData) ; diff --git a/EgkSurfTriMesh.h b/EgkSurfTriMesh.h index a35e2d2..b40144f 100644 --- a/EgkSurfTriMesh.h +++ b/EgkSurfTriMesh.h @@ -30,8 +30,8 @@ class __declspec( novtable) ISurfTriMesh : public ISurf virtual bool Init( int nNumVert, int nNumTria) = 0 ; virtual void SetLinearTolerance( double dLinTol) = 0 ; virtual void SetSmoothAngle( double dSmoothAngDeg) = 0 ; - virtual int AddVertex( const Point3d& ptVert) = 0 ; - virtual int AddTriangle( const int nIdVert[3]) = 0 ; + virtual int AddVertex( const Point3d& ptVert) = 0 ; + virtual int AddTriangle( const int nIdVert[3]) = 0 ; virtual bool AdjustTopology( void) = 0 ; virtual bool CreateByFlatContour( const PolyLine& PL) = 0 ; virtual bool CreateByExtrusion( const PolyLine& PL, const Vector3d& vtExtr) = 0 ; @@ -42,14 +42,18 @@ class __declspec( novtable) ISurfTriMesh : public ISurf double dAngRot, double dStepRot, double dMove) = 0 ; virtual bool DoCompacting( void) = 0 ; virtual bool DoSewing( const ISurfTriMesh& stmOther, const Frame3d& frOther = GLOB_FRM) = 0 ; - virtual int GetVertexSize( void) const = 0 ; - virtual int GetTriangleSize( void) const = 0 ; + virtual int GetVertexNum( void) const = 0 ; + virtual int GetTriangleNum( void) const = 0 ; + virtual int GetVertexSize( void) const = 0 ; + virtual int GetTriangleSize( void) const = 0 ; virtual double GetLinearTolerance( void) = 0 ; virtual double GetSmoothAngle( void) = 0 ; - virtual int GetFirstVertex( Point3d& ptP) const = 0 ; - virtual int GetNextVertex( int nId, Point3d& ptP) const = 0 ; - virtual int GetFirstTriangle( Triangle3d& Tria) const = 0 ; - virtual int GetNextTriangle( int nId, Triangle3d& Tria) const = 0 ; + virtual int GetFirstVertex( Point3d& ptP) const = 0 ; + virtual int GetNextVertex( int nId, Point3d& ptP) const = 0 ; + virtual int GetFirstTriangle( int nIdVert[3]) const = 0 ; + virtual int GetNextTriangle( int nId, int nIdVert[3]) const = 0 ; + virtual int GetFirstTriangle( Triangle3d& Tria) const = 0 ; + virtual int GetNextTriangle( int nId, Triangle3d& Tria) const = 0 ; virtual bool GetTriangleSmoothNormals( int nId, TriNormals3d& TNrms) const = 0 ; } ;