Commit cc7691b9 authored by Pierre Kraemer's avatar Pierre Kraemer

on avance sur le calcul du maillage dual

parent c59d85ad
......@@ -437,32 +437,24 @@ void LoopSubdivision(typename PFP::MAP& map, typename PFP::TVEC3& position, cons
template <typename PFP>
void computeDual(typename PFP::MAP& map, typename PFP::TVEC3& position, const FunctorSelect& selected)
{
// typedef typename PFP::MAP MAP ;
// typedef typename PFP::VEC3 VEC3 ;
// typedef typename PFP::REAL REAL ;
//
// AutoAttributeHandler<VEC3> faceCentroid(map, FACE_ORBIT, "faceCentroid") ;
// Algo::Geometry::computeCentroidFaces<PFP>(map, position, faceCentroid, selected) ;
//
// for(Dart d = map.begin(); d != map.end(); map.next(d))
// {
// if(m.isMarked(d))
// {
// unsigned int em = map.newCell(VERTEX_ORBIT) ;
// Dart dd = d ;
// do
// {
// map.setDartEmbedding(map.phi2(dd), VERTEX_ORBIT, em) ;
// m.unmark(dd) ;
// dd = map.phi1(dd) ;
// }
// while (dd != d) ;
// attributs[map.phi2(d)] = *itEmb ;
// ++itEmb ;
// }
// }
//
// map.computeDual() ;
typedef typename PFP::MAP MAP ;
typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ;
AttributeHandler<Dart> phi1 = map.template getAttribute<Dart>(DART_ORBIT, "phi1") ;
AttributeHandler<Dart> phi_1 = map.template getAttribute<Dart>(DART_ORBIT, "phi_1") ;
AttributeHandler<Dart> new_phi1 = map.template addAttribute<Dart>(DART_ORBIT, "new_phi1") ;
for(Dart d = map.begin(); d != map.end(); map.next(d))
{
Dart dd = map.alpha1(d) ;
new_phi1[d] = dd ;
phi_1[dd] = d ;
}
map.template swapAttributes<Dart>(phi1, new_phi1) ;
map.template removeAttribute<Dart>(new_phi1) ;
}
template <typename PFP>
......
......@@ -56,8 +56,8 @@ template <typename T>
inline bool AttribMap::swapAttributes(AttributeHandler<T>& attr1, AttributeHandler<T>& attr2)
{
assert((attr1.isValid() && attr2.isValid()) || !"Invalid attribute handler") ;
assert(AttributeContainer::orbitAttr(attr1.id()) == AttributeContainer::orbitAttr(attr2.id()) || !"Cannot swap attributes of different orbits") ;
unsigned int orbit = AttributeContainer::orbitAttr(attr1.id()) ;
assert(orbit == AttributeContainer::orbitAttr(attr2.id()) || !"Cannot swap attributes of different orbits") ;
unsigned int index1 = AttributeContainer::indexAttr(attr1.id()) ;
unsigned int index2 = AttributeContainer::indexAttr(attr2.id()) ;
if(index1 != index2)
......
......@@ -393,27 +393,6 @@ void Map2::reverseOrientation()
}
}
//void Map2::computeDual()
//{
// AttributeContainer& cont = m_attribs[DART_ORBIT] ;
//
// unsigned int phi1_idx = cont.getAttribute("phi1") ;
// unsigned int new_phi1_idx = cont.addAttribute<Dart>("new_phi1") ;
//
// AttributeMultiVector<Dart>& new_phi1 = cont.getDataVector<Dart>(new_phi1_idx) ;
//
// for (Dart d = begin() ; d != end() ; next(d))
// {
// Dart dd = alpha1(d) ;
// new_phi1[d.index] = dd ;
// (*m_phi_1)[dd.index] = d ;
// }
//
// cont.swapAttributes(phi1_idx, new_phi1_idx) ;
//
// cont.removeAttribute(new_phi1_idx) ;
//}
/*! @name Topological Queries
* Return or set various topological information
*************************************************************************/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment