aMeshOnEntity->myMeshName = aMeshName;
aMeshOnEntity->myGeom2Size = aGeom2Size;
VISU::TFamilyID2CellsSize& aFamilyID2CellsSize = aMeshOnEntity->myFamilyID2CellsSize;
+ VISU::TGeom2ElemID2FamilyID& aGeom2ElemID2FamilyID = aMeshOnEntity->myGeom2ElemID2FamilyID;
INITMSG(MYDEBUG,
"- aMEntity = "<<aMEntity<<
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,
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);
TInt aFamId = aPolygoneInfo->GetFamNum(anElemId);
if(aFamId != 0)
aFamilyID2CellsSize[aFamId] += aNbConn + 1;
+ anElemID2FamilyID[anElemId] = aFamId;
}
break;
}
TInt aFamId = aPolyedreInfo->GetFamNum(anElemId);
if(aFamId != 0)
aFamilyID2CellsSize[aFamId] += aCellSize + 1;
+ anElemID2FamilyID[anElemId] = aFamId;
}
break;
}
TInt aFamId = aCellInfo->GetFamNum(iElem);
if(aFamId != 0)
aFamilyID2CellsSize[aFamId] += aVNbNodes + 1;
+ anElemID2FamilyID[iElem] = aFamId;
}
}} // end switch(...)
}
aMeshOnEntity->myMeshName = aMeshName;
aMeshOnEntity->myGeom2Size = aGeom2Size;
VISU::TFamilyID2CellsSize& aFamilyID2CellsSize = aMeshOnEntity->myFamilyID2CellsSize;
+ VISU::TGeom2ElemID2FamilyID& aGeom2ElemID2FamilyID = aMeshOnEntity->myGeom2ElemID2FamilyID;
INITMSG(MYDEBUG,
"- aMEntity = "<<aMEntity<<
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,
TInt aNbElem = aGeom2SizeIter->second;//theGrilleInfo->GetNbCells();
aMeshOnEntity->myNbCells += aNbElem;
aMeshOnEntity->myCellsSize += aNbElem*(aVNbNodes+1);
+
+ VISU::TElemID2FamilyID& anElemID2FamilyID = aGeom2ElemID2FamilyID[aMGeom];
INITMSG(MYDEBUG,
"- aMGeom = "<<aMGeom<<
TInt aFamId = theGrilleInfo->GetFamNum(iElem);
if(aFamId != 0)
aFamilyID2CellsSize[aFamId] += aVNbNodes + 1;
+ anElemID2FamilyID[iElem] = aFamId;
}
}
}
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;
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<<"; "<<
"; 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");
aMeshOnEntity = aMeshOnEntityIter->second;
VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
+ VISU::TFamilyIDMap& aFamilyIDMap = aMeshOnEntity->myFamilyIDMap;
VISU::PMEDFamily aFamily = aFamilyMap[aFamilyName](new VISU::TMEDFamily());
aFamily->myId = anId;
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
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++){
"; aNbElem = "<<aNbElem<<
"; aNbGauss = "<<aNbGauss<<
endl);
+
+ VISU::TElemID2FamilyID anElemID2FamilyID = aGeom2ElemID2FamilyID[aMGeom];
bool isAverageByGaussPoints = (aNbGauss > 1);
// To calculate min/max per components
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);
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;
+ }
}
}
}
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;
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);
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;
+ }
}
}
}
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()");
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);
#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);
}
}
//---------------------------------------------------------------
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;
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,
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.
*/
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();
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;
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;
}
//----------------------------------------------------------------------------
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
};
//---------------------------------------------------------------
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
{
//! 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;
};
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));
}
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()
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
void
ClearGeometry();
+ virtual
+ void
+ GetSourceRange(vtkFloatingPointType theRange[2]);
+
virtual
vtkPointSet*
GetMergedInput();
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();
+}
#define VISU_MergedPL_HeaderFile
#include "VISUPipeline.hxx"
+#include "VISU_Structures.hxx"
class vtkDataSet;
class vtkPointSet;
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
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
//----------------------------------------------------------------------------
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();
}
//----------------------------------------------------------------------------
vtkDataSet*
VISU_ScalarMapPL
-::GetGeometry(int theGeomNumber)
+::GetGeometry(int theGeomNumber, VISU::TName& theGeomName)
{
+ theGeomName = GetGeometryName(theGeomNumber);
return vtkDataSet::SafeDownCast(myAppendFilter->GetInput(theGeomNumber));
}
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
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
void
ClearGeometry();
+ virtual
+ void
+ GetSourceRange(vtkFloatingPointType theRange[2]);
+
//----------------------------------------------------------------------------
virtual
vtkPointSet*
const std::string aGroupName = *anIter;
mySelectedGroups->insertItem(mySelectedGroups->count(), aGroupName.c_str());
}
- myUseGroupsGroupBox->setEnabled(anIsTimeStampFixed);
+ myUseGroupsGroupBox->setEnabled(true);
}
myUseGroupsGroupBox->setChecked(mySelectedGroups->count() > 0);
}
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());
}
//---------------------------------------------------------------
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)
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;
}
}
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;
}
}
}
//----------------------------------------------------------------------------
-struct TGetComponentMin: public SALOME_Event
+struct TGaussGetComponentMin: public SALOME_Event
{
VISU::ColoredPrs3d_i* myColoredPrs3d;
vtkIdType myCompID;
typedef CORBA::Double TResult;
TResult myResult;
- TGetComponentMin( VISU::ColoredPrs3d_i* theColoredPrs3d,
- vtkIdType theCompID ):
+ TGaussGetComponentMin( VISU::ColoredPrs3d_i* theColoredPrs3d,
+ vtkIdType theCompID ):
myColoredPrs3d( theColoredPrs3d ),
myCompID( theCompID )
{}
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;
}
}
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;
typedef CORBA::Double TResult;
TResult myResult;
- TGetComponentMax( VISU::ColoredPrs3d_i* theColoredPrs3d,
- vtkIdType theCompID ):
+ TGaussGetComponentMax( VISU::ColoredPrs3d_i* theColoredPrs3d,
+ vtkIdType theCompID ):
myColoredPrs3d( theColoredPrs3d ),
myCompID( theCompID )
{}
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;
}
}
VISU::GaussPoints_i
::GetComponentMax(vtkIdType theCompID)
{
- return ProcessEvent( new TGetComponentMax( this, theCompID ) );
+ return ProcessEvent( new TGaussGetComponentMax( this, theCompID ) );
}
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();
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;
}
}
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;
}
}