mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-26 09:20:34 +05:00
make GetNumberOfSegments and GetScaleFactor const
This commit is contained in:
parent
5b889e3e3e
commit
0273fe09c6
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user