0021197: EDF 1772 SMESH: Automatic meshing hypothesis

class HypothesesSet
{
+  void setIsCustom( bool );
+  bool getIsCustom() const;
+  int maxDim() const;
This commit is contained in:
eap 2011-03-11 13:14:52 +00:00
parent 570cb9161c
commit 9296d2af7b
2 changed files with 34 additions and 3 deletions

View File

@ -697,7 +697,8 @@ HypothesisData::HypothesisData( const QString& theTypeName,
HypothesesSet::HypothesesSet( const QString& theSetName )
: myHypoSetName( theSetName ),
myIsAlgo( false )
myIsAlgo( false ),
myIsCustom( false )
{
}
@ -707,7 +708,8 @@ HypothesesSet::HypothesesSet( const QString& theSetName,
: myHypoSetName( theSetName ),
myHypoList( theHypoList ),
myAlgoList( theAlgoList ),
myIsAlgo( false )
myIsAlgo( false ),
myIsCustom( false )
{
}
@ -761,3 +763,28 @@ QString HypothesesSet::current() const
{
return list()->at(myIndex);
}
void HypothesesSet::setIsCustom( bool isCustom )
{
myIsCustom = isCustom;
}
bool HypothesesSet::getIsCustom() const
{
return myIsCustom;
}
int HypothesesSet::maxDim() const
{
HypothesesSet * thisSet = (HypothesesSet*) this;
int dim = -1;
for ( int isAlgo = 0; isAlgo < 2; ++isAlgo )
{
thisSet->init( isAlgo );
while ( thisSet->next(), thisSet->more() )
if ( HypothesisData* hypData = SMESH::GetHypothesisData( thisSet->current() ))
for ( int i = 0; i < hypData->Dim.count(); ++i )
dim = qMax( dim, hypData->Dim[i] );
}
return dim;
}

View File

@ -202,6 +202,10 @@ public:
void set( bool, const QStringList& );
int count( bool ) const;
void setIsCustom( bool );
bool getIsCustom() const;
int maxDim() const;
bool isAlgo() const;
//this method sets internal index to -1, thus before any data access it is necessary to call next()
@ -216,9 +220,9 @@ private:
QStringList* list() const;
private:
bool myIsAlgo;
QString myHypoSetName;
QStringList myHypoList, myAlgoList;
bool myIsAlgo, myIsCustom;
int myIndex;
};