From f700beb3d82ed6a0a729bd69df7f035fac62eb98 Mon Sep 17 00:00:00 2001 From: pkv Date: Fri, 7 Oct 2005 08:40:38 +0000 Subject: [PATCH] fix for Bug GVIEW10166 --- src/PIPELINE/VISU_Extractor.cxx | 2 +- src/PIPELINE/VISU_ScalarMapPL.cxx | 20 ++++++++++++++++++++ src/VISUGUI/VisuGUI_GaussPointsDlg.cxx | 3 +++ src/VISUGUI/VisuGUI_ScalarBarDlg.cxx | 3 +++ src/VISU_I/VISU_GaussPoints_i.cc | 4 +++- 5 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/PIPELINE/VISU_Extractor.cxx b/src/PIPELINE/VISU_Extractor.cxx index 74cef5a8..fa36cd8e 100644 --- a/src/PIPELINE/VISU_Extractor.cxx +++ b/src/PIPELINE/VISU_Extractor.cxx @@ -41,7 +41,7 @@ using namespace std; vtkStandardNewMacro(VISU_Extractor); VISU_Extractor::VISU_Extractor(){ - myScalarMode = 0; + myScalarMode = 1; } VISU_Extractor::~VISU_Extractor(){ diff --git a/src/PIPELINE/VISU_ScalarMapPL.cxx b/src/PIPELINE/VISU_ScalarMapPL.cxx index 9d79508c..1a644c7c 100644 --- a/src/PIPELINE/VISU_ScalarMapPL.cxx +++ b/src/PIPELINE/VISU_ScalarMapPL.cxx @@ -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(); } diff --git a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx index eb871855..823990d6 100644 --- a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx +++ b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx @@ -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); diff --git a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx index 41ecd389..399e0637 100644 --- a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx +++ b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx @@ -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); diff --git a/src/VISU_I/VISU_GaussPoints_i.cc b/src/VISU_I/VISU_GaussPoints_i.cc index 3aca4537..b9d60abb 100644 --- a/src/VISU_I/VISU_GaussPoints_i.cc +++ b/src/VISU_I/VISU_GaussPoints_i.cc @@ -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); -- 2.39.2