final changes to put the demo on the next release

This commit is contained in:
Manuel Caroli 2009-12-08 21:02:25 +00:00
parent 848c774faf
commit dbadc61397
12 changed files with 221 additions and 2 deletions

7
.gitattributes vendored
View File

@ -2446,8 +2446,15 @@ Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/MainWindow.ui -text
Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/Periodic_Lloyd_3.qrc -text
Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/about_CGAL.html svneol=native#text/html
Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/about_Periodic_Lloyd_3.html svneol=native#text/html
Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/documentation/Periodic_Lloyd_3.adp -text
Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/documentation/images/mainwindow.png -text svneol=unset#image/png
Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/documentation/index.html svneol=native#text/html
Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/documentation/introduction.html svneol=native#text/html
Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/documentation/menu.html svneol=native#text/html
Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/icons/cp8.png -text svneol=unset#image/png
Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/icons/fileNew.png -text svneol=unset#image/png
Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/icons/fileOpen.png -text svneol=unset#image/png
Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/icons/fileSave.png -text svneol=unset#image/png
Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/icons/pause.png -text svneol=unset#image/png
Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/icons/planar.png -text svneol=unset#image/png
Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/icons/play.png -text svneol=unset#image/png

View File

@ -18,6 +18,7 @@ set( QT_USE_QTXML TRUE )
set( QT_USE_QTMAIN TRUE )
set( QT_USE_QTSCRIPT TRUE )
set( QT_USE_QTOPENGL TRUE )
set( QT_USE_QTASSISTANT TRUE )
find_package(Qt4)
find_package(OpenGL)

View File

@ -5,6 +5,15 @@ MainWindow::MainWindow(QWidget* parent): CGAL::Qt::DemosMainWindow(parent)
{
setupUi(this);
this->viewer->setScene(&scene);
QString loc = QLibraryInfo::location(QLibraryInfo::BinariesPath);
assistantClient = new QAssistantClient(loc, this);
QStringList arguments;
arguments << "-profile"
<< QCoreApplication::applicationDirPath() + QDir::separator()
+ QString("documentation/Periodic_Lloyd_3.adp");
assistantClient->setArguments(arguments);
connectActions();
this->addAboutDemo(":/cgal/help/about_Periodic_Lloyd_3.html");
this->addAboutCGAL();
@ -16,7 +25,6 @@ MainWindow::MainWindow(QWidget* parent): CGAL::Qt::DemosMainWindow(parent)
connect(qtimer, SIGNAL(timeout()), this, SLOT(lloydStep()));
}
void
MainWindow::connectActions()
{
@ -52,6 +60,9 @@ MainWindow::connectActions()
QObject::connect(this->actionQuit, SIGNAL(triggered()),
qApp, SLOT(quit()));
QObject::connect(this->actionDemo_Help, SIGNAL(triggered()),
this, SLOT(help()));
}
void
@ -195,6 +206,11 @@ MainWindow::newPoints(int n)
emit (sceneChanged());
}
void MainWindow::help() {
QString loc = QCoreApplication::applicationDirPath() + QDir::separator()
+ QString("documentation/index.html");
assistantClient->showPage(loc);
}
#include "MainWindow.moc"

View File

@ -7,20 +7,28 @@
#include <QInputDialog>
#include <QSlider>
#include <QTimer>
#include <QtGui>
#include <QtAssistant/QAssistantClient>
class QWidget;
class MainWindow : public CGAL::Qt::DemosMainWindow, private Ui::MainWindow
{
Q_OBJECT
public:
public:
MainWindow(QWidget* = 0);
~MainWindow() { delete(assistantClient); }
void connectActions();
Scene scene;
QTimer * qtimer;
private:
QAssistantClient *assistantClient;
public slots:
void newPoints(int i);
void newPointSet();
@ -31,6 +39,7 @@ public slots:
void toggle8Copies(bool on);
void toggle2D(bool on);
void lloydStep();
void help();
signals:
void sceneChanged();

View File

@ -102,8 +102,15 @@
<addaction name="actionShow_8_Copies" />
<addaction name="action2D_version" />
</widget>
<widget class="QMenu" name="menuHelp" >
<property name="title" >
<string>Help</string>
</property>
<addaction name="actionDemo_Help" />
</widget>
<addaction name="menuFile" />
<addaction name="menuControl" />
<addaction name="menuHelp" />
</widget>
<widget class="QStatusBar" name="statusbar" />
<widget class="QToolBar" name="toolBar" >
@ -236,6 +243,11 @@
<string>Ctrl+S</string>
</property>
</action>
<action name="actionDemo_Help" >
<property name="text" >
<string>Demo Help</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>

View File

@ -0,0 +1,21 @@
<!DOCTYPE DCF>
<assistantconfig version="3.2.0">
<profile>
<property name="name">Periodic_Lloyd_3</property>
<property name="title">CGAL Periodic Lloyd Demo</property>
<property name="startpage">index.html</property>
<property name="assistantdocs">.</property>
</profile>
<DCF ref="index.html" title="CGAL Periodic Lloyd Demo">
<section ref="./introduction.html" title="Introduction" />
<section ref="./menu.html" title="Menu">
<section ref="./menu.html#File" title="File Menu" />
<section ref="./menu.html#Control" title="Control Menu" />
</section>
</DCF>
</assistantconfig>

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View File

@ -0,0 +1,29 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Manual</title>
</head>
<body style="font-size:12pt;font-family:helvetica">
<p><h2>CGAL Periodic Lloyd Demo</h2></p>
<img src="images/mainwindow.png" alt="Demo main window" />
<p>
This is a small demo program that illustrates a periodic
version of the Lloyd algorithm.
</p>
<ul>
<li><a href="introduction.html">Introduction</a></li>
<li><a href="menu.html">Menu</a></li>
<ul>
<li><a href="menu.html#File">File Menu</a></li>
<li><a href="menu.html#Control">Control Menu</a></li>
</ul>
</ul>
</body>
</html>

View File

@ -0,0 +1,30 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Introduction</title>
</head>
<body style="font-size:12pt;font-family:helvetica">
<p><h3>Introduction</h3></p>
<p>
This demo implements the Lloyd algorithm in periodic space
using the CGAL 3D periodic triangulations. The algorithm can
be run either on randomly generated point sets or on input
point sets provided in a file.
</p>
<p>
The Lloyd algorithm computes the Voronoi diagram and replaces
in each step the input point set by the centroids of their
respective Voronoi cells.
</p>
<p>
For more information on 3D periodic triangulations see the
<a href="http://www.cgal.org/Manual/3.6/doc_html/cgal_manual/Periodic_3_triangulation_3/Chapter_main.html">CGAL Periodic Triangulation
package manual</a>.
</p>
</body>
</html>

View File

@ -0,0 +1,94 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Menu</title>
<a name="File">
</head>
<body style="font-size:12pt;font-family:helvetica">
<p><h3><a name="File">File</a></h3></p>
<table cellspacing="16">
<tr>
<td width="32" align="center" valign="top">
<img src="../icons/fileNew.png" />
</td>
<td>
<b><i>New Point Set</i></b><br>
Asks for the wanted number of points and creates a uniformly
distributed random point set.
</td>
</tr>
<tr>
<td width="32" align="center" valign="top">
<img src="../icons/fileOpen.png" />
</td>
<td>
<b><i>Load Points</i></b><br>
Shows a "Open file" dialog. A readable file is supposed to
consist of
<ul>
<li> an Iso_cuboid_3 given by six values in the order
xmin ymin zmin xmax ymax zmax, separated by white spaces,
<li> a list of points that are separated by white
spaces. A point has to be represented as a list of three
coordinates that again are separated by white spaces.
</ul>
</td>
</tr>
<tr>
<td width="32" align="center" valign="top">
<img src="../icons/fileSave.png" />
</td>
<td>
<b><i>Save Points</i></b><br>
Shows a "Save file" dialog and saves the current points in
the same format as expected by "Load Points".
</td>
</tr>
</table>
<p><h3><a name="Control">Control</a></h3></p>
<table cellspacing="16">
<tr>
<td valign="top">
<img src="../icons/step.png" width="32" />
</td>
<td><b><i>Step</i></b><br>
Performs one Lloyd step.</td></tr>
<tr>
<td valign="top">
<img src="../icons/play.png" width="32" />
</td>
<td><b><i>Play</i></b><br>
Starts performing repeated Lloyd steps.
</td></tr>
<tr>
<td valign="top">
<img src="../icons/cp8.png" width="32" />
</td>
<td><b><i>Show 8 copies</i></b><br>
Shows eight periodic copies arranged in a 2x2x2 cube. This
is useful for small point sets to better see what the
Voronoi cells look like.
</td></tr>
<tr>
<td valign="top">
<img src="../icons/planar.png" width="32" />
</td>
<td><b><i>2D version</i></b><br>
Switches to 2D. The 2D version is simulated using the 3D
periodic triangulation, so it is very slow.
The 2D version only works for random point sets.
</td></tr>
</table>
<br>
The speed slider can be used to increase the pauses between
two separate Lloyd steps. By default the demo runs on maximum
speed.
</body>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB