Commit 9e2ce59c authored by untereiner's avatar untereiner
Browse files

change subdiv algo for no_boundary

parent 7f08b177
...@@ -36,11 +36,11 @@ namespace Algo ...@@ -36,11 +36,11 @@ namespace Algo
namespace IHM namespace IHM
{ {
//template<typename T> class AttributeHandler_IHM ; template<typename T> class AttributeHandler_IHM ;
class ImplicitHierarchicalMap3 : public EmbeddedMap3 class ImplicitHierarchicalMap3 : public EmbeddedMap3
{ {
//template<typename T> friend class AttributeHandler_IHM ; template<typename T> friend class AttributeHandler_IHM ;
public: public:
unsigned int m_curLevel ; unsigned int m_curLevel ;
...@@ -59,23 +59,37 @@ public: ...@@ -59,23 +59,37 @@ public:
~ImplicitHierarchicalMap3() ; ~ImplicitHierarchicalMap3() ;
//!
/*!
*
*/
void init() ; void init() ;
/*************************************************** /*! @name Attributes Management
* ATTRIBUTES MANAGEMENT * * To handles Attributes for each level of an implicit 3-map
***************************************************/ *************************************************************************/
//template <typename T>
//AttributeHandler_IHM<T> addAttribute(unsigned int orbit, const std::string& nameAttr) ;
//template <typename T> //@{
//AttributeHandler_IHM<T> getAttribute(unsigned int orbit, const std::string& nameAttr) ; //!
/*!
*
*/
template <typename T>
AttributeHandler_IHM<T> addAttribute(unsigned int orbit, const std::string& nameAttr) ;
//!
/*!
*
*/
template <typename T>
AttributeHandler_IHM<T> getAttribute(unsigned int orbit, const std::string& nameAttr) ;
//@}
/*************************************************** /*! @name Basic Topological Operators
* MAP TRAVERSAL * * Redefinition of the basic topological operators
***************************************************/ *************************************************************************/
//@{
virtual Dart newDart() ; virtual Dart newDart() ;
Dart phi1(Dart d) ; Dart phi1(Dart d) ;
...@@ -97,214 +111,278 @@ public: ...@@ -97,214 +111,278 @@ public:
Dart alpha2(Dart d); Dart alpha2(Dart d);
Dart alpha_2(Dart d); Dart alpha_2(Dart d);
//@}
virtual Dart begin() ; // /*! @name Topological Operators with Cells id management
// * Topological operations on Hierarchical Implicit 3-maps
virtual Dart end() ; // *************************************************************************/
//
virtual void next(Dart& d) ; // //@{
// //!
virtual bool foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread = 0) ; // /*!
// *
virtual bool foreach_dart_of_edge(Dart d, FunctorType& f, unsigned int thread = 0) ; // */
// virtual Dart cutEdge(Dart d);
bool foreach_dart_of_oriented_face(Dart d, FunctorType& f, unsigned int thread = 0); //
virtual bool foreach_dart_of_face(Dart d, FunctorType& f, unsigned int thread = 0) ; // //!
// /*!
bool foreach_dart_of_oriented_volume(Dart d, FunctorType& f, unsigned int thread = 0); // *
virtual bool foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread = 0) ; // */
// virtual bool uncutEdge(Dart d);
virtual bool foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread = 0) ; //
// //!
// /*!
/*************************************************** // *
* LEVELS MANAGEMENT * // */
***************************************************/ // virtual void splitFace(Dart d, Dart e);
//
// //!
// /*!
// *
// */
// virtual void sewVolumes(Dart d, Dart e, bool withBoundary = true);
//
// //!
// /*!
// *
// */
// virtual void splitVolume(std::vector<Dart>& vd);
// //@}
/*! @name Levels Management
* Operations to manage the levels of an Implicit Hierarchical 3-map
*************************************************************************/
//@{
//!
/*!
*
*/
unsigned int getCurrentLevel() ; unsigned int getCurrentLevel() ;
//!
/*!
*
*/
void setCurrentLevel(unsigned int l) ; void setCurrentLevel(unsigned int l) ;
//!
/*!
*
*/
unsigned int getMaxLevel() ; unsigned int getMaxLevel() ;
//!
/*!
*
*/
unsigned int getDartLevel(Dart d) ; unsigned int getDartLevel(Dart d) ;
//!
/*!
*
*/
void setDartLevel(Dart d, unsigned int i) ; void setDartLevel(Dart d, unsigned int i) ;
//@}
/*************************************************** /*! @name Id Management
* EDGE ID MANAGEMENT * * Operations to manage the ids of edges and faces
***************************************************/ *************************************************************************/
/** //@{
* Give a new unique id to all the edges of the map //! Give a new unique id to all the edges of the map
/*!
*/ */
void initEdgeId() ; void initEdgeId() ;
/** //! Return the next available edge id
* Return the next available edge id /*!
*/ */
unsigned int getNewEdgeId() ; unsigned int getNewEdgeId() ;
/** //! Return the id of the edge of d
* Return the id of the edge of d /*!
*/ */
unsigned int getEdgeId(Dart d) ; unsigned int getEdgeId(Dart d) ;
/** //! Set an edge id to all darts from an orbit of d
* Set an edge id to all darts from an orbit of d /*!
*/ */
//TODO changer l'ordre des parametres void setEdgeId(Dart d, unsigned int i, unsigned int orbit); //TODO a virer
void setEdgeId(Dart d, unsigned int i, unsigned int orbit); void setEdgeId(Dart d, unsigned int i);
/*************************************************** //! Give a new unique id to all the faces of the map
* FACE ID MANAGEMENT * /*!
***************************************************/
/**
* Give a new unique id to all the faces of the map
*/ */
void initFaceId() ; void initFaceId() ;
/** //! Return the next available face id
* Return the next available face id /*!
*/ */
unsigned int getNewFaceId() ; unsigned int getNewFaceId() ;
/** //! Return the id of the face of d
* Return the id of the face of d /*!
*/ */
unsigned int getFaceId(Dart d) ; unsigned int getFaceId(Dart d) ;
/** //! Set a face id to all darts from an orbit of d
* Set a face id to all darts from an orbit of d /*!
*/ */
//TODO changer l'ordre des parametres void setFaceId(Dart d, unsigned int i, unsigned int orbit); //TODO a virer
void setFaceId(Dart d, unsigned int i, unsigned int orbit);
void setFaceId(unsigned int orbit, Dart d); void setFaceId(unsigned int orbit, Dart d);
//@}
/*************************************************** /*! @name Cells Information
* CELLS INFORMATION * * Operations to manage the cells informations :
***************************************************/ *************************************************************************/
/** //@{
* Return the level of insertion of the vertex of d //! Return the level of insertion of the vertex of d
/*!
*/ */
unsigned int vertexInsertionLevel(Dart d) ; unsigned int vertexInsertionLevel(Dart d) ;
/** //! Return the level of the edge of d in the current level map
* Return the level of the edge of d in the current level map /*!
*/ */
unsigned int edgeLevel(Dart d) ; unsigned int edgeLevel(Dart d) ;
/** //! Return the level of the face of d in the current level map
* Return the level of the face of d in the current level map /*!
*/ */
unsigned int faceLevel(Dart d); unsigned int faceLevel(Dart d);
/** //! Return the level of the volume of d in the current level map
* Return the level of the volume of d in the current level map /*!
*/ */
unsigned int volumeLevel(Dart d); unsigned int volumeLevel(Dart d);
/** //! Return the oldest dart of the face of d in the current level map
* Return the oldest dart of the face of d in the current level map /*!
*/ */
Dart faceOldestDart(Dart d); Dart faceOldestDart(Dart d);
/** //! Return the oldest dart of the volume of d in the current level map
* Return the oldest dart of the volume of d in the current level map /*!
*/ */
Dart volumeOldestDart(Dart d); Dart volumeOldestDart(Dart d);
/** //! Return true if the edge of d in the current level map
* Return true if the edge of d in the current level map //! has already been subdivided to the next level
* has already been subdivided to the next level /*!
*/ */
bool edgeIsSubdivided(Dart d) ; bool edgeIsSubdivided(Dart d) ;
/** //! Return true if the face of d in the current level map
* Return true if the face of d in the current level map //! has already been subdivided to the next level
* has already been subdivided to the next level /*!
*/ */
bool faceIsSubdivided(Dart d) ; bool faceIsSubdivided(Dart d) ;
/** //! Return true if the volume of d in the current level map
* Return true if the volume of d in the current level map //! has already been subdivided to the next level
* has already been subdivided to the next level /*!
*/ */
bool volumeIsSubdivided(Dart d); bool volumeIsSubdivided(Dart d);
/** //! Return true if the edge of d in the current level map
* Return true if the edge of d in the current level map //! is subdivided to the next level,
* is subdivided to the next level, //! none of its resulting edges is in turn subdivided to the next level
* none of its resulting edges is in turn subdivided to the next level //! and the middle vertex is of degree 2
* and the middle vertex is of degree 2 /*!
*/ */
bool edgeCanBeCoarsened(Dart d); bool edgeCanBeCoarsened(Dart d);
/** //!
* /*!
*/ */
bool faceCanBeCoarsened(Dart d); bool faceCanBeCoarsened(Dart d);
/** //!
* /*!
*/ */
bool faceIsSubdividedOnce(Dart d); bool faceIsSubdividedOnce(Dart d);
/** //!
* /*!
*/ */
bool volumeIsSubdividedOnce(Dart d); bool volumeIsSubdividedOnce(Dart d);
/** //!
* /*!
*/ */
bool neighborhoodLevelDiffersByOne(Dart d); bool neighborhoodLevelDiffersByOne(Dart d);
/** //! wired !!!
* wired !!! /*!
*/ */
bool coarsenNeighborhoodLevelDiffersByOne(Dart d); bool coarsenNeighborhoodLevelDiffersByOne(Dart d);
//@}
/*! @name Cell Functors
* Redefition of the 3-maps map traversor
*************************************************************************/
//@{
virtual Dart begin() ;
virtual Dart end() ;
virtual void next(Dart& d) ;
virtual bool foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread = 0) ;
virtual bool foreach_dart_of_edge(Dart d, FunctorType& f, unsigned int thread = 0) ;
bool foreach_dart_of_oriented_face(Dart d, FunctorType& f, unsigned int thread = 0);
virtual bool foreach_dart_of_face(Dart d, FunctorType& f, unsigned int thread = 0) ;
bool foreach_dart_of_oriented_volume(Dart d, FunctorType& f, unsigned int thread = 0);
virtual bool foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread = 0) ;
virtual bool foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread = 0) ;
//@}
} ; } ;
//template <typename T> template <typename T>
//class AttributeHandler_IHM : public AttributeHandler<T> class AttributeHandler_IHM : public AttributeHandler<T>
//{ {
//public: public:
// typedef T DATA_TYPE ; typedef T DATA_TYPE ;
//
// AttributeHandler_IHM() : AttributeHandler<T>() AttributeHandler_IHM() : AttributeHandler<T>()
// {} {}
//
// AttributeHandler_IHM(GenericMap* m, AttributeMultiVector<T>* amv) : AttributeHandler<T>(m, amv) AttributeHandler_IHM(GenericMap* m, AttributeMultiVector<T>* amv) : AttributeHandler<T>(m, amv)
// {} {}
//
// AttributeMultiVector<T>* getDataVector() const AttributeMultiVector<T>* getDataVector() const
// { {
// return AttributeHandler<T>::getDataVector() ; return AttributeHandler<T>::getDataVector() ;
// } }
//
// bool isValid() const bool isValid() const
// { {
// return AttributeHandler<T>::isValid() ; return AttributeHandler<T>::isValid() ;
// } }
//
// T& operator[](Dart d) ; T& operator[](Dart d) ;
//
// const T& operator[](Dart d) const ; const T& operator[](Dart d) const ;
//
// T& operator[](unsigned int a) T& operator[](unsigned int a)
// { {
// return AttributeHandler<T>::operator[](a) ; return AttributeHandler<T>::operator[](a) ;
// } }
//
// const T& operator[](unsigned int a) const const T& operator[](unsigned int a) const
// { {
// return AttributeHandler<T>::operator[](a) ; return AttributeHandler<T>::operator[](a) ;
// } }
//} ; } ;
} //namespace IHM } //namespace IHM
......
...@@ -31,37 +31,37 @@ namespace Algo ...@@ -31,37 +31,37 @@ namespace Algo
namespace IHM namespace IHM
{ {
///*************************************************** /***************************************************
// * ATTRIBUTES MANAGEMENT * * ATTRIBUTES MANAGEMENT *
// ***************************************************/ ***************************************************/
//
//template <typename T> template <typename T>
//AttributeHandler_IHM<T> ImplicitHierarchicalMap3::addAttribute(unsigned int orbit, const std::string& nameAttr) AttributeHandler_IHM<T> ImplicitHierarchicalMap3::addAttribute(unsigned int orbit, const std::string& nameAttr)
//{ {
// bool addNextLevelCell = false ; bool addNextLevelCell = false ;
// if(!isOrbitEmbedded(orbit)) if(!isOrbitEmbedded(orbit))
// addNextLevelCell = true ; addNextLevelCell = true ;
//
// AttributeHandler<T> h = Map3::addAttribute<T>(orbit, nameAttr) ; AttributeHandler<T> h = Map3::addAttribute<T>(orbit, nameAttr) ;
//
// if(addNextLevelCell) if(addNextLevelCell)
// { {
// AttributeContainer& cellCont = m_attribs[orbit] ; AttributeContainer& cellCont = m_attribs[orbit] ;
// AttributeMultiVector<unsigned int>* amv = cellCont.addAttribute<unsigned int>("nextLevelCell") ; AttributeMultiVector<unsigned int>* amv = cellCont.addAttribute<unsigned int>("nextLevelCell") ;
// 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->operator[](i) = EMBNULL ; amv->operator[](i) = EMBNULL ;
// } }
//
// return AttributeHandler_IHM<T>(this, h.getDataVector()) ; return AttributeHandler_IHM<T>(this, h.getDataVector()) ;
//} }
//
//template <typename T> template <typename T>
//AttributeHandler_IHM<T> ImplicitHierarchicalMap3::getAttribute(unsigned int orbit, const std::string& nameAttr) AttributeHandler_IHM<T> ImplicitHierarchicalMap3::getAttribute(unsigned int orbit, const std::string& nameAttr)
//{ {
// AttributeHandler<T> h = Map2::getAttribute<T>(orbit, nameAttr) ; AttributeHandler<T> h = Map3::getAttribute<T>(orbit, nameAttr) ;
// return AttributeHandler_IHM<T>(this, h.getDataVector()) ; return AttributeHandler_IHM<T>(this, h.getDataVector()) ;
//} }
/*************************************************** /***************************************************
* MAP TRAVERSAL * * MAP TRAVERSAL *
...@@ -171,50 +171,21 @@ inline Dart ImplicitHierarchicalMap3::alpha1(Dart d) ...@@ -171,50 +171,21 @@ inline Dart ImplicitHierarchicalMap3::alpha1(Dart d)
{ {
//assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ; //assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ;
return Map3::alpha1(d) ; return phi3(phi_1(d)) ;
} }
inline Dart ImplicitHierarchicalMap3::alpha2(Dart d)