Coupure prévue mardi 3 Août au matin pour maintenance du serveur. Nous faisons au mieux pour que celle-ci soit la plus brève possible.

Commit df2d8970 authored by Sylvain Thery's avatar Sylvain Thery
Browse files

resolving bug render picking and coloring

parent ac81c9b3
...@@ -93,9 +93,6 @@ void Topo3Render::updateDataMap3(typename PFP::MAP& mapx, const typename PFP::TV ...@@ -93,9 +93,6 @@ void Topo3Render::updateDataMap3(typename PFP::MAP& mapx, const typename PFP::TV
{ {
if (good(d)) if (good(d))
{ {
m_attIndex[d] = posDBI;
posDBI+=2;
CellMarkerStore markVert(map, VERTEX); //marker for vertices CellMarkerStore markVert(map, VERTEX); //marker for vertices
VEC3 center(0, 0, 0); VEC3 center(0, 0, 0);
unsigned int nbv = 0; unsigned int nbv = 0;
...@@ -196,6 +193,9 @@ void Topo3Render::updateDataMap3(typename PFP::MAP& mapx, const typename PFP::TV ...@@ -196,6 +193,9 @@ void Topo3Render::updateDataMap3(typename PFP::MAP& mapx, const typename PFP::TV
VEC3 P = vecPos[i]*ke + vecPos[i+1]*oke; VEC3 P = vecPos[i]*ke + vecPos[i+1]*oke;
VEC3 Q = vecPos[i+1]*ke + vecPos[i]*oke; VEC3 Q = vecPos[i+1]*ke + vecPos[i]*oke;
m_attIndex[d] = posDBI;
posDBI+=2;
*positionDartBuf++ = P; *positionDartBuf++ = P;
*positionDartBuf++ = Q; *positionDartBuf++ = Q;
*colorDartBuf++ = VEC3(1.,1.,1.0); *colorDartBuf++ = VEC3(1.,1.,1.0);
...@@ -364,9 +364,6 @@ void Topo3Render::updateDataGMap3(typename PFP::MAP& mapx, const typename PFP::T ...@@ -364,9 +364,6 @@ void Topo3Render::updateDataGMap3(typename PFP::MAP& mapx, const typename PFP::T
{ {
if (good(d)) if (good(d))
{ {
m_attIndex[d] = posDBI;
posDBI+=2;
CellMarkerStore markVert(map, VERTEX); //marker for vertices CellMarkerStore markVert(map, VERTEX); //marker for vertices
VEC3 center(0, 0, 0); VEC3 center(0, 0, 0);
unsigned int nbv = 0; unsigned int nbv = 0;
...@@ -477,6 +474,10 @@ void Topo3Render::updateDataGMap3(typename PFP::MAP& mapx, const typename PFP::T ...@@ -477,6 +474,10 @@ void Topo3Render::updateDataGMap3(typename PFP::MAP& mapx, const typename PFP::T
*colorDartBuf++ = VEC3(1.,1.,1.); *colorDartBuf++ = VEC3(1.,1.,1.);
*colorDartBuf++ = VEC3(1.,1.,1.); *colorDartBuf++ = VEC3(1.,1.,1.);
m_attIndex[d] = posDBI;
posDBI+=2;
fv1[d] = P*0.9f + PP*0.1f; fv1[d] = P*0.9f + PP*0.1f;
fv2x[d] = P*0.52f + PP*0.48f; fv2x[d] = P*0.52f + PP*0.48f;
fv2[d] = P*0.48f + PP*0.52f; fv2[d] = P*0.48f + PP*0.52f;
...@@ -484,6 +485,10 @@ void Topo3Render::updateDataGMap3(typename PFP::MAP& mapx, const typename PFP::T ...@@ -484,6 +485,10 @@ void Topo3Render::updateDataGMap3(typename PFP::MAP& mapx, const typename PFP::T
fv1[dx] = Q*0.9f + QQ*0.1f; fv1[dx] = Q*0.9f + QQ*0.1f;
fv2[dx] = Q*0.52f + QQ*0.48f; fv2[dx] = Q*0.52f + QQ*0.48f;
fv2x[dx] = Q*0.48f + QQ*0.52f; fv2x[dx] = Q*0.48f + QQ*0.52f;
m_attIndex[dx] = posDBI;
posDBI+=2;
d = map.phi1(d); d = map.phi1(d);
} }
......
...@@ -75,10 +75,7 @@ void TopoRender::updateDataMap(typename PFP::MAP& mapx, const typename PFP::TVEC ...@@ -75,10 +75,7 @@ void TopoRender::updateDataMap(typename PFP::MAP& mapx, const typename PFP::TVEC
for(Dart d = map.begin(); d!= map.end(); map.next(d)) for(Dart d = map.begin(); d!= map.end(); map.next(d))
{ {
if (good(d)) if (good(d))
{
vecDarts.push_back(d); vecDarts.push_back(d);
m_attIndex[d] = (vecDarts.size()-1)*2;
}
} }
m_nbDarts = vecDarts.size(); m_nbDarts = vecDarts.size();
...@@ -102,6 +99,8 @@ void TopoRender::updateDataMap(typename PFP::MAP& mapx, const typename PFP::TVEC ...@@ -102,6 +99,8 @@ void TopoRender::updateDataMap(typename PFP::MAP& mapx, const typename PFP::TVEC
std::vector<VEC3> vecPos; std::vector<VEC3> vecPos;
vecPos.reserve(16); vecPos.reserve(16);
unsigned int indexDC=0;
DartMarker mf(map); DartMarker mf(map);
for(std::vector<Dart>::iterator id = vecDarts.begin(); id!= vecDarts.end(); id++) for(std::vector<Dart>::iterator id = vecDarts.begin(); id!= vecDarts.end(); id++)
{ {
...@@ -137,11 +136,12 @@ void TopoRender::updateDataMap(typename PFP::MAP& mapx, const typename PFP::TVEC ...@@ -137,11 +136,12 @@ void TopoRender::updateDataMap(typename PFP::MAP& mapx, const typename PFP::TVEC
VEC3 P = vecPos[i]*ke + vecPos[i+1]*k; VEC3 P = vecPos[i]*ke + vecPos[i+1]*k;
VEC3 Q = vecPos[i+1]*ke + vecPos[i]*k; VEC3 Q = vecPos[i+1]*ke + vecPos[i]*k;
m_attIndex[d] = indexDC;
indexDC+=2;
*positionDartBuf++ = P; *positionDartBuf++ = P;
*colorDartBuf++ = VEC3(1.,0.,0.);
*positionDartBuf++ = Q; *positionDartBuf++ = Q;
*colorDartBuf++ = VEC3(1.,1.,1.); *colorDartBuf++ = VEC3(1.,1.,1.);
*colorDartBuf++ = VEC3(1.,1.,1.);
VEC3 f = P*0.5f + Q*0.5f; VEC3 f = P*0.5f + Q*0.5f;
fv2[d] = f; fv2[d] = f;
f = P*0.1f + Q*0.9f; f = P*0.1f + Q*0.9f;
...@@ -220,10 +220,7 @@ void TopoRender::updateDataGMap(typename PFP::MAP& mapx, const typename PFP::TVE ...@@ -220,10 +220,7 @@ void TopoRender::updateDataGMap(typename PFP::MAP& mapx, const typename PFP::TVE
for(Dart d = map.begin(); d!= map.end(); map.next(d)) for(Dart d = map.begin(); d!= map.end(); map.next(d))
{ {
if (good(d)) if (good(d))
{
vecDarts.push_back(d); vecDarts.push_back(d);
m_attIndex[d] = (vecDarts.size()-1)*2;
}
} }
m_nbDarts = vecDarts.size(); m_nbDarts = vecDarts.size();
...@@ -248,6 +245,8 @@ void TopoRender::updateDataGMap(typename PFP::MAP& mapx, const typename PFP::TVE ...@@ -248,6 +245,8 @@ void TopoRender::updateDataGMap(typename PFP::MAP& mapx, const typename PFP::TVE
std::vector<VEC3> vecPos; std::vector<VEC3> vecPos;
vecPos.reserve(16); vecPos.reserve(16);
unsigned int indexDC=0;
DartMarker mf(map); DartMarker mf(map);
for(std::vector<Dart>::iterator id = vecDarts.begin(); id!= vecDarts.end(); id++) for(std::vector<Dart>::iterator id = vecDarts.begin(); id!= vecDarts.end(); id++)
{ {
...@@ -285,6 +284,8 @@ void TopoRender::updateDataGMap(typename PFP::MAP& mapx, const typename PFP::TVE ...@@ -285,6 +284,8 @@ void TopoRender::updateDataGMap(typename PFP::MAP& mapx, const typename PFP::TVE
VEC3 PP = REAL(0.52)*P + REAL(0.48)*Q; VEC3 PP = REAL(0.52)*P + REAL(0.48)*Q;
VEC3 QQ = REAL(0.52)*Q + REAL(0.48)*P; VEC3 QQ = REAL(0.52)*Q + REAL(0.48)*P;
m_attIndex[d] = indexDC;
indexDC+=2;
*positionDartBuf++ = P; *positionDartBuf++ = P;
*colorDartBuf++ = VEC3(1.,1.,1.); *colorDartBuf++ = VEC3(1.,1.,1.);
*positionDartBuf++ = PP; *positionDartBuf++ = PP;
...@@ -304,6 +305,9 @@ void TopoRender::updateDataGMap(typename PFP::MAP& mapx, const typename PFP::TVE ...@@ -304,6 +305,9 @@ void TopoRender::updateDataGMap(typename PFP::MAP& mapx, const typename PFP::TVE
fv2[dd] = f; fv2[dd] = f;
f = Q*0.9f + QQ*0.1f; f = Q*0.9f + QQ*0.1f;
fv1[dd] = f; fv1[dd] = f;
m_attIndex[dd] = indexDC;
indexDC+=2;
d = map.phi1(d); d = map.phi1(d);
} }
...@@ -366,10 +370,10 @@ void TopoRender::setDartsIdColor(typename PFP::MAP& map, const FunctorSelect& go ...@@ -366,10 +370,10 @@ void TopoRender::setDartsIdColor(typename PFP::MAP& map, const FunctorSelect& go
unsigned int nb=0; unsigned int nb=0;
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 (good(d)) if (good(d))
{
if (nb < m_nbDarts)
{ {
float r,g,b; float r,g,b;
dartToCol(d, r,g,b); dartToCol(d, r,g,b);
...@@ -380,7 +384,6 @@ void TopoRender::setDartsIdColor(typename PFP::MAP& map, const FunctorSelect& go ...@@ -380,7 +384,6 @@ void TopoRender::setDartsIdColor(typename PFP::MAP& map, const FunctorSelect& go
*local++ = r; *local++ = r;
*local++ = g; *local++ = g;
*local++ = b; *local++ = b;
nb++; nb++;
} }
else else
...@@ -389,7 +392,6 @@ void TopoRender::setDartsIdColor(typename PFP::MAP& map, const FunctorSelect& go ...@@ -389,7 +392,6 @@ void TopoRender::setDartsIdColor(typename PFP::MAP& map, const FunctorSelect& go
break; break;
} }
} }
} }
glUnmapBuffer(GL_ARRAY_BUFFER); glUnmapBuffer(GL_ARRAY_BUFFER);
} }
......
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