]> SALOME platform Git repositories - modules/visu.git/blobdiff - src/CONVERTOR/VISU_Structures_impl.cxx
Salome HOME
Merge from V5_1_main 14/05/2010
[modules/visu.git] / src / CONVERTOR / VISU_Structures_impl.cxx
index 589435e0fbd1bb097e15d1720e92f934cae139e7..a0c1012b66523b3498974573bcd694152465c256 100644 (file)
@@ -1,4 +1,4 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -19,7 +19,8 @@
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-//  File:    
+
+//  File:
 //  Author:  Alexey PETROV
 //  Module : VISU
 //
@@ -43,26 +44,26 @@ namespace VISU
 {
   /*  vtkIdType
   VISUGeom2NbNodes(EGeometry theGeom)
-  { 
+  {
     switch(theGeom){
 #ifndef VISU_ENABLE_QUADRATIC
-    case VISU::eSEG3: 
+    case VISU::eSEG3:
       return 2;
-    case VISU::eTRIA6: 
+    case VISU::eTRIA6:
       return 3;
-    case VISU::eQUAD8: 
+    case VISU::eQUAD8:
       return 4;
-    case VISU::eTETRA10: 
+    case VISU::eTETRA10:
       return 4;
-    case VISU::eHEXA20: 
+    case VISU::eHEXA20:
       return 8;
-    case VISU::ePENTA15: 
+    case VISU::ePENTA15:
       return 6;
-    case VISU::ePYRA13: 
+    case VISU::ePYRA13:
       return 5;
 #endif
-    case VISU::ePOLYGONE: 
-    case VISU::ePOLYEDRE: 
+    case VISU::ePOLYGONE:
+    case VISU::ePOLYEDRE:
       return -1;
     default:
       return theGeom % 100;
@@ -71,91 +72,91 @@ namespace VISU
 
   vtkIdType
   VISUGeom2VTK(EGeometry theGeom)
-  { 
+  {
     switch(theGeom){
-    case VISU::ePOINT1: 
+    case VISU::ePOINT1:
       return VTK_VERTEX;
-    case VISU::eSEG2: 
+    case VISU::eSEG2:
       return VTK_LINE;
-    case VISU::eTRIA3: 
+    case VISU::eTRIA3:
       return VTK_TRIANGLE;
-    case VISU::eQUAD4: 
+    case VISU::eQUAD4:
       return VTK_QUAD;
-    case VISU::eTETRA4: 
+    case VISU::eTETRA4:
       return VTK_TETRA;
-    case VISU::eHEXA8: 
+    case VISU::eHEXA8:
       return VTK_HEXAHEDRON;
-    case VISU::ePENTA6: 
+    case VISU::ePENTA6:
       return VTK_WEDGE;
-    case VISU::ePYRA5: 
+    case VISU::ePYRA5:
       return VTK_PYRAMID;
 
-    case VISU::ePOLYGONE: 
+    case VISU::ePOLYGONE:
       return VTK_POLYGON;
-    case VISU::ePOLYEDRE: 
+    case VISU::ePOLYEDRE:
       return VTK_CONVEX_POINT_SET;
 
 #ifndef VISU_ENABLE_QUADRATIC
-    case VISU::eSEG3: 
+    case VISU::eSEG3:
       return VTK_LINE;
-    case VISU::eTRIA6: 
+    case VISU::eTRIA6:
       return VTK_TRIANGLE;
-    case VISU::eQUAD8: 
+    case VISU::eQUAD8:
       return VTK_QUAD;
-    case VISU::eTETRA10: 
+    case VISU::eTETRA10:
       return VTK_TETRA;
-    case VISU::eHEXA20: 
+    case VISU::eHEXA20:
       return VTK_HEXAHEDRON;
-    case VISU::ePENTA15: 
+    case VISU::ePENTA15:
       return VTK_WEDGE;
-    case VISU::ePYRA13: 
+    case VISU::ePYRA13:
       return VTK_PYRAMID;
 
 #else
 
-    case VISU::eSEG3: 
+    case VISU::eSEG3:
 #if defined(VTK_QUADRATIC_EDGE) && defined(VISU_USE_VTK_QUADRATIC)
       return VTK_QUADRATIC_EDGE;
 #else
       return VTK_POLY_LINE;
 #endif
 
-    case VISU::eTRIA6: 
+    case VISU::eTRIA6:
 #if defined(VTK_QUADRATIC_TRIANGLE) && defined(VISU_USE_VTK_QUADRATIC)
       return VTK_QUADRATIC_TRIANGLE;
 #else
       return VTK_POLYGON;
 #endif
 
-    case VISU::eQUAD8: 
+    case VISU::eQUAD8:
 #if defined(VTK_QUADRATIC_QUAD) && defined(VISU_USE_VTK_QUADRATIC)
       return VTK_QUADRATIC_QUAD;
 #else
       return VTK_POLYGON;
 #endif
 
-    case VISU::eTETRA10: 
+    case VISU::eTETRA10:
 #if defined(VTK_QUADRATIC_TETRA) && defined(VISU_USE_VTK_QUADRATIC)
       return VTK_QUADRATIC_TETRA;
 #else
       return VTK_CONVEX_POINT_SET;
 #endif
 
-    case VISU::eHEXA20: 
+    case VISU::eHEXA20:
 #if defined(VTK_QUADRATIC_HEXAHEDRON) && defined(VISU_USE_VTK_QUADRATIC)
       return VTK_QUADRATIC_HEXAHEDRON;
 #else
       return VTK_CONVEX_POINT_SET;
 #endif
 
-    case VISU::ePENTA15: 
+    case VISU::ePENTA15:
 #if defined(VTK_QUADRATIC_WEDGE) && defined(VISU_USE_VTK_QUADRATIC)
       return VTK_QUADRATIC_WEDGE;
 #else
       return VTK_CONVEX_POINT_SET;
 #endif
 
-    case VISU::ePYRA13: 
+    case VISU::ePYRA13:
 #if defined(VTK_QUADRATIC_PYRAMID) && defined(VISU_USE_VTK_QUADRATIC)
       return VTK_QUADRATIC_PYRAMID;
 #else
@@ -172,63 +173,63 @@ namespace VISU
 
   EGeometry
   VTKGeom2VISU(vtkIdType theGeom)
-  { 
+  {
     switch(theGeom){
-    case VTK_VERTEX: 
+    case VTK_VERTEX:
       return VISU::ePOINT1;
-    case VTK_LINE: 
+    case VTK_LINE:
       return VISU::eSEG2;
-    case VTK_TRIANGLE: 
+    case VTK_TRIANGLE:
       return VISU::eTRIA3;
-    case VTK_QUAD: 
+    case VTK_QUAD:
       return VISU::eQUAD4;
-    case VTK_TETRA: 
+    case VTK_TETRA:
       return VISU::eTETRA4;
-    case VTK_HEXAHEDRON: 
+    case VTK_HEXAHEDRON:
       return VISU::eHEXA8;
-    case VTK_WEDGE: 
+    case VTK_WEDGE:
       return VISU::ePENTA6;
-    case VTK_PYRAMID: 
+    case VTK_PYRAMID:
       return VISU::ePYRA5;
 
-    case VTK_POLYGON: 
+    case VTK_POLYGON:
       return VISU::ePOLYGONE;
-    case VTK_CONVEX_POINT_SET: 
+    case VTK_CONVEX_POINT_SET:
       return VISU::ePOLYEDRE;
 
 #if defined(VISU_ENABLE_QUADRATIC) && defined(VISU_USE_VTK_QUADRATIC)
   #if defined(VTK_QUADRATIC_EDGE)
-    case VTK_QUADRATIC_EDGE: 
+    case VTK_QUADRATIC_EDGE:
       return VISU::eSEG3;
   #endif
 
   #if defined(VTK_QUADRATIC_TRIANGLE)
-    case VTK_QUADRATIC_TRIANGLE: 
+    case VTK_QUADRATIC_TRIANGLE:
       return VISU::eTRIA6;
   #endif
 
   #if defined(VTK_QUADRATIC_QUAD)
-    case VTK_QUADRATIC_QUAD: 
+    case VTK_QUADRATIC_QUAD:
       return VISU::eQUAD8;
   #endif
 
   #if defined(VTK_QUADRATIC_TETRA)
-    case VTK_QUADRATIC_TETRA: 
+    case VTK_QUADRATIC_TETRA:
       return VISU::eTETRA10;
   #endif
 
   #if defined(VTK_QUADRATIC_HEXAHEDRON)
-    case VTK_QUADRATIC_HEXAHEDRON: 
+    case VTK_QUADRATIC_HEXAHEDRON:
       return VISU::eHEXA20;
   #endif
 
   #if defined(VTK_QUADRATIC_WEDGE)
-    case VTK_QUADRATIC_WEDGE: 
+    case VTK_QUADRATIC_WEDGE:
       return VISU::ePENTA15;
   #endif
 
   #if defined(VTK_QUADRATIC_PYRAMID)
-    case VTK_QUADRATIC_PYRAMID: 
+    case VTK_QUADRATIC_PYRAMID:
       return VISU::ePYRA13;
   #endif
 
@@ -255,9 +256,9 @@ namespace VISU
    */
   size_t
   GetDataSetSize(size_t theNbOfPoints,
-                size_t theNbOfCells,
-                size_t theCellsSize,
-                bool theComputeLinks)
+                 size_t theNbOfCells,
+                 size_t theCellsSize,
+                 bool theComputeLinks)
   {
     size_t aPointsSize = 3*theNbOfPoints*sizeof(VISU::TCoord);
     size_t aConnectivityAndTypesSize = theCellsSize*sizeof(vtkIdType);
@@ -283,7 +284,7 @@ namespace VISU
   ::TPolyDataHolder()
   {}
 
-  const PPolyData& 
+  const PPolyData&
   TPolyDataHolder
   ::GetSource() const
   {
@@ -294,7 +295,7 @@ namespace VISU
     return mySource;
   }
 
-  vtkPolyData* 
+  vtkPolyData*
   TPolyDataHolder
   ::GetPolyDataOutput()
   {
@@ -322,7 +323,7 @@ namespace VISU
   ::TUnstructuredGridHolder()
   {}
 
-  const PUnstructuredGrid& 
+  const PUnstructuredGrid&
   TUnstructuredGridHolder
   ::GetSource() const
   {
@@ -333,7 +334,7 @@ namespace VISU
     return mySource;
   }
 
-  vtkUnstructuredGrid* 
+  vtkUnstructuredGrid*
   TUnstructuredGridHolder
   ::GetUnstructuredGridOutput()
   {
@@ -363,8 +364,8 @@ namespace VISU
   {
     if(myIsVTKDone){
       if(vtkDataSet* anOutput = GetOutput()){
-       anOutput->Update();
-       return anOutput->GetActualMemorySize() * 1024;
+        anOutput->Update();
+        return anOutput->GetActualMemorySize() * 1024;
       }
     }
     throw std::runtime_error("TMemoryCheckIDMapper::GetMemorySize - myIsVTKDone == false !!!");
@@ -377,7 +378,7 @@ namespace VISU
   ::TAppendFilterHolder()
   {}
 
-  const PAppendFilter& 
+  const PAppendFilter&
   TAppendFilterHolder
   ::GetFilter() const
   {
@@ -389,7 +390,7 @@ namespace VISU
     return myFilter;
   }
 
-  vtkUnstructuredGrid* 
+  vtkUnstructuredGrid*
   TAppendFilterHolder
   ::GetUnstructuredGridOutput()
   {
@@ -402,7 +403,7 @@ namespace VISU
   ::TAppendPolyDataHolder()
   {}
 
-  const PAppendPolyData& 
+  const PAppendPolyData&
   TAppendPolyDataHolder
   ::GetFilter() const
   {
@@ -414,7 +415,7 @@ namespace VISU
     return myFilter;
   }
 
-  vtkPolyData* 
+  vtkPolyData*
   TAppendPolyDataHolder
   ::GetPolyDataOutput()
   {
@@ -428,7 +429,7 @@ namespace VISU
   ::TMergeFilterHolder()
   {}
 
-  const PMergeFilter& 
+  const PMergeFilter&
   TMergeFilterHolder
   ::GetFilter() const
   {
@@ -439,7 +440,7 @@ namespace VISU
     return myFilter;
   }
 
-  vtkDataSet* 
+  vtkDataSet*
   TMergeFilterHolder
   ::GetOutput()
   {
@@ -450,7 +451,7 @@ namespace VISU
 
   //---------------------------------------------------------------
   TMeshImpl
-  ::TMeshImpl(): 
+  ::TMeshImpl():
     myNbPoints(0)
   {}
 
@@ -460,14 +461,14 @@ namespace VISU
   {
     return myNbPoints;
   }
-  
+
   vtkIdType
   TMeshImpl::
   GetDim() const
   {
     return myDim;
   }
-  
+
   vtkPointSet*
   TMeshImpl::
   GetPointSet()
@@ -489,7 +490,7 @@ namespace VISU
   {
     if ( !mySubMeshID.empty() )
       return mySubMeshID[theID];
-    
+
     return theID;
   }
 
@@ -499,9 +500,9 @@ namespace VISU
   ::GetElemVTKID(vtkIdType theID) const
   {
     if ( !mySubMeshID.empty() )
-      for ( size_t anId = 0; anId < mySubMeshID.size(); anId++ ) 
-       if ( mySubMeshID[ anId ] == theID ) 
-         return anId;
+      for ( size_t anId = 0; anId < mySubMeshID.size(); anId++ )
+        if ( mySubMeshID[ anId ] == theID )
+          return anId;
 
     return theID;
   }
@@ -545,7 +546,7 @@ namespace VISU
   {
     return myNamedPointCoords->GetObjID(theID);
   }
-  
+
   vtkIdType
   TProfileImpl
   ::GetNodeVTKID(vtkIdType theID) const
@@ -553,7 +554,7 @@ namespace VISU
     return myNamedPointCoords->GetVTKID(theID);
   }
 
-  vtkFloatingPointType*  
+  vtkFloatingPointType*
   TProfileImpl
   ::GetNodeCoord(vtkIdType theObjID)
   {
@@ -578,7 +579,7 @@ namespace VISU
     return VISU::GetElemVTKID(GetFilter()->GetOutput(), theID);
   }
 
-  vtkCell* 
+  vtkCell*
   TProfileImpl
   ::GetElemCell(vtkIdType theObjID)
   {
@@ -588,8 +589,8 @@ namespace VISU
     vtkIdType aVtkID = GetElemVTKID(theObjID);
     return GetFilter()->GetOutput()->GetCell(aVtkID);
   }
-  
-  vtkUnstructuredGrid* 
+
+  vtkUnstructuredGrid*
   TProfileImpl
   ::GetUnstructuredGridOutput()
   {
@@ -614,14 +615,14 @@ namespace VISU
     return aSize;
   }
 
-  std::string 
+  std::string
   TProfileImpl
   ::GetNodeName(vtkIdType theObjID) const
   {
     return myNamedPointCoords->GetNodeName(theObjID);
   }
 
-  std::string 
+  std::string
   TProfileImpl
   ::GetElemName(vtkIdType theObjID) const
   {
@@ -645,7 +646,7 @@ namespace VISU
   {
     return myIDMapper->GetNodeObjID(theID);
   }
-  
+
   vtkIdType
   TUnstructuredGridIDMapperImpl
   ::GetNodeVTKID(vtkIdType theID) const
@@ -653,7 +654,7 @@ namespace VISU
     return myIDMapper->GetNodeVTKID(theID);
   }
 
-  vtkFloatingPointType*  
+  vtkFloatingPointType*
   TUnstructuredGridIDMapperImpl
   ::GetNodeCoord(vtkIdType theObjID)
   {
@@ -674,21 +675,21 @@ namespace VISU
     return myIDMapper->GetElemVTKID(theID);
   }
 
-  vtkCell* 
+  vtkCell*
   TUnstructuredGridIDMapperImpl
   ::GetElemCell(vtkIdType theObjID)
   {
     return myIDMapper->GetElemCell(theObjID);
   }
-  
-  void 
+
+  void
   TUnstructuredGridIDMapperImpl
   ::SetReferencedMesh( const PNamedIDMapper& theNamedIDMapper )
   {
     myCommonCellsFilter->SetCellsUG( theNamedIDMapper->GetUnstructuredGridOutput() );
   }
 
-  void 
+  void
   TUnstructuredGridIDMapperImpl
   ::Build()
   {
@@ -705,16 +706,19 @@ namespace VISU
       aFilter->SetScalars( aDataSet );
       aFilter->SetVectors( aDataSet );
       aFilter->AddField( "VISU_FIELD", aDataSet );
+      aFilter->AddField( "VISU_FIELD_GAUSS_MIN", aDataSet );
+      aFilter->AddField( "VISU_FIELD_GAUSS_MAX", aDataSet );
+      aFilter->AddField( "VISU_FIELD_GAUSS_MOD", aDataSet );
       aFilter->AddField( "VISU_CELLS_MAPPER", aDataSet );
       aFilter->AddField( "ELNO_FIELD", aDataSet );
       aFilter->AddField( "ELNO_COMPONENT_MAPPER", aDataSet );
       aFilter->AddField( "VISU_POINTS_MAPPER", aDataSet );
-                                                     
+
       myCommonCellsFilter->SetProfileUG( aFilter->GetUnstructuredGridOutput() );
-    } 
+    }
   }
 
-  vtkUnstructuredGrid* 
+  vtkUnstructuredGrid*
   TUnstructuredGridIDMapperImpl
   ::GetUnstructuredGridOutput()
   {
@@ -722,14 +726,14 @@ namespace VISU
     return myCommonCellsFilter->GetOutput();
   }
 
-  vtkDataSet* 
+  vtkDataSet*
   TUnstructuredGridIDMapperImpl
   ::GetOutput()
   {
     return GetUnstructuredGridOutput();
   }
 
-  PUnstructuredGrid 
+  PUnstructuredGrid
   TUnstructuredGridIDMapperImpl
   ::GetSource()
   {
@@ -758,7 +762,7 @@ namespace VISU
   {
     return myIDMapper->GetNodeObjID(theID);
   }
-  
+
   vtkIdType
   TPolyDataIDMapperImpl
   ::GetNodeVTKID(vtkIdType theID) const
@@ -766,7 +770,7 @@ namespace VISU
     return myIDMapper->GetNodeVTKID(theID);
   }
 
-  vtkFloatingPointType*  
+  vtkFloatingPointType*
   TPolyDataIDMapperImpl
   ::GetNodeCoord(vtkIdType theObjID)
   {
@@ -787,36 +791,39 @@ namespace VISU
     return myIDMapper->GetElemVTKID(theID);
   }
 
-  vtkCell* 
+  vtkCell*
   TPolyDataIDMapperImpl
   ::GetElemCell(vtkIdType theObjID)
   {
     return myIDMapper->GetElemCell(theObjID);
   }
-  
-  void 
+
+  void
   TPolyDataIDMapperImpl
   ::Build()
   {
     if ( !myFilter.GetPointer() ) {
       const PAppendPolyData& anAppendFilter = myIDMapper->GetFilter();
       vtkPolyData* aGeometry = anAppendFilter->GetOutput();
-      
+
       const PPolyData& aSource = mySource.GetSource();
       vtkPolyData* aDataSet = aSource.GetPointer();
       aDataSet->ShallowCopy( aGeometry );
-      
+
       const PMergeFilter& aFilter = GetFilter();
       aFilter->SetGeometry( aGeometry );
       aFilter->SetScalars( aDataSet );
       aFilter->SetVectors( aDataSet );
       aFilter->AddField( "VISU_FIELD", aDataSet );
+      aFilter->AddField( "VISU_FIELD_GAUSS_MIN", aDataSet );
+      aFilter->AddField( "VISU_FIELD_GAUSS_MAX", aDataSet );
+      aFilter->AddField( "VISU_FIELD_GAUSS_MOD", aDataSet );
       aFilter->AddField( "VISU_CELLS_MAPPER", aDataSet );
       aFilter->AddField( "VISU_POINTS_MAPPER", aDataSet );
     }
   }
 
-  vtkPolyData* 
+  vtkPolyData*
   TPolyDataIDMapperImpl
   ::GetPolyDataOutput()
   {
@@ -824,14 +831,14 @@ namespace VISU
     return myFilter->GetPolyDataOutput();
   }
 
-  vtkDataSet* 
+  vtkDataSet*
   TPolyDataIDMapperImpl
   ::GetOutput()
   {
     return GetPolyDataOutput();
   }
 
-  PPolyData 
+  PPolyData
   TPolyDataIDMapperImpl
   ::GetSource()
   {
@@ -855,11 +862,11 @@ namespace VISU
     myGeom(EGeometry(-1)),
     myNbPoints(0)
   {}
-  
+
   void
   TGaussImpl
   ::LessThan(const PGaussImpl& theGauss,
-            bool& theResult) const
+             bool& theResult) const
   {
     theResult = false;
   }
@@ -872,14 +879,14 @@ namespace VISU
     myStatus(eNone),
     myStartID(0)
   {}
-  
+
   TGaussPointID
   TGaussSubMeshImpl
   ::GetObjID(vtkIdType theID) const
   {
     TCellID aCellID = myStartID + theID / myGauss->myNbPoints;
     TLocalPntID aLocalPntID = theID % myGauss->myNbPoints;
-    
+
     return TGaussPointID(aCellID, aLocalPntID);
   }
 
@@ -891,7 +898,7 @@ namespace VISU
 
     TCellID aCellID = theID.first;
     TLocalPntID aLocalPntID = theID.second;
-    
+
     vtkIdType aNbPoints = myGauss->myNbPoints;
     if ( aLocalPntID >= aNbPoints )
       return aResult;
@@ -905,8 +912,8 @@ namespace VISU
   {
     return mySubProfile->GetElemObjID( theID );
   }
-  
-  
+
+
   vtkIdType
   VISU::TGaussSubMeshImpl
   ::GetElemVTKID(vtkIdType theID) const
@@ -914,7 +921,7 @@ namespace VISU
     return mySubProfile->GetElemVTKID( theID );
   }
 
-  vtkIdType 
+  vtkIdType
   TGaussSubMeshImpl
   ::GetGlobalID(vtkIdType theID) const
   {
@@ -937,7 +944,7 @@ namespace VISU
     PGaussSubMeshImpl aLeft(theLeft), aRight(theRight);
     const PGaussImpl& aGaussLeft = aLeft->myGauss;
     const PGaussImpl& aGaussRight = aRight->myGauss;
-    
+
     if(aGaussLeft->myGeom != aGaussRight->myGeom)
       return aGaussLeft->myGeom < aGaussRight->myGeom;
 
@@ -957,7 +964,7 @@ namespace VISU
     myParent(NULL)
   {}
 
-  TGaussPointID 
+  TGaussPointID
   TGaussMeshImpl
   ::GetObjID(vtkIdType theID) const
   {
@@ -965,7 +972,7 @@ namespace VISU
     return VISU::GetObjID(aFilter->GetOutput(), theID);
   }
 
-  vtkIdType 
+  vtkIdType
   TGaussMeshImpl
   ::GetVTKID(const TGaussPointID& theID) const
   {
@@ -974,34 +981,34 @@ namespace VISU
     TCellID aCellID = theID.first;
 
     vtkIdType aVTKCellId = GetParent()->GetElemVTKID( aCellID );
-    if ( aVTKCellId < 0 ) 
+    if ( aVTKCellId < 0 )
       return aResult;
-      
+
     vtkCell* aCell = GetParent()->GetElemCell( aCellID );
     if ( !aCell )
       return aResult;
 
     EGeometry aVGeom = VISU::VTKGeom2VISU( aCell->GetCellType() );
-    if ( aVGeom < EGeometry(0) ) 
+    if ( aVGeom < EGeometry(0) )
       return aResult;
-    
+
     TGeom2GaussSubMesh::const_iterator anIter = myGeom2GaussSubMesh.find( aVGeom );
     if ( anIter == myGeom2GaussSubMesh.end() )
       return aResult;
-      
+
     size_t aSubMeshEnd = myGaussSubMeshArr.size();
     const PGaussSubMeshImpl& aGaussSubMesh = anIter->second;
     for ( size_t aSubMeshId = 0; aSubMeshId < aSubMeshEnd; aSubMeshId++ ) {
       const PGaussSubMeshImpl& aSubMesh = myGaussSubMeshArr[aSubMeshId];
       if ( aGaussSubMesh.get() == aSubMesh.get() ) {
-       return aGaussSubMesh->GetVTKID(theID);
+        return aGaussSubMesh->GetVTKID(theID);
       }
     }
 
     return aResult;
   }
 
-  vtkPolyData* 
+  vtkPolyData*
   TGaussMeshImpl
   ::GetPolyDataOutput()
   {
@@ -1023,7 +1030,7 @@ namespace VISU
     return aSize;
   }
 
-  TNamedIDMapper* 
+  TNamedIDMapper*
   TGaussMeshImpl
   ::GetParent() const
   {
@@ -1032,35 +1039,35 @@ namespace VISU
 
 
   //---------------------------------------------------------------
-  TGaussPointID 
+  TGaussPointID
   TGaussPtsIDFilter
   ::GetObjID(vtkIdType theID) const
   {
     return myGaussPtsIDMapper->GetObjID(theID);
   }
 
-  vtkIdType 
+  vtkIdType
   TGaussPtsIDFilter
   ::GetVTKID(const TGaussPointID& theID) const
   {
     return myGaussPtsIDMapper->GetVTKID(theID);
   }
-  
-  TNamedIDMapper* 
+
+  TNamedIDMapper*
   TGaussPtsIDFilter
   ::GetParent() const
   {
     return myGaussPtsIDMapper->GetParent();
   }
 
-  vtkPolyData* 
+  vtkPolyData*
   TGaussPtsIDFilter
   ::GetPolyDataOutput()
   {
     return TPolyDataIDMapperImpl::GetPolyDataOutput();
   }
 
-  vtkDataSet* 
+  vtkDataSet*
   TGaussPtsIDFilter
   ::GetOutput()
   {
@@ -1080,8 +1087,8 @@ namespace VISU
   {
     TStructured::CopyStructure( theStructured );
 
-    if ( PMeshImpl aMesh = theStructured ) 
-      GetSource()->ShallowCopy( aMesh->GetPointSet() );    
+    if ( PMeshImpl aMesh = theStructured )
+      GetSource()->ShallowCopy( aMesh->GetPointSet() );
   }
 
   vtkIdType
@@ -1091,7 +1098,7 @@ namespace VISU
     return myStartID + theID;
   }
 
-  std::string 
+  std::string
   TSubMeshImpl
   ::GetElemName(vtkIdType theObjID) const
   {
@@ -1124,8 +1131,8 @@ namespace VISU
   {
     TStructured::CopyStructure( theStructured );
 
-    if ( PMeshImpl aMesh = theStructured ) 
-      myNamedPointCoords = aMesh->myNamedPointCoords;    
+    if ( PMeshImpl aMesh = theStructured )
+      myNamedPointCoords = aMesh->myNamedPointCoords;
   }
 
   vtkIdType
@@ -1156,14 +1163,14 @@ namespace VISU
     return VISU::GetElemObjID(GetFilter()->GetOutput(), theID);
   }
 
-  std::string 
+  std::string
   TMeshOnEntityImpl
   ::GetNodeName(vtkIdType theObjID) const
   {
     return myNamedPointCoords->GetNodeName(theObjID);
   }
 
-  std::string 
+  std::string
   TMeshOnEntityImpl
   ::GetElemName(vtkIdType theObjID) const
   {
@@ -1172,7 +1179,7 @@ namespace VISU
     return aSubMesh->GetElemName(anInputCellID.second);
   }
 
-  vtkUnstructuredGrid* 
+  vtkUnstructuredGrid*
   TMeshOnEntityImpl
   ::GetUnstructuredGridOutput()
   {
@@ -1218,7 +1225,7 @@ namespace VISU
     else{
       TID2ID::const_iterator anIter = myElemObj2VTKID.find(theID);
       if(anIter != myElemObj2VTKID.end())
-       return anIter->second;
+        return anIter->second;
     }
     return -1;
   }
@@ -1230,21 +1237,21 @@ namespace VISU
     return myMeshID[theID];
   }
 
-  vtkIdType 
+  vtkIdType
   TFamilyImpl
-  ::GetNodeObjID(vtkIdType theID) const 
+  ::GetNodeObjID(vtkIdType theID) const
   {
     return myNamedPointCoords->GetObjID(theID);
   }
 
   vtkIdType
   TFamilyImpl
-  ::GetNodeVTKID(vtkIdType theID) const 
+  ::GetNodeVTKID(vtkIdType theID) const
   {
     return myNamedPointCoords->GetVTKID(theID);
   }
 
-  vtkUnstructuredGrid* 
+  vtkUnstructuredGrid*
   TFamilyImpl
   ::GetUnstructuredGridOutput()
   {
@@ -1277,18 +1284,18 @@ namespace VISU
   {
     TStructured::CopyStructure( theStructured );
 
-    if ( PMeshImpl aMesh = theStructured ) 
+    if ( PMeshImpl aMesh = theStructured )
       myNamedPointCoords = aMesh->myNamedPointCoords;
   }
 
-  TNbASizeCells 
+  TNbASizeCells
   TGroupImpl
   ::GetNbASizeCells() const
   {
     vtkIdType aNbCells = 0, aCellsSize = 0;
     TFamilySet::const_iterator anIter = myFamilySet.begin();
     for(; anIter != myFamilySet.end(); anIter++){
-      PFamilyImpl aFamily = *anIter; 
+      PFamilyImpl aFamily = (*anIter).second;
       aNbCells += aFamily->myNbCells;
       aCellsSize += aFamily->myCellsSize;
     }
@@ -1304,7 +1311,7 @@ namespace VISU
     else{
       TID2ID::const_iterator anIter = myElemObj2VTKID.find(theID);
       if(anIter != myElemObj2VTKID.end())
-       return anIter->second;
+        return anIter->second;
     }
     return -1;
   }
@@ -1316,21 +1323,21 @@ namespace VISU
     return VISU::GetElemObjID(GetFilter()->GetOutput(), theID);
   }
 
-  vtkIdType 
+  vtkIdType
   TGroupImpl
-  ::GetNodeObjID(vtkIdType theID) const 
+  ::GetNodeObjID(vtkIdType theID) const
   {
     return myNamedPointCoords->GetObjID(theID);
   }
 
   vtkIdType
   TGroupImpl
-  ::GetNodeVTKID(vtkIdType theID) const 
+  ::GetNodeVTKID(vtkIdType theID) const
   {
     return myNamedPointCoords->GetVTKID(theID);
   }
 
-  vtkUnstructuredGrid* 
+  vtkUnstructuredGrid*
   TGroupImpl
   ::GetUnstructuredGridOutput()
   {
@@ -1352,7 +1359,7 @@ namespace VISU
   }
 
 
-  
+
   //---------------------------------------------------------------
   TFieldImpl
   ::TFieldImpl()
@@ -1360,51 +1367,109 @@ namespace VISU
     , myDataType( 0 )
   {}
 
-  void 
+  void
   TFieldImpl
   ::Init(vtkIdType theNbComp,
-        vtkIdType theDataType)
+         vtkIdType theDataType)
   {
     myNbComp = theNbComp;
     myDataType = theDataType;
     myCompNames.resize(theNbComp);
     myUnitNames.resize(theNbComp);
-    myMinMaxArr.resize(theNbComp + 1);
-    myAverageMinMaxArr.resize(theNbComp + 1);
-    for(vtkIdType iComp = 0; iComp <= theNbComp; iComp++){
-      TMinMax& aMinMax = myMinMaxArr[iComp];
-      aMinMax.first = VTK_LARGE_FLOAT;
-      aMinMax.second = -VTK_LARGE_FLOAT;
-      TMinMax& anAverageMinMax = myAverageMinMaxArr[iComp];
-      anAverageMinMax.first = VTK_LARGE_FLOAT;
-      anAverageMinMax.second = -VTK_LARGE_FLOAT;
+
+    myMetric2Comp2MinMax.resize(3);
+    myMetric2Comp2AverageMinMax.resize(3);
+    myMetric2Comp2Group2MinMax.resize(3);
+    myMetric2Comp2Group2AverageMinMax.resize(3);
+    for(int aGaussMetric = (int)VISU::AVERAGE_METRIC; aGaussMetric <= (int)VISU::MAXIMUM_METRIC; aGaussMetric++){
+      TComp2MinMax& aComp2MinMax = myMetric2Comp2MinMax[aGaussMetric];
+      TComp2MinMax& aComp2AverageMinMax = myMetric2Comp2AverageMinMax[aGaussMetric];
+      TComp2Group2MinMax& aComp2Group2MinMax = myMetric2Comp2Group2MinMax[aGaussMetric];
+      TComp2Group2MinMax& aComp2Group2AverageMinMax = myMetric2Comp2Group2AverageMinMax[aGaussMetric];
+
+      aComp2MinMax.resize(theNbComp + 1);
+      aComp2AverageMinMax.resize(theNbComp + 1);
+      aComp2Group2MinMax.resize(theNbComp + 1);
+      aComp2Group2AverageMinMax.resize(theNbComp + 1);
+      for(vtkIdType iComp = 0; iComp <= theNbComp; iComp++){
+        TMinMax& aMinMax = aComp2MinMax[iComp];
+        aMinMax.first = VTK_LARGE_FLOAT;
+        aMinMax.second = -VTK_LARGE_FLOAT;
+        TMinMax& anAverageMinMax = aComp2AverageMinMax[iComp];
+        anAverageMinMax.first = VTK_LARGE_FLOAT;
+        anAverageMinMax.second = -VTK_LARGE_FLOAT;
+      }
     }
   }
 
-  vtkIdType 
+  vtkIdType
   TFieldImpl
   ::GetDataType() const
   {
     return myDataType;
   }
 
-  TMinMax 
+  TMinMax
   TFieldImpl
-  ::GetMinMax(vtkIdType theCompID)
+  ::GetMinMax(vtkIdType theCompID, const TNames& theGroupNames, TGaussMetric theGaussMetric)
   {
-    return myMinMaxArr[theCompID];
+    TMinMax aMinMax;
+    bool anIsMinMaxInitialized = false;
+    if( !theGroupNames.empty() ) {
+      aMinMax.first = VTK_LARGE_FLOAT;
+      aMinMax.second = -VTK_LARGE_FLOAT;
+
+      const TGroup2MinMax& aGroup2MinMax = myMetric2Comp2Group2MinMax[theGaussMetric][theCompID];
+      TNames::const_iterator aNameIter = theGroupNames.begin();
+      for( ; aNameIter != theGroupNames.end(); aNameIter++ ) {
+        TGroup2MinMax::const_iterator aGroup2MinMaxIter = aGroup2MinMax.find( *aNameIter );
+        if( aGroup2MinMaxIter != aGroup2MinMax.end() ) {
+          const TMinMax& aGroupMinMax = aGroup2MinMaxIter->second;
+          aMinMax.first = std::min( aMinMax.first, aGroupMinMax.first );
+          aMinMax.second = std::max( aMinMax.second, aGroupMinMax.second );
+          anIsMinMaxInitialized = true;
+        }
+      }
+    }
+
+    if( !anIsMinMaxInitialized )
+      aMinMax = myMetric2Comp2MinMax[theGaussMetric][theCompID];
+
+    return aMinMax;
   }
 
 
-  TMinMax 
+  TMinMax
   TFieldImpl
-  ::GetAverageMinMax(vtkIdType theCompID)
+  ::GetAverageMinMax(vtkIdType theCompID, const TNames& theGroupNames, TGaussMetric theGaussMetric)
   {
-    return myAverageMinMaxArr[theCompID];
+    TMinMax aMinMax;
+    bool anIsMinMaxInitialized = false;
+    if( !theGroupNames.empty() ) {
+      aMinMax.first = VTK_LARGE_FLOAT;
+      aMinMax.second = -VTK_LARGE_FLOAT;
+
+      const TGroup2MinMax& aGroup2MinMax = myMetric2Comp2Group2AverageMinMax[theGaussMetric][theCompID];
+      TNames::const_iterator aNameIter = theGroupNames.begin();
+      for( ; aNameIter != theGroupNames.end(); aNameIter++ ) {
+        TGroup2MinMax::const_iterator aGroup2MinMaxIter = aGroup2MinMax.find( *aNameIter );
+        if( aGroup2MinMaxIter != aGroup2MinMax.end() ) {
+          const TMinMax& aGroupMinMax = aGroup2MinMaxIter->second;
+          aMinMax.first = std::min( aMinMax.first, aGroupMinMax.first );
+          aMinMax.second = std::max( aMinMax.second, aGroupMinMax.second );
+          anIsMinMaxInitialized = true;
+        }
+      }
+    }
+
+    if( !anIsMinMaxInitialized )
+      aMinMax = myMetric2Comp2AverageMinMax[theGaussMetric][theCompID];
+
+    return aMinMax;
   }
-  
+
   //----------------------------------------------------------------------------
-  const PMeshValue& 
+  const PMeshValue&
   TGeom2Value
   ::GetMeshValue(EGeometry theGeom) const
   {
@@ -1413,8 +1478,8 @@ namespace VISU
       EXCEPTION(std::runtime_error,"TGeom2Value::GetMeshValue - myGeom2MeshValue.find(theGeom) fails");
     return anIter->second;
   }
-  
-  PMeshValue& 
+
+  PMeshValue&
   TGeom2Value
   ::GetMeshValue(EGeometry theGeom)
   {
@@ -1423,21 +1488,21 @@ namespace VISU
 
 
   //----------------------------------------------------------------------------
-  TGeom2MeshValue& 
+  TGeom2MeshValue&
   TGeom2Value
   ::GetGeom2MeshValue()
   {
     return myGeom2MeshValue;
   }
-    
-  const TGeom2MeshValue& 
+
+  const TGeom2MeshValue&
   TGeom2Value
   ::GetGeom2MeshValue() const
   {
     return myGeom2MeshValue;
   }
 
-  PMeshValue 
+  PMeshValue
   TGeom2Value
   ::GetFirstMeshValue() const
   {
@@ -1454,35 +1519,35 @@ namespace VISU
     myUnstructuredGridIDMapper(new TUnstructuredGridIDMapperImpl())
   {}
 
-  const PMeshValue& 
+  const PMeshValue&
   TValForTimeImpl
   ::GetMeshValue(EGeometry theGeom) const
   {
     return myGeom2Value.GetMeshValue(theGeom);
   }
-  
-  PMeshValue& 
+
+  PMeshValue&
   TValForTimeImpl
   ::GetMeshValue(EGeometry theGeom)
   {
     return myGeom2Value.GetMeshValue(theGeom);
   }
 
-  TGeom2MeshValue& 
+  TGeom2MeshValue&
   TValForTimeImpl
   ::GetGeom2MeshValue()
   {
     return myGeom2Value.GetGeom2MeshValue();
   }
 
-  const TGeom2MeshValue& 
+  const TGeom2MeshValue&
   TValForTimeImpl
   ::GetGeom2MeshValue() const
   {
     return myGeom2Value.GetGeom2MeshValue();
   }
 
-  PMeshValue 
+  PMeshValue
   TValForTimeImpl
   ::GetFirstMeshValue() const
   {
@@ -1499,7 +1564,19 @@ namespace VISU
     }
     return anIter->second;
   }
-  
+
+  int
+  TValForTimeImpl
+  ::GetMaxNbGauss() const
+  {
+    int aNbGauss = 1;
+    TGeom2NbGauss::const_iterator anIter = myGeom2NbGauss.begin();
+    for(; anIter != myGeom2NbGauss.end(); anIter++){
+      aNbGauss = std::max<int>(aNbGauss, anIter->second);
+    }
+    return aNbGauss;
+  }
+
   unsigned long int
   TValForTimeImpl
   ::GetMemorySize()
@@ -1516,6 +1593,5 @@ namespace VISU
     return aSize;
   }
 
-
   //---------------------------------------------------------------
 }