fix:调整对数色标标题格式

- 根据线性或对数模式生成对应的色标标题
- 对数模式使用 log(属性符号) 并将单位保留在括号外
- 使用已校验的比例模式构造 Scene 显示候选
feature/nmNum-postprocessing-view-20260910
lh 2 weeks ago
parent 14a9e8f627
commit 1197f58734

@ -21,10 +21,12 @@ public:
*/
static QString getDisplayName(const QString& sPropertyId);
/**
* @brief 返回 VTK 色标使用的固定 ASCII 短标题。
* @brief 根据比例模式返回 VTK 色标使用的固定 ASCII 短标题。
* @param bLogarithmic 为 true 时只用 log(...) 包裹属性符号,单位仍置于括号外。
* @note 标题不参与翻译;未知属性返回空字符串。
*/
static QString getScalarBarTitle(const QString& sPropertyId);
static QString getScalarBarTitle(const QString& sPropertyId,
bool bLogarithmic);
/**
* @brief 返回 Catalog 中的默认显示单位。
* @return 单位原文;未知属性或无量纲属性返回空字符串。

@ -35,7 +35,8 @@ QString nmPebiResultPropertyDisplayText::getDisplayName(
}
QString nmPebiResultPropertyDisplayText::getScalarBarTitle(
const QString& sPropertyId)
const QString& sPropertyId,
bool bLogarithmic)
{
nmPebiResultPropertyDescriptor oDescriptor;
if(!nmPebiResultPropertyCatalog::findDescriptor(
@ -61,6 +62,10 @@ QString nmPebiResultPropertyDisplayText::getScalarBarTitle(
return QString();
}
if(bLogarithmic) {
sTitle = QString::fromLatin1("log(") + sTitle +
QString::fromLatin1(")");
}
if(!oDescriptor.m_sDefaultDisplayUnit.isEmpty()) {
sTitle += QString::fromLatin1(" ") +
oDescriptor.m_sDefaultDisplayUnit;

@ -316,7 +316,8 @@ bool prepareDisplayCandidate(
pLookupTable->ResetAnnotations();
const QString sTitle =
nmPebiResultPropertyDisplayText::getScalarBarTitle(sPropertyId);
nmPebiResultPropertyDisplayText::getScalarBarTitle(
sPropertyId, bLogarithmic);
oCandidate.m_oSettings = oSettings;
oCandidate.m_dBusinessRange[0] = dBusinessRange[0];

Loading…
Cancel
Save