From: apo Date: Tue, 13 Sep 2005 08:29:38 +0000 (+0000) Subject: 1. First implementation of Min/Max filed's values calculation. X-Git-Tag: BR-D5-38-2003_D2005-12-10~204 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4426b3131548c55d760f97f392ac6724637ed553;p=modules%2Fvisu.git 1. First implementation of Min/Max filed's values calculation. --- diff --git a/src/CONVERTOR/VISU_Convertor.hxx b/src/CONVERTOR/VISU_Convertor.hxx index 14500e14..4f2ff546 100644 --- a/src/CONVERTOR/VISU_Convertor.hxx +++ b/src/CONVERTOR/VISU_Convertor.hxx @@ -163,6 +163,7 @@ namespace VISU //--------------------------------------------------------------- typedef std::map TValField; + typedef std::pair TMinMax; struct TField: virtual TIntId { @@ -172,7 +173,11 @@ namespace VISU TValField myValField; TNames myCompNames; TNames myUnitNames; - int myNbComp; + vtkIdType myNbComp; + + virtual + TMinMax + GetMinMax(vtkIdType theCompID) = 0; TField(): myNbComp(0) {} diff --git a/src/CONVERTOR/VISU_Convertor_impl.cxx b/src/CONVERTOR/VISU_Convertor_impl.cxx index b4dbc4b1..8fd0cbe9 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.cxx +++ b/src/CONVERTOR/VISU_Convertor_impl.cxx @@ -521,6 +521,35 @@ namespace VISU } + //--------------------------------------------------------------- + TFieldImpl + ::TFieldImpl(): + myDataSize(0) + {} + + void + TFieldImpl + ::InitArrays(vtkIdType theNbComp) + { + myNbComp = theNbComp; + myCompNames.resize(theNbComp); + myUnitNames.resize(theNbComp); + myMinMaxArr.resize(theNbComp); + for(vtkIdType iComp = 0; iComp < theNbComp; iComp++){ + TMinMax& aMinMax = myMinMaxArr[iComp]; + aMinMax.first = -VTK_LARGE_FLOAT; + aMinMax.second = VTK_LARGE_FLOAT; + } + } + + TMinMax + TFieldImpl + ::GetMinMax(vtkIdType theCompID) + { + return myMinMaxArr[theCompID]; + } + + //--------------------------------------------------------------- void TMeshValue @@ -964,7 +993,7 @@ namespace const PValForTimeImpl& theValForTime) { int aNbTuples = theField->myDataSize/theField->myNbComp; - string aFieldName = GenerateFieldName(theField,theValForTime); + std::string aFieldName = GenerateFieldName(theField,theValForTime); INITMSG(MYDEBUG,"GetTimeStampOnProfile - aNbTuples = "< TMinMaxArr; + struct TFieldImpl: virtual TField { vtkIdType myDataSize; - TFieldImpl(): myDataSize(0) - {} + TMinMaxArr myMinMaxArr; + + virtual + TMinMax + GetMinMax(vtkIdType theCompID); + + void + InitArrays(vtkIdType theNbComp); + + TFieldImpl(); }; typedef SharedPtr PFieldImpl; diff --git a/src/VISU_I/VISU_CorbaMedConvertor.cxx b/src/VISU_I/VISU_CorbaMedConvertor.cxx index c580b50e..645c5059 100644 --- a/src/VISU_I/VISU_CorbaMedConvertor.cxx +++ b/src/VISU_I/VISU_CorbaMedConvertor.cxx @@ -365,10 +365,8 @@ VISU_MEDFieldConvertor::Build() aField->myName = aFieldName.in(); aField->myEntity = aVEntity; aField->myMeshName = aMeshName.in(); - aField->myNbComp = myField->getNumberOfComponents(); + aField->InitArrays(myField->getNumberOfComponents()); aField->myDataSize = aMeshOnEntity->myNbCells * aField->myNbComp; - aField->myCompNames.resize(aField->myNbComp); - aField->myUnitNames.resize(aField->myNbComp); if(MYDEBUG) MESSAGE("VISU_MEDFieldConvertor::Build - aMeshName = "<myNbCells = "<myNbCells); - aField->myCompNames.resize(aField->myNbComp); - aField->myUnitNames.resize(aField->myNbComp); }else aField = aFieldMapIter->second; @@ -840,12 +836,10 @@ VISU_MEDConvertor::Build(SALOMEDS::ChildIterator_ptr theTimeStampIterator) aField->myName = aFieldName.in(); aField->myEntity = aVEntity; aField->myMeshName = aMeshName.in(); - aField->myNbComp = aMEDField->getNumberOfComponents(); + aField->InitArrays(aMEDField->getNumberOfComponents()); aField->myDataSize = aMeshOnEntity->myNbCells * aField->myNbComp; if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aMeshOnEntity->myNbCells = "<myNbCells); - aField->myCompNames.resize(aField->myNbComp); - aField->myUnitNames.resize(aField->myNbComp); } TValField& aValField = aField->myValField; int anId = aMEDField->getIterationNumber();