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