Salome HOME
This commit was generated by cvs2git to track changes on a CVS vendor
[modules/visu.git] / src / VISU_I / VISU_Table_i.hh
1 // File:        VISU_Table_i.hh
2 // Created:     Thu Feb 13 17:24:49 2003
3 // Author:      Vadim SANDLER
4 //              <vsr@rolex.nnov.matra-dtv.fr>
5
6 #ifndef VISU_Table_i_HeaderFile
7 #define VISU_Table_i_HeaderFile
8
9 #include "VISU_PrsObject_i.hh"
10 #include <qstringlist.h>
11 #include "Plot2d_Curve.h"
12
13 namespace VISU{
14   //==============================================================================
15   class Table_i : public virtual POA_VISU::Table,
16                   public virtual PrsObject_i
17   {
18     static int myNbPresent;
19     Table_i();
20     Table_i( const Table_i& );
21   public:
22     Table_i( SALOMEDS::Study_ptr theStudy, const char* theObject );
23     virtual ~Table_i();
24     virtual VISU::VISUType GetType() { return VISU::TTABLE;};
25
26     virtual void SetTitle( const char* theName ) { myTitle = theName; }
27     virtual char* GetTitle() { return CORBA::string_dup( myTitle.c_str() ); }
28
29     virtual void SetOrientation( VISU::Table::Orientation theOrientation ) { myOrientation = theOrientation; }
30     virtual VISU::Table::Orientation GetOrientation() { return myOrientation; }
31
32     virtual CORBA::Long GetNbRows();
33     virtual CORBA::Long GetNbColumns();
34
35   protected:
36     Storable* Build(int theRestoring);
37
38   protected:
39     VISU::Table::Orientation myOrientation;
40     string myTitle;
41     string myObjectEntry;
42
43   public:
44     virtual Storable* Create();
45     virtual Storable* Restore( const Storable::TRestoringMap& theMap )
46       throw(std::logic_error&);
47     virtual void ToStream( ostrstream& theStr );
48     static const string myComment;
49     virtual const char* GetComment() const;
50     virtual const char* GenerateName();
51
52     virtual char* GetObjectEntry() { return CORBA::string_dup( myObjectEntry.c_str() ); }
53   };
54   Storable* TableRestore(SALOMEDS::SObject_ptr theSObject, 
55                          const string& thePrefix, const Storable::TRestoringMap& theMap);
56   SALOMEDS::SObject_var ImportTables(const char* theFileName, SALOMEDS::Study_ptr theStudy);
57
58   //==============================================================================
59   class Curve_i : public virtual POA_VISU::Curve,
60                   public virtual PrsObject_i
61   {
62     static int myNbPresent;
63     Curve_i();
64     Curve_i( const Curve_i& );
65   public:
66     Curve_i( SALOMEDS::Study_ptr theStudy, Table_i* theTable, CORBA::Long theHRow, CORBA::Long theVRow );
67     virtual ~Curve_i();
68     virtual VISU::VISUType GetType() { return VISU::TCURVE;};
69
70     virtual void SetTitle( const char* theName ) { myTitle = theName; myAuto = false; }
71     virtual char* GetTitle() { return CORBA::string_dup( myTitle.c_str() ); }
72
73     virtual void SetColor( const SALOMEDS::Color& theColor ) { myColor = theColor; myAuto = false; }
74     virtual SALOMEDS::Color GetColor() { return myColor; }
75     
76     virtual void SetMarker( VISU::Curve::MarkerType theType ) { myMarker = theType; myAuto = false; }
77     virtual VISU::Curve::MarkerType GetMarker() { return myMarker; }
78
79     virtual void SetLine( VISU::Curve::LineType theType, CORBA::Long theWidth ) 
80                                                 { myLine = theType; myLineWidth = theWidth; myAuto = false; }
81     virtual VISU::Curve::LineType GetLine() { return myLine; }
82     virtual CORBA::Long GetLineWidth() { return myLineWidth; }
83
84   protected:
85     Storable* Build(int theRestoring);
86
87   protected:
88     Table_i*                myTable;
89     int                     myHRow;
90     int                     myVRow;
91     struct SALOMEDS::Color  myColor;
92     VISU::Curve::MarkerType myMarker;
93     VISU::Curve::LineType   myLine;
94     int                     myLineWidth;
95     string                  myTitle;
96     bool                    myAuto;
97
98   public:
99     virtual Storable* Create();
100     virtual Storable* Restore( const Storable::TRestoringMap& theMap )
101       throw(std::logic_error&);
102     virtual void ToStream( ostrstream& theStr );
103     static const string myComment;
104     virtual const char* GetComment() const;
105     virtual const char* GenerateName();
106     virtual const char* GetTableID();
107
108     virtual CORBA::Boolean IsAuto() { return myAuto; }
109     virtual CORBA::Boolean IsValid();
110     virtual string GetHorTitle();
111     virtual string GetVerTitle();
112     virtual string GetHorUnits();
113     virtual string GetVerUnits();
114     virtual int    GetData( double*& theHorList, double*& theVerList );
115
116     virtual Plot2d_Curve* CreatePresentation();
117   };
118   Storable* CurveRestore(SALOMEDS::SObject_ptr theSObject, 
119                          const string& thePrefix, const Storable::TRestoringMap& theMap);
120
121   //==============================================================================
122   class Container_i : public virtual POA_VISU::Container,
123                       public virtual PrsObject_i
124   {
125     static int myNbPresent;
126     Container_i();
127     Container_i( const Container_i& );
128   public:
129     Container_i(SALOMEDS::Study_ptr theStudy);
130     virtual ~Container_i();
131     virtual VISU::VISUType GetType() { return VISU::TCONTAINER;};
132
133     virtual void AddCurve( Curve_ptr theCurve );
134     virtual void RemoveCurve( Curve_ptr theCurve );
135
136     virtual CORBA::Long GetNbCurves();
137     virtual void Clear();
138
139   protected:
140     Storable* Build(int theRestoring);
141     
142   protected:
143     QStringList myCurves;
144     
145   public:
146     virtual Storable* Create();
147     virtual Storable* Restore( const Storable::TRestoringMap& theMap )
148       throw(std::logic_error&);
149     virtual void ToStream( ostrstream& theStr );
150     static const string myComment;
151     virtual const char* GetComment() const;
152     virtual const char* GenerateName();
153
154     void Update();
155     VISU::Curve_i* GetCurve( CORBA::Long theIndex );
156
157   };
158   Storable* ContainerRestore(SALOMEDS::SObject_ptr theSObject, 
159                              const string& thePrefix, const Storable::TRestoringMap& theMap);
160 }
161 #endif // (#ifndef VISU_Table_i_HeaderFile)
162
163