]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix of the following issues: V5_1_main_20090608 V5_1_main_20090626 V5_1_main_20090713 V5_1_main_20090714 before_mergefrom_V5_1_2_BR_14Jul09
authorouv <ouv@opencascade.com>
Mon, 1 Jun 2009 13:28:35 +0000 (13:28 +0000)
committerouv <ouv@opencascade.com>
Mon, 1 Jun 2009 13:28:35 +0000 (13:28 +0000)
0019930: EDF 779 VISU : Filter group inactive in animation
0020090: EDF 889 VISU : Field range on groups selected

15 files changed:
src/CONVERTOR/VISU_MedConvertor.cxx
src/CONVERTOR/VISU_MedConvertor.hxx
src/CONVERTOR/VISU_Structures.hxx
src/CONVERTOR/VISU_Structures_impl.cxx
src/CONVERTOR/VISU_Structures_impl.hxx
src/PIPELINE/VISU_GaussPointsPL.cxx
src/PIPELINE/VISU_GaussPointsPL.hxx
src/PIPELINE/VISU_MergedPL.cxx
src/PIPELINE/VISU_MergedPL.hxx
src/PIPELINE/VISU_ScalarMapPL.cxx
src/PIPELINE/VISU_ScalarMapPL.hxx
src/VISUGUI/VisuGUI_InputPane.cxx
src/VISU_I/VISU_ColoredPrs3d_i.cc
src/VISU_I/VISU_GaussPoints_i.cc
src/VISU_I/VISU_ScalarMap_i.cc

index 8d0f0e6a25923148fc944b5813a72a27d2d40edb..467a4957a8b3704fc96b64eaf0ab70fbb7a30a39 100644 (file)
@@ -518,6 +518,7 @@ namespace
       aMeshOnEntity->myMeshName = aMeshName;
       aMeshOnEntity->myGeom2Size = aGeom2Size;
       VISU::TFamilyID2CellsSize& aFamilyID2CellsSize = aMeshOnEntity->myFamilyID2CellsSize;
+      VISU::TGeom2ElemID2FamilyID& aGeom2ElemID2FamilyID = aMeshOnEntity->myGeom2ElemID2FamilyID;
 
       INITMSG(MYDEBUG,
              "- aMEntity = "<<aMEntity<<
@@ -528,10 +529,13 @@ namespace
        aMeshOnEntity->myNbCells = theMesh->myNbPoints;
        aMeshOnEntity->myCellsSize = 2*theMesh->myNbPoints;
        
+       VISU::TElemID2FamilyID& anElemID2FamilyID = aGeom2ElemID2FamilyID[MED::ePOINT1];
+
        for(TInt iElem = 0; iElem < theMesh->myNbPoints; iElem++){
          TInt aFamId = theNodeInfo->GetFamNum(iElem);
          if(aFamId != 0)
            aFamilyID2CellsSize[aFamId] += 2;
+         anElemID2FamilyID[iElem] = aFamId;
        }
        
        INITMSG(MYDEBUG,
@@ -546,6 +550,7 @@ namespace
        for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
          const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
          
+         VISU::TElemID2FamilyID& anElemID2FamilyID = aGeom2ElemID2FamilyID[aMGeom];
          switch(aMGeom){
          case MED::ePOLYGONE: {
            MED::PPolygoneInfo aPolygoneInfo = theMEDWrapper->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
@@ -563,6 +568,7 @@ namespace
              TInt aFamId = aPolygoneInfo->GetFamNum(anElemId);
              if(aFamId != 0)
                aFamilyID2CellsSize[aFamId] += aNbConn + 1;
+             anElemID2FamilyID[anElemId] = aFamId;
            }
            break;
          }
@@ -589,6 +595,7 @@ namespace
              TInt aFamId = aPolyedreInfo->GetFamNum(anElemId);
              if(aFamId != 0)
                aFamilyID2CellsSize[aFamId] += aCellSize + 1;
+             anElemID2FamilyID[anElemId] = aFamId;
            }
            break;
          }
@@ -611,6 +618,7 @@ namespace
              TInt aFamId = aCellInfo->GetFamNum(iElem);
              if(aFamId != 0)
                aFamilyID2CellsSize[aFamId] += aVNbNodes + 1;
+             anElemID2FamilyID[iElem] = aFamId;
            }
          }} // end switch(...)
        }
@@ -684,6 +692,7 @@ namespace
       aMeshOnEntity->myMeshName = aMeshName;
       aMeshOnEntity->myGeom2Size = aGeom2Size;
       VISU::TFamilyID2CellsSize& aFamilyID2CellsSize = aMeshOnEntity->myFamilyID2CellsSize;
+      VISU::TGeom2ElemID2FamilyID& aGeom2ElemID2FamilyID = aMeshOnEntity->myGeom2ElemID2FamilyID;
 
       INITMSG(MYDEBUG,
              "- aMEntity = "<<aMEntity<<
@@ -694,11 +703,14 @@ namespace
        aMeshOnEntity->myNbCells = theGrilleInfo->GetNbNodes();
        aMeshOnEntity->myCellsSize = 2*theGrilleInfo->GetNbNodes();
 
+       VISU::TElemID2FamilyID& anElemID2FamilyID = aGeom2ElemID2FamilyID[MED::ePOINT1];
+
        if((theGrilleInfo->myFamNumNode).size() > 0)
        for(TInt iElem = 0; iElem < theGrilleInfo->GetNbNodes(); iElem++){
          TInt aFamId = theGrilleInfo->GetFamNumNode(iElem);
          if(aFamId != 0)
            aFamilyID2CellsSize[aFamId] += 2;
+         anElemID2FamilyID[iElem] = aFamId;
        }
        
        INITMSG(MYDEBUG,
@@ -717,6 +729,8 @@ namespace
          TInt aNbElem = aGeom2SizeIter->second;//theGrilleInfo->GetNbCells();
          aMeshOnEntity->myNbCells += aNbElem;
          aMeshOnEntity->myCellsSize += aNbElem*(aVNbNodes+1);
+
+         VISU::TElemID2FamilyID& anElemID2FamilyID = aGeom2ElemID2FamilyID[aMGeom];
          
          INITMSG(MYDEBUG,
                  "- aMGeom = "<<aMGeom<<
@@ -730,6 +744,7 @@ namespace
            TInt aFamId = theGrilleInfo->GetFamNum(iElem);
            if(aFamId != 0)
              aFamilyID2CellsSize[aFamId] += aVNbNodes + 1;
+           anElemID2FamilyID[iElem] = aFamId;
          }
        }
       }
@@ -863,6 +878,7 @@ namespace
       VISU::PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[aVEntity];
       const VISU::TFamilyID2CellsSize& aFamilyID2CellsSize = aMeshOnEntity->myFamilyID2CellsSize;
       VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
+      VISU::TFamilyIDMap& aFamilyIDMap = aMeshOnEntity->myFamilyIDMap;
        
       if(aFamilyTSizeSet.empty())
        continue;
@@ -893,7 +909,17 @@ namespace
        VISU::TFamilyID2CellsSize::const_iterator anIter = aFamilyID2CellsSize.find(anId);
        if(anIter != aFamilyID2CellsSize.end())
          aFamily->myCellsSize = anIter->second;
-       
+
+       const TInt aNbGroup = aFamilyInfo->GetNbGroup();
+       VISU::TNames& aGroupNames = aFamily->myGroupNames;
+       aGroupNames.resize(aNbGroup);
+       for(TInt i = 0; i < aNbGroup; i++){
+         std::string aGroupName = aFamilyInfo->GetGroupName(i);
+         aGroupNames[i] = aGroupName;
+       }
+
+       aFamilyIDMap[anId] = aFamily;
+
        INITMSG(MY_FAMILY_DEBUG,
                "- aFamilyName = '"<<aFamilyName<<"'"<<
                "; myId = "<<aFamily->myId<<"; "<<
@@ -904,7 +930,6 @@ namespace
                "; myCellsSize = "<<aFamily->myCellsSize<<
                endl);
 #ifdef _DEBUG_ 
-       const TInt aNbGroup = aFamilyInfo->GetNbGroup();
        for(TInt i = 0; i < aNbGroup; i++){
          std::string aGroupName = aFamilyInfo->GetGroupName(i);
          INITMSG(MY_FAMILY_DEBUG,"- aGroupName = '"<<aGroupName<<"'\n");
@@ -956,6 +981,7 @@ namespace
        aMeshOnEntity = aMeshOnEntityIter->second;
 
       VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
+      VISU::TFamilyIDMap& aFamilyIDMap = aMeshOnEntity->myFamilyIDMap;
 
       VISU::PMEDFamily aFamily = aFamilyMap[aFamilyName](new VISU::TMEDFamily());
       aFamily->myId = anId;
@@ -972,6 +998,16 @@ namespace
       if(aFam2NbCellsIter != aFam2NbCells.end())
        aFamily->myNbCells = aFam2NbCellsIter->second;
 
+      const TInt aNbGroup = aFamilyInfo->GetNbGroup();
+      VISU::TNames& aGroupNames = aFamily->myGroupNames;
+      aGroupNames.resize(aNbGroup);
+      for(TInt i = 0; i < aNbGroup; i++){
+       std::string aGroupName = aFamilyInfo->GetGroupName(i);
+       aGroupNames[i] = aGroupName;
+      }
+
+      aFamilyIDMap[anId] = aFamily;
+
       INITMSG(MY_FAMILY_DEBUG,
              "- aFamilyName =|"<<aFamily->myName<<"|"
              << "; myId = "<<aFamily->myId
@@ -1551,12 +1587,18 @@ VISU_MedConvertor
 template<class TimeStampValueType>
 void
 BuildTimeStampMinMax(MED::SharedPtr<TimeStampValueType> theTimeStampValue,
+                    const VISU::PMEDMeshOnEntity theMeshOnEntity,
                     const MED::TGeom2Gauss& theGeom2Gauss,
                     VISU::TMinMaxArr& theMinMaxArr,
                      VISU::TMinMaxArr& theAverageMinMaxArr,
+                    VISU::TGroup2MinMaxArr& theGroup2MinMaxArr,
+                    VISU::TGroup2MinMaxArr& theGroup2AverageMinMaxArr,
                     TInt theNbComp,
                     TInt theNbComp2)
 {
+  const VISU::TFamilyIDMap& aFamilyIDMap = theMeshOnEntity->myFamilyIDMap;
+  VISU::TGeom2ElemID2FamilyID aGeom2ElemID2FamilyID = theMeshOnEntity->myGeom2ElemID2FamilyID;
+
   const typename TimeStampValueType::TTGeom2Value& aGeom2Value = theTimeStampValue->myGeom2Value;
   typename TimeStampValueType::TTGeom2Value::const_iterator anIter = aGeom2Value.begin();
   for(; anIter != aGeom2Value.end(); anIter++){
@@ -1575,6 +1617,8 @@ BuildTimeStampMinMax(MED::SharedPtr<TimeStampValueType> theTimeStampValue,
            "; aNbElem = "<<aNbElem<<
            "; aNbGauss = "<<aNbGauss<<
            endl);
+
+    VISU::TElemID2FamilyID anElemID2FamilyID = aGeom2ElemID2FamilyID[aMGeom];
     
     bool isAverageByGaussPoints = (aNbGauss > 1);
     // To calculate min/max per components
@@ -1589,6 +1633,28 @@ BuildTimeStampMinMax(MED::SharedPtr<TimeStampValueType> theTimeStampValue,
         vtkFloatingPointType& anAverageMin = anAverageMinMax.first;
        vtkFloatingPointType& anAverageMax = anAverageMinMax.second;
         vtkFloatingPointType anAverageValue = 0.0;
+
+       VISU::TGroup2MinMax& aGroup2MinMax = theGroup2MinMaxArr[iComp+1];
+       VISU::TGroup2MinMax& aGroup2AverageMinMax = theGroup2AverageMinMaxArr[iComp+1];
+       std::map<VISU::TName,vtkFloatingPointType> aGroup2AverageValue;
+
+       // get names of groups, to which the element belongs
+       VISU::TNames aGroupNames;
+       VISU::TElemID2FamilyID::const_iterator anIter = anElemID2FamilyID.find(iElem);
+       if(anIter != anElemID2FamilyID.end()){
+         int aFamilyId = anIter->second;
+         if(aFamilyId != 0){
+           VISU::TFamilyIDMap::const_iterator aFamilyIter = aFamilyIDMap.find(aFamilyId);
+           if(aFamilyIter != aFamilyIDMap.end()){
+             VISU::PMEDFamily aFamily = aFamilyIter->second;
+             aGroupNames = aFamily->myGroupNames;
+             VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
+             for(; aGroupIter != aGroupNames.end(); aGroupIter++)
+               aGroup2AverageValue[*aGroupIter] = 0.0;
+           }
+         }
+       }
+
         for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
          const vtkFloatingPointType& aVal = aMValueSlice[iGauss];
           aMin = std::min(aMin,aVal);
@@ -1600,11 +1666,46 @@ BuildTimeStampMinMax(MED::SharedPtr<TimeStampValueType> theTimeStampValue,
             anAverageMin = aMin;
             anAverageMax = aMax;
           }
+
+         // additional calculation for each group, to which the element belongs
+         VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
+         for(; aGroupIter != aGroupNames.end(); aGroupIter++){
+           VISU::TName aGroupName = *aGroupIter;
+           bool isGroupFound = aGroup2MinMax.find(aGroupName) != aGroup2MinMax.end();
+           VISU::TMinMax& aGroupMinMax = aGroup2MinMax[aGroupName];
+           vtkFloatingPointType& aGroupMin = aGroupMinMax.first;
+           vtkFloatingPointType& aGroupMax = aGroupMinMax.second;
+           aGroupMin = isGroupFound ? std::min(aGroupMin,aVal) : aVal;
+           aGroupMax = isGroupFound ? std::max(aGroupMax,aVal) : aVal;          
+
+           if(isAverageByGaussPoints){
+             aGroup2AverageValue[aGroupName] = aGroup2AverageValue[aGroupName] + aVal;
+           }
+           else {
+             VISU::TMinMax& aGroupAverageMinMax = aGroup2AverageMinMax[aGroupName];
+             vtkFloatingPointType& aGroupAverageMin = aGroupAverageMinMax.first;
+             vtkFloatingPointType& aGroupAverageMax = aGroupAverageMinMax.second;
+             aGroupAverageMin = aGroupMin;
+             aGroupAverageMax = aGroupMax;
+           }
+         }
        }
         if(isAverageByGaussPoints){
           anAverageValue /= aNbGauss;
           anAverageMin = std::min(anAverageMin,anAverageValue);
           anAverageMax = std::max(anAverageMax,anAverageValue);
+
+         VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
+         for(; aGroupIter != aGroupNames.end(); aGroupIter++){
+           VISU::TName aGroupName = *aGroupIter;
+           vtkFloatingPointType aGroupAverageValue = aGroup2AverageValue[aGroupName] / aNbGauss;
+           bool isGroupFound = aGroup2AverageMinMax.find(aGroupName) != aGroup2AverageMinMax.end();
+           VISU::TMinMax& aGroupAverageMinMax = aGroup2AverageMinMax[aGroupName];
+           vtkFloatingPointType& aGroupAverageMin = aGroupAverageMinMax.first;
+           vtkFloatingPointType& aGroupAverageMax = aGroupAverageMinMax.second;
+           aGroupAverageMin = isGroupFound ? std::min(aGroupAverageMin,aGroupAverageValue) : aGroupAverageValue;
+           aGroupAverageMax = isGroupFound ? std::max(aGroupAverageMax,aGroupAverageValue) : aGroupAverageValue;
+         }
         }
       }
     }
@@ -1616,8 +1717,27 @@ BuildTimeStampMinMax(MED::SharedPtr<TimeStampValueType> theTimeStampValue,
     VISU::TMinMax& anAverageMinMax = theAverageMinMaxArr[0];
     vtkFloatingPointType& anAverageMin = anAverageMinMax.first;
     vtkFloatingPointType& anAverageMax = anAverageMinMax.second;
+
+    VISU::TGroup2MinMax& aGroup2MinMax = theGroup2MinMaxArr[0];
+    VISU::TGroup2MinMax& aGroup2AverageMinMax = theGroup2AverageMinMaxArr[0];
+
     for(TInt iElem = 0; iElem < aNbElem; iElem++){
       typename TimeStampValueType::TTMeshValue::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetGaussValueSliceArr(iElem);
+
+      // get names of groups, to which the element belongs
+      VISU::TNames aGroupNames;
+      VISU::TElemID2FamilyID::const_iterator anIter = anElemID2FamilyID.find(iElem);
+      if(anIter != anElemID2FamilyID.end()){
+       int aFamilyId = anIter->second;
+       if(aFamilyId != 0){
+         VISU::TFamilyIDMap::const_iterator aFamilyIter = aFamilyIDMap.find(aFamilyId);
+         if(aFamilyIter != aFamilyIDMap.end()){
+           VISU::PMEDFamily aFamily = aFamilyIter->second;
+           aGroupNames = aFamily->myGroupNames;
+         }
+       }
+      }
+
       for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
         const typename TimeStampValueType::TTMeshValue::TCValueSlice& aMValueSlice = aMValueSliceArr[iGauss];
         vtkFloatingPointType aValue = 0.0;
@@ -1628,6 +1748,18 @@ BuildTimeStampMinMax(MED::SharedPtr<TimeStampValueType> theTimeStampValue,
         aValue = sqrt(aValue);
         aMin = std::min(aMin,aValue);
         aMax = std::max(aMax,aValue);
+
+       // additional calculation for each group, to which the element belongs
+       VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
+       for(; aGroupIter != aGroupNames.end(); aGroupIter++){
+         VISU::TName aGroupName = *aGroupIter;
+         bool isGroupFound = aGroup2MinMax.find(aGroupName) != aGroup2MinMax.end();
+         VISU::TMinMax& aGroupMinMax = aGroup2MinMax[aGroupName];
+         vtkFloatingPointType& aGroupMin = aGroupMinMax.first;
+         vtkFloatingPointType& aGroupMax = aGroupMinMax.second;
+         aGroupMin = isGroupFound ? std::min(aGroupMin,aValue) : aValue;
+         aGroupMax = isGroupFound ? std::max(aGroupMax,aValue) : aValue;
+       }
       }
       if(isAverageByGaussPoints){
         typename TimeStampValueType::TTMeshValue::TCValueSliceArr aMCompValueSliceArr = aMMeshValue.GetCompValueSliceArr(iElem);
@@ -1645,10 +1777,33 @@ BuildTimeStampMinMax(MED::SharedPtr<TimeStampValueType> theTimeStampValue,
         aValue = sqrt(aValue);
         anAverageMin = std::min(anAverageMin,aValue);
         anAverageMax = std::max(anAverageMax,aValue);
+
+       // additional calculation for each group, to which the element belongs
+       VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
+       for(; aGroupIter != aGroupNames.end(); aGroupIter++){
+         VISU::TName aGroupName = *aGroupIter;
+         bool isGroupFound = aGroup2AverageMinMax.find(aGroupName) != aGroup2AverageMinMax.end();
+         VISU::TMinMax& aGroupAverageMinMax = aGroup2AverageMinMax[aGroupName];
+         vtkFloatingPointType& aGroupAverageMin = aGroupAverageMinMax.first;
+         vtkFloatingPointType& aGroupAverageMax = aGroupAverageMinMax.second;
+         aGroupAverageMin = isGroupFound ? std::min(aGroupAverageMin,aValue) : aValue;
+         aGroupAverageMax = isGroupFound ? std::max(aGroupAverageMax,aValue) : aValue;
+       }
       }
       else {
         anAverageMin = aMin;
         anAverageMax = aMax;
+
+       // additional calculation for each group, to which the element belongs
+       VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
+       for(; aGroupIter != aGroupNames.end(); aGroupIter++){
+         VISU::TName aGroupName = *aGroupIter;
+         VISU::TMinMax& aGroupAverageMinMax = aGroup2AverageMinMax[aGroupName];
+         vtkFloatingPointType& aGroupAverageMin = aGroupAverageMinMax.first;
+         vtkFloatingPointType& aGroupAverageMax = aGroupAverageMinMax.second;
+         aGroupAverageMin = aGroup2MinMax[aGroupName].first;
+         aGroupAverageMax = aGroup2MinMax[aGroupName].second;
+       }
       }
     }
   }
@@ -1735,6 +1890,8 @@ VISU_MedConvertor
 
          VISU::TMinMaxArr& aMinMaxArr = aField->myMinMaxArr;
           VISU::TMinMaxArr& anAverageMinMaxArr = aField->myAverageMinMaxArr;
+          VISU::TGroup2MinMaxArr& aGroup2MinMaxArr = aField->myGroup2MinMaxArr;
+          VISU::TGroup2MinMaxArr& aGroup2AverageMinMaxArr = aField->myGroup2AverageMinMaxArr;
          TSetIsDone aSetIsDone(aField->myIsMinMaxInitilized);
          for(TInt iTimeStamp = aNbTimeStamps; iTimeStamp >= 1; iTimeStamp--){
            VISU::TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPTimeStampInfo()");
@@ -1761,16 +1918,22 @@ VISU_MedConvertor
 
               if(aFieldInfo->GetType() == MED::eFLOAT64)
                 BuildTimeStampMinMax<MED::TFloatTimeStampValue>(CastToFloatTimeStampValue(aTimeStampValue),
+                                                               aMeshOnEntity,
                                                                 aGeom2Gauss,
                                                                 aMinMaxArr,
                                                                 anAverageMinMaxArr,
+                                                               aGroup2MinMaxArr,
+                                                               aGroup2AverageMinMaxArr,
                                                                 aNbComp,
                                                                 aNbComp2);
               else
                 BuildTimeStampMinMax<MED::TIntTimeStampValue>(CastToIntTimeStampValue(aTimeStampValue),
+                                                             aMeshOnEntity,
                                                               aGeom2Gauss,
                                                               aMinMaxArr,
                                                               anAverageMinMaxArr,
+                                                             aGroup2MinMaxArr,
+                                                             aGroup2AverageMinMaxArr,
                                                               aNbComp,
                                                               aNbComp2);
 
@@ -1786,7 +1949,7 @@ VISU_MedConvertor
 #endif
          }
          for(TInt iComp = 0; iComp <= aNbComp; iComp++){
-           VISU::TMinMax aMinMax = aField->GetMinMax(iComp);
+           VISU::TMinMax aMinMax = aField->GetMinMax(iComp, VISU::TNames());
            INITMSG(MYDEBUG,"- "<<iComp<<": "<<aMinMax.first<<"; "<<aMinMax.second<<endl);
          }
        }
index 927c9f44cd578b8f493a21264575fee44b44e32e..58d7c9b34e1316295fdd2a236713d45bb4d8892a 100644 (file)
@@ -309,9 +309,13 @@ namespace VISU
   //---------------------------------------------------------------
   typedef std::map<vtkIdType,vtkIdType> TFamilyID2CellsSize;
 
+  typedef std::map<vtkIdType,vtkIdType> TElemID2FamilyID;
+  typedef std::map<MED::EGeometrieElement,TElemID2FamilyID> TGeom2ElemID2FamilyID;
+
   struct VISU_CONVERTOR_EXPORT TMEDMeshOnEntity: virtual TMeshOnEntityImpl
   {
     TFamilyID2CellsSize myFamilyID2CellsSize;
+    TGeom2ElemID2FamilyID myGeom2ElemID2FamilyID;
     MED::TGeom2Size myGeom2Size;
   };
   typedef MED::SharedPtr<TMEDMeshOnEntity> PMEDMeshOnEntity;
index eaa8524594aee3e5f4237f5b187c41f178926ef9..4e877ccd0e128e868d8a9bce1ab70788c30d4ef2 100644 (file)
@@ -159,6 +159,8 @@ namespace VISU
   typedef std::map<TName, PFamily> TFamilyMap;
   typedef std::map<TName, PField> TFieldMap;
 
+  typedef std::map<vtkIdType, PFamily> TFamilyIDMap;
+
   //! Define a basic class which corresponds to MED ENTITY
   /*!
     This class in its turn contains map of TGaussMesh and TProfile substructures,
@@ -170,6 +172,8 @@ namespace VISU
     TProfileMap myProfileMap; //!< Contains map of Profile mesh which exist on it
 
     TFamilyMap myFamilyMap; //!< Contains map of MED FAMILIES which belongs to it
+    TFamilyIDMap myFamilyIDMap; //!< Contains map of MED FAMILIES which belongs to it
+
     TFieldMap myFieldMap; //!< Contains map of MED FIELDS which belongs to it
 
     TName myMeshName; //!< Contains name of the MED MESH where the it belongs to.
@@ -227,13 +231,13 @@ namespace VISU
     */
     virtual
     TMinMax 
-    GetMinMax(vtkIdType theCompID) = 0;
+    GetMinMax(vtkIdType theCompID, const TNames& theGroupNames) = 0;
     
     //! Calculate average min/max values for each of the MED FIELD components among all its timestamps
     virtual
     TMinMax 
-    GetAverageMinMax(vtkIdType theCompID) = 0;
-    
+    GetAverageMinMax(vtkIdType theCompID, const TNames& theGroupNames) = 0;
+
     bool myIsMinMaxInitilized; //!< Is the min / max values are calculated
 
     TField();
index 589435e0fbd1bb097e15d1720e92f934cae139e7..cdb78dbdb6a77c0bcb3a071958aff12e88c187a7 100644 (file)
@@ -1371,6 +1371,8 @@ namespace VISU
     myUnitNames.resize(theNbComp);
     myMinMaxArr.resize(theNbComp + 1);
     myAverageMinMaxArr.resize(theNbComp + 1);
+    myGroup2MinMaxArr.resize(theNbComp + 1);
+    myGroup2AverageMinMaxArr.resize(theNbComp + 1);
     for(vtkIdType iComp = 0; iComp <= theNbComp; iComp++){
       TMinMax& aMinMax = myMinMaxArr[iComp];
       aMinMax.first = VTK_LARGE_FLOAT;
@@ -1390,17 +1392,61 @@ namespace VISU
 
   TMinMax 
   TFieldImpl
-  ::GetMinMax(vtkIdType theCompID)
+  ::GetMinMax(vtkIdType theCompID, const TNames& theGroupNames)
   {
-    return myMinMaxArr[theCompID];
+    TMinMax aMinMax;
+    bool anIsMinMaxInitialized = false;
+    if( !theGroupNames.empty() ) {
+      aMinMax.first = VTK_LARGE_FLOAT;
+      aMinMax.second = -VTK_LARGE_FLOAT;
+
+      const TGroup2MinMax& aGroup2MinMax = myGroup2MinMaxArr[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 = myMinMaxArr[theCompID];
+
+    return aMinMax;
   }
 
 
   TMinMax 
   TFieldImpl
-  ::GetAverageMinMax(vtkIdType theCompID)
+  ::GetAverageMinMax(vtkIdType theCompID, const TNames& theGroupNames)
   {
-    return myAverageMinMaxArr[theCompID];
+    TMinMax aMinMax;
+    bool anIsMinMaxInitialized = false;
+    if( !theGroupNames.empty() ) {
+      aMinMax.first = VTK_LARGE_FLOAT;
+      aMinMax.second = -VTK_LARGE_FLOAT;
+
+      const TGroup2MinMax& aGroup2MinMax = myGroup2AverageMinMaxArr[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 = myAverageMinMaxArr[theCompID];
+
+    return aMinMax;
   }
   
   //----------------------------------------------------------------------------
index 3140245f1ab358a1595941ffdcc647449740e0c1..eebf3dd1cefeb5fb536710f8c3bcdd8816408a84 100644 (file)
@@ -727,6 +727,8 @@ namespace VISU
     TSubMeshID myMeshID; //!< Keeps numbers of mesh elements that belongs to the MED FAMILY
 
     TGeom2SubMeshID myGeom2SubMeshID; //!< Keeps TSubMeshID according to their geometrical type
+
+    TNames myGroupNames; //!< Keeps names of groups that refer to the family
   };
 
 
@@ -786,6 +788,9 @@ namespace VISU
   //---------------------------------------------------------------
   typedef TVector<TMinMax> TMinMaxArr;
 
+  typedef std::map<TName,TMinMax> TGroup2MinMax;
+  typedef TVector<TGroup2MinMax> TGroup2MinMaxArr;
+
   //! Specialize TField to provide VTK mapping for the entity
   struct VISU_CONVERTOR_EXPORT TFieldImpl: virtual TField
   {
@@ -803,18 +808,21 @@ namespace VISU
     //! Implement the TField::GetMinMax
     virtual
     TMinMax 
-    GetMinMax(vtkIdType theCompID);
+    GetMinMax(vtkIdType theCompID, const TNames& theGroupNames);
 
     //! Implement the TField::GetAverageMinMax
     virtual
     TMinMax 
-    GetAverageMinMax(vtkIdType theCompID);
+    GetAverageMinMax(vtkIdType theCompID, const TNames& theGroupNames);
 
     vtkIdType myDataSize; //!< Keeps size of the assigned data
     vtkIdType myDataType; //!< Keeps type idetificator of the mesh data
     TMinMaxArr myMinMaxArr; //!< Keeps min/max values for each component of the MED FIELD
     TMinMaxArr myAverageMinMaxArr; //!< Keeps average by Gauss Points min/max values for each component of the MED FIELD
                                    //!< If Nb of Gauss Points <=1 myAverageMinMaxArr equal myMinMaxArr
+
+    TGroup2MinMaxArr myGroup2MinMaxArr;
+    TGroup2MinMaxArr myGroup2AverageMinMaxArr;
   };
 
 
index 23fa92231a9ef38ea6fc94ad652868041c747747..766c910e04b5ba4f749629c8c68a04ef1dd18a94 100644 (file)
@@ -827,16 +827,18 @@ VISU_GaussPointsPL
 
 int
 VISU_GaussPointsPL
-::AddGeometry(vtkDataSet* theGeometry)
+::AddGeometry(vtkDataSet* theGeometry, const VISU::TName& theGeomName)
 {
+  AddGeometryName(theGeomName);
   myAppendFilter->AddInput(theGeometry);
   return GetNumberOfGeometry();
 }
 
 vtkDataSet*
 VISU_GaussPointsPL
-::GetGeometry(int theGeomNumber)
+::GetGeometry(int theGeomNumber, VISU::TName& theGeomName)
 {
+  theGeomName = GetGeometryName(theGeomNumber);
   return vtkDataSet::SafeDownCast(myAppendFilter->GetInput(theGeomNumber));
 }
 
@@ -858,9 +860,20 @@ void
 VISU_GaussPointsPL
 ::ClearGeometry()
 {
+  ClearGeometryNames();
   myAppendFilter->RemoveAllInputs();
 }
 
+void
+VISU_GaussPointsPL
+::GetSourceRange(vtkFloatingPointType theRange[2])
+{
+  if(!IsExternalGeometryUsed())
+    Superclass::GetSourceRange(theRange);
+  else
+    GetMergedInput()->GetScalarRange( theRange );
+}
+
 vtkPointSet* 
 VISU_GaussPointsPL
 ::GetMergedInput()
index 2ecb13f0a17a5360904d6897ba1a5c8afe730ae4..e86217fa509fbff9f5362fce780c6e1703d4d267 100644 (file)
@@ -287,11 +287,11 @@ public:
 
   virtual
   int
-  AddGeometry(vtkDataSet* theGeometry);
+  AddGeometry(vtkDataSet* theGeometry, const VISU::TName& theGeomName);
 
   virtual
   vtkDataSet*
-  GetGeometry(int theGeomNumber);
+  GetGeometry(int theGeomNumber, VISU::TName& theGeomName);
 
   virtual
   int
@@ -305,6 +305,10 @@ public:
   void
   ClearGeometry();
 
+  virtual
+  void
+  GetSourceRange(vtkFloatingPointType theRange[2]);
+
   virtual 
   vtkPointSet* 
   GetMergedInput();
index ca29edebcd4673ac5be685ee122c90dfee8cd336..d0b2a328fcc16ea13af84d526a4cb494a4f74c78 100644 (file)
@@ -41,9 +41,45 @@ VISU_MergedPL
     if ( aPipeLine->IsExternalGeometryUsed() ) {
       ClearGeometry();
       int aNbOfGeometry = aPipeLine->GetNumberOfGeometry();
-      for ( int aGeomNumber = 0; aGeomNumber < aNbOfGeometry; aGeomNumber++ )
-       AddGeometry( aPipeLine->GetGeometry( aGeomNumber ) );
+      for ( int aGeomNumber = 0; aGeomNumber < aNbOfGeometry; aGeomNumber++ ) {
+       VISU::TName aGeomName;
+       AddGeometry( aPipeLine->GetGeometry( aGeomNumber, aGeomName ), aGeomName );
+      }
     }else
       SetSourceGeometry();
   }
 }
+
+//----------------------------------------------------------------------------
+void
+VISU_MergedPL
+::AddGeometryName(const VISU::TName& theGeomName)
+{
+  myGeometryNames.push_back( theGeomName );
+}
+
+//----------------------------------------------------------------------------
+VISU::TName
+VISU_MergedPL
+::GetGeometryName( int theGeomNumber ) const
+{
+  if( theGeomNumber < myGeometryNames.size() )
+    return myGeometryNames[ theGeomNumber ];
+  return VISU::TName();
+}
+
+//----------------------------------------------------------------------------
+const VISU::TNames&
+VISU_MergedPL
+::GetGeometryNames() const
+{
+  return myGeometryNames;
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_MergedPL
+::ClearGeometryNames()
+{
+  myGeometryNames.clear();
+}
index 7c30a4c3122c0cfca0ee5000566eaf21c6c2c2c8..6d60e9ccc637a9ec14d988e1b266937f07c037c6 100644 (file)
@@ -28,6 +28,7 @@
 #define VISU_MergedPL_HeaderFile
 
 #include "VISUPipeline.hxx"
+#include "VISU_Structures.hxx"
 
 class vtkDataSet;
 class vtkPointSet;
@@ -43,11 +44,11 @@ struct VISU_PIPELINE_EXPORT VISU_MergedPL
 
   virtual
   int
-  AddGeometry( vtkDataSet* theGeometry ) = 0;
+  AddGeometry( vtkDataSet* theGeometry, const VISU::TName& theGeomName ) = 0;
 
   virtual
   vtkDataSet*
-  GetGeometry( int theGeomNumber ) = 0;
+  GetGeometry( int theGeomNumber, VISU::TName& theGeomName ) = 0;
 
   virtual
   int
@@ -69,6 +70,24 @@ struct VISU_PIPELINE_EXPORT VISU_MergedPL
   void
   DoShallowCopy(VISU_PipeLine *thePipeLine,
                bool theIsCopyInput);
+
+  virtual
+  void
+  AddGeometryName(const VISU::TName& theGeomName);
+
+  virtual
+  VISU::TName
+  GetGeometryName( int theGeomNumber ) const;
+
+  virtual
+  const VISU::TNames&
+  GetGeometryNames() const;
+
+  virtual
+  void
+  ClearGeometryNames();
+
+  VISU::TNames myGeometryNames;
 };
   
 #endif
index e32a02aa74827bf7e457bbe50ca99b43015304c3..9786e6e02e46a2a00419d75400937ba15d78ac99 100644 (file)
@@ -180,13 +180,14 @@ VISU_ScalarMapPL
 //----------------------------------------------------------------------------
 int
 VISU_ScalarMapPL
-::AddGeometry(vtkDataSet* theGeometry)
+::AddGeometry(vtkDataSet* theGeometry, const VISU::TName& theGeomName)
 {
   // rnv: to fix issue 0020167 (AddMeshOnGroup is not fully taken into account)
   // clear all inpust of the this->myAppendFilter in case if presentation 
   // constructed on the entire mesh.
   if(!IsExternalGeometryUsed())
     ClearGeometry();
+  AddGeometryName(theGeomName);
   myAppendFilter->AddInput(theGeometry);
   return GetNumberOfGeometry();
 }
@@ -195,8 +196,9 @@ VISU_ScalarMapPL
 //----------------------------------------------------------------------------
 vtkDataSet*
 VISU_ScalarMapPL
-::GetGeometry(int theGeomNumber)
+::GetGeometry(int theGeomNumber, VISU::TName& theGeomName)
 {
+  theGeomName = GetGeometryName(theGeomNumber);
   return vtkDataSet::SafeDownCast(myAppendFilter->GetInput(theGeomNumber));
 }
 
@@ -224,10 +226,23 @@ void
 VISU_ScalarMapPL
 ::ClearGeometry()
 {
+  ClearGeometryNames();
   myAppendFilter->RemoveAllInputs();
 }
 
 
+//----------------------------------------------------------------------------
+void
+VISU_ScalarMapPL
+::GetSourceRange(vtkFloatingPointType theRange[2])
+{
+  if(!IsExternalGeometryUsed())
+    Superclass::GetSourceRange(theRange);
+  else
+    GetMergedInput()->GetScalarRange( theRange );
+}
+
+
 //----------------------------------------------------------------------------
 vtkDataSet* 
 VISU_ScalarMapPL
index 06647d30565be0c9fa8d7b8f6b3636df934d15e0..5db2f3b54c1cdafedf30442b54c4335afc855e44 100644 (file)
@@ -65,11 +65,11 @@ public:
 
   virtual
   int
-  AddGeometry(vtkDataSet* theGeometry);
+  AddGeometry(vtkDataSet* theGeometry, const VISU::TName& theGeomName);
 
   virtual
   vtkDataSet*
-  GetGeometry(int theGeomNumber);
+  GetGeometry(int theGeomNumber, VISU::TName& theGeomName);
 
   virtual
   int
@@ -82,6 +82,10 @@ public:
   void
   ClearGeometry();
 
+  virtual
+  void
+  GetSourceRange(vtkFloatingPointType theRange[2]);
+
   //----------------------------------------------------------------------------
   virtual 
   vtkPointSet* 
index b5b95490321e67abc547e370a7bc9bc01d6f5757..a4d95edabcb0107d9c2dc2899240c2dd91c2ce59 100644 (file)
@@ -555,7 +555,7 @@ void VisuGUI_InputPane::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs )
       const std::string aGroupName = *anIter;
       mySelectedGroups->insertItem(mySelectedGroups->count(), aGroupName.c_str());
     }
-    myUseGroupsGroupBox->setEnabled(anIsTimeStampFixed);
+    myUseGroupsGroupBox->setEnabled(true);
   }
   myUseGroupsGroupBox->setChecked(mySelectedGroups->count() > 0);
 }
index dcf280865181f765135c6447cc63c5452ff0eb29..0b984dd03e7c228ea7909a1dd4410ebb7c272282 100644 (file)
@@ -88,9 +88,9 @@ namespace VISU
     if(!theResult->IsMinMaxDone())
       theResult->GetInput()->BuildMinMax();
     if(theField->myIsELNO)
-      return theField->GetMinMax(theCompID);
+      return theField->GetMinMax(theCompID, VISU::TNames());
     else
-      return theField->GetAverageMinMax(theCompID);
+      return theField->GetAverageMinMax(theCompID, VISU::TNames());
   }
 
   //---------------------------------------------------------------
index 04d52a8b0a7751ef427c71ad97c527f63f32ee43..050e768d78356a6e4635f567d62ae04fd40fa3a0 100644 (file)
@@ -733,7 +733,7 @@ VISU::GaussPoints_i
   if(anIDMapper){
     int aNbGroups  = myGroupNames.size();
     if(myGroupNames.find(theGroupName) == myGroupNames.end()){
-      GetSpecificPL()->AddGeometry(anIDMapper->GetOutput());
+      GetSpecificPL()->AddGeometry(anIDMapper->GetOutput(), theGroupName);
       myGroupNames.insert(theGroupName);
       /*
       if(aNbGroups == 0)
@@ -1160,7 +1160,8 @@ struct TGetSourceMin: public SALOME_Event
       myColoredPrs3d->GetSpecificPL()->GetSourceRange(aRange);
       myResult = aRange[0];
     }else{
-      VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myColoredPrs3d->GetScalarMode() );
+      VISU::TNames aGroupNames = myColoredPrs3d->GetSpecificPL()->GetGeometryNames();
+      VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myColoredPrs3d->GetScalarMode(), aGroupNames );
       myResult = aTMinMax.first;
     }
   }
@@ -1197,7 +1198,8 @@ struct TGetSourceMax: public SALOME_Event
       myColoredPrs3d->GetSpecificPL()->GetSourceRange(aRange);
       myResult = aRange[1];
     }else{
-      VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myColoredPrs3d->GetScalarMode() );
+      VISU::TNames aGroupNames = myColoredPrs3d->GetSpecificPL()->GetGeometryNames();
+      VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myColoredPrs3d->GetScalarMode(), aGroupNames );
       myResult = aTMinMax.second;
     }
   }
@@ -1259,7 +1261,7 @@ VISU::GaussPoints_i
 }
 
 //----------------------------------------------------------------------------
-struct TGetComponentMin: public SALOME_Event
+struct TGaussGetComponentMin: public SALOME_Event
 {
   VISU::ColoredPrs3d_i* myColoredPrs3d;
   vtkIdType myCompID;
@@ -1267,8 +1269,8 @@ struct TGetComponentMin: public SALOME_Event
   typedef CORBA::Double TResult;
   TResult myResult;
   
-  TGetComponentMin( VISU::ColoredPrs3d_i* theColoredPrs3d,
-                   vtkIdType theCompID ):
+  TGaussGetComponentMin( VISU::ColoredPrs3d_i* theColoredPrs3d,
+                        vtkIdType theCompID ):
     myColoredPrs3d( theColoredPrs3d ),
     myCompID( theCompID )
   {}
@@ -1277,11 +1279,15 @@ struct TGetComponentMin: public SALOME_Event
   void
   Execute()
   {
+    VISU::TNames aGroupNames;
+    if(VISU::GaussPoints_i* aPrs3d = dynamic_cast<VISU::GaussPoints_i*>(myColoredPrs3d))
+      aGroupNames = aPrs3d->GetSpecificPL()->GetGeometryNames();
+
     VISU::PMinMaxController aMinMaxController = myColoredPrs3d->GetMinMaxController();
     if ( aMinMaxController ) {
       myResult = aMinMaxController->GetComponentMin( myCompID );
     } else {
-      VISU::TMinMax aTMinMax = myColoredPrs3d->GetScalarField()->GetMinMax( myCompID );
+      VISU::TMinMax aTMinMax = myColoredPrs3d->GetScalarField()->GetMinMax( myCompID, aGroupNames );
       myResult = aTMinMax.first;
     }
   }
@@ -1293,11 +1299,11 @@ vtkFloatingPointType
 VISU::GaussPoints_i
 ::GetComponentMin(vtkIdType theCompID)
 {
-  return ProcessEvent( new TGetComponentMin( this, theCompID ) );
+  return ProcessEvent( new TGaussGetComponentMin( this, theCompID ) );
 }
 
 //----------------------------------------------------------------------------
-struct TGetComponentMax: public SALOME_Event
+struct TGaussGetComponentMax: public SALOME_Event
 {
   VISU::ColoredPrs3d_i* myColoredPrs3d;
   vtkIdType myCompID;
@@ -1305,8 +1311,8 @@ struct TGetComponentMax: public SALOME_Event
   typedef CORBA::Double TResult;
   TResult myResult;
   
-  TGetComponentMax( VISU::ColoredPrs3d_i* theColoredPrs3d,
-                   vtkIdType theCompID ):
+  TGaussGetComponentMax( VISU::ColoredPrs3d_i* theColoredPrs3d,
+                        vtkIdType theCompID ):
     myColoredPrs3d( theColoredPrs3d ),
     myCompID( theCompID )
   {}
@@ -1315,11 +1321,15 @@ struct TGetComponentMax: public SALOME_Event
   void
   Execute()
   {
+    VISU::TNames aGroupNames;
+    if(VISU::GaussPoints_i* aPrs3d = dynamic_cast<VISU::GaussPoints_i*>(myColoredPrs3d))
+      aGroupNames = aPrs3d->GetSpecificPL()->GetGeometryNames();
+
     VISU::PMinMaxController aMinMaxController = myColoredPrs3d->GetMinMaxController();
     if ( aMinMaxController ) {
       myResult = aMinMaxController->GetComponentMax( myCompID );
     } else {
-      VISU::TMinMax aTMinMax = myColoredPrs3d->GetScalarField()->GetMinMax( myCompID );
+      VISU::TMinMax aTMinMax = myColoredPrs3d->GetScalarField()->GetMinMax( myCompID, aGroupNames );
       myResult = aTMinMax.second;
     }
   }
@@ -1331,5 +1341,5 @@ vtkFloatingPointType
 VISU::GaussPoints_i
 ::GetComponentMax(vtkIdType theCompID)
 {
-  return ProcessEvent( new TGetComponentMax( this, theCompID ) );
+  return ProcessEvent( new TGaussGetComponentMax( this, theCompID ) );
 }
index 7afea4d43e4915d8d748aa3ea9bce7c87f974852..9c67ac1f8456f501a2960d3badc8a9a82a7e2bb5 100644 (file)
@@ -320,7 +320,7 @@ VISU::ScalarMap_i
   if(anIDMapper){
     int aNbGroups  = myGroupNames.size();
     if(myGroupNames.find(theGroupName) == myGroupNames.end()){
-      GetSpecificPL()->AddGeometry(anIDMapper->GetOutput());
+      GetSpecificPL()->AddGeometry(anIDMapper->GetOutput(), theGroupName);
       myGroupNames.insert(theGroupName);
       if(aNbGroups == 0)
        UpdateIcon();
@@ -540,15 +540,19 @@ struct TGetComponentMin: public SALOME_Event
   void
   Execute()
   {
+    VISU::TNames aGroupNames;
+    if(VISU::ScalarMap_i* aPrs3d = dynamic_cast<VISU::ScalarMap_i*>(myColoredPrs3d))
+      aGroupNames = aPrs3d->GetSpecificPL()->GetGeometryNames();
+
     VISU::PMinMaxController aMinMaxController = myColoredPrs3d->GetMinMaxController();
     if ( aMinMaxController ) {
       myResult = aMinMaxController->GetComponentMin( myCompID );
     } else {
       VISU::TMinMax aTMinMax;
       if(myColoredPrs3d->GetScalarField()->myIsELNO)
-       aTMinMax = myColoredPrs3d->GetScalarField()->GetMinMax( myCompID );
+       aTMinMax = myColoredPrs3d->GetScalarField()->GetMinMax( myCompID, aGroupNames );
       else
-       aTMinMax = myColoredPrs3d->GetScalarField()->GetAverageMinMax( myCompID );
+       aTMinMax = myColoredPrs3d->GetScalarField()->GetAverageMinMax( myCompID, aGroupNames );
       myResult = aTMinMax.first;
     }
   }
@@ -582,15 +586,19 @@ struct TGetComponentMax: public SALOME_Event
   void
   Execute()
   {
+    VISU::TNames aGroupNames;
+    if(VISU::ScalarMap_i* aPrs3d = dynamic_cast<VISU::ScalarMap_i*>(myColoredPrs3d))
+      aGroupNames = aPrs3d->GetSpecificPL()->GetGeometryNames();
+
     VISU::PMinMaxController aMinMaxController = myColoredPrs3d->GetMinMaxController();
     if ( aMinMaxController ) {
       myResult = aMinMaxController->GetComponentMax( myCompID );
     } else {
       VISU::TMinMax aTMinMax;
       if(myColoredPrs3d->GetScalarField()->myIsELNO)
-       aTMinMax = myColoredPrs3d->GetScalarField()->GetMinMax( myCompID );
+       aTMinMax = myColoredPrs3d->GetScalarField()->GetMinMax( myCompID, aGroupNames );
       else
-       aTMinMax = myColoredPrs3d->GetScalarField()->GetAverageMinMax( myCompID );
+       aTMinMax = myColoredPrs3d->GetScalarField()->GetAverageMinMax( myCompID, aGroupNames );
       myResult = aTMinMax.second;
     }
   }