diff --git a/Include/nmNum/nmSubWxs/nmPebiResultPropertyDisplayText.h b/Include/nmNum/nmSubWxs/nmPebiResultPropertyDisplayText.h index 8fe9402a..4c3a0a92 100644 --- a/Include/nmNum/nmSubWxs/nmPebiResultPropertyDisplayText.h +++ b/Include/nmNum/nmSubWxs/nmPebiResultPropertyDisplayText.h @@ -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 单位原文;未知属性或无量纲属性返回空字符串。 diff --git a/Src/nmNum/nmSubWxs/nmPebiResultPropertyDisplayText.cpp b/Src/nmNum/nmSubWxs/nmPebiResultPropertyDisplayText.cpp index 89382d3f..ca1f29ed 100644 --- a/Src/nmNum/nmSubWxs/nmPebiResultPropertyDisplayText.cpp +++ b/Src/nmNum/nmSubWxs/nmPebiResultPropertyDisplayText.cpp @@ -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; diff --git a/Src/nmNum/nmSubWxs/nmPebiResultSceneController.cpp b/Src/nmNum/nmSubWxs/nmPebiResultSceneController.cpp index c7b0b562..e68e4171 100644 --- a/Src/nmNum/nmSubWxs/nmPebiResultSceneController.cpp +++ b/Src/nmNum/nmSubWxs/nmPebiResultSceneController.cpp @@ -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];