]> SALOME platform Git repositories - modules/visu.git/blob - src/VISU_I/VISU_GaussPoints_i.hh
Salome HOME
Merge from PortingMED3 07Apr11
[modules/visu.git] / src / VISU_I / VISU_GaussPoints_i.hh
1 //  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  VISU OBJECT : interactive object for VISU entities implementation
24 //  File   : VISU_PrsObject_i.hxx
25 //  Author : Alexey PETROV
26 //  Module : VISU
27 //
28 #ifndef VISU_GaussPoints_i_HeaderFile
29 #define VISU_GaussPoints_i_HeaderFile
30
31 #include "VISU_ColoredPrs3d_i.hh"
32 #include "VISU_GaussPtsActorFactory.h"
33
34 class VISU_LookupTable;
35 class VISU_ScalarBarActor;
36
37 class VISU_GaussPointsPL;
38
39 #include <QColor>
40
41 namespace VISU
42 {
43   //! Class of the Gauss Points presentation.
44   class VISU_I_EXPORT GaussPoints_i : public virtual POA_VISU::GaussPoints,
45                                       public virtual TGaussPtsActorFactory,
46                                       public virtual ColoredPrs3d_i
47   {
48     static int myNbPresent;
49     GaussPoints_i(const GaussPoints_i&);
50
51   public:
52     //----------------------------------------------------------------------------
53     typedef ColoredPrs3d_i TSuperClass;
54     typedef VISU::GaussPoints TInterface;
55
56     explicit
57     GaussPoints_i(EPublishInStudyMode thePublishInStudyModep);
58
59     virtual
60     ~GaussPoints_i();
61
62     virtual 
63     VISU::VISUType 
64     GetType() 
65     {
66       return VISU::TGAUSSPOINTS;
67     }
68
69     //----------------------------------------------------------------------------
70     //! Gets memory size actually used by the presentation (Mb).
71     virtual
72     CORBA::Float
73     GetMemorySize();
74
75     //----------------------------------------------------------------------------
76     CORBA::Long
77     GetFaceLimit();
78
79     void
80     SetFaceLimit( CORBA::Long theFaceLimit );
81
82     CORBA::Boolean 
83     GetIsDeformed();
84
85     void
86     SetIsDeformed( CORBA::Boolean theIsDeformed );
87
88     CORBA::Double
89     GetScaleFactor();
90
91     void
92     SetScaleFactor( CORBA::Double theScaleFactor );
93
94     //! Get color for Geometry mode of the presentation.
95     SALOMEDS::Color
96     GetColor();
97
98     QColor
99     GetQColor();
100
101     //! Set color for Geometry mode of the presentation.
102     void
103     SetColor( const SALOMEDS::Color& theColor );
104
105     void
106     SetQColor( const QColor& theColor );
107
108     //! Get flag indicating which mode of the presentation is active.
109     /*! When Results mode is active, returns true. Geometry - false. */
110     bool 
111     GetIsColored();
112
113     //! Get flag indicating which mode of the presentation is active.
114     void
115     SetIsColored( bool theIsColored );
116
117     //! Set path to the image using for Main Point Sprite texture.
118     bool
119     SetMainTexture( const QString& theMainTexture );
120
121     //! Get path to the image using for Main Point Sprite texture.
122     QString
123     GetQMainTexture();
124     
125     char*
126     GetMainTexture();
127
128     //! Set path to the image using for Alpha Point Sprite texture.
129     bool
130     SetAlphaTexture( const QString& theAlphaTexture );
131
132     //! Get path to the image using for Alpha Point Sprite texture.
133     QString
134     GetQAlphaTexture();
135
136     char*
137     GetAlphaTexture();
138
139     //! Convert Main and AlphaMask images to VTI format and set them to pipeline.
140     void
141     SetQTextures( const QString& theMainTexture,
142                   const QString& theAlphaTexture );
143
144     void
145     SetTextures( const char* theMainTexture, 
146                  const char* theAlphaTexture );
147
148     //! Redirect the request to VISU_GaussPointsPL::SetAlphaThreshold.
149     void
150     SetAlphaThreshold(CORBA::Double theAlphaThreshold);
151
152     //! Redirect the request to VISU_GaussPointsPL::GetAlphaThreshold.
153     CORBA::Double
154     GetAlphaThreshold();
155
156     //! Redirect the request to VISU_GaussPointsPL::SetResolution.
157     void
158     SetResolution(CORBA::Long theResolution);
159
160     //! Redirect the request to VISU_GaussPointsPL::GetResolution.
161     CORBA::Long
162     GetResolution();
163
164     void
165     SetPrimitiveType(VISU::GaussPoints::PrimitiveType thePrimitiveType);
166
167     VISU::GaussPoints::PrimitiveType
168     GetPrimitiveType();
169
170     //! Redirect the request to VISU_GaussPointsPL::GetMaximumSupportedSize.
171     vtkFloatingPointType 
172     GetMaximumSupportedSize();
173
174     //! Redirect the request to VISU_GaussPointsPL::SetClamp.
175     void
176     SetClamp(CORBA::Double theClamp);
177
178     //! Redirect the request to VISU_GaussPointsPL::GetClamp.
179     CORBA::Double
180     GetClamp();
181
182     //! Redirect the request to VISU_GaussPointsPL::SetSize.
183     void
184     SetGeomSize(CORBA::Double theGeomSize);
185
186     //! Redirect the request to VISU_GaussPointsPL::GetSize.
187     CORBA::Double 
188     GetGeomSize();
189
190     //! Redirect the request to VISU_GaussPointsPL::SetMinSize.
191     void
192     SetMinSize(CORBA::Double theMinSize);
193
194     //! Redirect the request to VISU_GaussPointsPL::GetMinSize.
195     CORBA::Double 
196     GetMinSize();
197
198     //! Redirect the request to VISU_GaussPointsPL::SetMaxSize.
199     void
200     SetMaxSize(CORBA::Double theMaxSize);
201
202     //! Redirect the request to VISU_GaussPointsPL::GetMaxSize.
203     CORBA::Double 
204     GetMaxSize();
205
206     //! Redirect the request to VISU_GaussPointsPL::SetMagnification.
207     void
208     SetMagnification(CORBA::Double theMagnification);
209
210     //! Redirect the request to VISU_GaussPointsPL::GetMagnification.
211     CORBA::Double
212     GetMagnification();
213
214     //! Redirect the request to VISU_GaussPointsPL::SetMagnificationIncrement.
215     void
216     SetMagnificationIncrement(CORBA::Double theIncrement);
217
218     //! Redirect the request to VISU_GaussPointsPL::GetMagnificationIncrement.
219     CORBA::Double
220     GetMagnificationIncrement();
221
222     //! Set flag indicating which scalar bar is active.
223     void
224     SetIsActiveLocalScalarBar(CORBA::Boolean theIsActiveLocalScalarBar);
225
226     //! Get flag indicating which scalar bar is active.
227     CORBA::Boolean
228     GetIsActiveLocalScalarBar();
229
230     //! Set flag indicating visibility of global scalar bar.
231     void
232     SetIsDispGlobalScalarBar(CORBA::Boolean theIsDispGlobalScalarBar);
233
234     //! Get flag indicating visibility of global scalar bar.
235     CORBA::Boolean
236     GetIsDispGlobalScalarBar();
237
238     //! Redirect the request to VISU_GaussPointsPL::SetBicolor.
239     void
240     SetBiColor(CORBA::Boolean theIsBiColor);
241
242     //! Redirect the request to VISU_GaussPointsPL::GetBicolor.
243     CORBA::Boolean
244     GetBiColor();
245
246     //! Set value of the distance between global and local scalar bars.
247     void
248     SetSpacing(CORBA::Double theSpacing);
249
250     //! Get value of the distance between global and local scalar bars.
251     CORBA::Double
252     GetSpacing();
253
254     //! Let know is the global range is already calculated
255     bool
256     IsGlobalRangeDefined() const;
257
258     virtual
259     CORBA::Double 
260     GetSourceMin();
261
262     virtual
263     CORBA::Double 
264     GetSourceMax();
265
266     virtual 
267     void
268     SetSourceRange();
269
270     VISU_GaussPointsPL* 
271     GetSpecificPL() const
272     { 
273       return myGaussPointsPL; 
274     }
275     
276     virtual CORBA::Boolean IsBarVisible() { return myShowBar; }
277        
278     virtual void SetBarVisible(CORBA::Boolean theVisible);
279
280     //----------------------------------------------------------------------------
281     //! Sets initial source geometry
282     virtual
283     void
284     SetSourceGeometry();
285
286     //! Add geometry of mesh as group. \retval the id of added group.
287     virtual 
288     void
289     AddMeshOnGroup(const char* theGroupName);
290     
291     //! Removes all geometries.
292     virtual
293     void
294     RemoveAllGeom();
295
296     virtual
297     vtkFloatingPointType
298     GetComponentMin(vtkIdType theCompID);
299
300     virtual
301     vtkFloatingPointType
302     GetComponentMax(vtkIdType theCompID);
303     
304   protected:
305     //! Redefines VISU_ColoredPrs3d_i::DoSetInput
306     virtual
307     void
308     DoSetInput(bool theIsInitilizePipe, bool theReInit);
309
310     //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
311     virtual
312     void
313     CreatePipeLine(VISU_PipeLine* thePipeLine);
314
315     //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
316     virtual 
317     bool 
318     CheckIsPossible();
319
320     virtual 
321     const char* 
322     GetIconName();
323
324     virtual 
325     VISU_PipeLine* 
326     GetActorPipeLine();
327     
328     bool
329     OnCreateActor(VISU_GaussPtsAct* theActor);
330
331     VISU_GaussPtsAct1* 
332     OnCreateActor1();
333
334     VISU_GaussPtsAct2* 
335     OnCreateActor2();
336
337     void
338     UpdateScalarBar(VISU_ScalarBarActor *theScalarBar,
339                     VISU_LookupTable* theLookupTable);
340
341   protected:
342     VISU_GaussPointsPL *myGaussPointsPL;
343     
344     bool myIsDispGlobalScalarBar;
345     bool myIsActiveLocalScalarBar;
346     QColor myColor;
347     vtkFloatingPointType mySpacing;
348     int myFaceLimit;
349
350     QString myMainTexture;
351     QString myAlphaTexture;
352
353   public:
354     static 
355     size_t
356     IsPossible(Result_i* theResult, 
357                const std::string& theMeshName, 
358                VISU::Entity theEntity,
359                const std::string& theFieldName, 
360                CORBA::Long theTimeStampNumber,
361                bool theIsMemoryCheck);
362     virtual
363     Storable* 
364     Create(const std::string& theMeshName, 
365            VISU::Entity theEntity,
366            const std::string& theFieldName, 
367            CORBA::Long theTimeStampNumber);
368
369     virtual 
370     void
371     SameAs(const Prs3d_i* theOrigin);
372
373     static const std::string myComment;
374
375     virtual
376     const char* 
377     GetComment() const;
378
379     virtual
380     QString
381     GenerateName();
382
383     virtual
384     void
385     ToStream(std::ostringstream& theStr);
386
387     virtual 
388     Storable* 
389     Restore(SALOMEDS::SObject_ptr theSObject,
390             const Storable::TRestoringMap& theMap);
391
392     //----------------------------------------------------------------------------
393     virtual 
394     VISU_Actor* 
395     CreateActor();
396
397     virtual 
398     VISU_GaussPtsAct2* 
399     CloneActor(VISU_GaussPtsAct1* theActor);
400
401     virtual
402     void
403     UpdateActor(VISU_ActorBase* theActor);
404
405     virtual 
406     void
407     UpdateFromActor(VISU_GaussPtsAct* theActor);
408     
409     private:
410       bool myShowBar;
411   };
412 }
413
414 #endif