diff --git a/libs/graphic3d/scatter3d.cpp b/libs/graphic3d/scatter3d.cpp index 0aac0d6..445c25d 100644 --- a/libs/graphic3d/scatter3d.cpp +++ b/libs/graphic3d/scatter3d.cpp @@ -84,14 +84,20 @@ void Scatter3D::setGraphicMesh(Mesh mesh, int index) { } -void Scatter3D::addGraphic(const QColor & color, float pointSize, Mesh mesh) { +void Scatter3D::setGraphicMeshSmooth(bool smooth, int index) { + graphics[index].series->setMeshSmooth(smooth); + container->update(); +} + + +void Scatter3D::addGraphic(const QColor & color, float pointSize, Mesh mesh, bool meshSmooth) { Scatter3DGraphic sg; sg.data = new QtDataVisualization::QScatterDataProxy(); sg.series = new QtDataVisualization::QScatter3DSeries(sg.data); sg.series->setItemSize(pointSize); sg.series->setBaseColor(color); sg.series->setMesh(mesh); - sg.series->setMeshSmooth(true); + sg.series->setMeshSmooth(meshSmooth); graphics.append(sg); canvas->addSeries(sg.series); container->update(); diff --git a/libs/graphic3d/scatter3d.h b/libs/graphic3d/scatter3d.h index ae5379a..e8ee6ec 100644 --- a/libs/graphic3d/scatter3d.h +++ b/libs/graphic3d/scatter3d.h @@ -44,6 +44,7 @@ class QAD_GRAPHIC3D_EXPORT Scatter3D: public QWidget { Q_PROPERTY(float graphicPointSize READ graphicPointSize WRITE setGraphicPointSize) Q_PROPERTY(Mesh graphicMesh READ graphicMesh WRITE setGraphicMesh) Q_PROPERTY(bool labelAutoRotation READ labelAutoRotation WRITE setLabelAutoRotation) + Q_PROPERTY(bool graphicMeshSmooth READ graphicMeshSmooth WRITE setGraphicMeshSmooth) public: explicit Scatter3D(QWidget * parent = nullptr); @@ -68,7 +69,9 @@ public slots: void setGraphicPointSize(float sz) { setGraphicPointSize(sz, curGraphic); } void setGraphicMesh(Mesh mesh, int index); void setGraphicMesh(Mesh mesh) { setGraphicMesh(mesh, curGraphic); } - void addGraphic(const QColor & color = Qt::darkBlue, float pointSize = 1.f, Mesh mesh = Mesh::MeshSphere); + 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 clear() { setGraphicsCount(0); } void setLabelAutoRotation(bool on); void setGraphicData(const QVector & points, int index);