From 10da4eae93f47dcbed3dcf97457f401f592114c7 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Thu, 18 Sep 2014 15:00:32 +0000 Subject: [PATCH] Include : - aggiornamenti e aggiunta ImportCNC. --- EExImportCnc.h | 36 ++++++++++++++++++++++++++++++++++++ EGnStringUtils.h | 13 +++++++++---- EgkCurveArc.h | 2 ++ 3 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 EExImportCnc.h diff --git a/EExImportCnc.h b/EExImportCnc.h new file mode 100644 index 0000000..7679aa5 --- /dev/null +++ b/EExImportCnc.h @@ -0,0 +1,36 @@ +//---------------------------------------------------------------------------- +// EgalTech 2014-2014 +//---------------------------------------------------------------------------- +// File : EExImportCnc.h Data : 15.09.14 Versione : 1.5i3 +// Contenuto : Dichiarazione della interfaccia IImportCnc. +// +// +// +// Modifiche : 15.09.14 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EgkGeomDB.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) IImportCnc +{ + public : + virtual ~IImportCnc( void) {} + virtual bool Import( const std::string& sFile, IGeomDB* pGDB, int nIdGroup) = 0 ; +} ; + +//----------------------------------------------------------------------------- +EEX_EXPORT IImportCnc* CreateImportCnc( void) ; \ No newline at end of file diff --git a/EGnStringUtils.h b/EGnStringUtils.h index 66d4813..927545c 100644 --- a/EGnStringUtils.h +++ b/EGnStringUtils.h @@ -66,6 +66,11 @@ IsEmptyOrSpaces( const std::string& sName) { return ( sName.empty() || sName.find_first_not_of( " \t\r\n") == std::string::npos) ; } +//---------------------------------------------------------------------------- +inline bool +IsNullOrSpace( char cChar) + { return ( cChar == '\0' || cChar == ' ' || cChar == '\t' || cChar == '\r' || cChar == '\n') ; } + //---------------------------------------------------------------------------- inline bool IsValidName( const std::string& sName) @@ -88,7 +93,7 @@ FromString( const std::string& sVal, int& nVal) char* pStop ; errno = 0 ; nVal = strtol( pStart, &pStop, 10) ; - return ( pStop != pStart && *pStop == '\0' && errno == 0) ; } + return ( pStop != pStart && errno == 0) ; } inline bool FromString( const std::string& sVal, bool& bVal) { int nTmp ; @@ -102,7 +107,7 @@ FromString( const std::string& sVal, double& dVal) char* pStop ; errno = 0 ; dVal = strtod( pStart, &pStop) ; - return ( pStop != pStart && *pStop == '\0' && errno == 0) ; } + return ( pStop != pStart && errno == 0) ; } template bool FromString( const std::string& sVal, int (&nVal)[size]) { const char* pStart = sVal.c_str() ; @@ -114,7 +119,7 @@ bool FromString( const std::string& sVal, int (&nVal)[size]) return false ; pStart = pStop + 1 ; } - return ( *pStop == '\0' && errno == 0) ; + return ( errno == 0) ; } template bool FromString( const std::string& sVal, double (&dVal)[size]) @@ -127,7 +132,7 @@ bool FromString( const std::string& sVal, double (&dVal)[size]) return false ; pStart = pStop + 1 ; } - return ( *pStop == '\0' && errno == 0) ; + return ( errno == 0) ; } //---------------------------------------------------------------------------- diff --git a/EgkCurveArc.h b/EgkCurveArc.h index dbfe37a..3d28b44 100644 --- a/EgkCurveArc.h +++ b/EgkCurveArc.h @@ -29,7 +29,9 @@ class __declspec( novtable) ICurveArc : public ICurve virtual bool Set2PNB( const Point3d& ptIni, const Point3d& ptFin, const Vector3d& vtN, double dBulge) = 0 ; virtual bool Set2PD( const Point3d& ptStart, const Point3d& ptEnd, double dDirStartDeg) = 0 ; virtual bool Set2PRS( const Point3d& ptStart, const Point3d& ptEnd, double dRad, bool bCCW = true) = 0 ; + virtual bool Set2PNRS( const Point3d& ptStart, const Point3d& ptEnd, const Vector3d& vtN, double dRad, bool bCCW = true) = 0 ; virtual bool SetC2P( const Point3d& ptCen, const Point3d& ptStart, const Point3d& ptNearEnd) = 0 ; + virtual bool SetC2PN( const Point3d& ptCen, const Point3d& ptStart, const Point3d& ptNearEnd, const Vector3d& vtN) = 0 ; virtual bool IsFlat( double dToler = EPS_SMALL) const = 0 ; virtual bool IsACircle( void) const = 0 ; virtual bool IsInPlaneXY( void) const = 0 ;