]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for Bug IPAL13642
authorapo <apo@opencascade.com>
Fri, 20 Oct 2006 06:52:31 +0000 (06:52 +0000)
committerapo <apo@opencascade.com>
Fri, 20 Oct 2006 06:52:31 +0000 (06:52 +0000)
   Incorrect visualization of time stamp on field built on profile.
Additional check that verifies whether it is possible to build the presentation on the Entity or not is introduced.

src/CONVERTOR/VISU_Convertor_impl.cxx

index c39f28fecda312d79f99b1df6114e6eeaf3003a1..4ce5600e1d6f62f0170ff9b7b9703050d0957bbf 100644 (file)
@@ -1485,17 +1485,19 @@ namespace
   
   
   //---------------------------------------------------------------
-  void
+  bool
   GetMeshOnProfile(const PMeshImpl& theMesh,
                   const PMeshOnEntityImpl& theMeshOnEntity,
                   const PProfileImpl& theProfile)
   {
     INITMSG(MYDEBUG,"GetMeshOnProfile - anEntity = "<<theMeshOnEntity->myEntity<<endl);
 
+    if(theProfile->myMeshOnEntity && theProfile->myMeshOnEntity != theMeshOnEntity.get())
+      return false;
+      
     if(theProfile->myIsVTKDone)
-      return;
-    
-    theProfile->myMeshOnEntity = theMeshOnEntity.get();
+      return true;
+   
     const TVTKAppendFilter& anAppendFilter = theProfile->GetFilter();
     anAppendFilter->SetPoints(GetPoints(theMesh));
 
@@ -1533,9 +1535,11 @@ namespace
       }
     }
     anAppendFilter->Update(); // Fix on VTK
+    theProfile->myMeshOnEntity = theMeshOnEntity.get();
     theProfile->myNamedPointCoords = theMesh->myNamedPointCoords;
     
     theProfile->myIsVTKDone = true;
+    return true;
   }
   
   
@@ -2073,15 +2077,20 @@ VISU_Convertor_impl
                        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);
-
+  TVTKOutput* anOutput = NULL;
+  try{
+    LoadMeshOnEntity(theMesh,theMeshOnEntity);
+    GetMeshOnEntity(theMeshOnEntity->myMeshName,theMeshOnEntity->myEntity);
+    if(GetMeshOnProfile(theMesh,theMeshOnEntity,theProfile)){
+      theIDMapperFilter->myIDMapper = theProfile;
+      anOutput = theIDMapperFilter->GetVTKOutput();
+      const TVTKSource& aSource = theIDMapperFilter->mySource.GetSource();
+      ::GetTimeStampOnProfile(aSource,theField,theValForTime,theEntity);
+    }
+  }catch(std::exception& exc){
+    MSG(MYDEBUG,"Follow exception was occured :\n"<<exc.what());
+    return NULL;
+  }
   return anOutput;
 }
 
@@ -2121,17 +2130,14 @@ VISU_Convertor_impl
     if(!anIDMapperFilter->myIsVTKDone){
       LoadValForTimeOnMesh(aMesh,aMeshOnEntity,aField,aValForTime);
 
-      TVTKOutput* anOutput;
-      try{
-       anOutput = GetTimeStampOnProfile(aMesh,
-                                        aVTKMeshOnEntity,
-                                        aField,
-                                        aValForTime,
-                                        anIDMapperFilter,
-                                        aValForTime->myProfile,
-                                        aMeshOnEntity->myEntity);
-      }catch(std::exception& exc){
-       MSG(MYDEBUG,"Follow exception was occured :\n"<<exc.what());
+      TVTKOutput* anOutput = GetTimeStampOnProfile(aMesh,
+                                                  aVTKMeshOnEntity,
+                                                  aField,
+                                                  aValForTime,
+                                                  anIDMapperFilter,
+                                                  aValForTime->myProfile,
+                                                  aMeshOnEntity->myEntity);
+      if(!anOutput)
        anOutput = GetTimeStampOnProfile(aMesh,
                                         aMeshOnEntity,
                                         aField,
@@ -2139,7 +2145,6 @@ VISU_Convertor_impl
                                         anIDMapperFilter,
                                         aValForTime->myProfile,
                                         aVTKMeshOnEntity->myEntity);
-      }
 
       anIDMapperFilter->myIsVTKDone = true;