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( QString& ) const;
59 virtual void onReject();
60 virtual QString helpPage() const;
62 QString hypType() const;
63 QString hypName() const;
64 bool isCreation() const;
77 typedef QList<StdParam> ListOfStdParams;
78 typedef QList<QWidget*> ListOfWidgets;
80 SMESH::SMESH_Hypothesis_var hypothesis() const;
81 SMESH::SMESH_Hypothesis_var initParamsHypothesis() const;
82 const ListOfWidgets& widgets() const;
83 ListOfWidgets& changeWidgets();
84 QtxDialog* dlg() const;
86 virtual QFrame* buildFrame() = 0;
87 QFrame* buildStdFrame();
88 virtual void retrieveParams() const = 0;
89 virtual QString storeParams() const = 0;
90 virtual bool stdParams( ListOfStdParams& ) const;
91 bool getStdParamFromDlg( ListOfStdParams& ) const;
92 virtual QStringList getVariablesFromDlg() const;
93 static QString stdParamValues( const ListOfStdParams& );
94 virtual void attuneStdWidget( QWidget*, const int ) const;
95 virtual QWidget* getCustomWidget( const StdParam&,
96 QWidget*, const int ) const;
97 virtual bool getParamFromCustomWidget( StdParam&, QWidget* ) const;
98 virtual QString caption() const;
99 virtual QPixmap icon() const;
100 virtual QString type() const;
103 virtual void onValueChanged();
106 virtual void onDialogFinished( int );
109 bool editHypothesis( SMESH::SMESH_Hypothesis_ptr,
110 const QString&, QWidget* );
113 SMESH::SMESH_Hypothesis_var myHypo, myInitParamsHypo;
116 ListOfWidgets myParamWidgets;
119 QEventLoop* myEventLoop;
122 class SMESHGUI_HypothesisDlg : public QtxDialog
127 SMESHGUI_HypothesisDlg( SMESHGUI_GenericHypothesisCreator*, QWidget* );
128 virtual ~SMESHGUI_HypothesisDlg();
130 void setHIcon( const QPixmap& );
131 void setCustomFrame( QFrame* );
132 void setType( const QString& );
135 virtual void accept();
136 virtual void reject();
140 SMESHGUI_GenericHypothesisCreator* myCreator;
143 QString myHelpFileName;
147 * \brief Class containing information about hypothesis
152 HypothesisData( const QString&, const QString&, const QString&,
153 const QString&, const QString&, const QString&,
154 const QList<int>&, const bool,
155 const QStringList&, const QStringList&,
156 const QStringList&, const QStringList&,
157 const bool=true, const bool supportSub=false );
159 QString TypeName; //!< hypothesis type name
160 QString PluginName; //!< plugin name
161 QString ServerLibName; //!< server library name
162 QString ClientLibName; //!< client library name
163 QString Label; //!< label
164 QString IconId; //!< icon identifier
165 QList<int> Dim; //!< list of supported dimensions (see SMESH::Dimension enumeration)
166 bool IsAux; //!< TRUE if given hypothesis is auxiliary one, FALSE otherwise
167 bool IsNeedGeometry; //!< TRUE if the algorithm works with shapes only, FALSE otherwise
168 bool IsSupportSubmeshes; //!< TRUE if the algo building all-dim elems supports submeshes
170 // for algorithm only: dependencies algo <-> algo and algo -> hypos
171 QStringList NeededHypos; //!< list of obligatory hypotheses
172 QStringList OptionalHypos;//!< list of optional hypotheses
173 QStringList InputTypes; //!< list of element types required as a prerequisite
174 QStringList OutputTypes; //!< list of types of generated elements
178 * \brief Class containing set of hypotheses
180 * Actually it contains list of hypo types
185 HypothesesSet( const QString& );
186 HypothesesSet( const QString&, const QStringList&, const QStringList& );
189 QStringList HypoList, AlgoList;
192 #endif // SMESHGUI_HYPOTHESES_H