Commit 15a8cad2 authored by Pierre Kraemer's avatar Pierre Kraemer

compute volume colors in volumeExplorer main

parent 7dd93bed
......@@ -29,6 +29,7 @@
#include "Algo/Modelisation/polyhedron.h"
#include "Algo/Import/import.h"
#include "Algo/Geometry/volume.h"
#include "Algo/Geometry/area.h"
#include "Utils/chrono.h"
......@@ -176,7 +177,7 @@ void MyQT::cb_Open()
// if (v>maxV)
// maxV=v;
if(myMap.isBoundaryAdjacentVolume(d))
if(myMap.isVolumeIncidentToBoundary(d))
color[d] = PFP::VEC3(0,0,0);
}
// for (unsigned int i = color.begin(); i != color.end(); color.next(i))
......@@ -417,20 +418,20 @@ int main(int argc, char **argv)
for (Dart d = tra.begin(); d != tra.end(); d = tra.next())
{
float v = Algo::Geometry::tetrahedronVolume<PFP>(myMap, d, position);
// color[d] = PFP::VEC3(v,0,0);
// if (v>maxV)
// maxV=v;
color[d] = PFP::VEC3(v,0,0);
if (v>maxV)
maxV=v;
if(myMap.isBoundaryAdjacentVolume(d))
color[d] = PFP::VEC3(0,0,0);
else
// if(myMap.isVolumeIncidentToBoundary(d))
// color[d] = PFP::VEC3(0,0,0);
// else
color[d] = PFP::VEC3(v,0,0);
}
// for (unsigned int i = color.begin(); i != color.end(); color.next(i))
// {
// color[i][0] /= maxV;
// color[i][2] = 1.0f - color[i][0];
// }
for (unsigned int i = color.begin(); i != color.end(); color.next(i))
{
color[i][0] /= maxV;
color[i][2] = 1.0f - color[i][0];
}
}
else
......@@ -505,9 +506,18 @@ int main(int argc, char **argv)
Vol w(myMap.begin());
VEC3 q = Algo::Surface::Geometry::volumeCentroid<PFP>(myMap,w,position);
ch.start();
float vol = Algo::Geometry::Parallel::totalVolume<PFP>(myMap, position);
vol += Algo::Geometry::Parallel::totalVolume<PFP>(myMap, position);
vol += Algo::Geometry::Parallel::totalVolume<PFP>(myMap, position);
vol += Algo::Geometry::Parallel::totalVolume<PFP>(myMap, position);
std::cout << ch.elapsed()<< " ms // val="<<vol<< std::endl;
std::cout << "Compute Volume ->"<< std::endl;
ch.start();
float vol = Algo::Geometry::totalVolume<PFP>(myMap, position);
vol = Algo::Geometry::totalVolume<PFP>(myMap, position);
std::cout << ch.elapsed()<< " ms val="<<vol<< std::endl;
ch.start();
vol += Algo::Geometry::totalVolume<PFP>(myMap, position);
......@@ -519,13 +529,6 @@ int main(int argc, char **argv)
vol += Algo::Geometry::totalVolume<PFP>(myMap, position);
std::cout << ch.elapsed()<< " ms val="<<vol<< std::endl;
ch.start();
vol = Algo::Geometry::Parallel::totalVolume<PFP>(myMap, position);
vol += Algo::Geometry::Parallel::totalVolume<PFP>(myMap, position);
vol += Algo::Geometry::Parallel::totalVolume<PFP>(myMap, position);
vol += Algo::Geometry::Parallel::totalVolume<PFP>(myMap, position);
std::cout << ch.elapsed()<< " ms // val="<<vol<< std::endl;
// et on attend la fin.
return app.exec();
......
......@@ -301,9 +301,9 @@ public:
assert(this->m_map.template getMarkerSet<DART>(this->m_thread).testMark(this->m_mark));
this->m_map.foreach_dart_of_orbit(c, [&] (Dart d)
{
unsigned int dindex = this->m_map.dartIndex(d);
(*this->m_markVector)[dindex].setMark(this->m_mark);
m_markedDarts.push_back(dindex);
unsigned int d_index = this->m_map.dartIndex(d);
(*this->m_markVector)[d_index].setMark(this->m_mark);
m_markedDarts.push_back(d_index);
}
, this->m_thread) ;
}
......
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