diff --git a/VolTriZmapCreation.cpp b/VolTriZmapCreation.cpp index 7b79422..0afffae 100644 --- a/VolTriZmapCreation.cpp +++ b/VolTriZmapCreation.cpp @@ -146,11 +146,11 @@ VolZmap::Create( const Point3d& ptO, double dLengthX, double dLengthY, double dL } // Ridimensiono e setto il vettore dei blocchi a falso - int BlockVecSize = m_nFracLin[0] * m_nFracLin[1] * m_nFracLin[2] ; + m_nNumBlock = m_nFracLin[0] * m_nFracLin[1] * m_nFracLin[2] ; - m_BlockToUpdate.resize( BlockVecSize) ; + m_BlockToUpdate.resize( m_nNumBlock) ; - for ( int nCount = 0 ; nCount < BlockVecSize ; ++ nCount) + for ( unsigned int nCount = 0 ; nCount < m_nNumBlock ; ++ nCount) m_BlockToUpdate[nCount] = true ; @@ -380,11 +380,11 @@ VolZmap::CreateFromFlatRegion( const ISurfFlatRegion& Surf, double dDimZ, double } // Ridimensiono e setto il vettore dei blocchi a falso - int BlockVecSize = m_nFracLin[0] * m_nFracLin[1] * m_nFracLin[2] ; + m_nNumBlock = m_nFracLin[0] * m_nFracLin[1] * m_nFracLin[2] ; - m_BlockToUpdate.resize( BlockVecSize) ; + m_BlockToUpdate.resize( m_nNumBlock) ; - for ( int nCount = 0 ; nCount < BlockVecSize ; ++ nCount) + for ( unsigned int nCount = 0 ; nCount < m_nNumBlock ; ++ nCount) m_BlockToUpdate[nCount] = true ; @@ -667,11 +667,11 @@ VolZmap::CreateFromTriMesh( const ISurfTriMesh& Surf, double dPrec, bool bFlag) } // Ridimensiono e setto il vettore dei blocchi a falso - int BlockVecSize = m_nFracLin[0] * m_nFracLin[1] * m_nFracLin[2] ; + m_nNumBlock = m_nFracLin[0] * m_nFracLin[1] * m_nFracLin[2] ; - m_BlockToUpdate.resize( BlockVecSize) ; + m_BlockToUpdate.resize( m_nNumBlock) ; - for ( int nCount = 0 ; nCount < BlockVecSize ; ++ nCount) + for ( unsigned int nCount = 0 ; nCount < m_nNumBlock ; ++ nCount) m_BlockToUpdate[nCount] = true ; diff --git a/VolTriZmapGraphics.cpp b/VolTriZmapGraphics.cpp index c37ca6e..e8b10a7 100644 --- a/VolTriZmapGraphics.cpp +++ b/VolTriZmapGraphics.cpp @@ -223,6 +223,8 @@ VolZmap::GetBlockTriangles( int nBlock, TRIA3DLIST& lstTria) const //ExtMarchingCubes( nBlock, lstTria, triHold) ; MarchingCubes( nBlock, lstTria) ; + + m_BlockToUpdate[nBlock] = false ; return true ; } @@ -235,6 +237,13 @@ VolZmap::GetBlockInfo( std::vector & bModified) const return true ; } +//---------------------------------------------------------------------------- +int +VolZmap::GetBlockCount( void) const +{ + return m_nNumBlock ; +} + //---------------------------------------------------------------------------- bool VolZmap::GetChunkPrisms( int nPos1, int nPos2, int nDim1, int nDim2, int nDimChk, TRIA3DLIST& lstTria) const @@ -649,8 +658,6 @@ VolZmap::MarchingCubes( int nBlock, TRIA3DLIST& lstTria) const } } } - - m_BlockToUpdate[nBlock] = false ; return true ; } diff --git a/VolZmap.h b/VolZmap.h index 246e6d4..961ddd2 100644 --- a/VolZmap.h +++ b/VolZmap.h @@ -73,8 +73,9 @@ class VolZmap : public IVolZmap, public IGeoObjRW bool CreateFromFlatRegion( const ISurfFlatRegion& Surf, double dDimZ, double dPrec, bool bTriDex) override ; bool CreateFromTriMesh( const ISurfTriMesh& Surf, double dPrec, bool bTriDex) override ; bool GetAllTriangles( TRIA3DLIST& lstTria) const override ; - bool GetBlockTriangles( int nBlock, TRIA3DLIST& lstTria) const override ; + int GetBlockCount( void) const override ; bool GetBlockInfo( std::vector & bModified) const override ; + bool GetBlockTriangles( int nBlock, TRIA3DLIST& lstTria) const override ; bool GetDexelLines( int nDir, int nPos1, int nPos2, POLYLINELIST& lstPL) const override ; bool SetTolerances( double dLinTol, double dAngTolDeg = 90) override ; bool SetStdTool( const std::string& pToolName, double dH, double dR, double dCornR) override ; @@ -233,7 +234,7 @@ class VolZmap : public IVolZmap, public IGeoObjRW private : enum Status { ERR = 0, OK = 1, TO_VERIFY = 2} ; static const int N_MAPS = 3 ; - static const int N_DEXBLOCK = 10000 ; + static const int N_DEXBLOCK = 32 ; private : ObjGraphicsMgr m_OGrMgr ; // gestore grafica dell'oggetto @@ -256,7 +257,7 @@ class VolZmap : public IVolZmap, public IGeoObjRW std::vector> m_Values[N_MAPS] ; // dexel delle 3 griglie unsigned int m_nDexNumPBlock ; // Numero di dexel per blocco - unsigned int m_nFracLin[3] ; // Numero di blocchi per per ogni asse + unsigned int m_nFracLin[3] ; // Numero di blocchi per ogni asse unsigned int m_nNumBlock ; // Numero totale di blocchi mutable std::vector m_BlockToUpdate ;