From: apo Date: Fri, 18 May 2007 07:31:12 +0000 (+0000) Subject: To update scalar range on changing of scalar source X-Git-Tag: mergeto_BR_Dev_For_4_0_21May07~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=67bc52c6641a617c76cab42f0b2f9ece5e54d311;p=modules%2Fvisu.git To update scalar range on changing of scalar source --- diff --git a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx index 65ece955..54ff4f87 100644 --- a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx +++ b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx @@ -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(); } //---------------------------------------------------------------------------- diff --git a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx index 3d1b7afd..62f99dec 100644 --- a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx +++ b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx @@ -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 diff --git a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc index fbc0e6f9..f2a227a9 100644 --- a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc +++ b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc @@ -408,6 +408,8 @@ VISU::ScalarMapOnDeformedShape_i myScalarTimeStampNumber = theTimeStampNumber; SetTitle(theFieldName); + if(!IsRangeFixed() && IsPipeLineExists()) + GetSpecificPL()->SetSourceRange(); myParamsTime.Modified(); }