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();
58 Storable* Build(int theRestoring);
61 VISU::Table::Orientation myOrientation;
66 virtual Storable* Create();
67 virtual Storable* Restore( const Storable::TRestoringMap& theMap )
68 throw(std::logic_error&);
69 static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
70 const string& thePrefix, const Storable::TRestoringMap& theMap)
71 throw(std::logic_error&);
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( myObjectEntry.c_str() ); }
80 SALOMEDS::SObject_var ImportTables(const char* theFileName, SALOMEDS::Study_ptr theStudy);
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; }
109 Storable* Build(int theRestoring);
115 struct SALOMEDS::Color myColor;
116 VISU::Curve::MarkerType myMarker;
117 VISU::Curve::LineType myLine;
123 virtual Storable* Create();
124 virtual Storable* Restore( const Storable::TRestoringMap& theMap )
125 throw(std::logic_error&);
126 static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
127 const string& thePrefix, const Storable::TRestoringMap& theMap)
128 throw(std::logic_error&);
129 virtual void ToStream( std::ostringstream& theStr );
130 static const string myComment;
131 virtual const char* GetComment() const;
132 virtual const char* GenerateName();
133 virtual const char* GetTableID();
135 virtual CORBA::Boolean IsAuto() { return myAuto; }
136 virtual CORBA::Boolean IsValid();
137 virtual string GetHorTitle();
138 virtual string GetVerTitle();
139 virtual string GetHorUnits();
140 virtual string GetVerUnits();
141 virtual int GetData( double*& theHorList, double*& theVerList );
143 virtual Plot2d_Curve* CreatePresentation();
146 //==============================================================================
147 class Container_i : public virtual POA_VISU::Container,
148 public virtual PrsObject_i
150 static int myNbPresent;
152 Container_i( const Container_i& );
154 Container_i(SALOMEDS::Study_ptr theStudy);
155 virtual ~Container_i();
156 virtual VISU::VISUType GetType() { return VISU::TCONTAINER;};
158 virtual void AddCurve( Curve_ptr theCurve );
159 virtual void RemoveCurve( Curve_ptr theCurve );
161 virtual CORBA::Long GetNbCurves();
162 virtual void Clear();
165 Storable* Build(int theRestoring);
168 QStringList myCurves;
171 virtual Storable* Create();
172 virtual Storable* Restore( const Storable::TRestoringMap& theMap )
173 throw(std::logic_error&);
174 static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
175 const string& thePrefix, const Storable::TRestoringMap& theMap)
176 throw(std::logic_error&);
177 virtual void ToStream( std::ostringstream& theStr );
178 static const string myComment;
179 virtual const char* GetComment() const;
180 virtual const char* GenerateName();
183 VISU::Curve_i* GetCurve( CORBA::Long theIndex );