]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for Bug GVIEW10317
authorapo <apo@opencascade.com>
Mon, 23 Jan 2006 11:36:22 +0000 (11:36 +0000)
committerapo <apo@opencascade.com>
Mon, 23 Jan 2006 11:36:22 +0000 (11:36 +0000)
   Incorrect reading of "maill.3.med" file in Post-Pro module.

src/CONVERTOR/VISU_Convertor_impl.cxx
src/CONVERTOR/VISU_Convertor_impl.hxx

index 85032edff0c5c4e4d5140dab4357a69fd42d6bcb..4564df6037f72b4b63cb97ef9baf918a10115918 100644 (file)
@@ -1313,13 +1313,14 @@ namespace
   void 
   GetTimeStampOnProfile(const TVTKSource& theSource,
                        const PFieldImpl& theField, 
-                       const PValForTimeImpl& theValForTime)
+                       const PValForTimeImpl& theValForTime,
+                       const VISU::TEntity& theEntity)
   {
     int aNbTuples = theField->myDataSize/theField->myNbComp;
     std::string aFieldName = GenerateFieldName(theField,theValForTime);
     
     vtkDataSetAttributes* aDataSetAttributes;
-    switch(theField->myEntity){
+    switch(theEntity){
     case VISU::NODE_ENTITY : 
       aDataSetAttributes = theSource->GetPointData();
       break;
@@ -1492,6 +1493,8 @@ namespace
                   const PMeshOnEntityImpl& theMeshOnEntity,
                   const PProfileImpl& theProfile)
   {
+    INITMSG(MYDEBUG,"GetMeshOnProfile - anEntity = "<<theMeshOnEntity->myEntity<<endl);
+
     if(theProfile->myIsVTKDone)
       return;
     
@@ -2068,6 +2071,29 @@ VISU_Convertor_impl
 }
 
 
+//---------------------------------------------------------------
+VISU::TVTKOutput*
+VISU_Convertor_impl
+::GetTimeStampOnProfile(const VISU::PMeshImpl& theMesh,
+                       const VISU::PMeshOnEntityImpl& theMeshOnEntity,
+                       const VISU::PFieldImpl& theField,
+                       const VISU::PValForTimeImpl& theValForTime,
+                       const VISU::PIDMapperFilter& theIDMapperFilter,
+                       const VISU::PProfileImpl& theProfile,
+                       const VISU::TEntity& theEntity)
+{
+  LoadMeshOnEntity(theMesh,theMeshOnEntity);
+  GetMeshOnEntity(theMeshOnEntity->myMeshName,theMeshOnEntity->myEntity);
+  GetMeshOnProfile(theMesh,theMeshOnEntity,theProfile);
+
+  theIDMapperFilter->myIDMapper = theProfile;
+  TVTKOutput* anOutput = theIDMapperFilter->GetVTKOutput();
+  const TVTKSource& aSource = theIDMapperFilter->mySource.GetSource();
+  ::GetTimeStampOnProfile(aSource,theField,theValForTime,theEntity);
+  return anOutput;
+}
+
+
 //---------------------------------------------------------------
 VISU::PIDMapper 
 VISU_Convertor_impl
@@ -2103,26 +2129,26 @@ VISU_Convertor_impl
     if(!anIDMapperFilter->myIsVTKDone){
       LoadValForTimeOnMesh(aMesh,aMeshOnEntity,aField,aValForTime);
 
+      TVTKOutput* anOutput;
       try{
-       LoadMeshOnEntity(aMesh,aVTKMeshOnEntity);
+       anOutput = GetTimeStampOnProfile(aMesh,
+                                        aVTKMeshOnEntity,
+                                        aField,
+                                        aValForTime,
+                                        anIDMapperFilter,
+                                        aValForTime->myProfile,
+                                        aMeshOnEntity->myEntity);
       }catch(std::exception& exc){
-       aVTKMeshOnEntity = aMeshOnEntity;
        MSG(MYDEBUG,"Follow exception was occured :\n"<<exc.what());
-      }catch(...){
-       aVTKMeshOnEntity = aMeshOnEntity;
-       MSG(MYDEBUG,"Unknown exception was occured!");
+       anOutput = GetTimeStampOnProfile(aMesh,
+                                        aMeshOnEntity,
+                                        aField,
+                                        aValForTime,
+                                        anIDMapperFilter,
+                                        aValForTime->myProfile,
+                                        aVTKMeshOnEntity->myEntity);
       }
 
-      GetMeshOnEntity(aVTKMeshOnEntity->myMeshName,aVTKMeshOnEntity->myEntity);     
-
-      PProfileImpl aProfile = aValForTime->myProfile;
-      GetMeshOnProfile(aMesh,aVTKMeshOnEntity,aProfile);
-
-      anIDMapperFilter->myIDMapper = aProfile;
-      TVTKOutput* anOutput = anIDMapperFilter->GetVTKOutput();
-      const TVTKSource& aSource = anIDMapperFilter->mySource.GetSource();
-      GetTimeStampOnProfile(aSource,aField,aValForTime);
-
       anIDMapperFilter->myIsVTKDone = true;
 
       if(MYDEBUGWITHFILES){
index 18e494cfd8124dc70cd398e894296da088d65a94..c4efc7d25c80c2471f5f83b6b4651e4869cdcbad 100644 (file)
@@ -945,6 +945,15 @@ protected:
                const VISU::TEntity& theEntity, 
                const std::string& theFieldName, 
                int theStampsNum);
+
+  VISU::TVTKOutput*
+  GetTimeStampOnProfile(const VISU::PMeshImpl& theMesh,
+                       const VISU::PMeshOnEntityImpl& theMeshOnEntity,
+                       const VISU::PFieldImpl& theField,
+                       const VISU::PValForTimeImpl& theValForTime,
+                       const VISU::PIDMapperFilter& theIDMapperFilter,
+                       const VISU::PProfileImpl& theProfile,
+                       const VISU::TEntity& theEntity);
   
 protected:
   //! To fill intermeiate representation of TMeshOnEntity from a MED source