1 // Copyright (C) 2007-2008 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
22 // VISU OBJECT : interactive object for VISU entities implementation
23 // File : VISU_Table_i.hh
24 // Author : Vadim SANDLER
27 #ifndef VISU_Table_i_HeaderFile
28 #define VISU_Table_i_HeaderFile
30 #include "VISU_PrsObject_i.hh"
32 #include <QStringList>
37 //==============================================================================
38 class VISU_I_EXPORT Table_i : public virtual POA_VISU::Table,
39 public virtual PrsObject_i
41 static int myNbPresent;
42 Table_i( const Table_i& );
44 Table_i( SALOMEDS::Study_ptr theStudy, const char* theObject );
46 virtual VISU::VISUType GetType() { return VISU::TTABLE;};
48 virtual void SetTitle( const char* theTitle );
49 virtual char* GetTitle();
51 virtual void SetOrientation( VISU::Table::Orientation theOrientation );
52 virtual VISU::Table::Orientation GetOrientation();
54 virtual CORBA::Long GetNbRows();
55 virtual CORBA::Long GetNbColumns();
57 virtual void RemoveFromStudy();
60 Storable* Build(int theRestoring);
63 VISU::Table::Orientation myOrientation;
65 SALOMEDS::SObject_var mySObj;
68 virtual Storable* Create();
69 SALOMEDS::SObject_var GetSObject() const;
71 virtual Storable* Restore( const Storable::TRestoringMap& theMap,
72 SALOMEDS::SObject_ptr SO);
74 static Storable* StorableEngine(SALOMEDS::SObject_ptr theSObject,
75 const Storable::TRestoringMap& theMap,
76 const std::string& thePrefix,
77 CORBA::Boolean theIsMultiFile);
79 virtual void ToStream( std::ostringstream& theStr );
80 static const std::string myComment;
81 virtual const char* GetComment() const;
82 virtual QString GenerateName();
83 virtual QString GetTableTitle();
85 virtual std::string GetObjectEntry();
87 SALOMEDS::SObject_var ImportTables(const char* theFileName, SALOMEDS::Study_ptr theStudy);
88 bool ExportTableToFile(SALOMEDS::SObject_ptr theTable, const char* theFileName);
89 //==============================================================================
90 class VISU_I_EXPORT Curve_i : public virtual POA_VISU::Curve,
91 public virtual PrsObject_i
93 static int myNbPresent;
95 Curve_i( const Curve_i& );
97 Curve_i( SALOMEDS::Study_ptr theStudy, Table_i* theTable,
98 CORBA::Long theHRow, CORBA::Long theVRow, CORBA::Long theZRow );
100 virtual VISU::VISUType GetType() { return VISU::TCURVE;};
102 virtual void SetTitle( const char* theTitle );
103 virtual char* GetTitle();
105 virtual void SetColor( const SALOMEDS::Color& theColor );
106 virtual SALOMEDS::Color GetColor();
108 virtual void SetMarker( VISU::Curve::MarkerType theType );
109 virtual VISU::Curve::MarkerType GetMarker();
111 virtual void SetLine( VISU::Curve::LineType theType, CORBA::Long theWidth );
112 virtual VISU::Curve::LineType GetLine();
113 virtual CORBA::Long GetLineWidth();
115 virtual void RemoveFromStudy();
117 virtual SALOMEDS::SObject_var GetSObject();
120 Storable* Build(int theRestoring);
127 struct SALOMEDS::Color myColor;
128 VISU::Curve::MarkerType myMarker;
129 VISU::Curve::LineType myLine;
133 SALOMEDS::SObject_var mySObj;
136 virtual Storable* Create();
138 int GetHRow() const { return myHRow;}
139 int GetVRow() const { return myVRow;}
140 int GetZRow() const { return myZRow;}
142 virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr theSO);
144 static Storable* StorableEngine(SALOMEDS::SObject_ptr theSObject,
145 const Storable::TRestoringMap& theMap,
146 const std::string& thePrefix,
147 CORBA::Boolean theIsMultiFile);
149 virtual void ToStream( std::ostringstream& theStr );
150 static const std::string myComment;
151 virtual const char* GetComment() const;
152 virtual QString GenerateName();
153 virtual std::string GetTableID();
155 virtual CORBA::Boolean IsAuto() { return myAuto; }
156 virtual CORBA::Boolean IsValid();
157 virtual std::string GetHorTitle();
158 virtual std::string GetVerTitle();
159 virtual std::string GetHorUnits();
160 virtual std::string GetVerUnits();
161 virtual int GetData( double*& theHorList, double*& theVerList, QStringList& );
163 virtual SPlot2d_Curve* CreatePresentation();
166 //==============================================================================
167 class VISU_I_EXPORT Container_i : public virtual POA_VISU::Container,
168 public virtual PrsObject_i
170 static int myNbPresent;
172 Container_i( const Container_i& );
174 Container_i(SALOMEDS::Study_ptr theStudy);
175 virtual ~Container_i();
176 virtual VISU::VISUType GetType() { return VISU::TCONTAINER;};
178 virtual void AddCurve( Curve_ptr theCurve );
179 virtual void RemoveCurve( Curve_ptr theCurve );
181 virtual CORBA::Long GetNbCurves();
182 virtual void Clear();
184 virtual void RemoveFromStudy();
186 virtual SALOMEDS::SObject_var GetSObject();
189 Storable* Build(int theRestoring);
192 QStringList myCurves;
193 SALOMEDS::SObject_var mySObj;
196 virtual Storable* Create();
197 virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO );
199 static Storable* StorableEngine(SALOMEDS::SObject_ptr theSObject,
200 const Storable::TRestoringMap& theMap,
201 const std::string& thePrefix,
202 CORBA::Boolean theIsMultiFile);
204 virtual void ToStream( std::ostringstream& theStr );
205 static const std::string myComment;
206 virtual const char* GetComment() const;
207 virtual QString GenerateName();
210 VISU::Curve_i* GetCurve( CORBA::Long theIndex );