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); }