Salome HOME
Update copyright information
[modules/visu.git] / src / VISU_I / VISU_GaussPoints_i.cc
1 // Copyright (C) 2007-2012  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   :
25 //  Author :
26 //  Module :
27 //
28 #include "VISU_GaussPoints_i.hh"
29 #include "VISU_ScalarMap_i.hh"
30 #include "VISU_Prs3dUtils.hh"
31
32 #include "VISU_Result_i.hh"
33 #include "VISU_GaussPtsAct.h"
34 #include "VISU_GaussPointsPL.hxx"
35 #include "VISU_GaussPtsDeviceActor.h"
36
37 #include "VISU_OpenGLPointSpriteMapper.hxx"
38 #include "VISU_ScalarBarCtrl.hxx"
39 #include <VISU_ScalarBarActor.hxx>
40 #include "VISU_LookupTable.hxx"
41 #include "VISU_MedConvertor.hxx"
42
43 #include "SUIT_ResourceMgr.h"
44
45 #include "VISU_PipeLineUtils.hxx"
46
47 #include <vtkImageData.h>
48 #include <vtkXMLImageDataReader.h>
49 #include <vtkTextProperty.h>
50 #include <vtkProperty.h>
51
52 #ifdef _DEBUG_
53 static int MYDEBUG = 0;
54 #else
55 static int MYDEBUG = 0;
56 #endif
57
58 static int INCMEMORY = 10;
59
60 using namespace std;
61
62 //----------------------------------------------------------------------------
63 size_t
64 VISU::GaussPoints_i
65 ::IsPossible(Result_i* theResult, 
66              const std::string& theMeshName, 
67              VISU::Entity theEntity,
68              const std::string& theFieldName, 
69              CORBA::Long theTimeStampNumber,
70              bool theIsMemoryCheck)
71 {
72   size_t aResult = 0;
73   if(theEntity == VISU::NODE)
74     return aResult;
75   try{
76     bool anIsEstimated = true;
77     VISU::Result_i::PInput anInput = theResult->GetInput(theMeshName,
78                                                          theEntity,
79                                                          theFieldName,
80                                                          theTimeStampNumber);
81     if(!dynamic_cast<const VISU_MedConvertor*>(anInput.get()))
82       return aResult;
83     size_t aSize = anInput->GetTimeStampOnGaussPtsSize(theMeshName,
84                                                        VISU::TEntity(theEntity),
85                                                        theFieldName,
86                                                        theTimeStampNumber,
87                                                        anIsEstimated);
88       aResult = 1;
89     if(theIsMemoryCheck){
90       if(anIsEstimated)
91         aSize *= INCMEMORY;
92       aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
93       if(MYDEBUG) 
94         MESSAGE("GaussPoints_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
95     }
96   }catch(std::exception& exc){
97     INFOS("Follow exception was occured :\n"<<exc.what());
98   }catch(...){
99     INFOS("Unknown exception was occured!");
100   }
101   return aResult;
102 }
103
104 //----------------------------------------------------------------------------
105 int VISU::GaussPoints_i::myNbPresent = 0;
106
107 QString 
108 VISU::GaussPoints_i
109 ::GenerateName()
110 {
111   return VISU::GenerateName("Gauss Points",myNbPresent++);
112 }
113
114 //----------------------------------------------------------------------------
115 const string VISU::GaussPoints_i::myComment = "GAUSSPOINTS";
116
117 const char* 
118 VISU::GaussPoints_i
119 ::GetComment() const 
120
121   return myComment.c_str();
122 }
123
124
125 //---------------------------------------------------------------
126 const char*
127 VISU::GaussPoints_i
128 ::GetIconName()
129 {
130   return "ICON_TREE_GAUSS_POINTS";
131 }  
132
133
134 //----------------------------------------------------------------------------
135 VISU::GaussPoints_i
136 ::GaussPoints_i(EPublishInStudyMode thePublishInStudyMode) : 
137   ColoredPrs3d_i(thePublishInStudyMode),
138   myGaussPointsPL(NULL),
139   myColor(Qt::blue),
140   myIsActiveLocalScalarBar(true),
141   myIsDispGlobalScalarBar(true),
142   mySpacing(0.01),
143   myFaceLimit(50000),
144   myShowBar(true)
145 {
146   if(MYDEBUG) MESSAGE("GaussPoints_i::GaussPoints_i - this = "<<this);
147 }
148
149
150 //----------------------------------------------------------------------------
151 VISU::Storable* 
152 VISU::GaussPoints_i
153 ::Create(const std::string& theMeshName, 
154            VISU::Entity theEntity,
155            const std::string& theFieldName, 
156            CORBA::Long theTimeStampNumber)
157 {
158   TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
159
160   SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
161
162   int anActiveLocal = aResourceMgr->integerValue( "VISU", "scalar_bar_active_local", GetIsActiveLocalScalarBar() );
163   SetIsActiveLocalScalarBar( anActiveLocal == 0 );
164
165   bool aDisplayGlobal = aResourceMgr->booleanValue( "VISU", "scalar_bar_diplay_global", GetIsDispGlobalScalarBar() );
166   SetIsDispGlobalScalarBar( aDisplayGlobal );
167
168   int aBicolor = aResourceMgr->integerValue( "VISU", "scalar_bar_bicolor", GetBiColor() );
169   SetBiColor( aBicolor == 0 );
170
171   vtkFloatingPointType aSpacing = aResourceMgr->doubleValue( "VISU", "scalar_bar_spacing", GetSpacing() );
172   SetSpacing( aSpacing );
173
174   vtkFloatingPointType aScaleFactor = aResourceMgr->doubleValue( "VISU", "deformed_shape_scale_factor", GetScaleFactor() );
175   SetScaleFactor( aScaleFactor );
176
177   int aPrimitiveType = aResourceMgr->integerValue( "VISU", "point_sprite_primitive_type", GetPrimitiveType() );
178   SetPrimitiveType( VISU::GaussPoints::PrimitiveType(aPrimitiveType) );
179
180   vtkFloatingPointType aClamp = aResourceMgr->doubleValue( "VISU", "point_sprite_clamp", GetClamp() );
181   SetClamp( aClamp );
182
183   int aMinSize = aResourceMgr->integerValue( "VISU", "point_sprite_min_size", ( int )( GetMinSize() * 100.0 ) );
184   SetMinSize( aMinSize / 100.0 );
185
186   int aMaxSize = aResourceMgr->integerValue( "VISU", "point_sprite_max_size", ( int )( GetMaxSize() * 100.0 ) );
187   SetMaxSize( aMaxSize / 100.0 );
188
189   int aGeomSize = aResourceMgr->integerValue( "VISU", "point_sprite_size", ( int )( GetGeomSize() * 100.0 ) );
190   SetGeomSize( aGeomSize / 100.0 );
191
192   int aMagnification = aResourceMgr->integerValue( "VISU", "point_sprite_magnification", ( int )( GetMagnification() * 100.0 ) );
193   SetMagnification( aMagnification / 100.0 );
194
195   vtkFloatingPointType anIncrement = aResourceMgr->doubleValue( "VISU", "point_sprite_increment", GetMagnificationIncrement() );
196   SetMagnificationIncrement( anIncrement );
197
198   bool isColored = aResourceMgr->booleanValue( "VISU", "point_sprite_results", GetIsColored() );
199   SetIsColored( isColored );
200
201   QColor aColor = aResourceMgr->colorValue( "VISU", "point_sprite_color", GetQColor() );
202   SetQColor( aColor );
203
204   vtkFloatingPointType anAlphaThreshold = aResourceMgr->doubleValue( "VISU", "point_sprite_alpha_threshold", GetAlphaThreshold() );
205   SetAlphaThreshold( anAlphaThreshold );
206
207   int aResolution = aResourceMgr->integerValue( "VISU", "geom_sphere_resolution", GetResolution() );
208   SetResolution( aResolution );
209
210   int aFaceLimit = aResourceMgr->integerValue( "VISU", "geom_sphere_face_limit", GetFaceLimit() );
211   SetFaceLimit( aFaceLimit );
212
213   QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/sprite_texture.bmp";
214   aMainTexture = aResourceMgr->stringValue( "VISU", "point_sprite_main_texture", aMainTexture );
215
216   QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/sprite_alpha.bmp";
217   anAlphaTexture = aResourceMgr->stringValue( "VISU", "point_sprite_alpha_texture", anAlphaTexture );
218
219   SetTextures( aMainTexture.toLatin1().data(), anAlphaTexture.toLatin1().data() );
220   
221   myShowBar = true;
222
223   return this;
224 }
225
226
227 //---------------------------------------------------------------
228 void 
229 VISU::GaussPoints_i
230 ::SameAs(const Prs3d_i* theOrigin)
231 {
232   TSuperClass::SameAs(theOrigin);
233
234   if(const GaussPoints_i* aPrs3d = dynamic_cast<const GaussPoints_i*>(theOrigin)){
235     GaussPoints_i* anOrigin = const_cast<GaussPoints_i*>(aPrs3d);
236
237     SetIsActiveLocalScalarBar(anOrigin->GetIsActiveLocalScalarBar());
238     SetIsDispGlobalScalarBar(anOrigin->GetIsDispGlobalScalarBar());
239
240     SetSpacing(anOrigin->GetSpacing());
241
242     SetFaceLimit(anOrigin->GetFaceLimit());
243
244     SetColor(anOrigin->GetColor());
245
246     SetBarVisible(anOrigin->IsBarVisible());
247
248     SetTextures(anOrigin->GetMainTexture(), anOrigin->GetAlphaTexture());
249   }
250 }
251
252 //----------------------------------------------------------------------------
253 CORBA::Float
254 VISU::GaussPoints_i
255 ::GetMemorySize()
256 {
257   return TSuperClass::GetMemorySize();
258 }
259
260 //----------------------------------------------------------------------------
261 VISU::Storable* 
262 VISU::GaussPoints_i
263 ::Restore(SALOMEDS::SObject_ptr theSObject,
264           const Storable::TRestoringMap& theMap)
265 {
266   if(!TSuperClass::Restore(theSObject, theMap))
267     return NULL;
268
269   // Check if the icon needs to be updated, update if necessary
270   SALOMEDS::Study_var aStudy = theSObject->GetStudy();
271   SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
272   SALOMEDS::GenericAttribute_var anAttr = 
273     aStudyBuilder->FindOrCreateAttribute(theSObject, "AttributePixMap");
274   SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
275
276   CORBA::String_var aPixMapName = aPixmap->GetPixMap();
277   if(strcmp(GetIconName(), aPixMapName.in()) != 0)
278     aPixmap->SetPixMap(GetIconName());
279     
280   QString aVal = VISU::Storable::FindValue(theMap,"myShowBar", "1");
281   SetBarVisible((aVal.toInt() == 1)? true : false);
282
283   SetIsActiveLocalScalarBar(Storable::FindValue(theMap,"myIsActiveLocalScalarBar").toInt());
284   SetIsDispGlobalScalarBar(Storable::FindValue(theMap,"myIsDispGlobalScalarBar").toInt());
285   SetBiColor(Storable::FindValue(theMap,"myIsBiColor").toInt());
286   SetSpacing(Storable::FindValue(theMap,"mySpacing").toDouble());
287
288   int aPrimitiveType = Storable::FindValue(theMap,"myPrimitiveType").toInt();
289   SetPrimitiveType(VISU::GaussPoints::PrimitiveType(aPrimitiveType));
290   SetClamp(Storable::FindValue(theMap,"myClamp").toDouble());
291   SetMinSize(Storable::FindValue(theMap,"myMinSize").toDouble());
292   SetMaxSize(Storable::FindValue(theMap,"myMaxSize").toDouble());
293   SetGeomSize(Storable::FindValue(theMap,"myGeomSize").toDouble());
294
295   SetMagnification(Storable::FindValue(theMap,"myMagnification").toDouble());
296   SetMagnificationIncrement(Storable::FindValue(theMap,"myMagnificationIncrement").toDouble());
297
298   SetIsDeformed(Storable::FindValue(theMap,"myIsDeformed").toInt());
299   SetScaleFactor(Storable::FindValue(theMap,"myScaleFactor").toDouble());
300
301   SetFaceLimit(Storable::FindValue(theMap,"myFaceLimit").toInt());
302
303   SetIsColored(Storable::FindValue(theMap,"myIsColored").toInt());
304   int aRed = Storable::FindValue(theMap,"myColor.R").toInt();
305   int aGreen = Storable::FindValue(theMap,"myColor.G").toInt();
306   int aBlue = Storable::FindValue(theMap,"myColor.B").toInt();
307   SetQColor( QColor(aRed, aGreen, aBlue) );
308
309   SetAlphaThreshold(Storable::FindValue(theMap,"myAlphaThreshold").toDouble());
310
311   SetTextures( Storable::FindValue(theMap,"myMainTexture").toLatin1().data(),
312                Storable::FindValue(theMap,"myAlphaTexture").toLatin1().data() );
313
314   SetResolution(Storable::FindValue(theMap,"myResolution").toInt());
315
316   return this;
317 }
318
319
320 //----------------------------------------------------------------------------
321 void
322 VISU::GaussPoints_i
323 ::ToStream(std::ostringstream& theStr)
324 {
325   TSuperClass::ToStream(theStr);
326
327   Storable::DataToStream( theStr, "myIsActiveLocalScalarBar", myIsActiveLocalScalarBar );
328   Storable::DataToStream( theStr, "myIsDispGlobalScalarBar", myIsDispGlobalScalarBar );
329   Storable::DataToStream( theStr, "myIsBiColor", GetBiColor() );
330   Storable::DataToStream( theStr, "mySpacing", GetSpacing() );
331
332   Storable::DataToStream( theStr, "myPrimitiveType", GetPrimitiveType() );
333   Storable::DataToStream( theStr, "myClamp", GetClamp() );
334   Storable::DataToStream( theStr, "myMinSize", GetMinSize() );
335   Storable::DataToStream( theStr, "myMaxSize", GetMaxSize() );
336   Storable::DataToStream( theStr, "myGeomSize", GetGeomSize() );
337
338   Storable::DataToStream( theStr, "myMagnification", GetMagnification() );
339   Storable::DataToStream( theStr, "myMagnificationIncrement", GetMagnificationIncrement() );
340
341   Storable::DataToStream( theStr, "myIsDeformed", GetIsDeformed() );
342   Storable::DataToStream( theStr, "myScaleFactor", GetScaleFactor() );
343
344   Storable::DataToStream( theStr, "myFaceLimit", GetFaceLimit() );
345
346   Storable::DataToStream( theStr, "myIsColored", GetIsColored() );
347   QColor aColor = GetQColor();
348   Storable::DataToStream( theStr, "myColor.R", aColor.red() );
349   Storable::DataToStream( theStr, "myColor.G", aColor.green() );
350   Storable::DataToStream( theStr, "myColor.B", aColor.blue() );
351
352   Storable::DataToStream( theStr, "myAlphaThreshold", GetAlphaThreshold() );
353   Storable::DataToStream( theStr, "myMainTexture", GetQMainTexture() );
354   Storable::DataToStream( theStr, "myAlphaTexture", GetQAlphaTexture() );
355
356   Storable::DataToStream( theStr, "myResolution", GetResolution() );
357   Storable::DataToStream( theStr, "myShowBar",    (IsBarVisible()? 1:0) );
358 }
359
360
361 VISU::GaussPoints_i
362 ::~GaussPoints_i()
363 {
364   if(MYDEBUG) MESSAGE("GaussPoints_i::~GaussPoints_i() - this = "<<this);
365 }
366
367
368 //----------------------------------------------------------------------------
369 CORBA::Long
370 VISU::GaussPoints_i
371 ::GetFaceLimit()
372 {
373   return myFaceLimit;
374 }
375
376 //----------------------------------------------------------------------------
377 void
378 VISU::GaussPoints_i
379 ::SetFaceLimit( CORBA::Long theFaceLimit )
380 {
381   if( myFaceLimit == theFaceLimit )
382     return;
383
384   VISU::TSetModified aModified(this);
385   
386   myFaceLimit = theFaceLimit;
387   myParamsTime.Modified();
388 }
389
390 //----------------------------------------------------------------------------
391 void
392 VISU::GaussPoints_i
393 ::SetIsDeformed( CORBA::Boolean theIsDeformed )
394 {
395   VISU::TSetModified aModified(this);
396   
397   myGaussPointsPL->SetIsDeformed( theIsDeformed );
398 }
399
400 CORBA::Boolean
401 VISU::GaussPoints_i
402 ::GetIsDeformed()
403 {
404   return myGaussPointsPL->GetIsDeformed();
405 }
406
407 //----------------------------------------------------------------------------
408 void
409 VISU::GaussPoints_i
410 ::SetScaleFactor( CORBA::Double theScaleFactor )
411 {
412   VISU::TSetModified aModified(this);
413   
414   myGaussPointsPL->SetScale( theScaleFactor );
415 }
416
417 CORBA::Double
418 VISU::GaussPoints_i
419 ::GetScaleFactor()
420 {
421   return myGaussPointsPL->GetScale();
422 }
423
424 //----------------------------------------------------------------------------
425 QColor
426 VISU::GaussPoints_i
427 ::GetQColor()
428 {
429   return myColor;
430 }
431
432 SALOMEDS::Color
433 VISU::GaussPoints_i
434 ::GetColor()
435 {
436   SALOMEDS::Color aColor;
437   aColor.R = myColor.red();
438   aColor.G = myColor.green();
439   aColor.B = myColor.blue();
440   return aColor;
441 }
442
443
444 //----------------------------------------------------------------------------
445 void
446 VISU::GaussPoints_i
447 ::SetQColor( const QColor& theColor )
448 {
449   if(myColor == theColor)
450     return;
451
452   VISU::TSetModified aModified(this);
453   
454   myColor = theColor;
455   myParamsTime.Modified();
456 }
457
458 void
459 VISU::GaussPoints_i
460 ::SetColor( const SALOMEDS::Color& theColor )
461 {
462   SetQColor(QColor(int(theColor.R), int(theColor.G), int(theColor.B)));
463 }
464
465
466 //----------------------------------------------------------------------------
467 void
468 VISU::GaussPoints_i
469 ::SetIsColored( bool theIsColored )
470 {
471   VISU::TSetModified aModified(this);
472   
473   myGaussPointsPL->SetIsColored( theIsColored );
474 }
475
476 bool
477 VISU::GaussPoints_i
478 ::GetIsColored()
479 {
480   return myGaussPointsPL->GetIsColored();
481 }
482
483 //----------------------------------------------------------------------------
484 bool
485 VISU::GaussPoints_i
486 ::SetMainTexture( const QString& theMainTexture ) 
487 {
488   if(myMainTexture != theMainTexture){
489     VISU::TSetModified aModified(this);
490   
491     myMainTexture = theMainTexture;
492     myParamsTime.Modified();
493     return true;
494   }
495
496   return false;
497 }
498
499 QString
500 VISU::GaussPoints_i
501 ::GetQMainTexture() 
502
503   return myMainTexture; 
504 }
505
506 char*
507 VISU::GaussPoints_i
508 ::GetMainTexture() 
509
510   return CORBA::string_dup(myMainTexture.toLatin1().data());
511 }
512
513
514 //----------------------------------------------------------------------------
515 bool
516 VISU::GaussPoints_i
517 ::SetAlphaTexture( const QString& theAlphaTexture ) 
518 {
519   if(myAlphaTexture != theAlphaTexture){
520     VISU::TSetModified aModified(this);
521   
522     myAlphaTexture = theAlphaTexture;
523     myParamsTime.Modified();
524     return true;
525   }
526
527   return false;
528 }
529
530 QString
531 VISU::GaussPoints_i
532 ::GetQAlphaTexture() 
533
534   return myAlphaTexture; 
535 }
536
537 char*
538 VISU::GaussPoints_i
539 ::GetAlphaTexture() 
540
541   return CORBA::string_dup(myAlphaTexture.toLatin1().data());
542 }
543
544
545 //----------------------------------------------------------------------------
546 void
547 VISU::GaussPoints_i
548 ::SetAlphaThreshold( CORBA::Double theAlphaThreshold )
549 {
550   VISU::TSetModified aModified(this);
551   
552   myGaussPointsPL->SetAlphaThreshold( theAlphaThreshold );
553 }
554
555 CORBA::Double
556 VISU::GaussPoints_i
557 ::GetAlphaThreshold()
558 {
559   return myGaussPointsPL->GetAlphaThreshold();
560 }
561
562 //----------------------------------------------------------------------------
563 void
564 VISU::GaussPoints_i
565 ::SetResolution( CORBA::Long theResolution )
566 {
567   VISU::TSetModified aModified(this);
568   
569   myGaussPointsPL->SetResolution( theResolution );
570 }
571
572 CORBA::Long
573 VISU::GaussPoints_i
574 ::GetResolution()
575 {
576   return myGaussPointsPL->GetResolution();
577 }
578
579 //----------------------------------------------------------------------------
580 void
581 VISU::GaussPoints_i
582 ::SetPrimitiveType(VISU::GaussPoints::PrimitiveType thePrimitiveType)
583 {
584   VISU::TSetModified aModified(this);
585   
586   myGaussPointsPL->SetPrimitiveType( thePrimitiveType );
587 }
588
589 VISU::GaussPoints::PrimitiveType
590 VISU::GaussPoints_i
591 ::GetPrimitiveType()
592 {
593   int aPrimitiveType = myGaussPointsPL->GetPrimitiveType();
594
595   if(aPrimitiveType == VISU_OpenGLPointSpriteMapper::OpenGLPoint)
596     return VISU::GaussPoints::POINT;
597
598   if(aPrimitiveType == VISU_OpenGLPointSpriteMapper::GeomSphere)
599     return VISU::GaussPoints::SPHERE;
600
601   return VISU::GaussPoints::SPRITE;
602 }
603
604 //----------------------------------------------------------------------------
605 vtkFloatingPointType
606 VISU::GaussPoints_i
607 ::GetMaximumSupportedSize()
608 {
609   return myGaussPointsPL->GetMaximumSupportedSize();
610 }
611
612 //----------------------------------------------------------------------------
613 void
614 VISU::GaussPoints_i
615 ::SetClamp(CORBA::Double theClamp)
616 {
617   VISU::TSetModified aModified(this);
618   
619   myGaussPointsPL->SetClamp( theClamp );
620 }
621
622 CORBA::Double
623 VISU::GaussPoints_i
624 ::GetClamp()
625 {
626   return myGaussPointsPL->GetClamp();
627 }
628
629 //----------------------------------------------------------------------------
630 void
631 VISU::GaussPoints_i
632 ::SetGeomSize( CORBA::Double theGeomSize )
633 {
634   VISU::TSetModified aModified(this);
635   
636   myGaussPointsPL->SetSize( theGeomSize );
637 }
638
639 CORBA::Double
640 VISU::GaussPoints_i
641 ::GetGeomSize()
642 {
643   return myGaussPointsPL->GetSize();
644 }
645
646 //----------------------------------------------------------------------------
647 void
648 VISU::GaussPoints_i
649 ::SetMinSize( CORBA::Double theMinSize )
650 {
651   VISU::TSetModified aModified(this);
652   
653   myGaussPointsPL->SetMinSize( theMinSize );
654 }
655
656 CORBA::Double
657 VISU::GaussPoints_i
658 ::GetMinSize()
659 {
660   return myGaussPointsPL->GetMinSize();
661 }
662
663 //----------------------------------------------------------------------------
664 void
665 VISU::GaussPoints_i
666 ::SetMaxSize( CORBA::Double theMaxSize )
667 {
668   VISU::TSetModified aModified(this);
669   
670   myGaussPointsPL->SetMaxSize( theMaxSize );
671 }
672
673 CORBA::Double
674 VISU::GaussPoints_i
675 ::GetMaxSize()
676 {
677   return myGaussPointsPL->GetMaxSize();
678 }
679
680 //----------------------------------------------------------------------------
681 void
682 VISU::GaussPoints_i
683 ::SetMagnification( CORBA::Double theMagnification )
684 {
685   VISU::TSetModified aModified(this);
686   
687   myGaussPointsPL->SetMagnification( theMagnification );
688 }
689
690 CORBA::Double
691 VISU::GaussPoints_i
692 ::GetMagnification()
693 {
694   return myGaussPointsPL->GetMagnification();
695 }
696
697 //----------------------------------------------------------------------------
698 void
699 VISU::GaussPoints_i
700 ::SetMagnificationIncrement( CORBA::Double theIncrement )
701 {
702   VISU::TSetModified aModified(this);
703   
704   myGaussPointsPL->SetMagnificationIncrement( theIncrement );
705 }
706
707 CORBA::Double
708 VISU::GaussPoints_i
709 ::GetMagnificationIncrement()
710 {
711   return myGaussPointsPL->GetMagnificationIncrement();
712 }
713
714 //----------------------------------------------------------------------------
715 void
716 VISU::GaussPoints_i
717 ::SetSourceGeometry()
718 {
719   int aNbGroups = myGroupNames.size();
720   if(aNbGroups != 0){
721     GetSpecificPL()->SetSourceGeometry();
722     myGroupNames.clear();
723     /*UpdateIcon();*/
724   }
725 }
726
727 //----------------------------------------------------------------------------
728 void
729 VISU::GaussPoints_i
730 ::AddMeshOnGroup(const char* theGroupName)
731 {
732   VISU::Result_i::PInput anInput = GetCResult()->GetInput();
733   VISU::PUnstructuredGridIDMapper anIDMapper = anInput->GetMeshOnGroup(GetCMeshName(), theGroupName);
734   if(anIDMapper){
735     int aNbGroups  = myGroupNames.size();
736     if(myGroupNames.find(theGroupName) == myGroupNames.end()){
737       GetSpecificPL()->AddGeometry(anIDMapper->GetOutput(), theGroupName);
738       myGroupNames.insert(theGroupName);
739       /*
740       if(aNbGroups == 0)
741         UpdateIcon();
742       */
743       // To update scalar range according to the new input (IPAL21305)
744       if(!IsRangeFixed())
745         SetSourceRange();
746     }
747   }
748 }
749
750
751 //----------------------------------------------------------------------------
752 void
753 VISU::GaussPoints_i
754 ::RemoveAllGeom()
755 {
756   int aNbGroups  = myGroupNames.size();
757   GetSpecificPL()->ClearGeometry();
758   myGroupNames.clear();
759   /*
760   if(aNbGroups != 0)
761     UpdateIcon();
762   */
763 }
764
765 //----------------------------------------------------------------------------
766 void
767 VISU::GaussPoints_i
768 ::DoSetInput(bool theIsInitilizePipe, bool theReInit)
769 {
770   VISU::Result_i::PInput anInput = GetCResult()->GetInput(GetCMeshName(),
771                                                           GetEntity(),
772                                                           GetCFieldName(),
773                                                           GetTimeStampNumber());
774   if(!anInput)
775     throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!");
776
777   SetField(anInput->GetField(GetCMeshName(),
778                              GetTEntity(),
779                              GetCFieldName()));
780   if(!GetField()) 
781     throw std::runtime_error("There is no Field with the parameters !!!");
782
783   VISU::PGaussPtsIDMapper aGaussPtsIDMapper =
784     anInput->GetTimeStampOnGaussPts(GetCMeshName(),
785                                     GetTEntity(),
786                                     GetCFieldName(),
787                                     GetTimeStampNumber());
788   if(!aGaussPtsIDMapper) 
789     throw std::runtime_error("There is no TimeStamp with the parameters !!!");
790
791   GetSpecificPL()->SetGaussPtsIDMapper(aGaussPtsIDMapper);
792 }
793
794
795 //----------------------------------------------------------------------------
796 bool
797 VISU::GaussPoints_i
798 ::CheckIsPossible() 
799 {
800   return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
801 }
802
803 void VISU::GaussPoints_i::SetBarVisible(CORBA::Boolean theVisible) 
804
805   if (myShowBar == theVisible)
806     return;
807   VISU::TSetModified aModified(this);
808   myShowBar = theVisible; 
809   myParamsTime.Modified();
810 }
811       
812 //----------------------------------------------------------------------------
813 void
814 VISU::GaussPoints_i
815 ::CreatePipeLine(VISU_PipeLine* thePipeLine)
816 {
817   if(!thePipeLine){
818     myGaussPointsPL = VISU_GaussPointsPL::New();
819   }else
820     myGaussPointsPL = dynamic_cast<VISU_GaussPointsPL*>(thePipeLine);
821
822   TSuperClass::CreatePipeLine(myGaussPointsPL);
823 }
824
825
826 //----------------------------------------------------------------------------
827 VISU_PipeLine* 
828 VISU::GaussPoints_i
829 ::GetActorPipeLine()
830 {
831   // We create a new PipeLine instance in order to provide
832   //   different representations for different actors (basic and segmented)
833   VISU_GaussPointsPL* aPipeLine = VISU_GaussPointsPL::New();
834   aPipeLine->ShallowCopy(GetPipeLine(), true);
835   return aPipeLine;
836 }
837
838
839 //----------------------------------------------------------------------------
840 bool 
841 VISU::GaussPoints_i
842 ::OnCreateActor(VISU_GaussPtsAct* theActor)
843 {
844   try{
845     TSuperClass::CreateActor(theActor);
846     UpdateActor(theActor);
847     return true;
848   }catch(...){
849     theActor->Delete();
850     throw ;
851   }
852   return false;
853 }
854
855 VISU_GaussPtsAct1* 
856 VISU::GaussPoints_i
857 ::OnCreateActor1()
858 {
859   VISU_GaussPtsAct1* anActor = VISU_GaussPtsAct1::New();
860   if(OnCreateActor(anActor))
861     return anActor;
862   return NULL;
863 }
864
865 VISU_GaussPtsAct2* 
866 VISU::GaussPoints_i
867 ::OnCreateActor2()
868 {
869   VISU_GaussPtsAct2* anActor = VISU_GaussPtsAct2::New();
870   if(OnCreateActor(anActor))
871     return anActor;
872   return NULL;
873 }
874
875 VISU_Actor* 
876 VISU::GaussPoints_i
877 ::CreateActor() 
878 {
879   VISU_GaussPtsAct* anActor = VISU_GaussPtsAct::New();
880   anActor->SetBarVisibility(myShowBar);
881   if(OnCreateActor(anActor))
882     return anActor;
883   return NULL;
884   //  return OnCreateActor1();
885 }
886
887 //----------------------------------------------------------------------------
888 VISU_GaussPtsAct2* 
889 VISU::GaussPoints_i
890 ::CloneActor(VISU_GaussPtsAct1* theActor) 
891 {
892   if(MYDEBUG) MESSAGE("GaussPoints_i::CloneActor - this = "<<this);
893   if(VISU_GaussPtsAct2* anActor = OnCreateActor2()){
894     theActor->Connect(anActor);
895     return anActor;
896   }
897   return NULL;
898 }
899
900
901 //----------------------------------------------------------------------------
902 void
903 VISU::GaussPoints_i
904 ::UpdateScalarBar(VISU_ScalarBarActor *theScalarBar,
905                   VISU_LookupTable* theLookupTable)
906 {
907   theScalarBar->SetTitle(GetScalarBarTitle().c_str());
908   theScalarBar->SetOrientation(GetBarOrientation());
909   theScalarBar->SetNumberOfLabels(GetLabels());
910   theScalarBar->SetRatios(GetTitleSize(), GetLabelSize(), 
911                           GetBarWidth(), GetBarHeight());
912   theScalarBar->SetLabelFormat(GetLabelsFormat());
913
914   VISU_LookupTable* aLookupTable = GetSpecificPL()->GetBarTable();
915   
916   theLookupTable->SetNumberOfColors(aLookupTable->GetNumberOfColors());
917   theScalarBar->SetMaximumNumberOfColors(aLookupTable->GetNumberOfColors());
918
919   vtkFloatingPointType anRGB[3];
920
921   vtkTextProperty* aTitleProp = theScalarBar->GetTitleTextProperty();
922   aTitleProp->SetFontFamily(GetTitFontType());
923
924   GetTitleColor(anRGB[0],anRGB[1],anRGB[2]);
925   aTitleProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
926
927   IsBoldTitle()? aTitleProp->BoldOn() : aTitleProp->BoldOff();
928   IsItalicTitle()? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
929   IsShadowTitle()? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
930   
931   vtkTextProperty* aLabelProp = theScalarBar->GetLabelTextProperty();
932   aLabelProp->SetFontFamily(GetLblFontType());
933
934   GetLabelColor(anRGB[0],anRGB[1],anRGB[2]);
935   aLabelProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
936
937   IsBoldLabel()? aLabelProp->BoldOn() : aLabelProp->BoldOff();
938   IsItalicLabel()? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
939   IsShadowLabel()? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
940   
941   theScalarBar->Modified();
942 }
943
944
945 //----------------------------------------------------------------------------
946 void 
947 VISU::GaussPoints_i
948 ::UpdateActor(VISU_ActorBase* theActor) 
949 {
950   if(VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(theActor)){
951     VISU_ScalarBarCtrl *aScalarBarCtrl = anActor->GetScalarBarCtrl();
952     if(GetIsColored()){
953       GetPipeLine()->GetMapper()->SetScalarVisibility(1);
954
955       if(IsRangeFixed()){
956         vtkFloatingPointType* aRange = GetSpecificPL()->GetScalarRange();
957         aScalarBarCtrl->SetRangeLocal(aRange);
958       }else{
959         vtkFloatingPointType aRange[2];
960         GetSpecificPL()->GetSourceRange(aRange);
961         aScalarBarCtrl->SetRangeLocal(aRange);
962       }
963
964       bool anIsMinMaxDone = IsGlobalRangeDefined();
965       aScalarBarCtrl->SetGlobalRangeIsDefined(anIsMinMaxDone);
966
967       TMinMax aTMinMax( GetComponentMin( GetScalarMode() ),
968                         GetComponentMax( GetScalarMode() ));
969       aScalarBarCtrl->SetRangeGlobal(aTMinMax.first, aTMinMax.second);
970       
971       VISU_ScalarBarCtrl::EMode aScalarBarMode = VISU_ScalarBarCtrl::eGlobal;
972       if(myIsActiveLocalScalarBar){
973         if(myIsDispGlobalScalarBar){
974           aScalarBarMode = VISU_ScalarBarCtrl::eLocal; 
975         }else{
976           aScalarBarMode = VISU_ScalarBarCtrl::eSimple; 
977         }
978       }
979       
980       if(aScalarBarMode == VISU_ScalarBarCtrl::eGlobal){
981         vtkFloatingPointType aRangeGlobal[2];
982         //
983         aRangeGlobal[0] = aTMinMax.first;
984         aRangeGlobal[1] = aTMinMax.second;
985         
986         GetSpecificPL()->GetMapper()->SetScalarRange(aRangeGlobal);
987       }
988       
989       aScalarBarCtrl->SetMode(aScalarBarMode);
990       
991       // Position
992       aScalarBarCtrl->SetWidth(GetWidth());
993       aScalarBarCtrl->SetHeight(GetHeight());
994
995       vtkFloatingPointType aPosition[] = {GetPosX(), GetPosY()};
996       aScalarBarCtrl->SetPosition(aPosition);
997       
998       aScalarBarCtrl->SetSpacing(mySpacing);
999       
1000       // Bicolor
1001       bool anIsBicolor = GetSpecificPL()->GetBicolor();
1002       aScalarBarCtrl->SetBicolor(anIsBicolor);
1003       
1004       UpdateScalarBar(aScalarBarCtrl->GetLocalBar(),
1005                       aScalarBarCtrl->GetLocalTable());
1006       
1007       UpdateScalarBar(aScalarBarCtrl->GetGlobalBar(),
1008                       aScalarBarCtrl->GetGlobalTable());
1009
1010       aScalarBarCtrl->Update();
1011     }else{
1012       GetPipeLine()->GetMapper()->SetScalarVisibility(0);
1013
1014       anActor->GetProperty()->SetColor(myColor.red() / 255.0,
1015                                        myColor.green() / 255.0,
1016                                        myColor.blue() / 255.0);
1017     }
1018     
1019     anActor->SetBarVisibility(myShowBar && GetIsColored()); 
1020
1021     if( GetSpecificPL()->GetPrimitiveType() != VISU_OpenGLPointSpriteMapper::GeomSphere )
1022       theActor->SetRepresentation( VTK_POINTS );
1023     else
1024       theActor->SetRepresentation( VTK_SURFACE );
1025       
1026     // Update values labels
1027
1028     vtkTextProperty* aProp = anActor->GetsValLabelsProps();
1029     if ( aProp )
1030     {
1031       aProp->SetFontFamily( GetValLblFontType() );
1032       aProp->SetFontSize( GetValLblFontSize() );
1033       aProp->SetBold( IsBoldValLbl() );
1034       aProp->SetItalic( IsItalicValLbl() );
1035       aProp->SetShadow( IsShadowValLbl() );
1036
1037       vtkFloatingPointType anRGB[ 3 ];
1038       GetValLblFontColor( anRGB[ 0 ], anRGB[ 1 ], anRGB[ 2 ] );
1039       aProp->SetColor( anRGB[ 0 ], anRGB[ 1 ], anRGB[ 2 ] );
1040     }
1041   }
1042   
1043   TSuperClass::UpdateActor(theActor);
1044 }
1045
1046 //----------------------------------------------------------------------------
1047 void
1048 VISU::GaussPoints_i
1049 ::UpdateFromActor(VISU_GaussPtsAct* theActor) 
1050 {
1051   if(MYDEBUG) MESSAGE("GaussPoints_i::UpdateFromActor - this = "<<this);
1052   myGaussPointsPL->ChangeMagnification(theActor->GetChangeMagnification());
1053   myParamsTime.Modified();
1054   UpdateActors();
1055 }
1056
1057
1058 //----------------------------------------------------------------------------
1059 void
1060 VISU::GaussPoints_i
1061 ::SetQTextures( const QString& theMainTexture, 
1062                 const QString& theAlphaTexture )
1063 {
1064   bool updateMainTexture = SetMainTexture( theMainTexture );
1065   bool updateAlphaTexture = SetAlphaTexture( theAlphaTexture );
1066   if( !updateMainTexture && !updateAlphaTexture )
1067     return;
1068
1069   VISU::TSetModified aModified(this);
1070   
1071   using namespace VISU;
1072   TTextureValue aTextureValue = GetTexture(theMainTexture.toLatin1().data(), 
1073                                            theAlphaTexture.toLatin1().data());
1074   myGaussPointsPL->SetImageData( aTextureValue.GetPointer() );
1075 }
1076
1077 void
1078 VISU::GaussPoints_i
1079 ::SetTextures( const char* theMainTexture, 
1080                const char* theAlphaTexture )
1081 {
1082   SetQTextures(theMainTexture, theAlphaTexture);
1083 }
1084
1085
1086 //----------------------------------------------------------------------------
1087 void
1088 VISU::GaussPoints_i
1089 ::SetIsActiveLocalScalarBar(CORBA::Boolean theIsActiveLocalScalarBar)
1090 {
1091   if(myIsActiveLocalScalarBar == theIsActiveLocalScalarBar)
1092     return;
1093
1094   VISU::TSetModified aModified(this);
1095   
1096   myIsActiveLocalScalarBar = theIsActiveLocalScalarBar;
1097
1098   if ( !theIsActiveLocalScalarBar || !IsRangeFixed() )
1099     SetSourceRange();
1100
1101   myParamsTime.Modified();
1102 }
1103
1104 CORBA::Boolean
1105 VISU::GaussPoints_i
1106 ::GetIsActiveLocalScalarBar() 
1107 {
1108   return myIsActiveLocalScalarBar;
1109 }
1110
1111 void
1112 VISU::GaussPoints_i
1113 ::SetIsDispGlobalScalarBar(CORBA::Boolean theIsDispGlobalScalarBar)
1114 {
1115   if(myIsDispGlobalScalarBar == theIsDispGlobalScalarBar)
1116     return;
1117
1118   VISU::TSetModified aModified(this);
1119   
1120   myIsDispGlobalScalarBar = theIsDispGlobalScalarBar;
1121   myParamsTime.Modified();
1122 }
1123
1124 bool
1125 VISU::GaussPoints_i
1126 ::IsGlobalRangeDefined() const 
1127 {
1128   return GetCResult()->IsMinMaxDone();
1129 }
1130
1131 //----------------------------------------------------------------------------
1132 void
1133 VISU::GaussPoints_i
1134 ::SetSourceRange()
1135 {
1136   VISU::TSetModified aModified(this);
1137
1138   vtkFloatingPointType aScalarRange[2] = {GetSourceMin(), GetSourceMax()};
1139   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ColoredPL, vtkFloatingPointType*>
1140                    (GetSpecificPL(), &VISU_ColoredPL::SetScalarRange, aScalarRange));
1141
1142   UseFixedRange(false);
1143 }
1144
1145
1146 //----------------------------------------------------------------------------
1147 struct TGetSourceMin: public SALOME_Event
1148 {
1149   VISU::GaussPoints_i* myColoredPrs3d;
1150
1151   typedef CORBA::Double TResult;
1152   TResult myResult;
1153   
1154   TGetSourceMin( VISU::GaussPoints_i* theColoredPrs3d ):
1155     myColoredPrs3d( theColoredPrs3d )
1156   {}
1157     
1158   virtual
1159   void
1160   Execute()
1161   {
1162     if ( myColoredPrs3d->IsTimeStampFixed() || myColoredPrs3d->GetIsActiveLocalScalarBar() ) {
1163       vtkFloatingPointType aRange[2];
1164       myColoredPrs3d->GetSpecificPL()->GetSourceRange(aRange);
1165       myResult = aRange[0];
1166     }else{
1167       VISU::TNames aGroupNames = myColoredPrs3d->GetSpecificPL()->GetGeometryNames();
1168       VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myColoredPrs3d->GetScalarMode(), aGroupNames );
1169       myResult = aTMinMax.first;
1170     }
1171   }
1172 };
1173
1174
1175 //----------------------------------------------------------------------------
1176 CORBA::Double 
1177 VISU::GaussPoints_i
1178 ::GetSourceMin()
1179 {
1180   return ProcessEvent( new TGetSourceMin( this ) );
1181 }
1182
1183
1184 //----------------------------------------------------------------------------
1185 struct TGetSourceMax: public SALOME_Event
1186 {
1187   VISU::GaussPoints_i* myColoredPrs3d;
1188
1189   typedef CORBA::Double TResult;
1190   TResult myResult;
1191   
1192   TGetSourceMax( VISU::GaussPoints_i* theColoredPrs3d ):
1193     myColoredPrs3d( theColoredPrs3d )
1194   {}
1195     
1196   virtual
1197   void
1198   Execute()
1199   {
1200     if ( myColoredPrs3d->IsTimeStampFixed() || myColoredPrs3d->GetIsActiveLocalScalarBar() ) {
1201       vtkFloatingPointType aRange[2];
1202       myColoredPrs3d->GetSpecificPL()->GetSourceRange(aRange);
1203       myResult = aRange[1];
1204     }else{
1205       VISU::TNames aGroupNames = myColoredPrs3d->GetSpecificPL()->GetGeometryNames();
1206       VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myColoredPrs3d->GetScalarMode(), aGroupNames );
1207       myResult = aTMinMax.second;
1208     }
1209   }
1210 };
1211
1212
1213 //----------------------------------------------------------------------------
1214 CORBA::Double 
1215 VISU::GaussPoints_i
1216 ::GetSourceMax()
1217 {
1218   return ProcessEvent( new TGetSourceMax( this ) );
1219 }
1220
1221
1222 //----------------------------------------------------------------------------
1223 CORBA::Boolean
1224 VISU::GaussPoints_i
1225 ::GetIsDispGlobalScalarBar()
1226 {
1227   return myIsDispGlobalScalarBar;
1228 }
1229
1230
1231 void
1232 VISU::GaussPoints_i
1233 ::SetBiColor(CORBA::Boolean theIsBiColor)
1234 {
1235   VISU::TSetModified aModified(this);
1236
1237   GetSpecificPL()->SetBicolor(theIsBiColor);
1238 }
1239
1240 CORBA::Boolean
1241 VISU::GaussPoints_i
1242 ::GetBiColor() 
1243 {
1244   return GetSpecificPL()->GetBicolor();
1245 }
1246
1247 void
1248 VISU::GaussPoints_i
1249 ::SetSpacing(CORBA::Double theSpacing)
1250 {
1251   if(VISU::CheckIsSameValue(mySpacing, theSpacing))
1252     return;
1253
1254   VISU::TSetModified aModified(this);
1255
1256   mySpacing = theSpacing;
1257   myParamsTime.Modified();
1258 }
1259
1260 CORBA::Double
1261 VISU::GaussPoints_i
1262 ::GetSpacing()
1263 {
1264   return mySpacing;
1265 }
1266
1267 //----------------------------------------------------------------------------
1268 struct TGaussGetComponentMin: public SALOME_Event
1269 {
1270   VISU::ColoredPrs3d_i* myColoredPrs3d;
1271   vtkIdType myCompID;
1272   
1273   typedef CORBA::Double TResult;
1274   TResult myResult;
1275   
1276   TGaussGetComponentMin( VISU::ColoredPrs3d_i* theColoredPrs3d,
1277                          vtkIdType theCompID ):
1278     myColoredPrs3d( theColoredPrs3d ),
1279     myCompID( theCompID )
1280   {}
1281     
1282   virtual
1283   void
1284   Execute()
1285   {
1286     VISU::TNames aGroupNames;
1287     if(VISU::GaussPoints_i* aPrs3d = dynamic_cast<VISU::GaussPoints_i*>(myColoredPrs3d))
1288       aGroupNames = aPrs3d->GetSpecificPL()->GetGeometryNames();
1289
1290     VISU::PMinMaxController aMinMaxController = myColoredPrs3d->GetMinMaxController();
1291     if ( aMinMaxController ) {
1292       myResult = aMinMaxController->GetComponentMin( myCompID );
1293     } else {
1294       VISU::TMinMax aTMinMax = myColoredPrs3d->GetScalarField()->GetMinMax( myCompID, aGroupNames );
1295       myResult = aTMinMax.first;
1296     }
1297   }
1298 };
1299
1300
1301 //----------------------------------------------------------------------------
1302 vtkFloatingPointType 
1303 VISU::GaussPoints_i
1304 ::GetComponentMin(vtkIdType theCompID)
1305 {
1306   return ProcessEvent( new TGaussGetComponentMin( this, theCompID ) );
1307 }
1308
1309 //----------------------------------------------------------------------------
1310 struct TGaussGetComponentMax: public SALOME_Event
1311 {
1312   VISU::ColoredPrs3d_i* myColoredPrs3d;
1313   vtkIdType myCompID;
1314
1315   typedef CORBA::Double TResult;
1316   TResult myResult;
1317   
1318   TGaussGetComponentMax( VISU::ColoredPrs3d_i* theColoredPrs3d,
1319                          vtkIdType theCompID ):
1320     myColoredPrs3d( theColoredPrs3d ),
1321     myCompID( theCompID )
1322   {}
1323     
1324   virtual
1325   void
1326   Execute()
1327   {
1328     VISU::TNames aGroupNames;
1329     if(VISU::GaussPoints_i* aPrs3d = dynamic_cast<VISU::GaussPoints_i*>(myColoredPrs3d))
1330       aGroupNames = aPrs3d->GetSpecificPL()->GetGeometryNames();
1331
1332     VISU::PMinMaxController aMinMaxController = myColoredPrs3d->GetMinMaxController();
1333     if ( aMinMaxController ) {
1334       myResult = aMinMaxController->GetComponentMax( myCompID );
1335     } else {
1336       VISU::TMinMax aTMinMax = myColoredPrs3d->GetScalarField()->GetMinMax( myCompID, aGroupNames );
1337       myResult = aTMinMax.second;
1338     }
1339   }
1340 };
1341
1342
1343 //----------------------------------------------------------------------------
1344 vtkFloatingPointType 
1345 VISU::GaussPoints_i
1346 ::GetComponentMax(vtkIdType theCompID)
1347 {
1348   return ProcessEvent( new TGaussGetComponentMax( this, theCompID ) );
1349 }