merged with main branch

metadata
Wenzel Jakob 2010-10-21 12:03:08 +02:00
commit 0316615a64
28 changed files with 384 additions and 170 deletions

View File

@ -49,6 +49,7 @@ vars.Add('BOOSTINCLUDE', 'boost include path')
vars.Add('BOOSTLIB', 'boost libraries')
vars.Add('BOOSTLIBDIR', 'boost library path')
vars.Add('TARGET_ARCH', 'Target architecture')
vars.Add('MSVC_VERSION', 'MS Visual C++ compiler version')
try:
env = Environment(options=vars, ENV = os.environ, tools=['default', 'qt4'], toolpath=['tools'])
@ -716,8 +717,6 @@ elif sys.platform == 'darwin':
installTargets += env.OSXLibInst('Mitsuba.app/Contents/Frameworks', 'tools/darwin/Xerces-C.framework/Resources/lib/libxerces-c-3.0.dylib')
installTargets += env.OSXLibInst('Mitsuba.app/Contents/Frameworks', 'tools/darwin/libpng.framework/Resources/lib/libpng.dylib')
installTargets += env.OSXLibInst('Mitsuba.app/Contents/Frameworks', 'tools/darwin/libjpeg.framework/Resources/lib/libjpeg.dylib')
installTargets += env.OSXLibInst('Mitsuba.app/Contents/Frameworks', 'tools/darwin/libboost.framework/Resources/lib/libboost_system-xgcc42-mt-1_39.dylib')
installTargets += env.OSXLibInst('Mitsuba.app/Contents/Frameworks', 'tools/darwin/libboost.framework/Resources/lib/libboost_filesystem-xgcc42-mt-1_39.dylib')
if hasCollada:
installTargets += env.OSXLibInst('Mitsuba.app/Contents/Frameworks', 'tools/darwin/Collada14Dom.framework/Resources/lib/libCollada14Dom.dylib')
if hasQt:

View File

@ -6,6 +6,7 @@ GCC = 'cl'
CXXFLAGS = ['/nologo', '/Ox', '/fp:fast', '/arch:SSE2' ,'/D', 'WIN32', '/W3', '/EHsc', '/GS-', '/GL', '/MD', '/D', 'MTS_DEBUG', '/D', 'SINGLE_PRECISION', '/D', 'MTS_SSE', '/D', 'MTS_HAS_COHERENT_RT', '/D', '_CONSOLE', '/D', 'NDEBUG', '/D_SECURE_SCL=0', '/openmp']
SHCXXFLAGS = CXXFLAGS
TARGET_ARCH = 'x86'
MSVC_VERSION = '9.0'
LINKFLAGS = ['/nologo', '/SUBSYSTEM:CONSOLE', '/MACHINE:X86', '/FIXED:NO', '/OPT:REF', '/OPT:ICF', '/LTCG', '/NODEFAULTLIB:LIBCMT']
BASEINCLUDE = ['#include', '#tools/windows/include']
BASELIB = ['pthreadVCE2', 'msvcrt', 'ws2_32']
@ -13,7 +14,7 @@ OEXRINCLUDE = ['#tools/windows/include/OpenEXR']
OEXRFLAGS = ['/D', 'OPENEXR_DLL']
OEXRLIB = ['IlmImf', 'IlmThread', 'Iex', 'zlib1', 'Half']
BOOSTINCLUDE = ['#tools/boost']
BOOSTLIB = ['libboost_system', 'libboost_filesystem']
BOOSTLIB = ['libboost_system-vc90-mt-1_39', 'libboost_filesystem-vc90-mt-1_39']
COLLADAINCLUDE = ['#tools/windows/include/colladadom', '#tools/windows/include/colladadom/1.4']
COLLADALIB = ['libcollada14dom21']
XERCESLIB = ['xerces-c_3']

View File

@ -6,6 +6,7 @@ GCC = 'cl'
CXXFLAGS = ['/nologo', '/Ox', '/fp:fast', '/D', 'WIN32', '/D', 'WIN64', '/W3', '/EHsc', '/GS-', '/GL', '/MD', '/D', 'MTS_DEBUG', '/D', 'SINGLE_PRECISION', '/D', 'MTS_SSE', '/D', 'MTS_HAS_COHERENT_RT', '/D', '_CONSOLE', '/D', 'NDEBUG', '/D_SECURE_SCL=0', '/openmp']
SHCXXFLAGS = CXXFLAGS
TARGET_ARCH = 'x86_64'
MSVC_VERSION = '9.0'
LINKFLAGS = ['/nologo', '/SUBSYSTEM:CONSOLE', '/MACHINE:X64', '/FIXED:NO', '/OPT:REF', '/OPT:ICF', '/LTCG', '/NODEFAULTLIB:LIBCMT']
BASEINCLUDE = ['#include', '#tools/windows/include']
BASELIB = ['pthreadVCE2', 'msvcrt', 'ws2_32']
@ -13,7 +14,7 @@ OEXRINCLUDE = ['#tools/windows/include/OpenEXR']
OEXRFLAGS = ['/D', 'OPENEXR_DLL']
OEXRLIB = ['IlmImf', 'IlmThread', 'Iex', 'zlib1', 'Half']
BOOSTINCLUDE = ['#tools/boost']
BOOSTLIB = ['libboost_system', 'libboost_filesystem']
BOOSTLIB = ['libboost_system-vc90-mt-1_39', 'libboost_filesystem-vc90-mt-1_39']
COLLADAINCLUDE = ['#tools/windows/include/colladadom', '#tools/windows/include/colladadom/1.4']
COLLADALIB = ['libcollada14dom21']
XERCESLIB = ['xerces-c_3']

View File

@ -0,0 +1,28 @@
CXX = 'cl'
GCC = 'cl'
# /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission
# /EHsc=C++ exceptions, /fp:fast=Enable reasonable FP optimizations, /GS-=No buffer security checks, /GL=whole program optimizations
# To include debug information add '/Z7' to CXXFLAGS and '/DEBUG' to LINKFLAGS
CXXFLAGS = ['/nologo', '/Ox', '/fp:fast', '/arch:SSE2' ,'/D', 'WIN32', '/W3', '/EHsc', '/GS-', '/GL', '/MD', '/D', 'MTS_DEBUG', '/D', 'SINGLE_PRECISION', '/D', 'MTS_SSE', '/D', 'MTS_HAS_COHERENT_RT', '/D', '_CONSOLE', '/D', 'NDEBUG', '/D_SECURE_SCL=0', '/openmp']
SHCXXFLAGS = CXXFLAGS
TARGET_ARCH = 'x86'
MSVC_VERSION = '10.0'
LINKFLAGS = ['/nologo', '/SUBSYSTEM:CONSOLE', '/MACHINE:X86', '/FIXED:NO', '/OPT:REF', '/OPT:ICF', '/LTCG', '/NODEFAULTLIB:LIBCMT']
BASEINCLUDE = ['#include', '#tools/windows/include']
BASELIB = ['pthreadVCE2', 'msvcrt', 'ws2_32']
OEXRINCLUDE = ['#tools/windows/include/OpenEXR']
OEXRFLAGS = ['/D', 'OPENEXR_DLL']
OEXRLIB = ['IlmImf', 'IlmThread', 'Iex', 'zlib1', 'Half']
BOOSTINCLUDE = ['#tools/boost']
BOOSTLIB = ['libboost_system-vc100-mt-1_39', 'libboost_filesystem-vc100-mt-1_39']
COLLADAINCLUDE = ['#tools/windows/include/colladadom', '#tools/windows/include/colladadom/1.4']
COLLADALIB = ['libcollada14dom21']
XERCESLIB = ['xerces-c_3']
PNGLIB = ['libpng13']
JPEGLIB = ['jpeg62']
GLLIB = ['opengl32', 'glu32', 'glew32mx', 'gdi32', 'user32']
GLFLAGS = ['/D', 'GLEW_MX']
BASELIBDIR = ['#tools/windows/lib32']
SHLIBPREFIX = 'lib'
SHLIBSUFFIX = '.dll'
PROGSUFFIX = '.exe'

View File

@ -0,0 +1,28 @@
CXX = 'cl'
GCC = 'cl'
# /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission
# /EHsc=C++ exceptions, /fp:fast=Enable reasonable FP optimizations, /GS-=No buffer security checks, /GL=whole program optimizations
# To include debug information add '/Z7' to CXXFLAGS and '/DEBUG' to LINKFLAGS
CXXFLAGS = ['/nologo', '/Ox', '/fp:fast', '/D', 'WIN32', '/D', 'WIN64', '/W3', '/EHsc', '/GS-', '/GL', '/MD', '/D', 'MTS_DEBUG', '/D', 'SINGLE_PRECISION', '/D', 'MTS_SSE', '/D', 'MTS_HAS_COHERENT_RT', '/D', '_CONSOLE', '/D', 'NDEBUG', '/D_SECURE_SCL=0', '/openmp']
SHCXXFLAGS = CXXFLAGS
TARGET_ARCH = 'x86_64'
MSVC_VERSION = '10.0'
LINKFLAGS = ['/nologo', '/SUBSYSTEM:CONSOLE', '/MACHINE:X64', '/FIXED:NO', '/OPT:REF', '/OPT:ICF', '/LTCG', '/NODEFAULTLIB:LIBCMT']
BASEINCLUDE = ['#include', '#tools/windows/include']
BASELIB = ['pthreadVCE2', 'msvcrt', 'ws2_32']
OEXRINCLUDE = ['#tools/windows/include/OpenEXR']
OEXRFLAGS = ['/D', 'OPENEXR_DLL']
OEXRLIB = ['IlmImf', 'IlmThread', 'Iex', 'zlib1', 'Half']
BOOSTINCLUDE = ['#tools/boost']
BOOSTLIB = ['libboost_system-vc100-mt-1_39', 'libboost_filesystem-vc100-mt-1_39']
COLLADAINCLUDE = ['#tools/windows/include/colladadom', '#tools/windows/include/colladadom/1.4']
COLLADALIB = ['libcollada14dom21']
XERCESLIB = ['xerces-c_3']
PNGLIB = ['libpng13']
JPEGLIB = ['jpeg62']
GLLIB = ['opengl32', 'glu32', 'glew32mx', 'gdi32', 'user32']
GLFLAGS = ['/D', 'GLEW_MX']
BASELIBDIR = ['#tools/windows/lib64']
SHLIBPREFIX = 'lib'
SHLIBSUFFIX = '.dll'
PROGSUFFIX = '.exe'

View File

@ -1,6 +1,6 @@
\section{Compiling the renderer}
To compile Mitsuba, you will need a recent C++ compiler (e.g. GCC 4.1+ or
Visual Studio 2005+) and some additional libraries, which Mitsuba uses internally.
Visual Studio 2008+) and some additional libraries, which Mitsuba uses internally.
Builds on all three supported platforms are done using a unified system
based on SCons (\url{http://www.scons.org}), a flexible python-based
software construction tool. There are some minor differences between operating systems though: for
@ -23,8 +23,10 @@ config/config-linux.py
config/config-darwin-x86_64.py
config/config-darwin-x86.py
config/config-darwin-universal.py
config/config-msvc2005-win32.py
config/config-msvc2005-win64.py
config/config-msvc2008-win32.py
config/config-msvc2008-win64.py
config/config-msvc2010-win32.py
config/config-msvc2010-win64.py
\end{shell}
Some minor adjustments may have to be made to this file based on your configuration.
@ -131,7 +133,7 @@ $\text{\$}$ . setpath.sh
\subsection{Building on Windows}
This section assumes that Visual Studio 2008 is installed, but the instructions should work equally well with other versions.
This section assumes that Visual Studio 2008 is installed, but the instructions should work analogously for other versions.
On the Windows platform, Mitsuba already includes most of the dependencies in precompiled form.
You will still need to set up a few things though: first, you need to install Python
(\url{www.python.org}) and SCons (\url{http://www.scons.org}) and ensure that they are contained
@ -146,7 +148,7 @@ Next, install Qt (\url{http://qt.nokia.com/downloads/windows-cpp-vs2008} -- you
Qt utilities are reachable through the \code{\%PATH\%} environment variable so that you can for example launch \code{moc.exe} from the command line.
Because the official release of Qt currently only contains 32-bit binaries, you will accordingly have to
build Mitsuba in 32-bit mode (i.e. you should use the configuration file \code{config-msvc2005-win32.py}). If you would rather like compile it in 64-bit mode, you have to create
build Mitsuba in 32-bit mode (i.e. you should use the configuration file \code{config-msvc2008-win32.py}). If you would rather like compile it in 64-bit mode, you have to create
your own 64-bit Qt binaries.
Having installed these dependencies, run the ``Visual Studio 2008 Command

View File

@ -184,4 +184,44 @@ public:
}
};
class ProgramVersion {
public:
inline ProgramVersion(const QString &versionString) {
QStringList sl;
sl = versionString.trimmed().split('.');
SAssert(sl.size() == 3);
major = sl[0].toInt();
minor = sl[1].toInt();
release = sl[2].toInt();
}
inline bool operator<(const ProgramVersion &other) const {
if (major < other.major)
return true;
if (major > other.major)
return false;
if (minor < other.minor)
return true;
if (minor > other.minor)
return false;
if (release < other.release)
return true;
return false;
}
inline bool operator==(const ProgramVersion &other) const {
return major == other.major
&& minor == other.minor
&& release == other.release;
}
QString toString() const {
return QString("%1.%2.%3").arg(major).arg(minor).arg(release);
}
private:
int major;
int minor;
int release;
};
#endif // QTGUI_COMMON_H

View File

@ -27,6 +27,7 @@
#include "aboutdlg.h"
#include "importdlg.h"
#include "loaddlg.h"
#include "updatedlg.h"
#include "server.h"
#include "save.h"
#include <QtNetwork>
@ -48,40 +49,6 @@
#include "previewsettingsdlg.h"
#endif
class ProgramVersion {
public:
ProgramVersion(const QString &versionString) {
QStringList sl;
sl = versionString.trimmed().split('.');
SAssert(sl.size() == 3);
major = sl[0].toInt();
minor = sl[1].toInt();
release = sl[2].toInt();
}
inline bool operator<(const ProgramVersion &other) const {
if (major < other.major)
return true;
if (major > other.major)
return false;
if (minor < other.minor)
return true;
if (minor > other.minor)
return false;
if (release < other.release)
return true;
return false;
}
QString toString() const {
return QString("%1.%2.%3").arg(major).arg(minor).arg(release);
}
private:
int major;
int minor;
int release;
};
static int localWorkerCtr = 0, remoteWorkerCtr = 0;
MainWindow::MainWindow(QWidget *parent) :
@ -420,30 +387,33 @@ void MainWindow::adjustSize() {
resize(s);
}
void MainWindow::checkForUpdates(bool notifyIfNone) {
m_notifyIfNoUpdates = notifyIfNone;
void MainWindow::checkForUpdates(bool manualUpdateCheck) {
m_manualUpdateCheck = manualUpdateCheck;
m_networkReply = m_networkManager->get(QNetworkRequest(QUrl("http://www.mitsuba-renderer.org/version")));
}
void MainWindow::onNetworkFinished(QNetworkReply *reply) {
if (reply->error() == QNetworkReply::NoError) {
QSettings settings("mitsuba-renderer.org", "qtgui");
ProgramVersion remote(QString(reply->readAll()));
ProgramVersion ignoredVersion(settings.value("ignoredVersion", "0.0.0").toString());
ProgramVersion local(MTS_VERSION);
if (local < remote)
QMessageBox::information(this, tr("New version available"),
QString("<p>A new version of Mitsuba is available!</p><p>"
"You have version <b>%1</b> and the most recent release is version <b>%2</b>. "
"Please visit the <a href=\"http://www.mitsuba-renderer.org\">Mitsuba website</a> to download it.</p>")
.arg(local.toString()).arg(remote.toString()),
QMessageBox::Ok);
else if (m_notifyIfNoUpdates)
if (local < remote) {
if (!m_manualUpdateCheck && remote == ignoredVersion)
return;
UpdateDialog *dialog = new UpdateDialog(this, local, remote);
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->setWindowModality(Qt::WindowModal);
dialog->show();
} else if (m_manualUpdateCheck) {
QMessageBox::information(this, tr("Installed version is current"),
QString("<p>You're up to date!</p>"
"<p>Mitsuba <b>%1</b> is still the newest version available.</p>")
.arg(local.toString()), QMessageBox::Ok);
}
} else {
if (m_notifyIfNoUpdates)
if (m_manualUpdateCheck)
QMessageBox::warning(this, tr("Unable to determine the newest version"),
QString("<p>Unable to determine the newest Mitsuba version.</p><p>"
"Perhaps you are not connected to the Internet?</p>"),

View File

@ -173,7 +173,7 @@ private:
QStringList m_searchPaths;
QString m_nodeName;
int m_blockSize, m_listenPort;
bool m_checkForUpdates, m_notifyIfNoUpdates;
bool m_checkForUpdates, m_manualUpdateCheck;
bool m_activeWindowHack;
int m_bugStatus, m_contextIndex;
SceneContext *m_lastTab;

75
src/qtgui/updatedlg.cpp Normal file
View File

@ -0,0 +1,75 @@
/*
This file is part of Mitsuba, a physically based rendering system.
Copyright (c) 2007-2010 by Wenzel Jakob and others.
Mitsuba is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License Version 3
as published by the Free Software Foundation.
Mitsuba is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ui_updatedlg.h"
#include "updatedlg.h"
UpdateDialog::UpdateDialog(QWidget *parent, const ProgramVersion &local,
const ProgramVersion &remote) : QDialog(parent),
ui(new Ui::UpdateDialog) {
ui->setupUi(this);
ui->versionLabel->setText(QApplication::translate("UpdateDialog",
"Version %1 has been released (you are using %2). Would you like to visit the download page?",
0, QApplication::UnicodeUTF8).arg(remote.toString()).arg(local.toString()));
ui->changeView->setHtml("Loading change log ..");
m_networkManager = new QNetworkAccessManager(this);
connect(m_networkManager, SIGNAL(finished(QNetworkReply *)),
this, SLOT(onNetworkFinished(QNetworkReply *)));
m_networkReply = m_networkManager->get(QNetworkRequest(QUrl("http://www.mitsuba-renderer.org/changelog.html")));
m_remoteVersion = remote.toString();
}
void UpdateDialog::onNetworkFinished(QNetworkReply *reply) {
if (reply->error() == QNetworkReply::NoError)
ui->changeView->setHtml(QString(reply->readAll()));
else
ui->changeView->setHtml("Unable to load the change log!");
m_networkReply = NULL;
}
UpdateDialog::~UpdateDialog() {
if (m_networkReply)
m_networkReply->abort();
delete ui;
}
void UpdateDialog::on_skipButton_clicked() {
QSettings settings("mitsuba-renderer.org", "qtgui");
settings.setValue("ignoredVersion", m_remoteVersion);
accept();
}
void UpdateDialog::on_remindButton_clicked() {
accept();
}
void UpdateDialog::on_downloadButton_clicked() {
QDesktopServices::openUrl(QUrl("http://www.mitsuba-renderer.org/download.html"));
accept();
}
void UpdateDialog::changeEvent(QEvent *e) {
QDialog::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}

49
src/qtgui/updatedlg.h Normal file
View File

@ -0,0 +1,49 @@
/*
This file is part of Mitsuba, a physically based rendering system.
Copyright (c) 2007-2010 by Wenzel Jakob and others.
Mitsuba is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License Version 3
as published by the Free Software Foundation.
Mitsuba is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(__UPDATEDLG_H)
#define __UPDATEDLG_H
#include "common.h"
#include <QtNetwork>
namespace Ui {
class UpdateDialog;
}
class UpdateDialog : public QDialog {
Q_OBJECT
public:
UpdateDialog(QWidget *parent, const ProgramVersion &local,
const ProgramVersion &remote);
~UpdateDialog();
protected slots:
void on_skipButton_clicked();
void on_remindButton_clicked();
void on_downloadButton_clicked();
void onNetworkFinished(QNetworkReply *reply);
protected:
void changeEvent(QEvent *e);
private:
Ui::UpdateDialog *ui;
QNetworkAccessManager *m_networkManager;
QNetworkReply *m_networkReply;
QString m_remoteVersion;
};
#endif // __UPDATEDLG_H

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<class>UpdateDialog</class>
<widget class="QDialog" name="UpdateDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>531</width>
<width>532</width>
<height>327</height>
</rect>
</property>
@ -14,73 +14,6 @@
<string>Software Update</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>13</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label">
<property name="maximumSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="resources.qrc">:/resources/appicon.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="3" rowspan="2">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
@ -107,7 +40,7 @@
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<widget class="QLabel" name="versionLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
@ -144,7 +77,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>14</height>
<height>10</height>
</size>
</property>
</spacer>
@ -167,32 +100,16 @@
</item>
</layout>
</item>
<item row="2" column="3">
<widget class="QTextEdit" name="textEdit">
<property name="readOnly">
<bool>true</bool>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:10px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;Mitsuba 0.1.2&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;&lt;li style=&quot; font-size:9pt;&quot; style=&quot; margin-top:6px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Feature 1&lt;/li&gt;
&lt;li style=&quot; font-size:9pt;&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Feature 2&lt;/li&gt;
&lt;li style=&quot; font-size:9pt;&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Feature 3&lt;/li&gt;
&lt;li style=&quot; font-size:9pt;&quot; style=&quot; margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Feature 4&lt;/li&gt;&lt;/ul&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;&quot;&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="3" column="3">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="pushButton">
<widget class="QPushButton" name="skipButton">
<property name="text">
<string>Skip this version</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item>
@ -209,23 +126,104 @@ p, li { white-space: pre-wrap; }
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_2">
<widget class="QPushButton" name="remindButton">
<property name="text">
<string>Remind me again</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_3">
<widget class="QPushButton" name="downloadButton">
<property name="text">
<string>Download Page</string>
<string>Download</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label">
<property name="maximumSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="resources.qrc">:/resources/appicon.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>18</width>
<height>18</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="3">
<widget class="QTextBrowser" name="changeView">
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="openLinks">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>downloadButton</tabstop>
<tabstop>remindButton</tabstop>
<tabstop>skipButton</tabstop>
</tabstops>
<resources>
<include location="resources.qrc"/>
</resources>

View File

@ -174,7 +174,7 @@ public:
return result;
}
inline Float sqr(Float f) {
inline Float sqr(Float f) const {
return f*f;
}
@ -185,14 +185,26 @@ public:
* Based on:
* www.geometrictools.com/Documentation/IntersectionCylinderPlane.pdf
*/
inline bool intersectCylPlane(Point planePt, Normal planeNrml,
Point cylPt, Vector cylD, Float radius) {
FINLINE bool intersectCylPlane(Point planePt, Normal planeNrml,
Point cylPt, Vector cylD, Float radius, Point &center,
Vector &axis1, Vector &axis2) const {
if (absDot(planeNrml, cylD) < Epsilon)
return false;
Vector A = normalize(cylD - dot(planeNrml, cylD)*planeNrml),
B = cross(planeNrml, A),
delta = planePt - cylPt,
Vector B, A = cylD - dot(cylD, planeNrml)*planeNrml;
Float length = A.length();
if (length != 0) {
A /= length;
B = cross(planeNrml, A);
} else {
Log(EInfo, "interesting: %s %s", cylD.toString().c_str(),
planeNrml.toString().c_str());
coordinateSystem(planeNrml, A, B);
}
Vector delta = planePt - cylPt,
deltaProj = delta - cylD*dot(delta, cylD);
Float c0 = 1-sqr(dot(A, cylD));
@ -208,12 +220,33 @@ public:
L_alpha = std::sqrt(c1*lambda),
L_beta = std::sqrt(c0*lambda);
Point center = planePt + alpha0 * A + beta0 * B;
Vector axis1 = L_alpha * A;
Vector axis2 = L_beta * B;
center = planePt + alpha0 * A + beta0 * B;
axis1 = L_alpha * A;
axis2 = L_beta * B;
return true;
}
AABB getClippedAABB(const AABB &box) const {
/* Compute a base bounding box */
AABB base(getAABB());
base.clip(box);
Point p0 = m_objectToWorld(Point(0, 0, 0));
Point p1 = m_objectToWorld(Point(0, 0, m_length));
Vector cylD(normalize(p1-p0));
Point center;
Vector axis1, axis2;
intersectCylPlane(box.min, Normal(1, 0, 0), p0, cylD, m_radius, center, axis1, axis2);
// cout << center.toString() << endl;
/* Now forget about the cylinder ends and
intersect an infinite cylinder with each AABB face */
return base;
}
#if 0
inline AABB getAABB(Float start, Float end) const {
AABB result;
@ -228,17 +261,6 @@ public:
return result;
}
AABB getClippedAABB(const AABB &box) const {
/* Compute a base bounding box */
AABB base(getAABB());
base.clip(box);
/* Now forget about the cylinder ends and
intersect an infinite cylinder with each AABB face */
return box;
}
AABB getAABB() const {
/* Very approximate .. */
return getAABB(0, m_length);

View File

@ -7,6 +7,7 @@
#include <sstream>
#include <string>
#include <vector>
#include <cctype>
#if defined(WIN32)
#include <boost/tr1/functional.hpp>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.