1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // VISU OBJECT : interactive object for VISU entities implementation
24 // File : VISU_Table_i.hh
25 // Author : Vadim SANDLER
28 #ifndef VISU_Table_i_HeaderFile
29 #define VISU_Table_i_HeaderFile
31 #include "VISU_PrsObject_i.hh"
33 #include <QStringList>
38 //==============================================================================
39 class VISU_I_EXPORT Table_i : public virtual POA_VISU::Table,
40 public virtual PrsObject_i
42 static int myNbPresent;
43 Table_i( const Table_i& );
45 Table_i( SALOMEDS::Study_ptr theStudy, const char* theObject );
47 virtual VISU::VISUType GetType() { return VISU::TTABLE;};
49 virtual void SetTitle( const char* theTitle );
50 virtual char* GetTitle();
52 virtual void SetOrientation( VISU::Table::Orientation theOrientation );
53 virtual VISU::Table::Orientation GetOrientation();
55 virtual CORBA::Long GetNbRows();
56 virtual CORBA::Long GetNbColumns();
58 virtual void SortRow(CORBA::Long theRow, VISU::SortOrder theSortOrder, VISU::SortPolicy theSortPolicy);
59 virtual void SortColumn(CORBA::Long theColumn, VISU::SortOrder theSortOrder, VISU::SortPolicy theSortPolicy);
60 virtual void SortByRow(CORBA::Long theRow, VISU::SortOrder theSortOrder, VISU::SortPolicy theSortPolicy);
61 virtual void SortByColumn(CORBA::Long theColumn, VISU::SortOrder theSortOrder, VISU::SortPolicy theSortPolicy);
63 virtual void RemoveFromStudy();
66 Storable* Build(int theRestoring);
67 void UpdateCurves(std::map<int, int> theMixData);
70 VISU::Table::Orientation myOrientation;
72 SALOMEDS::SObject_var mySObj;
75 virtual Storable* Create();
76 SALOMEDS::SObject_var GetSObject() const;
78 virtual Storable* Restore( const Storable::TRestoringMap& theMap,
79 SALOMEDS::SObject_ptr SO);
81 static Storable* StorableEngine(SALOMEDS::SObject_ptr theSObject,
82 const Storable::TRestoringMap& theMap,
83 const std::string& thePrefix,
84 CORBA::Boolean theIsMultiFile);
86 virtual void ToStream( std::ostringstream& theStr );
87 static const std::string myComment;
88 virtual const char* GetComment() const;
89 virtual QString GenerateName();
90 virtual QString GetTableTitle();
92 virtual std::string GetObjectEntry();
94 SALOMEDS::SObject_var ImportTables(const char* theFileName, SALOMEDS::Study_ptr theStudy,
95 bool theFirstStrAsTitle = false);
96 bool ExportTableToFile(SALOMEDS::SObject_ptr theTable, const char* theFileName);
97 //==============================================================================
98 class VISU_I_EXPORT Curve_i : public virtual POA_VISU::Curve,
99 public virtual PrsObject_i
101 static int myNbPresent;
103 Curve_i( const Curve_i& );
105 Curve_i( SALOMEDS::Study_ptr theStudy, Table_i* theTable,
106 CORBA::Long theHRow, CORBA::Long theVRow, CORBA::Long theZRow,
107 CORBA::Boolean theIsV2 );
109 virtual VISU::VISUType GetType() { return VISU::TCURVE;};
111 virtual void SetTitle( const char* theTitle );
112 virtual char* GetTitle();
114 virtual void SetColor( const SALOMEDS::Color& theColor );
115 virtual SALOMEDS::Color GetColor();
117 virtual void SetMarker( VISU::Curve::MarkerType theType );
118 virtual VISU::Curve::MarkerType GetMarker();
120 virtual void SetLine( VISU::Curve::LineType theType, CORBA::Long theWidth );
121 virtual VISU::Curve::LineType GetLine();
122 virtual CORBA::Long GetLineWidth();
124 virtual void RemoveFromStudy();
126 virtual SALOMEDS::SObject_var GetSObject();
129 Storable* Build(int theRestoring);
137 struct SALOMEDS::Color myColor;
138 VISU::Curve::MarkerType myMarker;
139 VISU::Curve::LineType myLine;
143 SALOMEDS::SObject_var mySObj;
146 virtual Storable* Create();
148 int GetHRow() const { return myHRow; }
149 void SetHRow( const int theHRow ) { myHRow = theHRow; }
151 int GetVRow() const { return myVRow; }
152 void SetVRow( const int theVRow ) { myVRow = theVRow; }
154 int GetZRow() const { return myZRow; }
155 void SetZRow( const int theZRow ) { myZRow = theZRow; }
157 int GetIsV2() const { return myIsV2; }
158 void SetIsV2( const int theIsV2 ) { myIsV2 = theIsV2; }
160 virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr theSO);
162 static Storable* StorableEngine(SALOMEDS::SObject_ptr theSObject,
163 const Storable::TRestoringMap& theMap,
164 const std::string& thePrefix,
165 CORBA::Boolean theIsMultiFile);
167 virtual void ToStream( std::ostringstream& theStr );
168 static const std::string myComment;
169 virtual const char* GetComment() const;
170 virtual QString GenerateName();
171 virtual std::string GetTableID();
173 virtual CORBA::Boolean IsAuto() { return myAuto; }
174 virtual CORBA::Boolean IsValid();
175 virtual std::string GetHorTitle();
176 virtual std::string GetVerTitle();
177 virtual std::string GetHorUnits();
178 virtual std::string GetVerUnits();
179 virtual int GetData( double*& theHorList, double*& theVerList, QStringList& );
181 virtual SPlot2d_Curve* CreatePresentation();
184 //==============================================================================
185 class VISU_I_EXPORT Container_i : public virtual POA_VISU::Container,
186 public virtual PrsObject_i
188 static int myNbPresent;
190 Container_i( const Container_i& );
192 Container_i(SALOMEDS::Study_ptr theStudy);
193 virtual ~Container_i();
194 virtual VISU::VISUType GetType() { return VISU::TCONTAINER;};
196 virtual void AddCurve( Curve_ptr theCurve );
197 virtual void RemoveCurve( Curve_ptr theCurve );
199 virtual CORBA::Long GetNbCurves();
200 virtual void Clear();
202 virtual void RemoveFromStudy();
204 virtual SALOMEDS::SObject_var GetSObject();
207 Storable* Build(int theRestoring);
210 QStringList myCurves;
211 SALOMEDS::SObject_var mySObj;
214 virtual Storable* Create();
215 virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO );
217 static Storable* StorableEngine(SALOMEDS::SObject_ptr theSObject,
218 const Storable::TRestoringMap& theMap,
219 const std::string& thePrefix,
220 CORBA::Boolean theIsMultiFile);
222 virtual void ToStream( std::ostringstream& theStr );
223 static const std::string myComment;
224 virtual const char* GetComment() const;
225 virtual QString GenerateName();
228 VISU::Curve_i* GetCurve( CORBA::Long theIndex );