diff --git a/EgtGeomKernel.rc b/EgtGeomKernel.rc index b6f3ebb..8728d43 100644 Binary files a/EgtGeomKernel.rc and b/EgtGeomKernel.rc differ diff --git a/VolZmapGraphics.cpp b/VolZmapGraphics.cpp index e119cb0..34f79bb 100644 --- a/VolZmapGraphics.cpp +++ b/VolZmapGraphics.cpp @@ -1794,25 +1794,6 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DEXLIST& lstTria, VoxelContainer& vV for ( int nV = 0 ; nV < nVertComp[nComp] ; ++ nV) { VoxConf.Compo[tOldCompo].CompVecField[nV] = CompoVert[nComp][nV] ; } - // Esperimento - //for ( int nVtI = 0 ; nVtI < VoxConf[tOldSize].Compo[tOldCompo].nVertNum ; ++ nVtI) { - // int nVtJ = ( nVtI + 1) % nVertComp[nComp] ; - // Point3d ptPI = VoxConf[tOldSize].Compo[tOldCompo].CompVecField[nVtI].ptPApp ; - // Point3d ptPJ = VoxConf[tOldSize].Compo[tOldCompo].CompVecField[nVtJ].ptPApp ; - // Vector3d vtNI = VoxConf[tOldSize].Compo[tOldCompo].CompVecField[nVtI].vtVec ; - // Vector3d vtNJ = VoxConf[tOldSize].Compo[tOldCompo].CompVecField[nVtJ].vtVec ; - // Vector3d vtN = ( ptPJ - ptSol) ^ ( ptPI - ptPJ) ; - // double dFactor = 50 * EPS_SMALL * N_DEXVOXRATIO * m_dStep * vtN.Len() ; - // vtN.Normalize() ; - // if ( AreOppositeVectorApprox( vtN, vtNI) && AreOppositeVectorApprox( vtN, vtNJ)) { - // // Vers 1 - // //ptSol += dFactor * vtN ; - // // Vers 2 - // ptSol -= dFactor * 0.5 * ( vtNI + vtNJ) ; - // break ; - // } - //} - // Fine esperimento VoxConf.Compo[tOldCompo].ptVert = ptSol ; VoxConf.Compo[tOldCompo].bInside = IsPointInsideVoxelApprox( i, j, k, ptSol, 0) ; VoxConf.Compo[tOldCompo].bCorner = ( nFeatureType == CORNER) ; @@ -2000,41 +1981,39 @@ VolZmap::RegulateFeaturesChain( std::vector& vVecVox) const } // Caso feature else { - std::vector vNearInn, vNearBord ; + INTVECTOR vNearInn, vNearBord ; FindAdjComp( vVecVox, nBlock, nVox, nComp, vNearInn, vNearBord) ; int nSizeInn = int( vNearInn.size()) ; int nSizeBord = int( vNearBord.size() ); if ( nSizeInn + nSizeBord == 6) { - Voxel* pVoxSt = new Voxel ; - Voxel* pVoxEn = new Voxel ; + const Voxel* pVoxSt = nullptr ; + const Voxel* pVoxEn = nullptr ; if ( nSizeInn == 6) { - *pVoxSt = vVecVox[vNearInn[0]].find( vNearInn[1])->second ; - *pVoxEn = vVecVox[vNearInn[3]].find( vNearInn[4])->second ; + pVoxSt = &( vVecVox[vNearInn[0]].find( vNearInn[1])->second) ; + pVoxEn = &( vVecVox[vNearInn[3]].find( vNearInn[4])->second) ; } else if ( nSizeBord == 6) { - *pVoxSt = m_InterBlockVox[vNearBord[0]].find( vNearBord[1])->second ; - *pVoxEn = m_InterBlockVox[vNearBord[3]].find( vNearBord[4])->second ; + pVoxSt = &( m_InterBlockVox[vNearBord[0]].find( vNearBord[1])->second) ; + pVoxEn = &( m_InterBlockVox[vNearBord[3]].find( vNearBord[4])->second) ; } else { - *pVoxSt = vVecVox[vNearInn[0]].find( vNearInn[1])->second ; - *pVoxEn = m_InterBlockVox[vNearBord[0]].find( vNearBord[1])->second ; + pVoxSt = &( vVecVox[vNearInn[0]].find( vNearInn[1])->second) ; + pVoxEn = &( m_InterBlockVox[vNearBord[0]].find( vNearBord[1])->second) ; } - Voxel& AdjVoxSt = * pVoxSt ; - Voxel& AdjVoxEn = * pVoxEn ; Point3d ptPCur = CurVox.Compo[nComp].ptVert ; Point3d ptPSt ; Point3d ptPEn ; if ( nSizeInn == 6) { - ptPSt = AdjVoxSt.Compo[vNearInn[2]].ptVert ; - ptPEn = AdjVoxEn.Compo[vNearInn[5]].ptVert ; + ptPSt = pVoxSt->Compo[vNearInn[2]].ptVert ; + ptPEn = pVoxEn->Compo[vNearInn[5]].ptVert ; } else if ( nSizeBord == 6) { - ptPSt = AdjVoxSt.Compo[vNearBord[2]].ptVert ; - ptPEn = AdjVoxEn.Compo[vNearBord[5]].ptVert ; + ptPSt = pVoxSt->Compo[vNearBord[2]].ptVert ; + ptPEn = pVoxEn->Compo[vNearBord[5]].ptVert ; } else { - ptPSt = AdjVoxSt.Compo[vNearInn[2]].ptVert ; - ptPEn = AdjVoxEn.Compo[vNearBord[2]].ptVert ; + ptPSt = pVoxSt->Compo[vNearInn[2]].ptVert ; + ptPEn = pVoxEn->Compo[vNearBord[2]].ptVert ; } Vector3d vtStCurr = ptPCur - ptPSt ; Vector3d vtStEn = ptPEn - ptPSt ; @@ -2072,7 +2051,7 @@ VolZmap::RegulateFeaturesChain( std::vector& vVecVox) const } bool bNewInside = IsPointInsideVoxelApprox( CurVox.i, CurVox.j, CurVox.k, ptNew, 0) ; if ( abs( vtStCurr * vtStEn) > 0.95 && abs( vtStCurr * vtCurrEn) > 0.95 && - abs( vtStEn * vtCurrEn) > 0.95 /*&& bNewInside*/) { + abs( vtStEn * vtCurrEn) > 0.95) { CurVox.Compo[nComp].ptVert = ptNew ; } } @@ -2096,36 +2075,34 @@ VolZmap::RegulateFeaturesChain( std::vector& vVecVox) const int nSizeInn = int( vNearInn.size()) ; int nSizeBord = int( vNearBord.size() ); if ( nSizeInn + nSizeBord == 6) { - Voxel* pVoxSt = new Voxel ; - Voxel* pVoxEn = new Voxel ; + const Voxel* pVoxSt = nullptr ; + const Voxel* pVoxEn = nullptr ; if ( nSizeInn == 6) { - *pVoxSt = vVecVox[vNearInn[0]].find( vNearInn[1])->second ; - *pVoxEn = vVecVox[vNearInn[3]].find( vNearInn[4])->second ; + pVoxSt = &( vVecVox[vNearInn[0]].find( vNearInn[1])->second) ; + pVoxEn = &( vVecVox[vNearInn[3]].find( vNearInn[4])->second) ; } else if ( nSizeBord == 6) { - *pVoxSt = m_InterBlockVox[vNearBord[0]].find( vNearBord[1])->second ; - *pVoxEn = m_InterBlockVox[vNearBord[3]].find( vNearBord[4])->second ; + pVoxSt = &( m_InterBlockVox[vNearBord[0]].find( vNearBord[1])->second) ; + pVoxEn = &( m_InterBlockVox[vNearBord[3]].find( vNearBord[4])->second) ; } else { - *pVoxSt = vVecVox[vNearInn[0]].find( vNearInn[1])->second ; - *pVoxEn = m_InterBlockVox[vNearBord[0]].find( vNearBord[1])->second ; + pVoxSt = &( vVecVox[vNearInn[0]].find( vNearInn[1])->second) ; + pVoxEn = &( m_InterBlockVox[vNearBord[0]].find( vNearBord[1])->second) ; } - Voxel& AdjVoxSt = * pVoxSt ; - Voxel& AdjVoxEn = * pVoxEn ; Point3d ptPCur = CurVox.Compo[nComp].ptVert ; Point3d ptPSt ; Point3d ptPEn ; if ( nSizeInn == 6) { - ptPSt = AdjVoxSt.Compo[vNearInn[2]].ptVert ; - ptPEn = AdjVoxEn.Compo[vNearInn[5]].ptVert ; + ptPSt = pVoxSt->Compo[vNearInn[2]].ptVert ; + ptPEn = pVoxEn->Compo[vNearInn[5]].ptVert ; } else if ( nSizeBord == 6) { - ptPSt = AdjVoxSt.Compo[vNearBord[2]].ptVert ; - ptPEn = AdjVoxEn.Compo[vNearBord[5]].ptVert ; + ptPSt = pVoxSt->Compo[vNearBord[2]].ptVert ; + ptPEn = pVoxEn->Compo[vNearBord[5]].ptVert ; } else { - ptPSt = AdjVoxSt.Compo[vNearInn[2]].ptVert ; - ptPEn = AdjVoxEn.Compo[vNearBord[2]].ptVert ; + ptPSt = pVoxSt->Compo[vNearInn[2]].ptVert ; + ptPEn = pVoxEn->Compo[vNearBord[2]].ptVert ; } Vector3d vtStCurr = ptPCur - ptPSt ; Vector3d vtStEn = ptPEn - ptPSt ; diff --git a/VolZmapVolume.cpp b/VolZmapVolume.cpp index 9ff601c..99de0c9 100644 --- a/VolZmapVolume.cpp +++ b/VolZmapVolume.cpp @@ -1088,8 +1088,6 @@ VolZmap::CylBall_ZMilling( unsigned int nGrid, const Point3d & ptS, const Point3 vtV2 = vtV1 ; vtV2.Rotate( Z_AX, 90) ; - //Frame3d frNewFrame ; frNewFrame.Set( ptIT, vtMove) ; - double dMin, dMax ; for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {