Commit 0f0c1735 authored by Sylvain Thery's avatar Sylvain Thery
Browse files

resolve picking pb in topo3

parent bb7622ee
...@@ -75,6 +75,7 @@ void Topo3Render::updateDataMap3(typename PFP::MAP& mapx, const VertexAttribute< ...@@ -75,6 +75,7 @@ void Topo3Render::updateDataMap3(typename PFP::MAP& mapx, const VertexAttribute<
m_nbDarts = 0; m_nbDarts = 0;
for (Dart d = mapx.begin(); d != mapx.end(); mapx.next(d)) for (Dart d = mapx.begin(); d != mapx.end(); mapx.next(d))
{ {
if (!mapx.isBoundaryMarked3(d)) // in the following code Traversor do not traverse boundary
m_nbDarts++; m_nbDarts++;
} }
...@@ -237,25 +238,27 @@ void Topo3Render::setDartsIdColor(typename PFP::MAP& map) ...@@ -237,25 +238,27 @@ void Topo3Render::setDartsIdColor(typename PFP::MAP& map)
for (Dart d = map.begin(); d != map.end(); map.next(d)) for (Dart d = map.begin(); d != map.end(); map.next(d))
{ {
if (nb < m_nbDarts) if ( !map.isBoundaryMarked3(d)) // topo3 Render do not traverse boundary
{ {
float r,g,b; if (nb < m_nbDarts)
dartToCol(d, r,g,b); {
float r,g,b;
float* local = colorBuffer+3*m_attIndex[d]; // get the right position in VBO dartToCol(d, r,g,b);
*local++ = r;
*local++ = g; float* local = colorBuffer+3*m_attIndex[d]; // get the right position in VBO
*local++ = b; *local++ = r;
*local++ = r; *local++ = g;
*local++ = g; *local++ = b;
*local++ = b; *local++ = r;
*local++ = g;
nb++; *local++ = b;
} nb++;
else }
{ else
CGoGNerr << "Error buffer too small for color picking (change the selector parameter ?)" << CGoGNendl; {
break; CGoGNerr << "Error buffer too small for color picking (change the selector parameter ?)" << CGoGNendl;
break;
}
} }
} }
glUnmapBuffer(GL_ARRAY_BUFFER); glUnmapBuffer(GL_ARRAY_BUFFER);
...@@ -270,15 +273,18 @@ void Topo3Render::updateColors(typename PFP::MAP& map, const VertexAttribute<typ ...@@ -270,15 +273,18 @@ void Topo3Render::updateColors(typename PFP::MAP& map, const VertexAttribute<typ
for (Dart d = map.begin(); d != map.end(); map.next(d)) for (Dart d = map.begin(); d != map.end(); map.next(d))
{ {
if (nb < m_nbDarts) if ( !map.isBoundaryMarked3(d)) // topo3 Render do not traverse boundary
{ {
colorBuffer[m_attIndex[d]] = colors[d]; if (nb < m_nbDarts)
nb++; {
} colorBuffer[m_attIndex[d]] = colors[d];
else nb++;
{ }
CGoGNerr << "Error buffer too small for color picking (change the selector parameter ?)" << CGoGNendl; else
break; {
CGoGNerr << "Error buffer too small for color picking (change the selector parameter ?)" << CGoGNendl;
break;
}
} }
} }
glUnmapBuffer(GL_ARRAY_BUFFER); glUnmapBuffer(GL_ARRAY_BUFFER);
...@@ -313,6 +319,7 @@ void Topo3Render::updateDataGMap3(typename PFP::MAP& mapx, const VertexAttribute ...@@ -313,6 +319,7 @@ void Topo3Render::updateDataGMap3(typename PFP::MAP& mapx, const VertexAttribute
m_nbDarts = 0; m_nbDarts = 0;
for (Dart d = mapx.begin(); d != mapx.end(); mapx.next(d)) for (Dart d = mapx.begin(); d != mapx.end(); mapx.next(d))
{ {
if (!map.isBoundaryMarked3(d)) // in the following code Traversor do not traverse boundary
m_nbDarts++; m_nbDarts++;
} }
......
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