EgtGeomKernel :

- versione NGE portata a 1018 per aggiunta parametro DexToVoxRatio di Zmap
- in VolZmap funzione SetTolerances rinominata in SetToolTolerances.
This commit is contained in:
Dario Sassi
2020-09-18 16:24:43 +00:00
parent 2fcc500ac4
commit 71ba248c80
3 changed files with 27 additions and 12 deletions
+4 -2
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2014-2020
//----------------------------------------------------------------------------
// File : NgeConst.h Data : 22.03.20 Versione : 2.2c3
// File : NgeConst.h Data : 22.09.20 Versione : 2.2i2
// Contenuto : Costanti per file Nge.
//
//
@@ -17,6 +17,7 @@
// 18.09.18 DS 1014 -> Aggiunto flag Shape a Zmap.
// 27.12.19 DS 1015 -> Aggiunto DIMENSION.
// 22.03.20 DS 1016 -> Aggiunta SurfBezier.
// 22.09.20 DS 1018 -> Aggiunto DexVoxRatio a Zmap.
//
//----------------------------------------------------------------------------
@@ -40,7 +41,8 @@ const int NGE_VER_1013 = 1013 ; // aggiunto TextureData (Keyword T)
const int NGE_VER_1014 = 1014 ; // aggiunto Shape a Zmap
const int NGE_VER_1015 = 1015 ; // aggiunto Dimension
const int NGE_VER_1016 = 1016 ; // aggiunta superficie Bezier
const int NGE_VER_LAST = NGE_VER_1016 ;
const int NGE_VER_1018 = 1018 ; // aggiunto DexVoxRatio a Zmap
const int NGE_VER_LAST = NGE_VER_1018 ;
// Indici KeyWord
const int NGE_START = 0 ;
const int NGE_END = 1 ;
+18 -7
View File
@@ -212,6 +212,8 @@ VolZmap::Dump( string& sOut, bool bMM, const char* szNewLine) const
// numero di blocchi
sOut += "Blocks=" + ToString( m_nNumBlock) + " (" + ToString( m_nFracLin[0]) + "x" +
ToString( m_nFracLin[1]) + "x" + ToString( m_nFracLin[2]) + ")" + szNewLine ;
// dexel per voxel (DexToVoxRatio)
sOut += "DexVoxRat=" + ToString( m_nDexVoxRatio) + szNewLine ;
return true ;
}
@@ -233,7 +235,7 @@ VolZmap::Save( NgeWriter& ngeOut) const
// numero di blocchi
if ( ! ngeOut.WriteInt( m_nNumBlock, ",", false))
return false ;
// numero di dexel per blocco
// numero di voxel per blocco
if ( ! ngeOut.WriteInt( m_nVoxNumPerBlock, ",", false))
return false ;
// numero di blocchi per ogni asse
@@ -241,6 +243,9 @@ VolZmap::Save( NgeWriter& ngeOut) const
if ( ! ngeOut.WriteInt( m_nFracLin[i], ",", false))
return false ;
}
// DexVoxRatio
if ( ! ngeOut.WriteInt( m_nDexVoxRatio, ",", false))
return false ;
// numero di componenti connesse
if ( ! ngeOut.WriteInt( m_nConnectedCompoCount, ",", false))
return false ;
@@ -253,7 +258,7 @@ VolZmap::Save( NgeWriter& ngeOut) const
// sistema di riferimento
if ( ! ngeOut.WriteFrame( m_MapFrame, ";", true))
return false ;
// per ogni mappa : numero di passi in X e Y e quote z estremali
// per ogni mappa : numero di passi in X e Y e quote Z estremali
for ( int i = 0 ; i < m_nMapNum ; ++ i) {
if ( ! ngeOut.WriteInt( m_nNx[i], ",", false))
return false ;
@@ -313,7 +318,7 @@ VolZmap::Load( NgeReader& ngeIn)
// numero di blocchi
if ( ! ngeIn.ReadInt( m_nNumBlock, ",", false))
return false ;
// numero di dexel per blocco
// numero di voxel per blocco
if ( ! ngeIn.ReadInt( m_nVoxNumPerBlock, ",", false))
return false ;
// numero di blocchi per ogni asse
@@ -321,6 +326,11 @@ VolZmap::Load( NgeReader& ngeIn)
if ( ! ngeIn.ReadInt( m_nFracLin[i], ",", false))
return false ;
}
// da versione 1018 : aggiunto DexVoxRatio
if ( ngeIn.GetFileVersion() >= NGE_VER_1018) {
if ( ! ngeIn.ReadInt( m_nDexVoxRatio, ",", false))
return false ;
}
// numero di componenti connesse
if ( ! ngeIn.ReadInt( m_nConnectedCompoCount, ",", false))
return false ;
@@ -335,7 +345,7 @@ VolZmap::Load( NgeReader& ngeIn)
// sistema di riferimento
if ( ! ngeIn.ReadFrame( m_MapFrame, ";", true))
return false ;
// per ogni mappa : numero di passi in X e Y e quote z estremali
// per ogni mappa : numero di passi in X e Y e quote Z estremali
for ( int i = 0 ; i < m_nMapNum ; ++ i) {
if ( ! ngeIn.ReadInt( m_nNx[i], ",", false))
return false ;
@@ -1814,16 +1824,17 @@ VolZmap::Compact( void)
bool
VolZmap::ChangeResolution( int nDexVoxRatio)
{
if ( nDexVoxRatio < 1 || nDexVoxRatio > 2)
if ( nDexVoxRatio < 1 || nDexVoxRatio > 5)
return false ;
if ( nDexVoxRatio != m_nDexVoxRatio) {
int nOldDexVoxRatio = m_nDexVoxRatio ;
m_nDexVoxRatio = nDexVoxRatio ;
if ( CalcBlockNum()) {
ResetGraphics() ;
m_OGrMgr.Clear() ;
return true ;
}
m_nDexVoxRatio = ( m_nDexVoxRatio == 1 ? 2 : 1) ;
m_nDexVoxRatio = nOldDexVoxRatio ;
return false ;
}
return true ;
@@ -1873,7 +1884,7 @@ VolZmap::CalcBlockNum( void)
//----------------------------------------------------------------------------
bool
VolZmap::SetTolerances( double dLinTol, double dAngTolDeg)
VolZmap::SetToolTolerances( double dLinTol, double dAngTolDeg)
{
return m_Tool.SetTolerances( dLinTol, dAngTolDeg) ;
}
+5 -3
View File
@@ -75,7 +75,10 @@ class VolZmap : public IVolZmap, public IGeoObjRW
bool GetEdges( ICURVEPOVECTOR& vpCurve) const override ;
bool GetVolume( double& dVol) const override ;
bool GetDexelLines( int nDir, int nPos1, int nPos2, POLYLINELIST& lstPL) const override ;
bool SetTolerances( double dLinTol, double dAngTolDeg = 90) override ;
int GetResolution( void) const override
{ return m_nDexVoxRatio ; }
bool ChangeResolution( int nDexVoxRatio) override ;
bool SetToolTolerances( double dLinTol, double dAngTolDeg = 90) override ;
bool SetStdTool( const std::string& sToolName, double dH, double dR, double dCornR, double dCutterH, int nFlag) override ;
bool SetAdvTool( const std::string& sToolName,
double dH, double dR, double dTipH, double dTipR, double dCornR, double dCutterH, int nFlag) override ;
@@ -104,8 +107,7 @@ class VolZmap : public IVolZmap, public IGeoObjRW
bool GetPartBBox( int nPart, const Frame3d& frRef, BBox3d& b3Ref, int nFlag = BBF_STANDARD) const override ;
VolZmap* ClonePart( int nPart) const override ;
bool RemovePart( int nPart) override ;
int GetPartMinDistFromPoint( const Point3d& ptP) const override ;
bool ChangeResolution( int nDexVoxRatio) ;
int GetPartMinDistFromPoint( const Point3d& ptP) const override ;
public : // IGeoObjRW
int GetNgeId( void) const override ;