From 93beb22ee05b2e22d6a8402117432e47b18d7a79 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 17 Dec 2014 15:21:39 +0000 Subject: [PATCH] Include : - aggiornamento interfacce. --- EGkDistPointCurve.h | 6 ++++++ EGkGdbConst.h | 12 +++++++----- EGkGeoObj.h | 2 ++ EGkGeomDB.h | 12 ++++++++---- EGkPoint3d.h | 36 ++++++++++++++++++++++++++++++++++++ EGkPolyArc.h | 1 + EGrScene.h | 7 ++++--- EInAPI.h | 13 ++++++++++--- EgkCurve.h | 13 +++++++------ EgkCurveArc.h | 2 ++ EgkCurveAux.h | 8 ++++++-- EgkCurveComposite.h | 1 + 12 files changed, 90 insertions(+), 23 deletions(-) diff --git a/EGkDistPointCurve.h b/EGkDistPointCurve.h index 216ca23..8f12f81 100644 --- a/EGkDistPointCurve.h +++ b/EGkDistPointCurve.h @@ -38,6 +38,9 @@ struct MinDistPCInfo { } ; typedef std::vector MDPCIVECTOR ; // vettore di MinDistPCInfo +//---------------------------------------------------------------------------- +enum MdSide { MDS_LEFT = -1, MDS_ON = 0, MDS_RIGHT = +1} ; + //----------------------------------------------------------------------------- class DistPointCurve { @@ -53,6 +56,8 @@ class DistPointCurve 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) ; private : @@ -65,6 +70,7 @@ class DistPointCurve private : double m_dDist ; MDPCIVECTOR m_Info ; + Point3d m_ptP ; const ICurve* m_pCurve ; } ; diff --git a/EGkGdbConst.h b/EGkGdbConst.h index 3544593..2b1bd45 100644 --- a/EGkGdbConst.h +++ b/EGkGdbConst.h @@ -18,9 +18,11 @@ const int GDB_ID_ROOT = 0 ; const int GDB_ID_NULL = -1 ; const int GDB_ID_SEL = -2 ; -const int GDB_BEFORE = -1 ; -const int GDB_SON = 0 ; -const int GDB_AFTER = +1 ; + +//----------------- Costanti posizione di inserimento nel DB geometrico -------- +enum GdbInsPos { GDB_BEFORE = -1, + GDB_SON = 0, + GDB_AFTER = +1} ; //----------------- Costanti tipo salvataggio del DB geometrico ---------------- enum GdbSave { GDB_SV_TXT = 0, @@ -61,5 +63,5 @@ const int GDB_MT_NULL = GDB_MT_PARENT ; enum BBoxFlag { BBF_STANDARD = 0, BBF_ONLY_VISIBLE = 1, BBF_IGNORE_TEXT = 2, - BBF_IGNORE_DIM = 3, - BBF_EXACT = 4} ; + BBF_IGNORE_DIM = 4, + BBF_EXACT = 8} ; diff --git a/EGkGeoObj.h b/EGkGeoObj.h index 3b51342..b4183ab 100644 --- a/EGkGeoObj.h +++ b/EGkGeoObj.h @@ -53,6 +53,8 @@ class __declspec( novtable) IGeoObj virtual void SetObjGraphics( IObjGraphics* pOGr) = 0 ; virtual IObjGraphics* GetObjGraphics( void) = 0 ; virtual const IObjGraphics* GetObjGraphics( void) const = 0 ; + virtual void SetTempProp( int nProp) = 0 ; + virtual int GetTempProp( void) = 0 ; } ; //----------------------------------------------------------------------------- diff --git a/EGkGeomDB.h b/EGkGeomDB.h index 89a5bac..825b99f 100644 --- a/EGkGeomDB.h +++ b/EGkGeomDB.h @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- // EgalTech 2013-2014 //---------------------------------------------------------------------------- -// File : EGkGeomDB.h Data : 30.05.14 Versione : 1.5e10 +// File : EGkGeomDB.h Data : 03.12.14 Versione : 1.5k1 // Contenuto : Dichiarazione della interfaccia IGeomDB. // // @@ -10,6 +10,7 @@ // 26.04.14 DS Agg. gestione libreria materiali. // 21.05.14 DS Agg. GotoFirst/Next/Last/Prev. // 30.05.14 DS Agg. metodi di Shear. +// 03.12.14 DS Aggiunta gestione riferimento di griglia. // //---------------------------------------------------------------------------- @@ -88,7 +89,7 @@ class __declspec( novtable) IGeomDB virtual bool Shear( int nId, const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff) = 0 ; virtual bool ShearGlob( int nId, const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff) = 0 ; virtual bool ShearGroup( int nId, const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff) = 0 ; - // selection + // Selection virtual bool SelectObj( int nId, bool bOnlyIfVisible = false) = 0 ; virtual bool DeselectObj( int nId) = 0 ; virtual bool SelectGroupObjs( int nId, int nFilter = 0, bool bOnlyIfVisible = false) = 0 ; @@ -100,7 +101,7 @@ class __declspec( novtable) IGeomDB virtual int GetLastSelectedObj( void) const = 0 ; virtual int GetPrevSelectedObj( void) const = 0 ; virtual bool ClearSelection( void) = 0 ; - // attributes + // Attributes virtual bool DumpAttributes( int nId, std::string& sOut, const char* szNewLine) const = 0 ; virtual bool CopyAttributes( int nIdSou, int nIdDest) = 0 ; virtual bool SetLevel( int nId, int nLevel) = 0 ; @@ -150,7 +151,7 @@ class __declspec( novtable) IGeomDB virtual bool GetInfo( int nId, const std::string& sKey, Frame3d& frInfo) const = 0 ; virtual bool ExistsInfo( int nId, const std::string& sKey) const = 0 ; virtual bool RemoveInfo( int nId, const std::string& sKey) = 0 ; - // material library + // Material library virtual int AddMaterial( const std::string& sName, const Material& matM) = 0 ; virtual int FindMaterial( const std::string& sName) const = 0 ; virtual bool EraseMaterial( int nMat, bool& bInUse) = 0 ; @@ -161,6 +162,9 @@ class __declspec( novtable) IGeomDB virtual bool IsCustomMaterial( int nMat, bool& bCustom) const = 0 ; virtual bool ModifyMaterialData( int nMat, const Material& matM) = 0 ; virtual bool ModifyMaterialName( int nMat, const std::string& sName) = 0 ; + // Grid + virtual bool SetGridFrame( const Frame3d& frFrame) = 0 ; + virtual const Frame3d& GetGridFrame( void) = 0 ; } ; //----------------------------------------------------------------------------- diff --git a/EGkPoint3d.h b/EGkPoint3d.h index 71cc72b..c5589a6 100644 --- a/EGkPoint3d.h +++ b/EGkPoint3d.h @@ -311,6 +311,24 @@ DirDist( const Point3d& ptP1, const Point3d& ptP2, Vector3d& vtDir, double& dDis return false ; } +//---------------------------------------------------------------------------- +//! Verifica se due punti sono quasi coincidenti (tolleranza come parametro) +//---------------------------------------------------------------------------- +inline bool +AreSamePointEpsilon( const Point3d& ptP1, const Point3d& ptP2, const double dToler) +{ + return ( SqDist( ptP1, ptP2) < ( dToler * dToler)) ; +} + +//---------------------------------------------------------------------------- +//! Verifica se due punti sono quasi coincidenti nel piano XY (tolleranza come parametro) +//---------------------------------------------------------------------------- +inline bool +AreSamePointXYEpsilon( const Point3d& ptP1, const Point3d& ptP2, const double dToler) +{ + return ( SqDistXY( ptP1, ptP2) < ( dToler * dToler)) ; +} + //---------------------------------------------------------------------------- //! Verifica se due punti sono quasi coincidenti (Small error -> Approx) //---------------------------------------------------------------------------- @@ -320,6 +338,15 @@ AreSamePointApprox( const Point3d& ptP1, const Point3d& ptP2) return ( SqDist( ptP1, ptP2) < ( EPS_SMALL * EPS_SMALL)) ; } +//---------------------------------------------------------------------------- +//! Verifica se due punti sono quasi coincidenti nel piano XY (Small error -> Approx) +//---------------------------------------------------------------------------- +inline bool +AreSamePointXYApprox( const Point3d& ptP1, const Point3d& ptP2) +{ + return ( SqDistXY( ptP1, ptP2) < ( EPS_SMALL * EPS_SMALL)) ; +} + //---------------------------------------------------------------------------- //! Verifica se due punti sono esattamente coincidenti (Zero error -> Exact) //---------------------------------------------------------------------------- @@ -328,3 +355,12 @@ AreSamePointExact( const Point3d& ptP1, const Point3d& ptP2) { return ( SqDist( ptP1, ptP2) < ( EPS_ZERO * EPS_ZERO)) ; } + +//---------------------------------------------------------------------------- +//! Verifica se due punti sono esattamente coincidenti nel piano XY (Zero error -> Exact) +//---------------------------------------------------------------------------- +inline bool +AreSamePointXYExact( const Point3d& ptP1, const Point3d& ptP2) +{ + return ( SqDistXY( ptP1, ptP2) < ( EPS_ZERO * EPS_ZERO)) ; +} diff --git a/EGkPolyArc.h b/EGkPolyArc.h index 62a7ea3..037803e 100644 --- a/EGkPolyArc.h +++ b/EGkPolyArc.h @@ -40,6 +40,7 @@ class PolyArc EGK_EXPORT bool EraseFirstUPoint( void) ; EGK_EXPORT bool EraseLastUPoint( void) ; EGK_EXPORT bool AddOffsetToU( double dOffset) ; + EGK_EXPORT bool ParamLinearTransform( double dStartU, double dEndU) ; EGK_EXPORT bool SetElevation( double dZ) ; EGK_EXPORT bool AddElevation( double dZ) ; EGK_EXPORT bool Translate( const Vector3d& vtMove) ; diff --git a/EGrScene.h b/EGrScene.h index a87e9f1..e46fe07 100644 --- a/EGrScene.h +++ b/EGrScene.h @@ -88,10 +88,10 @@ class IEGrScene virtual bool SetSelSurf( Color colSelSurf) = 0 ; // Grid virtual bool SetGridShow( bool bShowGrid, bool bShowFrame) = 0 ; - virtual bool SetGridFrame( const Frame3d& frFrame) = 0 ; virtual bool SetGridGeo( double dSnapStep, int nMinLineSstep, int nMajLineSstep, int nExtSstep) = 0 ; virtual bool SetGridColor( Color colMinLine, Color colMajLine) = 0 ; - virtual const Frame3d& GetGridFrame( void) = 0 ; + // Glob Frame + virtual bool SetGlobFrameShow( bool bShow) = 0 ; // Direct virtual bool SetGeoLineAttribs( Color GLcol) = 0 ; virtual bool SetGeoLine( const Point3d& ptP1, const Point3d& ptP2) = 0 ; @@ -125,7 +125,8 @@ enum CameraDir { CT_NONE = 0, CT_ISO_SW = 7, CT_ISO_SE = 8, CT_ISO_NE = 9, - CT_ISO_NW = 10} ; + CT_ISO_NW = 10, + CT_CPLANE = 11} ; //------------------------ Costanti per tipo di visualizzazione -------------- enum ShowMode { SM_WIREFRAME = 0, SM_HIDDENLINE = 1, diff --git a/EInAPI.h b/EInAPI.h index a45a9d8..c715cf3 100644 --- a/EInAPI.h +++ b/EInAPI.h @@ -35,6 +35,8 @@ EIN_EXPORT BOOL __stdcall EgtInit( int nDebug, const wchar_t* sLogFile) ; 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) ; +EIN_EXPORT BOOL __stdcall EgtSetLuaLibs( const wchar_t* sLuaLibsDir) ; +EIN_EXPORT BOOL __stdcall EgtGetVersionInfo( wchar_t*& wsVer) ; EIN_EXPORT BOOL __stdcall EgtFreeMemory( void* pMem) ; // Geo Base @@ -98,6 +100,8 @@ EIN_EXPORT BOOL __stdcall EgtSetCurrentContext( int nGseCtx) ; EIN_EXPORT BOOL __stdcall EgtResetCurrentContext( void) ; EIN_EXPORT int __stdcall EgtGetCurrentContext( void) ; EIN_EXPORT BOOL __stdcall EgtSetDefaultMaterial( const int vCol[4]) ; +EIN_EXPORT BOOL __stdcall EgtSetGridFrame( const double ptOrig[3], const double vX[3], const double vY[3], const double vZ[3]) ; +EIN_EXPORT BOOL __stdcall EgtGetGridFrame( double ptOrig[3], double vX[3], double vY[3], double vZ[3]) ; EIN_EXPORT BOOL __stdcall EgtNewFile( void) ; EIN_EXPORT BOOL __stdcall EgtOpenFile( const wchar_t* wsFilePath) ; EIN_EXPORT BOOL __stdcall EgtSaveFile( const wchar_t* wsFilePath, int nFlag) ; @@ -152,6 +156,7 @@ EIN_EXPORT int __stdcall EgtCreateCurveCompo( int nParentId, int nNumId, const EIN_EXPORT int __stdcall EgtCreateCurveCompoByChain( int nParentId, int nNumId, const int nIds[], const double ptNear[3], BOOL bErase) ; EIN_EXPORT int __stdcall EgtCreateCurveCompoFromPoints( int nParentId, int nP, const double ptPs[/*3 x nP*/]) ; EIN_EXPORT int __stdcall EgtCreateCurveCompoFromPointBulges( int nParentId, int nPB, const double ptPBs[/*4 x nPB*/]) ; +EIN_EXPORT int __stdcall EgtCreateCurveCompoFromRectangle( int nParentId, const double ptIni[3], const double ptFin[3]) ; EIN_EXPORT int __stdcall EgtCreateCurveCompoFromPolygonSide( int nParentId, int nNumSides, const double ptIni[3], const double ptFin[3]) ; @@ -265,7 +270,7 @@ 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]) ; EIN_EXPORT BOOL __stdcall EgtSplitCurveAtPoint( int nId, double ptOn[3]) ; -EIN_EXPORT BOOL __stdcall EgtOffsetCurve( int nId, double dDist, int nSide, int nType) ; +EIN_EXPORT BOOL __stdcall EgtOffsetCurve( int nId, double dDist, int nType) ; EIN_EXPORT BOOL __stdcall EgtModifyCurveCircleCPN( int nId, const double ptOn[3]) ; EIN_EXPORT BOOL __stdcall EgtModifyCurveArcRadius( int nId, double dRad) ; EIN_EXPORT BOOL __stdcall EgtModifyCurveArcC2PN( int nId, const double ptEnd[3]) ; @@ -290,6 +295,9 @@ EIN_EXPORT BOOL __stdcall EgtCurveLength( int nId, double* pdLen) ; EIN_EXPORT BOOL __stdcall EgtCurveLengthAtPoint( int nId, double ptOn[3], double* pdLen) ; EIN_EXPORT BOOL __stdcall EgtCurveExtrusion( int nId, double vtExtr[3]) ; EIN_EXPORT BOOL __stdcall EgtCurveThickness( int nId, double* pdThick) ; +EIN_EXPORT BOOL __stdcall EgtGetMinDistPointCurve( const double ptP[3], int nId, double* pdDist) ; +EIN_EXPORT BOOL __stdcall EgtGetMinDistPntSidePointCurve( const double ptP[3], int nId, double vtN[3], + double* pdDist, double ptMin[3], int* pnSide) ; EIN_EXPORT BOOL __stdcall EgtCurveArcNormVersor( int nId, double vtNorm[3]) ; EIN_EXPORT BOOL __stdcall EgtExtTextNormVersor( int nId, double vtNorm[3]) ; EIN_EXPORT BOOL __stdcall EgtPointToIdGlob( double ptP[3], int nId) ; @@ -331,11 +339,10 @@ EIN_EXPORT BOOL __stdcall EgtSetMarkAttribs( const int MarkCol[4]) ; EIN_EXPORT BOOL __stdcall EgtSetSelSurfAttribs( const int SelSurfCol[4]) ; EIN_EXPORT BOOL __stdcall EgtSetGeoLineAttribs( const int GlCol[4]) ; EIN_EXPORT BOOL __stdcall EgtSetWinRectAttribs( BOOL bOutline, const int WrCol[4]) ; +EIN_EXPORT BOOL __stdcall EgtSetGlobFrameShow( BOOL bShow) ; EIN_EXPORT BOOL __stdcall EgtSetGridShow( BOOL bShowGrid, BOOL bShowFrame) ; -EIN_EXPORT BOOL __stdcall EgtSetGridFrame( const double ptOrig[3], const double vX[3], const double vY[3], const double vZ[3]) ; EIN_EXPORT BOOL __stdcall EgtSetGridGeo( double dSnapStep, int nMinLineSstep, int nMajLineSstep, int nExtSstep) ; EIN_EXPORT BOOL __stdcall EgtSetGridColor( const int nMinCol[4], const int nMajCol[4]) ; -EIN_EXPORT BOOL __stdcall EgtGetGridFrame( double ptOrig[3], double vX[3], double vY[3], double vZ[3]) ; EIN_EXPORT BOOL __stdcall EgtResize( int nW, int nH) ; EIN_EXPORT BOOL __stdcall EgtDraw( void) ; EIN_EXPORT BOOL __stdcall EgtSelect( int nWinX, int nWinY, int nSelW, int nSelH, int* pnSel) ; diff --git a/EgkCurve.h b/EgkCurve.h index 373a604..bc47911 100644 --- a/EgkCurve.h +++ b/EgkCurve.h @@ -28,11 +28,12 @@ class __declspec( novtable) ICurve : public IGeoObj PP_START = 1, // punto coincidente con l'inizio PP_MID = 2, // punto appartenente all'interno della curva PP_END = 3} ; // punto coincidente con la fine - enum OffSide { OFF_RIGHT = -1, // offset a destra - OFF_LEFT = 1} ; // offset a sinistra - enum OffType { OFF_FILLET = 0, // si raccordano con arco gli spigoli esterni - OFF_CHAMFER = 1, // si raccordano con smusso gli spigoli esterni - OFF_EXTEND = 2} ; // si prolungano all'intersezione gli spigoli esterni + enum OffType { OFF_FILLET = 0, // si raccordano con arco gli spigoli esterni + OFF_CHAMFER = 1, // si raccordano con smusso gli spigoli esterni + OFF_EXTEND = 2, // si prolungano all'intersezione gli spigoli esterni + OFF_MEDIA_INTDZ = 4, // su angoli interni con delta Z fa media (in or con prec) + OFF_FORCE_OPEN = 8, // forza a aperto anche se chiuso (in or ...) + OFF_NO_VERTICAL = 16} ;// vieta linee perpendicolari al piano di offset (in or ...) public : // IGeoObj virtual ICurve* Clone( void) const = 0 ; public : @@ -64,7 +65,7 @@ class __declspec( novtable) ICurve : public IGeoObj virtual bool ApproxWithArcs( double dLinTol, double dAngTolDeg, PolyArc& PA) const = 0 ; virtual ICurve* CopyParamRange( double dUStart, double dUEnd) const = 0 ; virtual bool Invert( void) = 0 ; - virtual bool Offset( double dDist, int nSide, int nType = OFF_FILLET) = 0 ; + virtual bool SimpleOffset( double dDist, int nType = OFF_FILLET) = 0 ; virtual bool SetExtrusion( const Vector3d& vtExtr) = 0 ; virtual bool SetThickness( double dThick) = 0 ; virtual bool ModifyStart( const Point3d& ptNewStart) = 0 ; diff --git a/EgkCurveArc.h b/EgkCurveArc.h index 79ce119..efa7241 100644 --- a/EgkCurveArc.h +++ b/EgkCurveArc.h @@ -36,12 +36,14 @@ class __declspec( novtable) ICurveArc : public ICurve virtual bool IsFlat( double dToler = EPS_SMALL) const = 0 ; virtual bool IsACircle( void) const = 0 ; virtual bool IsInPlaneXY( void) const = 0 ; + virtual bool IsInPlanePerpExtr( void) const = 0 ; virtual const Point3d& GetCenter( void) const = 0 ; virtual const Vector3d& GetNormVersor( void) const = 0 ; virtual const Vector3d& GetStartVersor( void) const = 0 ; virtual double GetRadius( void) const = 0 ; virtual double GetAngCenter( void) const = 0 ; virtual double GetDeltaN( void) const = 0 ; + virtual bool IsPointInSector( const Point3d& ptP) const = 0 ; virtual bool CalcPointAngle( const Point3d& ptP, double& dAngDeg) const = 0 ; virtual bool CalcPointParamPosiz( const Point3d& ptP, double& dU, int& nPos) const = 0 ; virtual bool InvertN( void) = 0 ; diff --git a/EgkCurveAux.h b/EgkCurveAux.h index e79bddc..c25ea95 100644 --- a/EgkCurveAux.h +++ b/EgkCurveAux.h @@ -45,8 +45,12 @@ struct CNurbsData EGK_EXPORT ICurve* ArcToBezierCurve( const ICurve* pArc) ; //---------------------------------------------------------------------------- -//! Trasforma una curva in una nuova curva semplice o composta senza archi -ICurve* CurveToNoArcsCurve( const ICurve* pCrv) ; +//! Trasforma una curva in una nuova curva semplice o composta senza archi (solo linee o curve di Bezier) +EGK_EXPORT ICurve* CurveToNoArcsCurve( const ICurve* pCrv) ; + +//---------------------------------------------------------------------------- +//! Trasformo una curva in una nuova curva semplice o composta con linee o archi perp. a estrusione +EGK_EXPORT ICurve* CurveToArcsPerpExtrCurve( const ICurve* pCrv, double dLinTol, double dAngTolDeg) ; //---------------------------------------------------------------------------- //! Rende canonica la rappresentazione della curva Nurbs diff --git a/EgkCurveComposite.h b/EgkCurveComposite.h index eda5979..5841516 100644 --- a/EgkCurveComposite.h +++ b/EgkCurveComposite.h @@ -38,6 +38,7 @@ class __declspec( novtable) ICurveComposite : public ICurve virtual ICurve* RemoveFirstOrLastCurve( bool bLast = true) = 0 ; virtual bool ChangeStartPoint( double dU) = 0 ; virtual bool ArcsToBezierCurves( void) = 0 ; + virtual bool ArcsBezierCurvesToArcsPerpExtr( double dLinTol, double dAngTolDeg) = 0 ; } ; //-----------------------------------------------------------------------------