+class QEventLoop;
+
+/*!
+ * \brief Auxiliary class for creation of hypotheses
+*/
+class SMESHGUI_EXPORT SMESHGUI_GenericHypothesisCreator : public QObject
+{
+ Q_OBJECT
+
+public:
+ SMESHGUI_GenericHypothesisCreator( const QString& );
+ virtual ~SMESHGUI_GenericHypothesisCreator();
+
+ void create( SMESH::SMESH_Hypothesis_ptr,
+ 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);
+
+ virtual bool checkParams( QString& ) const;
+ virtual void onReject();
+ virtual QString helpPage() const;
+
+ QString hypType() const;
+ QString hypName() const;
+ bool isCreation() const;
+
+ QString getShapeEntry() const { return myShapeEntry; }
+ void setShapeEntry( const QString& theEntry );
+
+ QString getMainShapeEntry() const { return myMainShapeEntry; }
+ void setMainShapeEntry( const QString& theEntry ) { myMainShapeEntry = theEntry; }
+
+signals:
+ void finished( int );
+
+protected:
+ struct StdParam
+ {
+ QString myName;
+ QVariant myValue;
+ bool isVariable;
+ QString myText;
+ QByteArray myTextAsBytes;
+ StdParam() {
+ isVariable = false;
+ }
+ const char* text() const {
+ ((QByteArray&) myTextAsBytes) = myText.toLatin1(); return myTextAsBytes.constData();
+ }
+ };
+
+ typedef QList<StdParam> ListOfStdParams;
+ typedef QList<QWidget*> ListOfWidgets;
+
+ SMESH::SMESH_Hypothesis_var hypothesis() const;
+ SMESH::SMESH_Hypothesis_var initParamsHypothesis(const bool strict=false) const;
+ bool hasInitParamsHypothesis() const;
+ const ListOfWidgets& widgets() const;
+ ListOfWidgets& changeWidgets();
+ QtxDialog* dlg() const;
+ QString getVariableName(const char* methodName) const;
+
+ virtual QFrame* buildFrame() = 0;
+ QFrame* buildStdFrame();
+ virtual void retrieveParams() const = 0;
+ virtual QString storeParams() const = 0;
+ virtual bool stdParams( ListOfStdParams& ) const;
+ bool getStdParamFromDlg( ListOfStdParams& ) const;
+ virtual QStringList getVariablesFromDlg() const;
+ static QString stdParamValues( const ListOfStdParams& );
+ virtual void attuneStdWidget( QWidget*, const int ) const;
+ virtual QWidget* getCustomWidget( const StdParam&,
+ QWidget*, const int ) const;
+ virtual bool getParamFromCustomWidget( StdParam&, QWidget* ) const;
+ virtual void valueChanged( QWidget* );
+ virtual QString caption() const;
+ virtual QPixmap icon() const;
+ virtual QString type() const;
+
+protected slots:
+ virtual void onValueChanged();
+
+private slots:
+ virtual void onDialogFinished( int );