// File : SMESHDS_Hypothesis.cxx
// Author : Paul RASCLE, EDF
// Module : SMESH
-// $Header$
//
#include "SMESHDS_Hypothesis.hxx"
+#include <sstream>
+
using namespace std;
//=============================================================================
SMESHDS_Hypothesis::SMESHDS_Hypothesis(int hypId)
{
-// MESSAGE("SMESHDS_Hypothesis::SMESHDS_Hypothesis");
_hypId = hypId;
_name = "generic";
-// SCRUTE(_name);
-// SCRUTE(_hypId);
}
//=============================================================================
SMESHDS_Hypothesis::~SMESHDS_Hypothesis()
{
-// MESSAGE("SMESHDS_Hypothesis::~SMESHDS_Hypothesis");
}
//=============================================================================
const char* SMESHDS_Hypothesis::GetName() const
{
-// MESSAGE("SMESHDS_Hypothesis::GetName");
-// SCRUTE(_name);
-// SCRUTE(&_name);
return _name.c_str();
}
int SMESHDS_Hypothesis::GetID() const
{
-// MESSAGE("SMESHDS_Hypothesis::GetId");
-// SCRUTE(_hypId);
return _hypId;
}
int SMESHDS_Hypothesis::GetType() const
{
-// MESSAGE("SMESHDS_Hypothesis::GetType");
-// SCRUTE(_type);
return _type;
}
+//=============================================================================
+/*!
+ * Equality
+ */
+//=============================================================================
+
+bool SMESHDS_Hypothesis::operator==(const SMESHDS_Hypothesis& other) const
+{
+ if ( this == &other )
+ return true;
+ if ( _name != other._name )
+ return false;
+ ostringstream mySave, otherSave;
+ ((SMESHDS_Hypothesis*)this )->SaveTo(mySave);
+ ((SMESHDS_Hypothesis*)&other)->SaveTo(otherSave);
+ return mySave.str() == otherSave.str();
+}
virtual std::ostream & SaveTo(std::ostream & save)=0;
virtual std::istream & LoadFrom(std::istream & load)=0;
+ virtual bool operator==(const SMESHDS_Hypothesis& other) const;
+ bool operator!=(const SMESHDS_Hypothesis& other) const { return !(*this==other); }
+
enum hypothesis_type {PARAM_ALGO, ALGO_0D, ALGO_1D, ALGO_2D, ALGO_3D};
protected: