diff --git a/Qt/Core/pqPlotSettingsModel.cxx b/Qt/Core/pqPlotSettingsModel.cxx index 52e96f1..8b07e76 100644 --- a/Qt/Core/pqPlotSettingsModel.cxx +++ b/Qt/Core/pqPlotSettingsModel.cxx @@ -32,11 +32,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "pqPlotSettingsModel.h" #include "pqDataRepresentation.h" +#include "pqUndoStack.h" #include "vtkChartRepresentation.h" -#include "vtkSMPropertyHelper.h" +#include "vtkEventQtSlotConnect.h" #include "vtkSMChartRepresentationProxy.h" +#include "vtkSMPropertyHelper.h" #include "vtkWeakPointer.h" -#include "vtkEventQtSlotConnect.h" #include #include @@ -270,6 +271,7 @@ void pqPlotSettingsModel::setSeriesEnabled(int row, bool enabled) { if (row >= 0 && row < this->rowCount(QModelIndex())) { + BEGIN_UNDO_SET("Change Series Visibility"); vtkSMPropertyHelper(this->Implementation->RepresentationProxy, "SeriesVisibility").SetStatus( this->getSeriesName(row), enabled ? 1 : 0); @@ -281,6 +283,7 @@ void pqPlotSettingsModel::setSeriesEnabled(int row, bool enabled) emit this->redrawChart(); emit this->rescaleChart(); this->updateCheckState(0, Qt::Horizontal); + END_UNDO_SET(); } } @@ -297,11 +300,13 @@ void pqPlotSettingsModel::setSeriesLabel(int row, const QString& label) { if (row >= 0 && row < this->rowCount(QModelIndex())) { + BEGIN_UNDO_SET("Change Series Label"); vtkSMPropertyHelper(this->Implementation->RepresentationProxy, "SeriesLabel").SetStatus( this->getSeriesName(row), label.toAscii().data()); this->Implementation->RepresentationProxy->UpdateVTKObjects(); emit this->redrawChart(); + END_UNDO_SET(); } } @@ -319,6 +324,7 @@ void pqPlotSettingsModel::setSeriesColor(int row, const QColor &color) { if (row >= 0 && row < this->rowCount(QModelIndex())) { + BEGIN_UNDO_SET("Change Series Color"); double double_color[3]; qreal qreal_color[3]; color.getRgbF(qreal_color, qreal_color+1, qreal_color+2); @@ -332,6 +338,7 @@ void pqPlotSettingsModel::setSeriesColor(int row, const QColor &color) QModelIndex idx = this->createIndex(row, 1); emit this->dataChanged(idx, idx); emit this->redrawChart(); + END_UNDO_SET(); } } @@ -349,11 +356,13 @@ void pqPlotSettingsModel::setSeriesThickness(int row, int value) { if (row >= 0 && row < this->rowCount(QModelIndex())) { + BEGIN_UNDO_SET("Change Series Line Thickness"); vtkSMPropertyHelper(this->Implementation->RepresentationProxy, "SeriesLineThickness").SetStatus( this->getSeriesName(row), value); this->Implementation->RepresentationProxy->UpdateVTKObjects(); emit this->redrawChart(); + END_UNDO_SET(); } } @@ -369,11 +378,13 @@ void pqPlotSettingsModel::setSeriesStyle(int row, int value) { if (row >= 0 && row < this->rowCount(QModelIndex())) { + BEGIN_UNDO_SET("Change Series Line Style"); vtkSMPropertyHelper(this->Implementation->RepresentationProxy, "SeriesLineStyle").SetStatus( this->getSeriesName(row), value); this->Implementation->RepresentationProxy->UpdateVTKObjects(); emit this->redrawChart(); + END_UNDO_SET(); } } @@ -389,11 +400,13 @@ void pqPlotSettingsModel::setSeriesAxisCorner(int row, int value) { if (row >= 0 && row < this->rowCount(QModelIndex())) { + BEGIN_UNDO_SET("Change Series Axes Placement"); vtkSMPropertyHelper(this->Implementation->RepresentationProxy, "SeriesPlotCorner").SetStatus( this->getSeriesName(row), value); this->Implementation->RepresentationProxy->UpdateVTKObjects(); emit this->redrawChart(); + END_UNDO_SET(); } } @@ -409,11 +422,13 @@ void pqPlotSettingsModel::setSeriesMarkerStyle(int row, int value) { if (row >= 0 && row < this->rowCount(QModelIndex())) { + BEGIN_UNDO_SET("Change Series Marker Style"); vtkSMPropertyHelper(this->Implementation->RepresentationProxy, "SeriesMarkerStyle").SetStatus( this->getSeriesName(row), value); this->Implementation->RepresentationProxy->UpdateVTKObjects(); emit this->redrawChart(); + END_UNDO_SET(); } }