3
3
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
4
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
<title>Qt 4.5: scene.h Example File (demos/boxes/scene.h)</title>
6
<title>Qt 4.6: scene.h Example File (demos/boxes/scene.h)</title>
7
7
<link href="classic.css" rel="stylesheet" type="text/css" />
10
10
<table border="0" cellpadding="0" cellspacing="0" width="100%">
12
<td align="left" valign="top" width="32"><a href="http://qtsoftware.com/products/qt"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
13
<td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="namespaces.html"><font color="#004faf">All Namespaces</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="mainclasses.html"><font color="#004faf">Main Classes</font></a> · <a href="groups.html"><font color="#004faf">Grouped Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a> · <a href="functions.html"><font color="#004faf">Functions</font></a></td>
14
<td align="right" valign="top" width="230"></td></tr></table><h1 class="title">scene.h Example File<br /><span class="small-subtitle">demos/boxes/scene.h</span>
12
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
13
<td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="functions.html"><font color="#004faf">All Functions</font></a> · <a href="overviews.html"><font color="#004faf">Overviews</font></a></td><td class="searchBar" align="right" valign="center"><form action="http://www.google.com/cse" id="cse-search-box"><div><input type="hidden" name="cx" value="000136343326384750312:dhbxnqlakyu" /><input type="hidden" name="ie" value="UTF-8" /><input type="text" name="q" size="31" /><input type="submit" name="sa" value="Search" /></div></form></td>
14
</tr></table><h1 class="title">scene.h Example File<br /><span class="small-subtitle">demos/boxes/scene.h</span>
16
16
<pre><span class="comment"> /****************************************************************************
18
18
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
19
** All rights reserved.
19
20
** Contact: Nokia Corporation (qt-info@nokia.com)
21
22
** This file is part of the demonstration applications of the Qt Toolkit.
23
24
** $QT_BEGIN_LICENSE:LGPL$
25
** Licensees holding valid Qt Commercial licenses may use this file in
26
** accordance with the Qt Commercial License Agreement provided with the
27
** Software or, alternatively, in accordance with the terms contained in
28
** a written agreement between you and Nokia.
25
** No Commercial Usage
26
** This file contains pre-release code and may not be distributed.
27
** You may use this file in accordance with the terms and conditions
28
** contained in the Technology Preview License Agreement accompanying
30
31
** GNU Lesser General Public License Usage
31
32
** Alternatively, this file may be used under the terms of the GNU Lesser
35
36
** ensure the GNU Lesser General Public License version 2.1 requirements
36
37
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
38
** In addition, as a special exception, Nokia gives you certain
39
** additional rights. These rights are described in the Nokia Qt LGPL
40
** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
43
** GNU General Public License Usage
44
** Alternatively, this file may be used under the terms of the GNU
45
** General Public License version 3.0 as published by the Free Software
46
** Foundation and appearing in the file LICENSE.GPL included in the
47
** packaging of this file. Please review the following information to
48
** ensure the GNU General Public License version 3.0 requirements will be
49
** met: http://www.gnu.org/copyleft/gpl.html.
51
** If you are unsure which license is appropriate for your use, please
52
** contact the sales department at http://www.qtsoftware.com/contact.
39
** In addition, as a special exception, Nokia gives you certain additional
40
** rights. These rights are described in the Nokia Qt LGPL Exception
41
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
43
** If you have questions regarding the use of this file, please contact
44
** Nokia at qt-info@nokia.com.
53
53
** $QT_END_LICENSE$
55
55
****************************************************************************/</span>
66
66
#include "roundedbox.h"
67
67
#include "gltrianglemesh.h"
68
#include "vector.h"
69
68
#include "trackball.h"
70
69
#include "glbuffers.h"
71
#include "glshaders.h"
72
70
#include "qtbox.h"
74
72
#define PI 3.14159265358979
76
76
class ParameterEdit : public QWidget
122
122
class GraphicsWidget : public QGraphicsProxyWidget
125
GraphicsWidget() : QGraphicsProxyWidget(0, Qt::Window) {}
125
127
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
126
128
virtual void resizeEvent(QGraphicsSceneResizeEvent *event);
210
212
void setFloatParameter(const QString &name, float value);
211
213
void newItem(ItemDialog::ItemType type);
213
void renderBoxes(const gfx::Matrix4x4f &view, int excludeBox = -2);
215
void renderBoxes(const QMatrix4x4 &view, int excludeBox = -2);
214
216
void setStates();
215
217
void setLights();
216
218
void defaultStates();
246
248
GLTexture3D *m_noise;
247
249
GLRenderTargetCube *m_mainCubemap;
248
250
QVector<GLRenderTargetCube *> m_cubemaps;
249
QVector<GLProgram *> m_programs;
250
GLVertexShader *m_vertexShader;
251
QVector<GLFragmentShader *> m_fragmentShaders;
252
GLFragmentShader *m_environmentShader;
253
GLProgram *m_environmentProgram;
251
QVector<QGLShaderProgram *> m_programs;
252
QGLShader *m_vertexShader;
253
QVector<QGLShader *> m_fragmentShaders;
254
QGLShader *m_environmentShader;
255
QGLShaderProgram *m_environmentProgram;
257
259
<p /><address><hr /><div align="center">
258
260
<table width="100%" cellspacing="0" border="0"><tr class="address">
259
<td width="30%" align="left">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies)</td>
260
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
261
<td width="30%" align="right"><div align="right">Qt 4.5.2</div></td>
262
</tr></table></div></address></body>
261
<td width="40%" align="left">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies)</td>
262
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
263
<td width="40%" align="right"><div align="right">Qt 4.6.0</div></td>
264
<script type="text/javascript" src="http://www.google.com/jsapi"></script><script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script><script type="text/javascript" src="http://www.google.com/coop/cse/t13n?form=cse-search-box&t13n_langs=en"></script><script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script></tr></table></div></address></body>