Commit 3d4119e2 authored by Sylvain Thery's avatar Sylvain Thery

Merge branch 'AttGenOrbit' into develop

parents 2c1e4b36 82cf5ae8
......@@ -2,7 +2,7 @@
IF (ONELIB)
SET(CGoGN_LIBS cgogn)
ELSE (ONELIB)
SET(CGoGN_LIBS topology algo container utils)
SET(CGoGN_LIBS algo topology container utils)
ENDIF (ONELIB)
......
......@@ -169,7 +169,6 @@ void MyQT::cb_Open()
color = myMap.addAttribute<VEC3, VOLUME, MAP>("color");
TraversorCell<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);
......@@ -503,11 +502,11 @@ int main(int argc, char **argv)
Utils::Chrono ch;
Vertex v(myMap.begin());
VEC3 p = Algo::Volume::Geometry::vertexNeighborhoodCentroid<PFP>(myMap,v,position);
// Vertex v(myMap.begin());
// VEC3 p = Algo::Volume::Geometry::vertexNeighborhoodCentroid<PFP>(myMap,v,position);
Vol w(myMap.begin());
VEC3 q = Algo::Surface::Geometry::volumeCentroid<PFP>(myMap,w,position);
// 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);
......
......@@ -24,6 +24,9 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_executable(multi_att multi_att.cpp)
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)
QT4_WRAP_CPP(tilings_moc tilings.h)
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)
// check at compile if ATT is an AttributeHandler on orbit 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
{
att_out[v] = smooth(map,v,att_in);
......
......@@ -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()
{
// declare a map to handle the mesh
......@@ -142,6 +174,8 @@ int main()
grid.embedIntoGrid(positionAtt, 1.,1.,0.);
VertexGeneric(myMap,positionAtt);
// ATTRIBUTE DECLARATION
// add an attribute of type float on orbit EDGE
......
......@@ -63,7 +63,16 @@ int main()
{
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)
foreach_attribute(position, [&] (unsigned int id) // for each element of position
......@@ -71,9 +80,11 @@ int main()
std::cout << id << " : " << position[id]<< " / ";
});
std::cout << std::endl << "--------------------------------" << std::endl;
// using parallel 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;
}, 4); // 4:4 thread, false for no need for markers in threaded code.
......
......@@ -111,17 +111,18 @@ int main()
}); // 4:4 thread, false for no need for markers in threaded code.
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 << std::endl;
// Example with // accumulation
// computing the sum of area faces
// force number of threads to 4 (0 for traverse, 1,2,3 for computation)
CGoGN::Parallel::NumberOfThreads = 4;
......@@ -137,6 +138,8 @@ int main()
std::cout << 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);
TraversorCellEven<MAP, VERTEX> tv1(tv0);
TraversorCellOdd<MAP, VERTEX> tv2(tv0);
......
......@@ -102,5 +102,16 @@ int main()
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;
}
......@@ -94,7 +94,7 @@ int main(int argc, char **argv)
}
}
Dart dcenter = myMap.explodBorderTopo(dsave);
Dart dcenter = myMap.explodBorderTopo(/*dsave*/);
DartMarker<MAP> mf(myMap);
for(Dart dit = myMap.begin() ; dit != myMap.end() ; myMap.next(dit))
......
......@@ -143,7 +143,8 @@ IF (WITH_QT)
ADD_DEFINITIONS(${QT_DEFINITIONS})
find_package(QGLViewer REQUIRED)
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)
IF (WITH_GLEWMX)
......
......@@ -63,10 +63,10 @@ class CellSelector : public CellSelectorGen
typedef CellSelector<MAP, ORBIT> SELECTOR;
public:
CellSelector(MAP& map, const QString& name, unsigned int thread = 0) :
CellSelector(MAP& map, const QString& name) :
CellSelectorGen(name),
m_map(map),
m_cm(map, thread)
m_cm(map)
{}
~CellSelector()
......
......@@ -26,7 +26,7 @@ file(STRINGS ${CGoGN_ROOT_DIR}/include/cgogn_onelib.h ONELIB_STR)
IF (ONELIB_STR EQUAL 1)
SET(CGoGN_LIBS cgogn)
ELSE()
SET(CGoGN_LIBS topology algo container utils)
SET(CGoGN_LIBS algo topology container utils)
ENDIF()
IF(WIN32)
......
......@@ -392,9 +392,9 @@ bool exportOFF(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3,
out.close() ;
return true ;
}
/*
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::VEC3 VEC3;
......@@ -416,7 +416,7 @@ bool exportOBJ(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>
std::vector<unsigned int> vertices ;
vertices.reserve(nbDarts/6) ;
CellMarker<VERTEX> markV(map) ;
CellMarker<typename PFP::MAP,VERTEX> markV(map) ;
TraversorF<MAP> t(map) ;
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>
Traversor2FV<typename PFP::MAP> tfv(map, d) ;
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))
{
markV.mark(it) ;
......@@ -458,7 +460,7 @@ bool exportOBJ(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>
out.close() ;
return true ;
}
/*
template <typename PFP>
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
//! @param position
//! @return
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.
//! @param map
......@@ -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) ;
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) ;
void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, FaceAttribute<typename PFP::REAL, typename PFP::MAP>& face_area) ;
template <typename PFP>
void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& vertex_area, unsigned int thread = 0) ;
void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& vertex_area) ;
template <typename PFP>
void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& vertex_area, unsigned int thread = 0) ;
void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& vertex_area) ;
template <typename PFP>
void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& vertex_area, unsigned int thread = 0) ;
void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& vertex_area) ;
namespace Parallel
{
......
......@@ -72,7 +72,7 @@ typename PFP::REAL convexFaceArea(typename PFP::MAP& map, Face d, const VertexAt
}
template <typename PFP>
typename PFP::REAL totalArea(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, unsigned int thread)
typename PFP::REAL totalArea(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position)
{
typename PFP::REAL area(0) ;
......@@ -80,7 +80,7 @@ typename PFP::REAL totalArea(typename PFP::MAP& map, const VertexAttribute<typen
{
area += convexFaceArea<PFP>(map, f, position);
}
,AUTO,thread);
,AUTO);
return area ;
}
......@@ -137,10 +137,10 @@ typename PFP::REAL vertexVoronoiArea(typename PFP::MAP& map, Vertex v, const Ver
}
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)
void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, FaceAttribute<typename PFP::REAL, typename PFP::MAP>& face_area)
{
if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread==0))
if (CGoGN::Parallel::NumberOfThreads > 1)
{
Parallel::computeAreaFaces<PFP>(map,position,face_area);
return;
......@@ -150,14 +150,14 @@ void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute<typename PFP
{
face_area[f] = convexFaceArea<PFP>(map, f, position) ;
}
,AUTO,thread);
,AUTO);
}
template <typename PFP>
void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& vertex_area, unsigned int thread)
void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& vertex_area)
{
if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread==0))
if (CGoGN::Parallel::NumberOfThreads > 1)
{
Parallel::computeOneRingAreaVertices<PFP>(map,position,vertex_area);
return;
......@@ -174,14 +174,14 @@ void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute<ty
vertex_area[v] += areas[f];
});
}
,FORCE_CELL_MARKING,thread);
,FORCE_CELL_MARKING);
}
template <typename PFP>
void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& vertex_area, unsigned int thread)
void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& vertex_area)
{
if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread==0))
if (CGoGN::Parallel::NumberOfThreads > 1)
{
Parallel::computeBarycentricAreaVertices<PFP>(map,position,vertex_area);
return;
......@@ -191,13 +191,13 @@ void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribut
{
vertex_area[v] = vertexBarycentricArea<PFP>(map, v, position) ;
}
,FORCE_CELL_MARKING,thread);
,FORCE_CELL_MARKING);
}
template <typename PFP>
void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& vertex_area, unsigned int thread)
void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& vertex_area)
{
if ((CGoGN::Parallel::NumberOfThreads > 1) && (thread==0))
if (CGoGN::Parallel::NumberOfThreads > 1)
{
Parallel::computeVoronoiAreaVertices<PFP>(map,position,vertex_area);
return;
......@@ -207,7 +207,7 @@ void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute<ty
{
vertex_area[v] = vertexVoronoiArea<PFP>(map, v, position) ;
}
,FORCE_CELL_MARKING,thread);
,FORCE_CELL_MARKING);
}
......
......@@ -50,7 +50,7 @@ namespace Geometry
* @param attributs the vector of attribute or cell
*/
template <typename PFP, typename V_ATT>
typename V_ATT::DATA_TYPE volumeCentroid(typename PFP::MAP& map, Vol d, const V_ATT& attributs, unsigned int thread = 0);
typename V_ATT::DATA_TYPE volumeCentroid(typename PFP::MAP& map, Vol d, const V_ATT& attributs);
/**
* Compute volume centroid weighted by edge length (generic version)
......@@ -63,7 +63,7 @@ typename V_ATT::DATA_TYPE volumeCentroid(typename PFP::MAP& map, Vol d, const V_
* @param attributs the vector of attribute or cell
*/
template <typename PFP, typename V_ATT>
typename V_ATT::DATA_TYPE volumeCentroidELW(typename PFP::MAP& map, Vol d, const V_ATT& attributs, unsigned int thread = 0);
typename V_ATT::DATA_TYPE volumeCentroidELW(typename PFP::MAP& map, Vol d, const V_ATT& attributs);
/**
* Compute face centroid (generic version)
......@@ -106,30 +106,27 @@ typename V_ATT::DATA_TYPE vertexNeighborhoodCentroid(typename PFP::MAP& map, Ver
* @param map the map
* @param position position vertex attribute
* @param face_centroid centroid face attribute
* @param thread the thread id (default 0)
*/
template <typename PFP, typename V_ATT, typename F_ATT>
void computeCentroidFaces(typename PFP::MAP& map, const V_ATT& position, F_ATT& face_centroid, unsigned int thread = 0);
void computeCentroidFaces(typename PFP::MAP& map, const V_ATT& position, F_ATT& face_centroid);
/**
* Compute centroid of all faces (Edge Length Weighted)
* @param map the map
* @param position position vertex attribute
* @param face_centroid centroid face attribute
* @param thread the thread id (default 0)
*/
template <typename PFP, typename V_ATT, typename F_ATT>
void computeCentroidELWFaces(typename PFP::MAP& map, const V_ATT& position, F_ATT& face_centroid, unsigned int thread = 0) ;
void computeCentroidELWFaces(typename PFP::MAP& map, const V_ATT& position, F_ATT& face_centroid) ;
/**
* Compute neighborhood centroid of all vertices
* @param map the map
* @param position position vertex attribute
* @param vertex_centroid centroid vertex attribute
* @param thread the thread id (default 0)
*/
template <typename PFP, typename V_ATT>
void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const V_ATT& position, V_ATT& vertex_centroid, unsigned int thread = 0) ;
void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const V_ATT& position, V_ATT& vertex_centroid) ;
namespace Parallel
......@@ -189,7 +186,7 @@ namespace Geometry
* @param position the vector of attribute or cell
*/
template <typename PFP, typename V_ATT>
typename V_ATT::DATA_TYPE vertexNeighborhoodCentroid(typename PFP::MAP& map, Vertex d, const V_ATT& attributs, unsigned int thread = 0);
typename V_ATT::DATA_TYPE vertexNeighborhoodCentroid(typename PFP::MAP& map, Vertex d, const V_ATT& attributs);
/**
* compute centroid of all volumes
......@@ -198,10 +195,10 @@ typename V_ATT::DATA_TYPE vertexNeighborhoodCentroid(typename PFP::MAP& map, Ver
* @param vol_centroid volume attribute where to store the centroids
*/
template <typename PFP, typename V_ATT, typename W_ATT>
void computeCentroidVolumes(typename PFP::MAP& map, const V_ATT& position, W_ATT& vol_centroid, unsigned int thread = 0);
void computeCentroidVolumes(typename PFP::MAP& map, const V_ATT& position, W_ATT& vol_centroid);
template <typename PFP, typename V_ATT, typename W_ATT>
void computeCentroidELWVolumes(typename PFP::MAP& map, const V_ATT& position, W_ATT& vol_centroid, unsigned int thread = 0);
void computeCentroidELWVolumes(typename PFP::MAP& map, const V_ATT& position, W_ATT& vol_centroid);
/**
* compute centroid of all vertices
......@@ -210,7 +207,7 @@ void computeCentroidELWVolumes(typename PFP::MAP& map, const V_ATT& position, W_
* @param vertex_centroid vertex attribute to store the centroids
*/