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