From 9fee5a7d0728a2441d10a2d6c55cfb4ead09fe19 Mon Sep 17 00:00:00 2001 From: peri4 Date: Tue, 24 Oct 2023 12:29:55 +0300 Subject: [PATCH] fix Scatter3D::clear --- libs/graphic3d/scatter3d.cpp | 6 ++++++ libs/graphic3d/scatter3d.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/graphic3d/scatter3d.cpp b/libs/graphic3d/scatter3d.cpp index 3364288..d135017 100644 --- a/libs/graphic3d/scatter3d.cpp +++ b/libs/graphic3d/scatter3d.cpp @@ -117,6 +117,12 @@ void Scatter3D::removeGraphic(int index) { } +void Scatter3D::clear() { + for (auto g: graphics) + g.data->resetArray(nullptr); +} + + void Scatter3D::setLabelAutoRotation(bool on) { if (on) { canvas->axisX()->setLabelAutoRotation(90); diff --git a/libs/graphic3d/scatter3d.h b/libs/graphic3d/scatter3d.h index 073fb65..b8cb60a 100644 --- a/libs/graphic3d/scatter3d.h +++ b/libs/graphic3d/scatter3d.h @@ -75,7 +75,7 @@ public slots: void setGraphicMeshSmooth(bool smooth) { setGraphicMeshSmooth(smooth, curGraphic); } void addGraphic(const QColor & color = Qt::darkBlue, float pointSize = 1.f, Mesh mesh = Mesh::MeshSphere, bool meshSmooth = true); void removeGraphic(int index); - void clear() { setGraphicsCount(0); } + void clear(); void setLabelAutoRotation(bool on); void setGraphicData(const QVector & points, int index); void setGraphicData(const QVector & points) { setGraphicData(points, curGraphic); }