Salome HOME
Copyright update 2020
[modules/yacs.git] / src / ydfx_gui / YDFXGUIWrap.hxx
1 // Copyright (C) 2016-2020  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author : Anthony Geay (EDF R&D)
20
21 #ifndef __YDFXGUIWRAP_HXX__
22 #define __YDFXGUIWRAP_HXX__
23
24 #include "ydfxwidgetsExport.hxx"
25
26 #include <QObject>
27
28 class YACSEvalYFX;
29 class YACSEvalSession;
30 class YACSEvalObserver;
31 class YACSEvalInputPort;
32 class YACSEvalExecParams;
33 class YACSEvalOutputPort;
34 class YACSEvalListOfResources;
35
36 class YACSEvalYFXWrap : public QObject
37 {
38   Q_OBJECT
39 public:
40   YDFXWIDGETS_EXPORT YACSEvalYFXWrap(YACSEvalYFX *efx):_efx(efx),_isSeqOfValsSet(false),_isRunning(false) { }
41   YDFXWIDGETS_EXPORT YACSEvalYFXWrap(const YACSEvalYFXWrap& other):_efx(other._efx) { }
42   YDFXWIDGETS_EXPORT std::vector< YACSEvalInputPort * > getFreeInputPorts() const;
43   YDFXWIDGETS_EXPORT std::vector< YACSEvalOutputPort * > getFreeOutputPorts() const;
44   YDFXWIDGETS_EXPORT YACSEvalExecParams *getParams() const;
45   YDFXWIDGETS_EXPORT bool isLocked() const;
46   YDFXWIDGETS_EXPORT void unlockAll();
47   YDFXWIDGETS_EXPORT YACSEvalListOfResources *giveResources();
48   YDFXWIDGETS_EXPORT bool run(YACSEvalSession *session, int& nbOfBranches);
49   YDFXWIDGETS_EXPORT void registerObserver(YACSEvalObserver *observer);
50   YDFXWIDGETS_EXPORT ~YACSEvalYFXWrap();
51 public:// modified API
52   YDFXWIDGETS_EXPORT void lockPortsForEvaluation();
53   YDFXWIDGETS_EXPORT int getNbOfItems() const;
54 public:
55   YDFXWIDGETS_EXPORT void setRunningStatus(bool status);
56   YDFXWIDGETS_EXPORT bool isRunning() const { return _isRunning; }
57   YDFXWIDGETS_EXPORT void updateSequencesStatus();
58   YDFXWIDGETS_EXPORT bool computeSequencesStatus(int& nbOfVals);
59 signals:
60   void lockSignal(bool);
61   void sequencesAreSetSignal(bool);
62   void runSignal(bool);
63 private:
64   YACSEvalYFX *_efx;
65   bool _isSeqOfValsSet;
66   bool _isRunning;
67 };
68
69 #endif