diff --git a/EGkCalcPocketing.h b/EGkCalcPocketing.h index 8f0dddf..39e5e38 100644 --- a/EGkCalcPocketing.h +++ b/EGkCalcPocketing.h @@ -27,7 +27,8 @@ //----------------------------------------------------------------------------- EGK_EXPORT bool CalcPocketing( const ISurfFlatRegion* pSfr, double dRad, double dRadOffs, double dStep, double dAngle, int nType, bool bSmooth, bool bInvert, bool bAvoidOpt, - bool bAllowZigZagOneWayBorders, const ISurfFlatRegion* pSfrLimit, ICRVCOMPOPOVECTOR& vCrv) ; + bool bAllowZigZagOneWayBorders, const Point3d& ptEndPrec, const ISurfFlatRegion* pSfrLimit, + ICRVCOMPOPOVECTOR& vCrv) ; EGK_EXPORT bool CalcZigZagInfill( const ISurfFlatRegion* pSfr, double dStep, bool bSmooth, bool bRemoveOverlapLink, ICRVCOMPOPOVECTOR& vCrvCompoRes) ; @@ -38,7 +39,8 @@ enum { POCKET_ZIGZAG = 0, POCKET_SPIRALOUT = 3, POCKET_CONFORMAL_ZIGZAG = 4} ; -enum { TEMP_PROP_INVALID = -1, +enum { TEMP_PROP_SMOOTH = -2, + TEMP_PROP_INVALID = -1, TEMP_PROP_CLOSE_EDGE = 0, TEMP_PROP_OPEN_EDGE = 1, TEMP_PROP_OUT_START = 2, diff --git a/EGkGdbConst.h b/EGkGdbConst.h index 56f536a..3d6a4cc 100644 --- a/EGkGdbConst.h +++ b/EGkGdbConst.h @@ -58,7 +58,8 @@ enum GdbStatus { GDB_ST_OFF = 0, //----------------- Costanti marcatura oggetti del DB geometrico --------------- enum GdbMark { GDB_MK_OFF = 0, - GDB_MK_ON = 1} ; + GDB_MK_ON = 1, + GDB_MK_ON_2 = 2} ; //----------------- Costante per numero proprietà temporanee ------------------- const int GDB_NUM_TEMP_PROP = 2 ; diff --git a/EGkGdbFunct.h b/EGkGdbFunct.h index 1f6f5d0..e6cddaa 100644 --- a/EGkGdbFunct.h +++ b/EGkGdbFunct.h @@ -80,7 +80,7 @@ CalcMark( int nObjMark, int nParentMark) if ( nObjMark == GDB_MK_OFF && nParentMark == GDB_MK_OFF) return GDB_MK_OFF ; - return GDB_MK_ON ; + return ( nParentMark != GDB_MK_OFF ? nParentMark : nObjMark) ; } // ovviamente la marcatura si combina con lo stato, nel senso che un oggetto // non visibile non viene nemmeno marcato \ No newline at end of file diff --git a/EGkGdbIterator.h b/EGkGdbIterator.h index d07163b..9689d40 100644 --- a/EGkGdbIterator.h +++ b/EGkGdbIterator.h @@ -104,7 +104,7 @@ class __declspec( novtable) IGdbIterator virtual bool RevertStatus( void) = 0 ; virtual bool GetStatus( int& nStat) const = 0 ; virtual bool GetCalcStatus( int& nStat) const = 0 ; - virtual bool SetMark( void) = 0 ; + virtual bool SetMark( int nMark = GDB_MK_ON) = 0 ; virtual bool ResetMark( void) = 0 ; virtual bool GetMark( int& nMark) const = 0 ; virtual bool GetCalcMark( int& nMark) const = 0 ; diff --git a/EGkGeomDB.h b/EGkGeomDB.h index e8b59a5..fa5bc5d 100644 --- a/EGkGeomDB.h +++ b/EGkGeomDB.h @@ -134,7 +134,7 @@ class __declspec( novtable) IGeomDB virtual bool RevertStatus( int nId) = 0 ; virtual bool GetStatus( int nId, int& nStat) const = 0 ; virtual bool GetCalcStatus( int nId, int& nStat) const = 0 ; - virtual bool SetMark( int nId) = 0 ; + virtual bool SetMark( int nId, int nMark = GDB_MK_ON) = 0 ; virtual bool ResetMark( int nId) = 0 ; virtual bool GetMark( int nId, int& nMark) const = 0 ; virtual bool GetCalcMark( int nId, int& nMark) const = 0 ; diff --git a/EGkPoint3d.h b/EGkPoint3d.h index 699a514..18af2d4 100644 --- a/EGkPoint3d.h +++ b/EGkPoint3d.h @@ -323,7 +323,16 @@ DirDist( const Point3d& ptP1, const Point3d& ptP2, Vector3d& vtDir, double& dDis inline bool AreSamePointEpsilon( const Point3d& ptP1, const Point3d& ptP2, double dToler) { - return ( SqDist( ptP1, ptP2) < ( dToler * dToler)) ; + double dX = ptP1.x - ptP2.x ; + if ( abs( dX) > dToler) + return false ; + double dY = ptP1.y - ptP2.y ; + if ( abs( dY) > dToler) + return false ; + double dZ = ptP1.z - ptP2.z ; + if ( abs( dZ) > dToler) + return false ; + return ( ( dX * dX + dY * dY + dZ * dZ) < ( dToler * dToler)) ; } //---------------------------------------------------------------------------- @@ -335,37 +344,22 @@ AreSamePointXYEpsilon( const Point3d& ptP1, const Point3d& ptP2, double dToler) return ( SqDistXY( ptP1, ptP2) < ( dToler * dToler)) ; } -//---------------------------------------------------------------------------- -//! Verifica se due punti sono quasi coincidenti per esclusione (tolleranza come parametro) -//---------------------------------------------------------------------------- -inline bool -AreSamePointStepEpsilon( const Point3d& ptP1, const Point3d& ptP2, double dToler) -{ - double dX = ptP1.x - ptP2.x ; - if( dX > dToler) - return false ; - else { - double dY = ptP1.y - ptP2.y ; - if( dY > dToler) - return false ; - else { - double dTol = dToler * dToler ; - double dX2 = dX * dX ; - double dY2 = dY * dY ; - double dZ = ptP1.z- ptP2.z ; - double dZ2 = dZ * dZ ; - return dX2 + dY2 + dZ2 < dTol ; - } - } -} - //---------------------------------------------------------------------------- //! Verifica se due punti sono quasi coincidenti (Small error -> Approx) //---------------------------------------------------------------------------- inline bool AreSamePointApprox( const Point3d& ptP1, const Point3d& ptP2) { - return ( SqDist( ptP1, ptP2) < SQ_EPS_SMALL) ; + double dX = ptP1.x - ptP2.x ; + if ( abs( dX) > EPS_SMALL) + return false ; + double dY = ptP1.y - ptP2.y ; + if ( abs( dY) > EPS_SMALL) + return false ; + double dZ = ptP1.z - ptP2.z ; + if ( abs( dZ) > EPS_SMALL) + return false ; + return ( ( dX * dX + dY * dY + dZ * dZ) < SQ_EPS_SMALL) ; } //---------------------------------------------------------------------------- @@ -377,37 +371,22 @@ AreSamePointXYApprox( const Point3d& ptP1, const Point3d& ptP2) return ( SqDistXY( ptP1, ptP2) < SQ_EPS_SMALL) ; } -//---------------------------------------------------------------------------- -//! Verifica se due punti sono quasi coincidenti per esclusione (tolleranza come parametro) -//---------------------------------------------------------------------------- -inline bool -AreSamePointStepApprox( const Point3d& ptP1, const Point3d& ptP2) -{ - double dX = ptP1.x - ptP2.x ; - if( dX > EPS_SMALL) - return false ; - else { - double dY = ptP1.y - ptP2.y ; - if( dY > EPS_SMALL) - return false ; - else { - double dTol = SQ_EPS_SMALL ; - double dX2 = dX * dX ; - double dY2 = dY * dY ; - double dZ = ptP1.z- ptP2.z ; - double dZ2 = dZ * dZ ; - return dX2 + dY2 + dZ2 < dTol ; - } - } -} - //---------------------------------------------------------------------------- //! Verifica se due punti sono esattamente coincidenti (Zero error -> Exact) //---------------------------------------------------------------------------- inline bool AreSamePointExact( const Point3d& ptP1, const Point3d& ptP2) { - return ( SqDist( ptP1, ptP2) < SQ_EPS_ZERO) ; + double dX = ptP1.x - ptP2.x ; + if ( abs( dX) > EPS_ZERO) + return false ; + double dY = ptP1.y - ptP2.y ; + if ( abs( dY) > EPS_ZERO) + return false ; + double dZ = ptP1.z - ptP2.z ; + if ( abs( dZ) > EPS_ZERO) + return false ; + return ( ( dX * dX + dY * dY + dZ * dZ) < SQ_EPS_ZERO) ; } //---------------------------------------------------------------------------- @@ -419,30 +398,6 @@ AreSamePointXYExact( const Point3d& ptP1, const Point3d& ptP2) return ( SqDistXY( ptP1, ptP2) < SQ_EPS_ZERO) ; } -//---------------------------------------------------------------------------- -//! Verifica se due punti sono quasi coincidenti per esclusione (tolleranza come parametro) -//---------------------------------------------------------------------------- -inline bool -AreSamePointStepExact( const Point3d& ptP1, const Point3d& ptP2) -{ - double dX = ptP1.x - ptP2.x ; - if( dX > EPS_ZERO) - return false ; - else { - double dY = ptP1.y - ptP2.y ; - if( dY > EPS_ZERO) - return false ; - else { - double dTol = SQ_EPS_ZERO ; - double dX2 = dX * dX ; - double dY2 = dY * dY ; - double dZ = ptP1.z- ptP2.z ; - double dZ2 = dZ * dZ ; - return dX2 + dY2 + dZ2 < dTol ; - } - } -} - //---------------------------------------------------------------------------- //! Restituisce una copia in locale del punto passato //---------------------------------------------------------------------------- diff --git a/EGrScene.h b/EGrScene.h index dcb9f8d..a5c649c 100644 --- a/EGrScene.h +++ b/EGrScene.h @@ -90,6 +90,7 @@ class IEGrScene virtual bool SetExtension( const BBox3d& b3Ext) = 0 ; virtual bool UpdateExtension( void) = 0 ; virtual bool SetMark( Color colMark) = 0 ; + virtual bool SetMark2( Color colMark) = 0 ; virtual bool SetSelSurf( Color colSelSurf) = 0 ; virtual bool SetLineWidth( int nW) = 0 ; // Grid diff --git a/EInAPI.h b/EInAPI.h index ad01640..541cd44 100644 --- a/EInAPI.h +++ b/EInAPI.h @@ -601,6 +601,7 @@ EIN_EXPORT BOOL __stdcall EgtSurfFrNormVersor( int nId, int nRefId, double vtNor EIN_EXPORT BOOL __stdcall EgtSurfFrGrossArea( int nId, double* pdArea) ; EIN_EXPORT int __stdcall EgtSurfFrChunkCount( int nId) ; EIN_EXPORT int __stdcall EgtSurfFrChunkSimpleClassify( int nId1, int nChunk1, int nId2, int nChunk2, double dToler) ; +EIN_EXPORT BOOL __stdcall EgtSurfFrChunkCenter( int nId, int nChunk, int nRefId, double ptCen[3], double vtNorm[3]) ; EIN_EXPORT int __stdcall EgtExtractSurfFrChunkLoops( int nId, int nChunk, int nDestGrpId, int* pnCount) ; EIN_EXPORT int __stdcall EgtSurfTmPartCount( int nId) ; EIN_EXPORT int __stdcall EgtSurfTmFacetCount( int nId) ; @@ -996,7 +997,7 @@ EIN_EXPORT BOOL __stdcall EgtInitScene( HWND hWnd, int nDriver, BOOL b2Buff, int EIN_EXPORT BOOL __stdcall EgtGetSceneInfo( wchar_t*& wsInfo) ; EIN_EXPORT BOOL __stdcall EgtSetBackground( const int nTopCol[4], const int nBottomCol[4], BOOL bRedraw) ; EIN_EXPORT BOOL __stdcall EgtSetLineAttribs( int nWidth) ; -EIN_EXPORT BOOL __stdcall EgtSetMarkAttribs( const int MarkCol[4]) ; +EIN_EXPORT BOOL __stdcall EgtSetMarkAttribs( const int MarkCol[4], const int Mark2Col[4]) ; EIN_EXPORT BOOL __stdcall EgtSetSelSurfAttribs( const int SelSurfCol[4]) ; EIN_EXPORT BOOL __stdcall EgtSetGeoLineAttribs( const int GlCol[4]) ; EIN_EXPORT BOOL __stdcall EgtSetGeoTriaAttribs( const int GtCol[4]) ; diff --git a/EXeExecutor.h b/EXeExecutor.h index 617b6d0..2b806a3 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -487,7 +487,7 @@ EXE_EXPORT bool ExeSetStatus( const INTVECTOR& vIds, int nStat) ; EXE_EXPORT bool ExeRevertStatus( int nId) ; EXE_EXPORT bool ExeGetStatus( int nId, int* pnStat) ; EXE_EXPORT bool ExeGetCalcStatus( int nId, int* pnStat) ; -EXE_EXPORT bool ExeSetMark( int nId) ; +EXE_EXPORT bool ExeSetMark( int nId, int nMark = 1) ; EXE_EXPORT bool ExeResetMark( int nId) ; EXE_EXPORT bool ExeGetMark( int nId, int* pnMark) ; EXE_EXPORT bool ExeGetCalcMark( int nId, int* pnMark) ; @@ -756,6 +756,7 @@ EXE_EXPORT bool ExeSurfFrChunkMaxOffset( int nId, int nChunk, double& dMaxOffset EXE_EXPORT bool ExeSurfFrTestExternal( int nId1, int nId2, double dMinDist) ; EXE_EXPORT int ExeSurfFrChunkCount( int nId) ; EXE_EXPORT int ExeSurfFrChunkSimpleClassify( int nId1, int nChunk1, int nId2, int nChunk2, double dToler = 0) ; +EXE_EXPORT bool ExeSurfFrChunkCenter( int nId, int nChunk, int nRefId, Point3d& ptCen, Vector3d& vtN) ; EXE_EXPORT int ExeExtractSurfFrChunkLoops( int nId, int nChunk, int nDestGrpId, int* pnCount) ; EXE_EXPORT int ExeSurfFrGetZigZagInfill( int nId, int nDestGrpId, double dStep, double dAng, bool bSmooth, int* pnCount) ; EXE_EXPORT int ExeSurfTmVertexCount( int nId) ; @@ -1300,7 +1301,7 @@ EXE_EXPORT bool ExeGetSceneInfo( std::string& sInfo) ; EXE_EXPORT bool ExeSetBackground( Color TopCol, Color BottomCol, bool bRedraw) ; EXE_EXPORT bool ExeGetBackground( Color& TopCol, Color& BottomCol) ; EXE_EXPORT bool ExeSetLineAttribs( int nWidth) ; -EXE_EXPORT bool ExeSetMarkAttribs( Color MarkCol) ; +EXE_EXPORT bool ExeSetMarkAttribs( Color MarkCol, Color Mark2Col) ; EXE_EXPORT bool ExeSetSelSurfAttribs( Color SelSurfCol) ; EXE_EXPORT bool ExeSetGeoLineAttribs( Color GlCol) ; EXE_EXPORT bool ExeSetGeoTriaAttribs( Color GtCol) ; diff --git a/EgtKeyCodes.h b/EgtKeyCodes.h index d21a5da..af42c4e 100644 --- a/EgtKeyCodes.h +++ b/EgtKeyCodes.h @@ -25,7 +25,7 @@ //---------------------------------------------------------------------------- const int KEY_BASELIB_PROD = 207 ; -const int KEY_BASELIB_VER = 2607 ; +const int KEY_BASELIB_VER = 2608 ; const int KEY_BASELIB_LEV = 1 ; //----------------------------------------------------------------------------