1 // Copyright (C) 2003 CEA/DEN, EDF R&D
5 // File : VISU_Table_i.hh
6 // Author : Vadim SANDLER
9 #ifndef VISU_Table_i_HeaderFile
10 #define VISU_Table_i_HeaderFile
12 #include "VISU_PrsObject_i.hh"
13 #include <qstringlist.h>
14 #include "Plot2d_Curve.h"
17 //==============================================================================
18 class Table_i : public virtual POA_VISU::Table,
19 public virtual PrsObject_i
21 static int myNbPresent;
23 Table_i( const Table_i& );
25 Table_i( SALOMEDS::Study_ptr theStudy, const char* theObject );
27 virtual VISU::VISUType GetType() { return VISU::TTABLE;};
29 virtual void SetTitle( const char* theName ) { SetName( theName ); }
30 virtual char* GetTitle() { return CORBA::string_dup( GetName() ); }
32 virtual void SetOrientation( VISU::Table::Orientation theOrientation ) { myOrientation = theOrientation; }
33 virtual VISU::Table::Orientation GetOrientation() { return myOrientation; }
35 virtual CORBA::Long GetNbRows();
36 virtual CORBA::Long GetNbColumns();
39 Storable* Build(int theRestoring);
42 VISU::Table::Orientation myOrientation;
47 virtual Storable* Create();
48 virtual Storable* Restore( const Storable::TRestoringMap& theMap )
49 throw(std::logic_error&);
50 virtual void ToStream( std::ostringstream& theStr );
51 static const string myComment;
52 virtual const char* GetComment() const;
53 virtual const char* GenerateName();
54 virtual const char* GetTableTitle();
56 virtual char* GetObjectEntry() { return CORBA::string_dup( myObjectEntry.c_str() ); }
58 Storable* TableRestore(SALOMEDS::SObject_ptr theSObject,
59 const string& thePrefix, const Storable::TRestoringMap& theMap);
60 SALOMEDS::SObject_var ImportTables(const char* theFileName, SALOMEDS::Study_ptr theStudy);
62 //==============================================================================
63 class Curve_i : public virtual POA_VISU::Curve,
64 public virtual PrsObject_i
66 static int myNbPresent;
68 Curve_i( const Curve_i& );
70 Curve_i( SALOMEDS::Study_ptr theStudy, Table_i* theTable, CORBA::Long theHRow, CORBA::Long theVRow );
72 virtual VISU::VISUType GetType() { return VISU::TCURVE;};
74 virtual void SetTitle( const char* theName ) { SetName( theName ); }
75 virtual char* GetTitle() { return CORBA::string_dup( GetName() ); }
77 virtual void SetColor( const SALOMEDS::Color& theColor ) { myColor = theColor; myAuto = false; }
78 virtual SALOMEDS::Color GetColor() { return myColor; }
80 virtual void SetMarker( VISU::Curve::MarkerType theType ) { myMarker = theType; myAuto = false; }
81 virtual VISU::Curve::MarkerType GetMarker() { return myMarker; }
83 virtual void SetLine( VISU::Curve::LineType theType, CORBA::Long theWidth )
84 { myLine = theType; myLineWidth = theWidth; myAuto = false; }
85 virtual VISU::Curve::LineType GetLine() { return myLine; }
86 virtual CORBA::Long GetLineWidth() { return myLineWidth; }
89 Storable* Build(int theRestoring);
95 struct SALOMEDS::Color myColor;
96 VISU::Curve::MarkerType myMarker;
97 VISU::Curve::LineType myLine;
103 virtual Storable* Create();
104 virtual Storable* Restore( const Storable::TRestoringMap& theMap )
105 throw(std::logic_error&);
106 virtual void ToStream( std::ostringstream& theStr );
107 static const string myComment;
108 virtual const char* GetComment() const;
109 virtual const char* GenerateName();
110 virtual const char* GetTableID();
112 virtual CORBA::Boolean IsAuto() { return myAuto; }
113 virtual CORBA::Boolean IsValid();
114 virtual string GetHorTitle();
115 virtual string GetVerTitle();
116 virtual string GetHorUnits();
117 virtual string GetVerUnits();
118 virtual int GetData( double*& theHorList, double*& theVerList );
120 virtual Plot2d_Curve* CreatePresentation();
122 Storable* CurveRestore(SALOMEDS::SObject_ptr theSObject,
123 const string& thePrefix, const Storable::TRestoringMap& theMap);
125 //==============================================================================
126 class Container_i : public virtual POA_VISU::Container,
127 public virtual PrsObject_i
129 static int myNbPresent;
131 Container_i( const Container_i& );
133 Container_i(SALOMEDS::Study_ptr theStudy);
134 virtual ~Container_i();
135 virtual VISU::VISUType GetType() { return VISU::TCONTAINER;};
137 virtual void AddCurve( Curve_ptr theCurve );
138 virtual void RemoveCurve( Curve_ptr theCurve );
140 virtual CORBA::Long GetNbCurves();
141 virtual void Clear();
144 Storable* Build(int theRestoring);
147 QStringList myCurves;
150 virtual Storable* Create();
151 virtual Storable* Restore( const Storable::TRestoringMap& theMap )
152 throw(std::logic_error&);
153 virtual void ToStream( std::ostringstream& theStr );
154 static const string myComment;
155 virtual const char* GetComment() const;
156 virtual const char* GenerateName();
159 VISU::Curve_i* GetCurve( CORBA::Long theIndex );
162 Storable* ContainerRestore(SALOMEDS::SObject_ptr theSObject,
163 const string& thePrefix, const Storable::TRestoringMap& theMap);
165 #endif // (#ifndef VISU_Table_i_HeaderFile)