//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RimPlotCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) { if (changedField == &m_showCurve) { this->updateCurveVisibility(true); if (m_showCurve()) loadDataAndUpdate(true); } else if (changedField == &m_curveName) { m_customCurveName = m_curveName; updateCurveNameAndUpdatePlotLegendAndTitle(); } else if (&m_curveColor == changedField || &m_curveThickness == changedField || &m_pointSymbol == changedField || &m_lineStyle == changedField || &m_symbolSkipPixelDistance == changedField || &m_curveInterpolation == changedField || &m_symbolSize == changedField || &m_symbolEdgeColor == changedField) { updateCurveAppearance(); if (&m_pointSymbol == changedField) { m_symbolSize.uiCapability()->setUiReadOnly(m_pointSymbol() == RiuQwtSymbol::SYMBOL_NONE); m_symbolSkipPixelDistance.uiCapability()->setUiReadOnly(m_pointSymbol() == RiuQwtSymbol::SYMBOL_NONE); } else if (&m_lineStyle == changedField) { m_curveThickness.uiCapability()->setUiReadOnly(m_lineStyle() == RiuQwtPlotCurve::STYLE_NONE); m_curveInterpolation.uiCapability()->setUiReadOnly(m_lineStyle() == RiuQwtPlotCurve::STYLE_NONE); } } else if (changedField == &m_isUsingAutoName) { if (!m_isUsingAutoName) { m_customCurveName = createCurveAutoName(); } updateCurveNameAndUpdatePlotLegendAndTitle(); } else if (changedField == &m_showLegend) { updateLegendEntryVisibilityAndPlotLegend(); } else if (changedField == &m_showErrorBars) { m_qwtPlotCurve->showErrorBars(m_showErrorBars); updateCurveAppearance(); } RiuPlotMainWindowTools::refreshToolbars(); if (m_parentQwtPlot) m_parentQwtPlot->replot(); }
//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RimPlotCurve::updateCurvePresentation(bool updatePlotLegend) { this->updateCurveVisibility(updatePlotLegend); if (updatePlotLegend) { this->updateCurveNameAndUpdatePlotLegend(); } else { this->updateCurveNameNoLegendUpdate(); } updateCurveAppearance(); }
//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RimPlotCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) { if (changedField == &m_showCurve) { this->updateCurveVisibility(true); if (m_showCurve()) loadDataAndUpdate(true); } else if (changedField == &m_curveName) { m_customCurveName = m_curveName; updateCurveNameAndUpdatePlotLegend(); } else if (&m_curveColor == changedField || &m_curveThickness == changedField || &m_pointSymbol == changedField || &m_lineStyle == changedField || &m_symbolSkipPixelDistance == changedField || &m_curveInterpolation == changedField) { updateCurveAppearance(); } else if (changedField == &m_isUsingAutoName) { if (!m_isUsingAutoName) { m_customCurveName = createCurveAutoName(); } updateCurveNameAndUpdatePlotLegend(); } else if (changedField == &m_showLegend) { updateLegendEntryVisibilityAndPlotLegend(); } if (m_parentQwtPlot) m_parentQwtPlot->replot(); }