1 // VISU OBJECT : interactive object for VISU entities implementation
3 // Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
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.h>
37 //==============================================================================
38 class Table_i : public virtual POA_VISU::Table,
39 public virtual PrsObject_i
41 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* theName ) { SetName( theName ); }
50 virtual char* GetTitle() { return CORBA::string_dup( GetName() ); }
52 virtual void SetOrientation( VISU::Table::Orientation theOrientation ) { myOrientation = theOrientation; }
53 virtual VISU::Table::Orientation GetOrientation() { return myOrientation; }
55 virtual CORBA::Long GetNbRows();
56 virtual CORBA::Long GetNbColumns();
58 virtual void RemoveFromStudy();
61 Storable* Build(int theRestoring);
64 VISU::Table::Orientation myOrientation;
66 SALOMEDS::SObject_var mySObj;
69 virtual Storable* Create();
70 SALOMEDS::SObject_var GetSObject() const { return mySObj;}
72 virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO);
73 static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
74 const std::string& thePrefix,
75 const Storable::TRestoringMap& theMap);
76 virtual void ToStream( std::ostringstream& theStr );
77 static const std::string myComment;
78 virtual const char* GetComment() const;
79 virtual const char* GenerateName();
80 virtual const char* GetTableTitle();
82 virtual char* GetObjectEntry() { return CORBA::string_dup( mySObj->GetID() ); }
84 SALOMEDS::SObject_var ImportTables(const char* theFileName, SALOMEDS::Study_ptr theStudy);
85 bool ExportTableToFile(SALOMEDS::SObject_ptr theTable, const char* theFileName);
86 //==============================================================================
87 class Curve_i : public virtual POA_VISU::Curve,
88 public virtual PrsObject_i
90 static int myNbPresent;
92 Curve_i( const Curve_i& );
94 Curve_i( SALOMEDS::Study_ptr theStudy, Table_i* theTable, CORBA::Long theHRow, CORBA::Long theVRow );
96 virtual VISU::VISUType GetType() { return VISU::TCURVE;};
98 virtual void SetTitle( const char* theName ) { SetName( theName ); }
99 virtual char* GetTitle() { return CORBA::string_dup( GetName() ); }
101 virtual void SetColor( const SALOMEDS::Color& theColor ) { myColor = theColor; myAuto = false; }
102 virtual SALOMEDS::Color GetColor() { return myColor; }
104 virtual void SetMarker( VISU::Curve::MarkerType theType ) { myMarker = theType; myAuto = false; }
105 virtual VISU::Curve::MarkerType GetMarker() { return myMarker; }
107 virtual void SetLine( VISU::Curve::LineType theType, CORBA::Long theWidth )
108 { myLine = theType; myLineWidth = theWidth; myAuto = false; }
109 virtual VISU::Curve::LineType GetLine() { return myLine; }
110 virtual CORBA::Long GetLineWidth() { return myLineWidth; }
112 virtual void RemoveFromStudy();
114 virtual SALOMEDS::SObject_var GetSObject();
117 Storable* Build(int theRestoring);
123 struct SALOMEDS::Color myColor;
124 VISU::Curve::MarkerType myMarker;
125 VISU::Curve::LineType myLine;
129 SALOMEDS::SObject_var mySObj;
132 virtual Storable* Create();
134 int GetHRow() const { return myHRow;}
135 int GetVRow() const { return myVRow;}
137 virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr theSO);
139 static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
140 const std::string& thePrefix,
141 const Storable::TRestoringMap& theMap);
143 virtual void ToStream( std::ostringstream& theStr );
144 static const std::string myComment;
145 virtual const char* GetComment() const;
146 virtual const char* GenerateName();
147 virtual const char* GetTableID();
149 virtual CORBA::Boolean IsAuto() { return myAuto; }
150 virtual CORBA::Boolean IsValid();
151 virtual std::string GetHorTitle();
152 virtual std::string GetVerTitle();
153 virtual std::string GetHorUnits();
154 virtual std::string GetVerUnits();
155 virtual int GetData( double*& theHorList, double*& theVerList );
157 virtual SPlot2d_Curve* CreatePresentation();
160 //==============================================================================
161 class Container_i : public virtual POA_VISU::Container,
162 public virtual PrsObject_i
164 static int myNbPresent;
166 Container_i( const Container_i& );
168 Container_i(SALOMEDS::Study_ptr theStudy);
169 virtual ~Container_i();
170 virtual VISU::VISUType GetType() { return VISU::TCONTAINER;};
172 virtual void AddCurve( Curve_ptr theCurve );
173 virtual void RemoveCurve( Curve_ptr theCurve );
175 virtual CORBA::Long GetNbCurves();
176 virtual void Clear();
178 virtual void RemoveFromStudy();
181 Storable* Build(int theRestoring);
184 QStringList myCurves;
185 SALOMEDS::SObject_var mySObj;
188 virtual Storable* Create();
189 virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO );
191 static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
192 const std::string& thePrefix,
193 const Storable::TRestoringMap& theMap);
195 virtual void ToStream( std::ostringstream& theStr );
196 static const std::string myComment;
197 virtual const char* GetComment() const;
198 virtual const char* GenerateName();
201 VISU::Curve_i* GetCurve( CORBA::Long theIndex );