add Scatter3D::removeGraphic
This commit is contained in:
@@ -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) {
|
||||
if (on) {
|
||||
canvas->axisX()->setLabelAutoRotation(90);
|
||||
|
||||
@@ -35,7 +35,7 @@ class QScatterDataItem;
|
||||
class QAD_GRAPHIC3D_EXPORT Scatter3D: public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
using Mesh = QtDataVisualization::QAbstract3DSeries::Mesh;
|
||||
using Mesh = QtDataVisualization::QAbstract3DSeries::Mesh;
|
||||
using DataArray = QVector<QtDataVisualization::QScatterDataItem>;
|
||||
|
||||
Q_PROPERTY(int currentGraphic READ currentGraphic WRITE setCurrentGraphic)
|
||||
@@ -74,12 +74,13 @@ public slots:
|
||||
void setGraphicMeshSmooth(bool smooth, int index);
|
||||
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 setLabelAutoRotation(bool on);
|
||||
void setGraphicData(const QVector<QVector3D> & points, int index);
|
||||
void setGraphicData(const QVector<QVector3D> & points) { setGraphicData(points, curGraphic); }
|
||||
void setGraphicData(DataArray *newArray, int index);
|
||||
void setGraphicData(DataArray *newArray) { setGraphicData(newArray, curGraphic); }
|
||||
void setGraphicData(DataArray * newArray, int index);
|
||||
void setGraphicData(DataArray * newArray) { setGraphicData(newArray, curGraphic); }
|
||||
void addPoint(const QVector3D & point, int index);
|
||||
void addPoint(const QVector3D & point) { addPoint(point, curGraphic); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user