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