Skip to content

Commit

Permalink
Integrate Qt3D into Qt5 and fix some qdoc errors.
Browse files Browse the repository at this point in the history
This doc change by 'integrating into Qt5' also made some changes to the
build system, so that now you need QT+=3d everywhere (instead of
QT+=qt3d as it was previously).

We have been asked to make this change, and it seems it is required for
this doc system to work, so lets get it done.

Note that the original change had a docsnippets target but that did not
work at all and will have be done in a later commit.

Change-Id: Icf4bc6b4be9494f1752e18ca1f5198c8fe8ecf53
Reviewed-by: Peter Yard <[email protected]>
Reviewed-by: Julian de Bhal <[email protected]>
  • Loading branch information
Peter Yard authored and Qt by Nokia committed Feb 13, 2012
1 parent 1703179 commit 00d127f
Show file tree
Hide file tree
Showing 99 changed files with 246 additions and 207 deletions.
2 changes: 1 addition & 1 deletion demos/qt3d/cubehouse/cubehouse.pro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TEMPLATE = app
TARGET = cubehouse
CONFIG += qt warn_on
QT += qt3d
QT += 3d

include (../../../pkg.pri)

Expand Down
2 changes: 1 addition & 1 deletion demos/qt3d/pageflip/pageflip.pro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TEMPLATE = app
TARGET = pageflip
CONFIG += qt warn_on
QT += qt3d
QT += 3d

include(../../../pkg.pri)

Expand Down
2 changes: 1 addition & 1 deletion demos/qt3d/photobrowser3d/photobrowser3d.pro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TEMPLATE = app
TARGET = photobrowser3d
CONFIG += qt warn_on
QT += qt3d
QT += 3d

include (../../../pkg.pri)

Expand Down
2 changes: 1 addition & 1 deletion demos/qt3d/shapes/shapes.pro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TEMPLATE = app
TARGET = shapes
CONFIG += qt warn_on
QT += qt3d
QT += 3d

include (../../../pkg.pri)

Expand Down
2 changes: 1 addition & 1 deletion demos/qt3d/teaservice/teaservice.pro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TEMPLATE = app
TARGET = teaservice
CONFIG += qt warn_on
QT += qt3d
QT += 3d

include (../../../pkg.pri)

Expand Down
2 changes: 1 addition & 1 deletion doc/src/camera-frustum.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@

This screen capture from a 3D modelling program shows how this camera is
set up in a scene, where its viewing a cube. The image shows a purple area
which indicates the \i{view frustum}, which you can think of for
which indicates the \e{view frustum}, which you can think of for
now as the area captured by the camera. Actually its more correct to think
of the volume captured by the camera, and imagine that the purple indication
in the image is the shadow cast by this volume.
Expand Down
15 changes: 8 additions & 7 deletions doc/src/examples/basket.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,39 +29,40 @@
\example quick3d/basket
\title Basket Example

\target Basket in QML
\section2 Basket in QML

The QML version of the basket example is very similar in
structure to the C++ version above, but much simpler.
We start by defining a viewport with a specific camera position:

\snippet quick3d/basket/qml/basket.qml 1
\snippet ../../examples/quick3d/basket/qml/basket.qml 1

We then add an \l Item3D object to load the basket model and
apply the desired texture to it:

\snippet quick3d/basket/qml/basket.qml 2
\snippet ../../examples/quick3d/basket/qml/basket.qml 2

And then we apply an animation to the rotation component of
the item's transform property:

\snippet quick3d/basket/qml/basket.qml 3
\snippet ../../examples/quick3d/basket/qml/basket.qml 3

\section2 Basket in Qt3D
\section2 Basket in Qt3D

The Basket example shows how Qt3D can be used to draw an animated
object covered in a texture. The basic application shell is similar
to the \l{qt3d/teapot}{Hello Teapot} example. In this case, we create
the basket object and add a texture to it as follows:

\snippet qt3d/basket/basketview.cpp 1
\snippet ../../examples/qt3d/basket/basketview.cpp 1

For this animation, we want to spin the basket around its Y axis,
once every 2 seconds. We first declare an \c angle property in the
class declaration (calling \c{update()} will force the view to
redraw whenever the angle changes):

\snippet qt3d/basket/basketview.h 1
\snippet ../../examples/qt3d/basket/basketview.h 1

Then we create a QPropertyAnimation object that will update
\c angle every time through the event loop with a new value
Expand All @@ -72,7 +73,7 @@
Now all we have to do is draw the basket using the \c angle
property every time \c{paintGL()} is called:

\snippet qt3d/basket/basketview.cpp 3
\snippet ../../examples/qt3d/basket/basketview.cpp 3

\image basket-screenshot.png

Expand Down
14 changes: 7 additions & 7 deletions doc/src/examples/teapot-qml.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,38 +32,38 @@
This example shows to use QML in Qt3D to display a teapot on
the screen. The QML is fairly simple:

\snippet quick3d/teapot_qml/qml/teapot.qml 1
\snippet ../../tutorials/quick3d/teapot_qml/qml/teapot.qml 1

\image teapot-qml-screenshot.png

The example starts by importing the Qt and Qt3D QML modules:

\snippet quick3d/teapot_qml/qml/teapot.qml 2
\snippet ../../tutorials/quick3d/teapot_qml/qml/teapot.qml 2

Then we create a viewport of size 640x480 to display the teapot:

\snippet quick3d/teapot_qml/qml/teapot.qml 3
\snippet ../../tutorials/quick3d/teapot_qml/qml/teapot.qml 3

And now we create a \l Item3D to display the teapot with a
default lit material effect:

\snippet quick3d/teapot_qml/qml/teapot.qml 4
\snippet ../../tutorials/quick3d/teapot_qml/qml/teapot.qml 4

The teapot data itself is loaded from \c{teapot.bez}, which contains
Bezier patch data that describes the geometry of the teapot.

Let's make the teapot a little more interesting by adding a
material to simulate bone china:

\snippet quick3d/teapot_bounce_qml/qml/teapot-bounce.qml 1
\snippet quick3d/teapot_bounce_qml/qml/teapot-bounce.qml 2
\snippet ../../tutorials/quick3d/teapot_bounce_qml/qml/teapot-bounce.qml 1
\snippet ../../tutorials/quick3d/teapot_bounce_qml/qml/teapot-bounce.qml 2

\image teapot-china-screenshot.png

To make the teapot even more interesting, we can cause it to
bounce up and down using a QML animation item:

\snippet quick3d/teapot_bounce_qml/qml/teapot-bounce.qml 3
\snippet ../../tutorials/quick3d/teapot_bounce_qml/qml/teapot-bounce.qml 3

This QML teapot example can be compared with the \l{qt3d/teapot}{C++ version}.
Using QML is briefer than C++, and easier to modify to adjust
Expand Down
34 changes: 19 additions & 15 deletions doc/src/index.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@

/*!
\page index.html
\title Qt3D Introduction and Overview
\keyword Qt3D Introduction Overview
\title Qt3D
\keyword Qt3D Introduction Overview Documentation
\brief The Qt 3D module provides a set of APIs to make 3D graphics programming easy and declarative.

\ingroup technology-apis

\section1 Overview

\section1 What is Qt 3D?
The Qt 3D module provides a set of APIs to make 3D graphics programming easy and declarative. Seamless integration
Expand Down Expand Up @@ -149,29 +153,29 @@
\list
\o \l {qt3d-building.html}{Building}
\o \l {qt3d-examples.html}{Tutorials and Examples}
\o \l {sceneformats-obj.html}{Scene format plug-ins}
\o \l {qgl.html}{QGL Namespace}
\o \l {Writing a scene format plug-in for Qt3D}{Scene format plug-ins}
\o \l {QGL}{QGL Namespace}
\o \l {qt3d-acceptance.html}{Acceptance tests}
\o \l {qt3d-troubleshooting.html}{Troubleshooting Qt3D}
\endlist

\section1 Qt3D Core Concepts
\list
\o \l {qt3d-arrays.html}{Arrays and Vertex Buffers}
\o \l {qt3d-geometry.html}{Geometry Building}
\o \l {qt3d-graphicsview.html}{Graphics View Integration}
\o \l {qt3d-materials.html}{Materials}
\o \l {qt3d-math.html}{Mathematical Primitives}
\o \l {qt3d-painting.html}{Painting in 3D}
\o \l {qt3d-scene.html}{Scene Management}
\o \l {qt3d-textures.html}{Texture Management}
\o \l {qt3d-viewing.html}{Viewing Widgets}
\o \l {Qt3D Arrays and Vertex Buffers}{Arrays and Vertex Buffers}
\o \l {Qt3D Geometry}{Geometry Building}
\o \l {Qt3D Graphics View Integration}{Graphics View Integration}
\o \l {Qt3D Materials}{Materials}
\o \l {Qt3D Math}{Mathematical Primitives}
\o \l {Qt3D Painting}{Painting in 3D}
\o \l {Qt3D Scene Management}{Scene Management}
\o \l {Qt3D Texture Handling}{Texture Management}
\o \l {Qt3D Viewing}{Viewing Widgets}
\endlist

\section1 API Reference documentation
\list
\o \l {qt3d-all-classes.html}{C++ APIs}
\o \l {qt3d-qml3d.html}{QML APIs}
\o \l {Qt3D Classes}{C++ APIs}
\o \l {Qt3D for Scripting 3D Apps in QML}{QML APIs}
\endlist

\section1 Extending Qt 3D
Expand Down
10 changes: 5 additions & 5 deletions doc/src/qline3d-math.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@

But there are important differences between points and vectors:
\list
\o a point \bold P is a 3D \i location, and makes sense in terms of a 3D cartesian
\o a point \bold P is a 3D \e location, and makes sense in terms of a 3D cartesian
coordinate system. A real-world example is a map-location given in terms
of a map cross-reference. The location has no inherent magnitude, unless you
provide another location and find the distance between the two.
\o a vector \bold v is a 3D \i direction and magnitude. It makes no sense to talk
\o a vector \bold v is a 3D \e direction and magnitude. It makes no sense to talk
about a vector being located somewhere. A vector can represent for example
some directions like "go 3 north-west 3 kilometers", but this can be done from
\bold {anywhere on the map} - it is not anchored like the point is.
Expand Down Expand Up @@ -120,7 +120,7 @@
Vectors used for 3D normals are usually normalized to unit length. Confusingly
enough, since that is two different uses of the word "normal".

A \i normal is simply a vector perpendicular to something. For example a plane normal is
A \e normal is simply a vector perpendicular to something. For example a plane normal is
perpendicular to the plane.

Typically a normal vector is unit length, for convenience in 3D applications (but
Expand All @@ -136,14 +136,14 @@
\list
\o QVector3D::crossProduct(const QVector3D &, const QVector3D &)
\list
\o The cross-product of two vectors produces a \i vector as a result and is
\o The cross-product of two vectors produces a \e vector as a result and is
written \bold w = \bold u x \bold v. The result \bold w is perpendicular to both
\bold u and \bold v. Consider a plane N containing point P, with the tails of \bold u
and \bold v at P, and both lying in N, then \bold u x \bold v is a normal to N.
\endlist
\o QVector3D::dotProduct(const QVector3D &, const QVector3D &)
\list
\o The dot-product of two vectors produces a \i scalar as a result and is written
\o The dot-product of two vectors produces a \e scalar as a result and is written
\c{t = \bold u . \bold v}. The result t = |u| |v| cos(A), where A is the angle
between u and v. When \bold u and \bold v have magnitude 1, they are called
unit vectors, and \bold u . \bold v = cos(A).
Expand Down
2 changes: 1 addition & 1 deletion doc/src/qt3d-all-classes.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

/*!
\page qt3d-all-namespaces.html
\title All Namespaces
\title Qt3D Namespaces
\keyword All Namespaces

\l{QGL}{QGL Namespace}
Expand Down
4 changes: 2 additions & 2 deletions doc/src/qt3d-all-modules.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

/*!
\page qt3d-modules.html
\title All Modules
\keyword All Modules
\title Qt3D Modules
\keyword Qt3D Modules

\raw HTML
<table cellpadding="2" cellspacing="1" border="0" width="100%" class="indextable">
Expand Down
2 changes: 1 addition & 1 deletion doc/src/qt3d-examples.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

\list
\o \l{Teapot Example in QML}{Hello Teapot} in Qt3D
\o \l{qt3d/basket#Basket in QML}{Basket} in Qt3D
\o \l{Basket Example#Basket in QML}{Basket} in Qt3D
\o \l{Object Effects}{Cube} in Qt3D
\o \l{Monkey God in QML}{Monkey God} in Qt3D
\o \l{Tea Service Demo in QML}{Tea Service} in Qt3D
Expand Down
10 changes: 5 additions & 5 deletions doc/src/tutorials/penguin.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
We start by defining a class that inherits from QGLView, which
provides some basic scene setup logic and 3D camera navigation:

\snippet qt3d/penguin/modelview.h class-defn
\snippet ../../examples/qt3d/penguin/modelview.h class-defn

Refer first to the \l{Teapot Example} for the basics of using
the QGLView class, lighting and so on.
Expand All @@ -45,12 +45,12 @@
resource file, and store the result in a member variable, so
we can refer to it in the paint function:

\snippet qt3d/penguin/modelview.cpp initialize
\snippet ../../examples/qt3d/penguin/modelview.cpp initialize

In the teapot example we had to specify appropriate effects but
the model loader sets appropriate effects on the scene for us.

\snippet qt3d/penguin/modelview.cpp paint
\snippet ../../examples/qt3d/penguin/modelview.cpp paint

Here in the paint function we call the \c{draw()} function of
the scene's main object, in order to display the fully
Expand All @@ -72,7 +72,7 @@
Let's make a few changes to have our penguin display nicely
when the application opens.

\snippet qt3d/penguin_advanced/modelview.cpp initialize
\snippet ../../examples/qt3d/penguin_advanced/modelview.cpp initialize

First of all, let move the camera away from the penguin and up
so he fits in the frame and we can get a better angle on him,
Expand All @@ -95,7 +95,7 @@
calculated and stored as a quaternion - we want the x twist first
so that goes last in the product of the two quaternions.

\snippet qt3d/penguin_advanced/modelview.cpp paint
\snippet ../../examples/qt3d/penguin_advanced/modelview.cpp paint

Now all that remains in the updated paint function is to apply the
new pose, and then paint the penguin.
Expand Down
2 changes: 1 addition & 1 deletion doc/src/tutorials/sceneformat.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
We start by declaring an instance of QGLSceneFormatPlugin and
arranging for it to be registered with the Qt plug-in system:

\snippet sceneformats/obj/main.cpp 1
\snippet ../../esceneformats/obj/main.cpp 1
\snippet sceneformats/obj/main.cpp 4

The two functions we need to implement are
Expand Down
Loading

0 comments on commit 00d127f

Please sign in to comment.