*/
void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ScalarMap_i* thePrs) {
initFromResources();
- myModeCombo->setCurrentItem(thePrs->GetScalarMode());
setPosAndSize( thePrs->GetPosX(),
thePrs->GetPosY(),
thePrs->GetWidth(),
setRange( thePrs->GetMin(), thePrs->GetMax(),
/*0.0, 0.0,*/ thePrs->IsRangeFixed() );
setScalarBarData( thePrs->GetNbColors(), thePrs->GetLabels() );
- bool isScalarMode = (thePrs->GetField()->myNbComp > 1);
+ //
+ int aNbComp=thePrs->GetField()->myNbComp;
+ bool isScalarMode = (aNbComp > 1);
+ //
+ // update myModeCombo
+ VISU::TNames& aNamesOfComponents =thePrs->GetField()->myCompNames;
+ VISU::TNames& aUnitNamesOfComponents=thePrs->GetField()->myUnitNames;
+ myModeCombo->clear();
+ myModeCombo->insertItem("<Modulus>");
+ for (int i=1; i<=aNbComp; ++i) {
+ VISU::TName aNmUn=aNamesOfComponents[i-1];
+ VISU::TName& aUnits=aUnitNamesOfComponents[i-1];
+ if (!aUnits.empty()) {
+ aNmUn+=", ";
+ aNmUn+=aUnits;
+ }
+ myModeCombo->insertItem(aNmUn);
+ }
+ //
+ myModeCombo->setCurrentItem(thePrs->GetScalarMode());
+ //
myModeLbl->setEnabled(isScalarMode);
myModeCombo->setEnabled(isScalarMode);