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 <SALOMEconfig.h>
32 #include CORBA_SERVER_HEADER(SMESH_Hypothesis)
34 #include <QtxDialog.h>
41 * \brief Auxiliary class for creation of hypotheses
43 class SMESHGUI_GenericHypothesisCreator : public QObject
48 SMESHGUI_GenericHypothesisCreator( const QString& );
49 virtual ~SMESHGUI_GenericHypothesisCreator();
51 void create( const bool isAlgo, QWidget* );
52 void edit( SMESH::SMESH_Hypothesis_ptr, QWidget* );
53 virtual bool checkParams() const = 0;
55 QString hypType() const;
56 bool isCreation() const;
66 typedef QValueList<StdParam> ListOfStdParams;
67 typedef QPtrList<QWidget> ListOfWidgets;
69 SMESH::SMESH_Hypothesis_var hypothesis() const;
70 const ListOfWidgets& widgets() const;
71 ListOfWidgets& changeWidgets();
73 virtual QFrame* buildFrame () = 0;
74 QFrame* buildStdFrame ();
75 virtual void retrieveParams() const = 0;
76 virtual void storeParams () const = 0;
77 virtual bool stdParams ( ListOfStdParams& ) const;
78 bool getStdParamFromDlg( ListOfStdParams& ) const;
79 virtual void attuneStdWidget( QWidget*, const int ) const;
80 virtual QString caption() const;
81 virtual QPixmap icon() const;
82 virtual QString type() const;
85 virtual void onValueChanged();
88 bool editHypothesis( SMESH::SMESH_Hypothesis_ptr, QWidget* );
91 SMESH::SMESH_Hypothesis_var myHypo;
93 ListOfWidgets myParamWidgets;
97 class SMESHGUI_HypothesisDlg : public QtxDialog
102 SMESHGUI_HypothesisDlg( SMESHGUI_GenericHypothesisCreator*, QWidget* );
103 virtual ~SMESHGUI_HypothesisDlg();
105 void setHIcon( const QPixmap& );
106 void setCustomFrame( QFrame* );
107 void setType( const QString& );
110 virtual void accept();
113 SMESHGUI_GenericHypothesisCreator* myCreator;
114 QVBoxLayout* myLayout;
115 QLabel *myIconLabel, *myTypeLabel;
119 * \brief Class containing information about hypothesis
124 HypothesisData( const QString& thePluginName,
125 const QString& theServerLibName,
126 const QString& theClientLibName,
127 const QString& theLabel,
128 const QString& theIconId,
129 const QValueList<int>& theDim,
130 const bool theIsAux )
131 : PluginName( thePluginName ),
132 ServerLibName( theServerLibName ),
133 ClientLibName( theClientLibName ),
140 QString PluginName; //!< plugin name
141 QString ServerLibName; //!< server library name
142 QString ClientLibName; //!< client library name
143 QString Label; //!< label
144 QString IconId; //!< icon identifier
145 QValueList<int> Dim; //!< list of supported dimensions (see SMESH::Dimension enumeration)
146 bool IsAux; //!< TRUE if given hypothesis is auxiliary one, FALSE otherwise
150 * \brief Class containing set of hypotheses
152 * Actually it contains list of hypo types
157 HypothesesSet( const QString& theSetName )
158 : HypoSetName( theSetName ) {};
159 HypothesesSet( const QString& theSetName,
160 const QStringList& theHypoList,
161 const QStringList& theAlgoList )
162 : HypoSetName( theSetName ), HypoList(theHypoList), AlgoList(theAlgoList) {};
164 QStringList HypoList, AlgoList;