Merge branch 'master' into MoreBezier

This commit is contained in:
Daniele Bariletti
2024-08-29 09:25:44 +02:00
10 changed files with 46 additions and 85 deletions
+4 -2
View File
@@ -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,
+2 -1
View File
@@ -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 ;
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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 ;
+1 -1
View File
@@ -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 ;
+30 -75
View File
@@ -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
//----------------------------------------------------------------------------
+1
View File
@@ -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
+2 -1
View File
@@ -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]) ;
+3 -2
View File
@@ -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) ;
+1 -1
View File
@@ -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 ;
//----------------------------------------------------------------------------