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"
31 #include "Plot2d_Curve.h"
33 #include <qstringlist.h>
36 //==============================================================================
37 class Table_i : public virtual POA_VISU::Table,
38 public virtual PrsObject_i
40 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* theName ) { SetName( theName ); }
49 virtual char* GetTitle() { return CORBA::string_dup( GetName() ); }
51 virtual void SetOrientation( VISU::Table::Orientation theOrientation ) { myOrientation = theOrientation; }
52 virtual VISU::Table::Orientation GetOrientation() { return myOrientation; }
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 virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO);
70 static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
71 const string& thePrefix, const Storable::TRestoringMap& theMap);
72 virtual void ToStream( std::ostringstream& theStr );
73 static const string myComment;
74 virtual const char* GetComment() const;
75 virtual const char* GenerateName();
76 virtual const char* GetTableTitle();
78 virtual char* GetObjectEntry() { return CORBA::string_dup( mySObj->GetID() ); }
80 SALOMEDS::SObject_var ImportTables(const char* theFileName, SALOMEDS::Study_ptr theStudy);
81 bool ExportTableToFile(SALOMEDS::SObject_ptr theTable, const char* theFileName);
82 //==============================================================================
83 class Curve_i : public virtual POA_VISU::Curve,
84 public virtual PrsObject_i
86 static int myNbPresent;
88 Curve_i( const Curve_i& );
90 Curve_i( SALOMEDS::Study_ptr theStudy, Table_i* theTable, CORBA::Long theHRow, CORBA::Long theVRow );
92 virtual VISU::VISUType GetType() { return VISU::TCURVE;};
94 virtual void SetTitle( const char* theName ) { SetName( theName ); }
95 virtual char* GetTitle() { return CORBA::string_dup( GetName() ); }
97 virtual void SetColor( const SALOMEDS::Color& theColor ) { myColor = theColor; myAuto = false; }
98 virtual SALOMEDS::Color GetColor() { return myColor; }
100 virtual void SetMarker( VISU::Curve::MarkerType theType ) { myMarker = theType; myAuto = false; }
101 virtual VISU::Curve::MarkerType GetMarker() { return myMarker; }
103 virtual void SetLine( VISU::Curve::LineType theType, CORBA::Long theWidth )
104 { myLine = theType; myLineWidth = theWidth; myAuto = false; }
105 virtual VISU::Curve::LineType GetLine() { return myLine; }
106 virtual CORBA::Long GetLineWidth() { return myLineWidth; }
108 virtual void RemoveFromStudy();
111 Storable* Build(int theRestoring);
117 struct SALOMEDS::Color myColor;
118 VISU::Curve::MarkerType myMarker;
119 VISU::Curve::LineType myLine;
123 SALOMEDS::SObject_var mySObj;
126 virtual Storable* Create();
127 virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr theSO);
129 static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
130 const string& thePrefix, const Storable::TRestoringMap& theMap);
132 virtual void ToStream( std::ostringstream& theStr );
133 static const string myComment;
134 virtual const char* GetComment() const;
135 virtual const char* GenerateName();
136 virtual const char* GetTableID();
138 virtual CORBA::Boolean IsAuto() { return myAuto; }
139 virtual CORBA::Boolean IsValid();
140 virtual string GetHorTitle();
141 virtual string GetVerTitle();
142 virtual string GetHorUnits();
143 virtual string GetVerUnits();
144 virtual int GetData( double*& theHorList, double*& theVerList );
146 virtual Plot2d_Curve* CreatePresentation();
149 //==============================================================================
150 class Container_i : public virtual POA_VISU::Container,
151 public virtual PrsObject_i
153 static int myNbPresent;
155 Container_i( const Container_i& );
157 Container_i(SALOMEDS::Study_ptr theStudy);
158 virtual ~Container_i();
159 virtual VISU::VISUType GetType() { return VISU::TCONTAINER;};
161 virtual void AddCurve( Curve_ptr theCurve );
162 virtual void RemoveCurve( Curve_ptr theCurve );
164 virtual CORBA::Long GetNbCurves();
165 virtual void Clear();
167 virtual void RemoveFromStudy();
170 Storable* Build(int theRestoring);
173 QStringList myCurves;
174 SALOMEDS::SObject_var mySObj;
177 virtual Storable* Create();
178 virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO );
180 static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
181 const string& thePrefix, const Storable::TRestoringMap& theMap);
183 virtual void ToStream( std::ostringstream& theStr );
184 static const string myComment;
185 virtual const char* GetComment() const;
186 virtual const char* GenerateName();
189 VISU::Curve_i* GetCurve( CORBA::Long theIndex );