Commit 421664a0 authored by Alexander Wiebel's avatar Alexander Wiebel

[FIX #453] now the index stuff is right (module works fine)

parent ff3b0db5
......@@ -637,6 +637,7 @@ void WMMarchingCubes::updateGraphicsCallback()
{
if( localTextureChangedFlag )
{
std::cout<<m_surfaceGeode->getNumDrawables()<<std::endl;
osg::ref_ptr< osg::Geometry > surfaceGeometry = m_surfaceGeode->getDrawable( 0 )->asGeometry();
osg::Vec3Array* texCoords = new osg::Vec3Array;
boost::shared_ptr< WGridRegular3D > grid = ( *iter )->getGrid();
......
......@@ -229,7 +229,6 @@ void WMTeemGlyphs::moduleMain()
m_moduleState.wait();
continue;
}
// std::cout << "FA: " << m_GFAThresholdProp->get( true ) << std::endl;
if( m_input->getData().get() )
{
bool dataChanged = false;
......@@ -448,7 +447,7 @@ WMTeemGlyphs::GlyphGeneration::GlyphGeneration( boost::shared_ptr< WDataSetSpher
m_nB = m_nY;
break;
}
size_t nbGlyphs = ( m_nA * m_nB ) / ( m_modulo * m_modulo );
size_t nbGlyphs = ( ( m_nA + ( m_modulo - 1 ) ) / m_modulo ) * ( ( m_nB + ( m_modulo - 1 ) ) / m_modulo );
const unsigned int level = m_subdivisionLevel; // subdivision level of sphere
unsigned int infoBitFlag = ( 1 << limnPolyDataInfoNorm ) | ( 1 << limnPolyDataInfoRGBA );
......@@ -512,33 +511,29 @@ void WMTeemGlyphs::GlyphGeneration::operator()( size_t id, size_t numThreads, WB
float* esh = new float[type->num];
//******************************************
// Please take care when changing something between here and the following mark.
// Sizes and upper bound are carefully adjusted to avoid segfault with modulo
// and to avoid unwanted gaps if computing with many threads.
size_t chunkSize = m_nA / numThreads;
size_t chunkSize = m_nA / ( numThreads - 1 );
size_t first = id * chunkSize;
size_t last = ( id + 1 ) * chunkSize - 1;
size_t lastPlusOne = ( id + 1 ) * chunkSize;
if( id == numThreads - 1 )
{
last = m_nA - 2;
lastPlusOne = m_nA;
}
std::stringstream ss;
ss << id << "/" << numThreads <<" (" << first << " ... " << last << ")[" << chunkSize << "/" << m_nA << "]" << std::endl;
ss << id << "/" << numThreads <<" (" << first << " ... " << lastPlusOne - 1 << ")[" << chunkSize << "/" << m_nA << "]" << std::endl;
WLogger::getLogger()->addLogMessage( ss.str(), "______", LL_DEBUG );
for( size_t aId = first; aId <= last; ++aId )
for( size_t aId = first; aId < lastPlusOne; ++aId )
{
for( size_t bId = 0; bId < m_nB; ++bId )
{
// Please take care when changing something between here and the above mark.
//******************************************
if( !( ( aId % m_modulo == 0) && ( bId % m_modulo == 0 ) ) )
if( ( aId % m_modulo != 0) || ( bId % m_modulo != 0 ) )
{
continue;
}
size_t glyphId = ( aId / m_modulo ) * ( m_nB / m_modulo ) + ( bId / m_modulo );
size_t glyphId = ( aId / m_modulo ) * ( ( m_nB + ( m_modulo - 1 ) ) / m_modulo ) + ( bId / m_modulo );
size_t vertsUpToCurrentIteration = glyphId * nbVerts;
size_t idsUpToCurrentIteration = glyphId * m_sphere->indxNum;
......@@ -632,12 +627,10 @@ void WMTeemGlyphs::GlyphGeneration::operator()( size_t id, size_t numThreads, WB
}
else
{
// std::cout<< radius << " " << m_scale << std::endl;
if( radius != 0 )
{
scale = m_scale / radius;
}
// std::cout<< m_scale << std::endl<< std::endl;
}
estimateNormalsAntipodal( glyph, normalize );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment