diff options
author | Tomi Korpipää <tomi.korpipaa@digia.com> | 2014-04-15 10:32:03 +0300 |
---|---|---|
committer | Tomi Korpipää <tomi.korpipaa@digia.com> | 2014-04-15 10:40:38 +0300 |
commit | a30c0c304e55ffe30545ab0838e4dbe11a99b8da (patch) | |
tree | ce6ccc0e4de8e350aebec466ff0a70c0fd7710bc /src/datavisualization/engine/qabstract3dgraph.cpp | |
parent | 79646ac9664745701667104c19bbae8cba8fd2e3 (diff) |
Add custom item support, part 1
Task-number: QTRD-2866
+ Added API for adding and removing custom items
+ Added custom data and custom render items
+ Added shaders for textured objects
+ Added custom item rendering draft to scatter
+ Fixed some shaders
- to be continued in part 2
Change-Id: I9735fd02fc9e86ae486cca4c06f6d7f2a4b0b7da
Reviewed-by: Mika Salmela <mika.salmela@digia.com>
Diffstat (limited to 'src/datavisualization/engine/qabstract3dgraph.cpp')
-rw-r--r-- | src/datavisualization/engine/qabstract3dgraph.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/datavisualization/engine/qabstract3dgraph.cpp b/src/datavisualization/engine/qabstract3dgraph.cpp index 703cd18b..0d1bdfc9 100644 --- a/src/datavisualization/engine/qabstract3dgraph.cpp +++ b/src/datavisualization/engine/qabstract3dgraph.cpp @@ -135,6 +135,8 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION Z axis label. \value ElementAxisYLabel Y axis label. + \value ElementCustomItem + Custom item. */ /*! @@ -380,6 +382,36 @@ void QAbstract3DGraph::clearSelection() } /*! + * Adds a custom mesh item located in \a meshFile to a graph at \a position with \a {scaling}, + * \a rotation and optional \a textureImage. Item must be in Wavefront obj format and include + * vertices, normals and UVs. It also needs to be in triangles. Item position is given in data + * coordinates. + * + * \return index to the added item. + * + * \sa removeCustomItemAt() + * + * \since Qt Data Visualization 1.1 + */ +int QAbstract3DGraph::addCustomItem(const QString &meshFile, const QVector3D &position, + const QVector3D &scaling, const QQuaternion &rotation, + const QImage &textureImage) +{ + return d_ptr->m_visualController->addCustomItem(meshFile, position, scaling, rotation, + textureImage); +} + +/*! + * Removes the custom item at \a {index}. Deletes the resource allocated to it. + * + * \since Qt Data Visualization 1.1 + */ +void QAbstract3DGraph::removeCustomItemAt(int index) +{ + d_ptr->m_visualController->deleteCustomItem(index); +} + +/*! * Renders current frame to an image of \a imageSize. Default size is the window size. Image is * rendered with antialiasing level given in \a msaaSamples. Default level is \c{0}. * |