EgtGeomKernel 2.2f6 :
- in calcolo triangoli Zmap parallelizzato calcolo ExtMarchingCubes.
This commit is contained in:
Binary file not shown.
@@ -107,7 +107,7 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;I_AM_EGK;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<OpenMPSupport>true</OpenMPSupport>
|
||||
<OpenMPSupport>false</OpenMPSupport>
|
||||
<CompileAs>CompileAsCpp</CompileAs>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
@@ -142,7 +142,7 @@ copy $(TargetPath) \EgtProg\DllD32</Command>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;I_AM_EGK;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<OpenMPSupport>true</OpenMPSupport>
|
||||
<OpenMPSupport>false</OpenMPSupport>
|
||||
<CompileAs>CompileAsCpp</CompileAs>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
@@ -177,7 +177,7 @@ copy $(TargetPath) \EgtProg\DllD64</Command>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;I_AM_EGK;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<OpenMPSupport>true</OpenMPSupport>
|
||||
<OpenMPSupport>false</OpenMPSupport>
|
||||
<CompileAs>CompileAsCpp</CompileAs>
|
||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
||||
@@ -224,7 +224,7 @@ copy $(TargetPath) \EgtProg\Dll32</Command>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;I_AM_EGK;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<OpenMPSupport>true</OpenMPSupport>
|
||||
<OpenMPSupport>false</OpenMPSupport>
|
||||
<CompileAs>CompileAsCpp</CompileAs>
|
||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "/EgtDev/Include/EGkVolZmap.h"
|
||||
#include <unordered_map>
|
||||
#include <stack>
|
||||
#include <mutex>
|
||||
|
||||
// ------------------------- STRUTTURE -----------------------------------------------------------
|
||||
struct AppliedVector {
|
||||
@@ -402,6 +403,7 @@ class VolZmap : public IVolZmap, public IGeoObjRW
|
||||
mutable std::vector<InterVoxMatter> m_SliceXY ;
|
||||
mutable std::vector<InterVoxMatter> m_SliceXZ ;
|
||||
mutable std::vector<InterVoxMatter> m_SliceYZ ;
|
||||
mutable std::mutex SliceMutex ;
|
||||
|
||||
Tool m_Tool ;
|
||||
} ;
|
||||
|
||||
+37
-6
@@ -24,6 +24,8 @@
|
||||
#include "/EgtDev/Include/EgtNumUtils.h"
|
||||
#include "/EgtDev/Extern/Eigen/Core"
|
||||
#include "/EgtDev/Extern/Eigen/SVD"
|
||||
#include <thread>
|
||||
#include <future>
|
||||
|
||||
using namespace std ;
|
||||
|
||||
@@ -916,11 +918,25 @@ VolZmap::UpdateTripleMapGraphics( void) const
|
||||
}
|
||||
|
||||
// Calcolo i triangoli sui blocchi
|
||||
for ( int t = 0 ; t < m_nNumBlock ; ++ t) {
|
||||
int nBlockUpdated = 0 ;
|
||||
vector< future<bool>> vRes ;
|
||||
vRes.resize( m_nNumBlock) ;
|
||||
for ( int i = 0 ; i < m_nNumBlock ; ++ i) {
|
||||
// Se il blocco deve essere processato
|
||||
if ( m_BlockToUpdate[t]) {
|
||||
if ( m_BlockToUpdate[i]) {
|
||||
// processo ...
|
||||
ExtMarchingCubes( int( t), vVoxContainerVec[t]) ;
|
||||
++ nBlockUpdated ;
|
||||
vRes[i] = async( launch::async, &VolZmap::ExtMarchingCubes, this, i, ref( vVoxContainerVec[i])) ;
|
||||
}
|
||||
}
|
||||
bool bOk = true ;
|
||||
int nTerminated = 0 ;
|
||||
while ( nTerminated < nBlockUpdated) {
|
||||
for ( int i = 0 ; i < m_nNumBlock ; ++ i) {
|
||||
if ( m_BlockToUpdate[i] && vRes[i].valid() && vRes[i].wait_for( chrono::microseconds{ 1 }) == future_status::ready) {
|
||||
bOk = vRes[i].get() && bOk ;
|
||||
++ nTerminated ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1205,11 +1221,13 @@ VolZmap::ExtMarchingCubes( int nBlock, VoxelContainer& vVox) const
|
||||
bDefTopology = true ;
|
||||
}
|
||||
if ( GetBlockNFromIJK( nSlBlockIJK, nSlBlockN)) {
|
||||
SliceMutex.lock() ;
|
||||
auto it = m_SliceYZ[nSlBlockN].find( nSliceN) ;
|
||||
if ( it != m_SliceYZ[nSlBlockN].end()) {
|
||||
bMatOnSlice = it->second ;
|
||||
bDefTopology = true ;
|
||||
}
|
||||
SliceMutex.unlock() ;
|
||||
}
|
||||
}
|
||||
else if ( abs( nAdjVox3[nCount]) == 2) {
|
||||
@@ -1219,11 +1237,13 @@ VolZmap::ExtMarchingCubes( int nBlock, VoxelContainer& vVox) const
|
||||
bDefTopology = true ;
|
||||
}
|
||||
if ( GetBlockNFromIJK( nSlBlockIJK, nSlBlockN)) {
|
||||
SliceMutex.lock() ;
|
||||
auto it = m_SliceXZ[nSlBlockN].find( nSliceN) ;
|
||||
if ( it != m_SliceXZ[nSlBlockN].end()) {
|
||||
bMatOnSlice = it->second ;
|
||||
bDefTopology = true ;
|
||||
}
|
||||
SliceMutex.unlock() ;
|
||||
}
|
||||
}
|
||||
else if ( abs( nAdjVox3[nCount]) == 3) {
|
||||
@@ -1233,11 +1253,13 @@ VolZmap::ExtMarchingCubes( int nBlock, VoxelContainer& vVox) const
|
||||
bDefTopology = true ;
|
||||
}
|
||||
if ( GetBlockNFromIJK( nSlBlockIJK, nSlBlockN)) {
|
||||
SliceMutex.lock() ;
|
||||
auto it = m_SliceXY[nSlBlockN].find( nSliceN) ;
|
||||
if ( it != m_SliceXY[nSlBlockN].end()) {
|
||||
bMatOnSlice = it->second ;
|
||||
bDefTopology = true ;
|
||||
}
|
||||
SliceMutex.unlock() ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1301,20 +1323,29 @@ VolZmap::ExtMarchingCubes( int nBlock, VoxelContainer& vVox) const
|
||||
if ( abs(nAdjVox3[nCount]) == 1) {
|
||||
if ( nSlBlockN == nBlock)
|
||||
SliceYZ.emplace( nSliceN, bMatOnSlice) ;
|
||||
else
|
||||
else {
|
||||
SliceMutex.lock() ;
|
||||
m_SliceYZ[nSlBlockN].emplace( nSliceN, bMatOnSlice) ;
|
||||
SliceMutex.unlock() ;
|
||||
}
|
||||
}
|
||||
else if ( abs(nAdjVox3[nCount]) == 2) {
|
||||
if ( nSlBlockN == nBlock)
|
||||
SliceXZ.emplace( nSliceN, bMatOnSlice) ;
|
||||
else
|
||||
else {
|
||||
SliceMutex.lock() ;
|
||||
m_SliceXZ[nSlBlockN].emplace( nSliceN, bMatOnSlice) ;
|
||||
SliceMutex.unlock() ;
|
||||
}
|
||||
}
|
||||
else if ( abs(nAdjVox3[nCount]) == 3) {
|
||||
if ( nSlBlockN == nBlock)
|
||||
SliceXY.emplace(nSliceN, bMatOnSlice) ;
|
||||
else
|
||||
else {
|
||||
SliceMutex.lock();
|
||||
m_SliceXY[nSlBlockN].emplace( nSliceN, bMatOnSlice) ;
|
||||
SliceMutex.unlock() ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user