##// END OF EJS Templates
Remove variable from graph (3)...
Alexandre Leroux -
r251:7858a36671f7
parent child
Show More
@@ -79,6 +79,17 void VisualizationGraphWidget::addVariable(std::shared_ptr<Variable> variable)
79
79
80 void VisualizationGraphWidget::removeVariable(std::shared_ptr<Variable> variable) noexcept
80 void VisualizationGraphWidget::removeVariable(std::shared_ptr<Variable> variable) noexcept
81 {
81 {
82 // Each component associated to the variable :
83 // - is removed from qcpplot (which deletes it)
84 // - is no longer referenced in the map
85 auto componentsIt = impl->m_VariableToPlotMultiMap.equal_range(variable);
86 for (auto it = componentsIt.first; it != componentsIt.second;) {
87 ui->widget->removePlottable(it->second);
88 it = impl->m_VariableToPlotMultiMap.erase(it);
89 }
90
91 // Updates graph
92 ui->widget->replot();
82 }
93 }
83
94
84 void VisualizationGraphWidget::accept(IVisualizationWidgetVisitor *visitor)
95 void VisualizationGraphWidget::accept(IVisualizationWidgetVisitor *visitor)
General Comments 0
You need to be logged in to leave comments. Login now