X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_Hypotheses.cxx;h=4c3438dc7ace67bbdafdc9abd05a4927f1ca9c6b;hb=4d706076ffe53bf258ba28122770117bd72a48c0;hp=e39b9cd0bd29647ca068e083cfe009c7d319a826;hpb=ac724740a914d5008bc0038a4d3fa6397b6cb87f;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx index e39b9cd0b..4c3438dc7 100644 --- a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx +++ b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx @@ -1,25 +1,24 @@ -// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// SMESH SMESHGUI : GUI for SMESH component // File : SMESHGUI_Hypotheses.cxx // Author : Julia DOROVSKIKH, Open CASCADE S.A.S. // SMESH includes @@ -151,8 +150,10 @@ void SMESHGUI_GenericHypothesisCreator::editHypothesis( SMESH::SMESH_Hypothesis_ Dlg->show(); Dlg->resize( Dlg->minimumSizeHint() ); } - else + else { emit finished( QDialog::Accepted ); + delete myDlg; + } } QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame() @@ -569,7 +570,7 @@ SMESHGUI_HypothesisDlg::SMESHGUI_HypothesisDlg( SMESHGUI_GenericHypothesisCreato myCreator( creator ) { setAttribute(Qt::WA_DeleteOnClose, true); - setMinimumSize( 300, height() ); + // setMinimumSize( 300, height() ); // setFixedSize( 300, height() ); QVBoxLayout* topLayout = new QVBoxLayout( mainFrame() ); topLayout->setMargin( 0 ); @@ -697,7 +698,8 @@ HypothesisData::HypothesisData( const QString& theTypeName, HypothesesSet::HypothesesSet( const QString& theSetName ) : myHypoSetName( theSetName ), - myIsAlgo( false ) + myIsAlgo( false ), + myIsCustom( false ) { } @@ -707,7 +709,8 @@ HypothesesSet::HypothesesSet( const QString& theSetName, : myHypoSetName( theSetName ), myHypoList( theHypoList ), myAlgoList( theAlgoList ), - myIsAlgo( false ) + myIsAlgo( false ), + myIsCustom( false ) { } @@ -761,3 +764,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; +}