1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
5
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
<title>Qt 4.7: trackball.h Example File (demos/boxes/trackball.h)</title>
7
<link rel="stylesheet" type="text/css" href="style/style.css" />
8
<script src="scripts/jquery.js" type="text/javascript"></script>
9
<script src="scripts/functions.js" type="text/javascript"></script>
11
<body class="offline narrow creator">
12
<div class="header" id="qtdocheader">
15
<a href="index.html">Home</a></div>
16
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
17
<div id="nav-topright">
19
<li class="nav-topright-home"><a href="http://qt.nokia.com/">Qt HOME</a></li>
20
<li class="nav-topright-dev"><a href="http://developer.qt.nokia.com/">DEV</a></li>
21
<li class="nav-topright-labs"><a href="http://labs.qt.nokia.com/blogs/">LABS</a></li>
22
<li class="nav-topright-doc nav-topright-doc-active"><a href="http://doc.qt.nokia.com/">
24
<li class="nav-topright-blog"><a href="http://blog.qt.nokia.com/">BLOG</a></li>
29
<li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.7</a></span></li>
30
<li class="shortCut-topleft-active"><a href="http://doc.qt.nokia.com">ALL VERSIONS </a></li>
33
<ul class="sf-menu sf-js-enabled sf-shadow" id="narrowmenu">
34
<li><a href="#">API Lookup</a>
36
<li><a href="classes.html">Class index</a></li>
37
<li><a href="functions.html">Function index</a></li>
38
<li><a href="modules.html">Modules</a></li>
39
<li><a href="namespaces.html">Namespaces</a></li>
40
<li><a href="qtglobal.html">Global Declarations</a></li>
41
<li><a href="licensing.html">Licenses and Credits</a></li>
44
<li><a href="#">Qt Topics</a>
45
<ul id="topmenuTopic">
46
<li><a href="qt-basic-concepts.html">Programming with Qt</a></li>
47
<li><a href="qtquick.html">Device UI's & Qt Quick</a></li>
48
<li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>
49
<li><a href="developing-with-qt.html">Cross-platform and Platform-specific</a></li>
50
<li><a href="platform-specific.html">Platform-specific info</a></li>
51
<li><a href="technology-apis.html">Qt and Key Technologies</a></li>
52
<li><a href="best-practices.html">How-To's and Best Practices</a></li>
55
<li><a href="#">Examples</a>
56
<ul id="topmenuexample">
57
<li><a href="all-examples.html">Examples</a></li>
58
<li><a href="tutorials.html">Tutorials</a></li>
59
<li><a href="demos.html">Demos</a></li>
60
<li><a href="qdeclarativeexamples.html">QML Examples</a></li>
70
<div class="bd group">
72
<div class="searchlabel">
75
<form id="qtdocsearch" action="" onsubmit="return false;">
77
<input type="text" name="searchstring" id="pageType" value="" />
81
<div class="box first bottombar" id="lookup">
82
<h2 title="API Lookup"><span></span>
84
<div id="list001" class="list">
86
<li class="defaultLink"><a href="classes.html">Class index</a></li>
87
<li class="defaultLink"><a href="functions.html">Function index</a></li>
88
<li class="defaultLink"><a href="modules.html">Modules</a></li>
89
<li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
90
<li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
91
<li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
95
<div class="box bottombar" id="topics">
96
<h2 title="Qt Topics"><span></span>
98
<div id="list002" class="list">
100
<li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li>
101
<li class="defaultLink"><a href="qtquick.html">Device UI's & Qt Quick</a></li>
102
<li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li>
103
<li class="defaultLink"><a href="developing-with-qt.html">Cross-platform and Platform-specific</a></li>
104
<li class="defaultLink"><a href="platform-specific.html">Platform-specific info</a></li>
105
<li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li>
106
<li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li>
110
<div class="box" id="examples">
111
<h2 title="Examples"><span></span>
113
<div id="list003" class="list">
115
<li class="defaultLink"><a href="all-examples.html">Examples</a></li>
116
<li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
117
<li class="defaultLink"><a href="demos.html">Demos</a></li>
118
<li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
124
<div class="toolbar">
125
<div class="breadcrumb toolblock">
127
<li class="first"><a href="index.html">Home</a></li>
128
<!-- Bread crumbs goes here -->
131
<div class="toolbuttons toolblock">
133
<li id="smallA" class="t_button">A</li>
134
<li id="medA" class="t_button active">A</li>
135
<li id="bigA" class="t_button">A</li>
136
<li id="print" class="t_button"><a href="javascript:this.print();">
137
<span>Print</span></a></li>
141
<div class="content">
142
<h1 class="title">trackball.h Example File</h1>
143
<span class="small-subtitle">demos/boxes/trackball.h</span>
144
<!-- $$$demos/boxes/trackball.h-description -->
145
<div class="descr"> <a name="details"></a>
146
<pre class="highlightedCode brush: cpp"><span class="comment"> /****************************************************************************
148
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
149
** All rights reserved.
150
** Contact: Nokia Corporation (qt-info@nokia.com)
152
** This file is part of the demonstration applications of the Qt Toolkit.
154
** $QT_BEGIN_LICENSE:LGPL$
156
** Licensees holding valid Qt Commercial licenses may use this file in
157
** accordance with the Qt Commercial License Agreement provided with the
158
** Software or, alternatively, in accordance with the terms contained in
159
** a written agreement between you and Nokia.
161
** GNU Lesser General Public License Usage
162
** Alternatively, this file may be used under the terms of the GNU Lesser
163
** General Public License version 2.1 as published by the Free Software
164
** Foundation and appearing in the file LICENSE.LGPL included in the
165
** packaging of this file. Please review the following information to
166
** ensure the GNU Lesser General Public License version 2.1 requirements
167
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
169
** In addition, as a special exception, Nokia gives you certain additional
170
** rights. These rights are described in the Nokia Qt LGPL Exception
171
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
173
** GNU General Public License Usage
174
** Alternatively, this file may be used under the terms of the GNU
175
** General Public License version 3.0 as published by the Free Software
176
** Foundation and appearing in the file LICENSE.GPL included in the
177
** packaging of this file. Please review the following information to
178
** ensure the GNU General Public License version 3.0 requirements will be
179
** met: http://www.gnu.org/copyleft/gpl.html.
181
** If you have questions regarding the use of this file, please contact
182
** Nokia at qt-info@nokia.com.
185
****************************************************************************/</span>
190
#include <QtGui>
192
#include <QtGui/qvector3d.h>
193
#include <QtGui/qquaternion.h>
203
TrackBall(TrackMode mode = Sphere);
204
TrackBall(float angularVelocity, const QVector3D& axis, TrackMode mode = Sphere);
205
<span class="comment">// coordinates in [-1,1]x[-1,1]</span>
206
void push(const QPointF& p, const QQuaternion &transformation);
207
void move(const QPointF& p, const QQuaternion &transformation);
208
void release(const QPointF& p, const QQuaternion &transformation);
209
void start(); <span class="comment">// starts clock</span>
210
void stop(); <span class="comment">// stops clock</span>
211
QQuaternion rotation() const;
213
QQuaternion m_rotation;
215
float m_angularVelocity;
226
<!-- @@@demos/boxes/trackball.h -->
227
<div class="feedback t_button">
228
[+] Documentation Feedback</div>
238
<acronym title="Copyright">©</acronym> 2008-2010 Nokia Corporation and/or its
239
subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation
240
in Finland and/or other countries worldwide.</p>
242
All other trademarks are property of their respective owners. <a title="Privacy Policy"
243
href="http://qt.nokia.com/about/privacy-policy">Privacy Policy</a></p>
246
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.</p>
248
Alternatively, this document may be used under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU
249
Free Documentation License version 1.3</a>
250
as published by the Free Software Foundation.</p>
252
<div id="feedbackBox">
253
<div id="feedcloseX" class="feedclose t_button">X</div>
254
<form id="feedform" action="http://doc.qt.nokia.com/docFeedbck/feedback.php" method="get">
255
<p id="noteHead">Thank you for giving your feedback.</p> <p class="note">Make sure it is related to this specific page. For more general bugs and
256
requests, please use the <a href="http://bugreports.qt.nokia.com/secure/Dashboard.jspa">Qt Bug Tracker</a>.</p>
257
<p><textarea id="feedbox" name="feedText" rows="5" cols="40"></textarea></p>
258
<p><input id="feedsubmit" class="feedclose" type="submit" name="feedback" /></p>