]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To update scalar range on changing of scalar source
authorapo <apo@opencascade.com>
Fri, 18 May 2007 07:31:12 +0000 (07:31 +0000)
committerapo <apo@opencascade.com>
Fri, 18 May 2007 07:31:12 +0000 (07:31 +0000)
src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx
src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx
src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc

index 65ece9556b7122f194011d396ba49ff0b8607998..54ff4f87d1ab7144301338235aed7ef73b6aa27d 100644 (file)
@@ -153,8 +153,6 @@ VISU_ScalarMapOnDeformedShapePL
 ::Update()
 {
   Superclass::Update();
-
-  UpdateScalars();
   //{
   //  std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myScalarsExtractor.vtk";
   //  VISU::WriteToFile(myScalarsExtractor->GetUnstructuredGridOutput(), aFileName);
@@ -237,7 +235,11 @@ void
 VISU_ScalarMapOnDeformedShapePL
 ::SetScalars(vtkDataSet *theScalars)
 {
+  if(GetScalars() == theScalars)
+    return;
+
   myScalars = theScalars;
+  UpdateScalars();
 }
 
 //----------------------------------------------------------------------------
index 3d1b7afdeba9770d24f2183312d404d5df8ce7c2..62f99dec1ce54fd4ad712fcf627e8a6a23df9dd2 100644 (file)
@@ -377,6 +377,8 @@ VisuGUI_ScalarMapOnDeformedShapeDlg
                 QString theFieldName, 
                 const bool save_scalar_pane )
 {
+  if( save_scalar_pane )
+    myScalarPane->storeToPrsObject(myPrsCopy);
 
   QString aFieldName;
 
@@ -393,10 +395,7 @@ VisuGUI_ScalarMapOnDeformedShapeDlg
                            anEntity);
   
   if( save_scalar_pane )
-  {
-    myScalarPane->storeToPrsObject(myPrsCopy);
     UpdateScalarField();
-  }
 }
 
 void VisuGUI_ScalarMapOnDeformedShapeDlg::accept()
@@ -478,16 +477,7 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::onTimeStampChanged(int){
 }
 
 void VisuGUI_ScalarMapOnDeformedShapeDlg::UpdateScalarField(){
-  myPrsCopy->SetScale(getFactor());
-  vtkFloatingPointType aRange[2];
-  myPrsCopy->GetSpecificPL()->Build();
-  myPrsCopy->GetSpecificPL()->Update();
-  myPrsCopy->GetSpecificPL()->GetSourceRange(aRange);
-  double aDoubleRange[2];
-  aDoubleRange[0] = double(aRange[0]);
-  aDoubleRange[1] = double(aRange[1]);
   myScalarPane->initFromPrsObject(myPrsCopy);
-  myScalarPane->setRange(aDoubleRange[0],aDoubleRange[1],myScalarPane->isIRange());
 }
 
 float 
index fbc0e6f992c263b87f0866d9d2b238f948286f6f..f2a227a974d8128fab4d93a58f7bfaae61707f0d 100644 (file)
@@ -408,6 +408,8 @@ VISU::ScalarMapOnDeformedShape_i
   myScalarTimeStampNumber = theTimeStampNumber;
 
   SetTitle(theFieldName);
+  if(!IsRangeFixed() && IsPipeLineExists())
+    GetSpecificPL()->SetSourceRange();
 
   myParamsTime.Modified();
 }