added initialization of mark component to zero. So all the element it is sure that are unitialized after the first unmarkall.

This commit is contained in:
Paolo Cignoni 2012-12-21 15:33:18 +00:00
parent 8476a1ff20
commit b48b0e568c
5 changed files with 15 additions and 12 deletions

View File

@ -162,16 +162,17 @@ template <class T> class EVAdj : public VertexRef<T>{};
*/
template <class T> class Mark: public T {
public:
static bool HasMark() { return true; }
static bool HasMarkOcc() { return true; }
inline void InitIMark() { _imark = 0; }
inline int & IMark() { return _imark;}
inline const int & IMark() const {return _imark;}
template < class LeftV>
void ImportData(const LeftV & left ) { IMark() = left.IMark(); T::ImportData( left); }
static void Name(std::vector<std::string> & name){name.push_back(std::string("Mark"));T::Name(name);}
Mark():_imark(0){}
static bool HasMark() { return true; }
static bool HasMarkOcc() { return true; }
inline void InitIMark() { _imark = 0; }
inline int & IMark() { return _imark;}
inline const int & IMark() const {return _imark;}
template < class LeftV>
void ImportData(const LeftV & left ) { IMark() = left.IMark(); T::ImportData( left); }
static void Name(std::vector<std::string> & name){name.push_back(std::string("Mark"));T::Name(name);}
private:
private:
int _imark;
};

View File

@ -457,6 +457,7 @@ public: static void Name(std::vector<std::string> & name){name.push_back(std::s
template <class T> class Mark: public T {
public:
Mark():_imark(0){}
inline int &IMark() { return _imark;}
inline int cIMark() const { return _imark;}
inline void InitIMark() { _imark = 0; }

View File

@ -263,7 +263,7 @@ bool IsMarkEnabled() const {return MarkEnabled;}
void EnableMark() {
assert(VALUE_TYPE::HasMarkOcf());
MarkEnabled=true;
MV.resize((*this).size());
MV.resize((*this).size(),0);
}
void DisableMark() {

View File

@ -218,6 +218,7 @@ public: static void Name(std::vector<std::string> & name){name.push_back(std::st
template <class T> class Mark: public T {
public:
Mark():_imark(0){}
inline const int &IMark() const { return _imark;}
inline int &IMark() { return _imark;}
inline int cIMark() const { return _imark;}

View File

@ -148,7 +148,7 @@ bool IsMarkEnabled() const {return MarkEnabled;}
void EnableMark() {
assert(VALUE_TYPE::HasMarkOcf());
MarkEnabled=true;
MV.resize((*this).size());
MV.resize((*this).size(),0);
}
void DisableMark() {
assert(VALUE_TYPE::HasMarkOcf());
@ -355,7 +355,7 @@ public:
template <class RightVertexType>
void ImportData(const RightVertexType & rightV)
{
if((*this).IsQualityEnabled && rightV.IsQualityEnabled() ) // copy the data only if they are enabled in both vertices
if((*this).IsQualityEnabled() && rightV.IsQualityEnabled() ) // copy the data only if they are enabled in both vertices
Q() = rightV.cQ();
T::ImportData(rightV);
}