Commit 0526b731 authored by Václav Šmilauer's avatar Václav Šmilauer
Browse files

1. Remove qt3 interface

2. Remove yade::serialization and related otherwise useless files 
3. Remove lib/loki, use the official Loki library (in /usr/include/loki, package libloki-dev) instead, except for (highly incompatible) Singleton, which was moved to lib/base.
parent ef7de7f9
......@@ -139,7 +139,7 @@ opts.AddVariables(
BoolVariable('optimize','Turn on heavy optimizations',defOptions['optimize']),
ListVariable('exclude','Yade components that will not be built','none',names=['gui','extra','common','dem','lattice','snow']),
EnumVariable('PGO','Whether to "gen"erate or "use" Profile-Guided Optimization','',['','gen','use'],{'no':'','0':'','false':''},1),
ListVariable('features','Optional features that are turned on','log4cxx,opengl,gts,openmp,vtk',names=['opengl','log4cxx','cgal','openmp','gts','vtk','python','gl2ps','devirt-functors','noqt3','qt3','qt4','never_use_this_one']),
ListVariable('features','Optional features that are turned on','log4cxx,opengl,gts,openmp,vtk',names=['opengl','log4cxx','cgal','openmp','gts','vtk','python','gl2ps','devirt-functors','qt4','never_use_this_one']),
('jobs','Number of jobs to run at the same time (same as -j, but saved)',2,None,int),
#('extraModules', 'Extra directories with their own SConscript files (must be in-tree) (whitespace separated)',None,None,Split),
('buildPrefix','Where to create build-[version][variant] directory for intermediary files','..'),
......@@ -149,7 +149,6 @@ opts.AddVariables(
('realVersion','Revision (usually bzr revision); guessed automatically unless specified',None),
('CPPPATH', 'Additional paths for the C preprocessor (colon-separated)','/usr/include/vtk-5.0:/usr/include/vtk-5.2:/usr/include/vtk-5.4:/usr/include/eigen2'), # hardy has vtk-5.0
('LIBPATH','Additional paths for the linker (colon-separated)',None),
('QTDIR','Directories where to look for qt3','/usr/share/qt3:/usr/lib/qt:/usr/lib/qt3:/usr/qt/3:/usr/lib/qt-3.3:/usr/share/qt4'),
('QT4DIR','Directory where Qt4 is installed','/usr/share/qt4'),
('PATH','Path (not imported automatically from the shell) (colon-separated)',None),
('CXX','The c++ compiler','g++'),
......@@ -166,14 +165,6 @@ if str(env['features'])=='all':
print 'ERROR: using "features=all" is illegal, since it breaks feature detection at runtime (SCons limitation). Write out all features separated by commas instead. Sorry.'
Exit(1)
if 'noqt3' in env['features']:
print 'WARNING: noqt3 feature is deprecated, use qt4 instead.'
if 'qt4' not in env['features']: env['features'].append('qt4')
if 'qt3' in env['features'] and 'qt4' in env['features']:
print 'ERROR: you specified both qt3 and qt4 features, which are mutually exclusive'
Exit(1)
opts.Save(optsFile,env)
# fix expansion in python substitution by assigning the right value if not specified
if not env.has_key('runtimePREFIX') or not env['runtimePREFIX']: env['runtimePREFIX']=env['PREFIX']
......@@ -259,22 +250,23 @@ if len(sys.argv)>1 and ('clean' in sys.argv) or ('tags' in sys.argv) or ('doc' i
# ensure non-None
env.Append(CPPPATH='',LIBPATH='',LIBS='',CXXFLAGS='',SHCCFLAGS='')
def CheckQt(context, qtdirs):
"Attempts to localize qt3 installation in given qtdirs. Sets necessary variables if found and returns True; otherwise returns False."
# make sure they exist and save them for restoring if a test fails
origs={'LIBS':context.env['LIBS'],'LIBPATH':context.env['LIBPATH'],'CPPPATH':context.env['CPPPATH']}
qtdirs=qtdirs[0].split()
for qtdir in qtdirs:
context.Message( 'Checking for qt-mt in '+qtdir+'... ' )
context.env['QTDIR']=qtdir
context.env.Append(LIBS='qt-mt',LIBPATH=qtdir+'/lib',CPPPATH=qtdir+'/include' )
ret=context.TryLink('#include<qapplication.h>\nint main(int argc, char **argv){QApplication qapp(argc, argv);return 0;}\n','.cpp')
context.Result(ret)
if not ret:
for k in origs.keys(): context.env[k]=origs[k]
else:
return ret
return False
if 0:
def CheckQt(context, qtdirs):
"Attempts to localize qt3 installation in given qtdirs. Sets necessary variables if found and returns True; otherwise returns False."
# make sure they exist and save them for restoring if a test fails
origs={'LIBS':context.env['LIBS'],'LIBPATH':context.env['LIBPATH'],'CPPPATH':context.env['CPPPATH']}
qtdirs=qtdirs[0].split()
for qtdir in qtdirs:
context.Message( 'Checking for qt-mt in '+qtdir+'... ' )
context.env['QTDIR']=qtdir
context.env.Append(LIBS='qt-mt',LIBPATH=qtdir+'/lib',CPPPATH=qtdir+'/include' )
ret=context.TryLink('#include<qapplication.h>\nint main(int argc, char **argv){QApplication qapp(argc, argv);return 0;}\n','.cpp')
context.Result(ret)
if not ret:
for k in origs.keys(): context.env[k]=origs[k]
else:
return ret
return False
def CheckCXX(context):
......@@ -348,7 +340,7 @@ def CheckPythonModules(context):
if not env.GetOption('clean'):
conf=env.Configure(custom_tests={'CheckLibStdCxx':CheckLibStdCxx,'CheckQt':CheckQt,'CheckCXX':CheckCXX,'CheckBoost':CheckBoost,'CheckPython':CheckPython,'CheckPythonModules':CheckPythonModules},
conf=env.Configure(custom_tests={'CheckLibStdCxx':CheckLibStdCxx,'CheckCXX':CheckCXX,'CheckBoost':CheckBoost,'CheckPython':CheckPython,'CheckPythonModules':CheckPythonModules}, # 'CheckQt':CheckQt
conf_dir='$buildDir/.sconf_temp',log_file='$buildDir/config.log'
)
ok=True
......@@ -364,6 +356,7 @@ if not env.GetOption('clean'):
env['haveForeach']=conf.CheckCXXHeader('boost/foreach.hpp','<>')
if not env['haveForeach']: print "(OK, local version will be used instead)"
ok&=conf.CheckCXXHeader('Eigen/Core')
ok&=conf.CheckCXXHeader('loki/NullType.h')
# for installable stript's shebang ( http://en.wikipedia.org/wiki/Shebang_(Unix) )
env['pyExecutable']=sys.executable
......@@ -379,13 +372,6 @@ if not env.GetOption('clean'):
ok=conf.CheckLibWithHeader('glut','GL/glut.h','c++','glutGetModifiers();',autoadd=1)
# TODO ok=True for darwin platform where openGL (and glut) is native
if not ok: featureNotOK('opengl')
if 'qt3' in env['features']:
ok=conf.CheckQt(env['QTDIR'])
if not ok: featureNotOK('opengl','Building with OpenGL implies qt3 interface, which was not found, although OpenGL was.')
env.Tool('qt'); env.Replace(QT_LIB='qt-mt')
ok=conf.CheckLibWithHeader(['qglviewer'],'QGLViewer/qglviewer.h','c++','QGLViewer();',autoadd=0)
if not ok: featureNotOK('opengl','Building with OpenGL implies the QGLViewer library installed (libqglviewer-qt3-dev package in debian/ubuntu)')
env['QGLVIEWER_LIB']='qglviewer-qt3';
if 'qt4' in env['features']:
env['ENV']['PKG_CONFIG_PATH']='/usr/bin/pkg-config'
env.Tool('qt4')
......
......@@ -26,13 +26,6 @@ void FileGenerator::setFileName(const string& fileName)
outputFileName=fileName;
}
#ifndef YADE_NO_YADE_SERIALIZATION
void FileGenerator::setSerializationLibrary(const string& lib)
{
serializationDynlib=lib;
}
#endif
bool FileGenerator::generate()
{
message="FileGenerator (base class) generates nothing.";
......
......@@ -20,12 +20,6 @@ class FileGenerator
{
protected :
shared_ptr<Scene> rootBody;
#ifndef YADE_NO_YADE_SERIALIZATION
string serializationDynlib;
public:
void setSerializationLibrary(const string& lib);
std::string getSerializationLibrary() {return serializationDynlib;};
#endif
public :
bool generateAndSave();
void setFileName(const string& fileName);
......@@ -44,9 +38,7 @@ class FileGenerator
YADE_CLASS_BASE_DOC_ATTRS_CTOR_PY(FileGenerator,Serializable,"Base class for scene generators, preprocessors.",
((string,outputFileName,"./scene.xml","Filename to write resulting simulation to")),
#ifndef YADE_NO_YADE_SERIALIZATION
/* ctor */ serializationDynlib="XMLFormatManager";
#endif
/*ctor*/
,
.def("generate",&FileGenerator::pyGenerate,(python::arg("out")),"Generate scene, save to given file")
.def("load",&FileGenerator::pyLoad,"Generate scene, save to temporary file and load immediately");
......
......@@ -13,10 +13,6 @@
#include"TimeStepper.hpp"
#include"ThreadRunner.hpp"
#include<yade/lib-base/Math.hpp>
#ifndef YADE_NO_YADE_SERIALIZATION
#include<yade/lib-serialization/IOFormatManager.hpp>
#include<yade/lib-serialization/FormatChecker.hpp>
#endif
#include<yade/lib-multimethods/FunctorWrapper.hpp>
#include<yade/lib-multimethods/Indexable.hpp>
#include<cstdlib>
......
......@@ -34,9 +34,10 @@
#include <iostream>
#include<yade/lib-base/Math.hpp>
#include<yade/lib-loki/Singleton.hpp>
#include<yade/lib-factory/ClassFactory.hpp>
#include<yade/lib-base/Singleton.hpp>
#include "SimulationFlow.hpp"
......
......@@ -2,7 +2,7 @@ Source: yade@_VERSION@
Section: x11
Priority: optional
Maintainer: Václav Šmilauer <eudoxos@arcig.cz>
Build-Depends: debhelper (>= 5), scons, freeglut3-dev, libboost-dev (>=1.35), libboost-date-time-dev (>=1.35), libboost-filesystem-dev (>=1.35), libboost-thread-dev (>=1.35), libboost-regex-dev (>=1.35), libboost-python-dev (>=1.35), libboost-iostreams-dev (>=1.35), libboost-program-options-dev, libboost-serialization-dev, liblog4cxx9-dev | liblog4cxx10-dev, docbook-to-man, ipython, libgts-dev, python-numpy, g++(>>4.0), libvtk5-dev, libgl1-mesa-dev, gdb, ipython, python-matplotlib, python-tk, libeigen2-dev, libqglviewer-qt4-dev @', binutils-gold' if DISTRIBUTION not in ('hardy','intrepid','jaunty','lenny') else ''@ @', texlive-latex-recommended, texlive-latex-extra, lmodern, texlive-pictures, texlive-xetex, python-sphinx, python-bibtex, graphviz, dvipng' if DISTRIBUTION not in ('hardy','intrepid','jaunty','lenny') else ''@, python-xlib, python-qt4, pyqt4-dev-tools
Build-Depends: debhelper (>= 5), scons, freeglut3-dev, libboost-dev (>=1.35), libboost-date-time-dev (>=1.35), libboost-filesystem-dev (>=1.35), libboost-thread-dev (>=1.35), libboost-regex-dev (>=1.35), libboost-python-dev (>=1.35), libboost-iostreams-dev (>=1.35), libboost-program-options-dev, libboost-serialization-dev, libloki-dev, liblog4cxx9-dev | liblog4cxx10-dev, docbook-to-man, ipython, libgts-dev, python-numpy, g++(>>4.0), libvtk5-dev, libgl1-mesa-dev, gdb, ipython, python-matplotlib, python-tk, libeigen2-dev, libqglviewer-qt4-dev @', binutils-gold' if DISTRIBUTION not in ('hardy','intrepid','jaunty','lenny') else ''@ @', texlive-latex-recommended, texlive-latex-extra, lmodern, texlive-pictures, texlive-xetex, python-sphinx, python-bibtex, graphviz, dvipng' if DISTRIBUTION not in ('hardy','intrepid','jaunty','lenny') else ''@, python-xlib, python-qt4, pyqt4-dev-tools
Standards-Version: 3.7.2
Package: yade@_VERSION@
......
......@@ -50,18 +50,19 @@ Yade relies on a number of external software to run; its installation is checked
* `eigen2 <http://eigen.tuxfamily.org>`_ algebra library
* `gdb <http://www.gnu.org/software/gdb>`_ debugger
* `sqlite3 <http://www.sqlite.org>`_ database engine
* `Loki <http://loki-lib.sf.net>`_ library
* `VTK <http://www.vtk.org/>`_ library (optional but recommended)
Most of the list above is very likely already packaged for your distribution. In Ubuntu, it can be all installed by the following command (cut&paste to the terminal)::
sudo apt-get install scons libqt3-mt-dev qt3-dev-tools freeglut3-dev \
sudo apt-get install scons freeglut3-dev libloki-dev \
libboost-date-time-dev libboost-filesystem-dev libboost-thread-dev \
libboost-regex-dev fakeroot dpkg-dev build-essential g++ \
libboost-iostreams-dev liblog4cxx10-dev python-dev libboost-python-dev ipython \
python-matplotlib libsqlite3-dev python-numeric python-tk gnuplot doxygen \
libgts-dev python-pygraphviz libvtk5-dev python-scientific bzr libeigen2-dev \
libqglviewer-qt3-dev binutils-gold python-xlib python-qt4 pyqt4-dev-tools \
libqglviewer-qt4-dev
binutils-gold python-xlib python-qt4 pyqt4-dev-tools \
libqglviewer-qt4-dev
Compilation
^^^^^^^^^^^
......
......@@ -14,56 +14,6 @@ if 'qt4' in env['features']:
])
env.Command('qt4/img_rc.py','qt4/img.qrc','pyrcc4 -o $buildDir/gui/qt4/img_rc.py gui/qt4/img.qrc')
env.Command('qt4/ui_controller.py','qt4/controller.ui','pyuic4 -o $buildDir/gui/qt4/ui_controller.py gui/qt4/controller.ui')
env.Command('qt4/ui_SeqSerializable.py','qt4/SeqSerializable.ui','pyuic4 -o $buildDir/gui/qt4/ui_SeqSerializable.py gui/qt4/SeqSerializable.ui')
env.Install('$PREFIX/lib/yade$SUFFIX/gui',[
env.SharedLibrary('GLViewer',['qt4/GLViewer.cpp'],LIBS=env['LIBS']+[env['QGLVIEWER_LIB']]+linkPlugins(['OpenGLRenderer']))
])
if 'opengl' in env['features'] and 'qt3' in env['features']:
env.Install('$PREFIX/lib/yade$SUFFIX/gui',[
env.SharedLibrary('QtGUI',
['qt3/FileDialog.cpp',
'qt3/GLViewer.cpp',
'qt3/MessageDialog.cpp',
'qt3/QtFileGenerator.cpp',
'qt3/QtGUI.cpp',
'qt3/QtGUIPreferences.cpp',
'qt3/SimulationController.cpp',
'qt3/YadeQtMainWindow.cpp',
'qt3/YadeCamera.cpp',
'qt3/QtGeneratedSimulationController.ui',
'qt3/QtGeneratedMessageDialog.ui',
'qt3/YadeQtGeneratedMainWindow.ui',
'qt3/QtFileGeneratorController.ui'],
LIBS=[# 'PythonUI',
'yade-serialization-qt',
linkPlugins(['GravityEngines','OpenGLRenderer']),
env['QGLVIEWER_LIB']
],
CPPPATH=env['CPPPATH']+['qt3']
),
env.SharedLibrary('SnapshotEngine',['qt3/SnapshotEngine.cpp'],LIBS=env['LIBS']+['QtGUI','qglviewer-qt3']+linkPlugins(['PeriodicEngines']),CPPPATH=env['CPPPATH']+['qt3']),
])
env.Install('$PREFIX/lib/yade$SUFFIX/py/yade',[
env.SharedLibrary('_qt',['qt3/QtGUI-python.cpp'],SHLIBPREFIX='',LIBS=['QtGUI'],CPPPATH=env['CPPPATH']+[env['buildDir']+'/gui/qt3']), # CPPPATH is for files generated by moc which are indirectly included
env.File('qt.py','qt3'),
])
#
# HACK that works around
# https://bugs.launchpad.net/yade/+bug/406343
# https://bugs.launchpad.net/yade/+bug/582679
# Not clear why scons is not picking up the dependency automatically
# Do not remove.
#
srcs=['FileDialog','GLViewer','MessageDialog','QtFileGenerator','QtGUI','QtGUIPreferences','SimulationController','YadeQtMainWindow','YadeCamera']
uis=['QtGeneratedSimulationController','QtGeneratedMessageDialog','YadeQtGeneratedMainWindow', 'QtFileGeneratorController']
import os.path
for ui in uis:
if os.path.exists(env.subst('$buildDir/gui/qt3/%s.h'%ui)): continue
for s in srcs:
env.AddPreAction('$buildDir/gui/qt3/%s.os'%s,'$QT_UIC -o $buildDir/gui/qt3/%s.h gui/qt3/%s.ui'%(ui,ui))
/*************************************************************************
* Copyright (C) 2004 by Olivier Galizzi *
* olivier.galizzi@imag.fr *
* *
* This program is free software; it is licensed under the terms of the *
* GNU General Public License v2 or later. See file LICENSE for details. *
*************************************************************************/
#include "FileDialog.hpp"
#ifndef __GXX_EXPERIMENTAL_CXX0X__
# include<boost/shared_ptr.hpp>
using boost::shared_ptr;
#else
# include<memory>
using std::shared_ptr;
#endif
FileDialog::FileDialog (const QString& directory,const QString& filters,const string& caption,QWidget* parent) : QFileDialog(directory,filters,parent,"FileDialog",false)
{
setCaption(caption);
if(parent){
QSize s1 = parent->size();
QSize s2 = size();
QSize s = s1-s2;
reparent(parent,QPoint(s.width()/2,s.height()/2));
}
show();
}
FileDialog::~FileDialog ()
{
}
string FileDialog::getOpenFileName(const string& directory,const vector<string>& filters,const string& caption,QWidget* parent,string& selectedFilter )
{
const QString d(directory);
const QString f(filters[0]);
shared_ptr<FileDialog> fd = shared_ptr<FileDialog>(new FileDialog(d,f,caption,parent));
for(size_t i = 1 ; i<filters.size() ; ++i)
fd->addFilter(filters[i]);
int res=fd->exec();
selectedFilter = fd->selectedFilter().data();
return res==QDialog::Accepted?fd->selectedFile().data():std::string("");
}
string FileDialog::getSaveFileName(const string& directory,const vector<string>& filters,const string& caption,QWidget* parent,string& selectedFilter )
{
const QString d(directory);
const QString f(filters[0]);
shared_ptr<FileDialog> fd = shared_ptr<FileDialog>(new FileDialog(d,f,caption,parent));
fd->setMode( QFileDialog::AnyFile );
for(size_t i = 1 ; i<filters.size() ; ++i)
fd->addFilter(filters[i]);
int res=fd->exec();
selectedFilter = fd->selectedFilter().data();
return res==QDialog::Accepted?fd->selectedFile().data():std::string("");
}
string FileDialog::getExistingDirectory ( const string& directory,const string& caption,QWidget* parent)
{
const QString d(directory.c_str());
shared_ptr<FileDialog> fd = shared_ptr<FileDialog>(new FileDialog(d,"",caption,parent));
fd->setMode( QFileDialog::DirectoryOnly );
int res=fd->exec();
return res==QDialog::Accepted?fd->selectedFile().data():std::string("");
}
/*************************************************************************
* Copyright (C) 2004 by Olivier Galizzi *
* olivier.galizzi@imag.fr *
* *
* This program is free software; it is licensed under the terms of the *
* GNU General Public License v2 or later. See file LICENSE for details. *
*************************************************************************/
#pragma once
#include <string>
#include <qfiledialog.h>
#include <qstring.h>
#include <vector>
using namespace std;
class FileDialog : public QFileDialog
{
public :
FileDialog (const QString& directory,const QString& filters,const string& caption,QWidget* parent);
virtual ~FileDialog ();
static string getOpenFileName(const string& directory,const vector<string>& filters,const string& caption,QWidget* parent,string& selectedFilter );
static string getSaveFileName(const string& directory,const vector<string>& filters,const string& caption,QWidget* parent,string& selectedFilter );
static string getExistingDirectory ( const string& directory,const string& caption,QWidget* parent);
};
This diff is collapsed.
<!DOCTYPE CW><CW>
<customwidgets>
<customwidget>
<class>GLViewer</class>
<header location="local">GLViewer.hpp</header>
<signal> closeSignal(int) </signal>
</customwidget>
</customwidgets>
</CW>
// Copyright (C) 2004 by Olivier Galizzi, Janek Kozicki *
// © 2008 Václav Šmilauer
#pragma once
#include<yade/core/Omega.hpp>
#include<yade/pkg-common/OpenGLRenderer.hpp>
#include<QGLViewer/qglviewer.h>
#include<QGLViewer/constraint.h>
#include"YadeQtMainWindow.hpp"
#include<boost/date_time/posix_time/posix_time.hpp>
#include<set>
/*! Class handling user interaction with the openGL rendering of simulation.
*
* Clipping planes:
* ================
*
* Clipping plane is manipulated after hitting F1, F2, .... To end the manipulation, press Escape.
*
* Keystrokes during clipping plane manipulation:
* * space activates/deactives the clipping plane
* * x,y,z aligns the plane with yz, xz, xy planes
* * left-double-click aligns the plane with world coordinates system (canonical planes + 45˚ interpositions)
* * 1,2,... will align the current plane with #1, #2, ... (same orientation)
* * r reverses the plane (normal*=-1)a
*
* Keystrokes that work regardless of whether a clipping plane is being manipulated:
* * Alt-1,Alt-2,... adds/removes the respective plane to bound group:
* mutual positions+orientations of planes in the group are maintained when one of those planes is manipulated
*
* Clip plane number is 3; change YADE_RENDERER_NUM_CLIP_PLANE, complete switches "|| ..." in keyPressEvent
* and recompile to have more.
*/
class GLViewer : public QGLViewer
{
Q_OBJECT
friend class QGLThread;
protected:
shared_ptr<OpenGLRenderer> renderer;
private :
bool isMoving;
bool wasDynamic;
float cut_plane;
int cut_plane_delta;
bool grid_subdivision;
int manipulatedClipPlane;
set<int> boundClipPlanes;
shared_ptr<qglviewer::LocalConstraint> xyPlaneConstraint;
string strBoundGroup(){string ret;FOREACH(int i, boundClipPlanes) ret+=" "+lexical_cast<string>(i+1);return ret;}
boost::posix_time::ptime last_user_event;
public:
virtual void updateGL(void);
void centerMedianQuartile();
bool drawGridXYZ[3];
bool drawScale;
int timeDispMask;
enum{TIME_REAL=1,TIME_VIRT=2,TIME_ITER=4};
GLViewer (int id, shared_ptr<OpenGLRenderer> _renderer, QWidget * parent=0, QGLWidget * shareWidget=0);
virtual ~GLViewer();
virtual void paintGL();
virtual void draw();
virtual void drawWithNames();
void centerScene();
void centerPeriodic();
void mouseMovesCamera();
void mouseMovesManipulatedFrame(qglviewer::Constraint* c=NULL);
void resetManipulation();
bool isManipulating();
void startClipPlaneManipulation(int planeNo);
//! get QGLViewer state as string (XML); QGLViewer normally only supports saving state to file.
string getState();
//! set QGLViewer state from string (XML); QGLVIewer normally only supports loading state from file.
void setState(string);
//! Load display parameters (QGLViewer and OpenGLRenderer) from Scene::dispParams[n] and use them
void useDisplayParameters(size_t n);
//! Save display parameters (QGOViewer and OpenGLRenderer) to Scene::dispParams[n]
void saveDisplayParameters(size_t n);
//! Get radius of the part of scene that fits the current view
float displayedSceneRadius();
//! Get center of the part of scene that fits the current view
qglviewer::Vec displayedSceneCenter();
//! Adds our attributes to the QGLViewer state that can be saved
QDomElement domElement(const QString& name, QDomDocument& document) const;
//! Adds our attributes to the QGLViewer state that can be restored
void initFromDOMElement(const QDomElement& element);
int viewId;
// if defined, snapshot will be saved to this file right after being drawn and the string will be reset.
// this way the caller will be notified of the frame being saved successfully.
string nextFrameSnapshotFilename;
#ifdef YADE_GL2PS
// output stream for gl2ps; initialized as needed
FILE* gl2psStream;
#endif
boost::posix_time::ptime getLastUserEvent();
DECLARE_LOGGER;
protected :
virtual void keyPressEvent(QKeyEvent *e);
virtual void postDraw();
// overridden in the player that doesn't get time from system clock but from the db
virtual string getRealTimeString();
virtual void closeEvent(QCloseEvent *e);
virtual void postSelection(const QPoint& point);
virtual void endSelection(const QPoint &point);
virtual void mouseDoubleClickEvent(QMouseEvent *e);
virtual void wheelEvent(QWheelEvent* e);
virtual void mouseMoveEvent(QMouseEvent *e);
virtual void mousePressEvent(QMouseEvent *e);
};
/*! Get unconditional lock on a GL view.
Use if you need to manipulate GL context in some way.
The ctor doesn't return until the lock has been acquired
and the lock is released when the GLLock object is desctructed;
*/
class GLLock: public boost::try_mutex::scoped_lock{
GLViewer* glv;
public:
GLLock(GLViewer* _glv);
~GLLock();
};
/*************************************************************************
* Copyright (C) 2004 by Olivier Galizzi *
* olivier.galizzi@imag.fr *
* Copyright (C) 2004 by Janek Kozicki *
* cosurgi@berlios.de *
* *
* This program is free software; it is licensed under the terms of the *
* GNU General Public License v2 or later. See file LICENSE for details. *
*************************************************************************/
#include "MessageDialog.hpp"
#include <qtextedit.h>
#include <iostream>
#include <qpushbutton.h>
using namespace std;
MessageDialog::MessageDialog (const string& message,QWidget* parent, const char* name, bool modal, WFlags fl) : QtGeneratedMessageDialog(parent,name,modal,fl)
{
teMessage->setText(message.c_str());
// I have fixed Message dialog, so it is using layouts now, and it is better, because you can resize it, and size of the content chages correctly
// teMessage->adjustSize();
// teMessage->move(10,10);
// resize(teMessage->size().width()+20,teMessage->size().height()+30+pbOk->size().height());
// pbOk->move((size().width()-pbOk->size().width())/2,teMessage->size().height()+20);
if(parent){
QSize s1 = parent->size();
QSize s2 = size();
QSize s = s1-s2;
reparent(parent,QPoint(s.width()/2,s.height()/2));
}
show();
startTimer(10);
}
MessageDialog::~MessageDialog ()
{
}
void MessageDialog::pbOkClicked()
{
emit close();
}
void MessageDialog::closeEvent(QCloseEvent * evt)
{
QtGeneratedMessageDialog::closeEvent(evt);
}