QSurface3DSeries Class

Base series class for Q3DSurface. More...

Header: #include <QSurface3DSeries>
Since: QtDataVisualization 1.0
Instantiated By: Surface3DSeries
Inherits: QAbstract3DSeries

Public Types

enum DrawFlag { DrawWireframe, DrawSurface, DrawSurfaceAndWireframe }
flags DrawFlags

Properties

Public Functions

QSurface3DSeries(QObject *parent = Q_NULLPTR)
QSurface3DSeries(QSurfaceDataProxy *dataProxy, QObject *parent = Q_NULLPTR)
virtual ~QSurface3DSeries()
QSurfaceDataProxy *dataProxy() const
QSurface3DSeries::DrawFlags drawMode() const
bool isFlatShadingEnabled() const
bool isFlatShadingSupported() const
QPoint selectedPoint() const
void setDataProxy(QSurfaceDataProxy *proxy)
void setDrawMode(DrawFlags mode)
void setFlatShadingEnabled(bool enabled)
void setSelectedPoint(const QPoint &position)
void setTexture(const QImage &texture)
void setTextureFile(const QString &filename)
QImage texture() const
QString textureFile() const

Signals

void dataProxyChanged(QSurfaceDataProxy *proxy)
void drawModeChanged(QSurface3DSeries::DrawFlags mode)
void flatShadingEnabledChanged(bool enable)
void flatShadingSupportedChanged(bool enable)
void selectedPointChanged(const QPoint &position)
void textureChanged(const QImage &image)
void textureFileChanged(const QString &filename)

Static Public Members

  • 10 static public members inherited from QObject

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 9 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

Base series class for Q3DSurface.

QSurface3DSeries manages the series specific visual elements, as well as series data (via data proxy).

If no data proxy is set explicitly for the series, the series creates a default proxy. Setting another proxy will destroy the existing proxy and all data added to it.

The object mesh set via QAbstract3DSeries::mesh property defines the selection pointer shape in surface series.

QSurface3DSeries supports the following format tags for QAbstract3DSeries::setItemLabelFormat():

@xTitleTitle from X axis
@yTitleTitle from Y axis
@zTitleTitle from Z axis
@xLabelItem value formatted using the same format as the X axis attached to the graph uses, see QValue3DAxis::setLabelFormat() for more information.
@yLabelItem value formatted using the same format as the Y axis attached to the graph uses, see QValue3DAxis::setLabelFormat() for more information.
@zLabelItem value formatted using the same format as the Z axis attached to the graph uses, see QValue3DAxis::setLabelFormat() for more information.
@seriesNameName of the series

For example:


  proxy->setItemLabelFormat(QStringLiteral("@valueTitle for (@rowLabel, @colLabel): %.1f"));

See also Qt Data Visualization Data Handling.

Member Type Documentation

enum QSurface3DSeries::DrawFlag
flags QSurface3DSeries::DrawFlags

Drawing mode of the surface. Values of this enumeration can be combined with OR operator.

ConstantValueDescription
QSurface3DSeries::DrawWireframe1Only the grid is drawn.
QSurface3DSeries::DrawSurface2Only the surface is drawn.
QSurface3DSeries::DrawSurfaceAndWireframeDrawWireframe | DrawSurfaceBoth the surface and grid are drawn.

The DrawFlags type is a typedef for QFlags<DrawFlag>. It stores an OR combination of DrawFlag values.

Property Documentation

dataProxy : QSurfaceDataProxy *

This property holds the active data proxy. The series assumes ownership of any proxy set to it and deletes any previously set proxy when a new one is added. The proxy cannot be null or set to another series.

Access functions:

QSurfaceDataProxy *dataProxy() const
void setDataProxy(QSurfaceDataProxy *proxy)

Notifier signal:

void dataProxyChanged(QSurfaceDataProxy *proxy)

drawMode : DrawFlags

Sets the drawing mode to one of DrawFlag. Clearing all flags is not allowed.

Access functions:

QSurface3DSeries::DrawFlags drawMode() const
void setDrawMode(DrawFlags mode)

Notifier signal:

void drawModeChanged(QSurface3DSeries::DrawFlags mode)

flatShadingEnabled : bool

Sets surface flat shading to enabled. It is preset to true by default. When disabled, the normals on the surface are interpolated making edges looking round. When enabled, the normals are kept same on a triangle making the color of the triangle solid. This makes the data more readable from the model.

Note: Flat shaded surfaces require at least GLSL version 1.2 with GL_EXT_gpu_shader4 extension. The value of flatShadingSupported property indicates if flat shading is supported at runtime.

Access functions:

bool isFlatShadingEnabled() const
void setFlatShadingEnabled(bool enabled)

Notifier signal:

void flatShadingEnabledChanged(bool enable)

flatShadingSupported : const bool

Flat shading for surfaces requires at least GLSL version 1.2 with GL_EXT_gpu_shader4 extension. If true, flat shading for surfaces is supported by current system.

Note: This read-only property is set to its correct value after first render pass. Before then it is always true.

Access functions:

bool isFlatShadingSupported() const

Notifier signal:

void flatShadingSupportedChanged(bool enable)

selectedPoint : QPoint

Selects a surface grid point in a position. The position is the (row, column) position in the data array of the series. Only one point can be selected at a time. To clear selection from this series, set invalidSelectionPosition() as the position. If this series is added to a graph, the graph can adjust the selection according to user interaction or if it becomes invalid. Removing rows from or inserting rows to the series before the row of the selected point will adjust the selection so that the same point will stay selected.

Access functions:

QPoint selectedPoint() const
void setSelectedPoint(const QPoint &position)

Notifier signal:

void selectedPointChanged(const QPoint &position)

See also QAbstract3DGraph::clearSelection().

texture : QImage

Set the texture as a QImage for the surface. To clear the texture, set empty QImage as texture.

Access functions:

QImage texture() const
void setTexture(const QImage &texture)

Notifier signal:

void textureChanged(const QImage &image)

textureFile : QString

Holds the texture file name for the surface texture. To clear the texture, set empty file name.

Access functions:

QString textureFile() const
void setTextureFile(const QString &filename)

Notifier signal:

void textureFileChanged(const QString &filename)

Member Function Documentation

QSurface3DSeries::QSurface3DSeries(QObject *parent = Q_NULLPTR)

Constructs QSurface3DSeries with the given parent.

QSurface3DSeries::QSurface3DSeries(QSurfaceDataProxy *dataProxy, QObject *parent = Q_NULLPTR)

Constructs QSurface3DSeries with the given dataProxy and the parent.

[virtual] QSurface3DSeries::~QSurface3DSeries()

Destroys QSurface3DSeries.

[static] QPoint QSurface3DSeries::invalidSelectionPosition()

Returns a QPoint signifying an invalid selection position. Set this to selectedPoint property to clear the selection from this series.

See also QAbstract3DGraph::clearSelection().