Commit f881feb7 authored by Sylvain Thery's avatar Sylvain Thery

Merge branch 'develop' of icube-forge.unistra.fr:thery/cgogn into develop

Conflicts:
	apps_cmake.txt
	include/Algo/Geometry/curvature.hpp
parents 6edb455a 1b7ac321
# ignore QtCreator files # ignore QtCreator files
CMakeLists.txt.user CMakeLists.txt.user
\ No newline at end of file bin/
ThirdParty/bin/
SCHNApps/bin
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
IF (ONELIB) IF (ONELIB)
SET(CGoGN_LIBS cgogn) SET(CGoGN_LIBS cgogn)
ELSE (ONELIB) ELSE (ONELIB)
SET(CGoGN_LIBS topology algo container utils) SET(CGoGN_LIBS algo topology container utils)
ENDIF (ONELIB) ENDIF (ONELIB)
......
...@@ -169,7 +169,6 @@ void MyQT::cb_Open() ...@@ -169,7 +169,6 @@ void MyQT::cb_Open()
color = myMap.addAttribute<VEC3, VOLUME, MAP>("color"); color = myMap.addAttribute<VEC3, VOLUME, MAP>("color");
TraversorCell<MAP, VOLUME> tra(myMap); TraversorCell<MAP, VOLUME> tra(myMap);
float maxV = 0.0f;
for (Dart d = tra.begin(); d != tra.end(); d = tra.next()) 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);
...@@ -503,11 +502,11 @@ int main(int argc, char **argv) ...@@ -503,11 +502,11 @@ int main(int argc, char **argv)
Utils::Chrono ch; Utils::Chrono ch;
Vertex v(myMap.begin()); // Vertex v(myMap.begin());
VEC3 p = Algo::Volume::Geometry::vertexNeighborhoodCentroid<PFP>(myMap,v,position); // VEC3 p = Algo::Volume::Geometry::vertexNeighborhoodCentroid<PFP>(myMap,v,position);
Vol w(myMap.begin()); // Vol w(myMap.begin());
VEC3 q = Algo::Surface::Geometry::volumeCentroid<PFP>(myMap,w,position); // VEC3 q = Algo::Surface::Geometry::volumeCentroid<PFP>(myMap,w,position);
ch.start(); ch.start();
float vol = Algo::Geometry::Parallel::totalVolume<PFP>(myMap, position); float vol = Algo::Geometry::Parallel::totalVolume<PFP>(myMap, position);
......
...@@ -24,6 +24,9 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) ...@@ -24,6 +24,9 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_executable(multi_att multi_att.cpp) add_executable(multi_att multi_att.cpp)
target_link_libraries(multi_att ${CGoGN_LIBS} ${CGoGN_EXT_LIBS}) target_link_libraries(multi_att ${CGoGN_LIBS} ${CGoGN_EXT_LIBS})
add_executable(trav3_test trav3_test.cpp)
target_link_libraries(trav3_test ${CGoGN_LIBS} ${CGoGN_EXT_LIBS})
IF (WITH_QT) IF (WITH_QT)
QT4_WRAP_CPP(tilings_moc tilings.h) QT4_WRAP_CPP(tilings_moc tilings.h)
add_executable(tilings tilings.cpp ${tilings_moc}) add_executable(tilings tilings.cpp ${tilings_moc})
......
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap3.h"
#include "Algo/Tiling/Volume/cubic.h"
#include "Utils/chrono.h"
using namespace CGoGN ;
/**
* Struct that contains some informations about the types of the manipulated objects
* Mainly here to be used by the algorithms that are parameterized by it
*/
struct PFP: public PFP_DOUBLE
{
// definition of the type of the map
typedef EmbeddedMap3 MAP;
};
// some typedef shortcuts
typedef PFP::MAP MAP ; // map type
typedef PFP::VEC3 VEC3 ; // type of R³ vector
template <typename PFP, typename V_ATT>
typename V_ATT::DATA_TYPE localvolumeCentroidELW(typename PFP::MAP& map, Vol d, const V_ATT& attributs)
{
typedef typename V_ATT::DATA_TYPE EMB;
EMB center(0.0);
double count=0.0;
for (Edge it : edgesIncidentToVolume3(map,d))
{
EMB e1 = attributs[it.dart];
EMB e2 = attributs[map.phi1(it)];
double l = (e2-e1).norm();
center += (e1+e2)*l;
count += 2.0*l ;
}
center /= double(count);
return center ;
}
int main()
{
// declare a map to handle the mesh
MAP myMap;
// add position attribute on vertices and get handler on it
VertexAttribute<VEC3, MAP> position = myMap.addAttribute<VEC3, VERTEX, MAP>("position");
// create a topo grid of 4x4x4 squares
Algo::Volume::Tilings::Cubic::Grid<PFP> cubic(myMap, 20, 20, 20);
cubic.embedIntoGrid(position, 1.0f, 1.0f, 1.0f);
// easy way to find the central vertex of the grid
Vertex v;
foreach_cell_until<VERTEX>(myMap, [&] (Vertex it)
{
if (position[it] == VEC3(0,0,0))
{
v = it;
std::cout << "Trouve"<< std::endl;
return false;
}
return true;
});
// must test of find ok (if not v.dart is NIL)
if (! v.valid())
std::cerr << "could not find a vertex with position (0,0,0)" << std::endl;
// WITH TRAVERSORS:
// find incident faces to vertex
Traversor3VF<MAP> trvf(myMap, v.dart);
for (Dart e = trvf.begin(); e != trvf.end(); e = trvf.next())
{
std::cout << "Face of dart "<<e<< " incident to vertex of dart " << v.dart<< std::endl;
}
// find adjacent vertices thru a face
Traversor3VVaF<MAP> trvvaf(myMap, v.dart);
for (Dart e = trvvaf.begin(); e != trvvaf.end(); e = trvvaf.next())
{
std::cout << "vertex of dart "<<e<< " adjacent to vertex of dart " << v.dart<< " by a face" << std::endl;
}
// WITH FOREACH FUNCTION (C++11 lambda expression)
// find faces incident to vertex v
foreach_incident3<FACE>(myMap, v, [&](Face f)
{
std::cout << "Face of dart " << f << " incident to vertex of dart " << v.dart << std::endl;
});
// find vertices adjacent to vertex v thru a face
foreach_adjacent3<FACE>(myMap, v, [&](Vertex x)
{
std::cout << "vertex of dart " << x << " adjacent to vertex of dart " << v.dart << " by a face" << std::endl;
});
// WITH FOR C++11 SYNTAX
for(Face f : facesIncidentToVertex3(myMap,v))
std::cout << "Face of dart " << f << " incident to vertex of dart " << v.dart << std::endl;
for (Vertex x : verticesAdjacentByFace3(myMap,v))
std::cout << "vertex of dart " << x << " adjacent to vertex of dart " << v.dart << " by a face" << std::endl;
for(Vertex v1 : allVerticesOf(myMap))
{
for (Vertex v2 : verticesAdjacentByEdge3(myMap,v1))
{
for (Face f : facesIncidentToVertex3(myMap,v2))
if ((f.dart.index)%1000 == 1 )
std::cout << "juste for fun face " << f << std::endl;
}
}
Utils::Chrono ch;
VertexAttribute<VEC3,MAP> pos2 = myMap.getAttribute<VEC3, VERTEX, MAP>("pos2") ;
if(!pos2.isValid())
pos2 = myMap.addAttribute<VEC3, VERTEX, MAP>("pos2") ;
ch.start();
for (int i=0; i< 20; ++i)
{
VEC3 xx(0,0,0);
int nb=0;
for(Vol d : allVolumesOf(myMap))
{
VEC3 vCentroid = localvolumeCentroidELW<PFP>(myMap, d, position) ;
xx += vCentroid;
nb++;
}
xx /= nb;
std::cout << xx << std::endl;
}
std::cout << "for "<< ch.elapsed()<< " ms "<< std::endl;
ch.start();
for (int i=0; i< 20; ++i)
{
VEC3 xx(0,0,0);
int nb=0;
foreach_cell<VOLUME>(myMap, [&] (Vol d)
{
VEC3 vCentroid = Algo::Surface::Geometry::volumeCentroidELW<PFP>(myMap, d, position) ;
xx += vCentroid;
nb++;
});
xx /= nb;
std::cout << xx << std::endl;
}
std::cout << "Lambda "<< ch.elapsed()<< " ms "<< std::endl;
return 0;
}
...@@ -80,6 +80,13 @@ void applySmooth(MAP& map, const ATT& att_in, ATT& att_out) ...@@ -80,6 +80,13 @@ void applySmooth(MAP& map, const ATT& att_in, ATT& att_out)
// check at compile if ATT is an AttributeHandler on orbit VERTEX // check at compile if ATT is an AttributeHandler on orbit VERTEX
CHECK_ATTRIBUTEHANDLER_ORBIT(ATT, VERTEX); CHECK_ATTRIBUTEHANDLER_ORBIT(ATT, VERTEX);
// or check at runtime(take care of const!)
if (! checkAttributeHandlerOrbit<VERTEX>(att_in))
{
CGoGNerr << "function applySmooth work only with VertexAttributes !" << CGoGNendl;
return;
}
foreach_cell<VERTEX>(map,[&](Vertex v) // for all vertex v of map do foreach_cell<VERTEX>(map,[&](Vertex v) // for all vertex v of map do
{ {
att_out[v] = smooth(map,v,att_in); att_out[v] = smooth(map,v,att_in);
......
...@@ -125,6 +125,38 @@ void dumpAttribute(const ATTRIB& attr) ...@@ -125,6 +125,38 @@ void dumpAttribute(const ATTRIB& attr)
} }
//function that apply on vertice with templated attribute type
template<typename T>
void VertexTyped(MAP& map, T& va)
{
// foreach_cell<VERTEX>(map,[&](Vertex v) // for all vertices
// {
// va[v] = 1.1 * va[v];
// });
// other syntax for traversal
for (Vertex v : allVerticesOf(map))
{
va[v] = 1.1 * va[v];
std::cout << "V:" << v << " -> "<<va[v]<< std::endl;
}
}
// version that take a VertexAttribute, check type at runtime and call instancied template version
void VertexGeneric(MAP& map, VertexAttributeGen& vg)
{
auto va3 = dynamic_cast<VertexAttribute<VEC3, MAP>*>(&vg);
if (va3 != NULL)
return VertexTyped(map,*va3);
auto vaf = dynamic_cast<VertexAttribute<float, MAP>*>(&vg);
if (vaf != NULL)
return VertexTyped(map,*vaf);
}
int main() int main()
{ {
// declare a map to handle the mesh // declare a map to handle the mesh
...@@ -142,6 +174,8 @@ int main() ...@@ -142,6 +174,8 @@ int main()
grid.embedIntoGrid(positionAtt, 1.,1.,0.); grid.embedIntoGrid(positionAtt, 1.,1.,0.);
VertexGeneric(myMap,positionAtt);
// ATTRIBUTE DECLARATION // ATTRIBUTE DECLARATION
// add an attribute of type float on orbit EDGE // add an attribute of type float on orbit EDGE
......
...@@ -102,7 +102,7 @@ void MyQT::createMap() ...@@ -102,7 +102,7 @@ void MyQT::createMap()
// return Geom::Vec3f(float(x)/255.0f,float(x)/255.0f,float(x)/255.0f); // return Geom::Vec3f(float(x)/255.0f,float(x)/255.0f,float(x)/255.0f);
// }); // });
// or with furnished operator of conversion // or with furnished operator of conversion
DataConversion::operatorScalarToRGBf<int> conv2col(0,255); DataConversion::functorScalarToRGBf<int> conv2col(0,255);
m_colorVBO1->updateDataConversion<int,3>(colorE,conv2col); m_colorVBO1->updateDataConversion<int,3>(colorE,conv2col);
......
...@@ -63,7 +63,16 @@ int main() ...@@ -63,7 +63,16 @@ int main()
{ {
std::cout << id << " : " << position[id]<< " / "; std::cout << id << " : " << position[id]<< " / ";
} }
std::cout << std::endl;
std::cout << std::endl << "--------------------------------" << std::endl;
//using (C++11 for syntax)
// warning: if you want ot modify the attributes do not forget the &
for (auto& p: position.iterable())
{
p *= 2.0;
}
//using foreach function (C++11 lambda expression) //using foreach function (C++11 lambda expression)
foreach_attribute(position, [&] (unsigned int id) // for each element of position foreach_attribute(position, [&] (unsigned int id) // for each element of position
...@@ -71,9 +80,11 @@ int main() ...@@ -71,9 +80,11 @@ int main()
std::cout << id << " : " << position[id]<< " / "; std::cout << id << " : " << position[id]<< " / ";
}); });
std::cout << std::endl << "--------------------------------" << std::endl;
// using parallel foreach // using parallel foreach
// parameter position must be captured explicitly even if it used as first parameter of foreach ! // parameter position must be captured explicitly even if it used as first parameter of foreach !
Parallel::foreach_attribute(position, [&position] (unsigned int id, unsigned int thread) // for each elt of the position attribute Parallel::foreach_attribute(position, [&position] (unsigned int id, unsigned int /*thread*/) // for each elt of the position attribute
{ {
position[id] *= 2.0f; position[id] *= 2.0f;
}, 4); // 4:4 thread, false for no need for markers in threaded code. }, 4); // 4:4 thread, false for no need for markers in threaded code.
......
...@@ -111,17 +111,18 @@ int main() ...@@ -111,17 +111,18 @@ int main()
}); // 4:4 thread, false for no need for markers in threaded code. }); // 4:4 thread, false for no need for markers in threaded code.
std::cout << "After // processing"<< std::endl; std::cout << "After // processing"<< std::endl;
foreach_cell<VERTEX>(myMap, [&] (Vertex v) // for each Vertex v of the MAP myMap
// last and simple traversal method (new for c++11 syntax)
for(Vertex v : allVerticesOf(myMap))
{ {
std::cout << position[v] << " / "; std::cout << position[v] << " / ";
}); }
std::cout << std::endl; std::cout << std::endl;
// Example with // accumulation // Example with // accumulation
// computing the sum of area faces // computing the sum of area faces
// force number of threads to 4 (0 for traverse, 1,2,3 for computation) // force number of threads to 4 (0 for traverse, 1,2,3 for computation)
CGoGN::Parallel::NumberOfThreads = 4; CGoGN::Parallel::NumberOfThreads = 4;
...@@ -137,6 +138,8 @@ int main() ...@@ -137,6 +138,8 @@ int main()
std::cout << surf[0]<< "/"<< surf[1]<< "/"<< surf[2]<< "/"<< std::endl; std::cout << surf[0]<< "/"<< surf[1]<< "/"<< surf[2]<< "/"<< std::endl;
std::cout << "Total="<<surf[0]+surf[1]+surf[2]<< std::endl; std::cout << "Total="<<surf[0]+surf[1]+surf[2]<< std::endl;
// example of traversal in two pass (optimizing marking/unmarking)
TraversorV<MAP> tv0(myMap); TraversorV<MAP> tv0(myMap);
TraversorCellEven<MAP, VERTEX> tv1(tv0); TraversorCellEven<MAP, VERTEX> tv1(tv0);
TraversorCellOdd<MAP, VERTEX> tv2(tv0); TraversorCellOdd<MAP, VERTEX> tv2(tv0);
......
...@@ -102,5 +102,16 @@ int main() ...@@ -102,5 +102,16 @@ int main()
std::cout << "vertex of dart " << x << " adjacent to vertex of dart " << v.dart << " by a face" << std::endl; std::cout << "vertex of dart " << x << " adjacent to vertex of dart " << v.dart << " by a face" << std::endl;
}); });
// WITH FOR C++11 SYNTAX
for(Face f : facesIncidentToVertex2(myMap,v))
{
std::cout << "Face of dart " << f << " incident to vertex of dart " << v.dart << std::endl;
}
for (Vertex x : verticesAdjacentByFace2(myMap,v))
{
std::cout << "vertex of dart " << x << " adjacent to vertex of dart " << v.dart << " by a face" << std::endl;
}
return 0; return 0;
} }
...@@ -94,7 +94,7 @@ int main(int argc, char **argv) ...@@ -94,7 +94,7 @@ int main(int argc, char **argv)
} }
} }
Dart dcenter = myMap.explodBorderTopo(dsave); Dart dcenter = myMap.explodBorderTopo(/*dsave*/);
DartMarker<MAP> mf(myMap); DartMarker<MAP> mf(myMap);
for(Dart dit = myMap.begin() ; dit != myMap.end() ; myMap.next(dit)) for(Dart dit = myMap.begin() ; dit != myMap.end() ; myMap.next(dit))
......
...@@ -143,7 +143,8 @@ IF (WITH_QT) ...@@ -143,7 +143,8 @@ IF (WITH_QT)
ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(${QT_DEFINITIONS})
find_package(QGLViewer REQUIRED) find_package(QGLViewer REQUIRED)
SET (CGoGN_EXT_INCLUDES ${CGoGN_EXT_INCLUDES} ${QT_INCLUDE_DIR} ${QGLVIEWER_INCLUDE_DIR} ) SET (CGoGN_EXT_INCLUDES ${CGoGN_EXT_INCLUDES} ${QT_INCLUDE_DIR} ${QGLVIEWER_INCLUDE_DIR} )
SET (CGoGN_EXT_LIBS ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES} ${CGoGN_EXT_LIBS}) SET (CGoGN_EXT_LIBS ${QGLVIEWER_LIBRARIES} ${QT_LIBRARIES} ${CGoGN_EXT_LIBS})
ENDIF (WITH_QT) ENDIF (WITH_QT)
IF (WITH_GLEWMX) IF (WITH_GLEWMX)
......
...@@ -63,10 +63,10 @@ class CellSelector : public CellSelectorGen ...@@ -63,10 +63,10 @@ class CellSelector : public CellSelectorGen
typedef CellSelector<MAP, ORBIT> SELECTOR; typedef CellSelector<MAP, ORBIT> SELECTOR;
public: public:
CellSelector(MAP& map, const QString& name, unsigned int thread = 0) : CellSelector(MAP& map, const QString& name) :
CellSelectorGen(name), CellSelectorGen(name),
m_map(map), m_map(map),
m_cm(map, thread) m_cm(map)
{} {}
~CellSelector() ~CellSelector()
......
...@@ -58,8 +58,9 @@ else( WIN32 ) ...@@ -58,8 +58,9 @@ else( WIN32 )
FIND_PATH( SUITESPARSE_LIBRARY_DIR FIND_PATH( SUITESPARSE_LIBRARY_DIR
NAMES libcholmod.so libcholmod.a NAMES libcholmod.so libcholmod.a
PATHS /usr/lib PATHS /usr/lib
/usr/lib64 /usr/lib64
/usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu
/usr/lib/i386-linux-gnu
/usr/local/lib ) /usr/local/lib )
ENDIF(APPLE) ENDIF(APPLE)
......
...@@ -26,7 +26,7 @@ file(STRINGS ${CGoGN_ROOT_DIR}/include/cgogn_onelib.h ONELIB_STR) ...@@ -26,7 +26,7 @@ file(STRINGS ${CGoGN_ROOT_DIR}/include/cgogn_onelib.h ONELIB_STR)
IF (ONELIB_STR EQUAL 1) IF (ONELIB_STR EQUAL 1)
SET(CGoGN_LIBS cgogn) SET(CGoGN_LIBS cgogn)
ELSE() ELSE()
SET(CGoGN_LIBS topology algo container utils) SET(CGoGN_LIBS algo topology container utils)
ENDIF() ENDIF()
IF(WIN32) IF(WIN32)
...@@ -130,9 +130,6 @@ ELSE() ...@@ -130,9 +130,6 @@ ELSE()
ENDIF() ENDIF()
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE})
IF(NOT CMAKE_BUILD_TYPE) IF(NOT CMAKE_BUILD_TYPE)
IF (${CMAKE_CURRENT_BINARY_DIR} MATCHES "(.*)Debug|(.*)debug") IF (${CMAKE_CURRENT_BINARY_DIR} MATCHES "(.*)Debug|(.*)debug")
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
...@@ -141,10 +138,14 @@ IF(NOT CMAKE_BUILD_TYPE) ...@@ -141,10 +138,14 @@ IF(NOT CMAKE_BUILD_TYPE)
ENDIF() ENDIF()
ENDIF() ENDIF()
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE})
IF(WIN32) IF(WIN32)
link_directories( ${CGoGN_ROOT_DIR}/lib/${ConfigurationName} ${Boost_LIBRARY_DIRS}) link_directories( ${CGoGN_ROOT_DIR}/lib/${ConfigurationName} ${Boost_LIBRARY_DIRS})
SET(EXECUTABLE_OUTPUT_PATH ${CGoGN_ROOT_DIR}/bin/) # Release/Debug added automatically by visual SET(EXECUTABLE_OUTPUT_PATH ${CGoGN_ROOT_DIR}/bin/) # Release/Debug added automatically by visual
ELSE () ELSE ()
link_directories( ${CGoGN_ROOT_DIR}/lib/${CMAKE_BUILD_TYPE}) link_directories( ${CGoGN_ROOT_DIR}/lib/${CMAKE_BUILD_TYPE})
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE}) SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE})
ENDIF () ENDIF ()
...@@ -60,6 +60,7 @@ else( WIN32 ) ...@@ -60,6 +60,7 @@ else( WIN32 )
PATHS /usr/lib PATHS /usr/lib
/usr/lib64 /usr/lib64
/usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu
/usr/lib/i386-linux-gnu
/usr/local/lib ) /usr/local/lib )
ENDIF(APPLE) ENDIF(APPLE)
......
...@@ -392,9 +392,9 @@ bool exportOFF(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, ...@@ -392,9 +392,9 @@ bool exportOFF(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3,
out.close() ; out.close() ;
return true ; return true ;
} }
/*
template <typename PFP> template <typename PFP>
bool exportOBJ(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, const char* filename) bool exportOBJ(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, const char* filename)
{ {
typedef typename PFP::MAP MAP; typedef typename PFP::MAP MAP;
typedef typename PFP::VEC3 VEC3; typedef typename PFP::VEC3 VEC3;
...@@ -416,7 +416,7 @@ bool exportOBJ(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3> ...@@ -416,7 +416,7 @@ bool exportOBJ(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>
std::vector<unsigned int> vertices ; std::vector<unsigned int> vertices ;
vertices.reserve(nbDarts/6) ; vertices.reserve(nbDarts/6) ;
CellMarker<VERTEX> markV(map) ; CellMarker<typename PFP::MAP,VERTEX> markV(map) ;
TraversorF<MAP> t(map) ; TraversorF<MAP> t(map) ;
for(Dart d = t.begin(); d != t.end(); d = t.next()) for(Dart d = t.begin(); d != t.end(); d = t.next())
{ {
...@@ -425,7 +425,9 @@ bool exportOBJ(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3> ...@@ -425,7 +425,9 @@ bool exportOBJ(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>
Traversor2FV<typename PFP::MAP> tfv(map, d) ; Traversor2FV<typename PFP::MAP> tfv(map, d) ;
for(Dart it = tfv.begin(); it != tfv.end(); it = tfv.next()) for(Dart it = tfv.begin(); it != tfv.end(); it = tfv.next())
{ {
unsigned int vNum = map.getEmbedding(VERTEX, it) ; // unsigned int vNum = map.getEmbedding(VERTEX, it) ;
unsigned int vNum = map. template getEmbedding<VERTEX>(it) ;
if(!markV.isMarked(it)) if(!markV.isMarked(it))
{ {
markV.mark(it) ; markV.mark(it) ;
...@@ -458,7 +460,7 @@ bool exportOBJ(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3> ...@@ -458,7 +460,7 @@ bool exportOBJ(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>
out.close() ; out.close() ;
return true ; return true ;
} }
/*
template <typename PFP> template <typename PFP>
bool exportPlyPTMgeneric(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, const char* filename) bool exportPlyPTMgeneric(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, const char* filename)
{ {
......
...@@ -58,7 +58,7 @@ typename PFP::REAL convexFaceArea(typename PFP::MAP& map, Face f, const VertexAt ...@@ -58,7 +58,7 @@ typename PFP::REAL convexFaceArea(typename PFP::MAP& map, Face f, const VertexAt
//! @param position //! @param position
//! @return //! @return
template <typename PFP> template <typename PFP>
typename PFP::REAL totalArea(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, unsigned int thread = 0) ; typename PFP::REAL totalArea(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position) ;
//! \brief Compute the area of the faces around a vertex. //! \brief Compute the area of the faces around a vertex.
//! @param map //! @param map
...@@ -75,16 +75,16 @@ template <typename PFP> ...@@ -75,16 +75,16 @@ template <typename PFP>
typename PFP::REAL vertexVoronoiArea(typename PFP::MAP& map, Vertex v, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position) ; typename PFP::REAL vertexVoronoiArea(typename PFP::MAP& map, Vertex v, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position) ;
template <typename PFP> template <typename PFP>
void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, FaceAttribute<typename PFP::REAL, typename PFP::MAP>& face_area, unsigned int thread = 0) ;