summaryrefslogtreecommitdiffstats
path: root/src/datavisualization/engine/qabstract3dgraph.cpp
diff options
context:
space:
mode:
authorTomi Korpipää <tomi.korpipaa@digia.com>2014-05-12 10:06:27 +0300
committerTomi Korpipää <tomi.korpipaa@digia.com>2014-05-12 10:07:15 +0300
commit6880277f23b47117f7788f08f855ed99b5120f9f (patch)
treede8b9e64ffce03a3ce77c8ffac396f7174e91956 /src/datavisualization/engine/qabstract3dgraph.cpp
parent590d11726e0708e9f8fad0ec386cc5859dbe5cc8 (diff)
CustomDataItem made into a public class
Task-number: QTRD-3055 Change-Id: I1e449df7c1bcb48fc639dbae579e2e1499c9ef2b Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'src/datavisualization/engine/qabstract3dgraph.cpp')
-rw-r--r--src/datavisualization/engine/qabstract3dgraph.cpp42
1 files changed, 19 insertions, 23 deletions
diff --git a/src/datavisualization/engine/qabstract3dgraph.cpp b/src/datavisualization/engine/qabstract3dgraph.cpp
index e143e756..85ee79c9 100644
--- a/src/datavisualization/engine/qabstract3dgraph.cpp
+++ b/src/datavisualization/engine/qabstract3dgraph.cpp
@@ -382,46 +382,42 @@ 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.
+ * Adds a QCustom3DItem \a item to the graph. Graph takes ownership of the added item.
*
- * \return index to the added item.
+ * \return index to the added item if add was successful, -1 if trying to add a null item, and
+ * index of the item if trying to add an already added item.
*
- * \note No validity checks are made for the position of the item, so it is up to the user to
- * provide a valid position. Items positioned outside axis ranges are still rendered.
- *
- * \sa removeCustomItemAt()
+ * \sa removeCustomItems(), removeCustomItem(), 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)
+int QAbstract3DGraph::addCustomItem(QCustom3DItem *item)
{
- return d_ptr->m_visualController->addCustomItem(meshFile, position, scaling, rotation,
- textureImage);
+ return d_ptr->m_visualController->addCustomItem(item);
}
/*!
- * Removes the custom item at \a {index}. Deletes the resources allocated to it.
- *
- * \note The index of the remaining items will change if the item removed is other than
- * the last.
+ * Removes all custom items. Deletes the resources allocated to them.
*
* \since Qt Data Visualization 1.1
*/
-void QAbstract3DGraph::removeCustomItemAt(int index)
+void QAbstract3DGraph::removeCustomItems()
{
- d_ptr->m_visualController->deleteCustomItem(index);
+ d_ptr->m_visualController->deleteCustomItems();
}
/*!
- * Removes the custom item at \a {position}. Deletes the resources allocated to it.
+ * Removes the custom \a {item}. Deletes the resources allocated to it.
*
- * \note The index of the remaining items will change if an item is removed from a position that
- * is not at the last index.
+ * \since Qt Data Visualization 1.1
+ */
+void QAbstract3DGraph::removeCustomItem(QCustom3DItem *item)
+{
+ d_ptr->m_visualController->deleteCustomItem(item);
+}
+
+/*!
+ * Removes all custom items at \a {position}. Deletes the resources allocated to them.
*
* \since Qt Data Visualization 1.1
*/