Skip to content

Commit

Permalink
Fix graphs in QGLSceneNode docs
Browse files Browse the repository at this point in the history
Change-Id: If114b65eec93f7b7120330d2714f2622abfd266d
Reviewed-by: Danny Pope <[email protected]>
  • Loading branch information
Julian de Bhal authored and Qt by Nokia committed Apr 5, 2012
1 parent 23f0cb5 commit c63de4a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/threed/scene/qglscenenode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1480,11 +1480,13 @@ void QGLSceneNode::setPickNode(QGLPickNode *node)
For example, given the following scene graph:
\code
Item2
/
Item1
\
Item3 - Item4
\endcode
We could get the QGLSceneNode for "Item4" using the following function
call:
Expand All @@ -1497,11 +1499,13 @@ void QGLSceneNode::setPickNode(QGLPickNode *node)
The function will automatically skip unnamed nodes. For example, consider
this scene graph:
\code
Item2
/
<unnamed> - Item1
\
Item3 - <unnamed> - Item4
\endcode
The function \a nodePath will return the QGLSceneNode for node "Item4".
Expand All @@ -1523,11 +1527,13 @@ void QGLSceneNode::setPickNode(QGLPickNode *node)
scenegraph is invalid because of the repeat of Sphere1 in the same layer
of the graph:
\code
Sphere1
/
Cube1
\
Sphere1
\endcode
The function also assumes that the names of nodes do not contain
double colons. For example, a node with the name: "Sphere::1" would
Expand Down Expand Up @@ -1636,11 +1642,13 @@ QGLSceneNode *QGLSceneNode::get(const QString &name, QObject *parent, bool force
The resulting set of branches will then be added to a newly created root node,
creating a composite branch. For example, consider the simple scenegraph below:
\code
Node 1 - Node 2 - Node 3
/
Root
\
Node 4 - Node 5 - Node 6
\endcode
If we now call the get() function with the following code.
Expand All @@ -1655,11 +1663,13 @@ QGLSceneNode *QGLSceneNode::get(const QString &name, QObject *parent, bool force
In this case the function will create a new root node for the output, and
graft the two branches onto it, as follows:
\code
Node 2 - Node 3
/
New-Root
\
Node 5 - Node 6
\endcode
\sa findSceneNode(), clone(), cloneWithChildren(), get(), except()
*/
Expand Down Expand Up @@ -1689,11 +1699,13 @@ QGLSceneNode *QGLSceneNode::get(const QStringList &names, QObject *parent, bool
For example, consider the following scenegraph:
\code
Node 1 - Node 2
/
Root
\
Node 3 - Node 4
\endcode
By using the following code:
Expand All @@ -1704,9 +1716,11 @@ QGLSceneNode *QGLSceneNode::get(const QStringList &names, QObject *parent, bool
We can create a copy of the scenegraph with the branch pruned, as shown below:
\code
Root
\
Node 3 - Node 4
\endcode
\sa findSceneNode(), clone(), cloneWithChildren(), get()
*/
Expand All @@ -1726,11 +1740,13 @@ QGLSceneNode *QGLSceneNode::except(const QString &name, QObject *parent)
Thus for the scenegraph:
\code
Node 1 - Node 2 - Node 3
/
Root
\
Node 4 - Node 5 - Node 6
\endcode
The code:
Expand All @@ -1744,11 +1760,13 @@ QGLSceneNode *QGLSceneNode::except(const QString &name, QObject *parent)
Would yield the scenegraph:
\code
Node 1
/
Root
\
Node 4
\endcode
Once again, this copy will be reparented with the parameter \a parent if it
exists.
Expand Down

0 comments on commit c63de4a

Please sign in to comment.