Salome HOME
0021517: Bad filter dumped when hdf study from previous version of Salome is loaded
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_Hypotheses.h
index 0372b092ff336fa453dc55266a7a148bcc81418d..d2cd29564268f173cebc28efd066700be21354f1 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  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.h
 // Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
@@ -52,7 +53,7 @@ public:
   virtual ~SMESHGUI_GenericHypothesisCreator();
 
   void                         create( SMESH::SMESH_Hypothesis_ptr,
-                                      const QString&, QWidget*, QObject*, const QString& );
+                                       const QString&, QWidget*, QObject*, const QString& );
   void                         create( bool, const QString&, QWidget*, QObject*, const QString& );
   void                         edit( SMESH::SMESH_Hypothesis_ptr, const QString&, QWidget*, QObject*, const QString& );
   void                         setInitParamsHypothesis(SMESH::SMESH_Hypothesis_ptr);
@@ -80,9 +81,11 @@ protected:
     QString   myName;
     QVariant  myValue;
     bool      isVariable;
+    QString   myText;
     StdParam(){
       isVariable = false;
     }
+    const char* text() const { return myText.toLatin1().constData(); }
   };
 
   typedef QList<StdParam>      ListOfStdParams;
@@ -94,6 +97,7 @@ protected:
   const ListOfWidgets&         widgets() const;
   ListOfWidgets&               changeWidgets();
   QtxDialog*                   dlg() const;
+  QString                      getVariableName(const char* methodName) const;
 
   virtual QFrame*              buildFrame() = 0;
           QFrame*              buildStdFrame();
@@ -105,7 +109,7 @@ protected:
   static  QString              stdParamValues( const ListOfStdParams& );
   virtual void                 attuneStdWidget( QWidget*, const int ) const;
   virtual QWidget*             getCustomWidget( const StdParam&, 
-                                               QWidget*, const int ) const;
+                                                QWidget*, const int ) const;
   virtual bool                 getParamFromCustomWidget( StdParam&, QWidget* ) const;
   virtual void                 valueChanged( QWidget* );
   virtual QString              caption() const;
@@ -166,7 +170,7 @@ public:
                   const QList<int>&, const bool,
                   const QStringList&, const QStringList&,
                   const QStringList&, const QStringList&,
-                 const bool=true, const bool supportSub=false );
+                  const bool=true, const bool supportSub=false );
 
   QString TypeName;        //!< hypothesis type name
   QString PluginName;      //!< plugin name
@@ -201,6 +205,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()
@@ -215,9 +223,9 @@ private:
   QStringList* list() const;
 
 private:
-  bool myIsAlgo;
   QString     myHypoSetName;
   QStringList myHypoList, myAlgoList;
+  bool myIsAlgo, myIsCustom;
   int myIndex;
 };