add Scatter3D::removeGraphic

This commit is contained in:
2023-10-24 12:15:02 +03:00
parent 876ceec0dc
commit dc5075ad8a
2 changed files with 12 additions and 3 deletions

View File

@@ -109,6 +109,14 @@ void Scatter3D::addGraphic(const QColor & color, float pointSize, Mesh mesh, boo
} }
void Scatter3D::removeGraphic(int index) {
if (index < 0 || index >= graphics.size()) return;
canvas->removeSeries(graphics[index].series);
delete graphics[index].series;
graphics.remove(index);
}
void Scatter3D::setLabelAutoRotation(bool on) { void Scatter3D::setLabelAutoRotation(bool on) {
if (on) { if (on) {
canvas->axisX()->setLabelAutoRotation(90); canvas->axisX()->setLabelAutoRotation(90);

View File

@@ -74,6 +74,7 @@ public slots:
void setGraphicMeshSmooth(bool smooth, int index); void setGraphicMeshSmooth(bool smooth, int index);
void setGraphicMeshSmooth(bool smooth) { setGraphicMeshSmooth(smooth, curGraphic); } 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 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() { setGraphicsCount(0); }
void setLabelAutoRotation(bool on); void setLabelAutoRotation(bool on);
void setGraphicData(const QVector<QVector3D> & points, int index); void setGraphicData(const QVector<QVector3D> & points, int index);