Qt 5.7 | Qt Data Visualization | C++ Classes | QSurfaceDataProxy

Qt 5.7.1 Reference Documentation

# QSurfaceDataProxy Class

Base proxy class for Q3DSurface. More...

Header: | #include <QSurfaceDataProxy>
Since: | QtDataVisualization 1.0
Instantiated By: | SurfaceDataProxy
Inherits: | QAbstractDataProxy
Inherited By: | QHeightMapSurfaceDataProxy and QItemModelSurfaceDataProxy

- List of all members, including inherited members

## Properties

- columnCount : const int
- rowCount : const int
- series : QSurface3DSeries * const

- 1 property inherited from QAbstractDataProxy

## Public Functions

| QSurfaceDataProxy(QObject *parent = Q_NULLPTR)
virtual | ~QSurfaceDataProxy()
int | addRow(QSurfaceDataRow *row)
int | addRows(const QSurfaceDataArray &rows)
const QSurfaceDataArray * | array() const
int | columnCount() const
void | insertRow(int rowIndex, QSurfaceDataRow *row)
void | insertRows(int rowIndex, const QSurfaceDataArray &rows)
const QSurfaceDataItem * | itemAt(int rowIndex, int columnIndex) const
const QSurfaceDataItem * | itemAt(const QPoint &position) const
void | removeRows(int rowIndex, int removeCount)
void | resetArray(QSurfaceDataArray *newArray)
int | rowCount() const
QSurface3DSeries * | series() const
void | setItem(int rowIndex, int columnIndex, const QSurfaceDataItem &item)
void | setItem(const QPoint &position, const QSurfaceDataItem &item)
void | setRow(int rowIndex, QSurfaceDataRow *row)
void | setRows(int rowIndex, const QSurfaceDataArray &rows)

- 1 public function inherited from QAbstractDataProxy

## Signals

void | arrayReset()
void | columnCountChanged(int count)
void | itemChanged(int rowIndex, int columnIndex)
void | rowCountChanged(int count)
void | rowsAdded(int startIndex, int count)
void | rowsChanged(int startIndex, int count)
void | rowsInserted(int startIndex, int count)
void | rowsRemoved(int startIndex, int count)
void | seriesChanged(QSurface3DSeries *series)

## Related Non-Members

typedef | QSurfaceDataArray
typedef | QSurfaceDataRow

## Detailed Description

Base proxy class for Q3DSurface.

QSurfaceDataProxy takes care of surface related data handling. The QSurfaceDataProxy handles the data in rows and for this it provides two auxiliary typedefs. QSurfaceDataArray is a QList for controlling the rows. For rows there is a QVector QSurfaceDataRow which contains QSurfaceDataItem objects. See Q3DSurface documentation and basic sample code there how to feed the data for the QSurfaceDataProxy.

All rows must have the same number of items.

QSurfaceDataProxy takes ownership of all QSurfaceDataRows passed to it, whether directly or in a QSurfaceDataArray container. If you use QSurfaceDataRow pointers to directly modify data after adding the array to the proxy, you must also emit proper signal to make the graph update.

To make a sensible surface, the X-value of each successive item in all rows must be either ascending or descending throughout the row. Similarly, the Z-value of each successive item in all columns must be either ascending or descending throughout the column.

Note: Currently only surfaces with straight rows and columns are fully supported. Any row with items that do not have the exact same Z-value or any column with items that do not have the exact same X-value may get clipped incorrectly if the whole surface doesn't completely fit in the visible X or Z axis ranges.

Note: Surfaces with less than two rows or columns are not considered valid surfaces and will not be rendered.

Note: On some environments, surfaces with a lot of visible vertices may not render, because they exceed the per-draw vertex count supported by the graphics driver. This is mostly an issue on 32bit and/or OpenGL ES2 platforms.

See also Qt Data Visualization Data Handling.

## Property Documentation

### columnCount : const int

Returns number of items in the columns.

Access functions:

int | columnCount() const

Notifier signal:

void | columnCountChanged(int count)

### rowCount : const int

Returns number of rows in the data.

Access functions:

int | rowCount() const

Notifier signal:

void | rowCountChanged(int count)

### series : QSurface3DSeries * const

The series this proxy is attached to.

Access functions:

QSurface3DSeries * | series() const

Notifier signal:

void | seriesChanged(QSurface3DSeries *series)

## Member Function Documentation

### QSurfaceDataProxy::QSurfaceDataProxy(QObject *parent = Q_NULLPTR)

Constructs QSurfaceDataProxy with the given parent.

### `[virtual]` QSurfaceDataProxy::~QSurfaceDataProxy()

Destroys QSurfaceDataProxy.

### int QSurfaceDataProxy::addRow(QSurfaceDataRow *row)

Adds a new row to the end of array. The new row must have the same number of columns as the rows at the initial array.

Returns index of the added row.

### int QSurfaceDataProxy::addRows(const QSurfaceDataArray &rows)

Adds new rows to the end of array. The new rows must have the same number of columns as the rows at the initial array.

Returns index of the first added row.

### const QSurfaceDataArray *QSurfaceDataProxy::array() const

Returns pointer to the data array.

### `[signal]` void QSurfaceDataProxy::arrayReset()

Emitted when the data array is reset. If you change the whole array contents without calling resetArray(), you need to emit this signal yourself or the graph won't get updated.

### void QSurfaceDataProxy::insertRow(int rowIndex, QSurfaceDataRow *row)

Inserts a new row into rowIndex. If rowIndex is equal to array size, rows are added to end of the array. The new row must have the same number of columns as the rows at the initial array.

### void QSurfaceDataProxy::insertRows(int rowIndex, const QSurfaceDataArray &rows)

Inserts new rows into rowIndex. If rowIndex is equal to array size, rows are added to end of the array. The new rows must have the same number of columns as the rows at the initial array.

### const QSurfaceDataItem *QSurfaceDataProxy::itemAt(int rowIndex, int columnIndex) const

Returns pointer to the item at rowIndex, columnIndex. It is guaranteed to be valid only until the next call that modifies data.

### const QSurfaceDataItem *QSurfaceDataProxy::itemAt(const QPoint &position) const

Returns pointer to the item at position. The X-value of position indicates the row and the Y-value indicates the column. The item is guaranteed to be valid only until the next call that modifies data.

### `[signal]` void QSurfaceDataProxy::itemChanged(int rowIndex, int columnIndex)

Emitted when an item has changed. Provides rowIndex and columnIndex of changed item. If you change an item directly in the array without calling setItem(), you need to emit this signal yourself or the graph won't get updated.

### void QSurfaceDataProxy::removeRows(int rowIndex, int removeCount)

Removes removeCount rows staring at rowIndex. Attempting to remove rows past the end of the array does nothing.

### void QSurfaceDataProxy::resetArray(QSurfaceDataArray *newArray)

Takes ownership of the newArray. Clears the existing array if the newArray is different from the existing array. If it's the same array, this just triggers arrayReset() signal. Passing a null array deletes the old array and creates a new empty array. All rows in newArray must be of same length.

### `[signal]` void QSurfaceDataProxy::rowsAdded(int startIndex, int count)

Emitted when rows have been added. Provides startIndex and count of rows added. If you add rows directly to the array without calling addRow() or addRows(), you need to emit this signal yourself or the graph won't get updated.

### `[signal]` void QSurfaceDataProxy::rowsChanged(int startIndex, int count)

Emitted when rows have changed. Provides startIndex and count of changed rows. If you change rows directly in the array without calling setRow() or setRows(), you need to emit this signal yourself or the graph won't get updated.

### `[signal]` void QSurfaceDataProxy::rowsInserted(int startIndex, int count)

Emitted when rows have been inserted. Provides startIndex and count of inserted rows. If you insert rows directly into the array without calling insertRow() or insertRows(), you need to emit this signal yourself or the graph won't get updated.

### `[signal]` void QSurfaceDataProxy::rowsRemoved(int startIndex, int count)

Emitted when rows have been removed. Provides startIndex and count of rows removed. Index is the current array size if rows were removed from the end of the array. If you remove rows directly from the array without calling removeRows(), you need to emit this signal yourself or the graph won't get updated.

### void QSurfaceDataProxy::setItem(int rowIndex, int columnIndex, const QSurfaceDataItem &item)

Changes a single item at rowIndex, columnIndex to the item.

### void QSurfaceDataProxy::setItem(const QPoint &position, const QSurfaceDataItem &item)

Changes a single item at position to the item. The X-value of position indicates the row and the Y-value indicates the column.

### void QSurfaceDataProxy::setRow(int rowIndex, QSurfaceDataRow *row)

Changes existing row by replacing a row at rowIndex with a new row. The row can be the same as the existing row already stored at the rowIndex. The new row must have the same number of columns as the row it is replacing.

### void QSurfaceDataProxy::setRows(int rowIndex, const QSurfaceDataArray &rows)

Changes existing rows by replacing a rows starting at rowIndex with rows. The rows in the rows array can be the same as the existing rows already stored at the rowIndex. The new rows must have the same number of columns as the rows they are replacing.

## Related Non-Members

### typedef QtDataVisualization::QSurfaceDataArray

A list of pointers to QSurfaceDataRows.

### typedef QtDataVisualization::QSurfaceDataRow

A vector of QSurfaceDataItems.