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.org
23 // File : SMESHGUI_Hypotheses.h
24 // Author : Julia DOROVSKIKH
28 #ifndef SMESHGUI_Hypotheses_HeaderFile
29 #define SMESHGUI_Hypotheses_HeaderFile
31 #include "SMESH_SMESHGUI.hxx"
33 #include <SALOMEconfig.h>
34 #include CORBA_SERVER_HEADER(SMESH_Hypothesis)
36 #include <QtxDialog.h>
43 * \brief Auxiliary class for creation of hypotheses
45 class SMESHGUI_EXPORT SMESHGUI_GenericHypothesisCreator : public QObject
50 SMESHGUI_GenericHypothesisCreator( const QString& );
51 virtual ~SMESHGUI_GenericHypothesisCreator();
53 void create( const bool isAlgo, QWidget* );
54 void edit( SMESH::SMESH_Hypothesis_ptr, QWidget* );
55 void create( SMESH::SMESH_Hypothesis_ptr, QWidget* );
56 virtual bool checkParams() const = 0;
58 QString hypType() const;
59 bool isCreation() const;
69 typedef QValueList<StdParam> ListOfStdParams;
70 typedef QPtrList<QWidget> ListOfWidgets;
72 SMESH::SMESH_Hypothesis_var hypothesis() const;
73 SMESH::SMESH_Hypothesis_var initParamsHypothesis() const;
74 const ListOfWidgets& widgets() const;
75 ListOfWidgets& changeWidgets();
77 virtual QFrame* buildFrame () = 0;
78 QFrame* buildStdFrame ();
79 virtual void retrieveParams() const = 0;
80 virtual QString storeParams () const = 0;
81 virtual bool stdParams ( ListOfStdParams& ) const;
82 bool getStdParamFromDlg( ListOfStdParams& ) const;
83 static QString stdParamValues( const ListOfStdParams& );
84 virtual void attuneStdWidget( QWidget*, const int ) const;
85 virtual QWidget* getCustomWidget( const StdParam &, QWidget* ) const;
86 virtual bool getParamFromCustomWidget( StdParam& , QWidget* ) const;
87 virtual QString caption() const;
88 virtual QPixmap icon() const;
89 virtual QString type() const;
92 virtual void onValueChanged();
95 bool editHypothesis( SMESH::SMESH_Hypothesis_ptr, QWidget* );
98 SMESH::SMESH_Hypothesis_var myHypo, myInitParamsHypo;
100 ListOfWidgets myParamWidgets;
104 class SMESHGUI_HypothesisDlg : public QtxDialog
109 SMESHGUI_HypothesisDlg( SMESHGUI_GenericHypothesisCreator*, QWidget* );
110 virtual ~SMESHGUI_HypothesisDlg();
112 void setHIcon( const QPixmap& );
113 void setCustomFrame( QFrame* );
114 void setType( const QString& );
117 virtual void accept();
120 SMESHGUI_GenericHypothesisCreator* myCreator;
121 QVBoxLayout* myLayout;
122 QLabel *myIconLabel, *myTypeLabel;
126 * \brief Class containing information about hypothesis
131 HypothesisData( const QString& thePluginName,
132 const QString& theServerLibName,
133 const QString& theClientLibName,
134 const QString& theLabel,
135 const QString& theIconId,
136 const QValueList<int>& theDim,
137 const bool theIsAux )
138 : PluginName( thePluginName ),
139 ServerLibName( theServerLibName ),
140 ClientLibName( theClientLibName ),
147 QString PluginName; //!< plugin name
148 QString ServerLibName; //!< server library name
149 QString ClientLibName; //!< client library name
150 QString Label; //!< label
151 QString IconId; //!< icon identifier
152 QValueList<int> Dim; //!< list of supported dimensions (see SMESH::Dimension enumeration)
153 bool IsAux; //!< TRUE if given hypothesis is auxiliary one, FALSE otherwise
157 * \brief Class containing set of hypotheses
159 * Actually it contains list of hypo types
164 HypothesesSet( const QString& theSetName )
165 : HypoSetName( theSetName ) {};
166 HypothesesSet( const QString& theSetName,
167 const QStringList& theHypoList,
168 const QStringList& theAlgoList )
169 : HypoSetName( theSetName ), HypoList(theHypoList), AlgoList(theAlgoList) {};
171 QStringList HypoList, AlgoList;