0020431: EDF 1020 SMESH : Radial Mesh of a cylinder

+  virtual bool operator==(const SMESHDS_Hypothesis& other) const;
+  bool operator!=(const SMESHDS_Hypothesis& other) const { return !(*this==other); }
This commit is contained in:
eap 2010-01-22 11:30:28 +00:00
parent 6462277df0
commit 982b910458
2 changed files with 22 additions and 12 deletions

View File

@ -23,10 +23,11 @@
// File : SMESHDS_Hypothesis.cxx
// Author : Paul RASCLE, EDF
// Module : SMESH
// $Header$
//
#include "SMESHDS_Hypothesis.hxx"
#include <sstream>
using namespace std;
//=============================================================================
@ -37,11 +38,8 @@ using namespace std;
SMESHDS_Hypothesis::SMESHDS_Hypothesis(int hypId)
{
// MESSAGE("SMESHDS_Hypothesis::SMESHDS_Hypothesis");
_hypId = hypId;
_name = "generic";
// SCRUTE(_name);
// SCRUTE(_hypId);
}
//=============================================================================
@ -52,7 +50,6 @@ SMESHDS_Hypothesis::SMESHDS_Hypothesis(int hypId)
SMESHDS_Hypothesis::~SMESHDS_Hypothesis()
{
// MESSAGE("SMESHDS_Hypothesis::~SMESHDS_Hypothesis");
}
//=============================================================================
@ -63,9 +60,6 @@ SMESHDS_Hypothesis::~SMESHDS_Hypothesis()
const char* SMESHDS_Hypothesis::GetName() const
{
// MESSAGE("SMESHDS_Hypothesis::GetName");
// SCRUTE(_name);
// SCRUTE(&_name);
return _name.c_str();
}
@ -77,8 +71,6 @@ const char* SMESHDS_Hypothesis::GetName() const
int SMESHDS_Hypothesis::GetID() const
{
// MESSAGE("SMESHDS_Hypothesis::GetId");
// SCRUTE(_hypId);
return _hypId;
}
@ -90,8 +82,23 @@ int SMESHDS_Hypothesis::GetID() const
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();
}

View File

@ -46,6 +46,9 @@ public:
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: