Commit a0a2dc32 authored by Lionel Untereiner's avatar Lionel Untereiner

old fashioned IHM3 are back

parent 652fa86d
......@@ -31,7 +31,7 @@ Viewer::Viewer() :
m_drawFaces(true),
m_drawNormals(false),
m_drawTopo(false),
m_drawBoundaryTopo(true),
m_drawBoundaryTopo(false),
m_render(NULL),
m_phongShader(NULL),
m_flatShader(NULL),
......@@ -87,7 +87,7 @@ void Viewer::cb_initGL()
m_render = new Algo::Render::GL2::MapRender() ;
m_topoRender = new Algo::Render::GL2::TopoRender() ;
m_topoRender->setInitialDartsColor(0.25f, 0.25f, 0.25f) ;
m_topoRender->setInitialDartsColor(1.0f, 1.00f, 1.00f) ;
m_positionVBO = new Utils::VBO() ;
m_normalVBO = new Utils::VBO() ;
......@@ -552,11 +552,14 @@ void Viewer::importMesh(std::string& filename)
// myMap.enableQuickTraversal<VERTEX>() ;
std::cout << "The mesh is " << (myMap.isOpen() ? "open" : "closed") << std::endl;
m_render->initPrimitives<PFP>(myMap, Algo::Render::GL2::POINTS) ;
m_render->initPrimitives<PFP>(myMap, Algo::Render::GL2::LINES) ;
m_render->initPrimitives<PFP>(myMap, Algo::Render::GL2::TRIANGLES) ;
m_topoRender->updateData<PFP>(myMap, position, 0.85f, 0.85f, m_drawBoundaryTopo) ;
m_topoRender->updateData<PFP>(myMap, position, 0.85f, 0.85f, m_drawBoundaryTopo, true) ;
bb = Algo::Geometry::computeBoundingBox<PFP>(myMap, position) ;
normalBaseSize = bb.diagSize() / 100.0f ;
......
......@@ -248,7 +248,7 @@ void MyQT::cb_redraw()
if(!m_selecteds.empty())
{
for(std::vector<Dart>::iterator it = m_selecteds.begin() ; it != m_selecteds.end() ; ++it)
m_render_topo->overdrawDart(*it, 11, 0.0f, 0.0f, 1.0f);
m_render_topo->overdrawDart(myMap, *it, 11, 0.0f, 0.0f, 1.0f);
}
m_render_topo->overdrawDart(myMap, m_selected2, 11, 0.0f, 1.0f, 0.0f);
......
......@@ -852,7 +852,7 @@ void MyQT::importMesh(std::string& filename)
std::cerr << "could not import " << filename << std::endl ;
return ;
}
else
else
position = myMap.getAttribute<VEC3, VERTEX, MAP>(attrNames[0]) ;
m_selected = NIL;
......
......@@ -125,7 +125,7 @@ SET (CGoGN_EXT_INCLUDES
# define libs for external libs
SET (CGoGN_EXT_LIBS
nl
nl
${OPENGL_LIBRARY}
${GLEW_LIBRARIES}
${ZLIB_LIBRARIES}
......
# all build directory ignored !
*
# all build directory ignored !
*
......@@ -69,6 +69,7 @@ SET (COMMON_LIBS
${LIBXML2_LIBRARIES}
${Boost_SYSTEM_LIBRARY}
${Boost_REGEX_LIBRARY}
tinyxml2
)
IF(WIN32)
......
#ignore all build directory
*
#ignore all build directory
*
......@@ -125,6 +125,9 @@ template <typename PFP>
bool exportTetmesh(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, const char* filename);
template <typename PFP>
bool exportBoundaryOFF(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, const char* filename);
} // namespace Export
} // namespace Volume
......
......@@ -853,6 +853,81 @@ bool exportMesh(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3
}
}
template <typename PFP>
bool exportBoundaryOFF(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;
std::ofstream out(filename, std::ios::out) ;
if (!out.good())
{
CGoGNerr << "Unable to open file " << CGoGNendl ;
return false ;
}
unsigned int nbDarts = map.getNbDarts() ;
std::vector<unsigned int> facesSize ;
std::vector<std::vector<unsigned int> > facesIdx ;
facesSize.reserve(nbDarts/3) ;
facesIdx.reserve(nbDarts/3) ;
std::map<unsigned int, unsigned int> vIndex ;
unsigned int vCpt = 0 ;
std::vector<unsigned int> vertices ;
vertices.reserve(nbDarts/6) ;
CellMarker<typename PFP::MAP,VERTEX> markV(map) ;
TraversorF<MAP> t(map) ;
for(Dart d = t.begin(); d != t.end(); d = t.next())
{
if(map.isBoundaryFace(d))
{
Dart db = d;
if(!map.template isBoundaryMarked<3>(db))
db = map.phi3(db);
std::vector<unsigned int> fidx ;
fidx.reserve(8) ;
unsigned int degree = 0 ;
Traversor2FV<typename PFP::MAP> tfv(map, db) ;
for(Dart it = tfv.begin(); it != tfv.end(); it = tfv.next())
{
++degree ;
unsigned int vNum = map.template getEmbedding<VERTEX>(it) ;
if(!markV.isMarked(it))
{
markV.mark(it) ;
vIndex[vNum] = vCpt++ ;
vertices.push_back(vNum) ;
}
fidx.push_back(vIndex[vNum]) ;
}
facesSize.push_back(degree) ;
facesIdx.push_back(fidx) ;
}
}
out << "OFF" << std::endl ;
out << vertices.size() << " " << facesSize.size() << " " << 0 << std::endl ;
for(unsigned int i = 0; i < vertices.size(); ++i)
{
const VEC3& v = position[vertices[i]] ;
out << v[0] << " " << v[1] << " " << v[2] << std::endl ;
}
for(unsigned int i = 0; i < facesSize.size(); ++i)
{
out << facesSize[i] ;
for(unsigned int j = 0; j < facesIdx[i].size(); ++j)
out << " " << facesIdx[i][j] ;
out << std::endl ;
}
out.close() ;
return true ;
}
} // namespace Export
} // namespace Volume
......
......@@ -57,9 +57,9 @@ public:
unsigned int m_edgeIdCount ;
unsigned int m_faceIdCount;
DartAttribute<unsigned int, ImplicitHierarchicalMap3> m_dartLevel ;
DartAttribute<unsigned int, ImplicitHierarchicalMap3> m_edgeId ;
DartAttribute<unsigned int, ImplicitHierarchicalMap3> m_faceId ;
DartAttribute<unsigned int, EmbeddedMap3> m_dartLevel ;
DartAttribute<unsigned int, EmbeddedMap3> m_edgeId ;
DartAttribute<unsigned int, EmbeddedMap3> m_faceId ;
AttributeMultiVector<unsigned int>* m_nextLevelCell[NB_ORBITS] ;
......@@ -100,15 +100,15 @@ public:
/*!
*
*/
template <typename T, unsigned int ORBIT>
AttributeHandler_IHM<T, ORBIT> addAttribute(const std::string& nameAttr) ;
// template <typename T, unsigned int ORBIT>
// AttributeHandler_IHM<T, ORBIT> addAttribute(const std::string& nameAttr) ;
//!
/*!
*
*/
template <typename T, unsigned int ORBIT>
AttributeHandler_IHM<T, ORBIT> getAttribute(const std::string& nameAttr) ;
// template <typename T, unsigned int ORBIT>
// AttributeHandler_IHM<T, ORBIT> getAttribute(const std::string& nameAttr) ;
//@}
/*! @name Basic Topological Operators
......@@ -419,8 +419,8 @@ public:
void foreach_dart_of_cc(Dart d, FUNC& f) const ;
//@}
template <unsigned int ORBIT>
unsigned int getEmbedding(Cell<ORBIT> c) const;
// template <unsigned int ORBIT>
// unsigned int getEmbedding(Cell<ORBIT> c) const;
} ;
template <typename T, unsigned int ORBIT>
......
......@@ -37,7 +37,7 @@ namespace IHM
/***************************************************
* ATTRIBUTES MANAGEMENT *
***************************************************/
/*
template <typename T, unsigned int ORBIT>
AttributeHandler_IHM<T, ORBIT> ImplicitHierarchicalMap3::addAttribute(const std::string& nameAttr)
{
......@@ -65,13 +65,13 @@ AttributeHandler_IHM<T, ORBIT> ImplicitHierarchicalMap3::getAttribute(const std:
AttributeHandler<T, ORBIT, ImplicitHierarchicalMap3> h = Map3::getAttribute<T, ORBIT, ImplicitHierarchicalMap3>(nameAttr) ;
return AttributeHandler_IHM<T, ORBIT>(this, h.getDataVector()) ;
}
*/
inline void ImplicitHierarchicalMap3::update_topo_shortcuts()
{
// Map3::update_topo_shortcuts();
m_dartLevel = Map3::getAttribute<unsigned int, DART, ImplicitHierarchicalMap3>("dartLevel") ;
m_faceId = Map3::getAttribute<unsigned int, DART, ImplicitHierarchicalMap3>("faceId") ;
m_edgeId = Map3::getAttribute<unsigned int, DART, ImplicitHierarchicalMap3>("edgeId") ;
m_dartLevel = Map3::getAttribute<unsigned int, DART, EmbeddedMap3>("dartLevel") ;
m_faceId = Map3::getAttribute<unsigned int, DART, EmbeddedMap3>("faceId") ;
m_edgeId = Map3::getAttribute<unsigned int, DART, EmbeddedMap3>("edgeId") ;
//AttributeContainer& cont = m_attribs[DART] ;
//m_nextLevelCell = cont.getDataVector<unsigned int>(cont.getAttributeIndex("nextLevelCell")) ;
......@@ -638,6 +638,7 @@ inline unsigned int ImplicitHierarchicalMap3::edgeLevel(Dart d)
return r;
}
/*
template <unsigned int ORBIT>
inline unsigned int ImplicitHierarchicalMap3::getEmbedding(Cell<ORBIT> c) const
{
......@@ -655,7 +656,7 @@ inline unsigned int ImplicitHierarchicalMap3::getEmbedding(Cell<ORBIT> c) const
}
return index;
}
}*/
inline bool ImplicitHierarchicalMap3::isWellEmbedded()
{
......
......@@ -48,7 +48,7 @@ enum SubdivideType
template <typename PFP>
void newLevelHexa(typename PFP::MAP& map, AttributeHandler<typename PFP::VEC3, VERTEX>& position);
void newLevelHexa(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position);
/***********************************************************************************
......@@ -56,13 +56,13 @@ void newLevelHexa(typename PFP::MAP& map, AttributeHandler<typename PFP::VEC3, V
***********************************************************************************/
template <typename PFP>
void subdivideEdge(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position) ;
void subdivideEdge(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position) ;
template <typename PFP>
void subdivideFace(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position, SubdivideType sType = S_TRI);
void subdivideFace(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, SubdivideType sType = S_TRI);
template <typename PFP>
Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position);
Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position);
......@@ -72,13 +72,13 @@ Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, AttributeHandler<typ
template <typename PFP>
void subdivideEdgeWrong(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position) ;
void subdivideEdgeWrong(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position) ;
template <typename PFP>
void subdivideFaceWrong(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position, SubdivideType sType = S_TRI);
void subdivideFaceWrong(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, SubdivideType sType = S_TRI);
template <typename PFP>
Dart subdivideVolumeClassicWrong(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position);
Dart subdivideVolumeClassicWrong(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position);
......@@ -89,23 +89,23 @@ Dart subdivideVolumeClassicWrong(typename PFP::MAP& map, Dart d, AttributeHandle
template <typename PFP>
Dart subdivideVolume(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position);
Dart subdivideVolume(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position);
template <typename PFP>
Dart subdivideVolumeGen(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position);
Dart subdivideVolumeGen(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position);
template <typename PFP>
Dart subdivideVolumeClassic2(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position);
Dart subdivideVolumeClassic2(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position);
template <typename PFP>
void subdivideLoop(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position);
void subdivideLoop(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position);
/***********************************************************************************
......@@ -113,13 +113,13 @@ void subdivideLoop(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP
***********************************************************************************/
template <typename PFP>
void coarsenEdge(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position);
void coarsenEdge(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position);
template <typename PFP>
void coarsenFace(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position, SubdivideType sType = S_TRI);
void coarsenFace(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, SubdivideType sType = S_TRI);
template <typename PFP>
void coarsenVolume(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position);
void coarsenVolume(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position);
/***********************************************************************************
* Raffinement
......@@ -128,7 +128,7 @@ void coarsenVolume(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP
* Un brin de la face oppose aux faces a spliter
*/
template <typename PFP>
void splitVolume(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position);
void splitVolume(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position);
......
......@@ -25,6 +25,7 @@
#include "Algo/Geometry/centroid.h"
#include "Algo/Modelisation/subdivision.h"
#include "Algo/Modelisation/extrusion.h"
#include "Topology/generic/dartmarker.h"
namespace CGoGN
{
......@@ -41,11 +42,11 @@ namespace IHM
template <typename PFP>
void subdivideEdge(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position)
void subdivideEdge(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position)
{
assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ;
assert(!map.edgeIsSubdivided(d) || !"Trying to subdivide an already subdivided edge") ;
assert(!map.isBoundaryMarked3(d) || !"Trying to subdivide a dart marked boundary");
assert(!map.isBoundaryMarked(3,d) || !"Trying to subdivide a dart marked boundary");
unsigned int eLevel = map.edgeLevel(d) ;
......@@ -73,11 +74,11 @@ void subdivideEdge(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP
}
template <typename PFP>
void subdivideFace(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position, SubdivideType sType)
void subdivideFace(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, SubdivideType sType)
{
assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ;
assert(!map.faceIsSubdivided(d) || !"Trying to subdivide an already subdivided face") ;
assert(!map.isBoundaryMarked3(d) || !"Trying to subdivide a dart marked boundary");
assert(!map.isBoundaryMarked(3,d) || !"Trying to subdivide a dart marked boundary");
unsigned int fLevel = map.faceLevel(d) ;
Dart old = map.faceOldestDart(d) ;
......@@ -193,12 +194,12 @@ void subdivideFace(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP
}
template <typename PFP>
Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position)
Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position)
//Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, Algo::Volume::IHM::AttributeHandler_IHM<typename PFP::VEC3, VERTEX>& position)
{
assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ;
assert(!map.volumeIsSubdivided(d) || !"Trying to subdivide an already subdivided volume") ;
assert(!map.isBoundaryMarked3(d) || !"Trying to subdivide a dart marked boundary");
assert(!map.isBoundaryMarked(3,d) || !"Trying to subdivide a dart marked boundary");
unsigned int vLevel = map.volumeLevel(d);
Dart old = map.volumeOldestDart(d);
......@@ -221,8 +222,8 @@ Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, AttributeHandler<typ
* avec calcul du centroid
*/
DartMarkerStore mf(map); // Lock a face marker to save one dart per face
DartMarkerStore mv(map);
DartMarkerStore<typename PFP::MAP> mf(map); // Lock a face marker to save one dart per face
DartMarkerStore<typename PFP::MAP> mv(map);
typename PFP::VEC3 volCenter;
unsigned count = 0 ;
......@@ -236,7 +237,7 @@ Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, AttributeHandler<typ
std::vector<Dart> oldEdges;
oldEdges.reserve(20);
mf.markOrbit<FACE>(old) ;
mf.markOrbit(Face(old)) ;
for(unsigned int i = 0; i < visitedFaces.size(); ++i)
{
......@@ -247,7 +248,7 @@ Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, AttributeHandler<typ
//compute volume centroid
if(!mv.isMarked(e))
{
mv.markOrbit<VERTEX>(e);
mv.markOrbit(Vertex(e));
volCenter += position[e];
++count;
oldEdges.push_back(e);
......@@ -258,7 +259,7 @@ Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, AttributeHandler<typ
if(!mf.isMarked(ee)) // not already marked
{
visitedFaces.push_back(ee) ;
mf.markOrbit<FACE>(ee) ;
mf.markOrbit(Face(ee)) ;
}
e = map.phi1(e) ;
......@@ -393,14 +394,14 @@ Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, AttributeHandler<typ
//LA copie de L'id est a gerer avec le sewVolumes normalement !!!!!!
//id pour les aretes interieurs : (i.e. 6 pour un hexa)
DartMarkerStore mne(map);
DartMarkerStore<typename PFP::MAP> mne(map);
for(unsigned int i = 0; i < newEdges.size(); ++i)
{
if(!mne.isMarked(newEdges[i]))
{
unsigned int idedge = map.getNewEdgeId();
map.setEdgeId(newEdges[i], idedge, EDGE);
mne.markOrbit<EDGE>(newEdges[i]);
mne.markOrbit(Edge(newEdges[i]));
}
}
......@@ -454,11 +455,11 @@ Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, AttributeHandler<typ
template <typename PFP>
void subdivideEdgeGeom(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position)
void subdivideEdgeGeom(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position)
{
assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ;
assert(!map.edgeIsSubdivided(d) || !"Trying to subdivide an already subdivided edge") ;
assert(!map.isBoundaryMarked3(d) || !"Trying to subdivide a dart marked boundary");
assert(!map.isBoundaryMarked(3,d) || !"Trying to subdivide a dart marked boundary");
unsigned int eLevel = map.edgeLevel(d) ;
......@@ -486,11 +487,11 @@ void subdivideEdgeGeom(typename PFP::MAP& map, Dart d, AttributeHandler<typename
}
template <typename PFP>
void subdivideFaceGeom(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position, SubdivideType sType)
void subdivideFaceGeom(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, SubdivideType sType)
{
assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ;
assert(!map.faceIsSubdivided(d) || !"Trying to subdivide an already subdivided face") ;
assert(!map.isBoundaryMarked3(d) || !"Trying to subdivide a dart marked boundary");
assert(!map.isBoundaryMarked(3,d) || !"Trying to subdivide a dart marked boundary");
unsigned int fLevel = map.faceLevel(d) ;
Dart old = map.faceOldestDart(d) ;
......@@ -607,12 +608,12 @@ void subdivideFaceGeom(typename PFP::MAP& map, Dart d, AttributeHandler<typename
}
template <typename PFP>
Dart subdivideVolumeClassicGeom(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position)
Dart subdivideVolumeClassicGeom(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position)
//Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, Algo::Volume::IHM::AttributeHandler_IHM<typename PFP::VEC3, VERTEX>& position)
{
assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ;
assert(!map.volumeIsSubdivided(d) || !"Trying to subdivide an already subdivided volume") ;
assert(!map.isBoundaryMarked3(d) || !"Trying to subdivide a dart marked boundary");
assert(!map.isBoundaryMarked(3,d) || !"Trying to subdivide a dart marked boundary");
unsigned int vLevel = map.volumeLevel(d);
Dart old = map.volumeOldestDart(d);
......@@ -635,8 +636,8 @@ Dart subdivideVolumeClassicGeom(typename PFP::MAP& map, Dart d, AttributeHandler
* avec calcul du centroid
*/
DartMarkerStore mf(map); // Lock a face marker to save one dart per face
DartMarkerStore mv(map);
DartMarkerStore<typename PFP::MAP> mf(map); // Lock a face marker to save one dart per face
DartMarkerStore<typename PFP::MAP> mv(map);
typename PFP::VEC3 volCenter;
unsigned count = 0 ;
......@@ -650,7 +651,7 @@ Dart subdivideVolumeClassicGeom(typename PFP::MAP& map, Dart d, AttributeHandler
std::vector<Dart> oldEdges;
oldEdges.reserve(20);
mf.markOrbit<FACE>(old) ;
mf.markOrbit(Face(old)) ;
for(unsigned int i = 0; i < visitedFaces.size(); ++i)
{
......@@ -661,7 +662,7 @@ Dart subdivideVolumeClassicGeom(typename PFP::MAP& map, Dart d, AttributeHandler
//compute volume centroid
if(!mv.isMarked(e))
{
mv.markOrbit<VERTEX>(e);
mv.markOrbit(Vertex(e));
volCenter += position[e];
++count;
oldEdges.push_back(e);
......@@ -672,7 +673,7 @@ Dart subdivideVolumeClassicGeom(typename PFP::MAP& map, Dart d, AttributeHandler
if(!mf.isMarked(ee)) // not already marked
{
visitedFaces.push_back(ee) ;
mf.markOrbit<FACE>(ee) ;
mf.markOrbit(Face(ee)) ;
}
e = map.phi1(e) ;
......@@ -807,14 +808,14 @@ Dart subdivideVolumeClassicGeom(typename PFP::MAP& map, Dart d, AttributeHandler
//LA copie de L'id est a gerer avec le sewVolumes normalement !!!!!!
//id pour les aretes interieurs : (i.e. 6 pour un hexa)
DartMarkerStore mne(map);
DartMarkerStore<typename PFP::MAP> mne(map);
for(unsigned int i = 0; i < newEdges.size(); ++i)
{
if(!mne.isMarked(newEdges[i]))
{
unsigned int idedge = map.getNewEdgeId();
map.setEdgeId(newEdges[i], idedge, EDGE);
mne.markOrbit<EDGE>(newEdges[i]);
mne.markOrbit(Edge(newEdges[i]));
}
}
......@@ -916,11 +917,11 @@ Dart subdivideVolumeClassicGeom(typename PFP::MAP& map, Dart d, AttributeHandler
template <typename PFP>
void subdivideEdgeWrong(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position)
void subdivideEdgeWrong(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position)
{
assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ;
assert(!map.edgeIsSubdivided(d) || !"Trying to subdivide an already subdivided edge") ;
assert(!map.isBoundaryMarked3(d) || !"Trying to subdivide a dart marked boundary");
assert(!map.isBoundaryMarked(3,d) || !"Trying to subdivide a dart marked boundary");
unsigned int eLevel = map.edgeLevel(d) ;
......@@ -947,11 +948,11 @@ void subdivideEdgeWrong(typename PFP::MAP& map, Dart d, AttributeHandler<typenam
}
template <typename PFP>
void subdivideFaceWrong(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position, SubdivideType sType)
void subdivideFaceWrong(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, SubdivideType sType)
{
assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ;
assert(!map.faceIsSubdivided(d) || !"Trying to subdivide an already subdivided face") ;
assert(!map.isBoundaryMarked3(d) || !"Trying to subdivide a dart marked boundary");
assert(!map.isBoundaryMarked(3,d) || !"Trying to subdivide a dart marked boundary");
unsigned int fLevel = map.faceLevel(d) ;
Dart old = map.faceOldestDart(d) ;
......@@ -1110,11 +1111,11 @@ void subdivideFaceWrong(typename PFP::MAP& map, Dart d, AttributeHandler<typenam
template <typename PFP>
//Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position)
Dart subdivideVolumeClassicWrong(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position)
Dart subdivideVolumeClassicWrong(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position)
{
assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ;
assert(!map.volumeIsSubdivided(d) || !"Trying to subdivide an already subdivided volume") ;
assert(!map.isBoundaryMarked3(d) || !"Trying to subdivide a dart marked boundary");
assert(!map.isBoundaryMarked(3,d) || !"Trying to subdivide a dart marked boundary");
unsigned int vLevel = map.volumeLevel(d);
Dart old = map.volumeOldestDart(d);
......@@ -1137,8 +1138,8 @@ Dart subdivideVolumeClassicWrong(typename PFP::MAP& map, Dart d, AttributeHandle
* avec calcul du centroid
*/
DartMarkerStore mf(map); // Lock a face marker to save one dart per face
DartMarkerStore mv(map);
DartMarkerStore<typename PFP::MAP> mf(map); // Lock a face marker to save one dart per face
DartMarkerStore<typename PFP::MAP> mv(map);
typename PFP::VEC3 volCenter;
unsigned count = 0 ;
......@@ -1307,7 +1308,7 @@ Dart subdivideVolumeClassicWrong(typename PFP::MAP& map, Dart d, AttributeHandle
//LA copie de L'id est a gerer avec le sewVolumes normalement !!!!!!
//id pour les aretes interieurs : (i.e. 6 pour un hexa)
DartMarkerStore mne(map);
DartMarkerStore<typename PFP::MAP> mne(map);
for(unsigned int i = 0; i < newEdges.size(); ++i)
{
if(!mne.isMarked(newEdges[i]))
......@@ -1330,7 +1331,7 @@ Dart subdivideVolumeClassicWrong(typename PFP::MAP& map, Dart d, AttributeHandle
template <typename PFP>
void coarsenEdge(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position)
void coarsenEdge(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position)
{
assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ;
assert(map.edgeCanBeCoarsened(d) || !"Trying to coarsen an edge that can not be coarsened") ;
......@@ -1342,7 +1343,7 @@ void coarsenEdge(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::
}
template <typename PFP>
void coarsenFace(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position, SubdivideType sType)
void coarsenFace(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, SubdivideType sType)
{
assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ;
assert(map.faceCanBeCoarsened(d) || !"Trying to coarsen a non-subdivided face or a more than once subdivided face") ;
......@@ -1395,7 +1396,7 @@ void coarsenFace(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::
}
template <typename PFP>
void coarsenVolume(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position)
void coarsenVolume(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position)
{
assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ;
assert(map.volumeIsSubdividedOnce(d) || !"Trying to coarsen a non-subdivided volume or a more than once subdivided volume") ;
......@@ -1438,11 +1439,11 @@ void coarsenVolume(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP
template <typename PFP>
Dart subdivideVolumeClassic2(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position)
Dart subdivideVolumeClassic2(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position)
{
assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ;
assert(!map.volumeIsSubdivided(d) || !"Trying to subdivide an already subdivided volume") ;
assert(!map.isBoundaryMarked3(d) || !"Trying to subdivide a dart marked boundary");
assert(!map.isBoundaryMarked(3,d) || !"Trying to subdivide a dart marked boundary");
unsigned int vLevel = map.volumeLevel(d);
Dart old = map.volumeOldestDart(d);
......@@ -1551,7 +1552,7 @@ Dart subdivideVolumeClassic2(typename PFP::MAP& map, Dart d, AttributeHandler<ty
//LA copie de L'id est a gerer avec le sewVolumes normalement !!!!!!
//id pour les aretes interieurs : (i.e. 6 pour un hexa)
DartMarker mne(map);
DartMarker<typename PFP::MAP> mne(map);
for(unsigned int i = 0; i < newEdges.size(); ++i)
{
if(!mne.isMarked(newEdges[i]))
......@@ -1581,11 +1582,11 @@ Dart subdivideVolumeClassic2(typename PFP::MAP& map, Dart d, AttributeHandler<ty
template <typename PFP>
void subdivideEdgeLoop(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position)
void subdivideEdgeLoop(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position)
{
assert(map.