diff --git a/EGkDistPointCurve.h b/EGkDistPointCurve.h index e0dca1c..b4b5b47 100644 --- a/EGkDistPointCurve.h +++ b/EGkDistPointCurve.h @@ -49,22 +49,23 @@ class DistPointCurve // Il flag bIsSegment vale solo per linee. public : - EGK_EXPORT bool GetSqDist( double& dSqDist) ; - EGK_EXPORT bool GetDist( double& dDist) ; - EGK_EXPORT bool IsEpsilon( double dTol) - { double dSqDist ; return ( GetSqDist( dSqDist) && ( dSqDist < SQ_EPS_ZERO || dSqDist < dTol * dTol)) ; } - EGK_EXPORT bool IsSmall( void) - { return IsEpsilon( EPS_SMALL) ; } - EGK_EXPORT bool IsZero( void) - { return IsEpsilon( EPS_ZERO) ; } - EGK_EXPORT int GetNbrMinDist( void) { return (int) m_Info.size() ; } - EGK_EXPORT bool GetMinDistPoint( int nInd, Point3d& ptMinDist, int& nFlag) ; - EGK_EXPORT bool GetMinDistPoint( double dNearParam, Point3d& ptMinDist, int& nFlag) ; - EGK_EXPORT bool GetParamAtMinDistPoint( int nInd, double& dParam, int& nFlag) ; - EGK_EXPORT bool GetParamAtMinDistPoint( double dNearParam, double& dParam, int& nFlag) ; - EGK_EXPORT bool GetSideAtMinDistPoint( int nInd, const Vector3d& vtN, int& nSide) ; - EGK_EXPORT bool GetSideAtMinDistPoint( double dNearParam, const Vector3d& vtN, int& nSide) ; - EGK_EXPORT bool GetMinDistInfo( int nInd, MinDistPCInfo& aInfo) ; + EGK_EXPORT bool GetSqDist( double& dSqDist) const ; + EGK_EXPORT bool GetDist( double& dDist) const ; + EGK_EXPORT bool IsEpsilon( double dTol) const + { double dSqDist ; return ( GetSqDist( dSqDist) && ( dSqDist < SQ_EPS_ZERO || dSqDist < dTol * dTol)) ; } + EGK_EXPORT bool IsSmall( void) const + { return IsEpsilon( EPS_SMALL) ; } + EGK_EXPORT bool IsZero( void) const + { return IsEpsilon( EPS_ZERO) ; } + EGK_EXPORT int GetNbrMinDist( void) const + { return (int) m_Info.size() ; } + EGK_EXPORT bool GetMinDistPoint( int nInd, Point3d& ptMinDist, int& nFlag) const ; + EGK_EXPORT bool GetMinDistPoint( double dNearParam, Point3d& ptMinDist, int& nFlag) const ; + EGK_EXPORT bool GetParamAtMinDistPoint( int nInd, double& dParam, int& nFlag) const ; + EGK_EXPORT bool GetParamAtMinDistPoint( double dNearParam, double& dParam, int& nFlag) const ; + EGK_EXPORT bool GetSideAtMinDistPoint( int nInd, const Vector3d& vtN, int& nSide) const ; + EGK_EXPORT bool GetSideAtMinDistPoint( double dNearParam, const Vector3d& vtN, int& nSide) const ; + EGK_EXPORT bool GetMinDistInfo( int nInd, MinDistPCInfo& aInfo) const ; private : DistPointCurve( void) ; diff --git a/EGkDistPointSurfTm.h b/EGkDistPointSurfTm.h index c8ec942..43d7a1f 100644 --- a/EGkDistPointSurfTm.h +++ b/EGkDistPointSurfTm.h @@ -37,16 +37,16 @@ class DistPointSurfTm EGK_EXPORT DistPointSurfTm( const Point3d& ptP, const ISurfTriMesh& tmSurf) ; public : - EGK_EXPORT bool GetDist( double& dDist) ; - EGK_EXPORT bool IsEpsilon( double dTol) + EGK_EXPORT bool GetDist( double& dDist) const ; + EGK_EXPORT bool IsEpsilon( double dTol) const { return ( m_dDist >= 0. && ( m_dDist < EPS_ZERO || m_dDist < dTol)) ; } - EGK_EXPORT bool IsSmall( void) + EGK_EXPORT bool IsSmall( void) const { return IsEpsilon( EPS_SMALL) ; } - EGK_EXPORT bool IsZero( void) + EGK_EXPORT bool IsZero( void) const { return IsEpsilon( EPS_ZERO) ; } - EGK_EXPORT bool GetMinDistPoint( Point3d& ptMinDistPoint) ; - EGK_EXPORT bool GetMinDistTriaIndex( int& nMinDistTriaIndex) ; - EGK_EXPORT bool IsPointInside( void) + EGK_EXPORT bool GetMinDistPoint( Point3d& ptMinDistPoint) const ; + EGK_EXPORT bool GetMinDistTriaIndex( int& nMinDistTriaIndex) const ; + EGK_EXPORT bool IsPointInside( void) const { return m_bIsInside ; } private : diff --git a/EGkPolyLine.h b/EGkPolyLine.h index a26e6dd..88de9de 100644 --- a/EGkPolyLine.h +++ b/EGkPolyLine.h @@ -136,8 +136,9 @@ class PolyLine //---------------------------------------------------------------------------- // Raccolte di PolyLine -typedef std::vector POLYLINEVECTOR ; // vettore di PolyLine -typedef std::list POLYLINELIST ; // lista di PolyLine +typedef std::vector POLYLINEVECTOR ; // vettore di PolyLine +typedef std::list POLYLINELIST ; // lista di PolyLine +typedef std::vector POLYLINEMATRIX ; // matrice di PolyLine //---------------------------------------------------------------------------- EGK_EXPORT bool DistPointPolyLine( const Point3d& ptP, const PolyLine& plPoly, double& dDist) ; diff --git a/EGkStmFromTriangleSoup.h b/EGkStmFromTriangleSoup.h index f417910..e444c0a 100644 --- a/EGkStmFromTriangleSoup.h +++ b/EGkStmFromTriangleSoup.h @@ -36,14 +36,13 @@ class StmFromTriangleSoup EGK_EXPORT bool Start( int nBuckets = GRID_STD_BUCKETS) ; EGK_EXPORT bool AddTriangle( const Triangle3d& Tria) ; EGK_EXPORT bool AddTriangle( const Point3d& ptP0, const Point3d& ptP1, const Point3d& ptP2, - const double dU0 = -1, const double dV0 = -1, const double dU1 = -1, const double dV1 = -1, - const double dU2 = -1, const double dV2 = -1) ; + double dU0 = -1, double dV0 = -1, double dU1 = -1, double dV1 = -1, double dU2 = -1, double dV2 = -1) ; EGK_EXPORT bool AddSurfTriMesh( const ISurfTriMesh& stmSource) ; EGK_EXPORT bool End( void) ; EGK_EXPORT ISurfTriMesh* GetSurf( void) ; private : - inline int AddVertex( const Point3d& ptP, const double dU = -1, const double dV = -1) ; + inline int AddVertex( const Point3d& ptP, double dU = -1, double dV = -1) ; private : ISurfTriMesh* m_pSTM ; diff --git a/EGkSurfTriMesh.h b/EGkSurfTriMesh.h index b9def3d..3510e12 100644 --- a/EGkSurfTriMesh.h +++ b/EGkSurfTriMesh.h @@ -43,7 +43,7 @@ class __declspec( novtable) ISurfTriMesh : public ISurf virtual void SetLinearTolerance( double dLinTol) = 0 ; virtual void SetBoundaryAngle( double dBoundaryAngDeg) = 0 ; virtual void SetSmoothAngle( double dSmoothAngDeg) = 0 ; - virtual int AddVertex( const Point3d& ptVert, const double dU = -1, const double dV = -1) = 0 ; + virtual int AddVertex( const Point3d& ptVert, double dU = -1, double dV = -1) = 0 ; virtual bool MoveVertex( int nInd, const Point3d& ptNewVert) = 0 ; virtual int AddTriangle( const int nIdVert[3], int nTFlag = 0) = 0 ; virtual bool RemoveTriangle( int nId) = 0 ; diff --git a/EgtExecMgr.h b/EgtExecMgr.h index 92ad538..c54d5e9 100644 --- a/EgtExecMgr.h +++ b/EgtExecMgr.h @@ -37,7 +37,7 @@ class ExecManager { return m_pExecMap.insert( std::pair< std::string, Exec>( sName, eFunc)).second ; } int Execute( T& Executor, const std::string& sCmd1, const std::string& sCmd2, const STRVECTOR& vsParams) - { KeyExecMap::iterator Iter = m_pExecMap.find( sCmd1) ; + { const auto Iter = m_pExecMap.find( sCmd1) ; if ( Iter != m_pExecMap.end() && (Iter->second) != nullptr) { if ( ( Executor.*(Iter->second))( sCmd2, vsParams)) return ER_OK ; diff --git a/EgtLogger.h b/EgtLogger.h index 3d44e0a..66a6051 100644 --- a/EgtLogger.h +++ b/EgtLogger.h @@ -109,8 +109,7 @@ namespace egtlogger void ClearOutputStreams( void) { - std::vector::iterator iter ; - for ( iter = m_outputStreams.begin(); iter < m_outputStreams.end() ; ++iter) { + for ( auto iter = m_outputStreams.cbegin() ; iter < m_outputStreams.cend() ; ++iter) { if ( iter->bOwned) delete iter->pStream ; } @@ -127,8 +126,7 @@ namespace egtlogger { m_threadProtect.Lock() ; - std::vector::iterator iter ; - for ( iter = m_outputStreams.begin() ; iter < m_outputStreams.end() ; ++iter) { + for ( auto iter = m_outputStreams.cbegin() ; iter < m_outputStreams.cend() ; ++iter) { if ( nLevel < iter->nLevel) continue ;