Salome HOME
Join modifications from branch OCC_development_for_3_2_0a2
[modules/visu.git] / src / VISU_I / VISU_ColoredPrs3d_i.hh
1 //  VISU OBJECT : interactive object for VISU entities implementation
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
21 //
22 //
23 //  File   : VISU_PrsObject_i.hxx
24 //  Author : Alexey PETROV
25 //  Module : VISU
26
27 #ifndef VISU_ColoredPrs3d_i_HeaderFile
28 #define VISU_ColoredPrs3d_i_HeaderFile
29
30 #include "VISU_Prs3d_i.hh"
31
32 class VISU_ScalarMapPL;
33
34 namespace VISU
35 {
36   //============================================================================
37   class ColoredPrs3d_i : public virtual POA_VISU::ColoredPrs3d,
38                          public virtual Prs3d_i
39   {
40     ColoredPrs3d_i();
41     ColoredPrs3d_i(const ColoredPrs3d_i&);
42   public:
43     //----------------------------------------------------------------------------
44     typedef Prs3d_i TSuperClass;
45
46     explicit
47     ColoredPrs3d_i(Result_i* theResult,
48                    bool theAddToStudy);
49     explicit
50     ColoredPrs3d_i(Result_i* theResult,
51                    SALOMEDS::SObject_ptr theSObject);
52
53     virtual
54     ~ColoredPrs3d_i();
55
56     virtual
57     void
58     RemoveFromStudy();
59
60     //----------------------------------------------------------------------------
61     virtual
62     CORBA::Long
63     GetScalarMode();
64
65     virtual
66     void 
67     SetScalarMode(CORBA::Long theScalarMode);
68
69     virtual
70     CORBA::Double 
71     GetMin();
72
73     virtual
74     CORBA::Double 
75     GetMax();
76
77     virtual 
78     void 
79     SetNbColors(CORBA::Long theNbColors);
80
81     virtual
82     CORBA::Long 
83     GetNbColors();
84
85     virtual
86     void
87     SetBarOrientation(VISU::ScalarMap::Orientation theOrientation);
88
89     virtual 
90     VISU::ScalarMap::Orientation 
91     GetBarOrientation();
92
93     virtual
94     void
95     SetPosition(CORBA::Double X, CORBA::Double Y);
96
97     virtual
98     CORBA::Double
99     GetPosX();
100
101     virtual
102     CORBA::Double
103     GetPosY();
104
105     virtual 
106     void
107     SetSize(CORBA::Double theWidth, CORBA::Double theHeight);
108     
109     virtual 
110     CORBA::Double
111     GetWidth();
112
113     virtual
114     CORBA::Double
115     GetHeight();
116
117     virtual 
118     void
119     SetLabels(CORBA::Long theNbLabels);
120
121     virtual
122     CORBA::Long
123     GetLabels();
124
125     virtual
126     void
127     SetTitle(const char* theName);
128
129     virtual
130     char* 
131     GetTitle();
132
133     //----------------------------------------------------------------------------
134   protected:
135     VISU::ScalarMap::Orientation myOrientation;
136     std::string myTitle;
137     int myNumberOfLabels;
138     float myPosition[2], myWidth, myHeight;
139
140   public:
141     //----------------------------------------------------------------------------
142     virtual
143     Storable* 
144     Create(const char* theMeshName, 
145            VISU::Entity theEntity,
146            const char* theFieldName, 
147            int theIteration);
148
149     virtual 
150     Storable* 
151     Restore(const Storable::TRestoringMap& theMap);
152
153     virtual 
154     void
155     ToStream(std::ostringstream& theStr);
156
157     virtual 
158     void
159     SameAs(const Prs3d_i* theOrigin);
160
161     /*!
162      *  \brief Works like SameAs() method, but keep myIteration value unchanged.
163      *
164      *  Is used in VISU_TimeAnimation class implementation.
165      */
166     void
167     SameAsParams(const ColoredPrs3d_i* theOrigin);
168
169     virtual const VISU::PField&
170     GetField() const;
171
172     const std::string& 
173     GetMeshName() const;
174
175     VISU::Entity
176     GetEntity() const;
177
178     const std::string& 
179     GetFieldName() const;
180
181     int
182     GetIteration() const;
183
184     VISU_ScalarMapPL* 
185     GetScalarMapPL();
186
187     virtual 
188     bool
189     IsBoldTitle();
190
191     virtual
192     void
193     SetBoldTitle(bool isBold);
194
195     virtual
196     bool
197     IsItalicTitle();
198
199     virtual
200     void
201     SetItalicTitle(bool isItalic);
202
203     virtual 
204     bool
205     IsShadowTitle();
206
207     virtual
208     void
209     SetShadowTitle(bool isShadow);
210
211     virtual 
212     int
213     GetTitFontType();
214
215     virtual
216     void
217     SetTitFontType(int theType);
218
219     virtual 
220     void
221     GetTitleColor(float* theR, float* theG, float* theB);
222     
223     virtual
224     void
225     SetTitleColor(float theR, float theG, float theB);    
226
227     virtual
228     bool
229     IsBoldLabel();
230
231     virtual
232     void
233     SetBoldLabel(bool isBold);
234
235     virtual
236     bool
237     IsItalicLabel();
238
239     virtual
240     void
241     SetItalicLabel(bool isItalic);
242
243     virtual
244     bool
245     IsShadowLabel();
246
247     virtual
248     void
249     SetShadowLabel(bool isShadow);
250
251     virtual 
252     int
253     GetLblFontType();
254
255     virtual
256     void
257     SetLblFontType(int theType);
258
259     virtual 
260     void
261     GetLabelColor(float* theR, float* theG, float* theB);
262
263     virtual
264     void
265     SetLabelColor(float theR, float theG, float theB);
266
267     //----------------------------------------------------------------------------
268   protected:
269     PField myField;
270     TEntity myEntity;
271     std::string myFieldName;
272     int myIteration;
273
274     //Font management
275     bool myIsBoldTitle;
276     bool myIsItalicTitle;
277     bool myIsShadowTitle;
278     int  myTitFontType;
279     float myTitleColor[3];
280
281     bool myIsBoldLabel;
282     bool myIsItalicLabel;
283     bool myIsShadowLabel;
284     int  myLblFontType;
285     float myLabelColor[3];
286
287     VISU_ScalarMapPL* myScalarMapPL;
288     bool myIsFixedRange;
289
290     virtual 
291     void
292     DoSetInput(Result_i* theResult) = 0;
293
294     Storable* 
295     Build(int theRestoring);
296
297     virtual
298     void 
299     DoHook();
300   };
301
302 }
303
304 #endif