From e45c7fa48fa12049a893c18805e2298e20688129 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 12 May 2014 09:00:23 +0000 Subject: [PATCH] Include : - aggiornamenti per GeomKernel e General. --- EGkFrame3d.h | 3 +++ EGkGeoFrame3d.h | 8 +++++--- EGkPoint3d.h | 3 +-- EGkVector3d.h | 3 +-- EGnScan.h | 3 ++- EGnStringUtils.h | 8 ++++++++ EgkCurve.h | 11 ++++++++--- EgkCurveComposite.h | 2 ++ EgkCurveLine.h | 2 ++ EgnCmdParser.h | 5 +++++ 10 files changed, 37 insertions(+), 11 deletions(-) diff --git a/EGkFrame3d.h b/EGkFrame3d.h index 7d3d8c0..c55c637 100644 --- a/EGkFrame3d.h +++ b/EGkFrame3d.h @@ -47,6 +47,7 @@ class EGK_EXPORT Frame3d bool Invert( void) ; bool ToGlob( const Frame3d& frRef) ; bool ToLoc( const Frame3d& frRef) ; + bool LocToLoc( const Frame3d& frOri, const Frame3d& frDest) ; const Frame3d& operator*=( const Frame3d& frRef) { this->ToGlob( frRef) ; return *this ;} const Frame3d& operator/=( const Frame3d& frRef) @@ -119,6 +120,8 @@ operator/( const Frame3d& frRef1, const Frame3d& frRef2) inline bool AreSameFrame( const Frame3d& frRef1, const Frame3d& frRef2) { + if ( frRef1.GetType() == Frame3d::ERR || frRef2.GetType() == Frame3d::ERR) + return false ; if ( ! AreSamePointNear( frRef1.Orig(), frRef2.Orig())) return false ; if ( ! AreSameVectorExact( frRef1.VersX(), frRef2.VersX())) diff --git a/EGkGeoFrame3d.h b/EGkGeoFrame3d.h index 0d3476a..213ff1e 100644 --- a/EGkGeoFrame3d.h +++ b/EGkGeoFrame3d.h @@ -1,13 +1,13 @@ //---------------------------------------------------------------------------- -// EgalTech 2013-2013 +// EgalTech 2013-2014 //---------------------------------------------------------------------------- -// File : EGkGeoFrame3d.h Data : 02.12.13 Versione : 1.4a3 +// File : EGkGeoFrame3d.h Data : 08.05.14 Versione : 1.5e3 // Contenuto : Dichiarazione della interfaccia IGeoFrame3d. // // // // Modifiche : 02.12.13 DS Creazione modulo. -// +// 08.05.14 DS Agg. Set con ptOrig, ptOnX, ptNearY e con ptOrig, vtZ. // //---------------------------------------------------------------------------- @@ -24,6 +24,8 @@ class __declspec( novtable) IGeoFrame3d : public IGeoObj virtual bool Copy( const IGeoObj* pGObjSrc) = 0 ; virtual bool Set( const Point3d& ptOrig, const Vector3d& vtDirX, const Vector3d& vtDirY, const Vector3d& vtDirZ) = 0 ; + virtual bool Set( const Point3d& ptOrig, const Point3d& ptOnX, const Point3d& ptNearY) = 0 ; + virtual bool Set( const Point3d& ptOrig, const Vector3d& vtDirZ) = 0 ; virtual bool Set( const Frame3d& frF) = 0 ; virtual const Frame3d& GetFrame( void) const = 0 ; virtual bool GetDrawWithArrowHeads( double dLenA, double dFrazLenAH, diff --git a/EGkPoint3d.h b/EGkPoint3d.h index 5b77965..711de9f 100644 --- a/EGkPoint3d.h +++ b/EGkPoint3d.h @@ -62,8 +62,7 @@ class EGK_EXPORT Point3d bool Mirror( const Point3d& ptOn, const Vector3d& vtNorm) ; bool ToGlob( const Frame3d& frRef) ; bool ToLoc( const Frame3d& frRef) ; - bool LocToLoc( const Frame3d& frOri, const Frame3d& frDest) - { return ( ToGlob( frOri) && ToLoc( frDest)) ; } + bool LocToLoc( const Frame3d& frOri, const Frame3d& frDest) ; public : union { diff --git a/EGkVector3d.h b/EGkVector3d.h index 07435ff..a29e681 100644 --- a/EGkVector3d.h +++ b/EGkVector3d.h @@ -79,8 +79,7 @@ class EGK_EXPORT Vector3d bool Mirror( const Vector3d& vtNorm) ; bool ToGlob( const Frame3d& frRef) ; bool ToLoc( const Frame3d& frRef) ; - bool LocToLoc( const Frame3d& frOri, const Frame3d& frDest) - { return ( ToGlob( frOri) && ToLoc( frDest)) ; } + bool LocToLoc( const Frame3d& frOri, const Frame3d& frDest) ; bool GetAngle( const Vector3d& vtEnd, double& dAngDeg) const ; bool GetRotation( const Vector3d& vtEnd, const Vector3d& vtAx, double& dAngDeg, bool& bDet) const ; diff --git a/EGnScan.h b/EGnScan.h index 3011cff..bd34137 100644 --- a/EGnScan.h +++ b/EGnScan.h @@ -33,7 +33,7 @@ class Scanner EGN_EXPORT ~Scanner( void) { Terminate() ; } EGN_EXPORT bool Init( const std::string& sCmdFile, - const char* szRemInit = nullptr, bool bSkipEmptyLine = true) ; + const char* szRemInit = "//", bool bSkipEmptyLine = true) ; EGN_EXPORT bool Terminate( void) ; EGN_EXPORT bool GetLine( std::string& sLine) ; EGN_EXPORT bool UngetLine( std::string& sLine) ; @@ -45,6 +45,7 @@ class Scanner private : std::ifstream m_InFile ; std::string m_sFName ; + bool m_bFindRem ; std::string m_sRemInit ; bool m_bSkipEmptyLine ; int m_nLineNbr ; diff --git a/EGnStringUtils.h b/EGnStringUtils.h index f83eab1..c33a16d 100644 --- a/EGnStringUtils.h +++ b/EGnStringUtils.h @@ -67,6 +67,14 @@ IsValidName( const std::string& sName) return false ; return ( sName.find_first_of( "\\/:*?\"<>|", 0) == std::string::npos) ; } +//---------------------------------------------------------------------------- +inline bool +ValidateName( std::string& sName) + { std::string::size_type i ; + while ( ( i = sName.find_first_of( "\\/:*?\"<>|")) != std::string::npos) + sName[i] = '_' ; + return true ; } + //---------------------------------------------------------------------------- inline bool FromString( const std::string& sVal, int& nVal) diff --git a/EgkCurve.h b/EgkCurve.h index d481675..063596e 100644 --- a/EgkCurve.h +++ b/EgkCurve.h @@ -1,13 +1,13 @@ //---------------------------------------------------------------------------- -// EgalTech 2013-2013 +// EgalTech 2014-2014 //---------------------------------------------------------------------------- -// File : EgkCurve.h Data : 22.11.13 Versione : 1.3a1 +// File : EgkCurve.h Data : 06.05.14 Versione : 1.5e3 // Contenuto : Dichiarazione della interfaccia ICurve. // // // // Modifiche : 22.11.13 DS Creazione modulo. -// +// 06.05.14 DS Agg. GetMidPoint, GetCenterPoint, GetStartDir, GetEndDir e GetMidDir. // //---------------------------------------------------------------------------- @@ -28,6 +28,11 @@ class __declspec( novtable) ICurve : public IGeoObj virtual bool IsClosed( void) const = 0 ; virtual bool GetStartPoint( Point3d& ptStart) const = 0 ; virtual bool GetEndPoint( Point3d& ptEnd) const = 0 ; + virtual bool GetMidPoint( Point3d& ptMid) const = 0 ; + virtual bool GetCenterPoint( Point3d& ptCen) const = 0 ; + virtual bool GetStartDir( Vector3d& vtDir) const = 0 ; + virtual bool GetEndDir( Vector3d& vtDir) const = 0 ; + virtual bool GetMidDir( Vector3d& vtDir) const = 0 ; virtual bool GetDomain( double& dStart, double& dEnd) const = 0 ; virtual bool GetLength( double& dLen) const = 0 ; virtual bool GetPointD1D2( double dU, Side nS, Point3d& ptPos, diff --git a/EgkCurveComposite.h b/EgkCurveComposite.h index b597850..929148c 100644 --- a/EgkCurveComposite.h +++ b/EgkCurveComposite.h @@ -24,6 +24,8 @@ class __declspec( novtable) ICurveComposite : public ICurve virtual bool AddCurve( const ICurve& cCrv) = 0 ; virtual bool AddCurve( ICurve* pCrv) = 0 ; virtual bool FromSplit( const ICurve& cCrv, int nParts) = 0 ; + virtual bool FromPointVector( const PNTVECTOR& vPnt) = 0 ; + virtual bool FromPointBulgeVector( const UPNTVECTOR& vUPnt, const Vector3d& vtN) = 0 ; virtual int GetCurveNumber( void) const = 0 ; virtual const ICurve* GetFirstCurve( void) const = 0 ; virtual const ICurve* GetNextCurve( void) const = 0 ; diff --git a/EgkCurveLine.h b/EgkCurveLine.h index 7c10223..cec25a7 100644 --- a/EgkCurveLine.h +++ b/EgkCurveLine.h @@ -21,6 +21,8 @@ class __declspec( novtable) ICurveLine : public ICurve public : virtual bool Copy( const IGeoObj* pGObjSrc) = 0 ; virtual bool Set( const Point3d& ptStart, const Point3d& ptEnd) = 0 ; + virtual bool Set( const Point3d& ptStart, const Vector3d& vtDir, double dLen) = 0 ; + virtual bool Set( const Point3d& ptStart, double dDirAngDeg, double dLen) = 0 ; virtual const Point3d& GetStart( void) const = 0 ; virtual const Point3d& GetEnd( void) const = 0 ; } ; diff --git a/EgnCmdParser.h b/EgnCmdParser.h index 8225dcd..de4cf92 100644 --- a/EgnCmdParser.h +++ b/EgnCmdParser.h @@ -9,6 +9,7 @@ // Modifiche : 25.11.13 DS Creazione modulo. // 15.03.14 DS Agg. ExecuteLine. // 10.04.14 DS Agg. GetIdParam. +// 09.05.14 DS Agg. funz. per DirReplace. // //---------------------------------------------------------------------------- @@ -39,6 +40,10 @@ class __declspec( novtable) ICmdParser virtual bool SetVariable( const std::string& sName, int nVal) = 0 ; virtual bool GetVariable( const std::string& sName, int& nVal) = 0 ; virtual bool RemoveVariable( const std::string& sName) = 0 ; + virtual void ResetDirReplace( void) = 0 ; + virtual bool SetDirReplace( const std::string& sToken, const std::string& sReplace) = 0 ; + virtual int DirReplace( std::string& sPath) = 0 ; + virtual int DirInvReplace( std::string& sPath) = 0 ; virtual int GetIdParam( const std::string& sParam, bool bNewAllowed = false) = 0 ; virtual bool Run( const std::string& sCmdFile, bool bIsolated = true) = 0 ; virtual bool ExecLine( const std::string& sCmdLine, bool bIsolated = false) = 0 ;