]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
fix for Bug GVIEW10166
authorpkv <pkv@opencascade.com>
Fri, 7 Oct 2005 08:40:38 +0000 (08:40 +0000)
committerpkv <pkv@opencascade.com>
Fri, 7 Oct 2005 08:40:38 +0000 (08:40 +0000)
src/PIPELINE/VISU_Extractor.cxx
src/PIPELINE/VISU_ScalarMapPL.cxx
src/VISUGUI/VisuGUI_GaussPointsDlg.cxx
src/VISUGUI/VisuGUI_ScalarBarDlg.cxx
src/VISU_I/VISU_GaussPoints_i.cc

index 74cef5a864fc50d496f1e0cf1bfca0489a21758a..fa36cd8e3173c6b0a418df4561e1e783d55e3935 100644 (file)
@@ -41,7 +41,7 @@ using namespace std;
 vtkStandardNewMacro(VISU_Extractor);
 
 VISU_Extractor::VISU_Extractor(){
-  myScalarMode = 0;
+  myScalarMode = 1;
 }
 
 VISU_Extractor::~VISU_Extractor(){
index 9d79508cbfaa9115a18917895a268c4bf1070bc4..1a644c7c378decab74a85c3b9c7d172cc95e70a8 100644 (file)
@@ -92,6 +92,26 @@ void
 VISU_ScalarMapPL
 ::SetScalarMode(int theScalarMode)
 {
+  vtkDataSet *input = GetInput();
+  if (input){
+    if(input->GetPointData()->GetNumberOfArrays()){
+      vtkPointData *inData = input->GetPointData();
+      if(!inData->GetAttribute(vtkDataSetAttributes::VECTORS)) {
+       if (theScalarMode==0){
+         return;
+       }
+      }
+    }
+    else {
+      vtkCellData *inData = input->GetCellData();
+      if(!inData->GetAttribute(vtkDataSetAttributes::VECTORS)){
+       if (theScalarMode==0){
+         return;
+       }
+      }
+    }
+  }
+  //
   myExtractor->SetScalarMode(theScalarMode);
   Modified();
 }
index eb87185595bd98313a0e81706204d8f45458aed2..823990d68353e2936e2d23f3aa693b0032d7b815 100644 (file)
@@ -312,6 +312,9 @@ void VisuGUI_GaussScalarBarPane::initFromPrsObject(VISU::GaussPoints_i* thePrs)
   }
   //
   myModeCombo->setCurrentItem(thePrs->GetScalarMode());
+  if (aNbComp==1){
+    myModeCombo->setCurrentItem(1);
+  }
   //
   myModeLbl->setEnabled(isScalarMode);
   myModeCombo->setEnabled(isScalarMode);
index 41ecd38974cc2c07258cdd900d86c263b02e0ffe..399e063774e3b9996c91e37ba815e5d0ffc7c661 100644 (file)
@@ -546,6 +546,9 @@ void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ScalarMap_i* thePrs) {
   }
   //
   myModeCombo->setCurrentItem(thePrs->GetScalarMode());
+  if (aNbComp==1){
+    myModeCombo->setCurrentItem(1);
+  }
   //
   myModeLbl->setEnabled(isScalarMode);
   myModeCombo->setEnabled(isScalarMode);
index 3aca4537f7e27baeaedd371b002405d33950eb88..b9d60abb4491496353e49a8af06cc646fe378954 100644 (file)
@@ -546,7 +546,9 @@ VISU::GaussPoints_i
       if(VISU_ScalarBarCtrl *aScalarBarCtrl = anActor->GetScalarBarCtrl()){
        vtkIdType aScalarMode = GetScalarMode();
        TMinMax aTMinMax = myField->GetMinMax(aScalarMode);
-       float *aRange = myScalarMapPL->GetBarTable()->GetRange();
+       float aRange[2];
+       myScalarMapPL->GetSourceRange(aRange);
+       //float *aRange = myScalarMapPL->GetBarTable()->GetRange();
 
        aScalarBarCtrl->SetRangeGlobal(aTMinMax.first, aTMinMax.second);
        aScalarBarCtrl->SetRangeLocal(aRange);