61 #include "QtBaseViewer.hh"
62 #include "QtGLGraphicsScene.hh"
63 #include "QtGLGraphicsView.hh"
65 #include <QApplication>
68 #include <QFileDialog>
93 qApp->processEvents();
101 QString fname = fi.path() + QDir::separator() +fi.baseName() +
"." + QString::number(
snapshotCounter_).rightJustified(7,
'0') +
".";
103 QString format=
"png";
105 if (fi.completeSuffix() ==
"ppm")
110 bool rval=
snapshot_->save(fname,format.toUpper().toLatin1());
113 assert(statusbar_!=0);
116 statusbar_->showMessage(QString(
"snapshot: ")+fname,5000);
117 if ( action_[
"SnapshotSavesView"]->isChecked() )
120 QFile f(fname+
".view"); f.open(QIODevice::WriteOnly|QIODevice::Truncate);
121 QTextStream sf(&f); sf << view; f.close();
126 statusbar_->showMessage(QString(
"could not save snapshot to ")+fname);
148 fname.replace(
'%',
'$');
149 fname = QFileDialog::getSaveFileName ( 0,
"Save snapshot name" );
150 if (!fname.isEmpty())
152 fname.replace(
'$',
'%');
155 assert(statusbar_!=0);
156 QString msg=
"next snapshot: ";
157 statusbar_->showMessage(msg);
Namespace providing different geometric functions concerning angles.
unsigned int glWidth() const
get width of QGLWidget
void actionSnapshotName()
virtual void paintGL()
draw the scene. Triggered by updateGL().
void actionSnapshotSavesView()
virtual void makeCurrent()
Makes this widget the current widget for OpenGL operations.
void encodeView(QString &_view)
convert current view to text representation
virtual void snapshotBaseFileName(const QString &_fname)
unsigned int glHeight() const
get height of QGLWidget
void copyToImage(QImage &_image, GLenum _buffer=GL_BACK)
copy current framebuffer to an QImage