Commit db4115a5 authored by Pierre Kraemer's avatar Pierre Kraemer
Browse files

Merge openGL3, parallelisme et modifs Containers

Conflicts:
	include/Algo/Render/vbo_MapRender.hpp
	include/Container/attribmv.hpp
	include/Topology/generic/genericmap.h
	include/Topology/generic/genericmap.hpp
	src/Topology/generic/attribmap.cpp
	src/Topology/generic/genericmap.cpp
parents b6651cd8 3619c00b
...@@ -246,7 +246,7 @@ void myGlutWin::myKeyboard(unsigned char keycode, int, int) ...@@ -246,7 +246,7 @@ void myGlutWin::myKeyboard(unsigned char keycode, int, int)
case 's': case 's':
{ {
GLint t1 = glutGet(GLUT_ELAPSED_TIME); GLint t1 = glutGet(GLUT_ELAPSED_TIME);
Algo::Modelisation::CatmullClarkSubdivision<PFP, AttributeHandler<PFP::VEC3>, PFP::VEC3>(myMap, position); Algo::Modelisation::CatmullClarkSubdivision<PFP>(myMap, position);
GLint t2 = glutGet(GLUT_ELAPSED_TIME); GLint t2 = glutGet(GLUT_ELAPSED_TIME);
GLfloat seconds = (t2 - t1) / 1000.0f; GLfloat seconds = (t2 - t1) / 1000.0f;
std::cout << "catmull-clark: "<< seconds << "sec" << std::endl; std::cout << "catmull-clark: "<< seconds << "sec" << std::endl;
...@@ -259,11 +259,11 @@ void myGlutWin::myKeyboard(unsigned char keycode, int, int) ...@@ -259,11 +259,11 @@ void myGlutWin::myKeyboard(unsigned char keycode, int, int)
case 'l': case 'l':
{ {
GLint t1 = glutGet(GLUT_ELAPSED_TIME); GLint t1 = glutGet(GLUT_ELAPSED_TIME);
Algo::Modelisation::LoopSubdivision<PFP, AttributeHandler<PFP::VEC3>, PFP::VEC3>(myMap, position); Algo::Modelisation::LoopSubdivision<PFP>(myMap, position);
Algo::Modelisation::LoopSubdivision<PFP, AttributeHandler<PFP::VEC3>, PFP::VEC3>(myMap, position); Algo::Modelisation::LoopSubdivision<PFP>(myMap, position);
Algo::Modelisation::LoopSubdivision<PFP, AttributeHandler<PFP::VEC3>, PFP::VEC3>(myMap, position); Algo::Modelisation::LoopSubdivision<PFP>(myMap, position);
Algo::Modelisation::LoopSubdivision<PFP, AttributeHandler<PFP::VEC3>, PFP::VEC3>(myMap, position); Algo::Modelisation::LoopSubdivision<PFP>(myMap, position);
Algo::Modelisation::LoopSubdivision<PFP, AttributeHandler<PFP::VEC3>, PFP::VEC3>(myMap, position); Algo::Modelisation::LoopSubdivision<PFP>(myMap, position);
GLint t2 = glutGet(GLUT_ELAPSED_TIME); GLint t2 = glutGet(GLUT_ELAPSED_TIME);
GLfloat seconds = (t2 - t1) / 1000.0f; GLfloat seconds = (t2 - t1) / 1000.0f;
std::cout << "loop: "<< seconds << "sec" << std::endl; std::cout << "loop: "<< seconds << "sec" << std::endl;
...@@ -276,7 +276,7 @@ void myGlutWin::myKeyboard(unsigned char keycode, int, int) ...@@ -276,7 +276,7 @@ void myGlutWin::myKeyboard(unsigned char keycode, int, int)
case 'd': case 'd':
{ {
GLint t1 = glutGet(GLUT_ELAPSED_TIME); GLint t1 = glutGet(GLUT_ELAPSED_TIME);
Algo::Modelisation::Sqrt3Subdivision<PFP, AttributeHandler<PFP::VEC3>, PFP::VEC3>(myMap, position); Algo::Modelisation::Sqrt3Subdivision<PFP>(myMap, position);
GLint t2 = glutGet(GLUT_ELAPSED_TIME); GLint t2 = glutGet(GLUT_ELAPSED_TIME);
GLfloat seconds = (t2 - t1) / 1000.0f; GLfloat seconds = (t2 - t1) / 1000.0f;
std::cout << "dual: "<< seconds << "sec" << std::endl; std::cout << "dual: "<< seconds << "sec" << std::endl;
......
...@@ -433,7 +433,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y) ...@@ -433,7 +433,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
case 'l': case 'l':
{ {
GLint t1 = glutGet(GLUT_ELAPSED_TIME); GLint t1 = glutGet(GLUT_ELAPSED_TIME);
Algo::Modelisation::LoopSubdivision<PFP, AttributeHandler<PFP::VEC3>, PFP::VEC3>(myMap, position); Algo::Modelisation::LoopSubdivision<PFP>(myMap, position);
GLint t2 = glutGet(GLUT_ELAPSED_TIME); GLint t2 = glutGet(GLUT_ELAPSED_TIME);
GLfloat seconds = (t2 - t1) / 1000.0f; GLfloat seconds = (t2 - t1) / 1000.0f;
std::cout << "loop: "<< seconds << "sec" << std::endl; std::cout << "loop: "<< seconds << "sec" << std::endl;
...@@ -454,7 +454,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y) ...@@ -454,7 +454,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
case 'c': case 'c':
{ {
GLint t1 = glutGet(GLUT_ELAPSED_TIME); GLint t1 = glutGet(GLUT_ELAPSED_TIME);
Algo::Modelisation::CatmullClarkSubdivision<PFP, AttributeHandler<PFP::VEC3>, PFP::VEC3>(myMap, position); Algo::Modelisation::CatmullClarkSubdivision<PFP>(myMap, position);
GLint t2 = glutGet(GLUT_ELAPSED_TIME); GLint t2 = glutGet(GLUT_ELAPSED_TIME);
GLfloat seconds = (t2 - t1) / 1000.0f; GLfloat seconds = (t2 - t1) / 1000.0f;
std::cout << "catmull-clark: "<< seconds << "sec" << std::endl; std::cout << "catmull-clark: "<< seconds << "sec" << std::endl;
...@@ -475,7 +475,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y) ...@@ -475,7 +475,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
case 't': case 't':
{ {
GLint t1 = glutGet(GLUT_ELAPSED_TIME); GLint t1 = glutGet(GLUT_ELAPSED_TIME);
Algo::Modelisation::trianguleFaces<PFP, AttributeHandler<PFP::VEC3>, PFP::VEC3>(myMap, position) ; Algo::Modelisation::trianguleFaces<PFP>(myMap, position) ;
GLint t2 = glutGet(GLUT_ELAPSED_TIME); GLint t2 = glutGet(GLUT_ELAPSED_TIME);
GLfloat seconds = (t2 - t1) / 1000.0f; GLfloat seconds = (t2 - t1) / 1000.0f;
std::cout << "triangulation: "<< seconds << "sec" << std::endl; std::cout << "triangulation: "<< seconds << "sec" << std::endl;
...@@ -495,7 +495,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y) ...@@ -495,7 +495,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
case 'q': case 'q':
{ {
GLint t1 = glutGet(GLUT_ELAPSED_TIME); GLint t1 = glutGet(GLUT_ELAPSED_TIME);
Algo::Modelisation::quadranguleFaces<PFP, AttributeHandler<PFP::VEC3>, PFP::VEC3>(myMap, position) ; Algo::Modelisation::quadranguleFaces<PFP>(myMap, position) ;
GLint t2 = glutGet(GLUT_ELAPSED_TIME); GLint t2 = glutGet(GLUT_ELAPSED_TIME);
GLfloat seconds = (t2 - t1) / 1000.0f; GLfloat seconds = (t2 - t1) / 1000.0f;
std::cout << "quadrangulation: "<< seconds << "sec" << std::endl; std::cout << "quadrangulation: "<< seconds << "sec" << std::endl;
...@@ -534,6 +534,99 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y) ...@@ -534,6 +534,99 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
break ; break ;
} }
case 'd':
{
myMap.removeAttribute<PFP::VEC3>(normal) ;
myMap.removeAttribute<PFP::VEC3>(laplacian) ;
AttributeHandler<PFP::VEC3> newPosition = myMap.addAttribute<PFP::VEC3>(FACE_ORBIT, "position") ;
Algo::Geometry::computeCentroidFaces<PFP>(myMap, position, newPosition) ;
GLint t1 = glutGet(GLUT_ELAPSED_TIME);
Algo::Modelisation::computeDual<PFP>(myMap) ;
GLint t2 = glutGet(GLUT_ELAPSED_TIME);
GLfloat seconds = (t2 - t1) / 1000.0f;
std::cout << "dual computation: "<< seconds << "sec" << std::endl;
newPosition = myMap.getAttribute<PFP::VEC3>(FACE_ORBIT, "position") ;
myMap.removeAttribute<PFP::VEC3>(newPosition) ;
position = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, "position") ;
normal = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "normal") ;
laplacian = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "laplacian") ;
t1 = glutGet(GLUT_ELAPSED_TIME);
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME);
seconds = (t2 - t1) / 1000.0f;
std::cout << "display update: "<< seconds << "sec" << std::endl;
glutPostRedisplay() ;
break ;
}
case '3':
{
CellMarker markVisit(myMap, VERTEX_CELL) ;
CellMarker markNoDelete(myMap, VERTEX_CELL) ;
std::vector<Dart> visited ;
visited.reserve(myMap.getNbCells(VERTEX_CELL)) ;
visited.push_back(myMap.begin()) ;
markVisit.mark(myMap.begin()) ;
for(std::vector<Dart>::iterator vertex = visited.begin(); vertex != visited.end(); ++vertex)
{
bool deleteV = true ;
if(markNoDelete.isMarked(*vertex))
deleteV = false ;
Dart vit = *vertex ;
do // add all vertex neighbors to the table
{
Dart nv = myMap.phi1(vit) ;
if(!markVisit.isMarked(nv))
{
visited.push_back(nv) ;
markVisit.mark(nv) ;
}
if(deleteV)
markNoDelete.mark(nv) ;
vit = myMap.alpha1(vit) ;
} while(vit != *vertex) ;
if(deleteV)
myMap.deleteVertex(*vertex) ;
}
// for(Dart d = myMap.begin(); d != myMap.end(); myMap.next(d))
// {
// if(!markVisit.isMarked(d))
// {
// Dart dd = myMap.phi1(d) ;
// myMap.deleteVertex(d) ;
// Dart fit = dd ;
// do
// {
// markVisit.mark(fit) ;
// fit = myMap.phi1(fit) ;
// } while(fit != dd) ;
// }
// }
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
glutPostRedisplay() ;
break ;
}
case 'a': case 'a':
{ {
Algo::Geometry::computeLaplacianVertices<PFP>(myMap, Algo::Geometry::TOPOLOGICAL, position, laplacian) ; Algo::Geometry::computeLaplacianVertices<PFP>(myMap, Algo::Geometry::TOPOLOGICAL, position, laplacian) ;
...@@ -633,6 +726,7 @@ int main(int argc, char** argv) ...@@ -633,6 +726,7 @@ int main(int argc, char** argv)
std::cerr << "could not import " << filename << std::endl ; std::cerr << "could not import " << filename << std::endl ;
return 1 ; return 1 ;
} }
mgw->position = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, attrNames[0]) ; mgw->position = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, attrNames[0]) ;
GLint t2 = glutGet(GLUT_ELAPSED_TIME) ; GLint t2 = glutGet(GLUT_ELAPSED_TIME) ;
GLfloat seconds = (t2 - t1) / 1000.0f ; GLfloat seconds = (t2 - t1) / 1000.0f ;
......
...@@ -74,7 +74,7 @@ int main(int argc, char **argv) ...@@ -74,7 +74,7 @@ int main(int argc, char **argv)
AttributeHandler<PFP::VEC3> position = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, attrNames[0]); AttributeHandler<PFP::VEC3> position = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, attrNames[0]);
for(unsigned int i = 0; i < nbSteps; ++i) for(unsigned int i = 0; i < nbSteps; ++i)
Algo::Modelisation::LoopSubdivision<PFP, AttributeHandler<PFP::VEC3>, PFP::VEC3>(myMap, position); Algo::Modelisation::LoopSubdivision<PFP>(myMap, position);
Algo::Export::exportOFF<PFP>(myMap, position, "result.off"); Algo::Export::exportOFF<PFP>(myMap, position, "result.off");
......
...@@ -51,7 +51,7 @@ private: ...@@ -51,7 +51,7 @@ private:
AttributeHandler<unsigned int> m_dartLevel ; AttributeHandler<unsigned int> m_dartLevel ;
AttributeHandler<unsigned int> m_edgeId ; AttributeHandler<unsigned int> m_edgeId ;
AttribMultiVect<unsigned int>* m_nextLevelCell[NB_ORBITS] ; AttributeMultiVector<unsigned int>* m_nextLevelCell[NB_ORBITS] ;
public: public:
ImplicitHierarchicalMap() ; ImplicitHierarchicalMap() ;
...@@ -211,10 +211,10 @@ public: ...@@ -211,10 +211,10 @@ public:
AttributeHandler_IHM() : AttributeHandler<T>() AttributeHandler_IHM() : AttributeHandler<T>()
{} {}
AttributeHandler_IHM(GenericMap* m, unsigned int idAttr) : AttributeHandler<T>(m, idAttr) AttributeHandler_IHM(GenericMap* m, AttributeMultiVector<T>* amv) : AttributeHandler<T>(m, amv)
{} {}
AttribMultiVect<T>* getDataVector() const AttributeMultiVector<T>* getDataVector() const
{ {
return AttributeHandler<T>::getDataVector() ; return AttributeHandler<T>::getDataVector() ;
} }
......
...@@ -46,22 +46,21 @@ AttributeHandler_IHM<T> ImplicitHierarchicalMap::addAttribute(unsigned int orbit ...@@ -46,22 +46,21 @@ AttributeHandler_IHM<T> ImplicitHierarchicalMap::addAttribute(unsigned int orbit
if(addNextLevelCell) if(addNextLevelCell)
{ {
AttribContainer& cellCont = m_attribs[orbit] ; AttributeContainer& cellCont = m_attribs[orbit] ;
unsigned int index = cellCont.addAttribute<unsigned int>("nextLevelCell") ; AttributeMultiVector<unsigned int>* amv = cellCont.addAttribute<unsigned int>("nextLevelCell") ;
AttribMultiVect<unsigned int>& amv = cellCont.getDataVector<unsigned int>(index) ; m_nextLevelCell[orbit] = amv ;
m_nextLevelCell[orbit] = &amv ;
for(unsigned int i = cellCont.begin(); i < cellCont.end(); cellCont.next(i)) for(unsigned int i = cellCont.begin(); i < cellCont.end(); cellCont.next(i))
amv[i] = EMBNULL ; amv->operator[](i) = EMBNULL ;
} }
return AttributeHandler_IHM<T>(this, h.id()) ; return AttributeHandler_IHM<T>(this, h.getDataVector()) ;
} }
template <typename T> template <typename T>
AttributeHandler_IHM<T> ImplicitHierarchicalMap::getAttribute(unsigned int orbit, const std::string& nameAttr) AttributeHandler_IHM<T> ImplicitHierarchicalMap::getAttribute(unsigned int orbit, const std::string& nameAttr)
{ {
AttributeHandler<T> h = Map2::getAttribute<T>(orbit, nameAttr) ; AttributeHandler<T> h = Map2::getAttribute<T>(orbit, nameAttr) ;
return AttributeHandler_IHM<T>(this, h.id()) ; return AttributeHandler_IHM<T>(this, h.getDataVector()) ;
} }
/*************************************************** /***************************************************
...@@ -333,6 +332,10 @@ inline unsigned int ImplicitHierarchicalMap::edgeLevel(Dart d) ...@@ -333,6 +332,10 @@ inline unsigned int ImplicitHierarchicalMap::edgeLevel(Dart d)
return ld < ldd ? ldd : ld ; // insertion levels of its two darts return ld < ldd ? ldd : ld ; // insertion levels of its two darts
} }
/***************************************************
* ATTRIBUTE HANDLER *
***************************************************/
template <typename T> template <typename T>
T& AttributeHandler_IHM<T>::operator[](Dart d) T& AttributeHandler_IHM<T>::operator[](Dart d)
{ {
...@@ -340,7 +343,7 @@ T& AttributeHandler_IHM<T>::operator[](Dart d) ...@@ -340,7 +343,7 @@ T& AttributeHandler_IHM<T>::operator[](Dart d)
assert(m->m_dartLevel[d] <= m->m_curLevel || !"Access to a dart introduced after current level") ; assert(m->m_dartLevel[d] <= m->m_curLevel || !"Access to a dart introduced after current level") ;
assert(m->vertexInsertionLevel(d) <= m->m_curLevel || !"Access to the embedding of a vertex inserted after current level") ; assert(m->vertexInsertionLevel(d) <= m->m_curLevel || !"Access to the embedding of a vertex inserted after current level") ;
unsigned int orbit = AttribContainer::orbitAttr(this->m_id) ; unsigned int orbit = this->m_orbit ;
unsigned int nbSteps = m->m_curLevel - m->vertexInsertionLevel(d) ; unsigned int nbSteps = m->m_curLevel - m->vertexInsertionLevel(d) ;
unsigned int index = m->getEmbedding(d, orbit) ; unsigned int index = m->getEmbedding(d, orbit) ;
...@@ -351,7 +354,7 @@ T& AttributeHandler_IHM<T>::operator[](Dart d) ...@@ -351,7 +354,7 @@ T& AttributeHandler_IHM<T>::operator[](Dart d)
return this->m_attrib->operator[](index); return this->m_attrib->operator[](index);
} }
AttribContainer& cont = m->getAttributeContainer(orbit) ; AttributeContainer& cont = m->getAttributeContainer(orbit) ;
unsigned int step = 0 ; unsigned int step = 0 ;
while(step < nbSteps) while(step < nbSteps)
{ {
...@@ -377,7 +380,7 @@ const T& AttributeHandler_IHM<T>::operator[](Dart d) const ...@@ -377,7 +380,7 @@ const T& AttributeHandler_IHM<T>::operator[](Dart d) const
assert(m->m_dartLevel[d] <= m->m_curLevel || !"Access to a dart introduced after current level") ; assert(m->m_dartLevel[d] <= m->m_curLevel || !"Access to a dart introduced after current level") ;
assert(m->vertexInsertionLevel(d) <= m->m_curLevel || !"Access to the embedding of a vertex inserted after current level") ; assert(m->vertexInsertionLevel(d) <= m->m_curLevel || !"Access to the embedding of a vertex inserted after current level") ;
unsigned int orbit = AttribContainer::orbitAttr(this->m_id) ; unsigned int orbit = this->m_orbit ;
unsigned int nbSteps = m->m_curLevel - m->vertexInsertionLevel(d) ; unsigned int nbSteps = m->m_curLevel - m->vertexInsertionLevel(d) ;
unsigned int index = m->getEmbedding(d, orbit) ; unsigned int index = m->getEmbedding(d, orbit) ;
......
...@@ -149,11 +149,9 @@ void coarsenEdge(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position) ...@@ -149,11 +149,9 @@ void coarsenEdge(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position)
unsigned int cur = map.getCurrentLevel() ; unsigned int cur = map.getCurrentLevel() ;
Dart d2 = map.phi2(d) ; Dart d2 = map.phi2(d) ;
map.setCurrentLevel(cur + 1) ; map.setCurrentLevel(cur + 1) ;
map.unsewFaces(d) ; unsigned int dl = map.getDartLevel(d2) ;
map.unsewFaces(d2) ; map.setDartLevel(map.phi1(d2), dl) ;
map.collapseEdge(map.phi1(d)) ; map.collapseEdge(d2) ;
map.collapseEdge(map.phi1(d2)) ;
map.sewFaces(d, d2) ;
map.setCurrentLevel(cur) ; map.setCurrentLevel(cur) ;
} }
......
...@@ -83,7 +83,7 @@ protected: ...@@ -83,7 +83,7 @@ protected:
static ImportSurfacique::ImportType getFileType(const std::string& filename); static ImportSurfacique::ImportType getFileType(const std::string& filename);
void extractMeshRec(AttribContainer& container, AttributeHandler<typename PFP::VEC3>& positions, const struct aiScene* scene, const struct aiNode* nd, struct aiMatrix4x4* trafo); void extractMeshRec(AttributeContainer& container, AttributeHandler<typename PFP::VEC3>& positions, const struct aiScene* scene, const struct aiNode* nd, struct aiMatrix4x4* trafo);
public: public:
typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::VEC3 VEC3 ;
......
...@@ -119,7 +119,7 @@ bool MeshTablesSurface<PFP>::importTrian(const std::string& filename, std::vecto ...@@ -119,7 +119,7 @@ bool MeshTablesSurface<PFP>::importTrian(const std::string& filename, std::vecto
AttributeHandler<typename PFP::VEC3> positions = m_map.template addAttribute<typename PFP::VEC3>(VERTEX_ORBIT, "position") ; AttributeHandler<typename PFP::VEC3> positions = m_map.template addAttribute<typename PFP::VEC3>(VERTEX_ORBIT, "position") ;
attrNames.push_back(positions.name()) ; attrNames.push_back(positions.name()) ;
AttribContainer& container = m_map.getAttributeContainer(VERTEX_CELL) ; AttributeContainer& container = m_map.getAttributeContainer(VERTEX_CELL) ;
// open file // open file
std::ifstream fp(filename.c_str(), std::ios::in); std::ifstream fp(filename.c_str(), std::ios::in);
...@@ -182,7 +182,7 @@ bool MeshTablesSurface<PFP>::importTrianBinGz(const std::string& filename, std:: ...@@ -182,7 +182,7 @@ bool MeshTablesSurface<PFP>::importTrianBinGz(const std::string& filename, std::
AttributeHandler<typename PFP::VEC3> positions = m_map.template addAttribute<typename PFP::VEC3>(VERTEX_ORBIT, "position") ; AttributeHandler<typename PFP::VEC3> positions = m_map.template addAttribute<typename PFP::VEC3>(VERTEX_ORBIT, "position") ;
attrNames.push_back(positions.name()) ; attrNames.push_back(positions.name()) ;
AttribContainer& container = m_map.getAttributeContainer(VERTEX_CELL) ; AttributeContainer& container = m_map.getAttributeContainer(VERTEX_CELL) ;
// open file // open file
igzstream fs(filename.c_str(), std::ios::in|std::ios::binary); igzstream fs(filename.c_str(), std::ios::in|std::ios::binary);
...@@ -248,7 +248,7 @@ bool MeshTablesSurface<PFP>::importOff(const std::string& filename, std::vector< ...@@ -248,7 +248,7 @@ bool MeshTablesSurface<PFP>::importOff(const std::string& filename, std::vector<
AttributeHandler<typename PFP::VEC3> positions = m_map.template addAttribute<typename PFP::VEC3>(VERTEX_ORBIT, "position") ; AttributeHandler<typename PFP::VEC3> positions = m_map.template addAttribute<typename PFP::VEC3>(VERTEX_ORBIT, "position") ;
attrNames.push_back(positions.name()) ; attrNames.push_back(positions.name()) ;
AttribContainer& container = m_map.getAttributeContainer(VERTEX_CELL) ; AttributeContainer& container = m_map.getAttributeContainer(VERTEX_CELL) ;
// open file // open file
std::ifstream fp(filename.c_str(), std::ios::in); std::ifstream fp(filename.c_str(), std::ios::in);
...@@ -343,7 +343,7 @@ bool MeshTablesSurface<PFP>::importObj(const std::string& filename, std::vector< ...@@ -343,7 +343,7 @@ bool MeshTablesSurface<PFP>::importObj(const std::string& filename, std::vector<
AttributeHandler<typename PFP::VEC3> positions = m_map.template addAttribute<typename PFP::VEC3>(VERTEX_ORBIT, "position") ; AttributeHandler<typename PFP::VEC3> positions = m_map.template addAttribute<typename PFP::VEC3>(VERTEX_ORBIT, "position") ;
attrNames.push_back(positions.name()) ; attrNames.push_back(positions.name()) ;
AttribContainer& container = m_map.getAttributeContainer(VERTEX_CELL) ; AttributeContainer& container = m_map.getAttributeContainer(VERTEX_CELL) ;
// open file // open file
std::ifstream fp(filename.c_str(), std::ios::binary); std::ifstream fp(filename.c_str(), std::ios::binary);
...@@ -462,7 +462,7 @@ bool MeshTablesSurface<PFP>::importPly(const std::string& filename, std::vector< ...@@ -462,7 +462,7 @@ bool MeshTablesSurface<PFP>::importPly(const std::string& filename, std::vector<
AttributeHandler<typename PFP::VEC3> positions = m_map.template addAttribute<typename PFP::VEC3>(VERTEX_ORBIT, "position") ; AttributeHandler<typename PFP::VEC3> positions = m_map.template addAttribute<typename PFP::VEC3>(VERTEX_ORBIT, "position") ;
attrNames.push_back(positions.name()) ; attrNames.push_back(positions.name()) ;
AttribContainer& container = m_map.getAttributeContainer(VERTEX_CELL) ; AttributeContainer& container = m_map.getAttributeContainer(VERTEX_CELL) ;
PlyImportData pid; PlyImportData pid;
...@@ -517,7 +517,7 @@ bool MeshTablesSurface<PFP>::importPlyPTM(const std::string& filename, std::vect ...@@ -517,7 +517,7 @@ bool MeshTablesSurface<PFP>::importPlyPTM(const std::string& filename, std::vect
AttributeHandler<typename PFP::MATRIX36> RGBfunctions = m_map.template addAttribute<typename PFP::MATRIX36>(VERTEX_ORBIT, "RGBfunctions") ; AttributeHandler<typename PFP::MATRIX36> RGBfunctions = m_map.template addAttribute<typename PFP::MATRIX36>(VERTEX_ORBIT, "RGBfunctions") ;
attrNames.push_back(RGBfunctions.name()) ; attrNames.push_back(RGBfunctions.name()) ;
AttribContainer& container = m_map.getAttributeContainer(VERTEX_CELL) ; AttributeContainer& container = m_map.getAttributeContainer(VERTEX_CELL) ;
std::ifstream fp(filename.c_str(), std::ios::binary); std::ifstream fp(filename.c_str(), std::ios::binary);
if (!fp.good()) if (!fp.good())
...@@ -621,7 +621,7 @@ bool MeshTablesSurface<PFP>::importCTM(const std::string& filename, std::vector< ...@@ -621,7 +621,7 @@ bool MeshTablesSurface<PFP>::importCTM(const std::string& filename, std::vector<
AttributeHandler<typename PFP::VEC3> positions = m_map.template addAttribute<typename PFP::VEC3>(VERTEX_ORBIT, "position") ; AttributeHandler<typename PFP::VEC3> positions = m_map.template addAttribute<typename PFP::VEC3>(VERTEX_ORBIT, "position") ;
attrNames.push_back(positions.name()) ; attrNames.push_back(positions.name()) ;
AttribContainer& container = m_map.getAttributeContainer(VERTEX_CELL) ; AttributeContainer& container = m_map.getAttributeContainer(VERTEX_CELL) ;
// Load the file using the OpenCTM API // Load the file using the OpenCTM API
CTMimporter ctm; CTMimporter ctm;
...@@ -665,7 +665,7 @@ bool MeshTablesSurface<PFP>::importCTM(const std::string& filename, std::vector< ...@@ -665,7 +665,7 @@ bool MeshTablesSurface<PFP>::importCTM(const std::string& filename, std::vector<
} }
template<typename PFP> template<typename PFP>
void MeshTablesSurface<PFP>::extractMeshRec(AttribContainer& container, AttributeHandler<typename PFP::VEC3>& positions, const struct aiScene* scene, const struct aiNode* nd, struct aiMatrix4x4* trafo) void MeshTablesSurface<PFP>::extractMeshRec(AttributeContainer& container, AttributeHandler<typename PFP::VEC3>& positions, const struct aiScene* scene, const struct aiNode* nd, struct aiMatrix4x4* trafo)
{ {
struct aiMatrix4x4 prev; struct aiMatrix4x4 prev;
...@@ -720,7 +720,7 @@ void MeshTablesSurface<PFP>::extractMeshRec(AttribContainer& container, Attribut ...@@ -720,7 +720,7 @@ void MeshTablesSurface<PFP>::extractMeshRec(AttribContainer& container, Attribut
template <typename PFP> template <typename PFP>
bool MeshTablesSurface<PFP>::importASSIMP(const std::string& filename, std::vector<std::string>& attrNames) bool MeshTablesSurface<PFP>::importASSIMP(const std::string& filename, std::vector<std::string>& attrNames)
{ {
AttribContainer& container = m_map.getAttributeContainer(VERTEX_CELL) ; AttributeContainer& container = m_map.getAttributeContainer(VERTEX_CELL) ;
AttributeHandler<typename PFP::VEC3> positions = m_map.template addAttribute<typename PFP::VEC3>(VERTEX_ORBIT, "position") ; AttributeHandler<typename PFP::VEC3> positions = m_map.template addAttribute<typename PFP::VEC3>(VERTEX_ORBIT, "position") ;
attrNames.push_back(positions.name()) ; attrNames.push_back(positions.name()) ;
......
...@@ -73,7 +73,7 @@ bool MeshTablesVolume<PFP>::importMesh(const std::string& filename, std::vector< ...@@ -73,7 +73,7 @@ bool MeshTablesVolume<PFP>::importMesh(const std::string& filename, std::vector<
template <typename PFP> template <typename PFP>
bool MeshTablesVolume<PFP>::importTet(const std::string& filename, std::vector<std::string>& attrNames, float scaleFactor=1.0f) bool MeshTablesVolume<PFP>::importTet(const std::string& filename, std::vector<std::string>& attrNames, float scaleFactor=1.0f)
{ {
AttribContainer& container = m_map.getAttributeContainer(VERTEX_CELL) ; AttributeContainer& container = m_map.getAttributeContainer(VERTEX_CELL) ;
AttributeHandler<typename PFP::VEC3> positions = m_map.template addAttribute<typename PFP::VEC3>(VERTEX_ORBIT, "position") ; AttributeHandler<typename PFP::VEC3> positions = m_map.template addAttribute<typename PFP::VEC3>(VERTEX_ORBIT, "position") ;
attrNames.push_back(positions.name()) ; attrNames.push_back(positions.name()) ;
......
...@@ -62,7 +62,7 @@ bool importInESS(typename PFP::MAP& map, const std::string& filename, std::vecto ...@@ -62,7 +62,7 @@ bool importInESS(typename PFP::MAP& map, const std::string& filename, std::vecto
AttributeHandler<VEC3> position = map.template addAttribute<VEC3>(VERTEX_ORBIT, "position") ; AttributeHandler<VEC3> position = map.template addAttribute<VEC3>(VERTEX_ORBIT, "position") ;
attrNames.push_back(position.name()) ; attrNames.push_back(position.name()) ;
AttribContainer& container = map.getAttributeContainer(VERTEX_CELL) ; AttributeContainer& container = map.getAttributeContainer(VERTEX_CELL) ;
// open file // open file
std::ifstream fp(filename.c_str(), std::ios::in); std::ifstream fp(filename.c_str(), std::ios::in);
......
...@@ -40,7 +40,7 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts) ...@@ -40,7 +40,7 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
{ {
typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::VEC3 VEC3 ;
AutoAttributeHandler< NoMathIONameAttribute< std::vector<Dart> > > vecDartsPerVertex(map, VERTEX_ORBIT, "incidents"); AutoAttributeHandler< NoMathIONameAttribute< std::vector<Dart> > > vecDartsPerVertex(map, VERTEX_ORBIT, "incidents");
unsigned nbf = mts.getNbFaces(); unsigned nbf = mts.getNbFaces();
int index = 0; int index = 0;
...@@ -106,7 +106,6 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts) ...@@ -106,7 +106,6 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)