Commit 273fc127 authored by Pierre Kraemer's avatar Pierre Kraemer

orbit as template -> volumeExplorer OK

parent 70b2a513
......@@ -33,8 +33,8 @@
PFP::MAP myMap;
PFP::TVEC3 position ;
PFP::TVEC3 color ;
AttributeHandler<PFP::VEC3, VERTEX> position ;
AttributeHandler<PFP::VEC3, VOLUME> color ;
void MyQT::volumes_onoff(bool x)
{
......@@ -139,7 +139,7 @@ void MyQT::cb_initGL()
SelectorDartNoBoundary<PFP::MAP> nb(myMap);
m_topo_render->updateData<PFP>(myMap, position, 0.8f, 0.8f, 0.8f, nb);
m_explode_render->updateData<PFP>(myMap,position,color);
m_explode_render->updateData<PFP>(myMap, position, color);
m_explode_render->setExplodeVolumes(0.8f);
m_explode_render->setExplodeFaces(0.9f);
m_explode_render->setAmbiant(Geom::Vec4f(0.2f,0.2f,0.2f,1.0f));
......@@ -316,7 +316,7 @@ int main(int argc, char **argv)
return 1;
}
else
position = myMap.getAttribute<PFP::VEC3>(VERTEX , attrNames[0]) ;
position = myMap.getAttribute<PFP::VEC3, VERTEX>(attrNames[0]) ;
}
if(extension == std::string(".off"))
......@@ -328,39 +328,39 @@ int main(int argc, char **argv)
}
else
{
position = myMap.getAttribute<PFP::VEC3>(VERTEX , attrNames[0]) ;
position = myMap.getAttribute<PFP::VEC3, VERTEX>(attrNames[0]) ;
myMap.closeMap();
}
}
color = myMap.addAttribute<PFP::VEC3>(VOLUME, "color");
color = myMap.addAttribute<PFP::VEC3, VOLUME>("color");
TraversorCell<PFP::MAP> tra(myMap,VOLUME);
float maxV=0.0f;
for (Dart d = tra.begin(); d != tra.end(); d=tra.next())
TraversorCell<PFP::MAP, VOLUME> tra(myMap);
float maxV = 0.0f;
for (Dart d = tra.begin(); d != tra.end(); d = tra.next())
{
float v = Algo::Geometry::tetrahedronVolume<PFP>(myMap,d,position);
float v = Algo::Geometry::tetrahedronVolume<PFP>(myMap, d, position);
color[d] = PFP::VEC3(v,0,0);
if (v>maxV)
maxV=v;
}
for (unsigned int i = color.begin(); i!=color.end(); color.next(i))
for (unsigned int i = color.begin(); i != color.end(); color.next(i))
{
color[i][0] /= maxV;
color[i][2] = 1.0f -color[i][0];
color[i][2] = 1.0f - color[i][0];
}
}
else
{
position = myMap.addAttribute<PFP::VEC3>(VERTEX, "position");
position = myMap.addAttribute<PFP::VEC3, VERTEX>("position");
Algo::Modelisation::Primitive3D<PFP> prim(myMap, position);
int nb = 8;
prim.hexaGrid_topo(nb,nb,nb);
prim.embedHexaGrid(1.0f,1.0f,1.0f);
color = myMap.addAttribute<PFP::VEC3>(VOLUME, "color");
TraversorCell<PFP::MAP> tra(myMap,VOLUME);
for (Dart d = tra.begin(); d != tra.end(); d=tra.next())
color = myMap.addAttribute<PFP::VEC3, VOLUME>("color");
TraversorW<PFP::MAP> tra(myMap);
for (Dart d = tra.begin(); d != tra.end(); d = tra.next())
color[d] = position[d] + PFP::VEC3(0.5,0.5,0.5);
}
// un peu d'interface
......
......@@ -97,11 +97,11 @@ class MyQT: public Utils::QT::SimpleQT
int m_begY;
int clip_id1;
int clip_id2;
public:
float m_WidthObj;
Geom::Vec3f m_PosObj;
public:
MyQT():
render_volumes(true),
......
......@@ -37,16 +37,16 @@ namespace Geometry
{
template <typename PFP>
typename PFP::REAL tetrahedronSignedVolume(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position) ;
typename PFP::REAL tetrahedronSignedVolume(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position) ;
template <typename PFP>
typename PFP::REAL tetrahedronVolume(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position) ;
typename PFP::REAL tetrahedronVolume(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position) ;
template <typename PFP>
typename PFP::REAL convexPolyhedronVolume(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position) ;
typename PFP::REAL convexPolyhedronVolume(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position) ;
template <typename PFP>
typename PFP::REAL totalVolume(typename PFP::MAP& map, const typename PFP::TVEC3& position, const FunctorSelect& select = allDarts) ;
typename PFP::REAL totalVolume(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, const FunctorSelect& select = allDarts) ;
} // namespace Geometry
......
......@@ -36,7 +36,7 @@ namespace Geometry
{
template <typename PFP>
typename PFP::REAL tetrahedronSignedVolume(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
typename PFP::REAL tetrahedronSignedVolume(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{
typename PFP::VEC3 p1 = position[d] ;
typename PFP::VEC3 p2 = position[map.phi1(d)] ;
......@@ -47,7 +47,7 @@ typename PFP::REAL tetrahedronSignedVolume(typename PFP::MAP& map, Dart d, const
}
template <typename PFP>
typename PFP::REAL tetrahedronVolume(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
typename PFP::REAL tetrahedronVolume(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{
typename PFP::VEC3 p1 = position[d] ;
typename PFP::VEC3 p2 = position[map.phi1(d)] ;
......@@ -58,7 +58,7 @@ typename PFP::REAL tetrahedronVolume(typename PFP::MAP& map, Dart d, const typen
}
template <typename PFP>
typename PFP::REAL convexPolyhedronVolume(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
typename PFP::REAL convexPolyhedronVolume(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{
typedef typename PFP::VEC3 VEC3;
......@@ -115,7 +115,7 @@ typename PFP::REAL convexPolyhedronVolume(typename PFP::MAP& map, Dart d, const
}
template <typename PFP>
float totalVolume(typename PFP::MAP& map, const typename PFP::TVEC3& position, const FunctorSelect& select)
float totalVolume(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, const FunctorSelect& select)
{
typename PFP::REAL vol = 0 ;
TraversorW<typename PFP::MAP> t(map, select) ;
......
......@@ -39,7 +39,7 @@ template <typename T, unsigned int ORBIT>
AttributeHandler_IHM<T, ORBIT> ImplicitHierarchicalMap::addAttribute(const std::string& nameAttr)
{
bool addNextLevelCell = false ;
if(!isOrbitEmbedded(ORBIT))
if(!isOrbitEmbedded<ORBIT>())
addNextLevelCell = true ;
AttributeHandler<T, ORBIT> h = Map2::addAttribute<T, ORBIT>(nameAttr) ;
......@@ -254,7 +254,7 @@ inline bool ImplicitHierarchicalMap::foreach_dart_of_cc(Dart d, FunctorType& f,
inline void ImplicitHierarchicalMap::splitFace(Dart d, Dart e)
{
EmbeddedMap2::splitFace(d, e) ;
if(isOrbitEmbedded(FACE))
if(isOrbitEmbedded<FACE>())
{
unsigned int cur = m_curLevel ;
m_curLevel = m_maxLevel ;
......
......@@ -32,14 +32,14 @@ namespace IHM
{
/***************************************************
* ATTRIBUTES MANAGEMENT *
* ATTRIBUTES MANAGEMENT *
***************************************************/
template <typename T, unsigned int ORBIT>
AttributeHandler_IHM<T, ORBIT> ImplicitHierarchicalMap3::addAttribute(const std::string& nameAttr)
{
bool addNextLevelCell = false ;
if(!isOrbitEmbedded(ORBIT))
if(!isOrbitEmbedded<ORBIT>())
addNextLevelCell = true ;
AttributeHandler<T, ORBIT> h = Map3::addAttribute<T, ORBIT>(nameAttr) ;
......
......@@ -179,21 +179,21 @@ bool importMeshSToV(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts, float d
if(backEdgesBuffer[em] == EMBNULL)
{
unsigned int emn = map.template newCell<VERTEX>();
map.copyCell<VERTEX>(emn, em);
map.template copyCell<VERTEX>(emn, em);
backEdgesBuffer[em] = emn;
position[emn] += typename PFP::VEC3(0,0,dist);
}
FunctorSetEmb<typename PFP::MAP, VERTEX> fsetemb(map, em);
//foreach_dart_of_orbit_in_parent<typename PFP::MAP>(&map, VERTEX, d, fsetemb) ;
map.foreach_dart_of_orbit<VERTEX + PFP::MAP::IN_PARENT>(d, fsetemb);
map.template foreach_dart_of_orbit<VERTEX + PFP::MAP::IN_PARENT>(d, fsetemb);
//Embed the other base face
Dart d2 = map.phi1(map.phi1(map.phi2(d)));
unsigned int em2 = backEdgesBuffer[em];
FunctorSetEmb<typename PFP::MAP, VERTEX> fsetemb2(map, em2);
//foreach_dart_of_orbit_in_parent<typename PFP::MAP>(&map, VERTEX, d2, fsetemb2) ;
map.foreach_dart_of_orbit<VERTEX + PFP::MAP::IN_PARENT>(d2, fsetemb2);
map.template foreach_dart_of_orbit<VERTEX + PFP::MAP::IN_PARENT>(d2, fsetemb2);
m.mark(d) ; // mark on the fly to unmark on second loop
vecDartsPerVertex[em].push_back(d); // store incident darts for fast adjacency reconstruction
......@@ -212,11 +212,11 @@ bool importMeshSToV(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts, float d
// darts incident to end vertex of edge
std::vector<Dart>& vec = vecDartsPerVertex[map.phi1(d)];
unsigned int embd = map.getEmbedding<VERTEX>(d);
unsigned int embd = map.template getEmbedding<VERTEX>(d);
Dart good_dart = NIL;
for (typename std::vector<Dart>::iterator it = vec.begin(); it != vec.end() && good_dart == NIL; ++it)
{
if (map.getEmbedding<VERTEX>(map.phi1(*it)) == embd)
if (map.template getEmbedding<VERTEX>(map.phi1(*it)) == embd)
good_dart = *it;
}
......
......@@ -129,8 +129,7 @@ bool importTet(typename PFP::MAP& map, const std::string& filename, std::vector<
for(unsigned int j = 0 ; j < 3 ; ++j)
{
FunctorSetEmb<typename PFP::MAP, VERTEX> fsetemb(map, verticesID[pt[2-j]]);
map.foreach_dart_of_orbit<VERTEX + PFP::MAP::IN_PARENT>(d, fsetemb);
map.template foreach_dart_of_orbit<VERTEX + PFP::MAP::IN_PARENT>(d, fsetemb);
//store darts per vertices to optimize reconstruction
Dart dd = d;
......@@ -148,8 +147,7 @@ bool importTet(typename PFP::MAP& map, const std::string& filename, std::vector<
d = map.phi_1(map.phi2(d));
FunctorSetEmb<typename PFP::MAP, VERTEX> fsetemb(map, verticesID[pt[3]]);
map.foreach_dart_of_orbit<VERTEX + PFP::MAP::IN_PARENT>(d, fsetemb);
map.template foreach_dart_of_orbit<VERTEX + PFP::MAP::IN_PARENT>(d, fsetemb);
//store darts per vertices to optimize reconstruction
Dart dd = d;
......@@ -174,9 +172,9 @@ bool importTet(typename PFP::MAP& map, const std::string& filename, std::vector<
Dart good_dart = NIL;
for(typename std::vector<Dart>::iterator it = vec.begin(); it != vec.end() && good_dart == NIL; ++it)
{
if(map.getEmbedding<VERTEX>(map.phi1(*it)) == map.getEmbedding<VERTEX>(d) &&
map.getEmbedding<VERTEX>(map.phi_1(*it)) == map.getEmbedding<VERTEX>(map.phi_1(d)) /*&&
map.getEmbedding<VERTEX>(*it) == map.getEmbedding<VERTEX>(map.phi1(d)) */)
if(map.template getEmbedding<VERTEX>(map.phi1(*it)) == map.template getEmbedding<VERTEX>(d) &&
map.template getEmbedding<VERTEX>(map.phi_1(*it)) == map.template getEmbedding<VERTEX>(map.phi_1(d)) /*&&
map.template getEmbedding<VERTEX>(*it) == map.template getEmbedding<VERTEX>(map.phi1(d)) */)
{
good_dart = *it ;
}
......@@ -185,7 +183,7 @@ bool importTet(typename PFP::MAP& map, const std::string& filename, std::vector<
if (good_dart != NIL)
{
map.sewVolumes(d, good_dart, false);
m.unmarkOrbit<FACE>(d);
m.template unmarkOrbit<FACE>(d);
}
else
{
......
......@@ -51,10 +51,10 @@ template <typename PFP>
class Primitive3D
{
typedef typename PFP::MAP MAP;
typedef typename PFP::VEC3 EMB;
typedef typename PFP::VEC3 VEC3;
public:
enum {NONE,HEXAGRID};
enum {NONE, HEXAGRID};
protected:
/**
......@@ -62,8 +62,8 @@ protected:
*/
MAP& m_map;
AttributeHandler<VEC3, VERTEX>& m_positions;
typename PFP::TVEC3& m_positions;
/**
* Reference dart of primitive
*/
......@@ -110,21 +110,22 @@ public:
* Constructor
* @param map the map in which we want to work
*/
Primitive3D(MAP& map, typename PFP::TVEC3& position):
m_map(map),
m_positions(position),
m_kind(NONE),
m_nx(-1), m_ny(-1), m_nz(-1) {}
Primitive3D(MAP& map, AttributeHandler<VEC3, VERTEX>& position):
m_map(map),
m_positions(position),
m_kind(NONE),
m_nx(-1), m_ny(-1), m_nz(-1)
{}
/**
* get the table of darts (one per vertex)
*/
const std::vector<Dart>& getVertexDarts() { return m_tableVertDarts;}
const std::vector<Dart>& getVertexDarts() { return m_tableVertDarts; }
/*
* get the reference dart
*/
Dart getDart() { return m_dart;}
Dart getDart() { return m_dart; }
/**
* transform the primitive with transformation matrice
......@@ -182,6 +183,6 @@ public:
} // namespace CGoGN
#include "primitives3d.hpp"
#include "Algo/Modelisation/primitives3d.hpp"
#endif
......@@ -206,7 +206,7 @@ void Primitive3D<PFP>::embedHexaGrid(float x, float y, float z)
typename PFP::VEC3 pos(-x/2.0f + dx*float(k), -y/2.0f + dy*float(j), -z/2.0f + dz*float(i));
Dart d = m_tableVertDarts[ i*nbs+j*(m_nx+1)+k ];
m_map.embedNewCell<VERTEX>(d);
m_map.template embedNewCell<VERTEX>(d);
m_positions[d] = pos;
}
}
......
......@@ -382,14 +382,14 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec
Dart dit2 = vd2[i];
// embed the vertex embedded from the origin volume to the new darts
if(map.isOrbitEmbedded(VERTEX))
if(map.isOrbitEmbedded<VERTEX>())
{
map.copyDartEmbedding<VERTEX>(map.phi2(dit), map.phi1(dit));
map.copyDartEmbedding<VERTEX>(map.phi2(dit2), map.phi1(dit2));
}
// embed the edge embedded from the origin volume to the new darts
if(map.isOrbitEmbedded(EDGE))
if(map.isOrbitEmbedded<EDGE>())
{
unsigned int eEmb = map.getEmbedding<EDGE>(dit) ;
map.setDartEmbedding<EDGE>(map.phi2(dit), eEmb);
......@@ -397,7 +397,7 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec
}
// embed the volume embedded from the origin volume to the new darts
if(map.isOrbitEmbedded(VOLUME))
if(map.isOrbitEmbedded<VOLUME>())
{
map.copyDartEmbedding<VOLUME>(map.phi2(dit), dit);
map.copyDartEmbedding<VOLUME>(map.phi2(dit2), dit2);
......@@ -412,7 +412,7 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec
Dart next = map.phi1(map.phi1(dd)) ;
map.PFP::MAP::ParentMap::splitFace(dd, next);
if (map.isOrbitEmbedded(VERTEX))
if (map.isOrbitEmbedded<VERTEX>())
{
map.copyDartEmbedding<VERTEX>(map.phi_1(next), dd) ;
map.copyDartEmbedding<VERTEX>(map.phi_1(dd), next) ;
......@@ -428,7 +428,7 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec
// Dart tmp = map.phi1(ne) ;
// map.PFP::MAP::ParentMap::splitFace(tmp, dd);
//
// if (map.isOrbitEmbedded(VERTEX))
// if (map.isOrbitEmbedded<VERTEX>())
// {
// map.copyDartEmbedding<VERTEX>(map.phi_1(dd), tmp) ;
// map.copyDartEmbedding<VERTEX>(map.phi_1(tmp), dd) ;
......
......@@ -110,7 +110,7 @@ void unlinkFromEdge(typename PFP::MAP& map, Dart d)
{
Dart d3 = map.phi3(d);
// if(map.isOrbitEmbedded(VERTEX))
// if(map.isOrbitEmbedded<VERTEX>())
// {
// //Si la face n'est pas libre en phi2
// if(map.phi2(d) != d && map.phi2(d3) != d3)
......
......@@ -77,15 +77,13 @@ protected:
Geom::Vec3f m_globalColor;
public:
/**
* Constructor
* @param withColorPerFace affect a color per face
* @param withExplodeFace shrinj each face
*/
ExplodeVolumeRender(bool withColorPerFace=false, bool withExplodeFace=false) ;
ExplodeVolumeRender(bool withColorPerFace = false, bool withExplodeFace = false) ;
/**
* Destructor
......@@ -109,17 +107,17 @@ public:
* @param good selector
*/
template<typename PFP>
void updateData(typename PFP::MAP& map, typename PFP::TVEC3& positions, const FunctorSelect& good = allDarts) ;
void updateData(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& positions, const FunctorSelect& good = allDarts) ;
/**
* update all drawing buffers
* @param map the map
* @param positions attribute of position vertices
* @param positions attribute of position vertices
* @param colorPerFace attribute of color (per face)
* @param good selector
*/
template<typename PFP>
void updateData(typename PFP::MAP& map, typename PFP::TVEC3& positions, typename PFP::TVEC3& colorPerFace, const FunctorSelect& good = allDarts) ;
void updateData(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& positions, const AttributeHandler<typename PFP::VEC3, VOLUME>& colorPerFace, const FunctorSelect& good = allDarts) ;
/**
* draw edges
......
......@@ -76,7 +76,7 @@ inline ExplodeVolumeRender::~ExplodeVolumeRender()
}
template<typename PFP>
void ExplodeVolumeRender::updateData(typename PFP::MAP& map, typename PFP::TVEC3& positions, const FunctorSelect& good)
void ExplodeVolumeRender::updateData(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& positions, const FunctorSelect& good)
{
if (m_cpf)
{
......@@ -87,25 +87,19 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, typename PFP::TVEC3
typedef typename PFP::VEC3 VEC3;
typedef typename PFP::REAL REAL;
CellMarker cmv(map,VOLUME);
AutoAttributeHandler<VEC3> centerVolumes(map,VOLUME,"centerVolumes");
TraversorW<typename PFP::MAP> traVol(map,good);
for (Dart d=traVol.begin(); d!=traVol.end(); d=traVol.next())
{
centerVolumes[d] = Algo::Geometry::volumeCentroid<PFP>(map, d, positions);
}
AutoAttributeHandler<VEC3, VOLUME> centerVolumes(map, "centerVolumes");
Algo::Geometry::computeCentroidVolumes<PFP>(map, positions, centerVolumes, good);
std::vector<VEC3> buffer;
buffer.reserve(16384);
TraversorCell<typename PFP::MAP, FACE + PFP::MAP::IN_PARENT> traFace(map, good);
TraversorCell<typename PFP::MAP> traFace(map, PFP::MAP::ORBIT_IN_PARENT(FACE),good);
for (Dart d=traFace.begin(); d!=traFace.end(); d=traFace.next())
for (Dart d = traFace.begin(); d != traFace.end(); d = traFace.next())
{
if (m_ef)
{
VEC3 centerFace = Algo::Geometry::faceCentroid<PFP>(map,d,positions);
VEC3 centerFace = Algo::Geometry::faceCentroid<PFP>(map, d, positions);
Dart a = d;
Dart b = map.phi1(a);
Dart c = map.phi1(b);
......@@ -154,12 +148,12 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, typename PFP::TVEC3
buffer.clear();
TraversorCell<typename PFP::MAP> traEdge(map, PFP::MAP::ORBIT_IN_PARENT(EDGE),good);
for (Dart d=traEdge.begin(); d!=traEdge.end(); d=traEdge.next())
TraversorCell<typename PFP::MAP, EDGE + PFP::MAP::IN_PARENT> traEdge(map, good);
for (Dart d = traEdge.begin(); d != traEdge.end(); d = traEdge.next())
{
buffer.push_back(centerVolumes[d]);
buffer.push_back(positions[d]);
buffer.push_back(positions[ map.phi1(d)]);
buffer.push_back(centerVolumes[d]);
buffer.push_back(positions[d]);
buffer.push_back(positions[map.phi1(d)]);
}
m_nbLines = buffer.size()/3;
......@@ -173,9 +167,8 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, typename PFP::TVEC3
m_shaderL->setAttributePosition(m_vboPosLine);
}
template<typename PFP>
void ExplodeVolumeRender::updateData(typename PFP::MAP& map, typename PFP::TVEC3& positions, typename PFP::TVEC3& colorPerXXX, const FunctorSelect& good)
void ExplodeVolumeRender::updateData(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& positions, const AttributeHandler<typename PFP::VEC3, VOLUME>& colorPerXXX, const FunctorSelect& good)
{
if (!m_cpf)
{
......@@ -186,13 +179,8 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, typename PFP::TVEC3
typedef typename PFP::VEC3 VEC3;
typedef typename PFP::REAL REAL;
CellMarker cmv(map,VOLUME);
AutoAttributeHandler<VEC3> centerVolumes(map,VOLUME,"centerVolumes");
TraversorW<typename PFP::MAP> traVol(map,good);
for (Dart d=traVol.begin(); d!=traVol.end(); d=traVol.next())
{
centerVolumes[d] = Algo::Geometry::volumeCentroid<PFP>(map, d, positions);
}
AutoAttributeHandler<VEC3, VOLUME> centerVolumes(map, "centerVolumes");
Algo::Geometry::computeCentroidVolumes<PFP>(map, positions, centerVolumes, good);
std::vector<VEC3> buffer;
buffer.reserve(16384);
......@@ -204,12 +192,11 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, typename PFP::TVEC3
if (withColors)
bufferColors.reserve(16384);
TraversorCell<typename PFP::MAP, FACE + PFP::MAP::IN_PARENT> traFace(map, good);
TraversorCell<typename PFP::MAP> traFace(map, PFP::MAP::ORBIT_IN_PARENT(FACE),good);
for (Dart d=traFace.begin(); d!=traFace.end(); d=traFace.next())
for (Dart d = traFace.begin(); d != traFace.end(); d = traFace.next())
{
VEC3 centerFace = Algo::Geometry::faceCentroid<PFP>(map,d,positions);
VEC3 centerFace = Algo::Geometry::faceCentroid<PFP>(map, d, positions);
Dart a = d;
Dart b = map.phi1(a);
......@@ -260,12 +247,12 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, typename PFP::TVEC3
buffer.clear();
TraversorCell<typename PFP::MAP> traEdge(map, PFP::MAP::ORBIT_IN_PARENT(EDGE),good);
for (Dart d=traEdge.begin(); d!=traEdge.end(); d=traEdge.next())
TraversorCell<typename PFP::MAP, EDGE + PFP::MAP::IN_PARENT> traEdge(map, good);
for (Dart d = traEdge.begin(); d != traEdge.end(); d = traEdge.next())
{
buffer.push_back(centerVolumes[d]);
buffer.push_back(positions[d]);
buffer.push_back(positions[ map.phi1(d)]);
buffer.push_back(positions[map.phi1(d)]);
}
m_nbLines = buffer.size()/3;
......@@ -277,11 +264,8 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, typename PFP::TVEC3
m_vboPosLine->releasePtr();
m_shaderL->setAttributePosition(m_vboPosLine);
}
inline void ExplodeVolumeRender::drawFaces()
{
m_shader->enableVertexAttribs();
......@@ -292,7 +276,6 @@ inline void ExplodeVolumeRender::drawFaces()
m_shader->disableVertexAttribs();
}
inline void ExplodeVolumeRender::drawEdges()
{
......@@ -301,7 +284,6 @@ inline void ExplodeVolumeRender::drawEdges()
m_shaderL->disableVertexAttribs();
}
inline void ExplodeVolumeRender::setExplodeVolumes(float explode)
{
m_shader->setExplodeVolumes(explode);
......@@ -313,7 +295,6 @@ inline void ExplodeVolumeRender::setExplodeFaces(float explode)
m_shader->setExplodeFaces(explode);
}
inline void ExplodeVolumeRender::setClippingPlane(const Geom::Vec4f& p)
{
m_shader->setClippingPlane(p);
......@@ -347,7 +328,6 @@ inline void ExplodeVolumeRender::setColorLine(const Geom::Vec4f& col)
m_shaderL->setColor(col);
}
inline Utils::GLSLShader* ExplodeVolumeRender::shaderFaces()
{
return m_shader;
......@@ -358,7 +338,6 @@ inline Utils::GLSLShader* ExplodeVolumeRender::shaderLines()
return m_shaderL;
}
}//end namespace VBO
}//end namespace Algo
......
......@@ -124,7 +124,6 @@ protected:
*/
AttributeHandler<unsigned int, DART> m_attIndex;