Include : Prime modifiche per ApproxWithLines.
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2013-2013
|
||||
//----------------------------------------------------------------------------
|
||||
// File : EGkDistPointLine.h Data : 17.12.13 Versione : 1.4l1
|
||||
// Contenuto : Dichiarazione dell'oggetto distanza punto da linea/segmento.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Modifiche : 30.12.12 DS Creazione modulo.
|
||||
//
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "/EgtDev/Include/EGkPoint3d.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 DistPointLine
|
||||
{
|
||||
public :
|
||||
EGK_EXPORT DistPointLine( void) ;
|
||||
|
||||
public :
|
||||
EGK_EXPORT bool Set( const Point3d& ptP, const Point3d& ptIni, const Point3d& ptFin, bool bIsSegment) ;
|
||||
EGK_EXPORT bool SetPoint( const Point3d& ptP) ;
|
||||
EGK_EXPORT bool SetLine( const Point3d& ptIni, const Point3d& ptFin, bool bIsSegment) ;
|
||||
EGK_EXPORT double GetSqDist( void) ;
|
||||
EGK_EXPORT double GetDist( void) ;
|
||||
EGK_EXPORT const Point3d& GetPointMinDist( void) ;
|
||||
|
||||
private :
|
||||
bool Calculate( void) ;
|
||||
|
||||
private :
|
||||
Point3d m_ptP ;
|
||||
Point3d m_ptIni ;
|
||||
Vector3d m_vtDir ;
|
||||
double m_dLen ;
|
||||
bool m_bIsSegment ;
|
||||
double m_dSqDist ;
|
||||
double m_dDist ;
|
||||
Point3d m_ptMinDist ;
|
||||
} ;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2013-2013
|
||||
//----------------------------------------------------------------------------
|
||||
// File : EgkVersion.h Data : 21.11.13 Versione : 1.3a1
|
||||
// Contenuto : Prototipo funzione con info versione della DLL.
|
||||
// File : EgkDllMain.h Data : 18.12.13 Versione : 1.4l2
|
||||
// Contenuto : Prototipi funzioni generali della DLL.
|
||||
//
|
||||
//
|
||||
//
|
||||
@@ -14,6 +14,7 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
class ILogger ;
|
||||
|
||||
//----------------------- Macro per import/export ----------------------------
|
||||
#undef EGK_EXPORT
|
||||
@@ -24,4 +25,7 @@
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// restituisce la versione della Dll (stringa del tipo 1.4a5)
|
||||
EGK_EXPORT const char* GetEGkVersion( void) ;
|
||||
// permette di impostare il logger per la Dll
|
||||
EGK_EXPORT void SetEGkLogger( ILogger* pLogger) ;
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
class _declspec( novtable) IGdbIterator
|
||||
class __declspec( novtable) IGdbIterator
|
||||
{
|
||||
public :
|
||||
virtual ~IGdbIterator( void) {}
|
||||
|
||||
@@ -38,3 +38,9 @@ const double SIN_EPS_ANG_SMALL = EPS_ANG_SMALL * DEGTORAD ;
|
||||
const double SIN_EPS_ANG_ZERO = EPS_ANG_ZERO * DEGTORAD ;
|
||||
const double COS_ORTO_ANG_SMALL = SIN_EPS_ANG_SMALL ;
|
||||
const double COS_ORTO_ANG_ZERO = SIN_EPS_ANG_ZERO ;
|
||||
|
||||
// tolleranza lineare minima in approssimazioni lineari
|
||||
const double LIN_TOL_MIN = 0.01 ;
|
||||
|
||||
// deviazione angolare minima (in gradi) in approssimazioni lineari
|
||||
const double ANG_TOL_MIN_DEG = 0.1 ;
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
#include "/EgtDev/Include/EGkGeoObj.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
class _declspec( novtable) IGeoFrame3d : public IGeoObj
|
||||
class __declspec( novtable) IGeoFrame3d : public IGeoObj
|
||||
{
|
||||
public :
|
||||
virtual bool Set( const Point3d& ptOrig, const Vector3d& vtDirX,
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
class _declspec( novtable) IGeoObj
|
||||
class __declspec( novtable) IGeoObj
|
||||
{
|
||||
public :
|
||||
virtual ~IGeoObj( void) {}
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
#include "/EgtDev/Include/EGkGeoObj.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
class _declspec( novtable) IGeoPoint3d : public IGeoObj
|
||||
class __declspec( novtable) IGeoPoint3d : public IGeoObj
|
||||
{
|
||||
public :
|
||||
virtual bool Set( const Point3d& ptP) = 0 ;
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2013-2013
|
||||
//----------------------------------------------------------------------------
|
||||
// File : EgkGeoType.h Data : 17.12.13 Versione : 1.4l1
|
||||
// Contenuto : Tipi generali per calcoli geometrici.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Modifiche : 17.12.13 DS Creazione modulo.
|
||||
//
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "/EgtDev/Include/EGkPoint3d.h"
|
||||
#include <vector>
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
typedef std::vector<Point3d> PNTVECTOR ; // vettore di punti
|
||||
typedef std::vector<Vector3d> VECVECTOR ; // vettore di vettori geometrici
|
||||
typedef std::pair<double,Point3d> UPOINT ; // coppia parametro, punto
|
||||
typedef std::vector<UPOINT> UPNTVECTOR ; // vettore di coppie parametro, punto
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
#include "/EgtDev/Include/EGkGeoObj.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
class _declspec( novtable) IGeoVector3d : public IGeoObj
|
||||
class __declspec( novtable) IGeoVector3d : public IGeoObj
|
||||
{
|
||||
public :
|
||||
virtual bool Set( const Vector3d& vtV) = 0 ;
|
||||
|
||||
+2
-3
@@ -27,12 +27,11 @@
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
class _declspec( novtable) IGeomDB
|
||||
class __declspec( novtable) IGeomDB
|
||||
{
|
||||
public :
|
||||
virtual ~IGeomDB( void) {}
|
||||
virtual bool Init( ILogger* pLogger) = 0 ;
|
||||
virtual bool ReInit( void) = 0 ;
|
||||
virtual bool Init( void) = 0 ;
|
||||
virtual bool Clear( void) = 0 ;
|
||||
virtual bool Load( const std::string& sFileIn) = 0 ;
|
||||
virtual bool Save( const std::string& sFileOut) const = 0 ;
|
||||
|
||||
+12
-11
@@ -30,14 +30,15 @@ class Frame3d ;
|
||||
class EGK_EXPORT Point3d
|
||||
{
|
||||
public :
|
||||
inline Point3d( double dX, double dY, double dZ) { x = dX ; y = dY ; z = dZ ;}
|
||||
inline Point3d( double dX, double dY) { x = dX ; y = dY ; z = 0 ;}
|
||||
inline Point3d( void) { x = 0 ; y = 0 ; z = 0 ;}
|
||||
inline void Set( double dX, double dY, double dZ) { x = dX ; y = dY ; z = dZ ;}
|
||||
inline const Point3d& operator =( const Point3d& ptSrc)
|
||||
{ if ( &ptSrc != this) {
|
||||
x = ptSrc.x , y = ptSrc.y , z = ptSrc.z ; }
|
||||
return *this ; }
|
||||
Point3d( double dX, double dY, double dZ) { x = dX ; y = dY ; z = dZ ;}
|
||||
Point3d( double dX, double dY) { x = dX ; y = dY ; z = 0 ;}
|
||||
Point3d( void) { x = 0 ; y = 0 ; z = 0 ;}
|
||||
void Set( double dX, double dY, double dZ) { x = dX ; y = dY ; z = dZ ;}
|
||||
const Point3d& operator =( const Point3d& ptSrc)
|
||||
{ if ( &ptSrc != this) {
|
||||
x = ptSrc.x , y = ptSrc.y , z = ptSrc.z ; }
|
||||
return *this ; }
|
||||
|
||||
public :
|
||||
void Translate( const Vector3d& vtMove) ;
|
||||
bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dAngRad) ;
|
||||
@@ -135,7 +136,7 @@ Media( const Point3d& ptP1, const Point3d& ptP2, double dCoeff)
|
||||
// Quadrato della distanza tra due punti
|
||||
//----------------------------------------------------------------------------
|
||||
inline double
|
||||
DistSq( const Point3d& ptP1, const Point3d& ptP2)
|
||||
SqDist( const Point3d& ptP1, const Point3d& ptP2)
|
||||
{
|
||||
double dX = ptP1.x - ptP2.x ;
|
||||
double dY = ptP1.y - ptP2.y ;
|
||||
@@ -170,7 +171,7 @@ Dist( const Point3d& ptP1, const Point3d& ptP2)
|
||||
inline bool
|
||||
AreSamePointNear( const Point3d& ptP1, const Point3d& ptP2)
|
||||
{
|
||||
return ( DistSq( ptP1, ptP2) < ( EPS_SMALL * EPS_SMALL)) ;
|
||||
return ( SqDist( ptP1, ptP2) < ( EPS_SMALL * EPS_SMALL)) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -179,5 +180,5 @@ AreSamePointNear( const Point3d& ptP1, const Point3d& ptP2)
|
||||
inline bool
|
||||
AreSamePointExact( const Point3d& ptP1, const Point3d& ptP2)
|
||||
{
|
||||
return ( DistSq( ptP1, ptP2) < ( EPS_ZERO * EPS_ZERO)) ;
|
||||
return ( SqDist( ptP1, ptP2) < ( EPS_ZERO * EPS_ZERO)) ;
|
||||
}
|
||||
|
||||
+12
-11
@@ -42,18 +42,18 @@ class EGK_EXPORT Vector3d
|
||||
void FromPolar( double dLen, double dAngDeg) ;
|
||||
|
||||
public :
|
||||
double LenSq( void) const ;
|
||||
double SqLen( void) const ;
|
||||
double Len( void) const ;
|
||||
inline bool IsSmall( void) const
|
||||
{ return ( ( x * x + y * y + z * z) < ( EPS_SMALL * EPS_SMALL)) ; }
|
||||
inline bool IsZero( void) const
|
||||
{ return ( ( x * x + y * y + z * z) < ( EPS_ZERO * EPS_ZERO)) ; }
|
||||
inline bool IsNormalized( void) const
|
||||
{ return ( fabs( 1.0 - (x * x + y * y + z * z)) < ( 2 * EPS_ZERO)) ; }
|
||||
inline bool IsZplus( void) const
|
||||
{ return ( fabs( x) < EPS_ZERO && fabs( y) < EPS_ZERO && z > EPS_ZERO) ; }
|
||||
inline bool IsZminus( void) const
|
||||
{ return ( fabs( x) < EPS_ZERO && fabs( y) < EPS_ZERO && z < - EPS_ZERO) ; }
|
||||
bool IsSmall( void) const
|
||||
{ return ( ( x * x + y * y + z * z) < ( EPS_SMALL * EPS_SMALL)) ; }
|
||||
bool IsZero( void) const
|
||||
{ return ( ( x * x + y * y + z * z) < ( EPS_ZERO * EPS_ZERO)) ; }
|
||||
bool IsNormalized( void) const
|
||||
{ return ( fabs( 1.0 - (x * x + y * y + z * z)) < ( 2 * EPS_ZERO)) ; }
|
||||
bool IsZplus( void) const
|
||||
{ return ( fabs( x) < EPS_ZERO && fabs( y) < EPS_ZERO && z > EPS_ZERO) ; }
|
||||
bool IsZminus( void) const
|
||||
{ return ( fabs( x) < EPS_ZERO && fabs( y) < EPS_ZERO && z < - EPS_ZERO) ; }
|
||||
void ToSpherical( double* pdLen, double* pdAngVertDeg, double* pdAngOrizzDeg) const ;
|
||||
bool Normalize( void) ;
|
||||
bool Rotate( const Vector3d& vtAx, double dAngRad) ;
|
||||
@@ -62,6 +62,7 @@ class EGK_EXPORT Vector3d
|
||||
bool Mirror( const Vector3d& vtNorm) ;
|
||||
bool ToGlob( const Frame3d& frRef) ;
|
||||
bool ToLoc( const Frame3d& frRef) ;
|
||||
bool GetAngle( const Vector3d& vtEnd, double& dAngDeg) ;
|
||||
bool GetRotation( const Vector3d& vtEnd, const Vector3d& vtAx, double& dAngDeg, bool& bDet) ;
|
||||
|
||||
public :
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2013-2013
|
||||
//----------------------------------------------------------------------------
|
||||
// File : EgnVersion.h Data : 21.11.13 Versione : 1.3a1
|
||||
// Contenuto : Prototipo funzione con info versione della DLL.
|
||||
// File : EgnDllMain.h Data : 21.11.13 Versione : 1.4l2
|
||||
// Contenuto : Prototipi funzioni generali della DLL.
|
||||
//
|
||||
//
|
||||
//
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
#include "/EgtDev/Include/EGkGeoObj.h"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
class _declspec( novtable) ICurve : public IGeoObj
|
||||
class __declspec( novtable) ICurve : public IGeoObj
|
||||
{
|
||||
public :
|
||||
virtual bool IsSimple( void) const = 0 ;
|
||||
|
||||
+3
-1
@@ -14,9 +14,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "/EgtDev/Include/EGkCurve.h"
|
||||
#include "/EgtDev/Include/EGkGeoType.h"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
class _declspec( novtable) ICurveArc : public ICurve
|
||||
class __declspec( novtable) ICurveArc : public ICurve
|
||||
{
|
||||
public :
|
||||
virtual bool Set( const Point3d& ptCen, const Vector3d& vtN, double dRad,
|
||||
@@ -30,6 +31,7 @@ class _declspec( novtable) ICurveArc : public ICurve
|
||||
virtual double GetRadius( void) const = 0 ;
|
||||
virtual double GetAngCenter( void) const = 0 ;
|
||||
virtual double GetDeltaN( void) const = 0 ;
|
||||
virtual bool ApproxWithLines( double dLinTol, double dAngTolDeg, UPNTVECTOR& vUPoints) const = 0 ;
|
||||
} ;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
+4
-1
@@ -14,11 +14,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "/EgtDev/Include/EGkCurve.h"
|
||||
#include "/EgtDev/Include/EGkGeoType.h"
|
||||
|
||||
class ICurveArc ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
class _declspec( novtable) ICurveBezier : public ICurve
|
||||
class __declspec( novtable) ICurveBezier : public ICurve
|
||||
{
|
||||
public :
|
||||
virtual bool Init( int nDeg, bool bIsRational) = 0 ;
|
||||
@@ -29,6 +30,8 @@ class _declspec( novtable) ICurveBezier : public ICurve
|
||||
virtual bool IsRational( void) const = 0 ;
|
||||
virtual const Point3d& GetControlPoint( int nInd, bool* pbOk = NULL) const = 0 ;
|
||||
virtual double GetControlWeight( int nInd, bool* pbOk = NULL) const = 0 ;
|
||||
virtual bool GetControlPolygonLength( double& dLen) const = 0 ;
|
||||
virtual bool ApproxWithLines( double dLinTol, double dAngTolDeg, UPNTVECTOR& vUPoints) const = 0 ;
|
||||
} ;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
#include "/EgtDev/Include/EGkCurve.h"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
class _declspec( novtable) ICurveComposite : public ICurve
|
||||
class __declspec( novtable) ICurveComposite : public ICurve
|
||||
{
|
||||
public :
|
||||
virtual bool Clear( void) = 0 ;
|
||||
|
||||
+3
-1
@@ -14,14 +14,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "/EgtDev/Include/EGkCurve.h"
|
||||
#include "/EgtDev/Include/EGkGeoType.h"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
class _declspec( novtable) ICurveLine : public ICurve
|
||||
class __declspec( novtable) ICurveLine : public ICurve
|
||||
{
|
||||
public :
|
||||
virtual bool Set( const Point3d& ptStart, const Point3d& ptEnd) = 0 ;
|
||||
virtual const Point3d& GetStart( void) const = 0 ;
|
||||
virtual const Point3d& GetEnd( void) const = 0 ;
|
||||
virtual bool ApproxWithLines( double dLinTol, double dAngTolDeg, UPNTVECTOR& vUPoints) const = 0 ;
|
||||
} ;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
+2
-2
@@ -26,11 +26,11 @@
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
class _declspec( novtable) IGdbExecutor : public ICmdExecutor
|
||||
class __declspec( novtable) IGdbExecutor : public ICmdExecutor
|
||||
{
|
||||
public :
|
||||
virtual ~IGdbExecutor( void) {}
|
||||
virtual bool Init( IGeomDB* pGdb, ILogger* pLogger) = 0 ;
|
||||
virtual bool Init( IGeomDB* pGdb) = 0 ;
|
||||
} ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
#include "/EgtDev/Include/EgnStringBase.h"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
class _declspec( novtable) ICmdExecutor
|
||||
class __declspec( novtable) ICmdExecutor
|
||||
{
|
||||
public :
|
||||
virtual bool Execute( const std::string& sCmd1, const std::string& sCmd2, const STRVECTOR& vsParams) = 0 ;
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
class _declspec( novtable) ICmdParser
|
||||
class __declspec( novtable) ICmdParser
|
||||
{
|
||||
public :
|
||||
virtual ~ICmdParser( void) {}
|
||||
|
||||
+8
-5
@@ -17,12 +17,14 @@
|
||||
#define LOG_DATETIME( pLog, szText) if ( (pLog) != nullptr) \
|
||||
(pLog)->Log( LL_INFO, LI_DATETIME, nullptr, 0, nullptr, szText) ;
|
||||
#define LOG_INFO( pLog, szText) if ( (pLog) != nullptr) \
|
||||
(pLog)->Log( LL_INFO, 0, nullptr, 0, nullptr, szText) ;
|
||||
(pLog)->Log( LL_INFO, LI_NONE, nullptr, 0, nullptr, szText) ;
|
||||
#define LOG_WARN( pLog, szText) if ( (pLog) != nullptr) \
|
||||
((pLog)->Log( LL_WARN, 0, nullptr, 0, nullptr, szText) ;
|
||||
((pLog)->Log( LL_WARN, LI_NONE, nullptr, 0, nullptr, szText) ;
|
||||
#define LOG_ERROR( pLog, szText) if ( (pLog) != nullptr) \
|
||||
(pLog)->Log( LL_ERROR, 0, nullptr, 0, nullptr, szText) ;
|
||||
#define LOG_DEBUG( pLog, szText) if ( (pLog) != nullptr) \
|
||||
(pLog)->Log( LL_ERROR, LI_NONE, nullptr, 0, nullptr, szText) ;
|
||||
#define LOG_DBG_INFO( pLog, szText) if ( (pLog) != nullptr) \
|
||||
(pLog)->Log( LL_DEBUG, LI_NONE, nullptr, 0, nullptr, szText) ;
|
||||
#define LOG_DBG_ERR( pLog, szText) if ( (pLog) != nullptr) \
|
||||
(pLog)->Log( LL_DEBUG, __FILE__, __LINE__, __FUNCTION__, szText) ;
|
||||
#define LOG( pLog, nLev, nItem, szText) if ( (pLog) != nullptr) \
|
||||
(pLog)->Log( nLev, nItem, __FILE__, __LINE__, __FUNCTION__, szText) ;
|
||||
@@ -39,6 +41,7 @@ enum LogLevel
|
||||
//----------------------------------------------------------------------------
|
||||
enum LogItem
|
||||
{
|
||||
LI_NONE = 0x0,
|
||||
LI_FILENAME = 0x1,
|
||||
LI_LINENUMBER = 0x2,
|
||||
LI_FUNCTION = 0x4,
|
||||
@@ -49,7 +52,7 @@ enum LogItem
|
||||
} ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
class _declspec( novtable) ILogger
|
||||
class __declspec( novtable) ILogger
|
||||
{
|
||||
public :
|
||||
virtual void Log( LogLevel nLevel, const char* szFile, int nLine, const char* szFunc, const char* szText) = 0 ;
|
||||
|
||||
Reference in New Issue
Block a user