myModeLbl = new QLabel("Scalar Mode", RangeGroup);
myModeCombo = new QComboBox(RangeGroup);
- myModeCombo->insertItem("Modulus");
- myModeCombo->insertItem("Component 1");
- myModeCombo->insertItem("Component 2");
- myModeCombo->insertItem("Component 3");
RangeGroupLayout->addWidget( myModeLbl, 0, 0 );
RangeGroupLayout->addWidget( myModeCombo, 0, 1 );
LabelLabel->setEnabled( !bicolor );
LabelSpin->setEnabled( !bicolor );
-
float aRange[2];
thePrs->GetGaussPointsPL()->GetSourceRange(aRange);
Rmin = aRange[0]; Rmax = aRange[1];
setScalarBarData( thePrs->GetNbColors(), thePrs->GetLabels() );
- bool isScalarMode = (thePrs->GetField()->myNbComp > 1);
+
+ // Update myModeCombo
+ int aNbComp = thePrs->GetField()->myNbComp;
+ bool isScalarMode = (aNbComp > 1);
+ myModeCombo->clear();
+ myModeCombo->insertItem("<Modulus>");
+ const VISU::PField& aField = thePrs->GetField();
+ const VISU::TNames& aCompNames = aField->myCompNames;
+ const VISU::TNames& aUnitNames = aField->myUnitNames;
+ for(int i = 0; i < aNbComp; i++){
+ QString aComponent = QString(aCompNames[i]).simplifyWhiteSpace();
+ if(aComponent.isNull() || aComponent == "")
+ aComponent = "Component " + QString::number(i+1);
+ else
+ aComponent = "[" + QString::number(i+1) + "] " + aComponent;
+
+ QString anUnit = QString(aUnitNames[i]).simplifyWhiteSpace();
+ if(anUnit.isNull() || anUnit == "")
+ anUnit = "-";
+
+ aComponent = aComponent + ", " + anUnit;
+
+ myModeCombo->insertItem(aComponent);
+ }
+ //
+ myModeCombo->setCurrentItem(thePrs->GetScalarMode());
+ //
myModeLbl->setEnabled(isScalarMode);
myModeCombo->setEnabled(isScalarMode);
setRange( thePrs->GetMin(), thePrs->GetMax(),
/*0.0, 0.0,*/ thePrs->IsRangeFixed() );
setScalarBarData( thePrs->GetNbColors(), thePrs->GetLabels() );
- //
- int aNbComp=thePrs->GetField()->myNbComp;
+
+ // Update myModeCombo
+ int aNbComp = thePrs->GetField()->myNbComp;
bool isScalarMode = (aNbComp > 1);
- //
- // update myModeCombo
myModeCombo->clear();
myModeCombo->insertItem("<Modulus>");
const VISU::PField& aField = thePrs->GetField();