]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Integration of development done in the MERGE_MULTIPR_EVOLUTION CVS branch mergefrom_MERGE_MULTIPR_EVOLUTION_07-Dec-07
authorapo <apo@opencascade.com>
Fri, 7 Dec 2007 08:02:28 +0000 (08:02 +0000)
committerapo <apo@opencascade.com>
Fri, 7 Dec 2007 08:02:28 +0000 (08:02 +0000)
src/VISUGUI/VisuGUI_FieldFilter.cxx
src/VISUGUI/VisuGUI_InputPane.cxx
src/VISUGUI/VisuGUI_Slider.cxx
src/VISU_I/VISU_ColoredPrs3d_i.cc
src/VISU_I/VISU_GaussPoints_i.cc
src/VISU_I/VISU_MultiResult_i.cc
src/VISU_I/VISU_Result_i.cc

index c2a0ca799813950648e03b81eee16d1d3c8a0759..807d2157e162da8480740e5d985df2c426a03989 100644 (file)
@@ -96,7 +96,12 @@ bool VisuGUI_FieldFilter::isOk( const SUIT_DataOwner* theDataOwner ) const
       anInput.myFieldName = CORBA::string_dup( aFieldName.latin1() );
       anInput.myTimeStampNumber = 1;
 
+      QApplication::setOverrideCursor(Qt::waitCursor);
+
       size_t isOk = VISU::CheckIsPossible( myType, anInput, true );
+
+      QApplication::restoreOverrideCursor();
+
       return isOk > 0;
     }
   }
index 3b90cc1786e21b0d050cfcbd5e3a8339f942f1e9..6b1a68f80417a6674fc84d462327e900e94e03d9 100644 (file)
@@ -409,6 +409,8 @@ void VisuGUI_InputPane::onSelectionChanged()
 
     if( myReInit->isChecked() && myPrs )
     {
+      QApplication::setOverrideCursor(Qt::waitCursor);
+
       myPrs->SetResultObject( myResult );
       myPrs->SetMeshName( aMeshName.latin1() );
       myPrs->SetEntity( VISU::Entity( myEntity ) );
@@ -417,6 +419,8 @@ void VisuGUI_InputPane::onSelectionChanged()
       myPrs->Apply( true );
 
       myDialog->initFromPrsObject( myPrs, false );
+
+      QApplication::restoreOverrideCursor();
     }
   }
 }
@@ -425,9 +429,13 @@ void VisuGUI_InputPane::onSelectionChanged()
 //---------------------------------------------------------------
 void VisuGUI_InputPane::changeTimeStamp( int theTimeStamp )
 {
+  QApplication::setOverrideCursor(Qt::waitCursor);
+
   myPrs->SetTimeStampNumber( myPrs->GetTimeStampNumberByIndex( theTimeStamp ) );
   myPrs->Apply( true );
   myDialog->initFromPrsObject( myPrs, false );
+
+  QApplication::restoreOverrideCursor();
 }
 
 
index fe6cf3ebd075449d77c22004fc6460242c7d4d5b..2e6c8c0efa494aaae855d2a75972f800f1f18cb6 100644 (file)
@@ -436,7 +436,11 @@ void VisuGUI_Slider::onValueChanged( int value )
     VISU::ColoredPrs3dHolder::BasicInput_var anInput = aHolder->GetBasicInput();
     anInput->myTimeStampNumber = aNumber;
 
+    QApplication::setOverrideCursor(Qt::waitCursor);
+    
     aHolder->Apply( aPrs3d, anInput, myView3D );
+    
+    QApplication::restoreOverrideCursor();
   }
 
   updateMemoryState();
index 118e2272008c0b480b9430ddb7b7e5ace0d2f712..5616092747561a377d3cea54d92dfd998d88be92 100644 (file)
@@ -191,10 +191,11 @@ void
 VISU::ColoredPrs3d_i
 ::RemoveFromStudy()
 {
-  struct TRemoveFromStudy: public SALOME_Event
+  struct TEvent: public SALOME_Event
   {
     VISU::ColoredPrs3d_i* myRemovable;
-    TRemoveFromStudy(VISU::ColoredPrs3d_i* theRemovable):
+
+    TEvent(VISU::ColoredPrs3d_i* theRemovable):
       myRemovable(theRemovable)
     {}
     
@@ -203,13 +204,15 @@ VISU::ColoredPrs3d_i
     Execute()
     {
       SALOMEDS::SObject_var aSObject = myRemovable->GetSObject();
+
       if(!CORBA::is_nil(aSObject.in()))
        VISU::RemoveFromStudy(aSObject,false);
+
       myRemovable->TSuperClass::RemoveFromStudy();
     }
   };
 
-  ProcessVoidEvent(new TRemoveFromStudy(this));
+  ProcessVoidEvent(new TEvent(this));
 }
 
 
@@ -218,16 +221,31 @@ void
 VISU::ColoredPrs3d_i
 ::UpdateFromResult(Result_i* theResult)
 {
-  try{
-    if(theResult == GetCResult()){
-      DoSetInput(false, false);
-      UpdateActors();
+  struct TEvent: public SALOME_Event
+  {
+    VISU::ColoredPrs3d_i* myColoredPrs3d;
+
+    TEvent(VISU::ColoredPrs3d_i* theColoredPrs3d):
+      myColoredPrs3d(theColoredPrs3d)
+    {}
+    
+    virtual
+    void
+    Execute()
+    {
+      try{
+       myColoredPrs3d->DoSetInput(false, false);
+       myColoredPrs3d->UpdateActors();
+      }catch(std::exception& exc){
+       INFOS("Follow exception was occured :\n"<<exc.what());
+      }catch(...){
+       INFOS("Unknown exception was occured!");
+      }
     }
-  }catch(std::exception& exc){
-    INFOS("Follow exception was occured :\n"<<exc.what());
-  }catch(...){
-    INFOS("Unknown exception was occured!");
-  }
+  };
+
+  if ( theResult == GetCResult() ) 
+    ProcessVoidEvent(new TEvent(this));
 }
 
 
@@ -284,7 +302,8 @@ VISU::ColoredPrs3d_i
     if(!IsRangeFixed() && theReInit)
       SetSourceRange();
 
-    GetCResult()->ConnectObserver(this, myResultConnection);
+    if(GetPublishInStudyMode() != EDoNotPublish)
+      GetCResult()->ConnectObserver(this, myResultConnection);
 
     myPreviousEntity = myEntity;
     myPreviousFieldName = myFieldName;
@@ -780,28 +799,81 @@ VISU::ColoredPrs3d_i
   return GetComponentMax(GetScalarMode());
 }
 
+
+//----------------------------------------------------------------------------
+struct TGetComponentMin: public SALOME_Event
+{
+  VISU::ColoredPrs3d_i* myColoredPrs3d;
+  vtkIdType myCompID;
+
+  typedef CORBA::Double TResult;
+  TResult myResult;
+  
+  TGetComponentMin( VISU::ColoredPrs3d_i* theColoredPrs3d,
+                   vtkIdType theCompID ):
+    myColoredPrs3d( theColoredPrs3d ),
+    myCompID( theCompID )
+  {}
+    
+  virtual
+  void
+  Execute()
+  {
+    VISU::PMinMaxController aMinMaxController = myColoredPrs3d->GetMinMaxController();
+    if ( aMinMaxController ) {
+      myResult = aMinMaxController->GetComponentMin( myCompID );
+    } else {
+      VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myCompID );
+      myResult = aTMinMax.first;
+    }
+  }
+};
+
+
 //----------------------------------------------------------------------------
 vtkFloatingPointType 
 VISU::ColoredPrs3d_i
 ::GetComponentMin(vtkIdType theCompID)
 {
-  if(PMinMaxController aMinMaxController = GetMinMaxController())
-    return aMinMaxController->GetComponentMin(theCompID);
-
-  TMinMax aTMinMax = GetMinMax(GetCResult(), GetField(), theCompID);
-  return aTMinMax.first;
+  return ProcessEvent( new TGetComponentMin( this, theCompID ) );
 }
 
+//----------------------------------------------------------------------------
+struct TGetComponentMax: public SALOME_Event
+{
+  VISU::ColoredPrs3d_i* myColoredPrs3d;
+  vtkIdType myCompID;
+
+  typedef CORBA::Double TResult;
+  TResult myResult;
+  
+  TGetComponentMax( VISU::ColoredPrs3d_i* theColoredPrs3d,
+                   vtkIdType theCompID ):
+    myColoredPrs3d( theColoredPrs3d ),
+    myCompID( theCompID )
+  {}
+    
+  virtual
+  void
+  Execute()
+  {
+    VISU::PMinMaxController aMinMaxController = myColoredPrs3d->GetMinMaxController();
+    if ( aMinMaxController ) {
+      myResult = aMinMaxController->GetComponentMax( myCompID );
+    } else {
+      VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myCompID );
+      myResult = aTMinMax.second;
+    }
+  }
+};
+
+
 //----------------------------------------------------------------------------
 vtkFloatingPointType 
 VISU::ColoredPrs3d_i
 ::GetComponentMax(vtkIdType theCompID)
 {
-  if(PMinMaxController aMinMaxController = GetMinMaxController())
-    return aMinMaxController->GetComponentMax(theCompID);
-
-  TMinMax aTMinMax = GetMinMax(GetCResult(), GetField(), theCompID);
-  return aTMinMax.second;
+  return ProcessEvent( new TGetComponentMax( this, theCompID ) );
 }
 
 //----------------------------------------------------------------------------
index 7d9a4152dc4acca3c98992f94f9980b88ab09176..ede97ab9b59b27d067bf3ed95d67cc9a88f3c113 100644 (file)
@@ -929,11 +929,11 @@ VISU::GaussPoints_i
        aScalarBarCtrl->SetRangeLocal(aRange);
       }
 
-      TMinMax aTMinMax(-VTK_LARGE_FLOAT,VTK_LARGE_FLOAT);
       bool anIsMinMaxDone = IsGlobalRangeDefined();
-      if(anIsMinMaxDone)
-       aTMinMax = GetField()->GetMinMax(GetScalarMode());
       aScalarBarCtrl->SetGlobalRangeIsDefined(anIsMinMaxDone);
+
+      TMinMax aTMinMax( GetComponentMin( GetScalarMode() ),
+                       GetComponentMax( GetScalarMode() ));
       aScalarBarCtrl->SetRangeGlobal(aTMinMax.first, aTMinMax.second);
       
       VISU_ScalarBarCtrl::EMode aScalarBarMode = VISU_ScalarBarCtrl::eGlobal;
@@ -1044,6 +1044,10 @@ VISU::GaussPoints_i
   VISU::TSetModified aModified(this);
   
   myIsActiveLocalScalarBar = theIsActiveLocalScalarBar;
+
+  if ( !theIsActiveLocalScalarBar || !IsRangeFixed() )
+    SetSourceRange();
+
   myParamsTime.Modified();
 }
 
@@ -1088,32 +1092,78 @@ VISU::GaussPoints_i
   UseFixedRange(false);
 }
 
+
+//----------------------------------------------------------------------------
+struct TGetSourceMin: public SALOME_Event
+{
+  VISU::GaussPoints_i* myColoredPrs3d;
+
+  typedef CORBA::Double TResult;
+  TResult myResult;
+  
+  TGetSourceMin( VISU::GaussPoints_i* theColoredPrs3d ):
+    myColoredPrs3d( theColoredPrs3d )
+  {}
+    
+  virtual
+  void
+  Execute()
+  {
+    if ( myColoredPrs3d->IsTimeStampFixed() || myColoredPrs3d->GetIsActiveLocalScalarBar() ) {
+      vtkFloatingPointType aRange[2];
+      myColoredPrs3d->GetSpecificPL()->GetSourceRange(aRange);
+      myResult = aRange[0];
+    }else{
+      VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myColoredPrs3d->GetScalarMode() );
+      myResult = aTMinMax.first;
+    }
+  }
+};
+
+
+//----------------------------------------------------------------------------
 CORBA::Double 
 VISU::GaussPoints_i
 ::GetSourceMin()
 {
-  if(IsTimeStampFixed() || GetIsActiveLocalScalarBar()){
-    vtkFloatingPointType aRange[2];
-    GetSpecificPL()->GetSourceRange(aRange);
-    return aRange[0];
-  }else{
-    TMinMax aTMinMax = GetField()->GetMinMax(GetScalarMode());
-    return aTMinMax.first;
-  }
+  return ProcessEvent( new TGetSourceMin( this ) );
 }
 
+
+//----------------------------------------------------------------------------
+struct TGetSourceMax: public SALOME_Event
+{
+  VISU::GaussPoints_i* myColoredPrs3d;
+
+  typedef CORBA::Double TResult;
+  TResult myResult;
+  
+  TGetSourceMax( VISU::GaussPoints_i* theColoredPrs3d ):
+    myColoredPrs3d( theColoredPrs3d )
+  {}
+    
+  virtual
+  void
+  Execute()
+  {
+    if ( myColoredPrs3d->IsTimeStampFixed() || myColoredPrs3d->GetIsActiveLocalScalarBar() ) {
+      vtkFloatingPointType aRange[2];
+      myColoredPrs3d->GetSpecificPL()->GetSourceRange(aRange);
+      myResult = aRange[1];
+    }else{
+      VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myColoredPrs3d->GetScalarMode() );
+      myResult = aTMinMax.second;
+    }
+  }
+};
+
+
+//----------------------------------------------------------------------------
 CORBA::Double 
 VISU::GaussPoints_i
 ::GetSourceMax()
 {
-  if(IsTimeStampFixed() || GetIsActiveLocalScalarBar()){
-    vtkFloatingPointType aRange[2];
-    GetSpecificPL()->GetSourceRange(aRange);
-    return aRange[1];
-  }else{
-    TMinMax aTMinMax = GetField()->GetMinMax(GetScalarMode());
-    return aTMinMax.second;
-  }
+  return ProcessEvent( new TGetSourceMax( this ) );
 }
 
 
index 8894cb93114e44a3b38519aebbc9ba050cb1fd14..f99d8ffda706df3072300b9cc17880b698915c25 100644 (file)
@@ -284,6 +284,7 @@ namespace VISU
     if(!theIsBuild || *theIsDone)
       return;
     
+    INITMSG(MYDEBUG, "BuildParts\n");
     TTimerLog aTimerLog(MYTIMEDEBUG, "BuildParts");
     TResultManager aResultManager(theResult);
     TTransactionManager aTransactionManager(theStudy);
@@ -295,6 +296,7 @@ namespace VISU
       const VISU::PMesh& aMesh = aMeshMapIter->second;
       
       MultiResult_i::TPartNames aPartNames = aMultiprObj.getParts();
+      BEGMSG(MYDEBUG, "aPartNames.size() = "<<aPartNames.size()<<"\n");
       
       if(thePublishInStudy){
        QString aComment = "Sub-parts: #";
@@ -320,6 +322,7 @@ namespace VISU
        const MultiResult_i::TPartName& aPartName = aPartNames[aPartID];
        MultiResult_i::TPartName aMainPart = ExtractMainPart(aPartName);
        aMainPart2SubPartNames[aMainPart].insert(aPartName);
+       BEGMSG(MYDEBUG, "aMainPart2SubPartNames['"<<aMainPart<<"'].insert('"<<aPartName<<"')\n");
       }
       
       for (size_t aPartID = 0 ; aPartID < aPartNames.size() ; aPartID++) {
@@ -330,6 +333,7 @@ namespace VISU
        aPartInfos[aFileInfo.fileName()] = aPartInfo;
        
        aPartName2FileName[aPartInfo.myName] = aPartInfo.myFileName;
+       BEGMSG(MYDEBUG, "aPartName2FileName['"<<aPartInfo.myName<<"'] = '"<<aPartInfo.myFileName<<"'\n");
        
        if(!thePublishInStudy)
          continue;
@@ -351,6 +355,7 @@ namespace VISU
                           aComment.latin1(),
                           true);
          aPartName2Resolution[aPartInfo.myName] = aResolution;
+         BEGMSG(MYDEBUG, "aPartName2Resolution['"<<aPartInfo.myName<<"'] = '"<<aResoltutionsString<<"'\n");
        }
       }
       
@@ -551,12 +556,23 @@ VISU::MultiResult_i
   QFileInfo aFileInfo(theFileName);
   QString aTargetFileName = aFileInfo.filePath();
   if(aTargetFileName.endsWith("_maitre.med")){
-    myMultiprObj.create(theFileName);
-    if (myMultiprObj.isValidDistributedMEDFile()) {
-      aTargetFileName = myMultiprObj.getSequentialMEDFilename();
-      SetInitFileName(aFileInfo.filePath().latin1());
-      SetName(VISU::GenerateName(aFileInfo.fileName()).latin1(), false);
-      myIsBuildParts = true;
+    try {
+      myMultiprObj.create(theFileName);
+      if ( myMultiprObj.isValidDistributedMEDFile() ) {
+       aTargetFileName = myMultiprObj.getSequentialMEDFilename();
+       SetInitFileName(aFileInfo.filePath().latin1());
+       SetName(VISU::GenerateName(aFileInfo.fileName()).latin1(), false);
+       myIsBuildParts = true;
+      }
+    }catch(std::exception& exc){
+      MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
+    }catch(multipr::RuntimeException& exc){
+      std::ostringstream aStream;
+      exc.dump(aStream);
+      aStream<<ends;
+      MSG(MYDEBUG,"Follow exception was occured in:\n"<<aStream.str());
+    }catch(...){
+      MSG(MYDEBUG,"Unknown exception !!!");
     }
   }
 
@@ -816,7 +832,7 @@ VISU::MultiResult_i
       continue;
 
     MultiResult_i::TPartInfo aPartInfo = GetPartInfo(myMultiprObj, aPartName);
-    if(aPartInfo.myMeshName == theMeshName)
+    if(true || aPartInfo.myMeshName == theMeshName) // To ignore theMeshName input parameter
       aMeshParts.push_back(aPartName);
   }
 
@@ -849,7 +865,7 @@ VISU::MultiResult_i
       continue;
 
     MultiResult_i::TPartInfo aPartInfo = GetPartInfo(myMultiprObj, aPartName);
-    if(aPartInfo.myMeshName != theMeshName)
+    if(false || aPartInfo.myMeshName != theMeshName) // To ignore theMeshName input parameter
       continue;
 
     MultiResult_i::TResolutions aResolutions = VISU::GetResolutions(myMainPart2SubPartNames, thePartName);
@@ -908,11 +924,11 @@ VISU::MultiResult_i
 
   VISU::Storable::TRestoringMap aRestoringMap;
   aRestoringMap["myComment"] = "PART";
-  aRestoringMap["myMeshName"] = theMeshName;
+  //aRestoringMap["myMeshName"] = theMeshName; // To ignore theMeshName input parameter
   aRestoringMap["myName"] = thePartName;
 
   const VISU::TMeshMap& aMeshMap = Result_i::GetInput()->GetMeshMap();
-  //VISU::TMeshMap::const_iterator aMeshIter = aMeshMap.find(theMeshName);
+  //VISU::TMeshMap::const_iterator aMeshIter = aMeshMap.find(theMeshName); // To ignore theMeshName input parameter
   VISU::TMeshMap::const_iterator aMeshIter = aMeshMap.begin();
   if(aMeshIter == aMeshMap.end())
     return;
@@ -926,6 +942,9 @@ VISU::MultiResult_i
   else
     aFatherEntry = Result_i::GetEntry(aRestoringMap);
   
+  if ( aFatherEntry == "" )
+    return;
+
   std::string anIconName = "ICON_MULTIPR_VIEW_HIDE";
   if(theResolution == VISU::Result::FULL)
     anIconName = "ICON_MULTIPR_VIEW_FULL";
index 775d3e48489ce8876ded6df120465c056891aae5..c6edea987411e72abaaaa5148bc43c0d4300dd91 100644 (file)
@@ -236,7 +236,23 @@ void
 VISU::Result_i
 ::UpdateObservers()
 {
-  myUpdateObserverSignal();
+  struct TEvent: public SALOME_Event
+  {
+    VISU::Result_i::TUpdateObserverSignal& myUpdateObserverSignal;
+
+    TEvent(VISU::Result_i::TUpdateObserverSignal& theUpdateObserverSignal):
+      myUpdateObserverSignal(theUpdateObserverSignal)
+    {}
+    
+    virtual
+    void
+    Execute()
+    {
+      myUpdateObserverSignal();
+    }
+  };
+
+  ProcessVoidEvent(new TEvent(myUpdateObserverSignal));
 }
 
 
@@ -533,9 +549,9 @@ VISU::Result_i
       return this;
     }
   }catch(std::exception& exc){
-    INFOS("Follow exception was occured :\n"<<exc.what());
+    MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
   }catch(...){
-    INFOS("Unknown exception was occured!!!");
+    MSG(MYDEBUG,"Unknown exception !!!");
   }
   return NULL;
 }