make GetNumberOfSegments and GetScaleFactor const

This commit is contained in:
jrt 2003-09-04 09:13:24 +00:00
parent 5b889e3e3e
commit 0273fe09c6
2 changed files with 38 additions and 37 deletions

View File

@ -26,7 +26,6 @@
// Module : SMESH
// $Header$
using namespace std;
using namespace std;
#include "SMESH_NumberOfSegments.hxx"
@ -36,8 +35,8 @@ using namespace std;
*/
//=============================================================================
SMESH_NumberOfSegments::SMESH_NumberOfSegments(int hypId, int studyId, SMESH_Gen* gen)
: SMESH_Hypothesis(hypId, studyId, gen)
SMESH_NumberOfSegments::SMESH_NumberOfSegments(int hypId, int studyId,
SMESH_Gen * gen):SMESH_Hypothesis(hypId, studyId, gen)
{
_numberOfSegments = 1;
_scaleFactor = 1.0;
@ -65,7 +64,8 @@ void SMESH_NumberOfSegments::SetNumberOfSegments(int segmentsNumber)
{
int oldNumberOfSegments = _numberOfSegments;
if (segmentsNumber <= 0)
throw SALOME_Exception(LOCALIZED("number of segments must be positive"));
throw
SALOME_Exception(LOCALIZED("number of segments must be positive"));
_numberOfSegments = segmentsNumber;
if (oldNumberOfSegments != _numberOfSegments)
@ -78,7 +78,7 @@ void SMESH_NumberOfSegments::SetNumberOfSegments(int segmentsNumber)
*/
//=============================================================================
int SMESH_NumberOfSegments::GetNumberOfSegments()
int SMESH_NumberOfSegments::GetNumberOfSegments() const
{
return _numberOfSegments;
}
@ -105,7 +105,7 @@ void SMESH_NumberOfSegments::SetScaleFactor(double scaleFactor)
*/
//=============================================================================
double SMESH_NumberOfSegments::GetScaleFactor()
double SMESH_NumberOfSegments::GetScaleFactor() const
{
return _scaleFactor;
}
@ -155,8 +155,9 @@ istream& operator >> (istream & load, SMESH_NumberOfSegments & hyp)
bool isOK = true;
int a;
isOK = (load >> a);
if (isOK) hyp._numberOfSegments = a;
else load.clear(ios::badbit | load.rdstate());
if (isOK)
hyp._numberOfSegments = a;
else
load.clear(ios::badbit | load.rdstate());
return load;
}

View File

@ -42,12 +42,12 @@ public:
void SetNumberOfSegments(int segmentsNumber)
throw (SALOME_Exception);
int GetNumberOfSegments();
int GetNumberOfSegments() const;
void SetScaleFactor(double scaleFactor)
throw (SALOME_Exception);
double GetScaleFactor();
double GetScaleFactor() const;
virtual ostream & SaveTo(ostream & save);
virtual istream & LoadFrom(istream & load);