mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-02-10 20:13:08 +05:00
[bos #32736][CEA] Threshold of criteria. Added initial state of Threshold checkbox by checking if vtkLookupTable uses above and below range colors.
This commit is contained in:
parent
822058a1f0
commit
19b74c9f65
@ -663,6 +663,7 @@ void SMESHGUI_Preferences_ScalarBarDlg::onSelectionChanged()
|
|||||||
//myLogarithmicCheck->setEnabled(range[0] > 1e-07 && range[1] > 1e-07);
|
//myLogarithmicCheck->setEnabled(range[0] > 1e-07 && range[1] > 1e-07);
|
||||||
myLogarithmicCheck->setEnabled(range[0] != range[1]);
|
myLogarithmicCheck->setEnabled(range[0] != range[1]);
|
||||||
|
|
||||||
|
setThresholdFromTable(aLookupTable);
|
||||||
applyThreshold(aLookupTable);
|
applyThreshold(aLookupTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -882,6 +883,29 @@ void SMESHGUI_Preferences_ScalarBarDlg::initScalarBarFromResources()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================================
|
||||||
|
/*!
|
||||||
|
* SMESHGUI_Preferences_ScalarBarDlg::setThresholdFromTable()
|
||||||
|
*
|
||||||
|
* Checks if the table uses special color for values beyond the min-max range,
|
||||||
|
* and this color is completely transparent - RGBA(0,0,0,0).
|
||||||
|
*/
|
||||||
|
//=================================================================================================
|
||||||
|
void SMESHGUI_Preferences_ScalarBarDlg::setThresholdFromTable(vtkLookupTable* aLookupTable)
|
||||||
|
{
|
||||||
|
bool isUseBeyondRangeColor = aLookupTable->GetUseAboveRangeColor() && aLookupTable->GetUseBelowRangeColor();
|
||||||
|
|
||||||
|
if (isUseBeyondRangeColor)
|
||||||
|
{
|
||||||
|
const double* aboveRangeColor = aLookupTable->GetAboveRangeColor();
|
||||||
|
const double* belowRangeColor = aLookupTable->GetBelowRangeColor();
|
||||||
|
|
||||||
|
isUseBeyondRangeColor = aboveRangeColor[3] == 0.0 && belowRangeColor[3] == 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
myThresholdCheck->setChecked(isUseBeyondRangeColor);
|
||||||
|
}
|
||||||
|
|
||||||
//=================================================================================================
|
//=================================================================================================
|
||||||
/*!
|
/*!
|
||||||
* SMESHGUI_Preferences_ScalarBarDlg::applyThreshold()
|
* SMESHGUI_Preferences_ScalarBarDlg::applyThreshold()
|
||||||
|
@ -73,6 +73,7 @@ public:
|
|||||||
void initScalarBarFromResources();
|
void initScalarBarFromResources();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void setThresholdFromTable(vtkLookupTable* aLookupTable);
|
||||||
void applyThreshold(vtkLookupTable* aLookupTable);
|
void applyThreshold(vtkLookupTable* aLookupTable);
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
|
Loading…
Reference in New Issue
Block a user