1 // SMESH SMESHGUI : GUI for SMESH component
3 // Copyright (C) 2003 CEA
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License.
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 // File : SMESHGUI_Hypotheses.h
22 // Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
25 #ifndef SMESHGUI_HYPOTHESES_H
26 #define SMESHGUI_HYPOTHESES_H
29 #include "SMESH_SMESHGUI.hxx"
32 #include <QtxDialog.h>
36 #include <SALOMEconfig.h>
37 #include CORBA_SERVER_HEADER(SMESH_Hypothesis)
42 * \brief Auxiliary class for creation of hypotheses
44 class SMESHGUI_EXPORT SMESHGUI_GenericHypothesisCreator : public QObject
49 SMESHGUI_GenericHypothesisCreator( const QString& );
50 virtual ~SMESHGUI_GenericHypothesisCreator();
52 void create( SMESH::SMESH_Hypothesis_ptr,
53 const QString&, QWidget* );
54 void create( bool, const QString&, QWidget* );
55 void edit( SMESH::SMESH_Hypothesis_ptr,
56 const QString&, QWidget* );
58 virtual bool checkParams() const = 0;
59 virtual void onReject();
61 QString hypType() const;
62 QString hypName() const;
63 bool isCreation() const;
73 typedef QList<StdParam> ListOfStdParams;
74 typedef QList<QWidget*> ListOfWidgets;
76 SMESH::SMESH_Hypothesis_var hypothesis() const;
77 SMESH::SMESH_Hypothesis_var initParamsHypothesis() const;
78 const ListOfWidgets& widgets() const;
79 ListOfWidgets& changeWidgets();
80 QtxDialog* dlg() const;
82 virtual QFrame* buildFrame() = 0;
83 QFrame* buildStdFrame();
84 virtual void retrieveParams() const = 0;
85 virtual QString storeParams() const = 0;
86 virtual bool stdParams( ListOfStdParams& ) const;
87 bool getStdParamFromDlg( ListOfStdParams& ) const;
88 static QString stdParamValues( const ListOfStdParams& );
89 virtual void attuneStdWidget( QWidget*, const int ) const;
90 virtual QWidget* getCustomWidget( const StdParam&,
91 QWidget*, const int ) const;
92 virtual bool getParamFromCustomWidget( StdParam&, QWidget* ) const;
93 virtual QString caption() const;
94 virtual QPixmap icon() const;
95 virtual QString type() const;
98 virtual void onValueChanged();
101 virtual void onDialogFinished( int );
104 bool editHypothesis( SMESH::SMESH_Hypothesis_ptr,
105 const QString&, QWidget* );
108 SMESH::SMESH_Hypothesis_var myHypo, myInitParamsHypo;
111 ListOfWidgets myParamWidgets;
114 QEventLoop* myEventLoop;
117 class SMESHGUI_HypothesisDlg : public QtxDialog
122 SMESHGUI_HypothesisDlg( SMESHGUI_GenericHypothesisCreator*, QWidget* );
123 virtual ~SMESHGUI_HypothesisDlg();
125 void setHIcon( const QPixmap& );
126 void setCustomFrame( QFrame* );
127 void setType( const QString& );
130 virtual void accept();
131 virtual void reject();
135 SMESHGUI_GenericHypothesisCreator* myCreator;
138 QString myHelpFileName;
142 * \brief Class containing information about hypothesis
147 HypothesisData( const QString&, const QString&, const QString&,
148 const QString&, const QString&, const QString&,
149 const QList<int>&, const bool,
150 const QStringList&, const QStringList&,
151 const QStringList&, const QStringList&,
154 QString TypeName; //!< hypothesis type name
155 QString PluginName; //!< plugin name
156 QString ServerLibName; //!< server library name
157 QString ClientLibName; //!< client library name
158 QString Label; //!< label
159 QString IconId; //!< icon identifier
160 QList<int> Dim; //!< list of supported dimensions (see SMESH::Dimension enumeration)
161 bool IsAux; //!< TRUE if given hypothesis is auxiliary one, FALSE otherwise
162 bool IsNeedGeometry; //!< TRUE if for given hypothesis need shape, FALSE otherwise
164 // for algorithm only: dependencies algo <-> algo and algo -> hypos
165 QStringList NeededHypos; //!< list of obligatory hypotheses
166 QStringList OptionalHypos;//!< list of optional hypotheses
167 QStringList InputTypes; //!< list of element types required as a prerequisite
168 QStringList OutputTypes; //!< list of types of generated elements
172 * \brief Class containing set of hypotheses
174 * Actually it contains list of hypo types
179 HypothesesSet( const QString& );
180 HypothesesSet( const QString&, const QStringList&, const QStringList& );
183 QStringList HypoList, AlgoList;
186 #endif // SMESHGUI_HYPOTHESES_H