From 7db74556026aae1e654ef633662421cdf9cc2a53 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 2 Feb 2015 08:19:23 +0000 Subject: [PATCH] Include : - aggiornamento interfacce - aggiunto oggetto per gestire curve temporanee passate in locale. --- EGkCurveLocal.h | 59 ++++++++++++++++++++++++++++++++++++++++++++++ EGkGeomDB.h | 1 + EGkPolyLine.h | 1 + EGkStmFromCurves.h | 35 +++++++++++++++++++++++++++ EInAPI.h | 8 +++++-- 5 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 EGkCurveLocal.h create mode 100644 EGkStmFromCurves.h diff --git a/EGkCurveLocal.h b/EGkCurveLocal.h new file mode 100644 index 0000000..be57b6d --- /dev/null +++ b/EGkCurveLocal.h @@ -0,0 +1,59 @@ +//---------------------------------------------------------------------------- +// EgalTech 2015-2015 +//---------------------------------------------------------------------------- +// File : EGkCurveLocal.h Data : 01.02.15 Versione : 1.6b1 +// Contenuto : Classe gestione curve nel locale desiderato. +// +// +// +// Modifiche : 01.02.15 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EGkCurve.h" +#include "/EgtDEv/Include/EgkGeomDB.h" + +//----------------------------------------------------------------------------- +class CurveLocal +{ + public : + CurveLocal( IGeomDB* pGeomDB, int nCrvId, const Frame3d& frLoc) + : pCrv( nullptr), pCopy( nullptr) + { // verifica dei parametri + if ( pGeomDB == nullptr || &frLoc == nullptr) + return ; + // recupero riferimento della curva + Frame3d frCrv ; + if ( ! pGeomDB->GetGlobFrame( nCrvId, frCrv)) + return ; + // recupero la curva + pCrv = GetCurve( pGeomDB->GetGeoObj( nCrvId)) ; + // se i riferimenti coincidono non devo fare altro + if ( AreSameFrame( frCrv, frLoc)) + return ; + // copio la curva e la porto in locale + pCopy = pCrv->Clone() ; + if ( pCopy == nullptr) { + pCrv = nullptr ; + return ; + } + pCopy->LocToLoc( frCrv, frLoc) ; + pCrv = pCopy ; + } + ~CurveLocal( void) + { // se necessario libero la memoria + if ( pCopy != nullptr) + delete pCopy ; + pCopy = nullptr ; + pCrv = nullptr ; + } + const ICurve* Get( void) + { return pCrv ; } + + private : + const ICurve* pCrv ; + ICurve* pCopy ; +} ; diff --git a/EGkGeomDB.h b/EGkGeomDB.h index aaea740..c5014f8 100644 --- a/EGkGeomDB.h +++ b/EGkGeomDB.h @@ -73,6 +73,7 @@ class __declspec( novtable) IGeomDB virtual bool RelocateGlob( int nId, int nRefId, int nSonBeforeAfter = GDB_SON) = 0 ; virtual bool ChangeId( int nId, int nNewId) = 0 ; virtual bool Erase( int nId) = 0 ; + virtual bool EmptyGroup( int nId) = 0 ; virtual bool Translate( int nId, const Vector3d& vtMove) = 0 ; virtual bool TranslateGlob( int nId, const Vector3d& vtMove) = 0 ; virtual bool TranslateGroup( int nId, const Vector3d& vtMove) = 0 ; diff --git a/EGkPolyLine.h b/EGkPolyLine.h index f380b0e..766b740 100644 --- a/EGkPolyLine.h +++ b/EGkPolyLine.h @@ -103,6 +103,7 @@ class PolyLine EGK_EXPORT bool GetMaxDistanceFromLine( double& dMaxDist, const Point3d& ptAx, const Vector3d& vtAx, double dLen, bool bIsSegment = true) const ; EGK_EXPORT bool AdjustForMaxSegmentLen( double& dMaxLen) ; + EGK_EXPORT bool Invert( bool bInvertU = true) ; private : int m_nRejected ; diff --git a/EGkStmFromCurves.h b/EGkStmFromCurves.h new file mode 100644 index 0000000..3389b8a --- /dev/null +++ b/EGkStmFromCurves.h @@ -0,0 +1,35 @@ +//---------------------------------------------------------------------------- +// EgalTech 2015-2015 +//---------------------------------------------------------------------------- +// File : EGkStmFromCurves.h Data : 01.02.15 Versione : 1.6b1 +// Contenuto : Dichiarazione della classe StmFromTriangleSoup. +// +// +// +// Modifiche : 19.05.14 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EgkCurve.h" +#include "/EgtDev/Include/EGkSurfTriMesh.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 ISurfTriMesh* GetSurfTriMeshByContour( const ICurve& Curve, double dLinTol) ; +EGK_EXPORT ISurfTriMesh* GetSurfTriMeshByExtrusion( const ICurve& Curve, const Vector3d& vtExtr, + bool bCapEnds, double dLinTol = 10 * EPS_SMALL) ; +EGK_EXPORT ISurfTriMesh* GetSurfTriMeshByRevolve( const ICurve& Curve, const Point3d& ptAx, + const Vector3d& vtAx, bool bCapEnds, double dLinTol = 10 * EPS_SMALL) ; +EGK_EXPORT ISurfTriMesh* GetSurfTriMeshByScrewing( const ICurve& Curve, const Point3d& ptAx, const Vector3d& vtAx, + double dAngRotDeg, double dMove, double dLinTol = 10 * EPS_SMALL) ; +EGK_EXPORT ISurfTriMesh* GetSurfTriMeshRuled( const ICurve& Curve1, const ICurve& Curve2, double dLinTol = 10 * EPS_SMALL) ; diff --git a/EInAPI.h b/EInAPI.h index dca8d97..a758e81 100644 --- a/EInAPI.h +++ b/EInAPI.h @@ -144,11 +144,14 @@ EIN_EXPORT int __stdcall EgtCreatePolygonFromSide( int nParentId, int nNumSides // GeomDB Create Surf EIN_EXPORT int __stdcall EgtCreateSurfTriMeshByContour( int nParentId, int nCrvId, double dLinTol) ; EIN_EXPORT int __stdcall EgtCreateSurfTriMeshByExtrusion( int nParentId, int nCrvId, const double vtExtr[3], - double dLinTol, int nRefType) ; + BOOL bCapEnds, double dLinTol, int nRefType) ; +EIN_EXPORT int __stdcall EgtCreateSurfTriMeshByRevolve( int nParentId, int nCrvId, + const double ptAx[3], const double vtAx[3], + BOOL bCapEnds, double dLinTol, int nRefType) ; EIN_EXPORT int __stdcall EgtCreateSurfTriMeshByScrewing( int nParentId, int nCrvId, const double ptAx[3], const double vtAx[3], double dAngRotDeg, double dMove, double dLinTol, int nRefType) ; -EIN_EXPORT int __stdcall EgtCreateSurfTriMeshRuled( int nParentId, int nCrvId1, int nCrvId2, double dLinTol) ; +EIN_EXPORT int __stdcall EgtCreateSurfTriMeshRuled( int nParentId, int nCrvId1, int nCrvId2, double dLinTol) ; // GeomDB PartLayer EIN_EXPORT int __stdcall EgtGetCurrPart( void) ; @@ -185,6 +188,7 @@ EIN_EXPORT BOOL __stdcall EgtRelocate( int nSouId, int nRefId, int nSonBeforeAft EIN_EXPORT BOOL __stdcall EgtRelocateGlob( int nSouId, int nRefId, int nSonBeforeAfter) ; EIN_EXPORT BOOL __stdcall EgtChangeId( int nId, int nNewId) ; EIN_EXPORT BOOL __stdcall EgtErase( int nId) ; +EIN_EXPORT BOOL __stdcall EgtEmptyGroup( int nId) ; EIN_EXPORT int __stdcall EgtGetType( int nId) ; EIN_EXPORT BOOL __stdcall EgtGetTitle( int nId, wchar_t*& wsTitle) ; EIN_EXPORT BOOL __stdcall EgtGroupDump( int nId, wchar_t*& wsDump) ;