Salome HOME
Merge from V6_main (04/10/2012)
[modules/med.git] / src / MEDOP / gui / XmedDataModel.hxx
1 #ifndef _XMEDDATAMODEL_H_
2 #define _XMEDDATAMODEL_H_
3
4 #include <SALOMEconfig.h>
5 #include CORBA_CLIENT_HEADER(MEDDataManager)
6
7 #include "MEDOPGUI.hxx"
8
9 //
10 // =================================================================
11 // Definition of an atom in the data model as an implementation of
12 // the virtual class DataObject
13 // =================================================================
14 //
15 #include "DataObject.hxx"
16 class MEDOPGUI_EXPORT XmedDataObject: public DataObject {
17 public:
18   XmedDataObject();
19   virtual string getPath();
20
21   void setFieldHandler(MEDOP::FieldHandler fieldHandler);
22   MEDOP::FieldHandler * getFieldHandler();
23
24   static const int NB_TYPE_OF_FIELDS = 4;
25   static const char *  mapTypeOfFieldLabel[NB_TYPE_OF_FIELDS];
26
27 private:
28   MEDOP::FieldHandler _fieldHandler;
29   string _getTypedFieldLabel();
30 };
31
32 //
33 // =================================================================
34 // Definition of the data model as an implementation of the virtual
35 // class DataModel. It implements the DataObject factory.
36 // =================================================================
37 //
38 #include "DataModel.hxx"
39 class MEDOPGUI_EXPORT XmedDataModel: public DataModel {
40 public:
41   XmedDataModel():DataModel() {};
42   virtual DataObject * newDataObject();
43 };
44
45 //
46 // =================================================================
47 // Base class for data processing
48 // =================================================================
49 // Howto use it? 
50 //
51 // 1) Create an instance, call the "process" function,
52 // then get the result you are interested in, using the corresponding
53 // "result*" function.
54 //
55 // 2) Alternativly, you can just call directly the suitable master
56 // "get*" function to process and get the result you are interested
57 // in.
58 //
59 #include "DataProcessor.hxx"
60
61 class MEDOPGUI_EXPORT XmedDataProcessor : public DataProcessor {
62 public:
63   XmedDataProcessor(DataModel * dataModel):DataProcessor(dataModel) {};
64
65   MEDOP::FieldHandlerList * getResultingFieldHandlerList();
66   MEDOP::FieldIdList * getResultingFieldIdList();
67
68 protected:
69   virtual void preprocess(QStringList itemNameIdList);
70   virtual void processDataObject(DataObject * dataObject);
71
72 private:
73   MEDOP::FieldHandlerList_var _resultingFieldHandlerList;
74   MEDOP::FieldIdList_var _resultingFieldIdList;
75   int _objectIndex;
76
77 };
78
79
80 #endif // _XMEDDATAMODEL_H_