Salome HOME
NRI : Merge from V1_2.
[modules/visu.git] / src / VISU_I / VISU_Result_i.hh
1 //  Copyright (C) 2003  CEA/DEN, EDF R&D
2 //
3 //
4 //
5 //  File   : VISU_Result_i.hh
6 //  Author : Alexey PETROV
7 //  Module : VISU
8
9 #ifndef __VISU_RESULT_I_H__
10 #define __VISU_RESULT_I_H__
11
12 #include "VISUConfig.hh"
13
14 class vtkUnstructuredGridReader;
15 class vtkUnstructuredGrid;
16 class VISU_Convertor;
17 class FieldInfo;
18 class QAD_Study;
19
20 namespace VISU{
21   class Result_i : public virtual POA_VISU::Result,
22                    public virtual Storable
23   {
24     Result_i();
25     Result_i(const Result_i &);
26   public:
27     Result_i(SALOMEDS::Study_ptr theStudy);
28     virtual ~Result_i();
29
30     virtual VISU::VISUType GetType() { return VISU::TRESULT;};
31
32     typedef VISU_Convertor InputType;
33     typedef vtkUnstructuredGridReader OutputType;
34   private:
35     InputType *myInput;
36     string myName;
37     QFileInfo myFileInfo;
38     int myIsRestored;
39   protected:
40     virtual Storable* Build();
41   public:
42     virtual Storable* Create(const char* theFileName);
43     virtual Storable* Create(SALOMEDS::SObject_ptr theMedSObject);
44     virtual Storable* Create(SALOME_MED::FIELD_ptr theField);
45     virtual Storable* Restore(SALOMEDS::SObject_ptr theSObject, 
46                               const string& thePrefix, const Storable::TRestoringMap& theMap)
47       throw(std::logic_error&);
48     virtual void ToStream(std::ostringstream& theStr);
49     virtual const char* GetComment() const;
50     static const string myComment;
51     InputType* GetInput() { return myInput;}
52     const char* GetName() const { return myName.c_str();}
53     const QFileInfo& GetFileInfo() const { return myFileInfo;}
54     int IsRestored() const { return myIsRestored;}
55   private:
56     SALOMEDS::SObject_var mySObject;
57     SALOMEDS::Study_var myStudyDocument;
58     SALOMEDS::SComponent_var mySComponent;
59   public:
60     string GetRefFatherEntry();
61     string GetEntry();
62     const SALOMEDS::SObject_var& GetSObject() const;
63     const SALOMEDS::Study_var& GetStudyDocument() const;
64     const SALOMEDS::SComponent_var& GetSComponent() const;
65   };
66   Storable* ResultRestore(SALOMEDS::SObject_ptr theSObject, 
67                            const string& thePrefix, const Storable::TRestoringMap& theMap)
68     throw(std::logic_error&);
69   Result_var FindResult(SALOMEDS::SObject_ptr theSObject);
70   QString GenerateName(const string& theFmt, int theId);
71   void WriteToFile(vtkUnstructuredGrid* theDataSet, const string& theFileName);
72 }
73 #endif