Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit 0ea6813e authored by Pierre Kraemer's avatar Pierre Kraemer
Browse files

update load & save

parent cb65f5ab
......@@ -68,7 +68,7 @@ AttributeHandler_IHM<T, ORBIT> ImplicitHierarchicalMap3::getAttribute(const std:
inline void ImplicitHierarchicalMap3::update_topo_shortcuts()
{
Map3::update_topo_shortcuts();
// Map3::update_topo_shortcuts();
m_dartLevel = Map3::getAttribute<unsigned int, DART>("dartLevel") ;
m_faceId = Map3::getAttribute<unsigned int, DART>("faceId") ;
m_edgeId = Map3::getAttribute<unsigned int, DART>("edgeId") ;
......
......@@ -344,17 +344,13 @@ public:
/****************************************
* SAVE & LOAD *
****************************************/
/**
* update the pointer of embedding vector after loading
*/
void update_m_emb_afterLoad();
protected:
/**
* update the markTables and recursively from real type the topo shortcut pointers
* restore embedding / markers / quick traversal shortcuts
*/
virtual void update_topo_shortcuts();
void restore_shortcuts();
public:
/**
* Save map in a binary file
* @param filename the file name
......@@ -379,11 +375,13 @@ public:
*/
void dumpAttributesAndMarkers() ;
protected:
/**
* update topo relation after compacting the container:
*/
virtual void compactTopoRelations(const std::vector<unsigned int>& oldnew) = 0 ;
public:
/**
* compact the map
*/
......
......@@ -70,6 +70,9 @@ protected:
inline void addPermutation();
virtual unsigned int getNbInvolutions() const = 0;
virtual unsigned int getNbPermutations() const = 0;
template <int I>
inline Dart getInvolution(Dart d) const;
......@@ -80,16 +83,16 @@ protected:
inline Dart getPermutationInv(Dart d) const;
template <int I>
inline void permutationSew(Dart d, Dart e);
inline void involutionSew(Dart d, Dart e);
template <int I>
inline void permutationUnsew(Dart d);
inline void involutionUnsew(Dart d);
template <int I>
inline void involutionSew(Dart d, Dart e);
inline void permutationSew(Dart d, Dart e);
template <int I>
inline void involutionUnsew(Dart d);
inline void permutationUnsew(Dart d);
inline virtual void compactTopoRelations(const std::vector<unsigned int>& oldnew);
......@@ -125,6 +128,8 @@ public:
bool loadMapBin(const std::string& filename);
bool copyFrom(const GenericMap& map);
void restore_topo_shortcuts();
} ;
} //namespace CGoGN
......
......@@ -107,6 +107,23 @@ inline Dart MapMono::getPermutationInv(Dart d) const
return (*m_permutation_inv[I])[d.index];
}
template <int I>
inline void MapMono::involutionSew(Dart d, Dart e)
{
assert((*m_involution[I])[d.index] == d) ;
assert((*m_involution[I])[e.index] == e) ;
(*m_involution[I])[d.index] = e ;
(*m_involution[I])[e.index] = d ;
}
template <int I>
inline void MapMono::involutionUnsew(Dart d)
{
Dart e = (*m_involution[I])[d.index] ;
(*m_involution[I])[d.index] = d ;
(*m_involution[I])[e.index] = e ;
}
template <int I>
inline void MapMono::permutationSew(Dart d, Dart e)
{
......@@ -129,23 +146,6 @@ inline void MapMono::permutationUnsew(Dart d)
(*m_permutation_inv[I])[e.index] = e ;
}
template <int I>
inline void MapMono::involutionSew(Dart d, Dart e)
{
assert((*m_involution[I])[d.index] == d) ;
assert((*m_involution[I])[e.index] == e) ;
(*m_involution[I])[d.index] = e ;
(*m_involution[I])[e.index] = d ;
}
template <int I>
inline void MapMono::involutionUnsew(Dart d)
{
Dart e = (*m_involution[I])[d.index] ;
(*m_involution[I])[d.index] = d ;
(*m_involution[I])[e.index] = e ;
}
inline void MapMono::compactTopoRelations(const std::vector<unsigned int>& oldnew)
{
for (unsigned int i = m_attribs[DART].begin(); i != m_attribs[DART].end(); m_attribs[DART].next(i))
......
......@@ -33,6 +33,7 @@ namespace CGoGN
class MapMulti : public GenericMap
{
template<typename MAP> friend class DartMarkerTmpl ;
template<typename MAP> friend class DartMarkerStore ;
public:
MapMulti()
......@@ -137,6 +138,9 @@ protected:
inline void addPermutation();
virtual unsigned int getNbInvolutions() const = 0;
virtual unsigned int getNbPermutations() const = 0;
template <int I>
inline Dart getInvolution(Dart d) const;
......@@ -147,16 +151,16 @@ protected:
inline Dart getPermutationInv(Dart d) const;
template <int I>
inline void permutationSew(Dart d, Dart e);
inline void involutionSew(Dart d, Dart e);
template <int I>
inline void permutationUnsew(Dart d);
inline void involutionUnsew(Dart d);
template <int I>
inline void involutionSew(Dart d, Dart e);
inline void permutationSew(Dart d, Dart e);
template <int I>
inline void involutionUnsew(Dart d);
inline void permutationUnsew(Dart d);
inline virtual void compactTopoRelations(const std::vector<unsigned int>& oldnew);
......@@ -283,6 +287,8 @@ public:
bool loadMapBin(const std::string& filename);
bool copyFrom(const GenericMap& map);
void restore_topo_shortcuts();
} ;
} //namespace CGoGN
......
......@@ -224,6 +224,24 @@ inline Dart MapMulti::getPermutationInv(Dart d) const
return (*m_permutation_inv[I])[dartIndex(d)];
}
template <int I>
inline void MapMulti::involutionSew(Dart d, Dart e)
{
assert((*m_involution[I])[dartIndex(d)] == d) ;
assert((*m_involution[I])[dartIndex(e)] == e) ;
(*m_involution[I])[dartIndex(d)] = e ;
(*m_involution[I])[dartIndex(e)] = d ;
}
template <int I>
inline void MapMulti::involutionUnsew(Dart d)
{
unsigned int d_index = dartIndex(d);
Dart e = (*m_involution[I])[d_index] ;
(*m_involution[I])[d_index] = d ;
(*m_involution[I])[dartIndex(e)] = e ;
}
template <int I>
inline void MapMulti::permutationSew(Dart d, Dart e)
{
......@@ -250,24 +268,6 @@ inline void MapMulti::permutationUnsew(Dart d)
(*m_permutation_inv[I])[e_index] = e ;
}
template <int I>
inline void MapMulti::involutionSew(Dart d, Dart e)
{
assert((*m_involution[I])[dartIndex(d)] == d) ;
assert((*m_involution[I])[dartIndex(e)] == e) ;
(*m_involution[I])[dartIndex(d)] = e ;
(*m_involution[I])[dartIndex(e)] = d ;
}
template <int I>
inline void MapMulti::involutionUnsew(Dart d)
{
unsigned int d_index = dartIndex(d);
Dart e = (*m_involution[I])[d_index] ;
(*m_involution[I])[d_index] = d ;
(*m_involution[I])[dartIndex(e)] = e ;
}
inline void MapMulti::compactTopoRelations(const std::vector<unsigned int>& oldnew)
{
for (unsigned int i = m_attribs[DART].begin(); i != m_attribs[DART].end(); m_attribs[DART].next(i))
......
......@@ -55,7 +55,8 @@ public:
virtual void clear(bool removeAttrib);
virtual void update_topo_shortcuts();
virtual unsigned int getNbInvolutions() const;
virtual unsigned int getNbPermutations() const;
/*! @name Basic Topological Operators
* Access and Modification
......
......@@ -60,10 +60,15 @@ inline void GMap0<MAP_IMPL>::clear(bool removeAttrib)
}
template <typename MAP_IMPL>
inline void GMap0<MAP_IMPL>::update_topo_shortcuts()
inline unsigned int GMap0<MAP_IMPL>::getNbInvolutions() const
{
MAP_IMPL::update_topo_shortcuts();
// m_beta0 = getRelation("beta0");
return 1;
}
template <typename MAP_IMPL>
inline unsigned int GMap0<MAP_IMPL>::getNbPermutations() const
{
return 0;
}
/*! @name Basic Topological Operators
......
......@@ -53,7 +53,8 @@ public:
virtual void clear(bool removeAttrib);
virtual void update_topo_shortcuts();
virtual unsigned int getNbInvolutions() const;
virtual unsigned int getNbPermutations() const;
/*! @name Basic Topological Operators
* Access and Modification
......
......@@ -58,10 +58,15 @@ inline void GMap1<MAP_IMPL>::clear(bool removeAttrib)
}
template <typename MAP_IMPL>
inline void GMap1<MAP_IMPL>::update_topo_shortcuts()
inline unsigned int GMap1<MAP_IMPL>::getNbInvolutions() const
{
ParentMap::update_topo_shortcuts();
// m_beta1 = getRelation("beta1");
return 1 + ParentMap::getNbInvolutions();
}
template <typename MAP_IMPL>
inline unsigned int GMap1<MAP_IMPL>::getNbPermutations() const
{
return ParentMap::getNbPermutations();
}
/*! @name Basic Topological Operators
......
......@@ -60,7 +60,8 @@ public:
virtual void clear(bool removeAttrib);
virtual void update_topo_shortcuts();
virtual unsigned int getNbInvolutions() const;
virtual unsigned int getNbPermutations() const;
/*! @name Basic Topological Operators
* Access and Modification
......
......@@ -58,10 +58,15 @@ inline void GMap2<MAP_IMPL>::clear(bool removeAttrib)
}
template <typename MAP_IMPL>
inline void GMap2<MAP_IMPL>::update_topo_shortcuts()
inline unsigned int GMap2<MAP_IMPL>::getNbInvolutions() const
{
ParentMap::update_topo_shortcuts();
// m_beta2 = getRelation("beta2");
return 1 + ParentMap::getNbInvolutions();
}
template <typename MAP_IMPL>
inline unsigned int GMap2<MAP_IMPL>::getNbPermutations() const
{
return ParentMap::getNbPermutations();
}
/*! @name Basic Topological Operators
......
......@@ -66,7 +66,8 @@ public:
virtual void clear(bool removeAttrib);
virtual void update_topo_shortcuts();
virtual unsigned int getNbInvolutions() const;
virtual unsigned int getNbPermutations() const;
/*! @name Basic Topological Operators
* Access and Modification
......
......@@ -60,10 +60,15 @@ inline void GMap3<MAP_IMPL>::clear(bool removeAttrib)
}
template <typename MAP_IMPL>
inline void GMap3<MAP_IMPL>::update_topo_shortcuts()
inline unsigned int GMap3<MAP_IMPL>::getNbInvolutions() const
{
ParentMap::update_topo_shortcuts();
// m_beta3 = getRelation("beta3");
return 1 + ParentMap::getNbInvolutions();
}
template <typename MAP_IMPL>
inline unsigned int GMap3<MAP_IMPL>::getNbPermutations() const
{
return ParentMap::getNbPermutations();
}
/*! @name Basic Topological Operators
......
......@@ -60,7 +60,7 @@ AttributeHandler_IHM<T, ORBIT> ImplicitHierarchicalMap2::getAttribute(const std:
inline void ImplicitHierarchicalMap2::update_topo_shortcuts()
{
Map2::update_topo_shortcuts();
// Map2::update_topo_shortcuts();
m_dartLevel = Map2::getAttribute<unsigned int, DART>("dartLevel") ;
m_edgeId = Map2::getAttribute<unsigned int, DART>("edgeId") ;
......
......@@ -59,7 +59,8 @@ public:
virtual void clear(bool removeAttrib);
virtual void update_topo_shortcuts();
virtual unsigned int getNbInvolutions() const;
virtual unsigned int getNbPermutations() const;
/*! @name Basic Topological Operators
* Access and Modification
......
......@@ -60,11 +60,15 @@ inline void Map1<MAP_IMPL>::clear(bool removeAttrib)
}
template <typename MAP_IMPL>
inline void Map1<MAP_IMPL>::update_topo_shortcuts()
inline unsigned int Map1<MAP_IMPL>::getNbInvolutions() const
{
MAP_IMPL::update_topo_shortcuts();
// m_phi1 = MAP::getRelation("phi1");
// m_phi_1 = MAP::getRelation("phi_1");
return 0;
}
template <typename MAP_IMPL>
inline unsigned int Map1<MAP_IMPL>::getNbPermutations() const
{
return 1;
}
/*! @name Basic Topological Operators
......
......@@ -72,7 +72,8 @@ public:
virtual void clear(bool removeAttrib);
virtual void update_topo_shortcuts();
virtual unsigned int getNbInvolutions() const;
virtual unsigned int getNbPermutations() const;
/*! @name Basic Topological Operators
* Access and Modification
......
......@@ -58,10 +58,15 @@ inline void Map2<MAP_IMPL>::clear(bool removeAttrib)
}
template <typename MAP_IMPL>
inline void Map2<MAP_IMPL>::update_topo_shortcuts()
inline unsigned int Map2<MAP_IMPL>::getNbInvolutions() const
{
ParentMap::update_topo_shortcuts();
// m_phi2 = getRelation("phi2");
return 1 + ParentMap::getNbInvolutions();
}
template <typename MAP_IMPL>
inline unsigned int Map2<MAP_IMPL>::getNbPermutations() const
{
return ParentMap::getNbPermutations();
}
/*! @name Basic Topological Operators
......
......@@ -80,7 +80,8 @@ public:
virtual void clear(bool removeAttrib);
virtual void update_topo_shortcuts();
virtual unsigned int getNbInvolutions() const;
virtual unsigned int getNbPermutations() const;
/*! @name Basic Topological Operators
* Access and Modification
......
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