Include :

- aggiornamento.
This commit is contained in:
Dario Sassi
2015-02-11 11:47:14 +00:00
parent deb6cbf9cf
commit 11eb3ae854
15 changed files with 99 additions and 37 deletions
+41 -14
View File
@@ -21,7 +21,7 @@ class CurveLocal
{
public :
CurveLocal( IGeomDB* pGeomDB, int nCrvId, const Frame3d& frLoc)
: pCrv( nullptr), pCopy( nullptr)
: m_pCrv( nullptr), m_pCopy( nullptr)
{ // verifica dei parametri
if ( pGeomDB == nullptr || &frLoc == nullptr)
return ;
@@ -30,30 +30,57 @@ class CurveLocal
if ( ! pGeomDB->GetGlobFrame( nCrvId, frCrv))
return ;
// recupero la curva
pCrv = GetCurve( pGeomDB->GetGeoObj( nCrvId)) ;
m_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 ;
m_pCopy = m_pCrv->Clone() ;
if ( m_pCopy == nullptr) {
m_pCrv = nullptr ;
return ;
}
pCopy->LocToLoc( frCrv, frLoc) ;
pCrv = pCopy ;
m_pCopy->LocToLoc( frCrv, frLoc) ;
m_pCrv = m_pCopy ;
}
CurveLocal( const CurveLocal& Other)
: m_pCrv( nullptr), m_pCopy( nullptr)
{ // se non devo clonare
if ( Other.m_pCopy == nullptr) {
m_pCrv = Other.m_pCrv ;
return ;
}
m_pCopy = Other.m_pCopy->Clone() ;
if ( m_pCopy == nullptr)
return ;
m_pCrv = m_pCopy ;
}
CurveLocal( CurveLocal&& Other) _NOEXCEPT
: m_pCrv( Other.m_pCrv), m_pCopy( Other.m_pCopy)
{ // annullo gli originali
Other.m_pCrv = nullptr ;
Other.m_pCopy = nullptr ;
}
~CurveLocal( void)
{ // se necessario libero la memoria
if ( pCopy != nullptr)
delete pCopy ;
pCopy = nullptr ;
pCrv = nullptr ;
if ( m_pCopy != nullptr)
delete m_pCopy ;
m_pCopy = nullptr ;
m_pCrv = nullptr ;
}
const ICurve* Get( void)
{ return pCrv ; }
{ return m_pCrv ; }
private :
const ICurve* pCrv ;
ICurve* pCopy ;
CurveLocal& operator =( const CurveLocal& other) ; // intenzionalmente senza implementazione
CurveLocal& operator =( CurveLocal&& other) ; // intenzionalmente senza implementazione
private :
const ICurve* m_pCrv ;
ICurve* m_pCopy ;
} ;
//----------------------------------------------------------------------------
// Raccolte di CurveLocal
typedef std::vector<CurveLocal> CURVELOCALVECTOR ; // vettore di CurveLocal
typedef std::list<CurveLocal> CURVELOCALLIST ; // lista di CurveLocal
+2
View File
@@ -35,6 +35,7 @@ class PointGrid3d
EGK_EXPORT bool Init( int nBuckets, double dCellDim = 100 * EPS_SMALL) ;
EGK_EXPORT bool InsertPoint( const Point3d& ptP, int nId) ;
EGK_EXPORT bool RemovePoint( const Point3d& ptP, int nId) ;
EGK_EXPORT bool Find( const BBox3d& b3Test, INTVECTOR& vnIds) ;
EGK_EXPORT bool Find( const Point3d& ptTest, double dTol, INTVECTOR& vnIds) ;
EGK_EXPORT bool Find( const Point3d& ptTest, double dTol, int& nId) ;
EGK_EXPORT bool FindNearest( const Point3d& ptTest, INTVECTOR& vnIds) ;
@@ -42,6 +43,7 @@ class PointGrid3d
private :
inline int Get1dCellNbr( double dCoord) ;
inline bool Get3dRangeNbr( const BBox3d& b3Test, IBox& iBox) ;
inline bool Get3dRangeNbr( const Point3d& ptTest, double dTol, IBox& iBox) ;
inline int PointHash( int nX, int nY, int nZ) ;
+3 -2
View File
@@ -14,10 +14,10 @@
#pragma once
#include "/EgtDev/Include/EGkPoint3d.h"
#include "/EgtDev/Include/EGkBBox3d.h"
#include "/EgtDev/Include/EGkPlane3d.h"
#include "/EgtDev/Include/EGkGeoCollection.h"
class Plane3d ;
//----------------------- Macro per import/export ----------------------------
#undef EGK_EXPORT
#if defined( I_AM_EGK) // da definirsi solo nella DLL
@@ -51,6 +51,7 @@ class PolyLine
EGK_EXPORT bool LocToLoc( const Frame3d& frOri, const Frame3d& frDest) ;
EGK_EXPORT bool Join( PolyLine& PL, double dOffsetPar = 0) ;
EGK_EXPORT bool Split( double dU, PolyLine& PL) ;
EGK_EXPORT bool GetLocalBBox( BBox3d& b3Loc) const ;
EGK_EXPORT bool IsClosed( void) const ;
EGK_EXPORT int GetRejectedNbr( void) const
{ return m_nRejected ; }
+8 -5
View File
@@ -25,11 +25,14 @@
#endif
//----------------------------------------------------------------------------
EGK_EXPORT ISurfTriMesh* GetSurfTriMeshByContour( const ICurve& Curve, double dLinTol) ;
EGK_EXPORT ISurfTriMesh* GetSurfTriMeshByExtrusion( const ICurve& Curve, const Vector3d& vtExtr,
EGK_EXPORT ISurfTriMesh* GetSurfTriMeshByFlatContour( const ICurve* pCurve, double dLinTol = 10 * EPS_SMALL) ;
EGK_EXPORT ISurfTriMesh* GetSurfTriMeshByRegion( const ICURVEPVECTOR& vpCurve, double dLinTol = 10 * EPS_SMALL) ;
EGK_EXPORT ISurfTriMesh* GetSurfTriMeshByExtrusion( const ICurve* pCurve, const Vector3d& vtExtr,
bool bCapEnds, double dLinTol = 10 * EPS_SMALL) ;
EGK_EXPORT ISurfTriMesh* GetSurfTriMeshByRevolve( const ICurve& Curve, const Point3d& ptAx,
EGK_EXPORT ISurfTriMesh* GetSurfTriMeshByRegionExtrusion( const ICURVEPVECTOR& vpCurve, const Vector3d& vtExtr,
double dLinTol = 10 * EPS_SMALL) ;
EGK_EXPORT ISurfTriMesh* GetSurfTriMeshByRevolve( const ICurve* pCurve, 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,
EGK_EXPORT ISurfTriMesh* GetSurfTriMeshByScrewing( const ICurve* pCurve, 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) ;
EGK_EXPORT ISurfTriMesh* GetSurfTriMeshRuled( const ICurve* pCurve1, const ICurve* pCurve2, double dLinTol = 10 * EPS_SMALL) ;
+17 -4
View File
@@ -1,19 +1,20 @@
//----------------------------------------------------------------------------
// EgalTech 2014-2014
// EgalTech 2014-2015
//----------------------------------------------------------------------------
// File : EGkTria3d.h Data : 30.03.14 Versione : 1.5c9
// File : EGkTria3d.h Data : 07.02.15 Versione : 1.6b2
// Contenuto : Dichiarazione classe triangolo Triangle3d.
//
//
//
// Modifiche : 30.03.14 DS Creazione modulo.
//
// 07.02.15 DS Agg. GetArea e GetAspectRatio.
//
//----------------------------------------------------------------------------
#pragma once
#include "/EgtDev/Include/EGkPoint3d.h"
#include <algorithm>
//-----------------------------------------------------------------------------
class Triangle3d
@@ -21,7 +22,7 @@ class Triangle3d
public :
Triangle3d( void)
{}
void Set( const Point3d& ptP0, const Point3d& ptP1, const Point3d& ptP2)
void Set( const Point3d& ptP0, const Point3d& ptP1, const Point3d& ptP2)
{ ptP[0] = ptP0 ; ptP[1] = ptP1 ; ptP[2] = ptP2 ; vtN.Set( 0, 0, 0) ; }
void Set( const Point3d& ptP0, const Point3d& ptP1, const Point3d& ptP2, const Vector3d& vtV)
{ ptP[0] = ptP0 ; ptP[1] = ptP1 ; ptP[2] = ptP2 ; vtN = vtV ; }
@@ -59,6 +60,18 @@ class Triangle3d
}
const Vector3d& GetN( void) const
{ return vtN ; }
double GetArea( void) const
{ return (( ptP[1] - ptP[0]) ^ ( ptP[2] - ptP[0])).Len() / 2 ; }
double GetAspectRatio( void) const
{ double dSqDistA = SqDist( ptP[0], ptP[1]) ;
double dSqDistB = SqDist( ptP[1], ptP[2]) ;
double dSqDistC = SqDist( ptP[2], ptP[0]) ;
double dTwoArea = (( ptP[1] - ptP[0]) ^ ( ptP[2] - ptP[0])).Len() ;
if ( dTwoArea < EPS_SMALL * EPS_SMALL)
return INFINITO ;
else
return ( std::max( dSqDistA, std::max( dSqDistB, dSqDistC)) / dTwoArea) ;
}
private :
Point3d ptP[3] ;
+1 -1
View File
@@ -304,7 +304,7 @@ AreOppositeVectorExact( const Vector3d& vtV1, const Vector3d& vtV2)
}
//----------------------------------------------------------------------------
//! Verifica se due vettori sono quasi coincidenti o opposti (Zero error -> Exact)
//! Verifica se due vettori sono quasi coincidenti o opposti (Small error -> Approx)
//----------------------------------------------------------------------------
inline bool
AreSameOrOppositeVectorApprox( const Vector3d& vtV1, const Vector3d& vtV2)
+3 -1
View File
@@ -16,7 +16,9 @@
//-----------------------------------------------------------------------------
#define NOMINMAX
#include <windows.h>
#include <algorithm>
#include <vector>
//-----------------------------------------------------------------------------
@@ -273,7 +275,7 @@ class wcharBuffer
wchar_t* data( void)
{ return m_wBuffer.data() ; }
void terminate( size_t nLen)
{ nLen = min( nLen, m_wBuffer.size() - 1) ;
{ nLen = std::min( nLen, m_wBuffer.size() - 1) ;
m_wBuffer[nLen] = '\0' ; }
private :
+2 -1
View File
@@ -18,8 +18,9 @@
#include "/EgtDev/Include/EGkBBox3d.h"
#include "/EgtDev/Include/EGkColor.h"
#include "/EgtDev/Include/EgtNumCollection.h"
#include <string>
#define NOMINMAX
#include <windows.h>
#include <string>
class IGeomDB ;
class ILogger ;
+11 -6
View File
@@ -13,6 +13,7 @@
#pragma once
#define NOMINMAX
#include <windows.h>
//----------------------- Macro per import/export ----------------------------
@@ -31,7 +32,7 @@ extern "C" {
// API
// General
EIN_EXPORT BOOL __stdcall EgtInit( int nDebug, const wchar_t* sLogFile) ;
EIN_EXPORT BOOL __stdcall EgtInit( int nDebug, const wchar_t* sLogFile, const wchar_t* sLogMsg) ;
EIN_EXPORT BOOL __stdcall EgtExit( void) ;
EIN_EXPORT BOOL __stdcall EgtSetKey( const wchar_t* sKey) ;
EIN_EXPORT BOOL __stdcall EgtSetFont( const wchar_t* sNfeFontDir, const wchar_t* sDefaultFont) ;
@@ -142,15 +143,18 @@ EIN_EXPORT int __stdcall EgtCreatePolygonFromSide( int nParentId, int nNumSides
const double ptFin[3], const double vtN[3], int nRefType) ;
// 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],
BOOL bCapEnds, double dLinTol, int nRefType) ;
EIN_EXPORT int __stdcall EgtCreateSurfTriMeshByFlatContour( int nParentId, int nCrvId, double dLinTol) ;
EIN_EXPORT int __stdcall EgtCreateSurfTriMeshByRegion( int nParentId, int nNumId, const int nCrvIds[], double dLinTol) ;
EIN_EXPORT int __stdcall EgtCreateSurfTriMeshByExtrusion( int nParentId, int nNumId, const int nCrvIds[],
const double vtExtr[3], double dLinTol, int nRefType) ;
EIN_EXPORT int __stdcall EgtCreateSurfTriMeshByRegionExtrusion( int nParentId, int nNumId, const int nCrvIds[],
const double vtExtr[3], 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) ;
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) ;
// GeomDB PartLayer
@@ -267,6 +271,7 @@ EIN_EXPORT BOOL __stdcall EgtTrimCurveStartEndAtParam( int nId, double dParS, do
EIN_EXPORT BOOL __stdcall EgtExtendCurveStartByLen( int nId, double dLen) ;
EIN_EXPORT BOOL __stdcall EgtExtendCurveEndByLen( int nId, double dLen) ;
EIN_EXPORT BOOL __stdcall EgtTrimExtendCurveByLen( int nId, double dLen, const double ptNear[3], int nRefType) ;
EIN_EXPORT BOOL __stdcall EgtSplitCurve( int nId, int nParts) ;
EIN_EXPORT BOOL __stdcall EgtSplitCurveAtPoint( int nId, double ptOn[3], int nRefType) ;
EIN_EXPORT BOOL __stdcall EgtOffsetCurve( int nId, double dDist, int nType) ;
EIN_EXPORT BOOL __stdcall EgtModifyCurveCircleCPN( int nId, const double ptOn[3], int nRefType) ;
+2 -2
View File
@@ -15,8 +15,7 @@
#include "/EgtDev/Include/EGkSurf.h"
#include "/EgtDev/Include/EGkTriangle3d.h"
class PolyLine ;
#include "/EgtDev/Include/EGkPolyLine.h"
//----------------------------------------------------------------------------
const int SVT_NULL = - 1 ; // vertice o triangolo nullo
@@ -34,6 +33,7 @@ class __declspec( novtable) ISurfTriMesh : public ISurf
virtual int AddTriangle( const int nIdVert[3]) = 0 ;
virtual bool AdjustTopology( void) = 0 ;
virtual bool CreateByFlatContour( const PolyLine& PL) = 0 ;
virtual bool CreateByRegion( const POLYLINEVECTOR& vPL) = 0 ;
virtual bool CreateByExtrusion( const PolyLine& PL, const Vector3d& vtExtr) = 0 ;
virtual bool CreateByTwoCurves( const PolyLine& PL1, const PolyLine& PL2) = 0 ;
virtual bool CreateByRevolution( const PolyLine& PL, const Point3d& ptAx, const Vector3d& vtAx,
+1
View File
@@ -13,6 +13,7 @@
#pragma once
#define NOMINMAX
#include <windows.h>
#include <string>
+1
View File
@@ -16,6 +16,7 @@
#include "/EgtDev/Include/EgtILogger.h"
#include <iostream>
#include <vector>
#define NOMINMAX
#include <Windows.h>
#include <time.h>
+5
View File
@@ -16,6 +16,11 @@
#include <vector>
#include <list>
//----------------------------------------------------------------------------
// Raccolte di booleani
typedef std::vector<bool> BOOLVECTOR ; // vettore di bool
typedef std::list<bool> BOOLLIST ; // lista di bool
//----------------------------------------------------------------------------
// Raccolte di interi
typedef std::vector<int> INTVECTOR ; // vettore di interi
+1
View File
@@ -13,6 +13,7 @@
#pragma once
#define NOMINMAX
#include <Windows.h>
//----------------------------------------------------------------------------
+1 -1
View File
@@ -13,7 +13,7 @@
#pragma once
#define NOMINMAX
#include <windows.h>
#if defined( _DEBUG)