47 #include "../qglviewer.h" 49 #if QT_VERSION >= 0x040000 51 # include <QMessageBox> 54 # include <qmessagebox.h> 62 _xmin=_xmax=_ymin=_ymax=_zmin=_zmax = 0.0 ;
67 const vector<PtrPrimitive>& primitive_tab,
72 #if QT_VERSION >= 0x040000 73 if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
75 if (!file.open(IO_WriteOnly | IO_Translate)) {
77 QMessageBox::warning(NULL, QGLViewer::tr(
"Exporter error",
"Message box window title"), QGLViewer::tr(
"Unable to open file %1.").arg(filename));
81 QTextStream out(&file);
85 unsigned int N = primitive_tab.size()/200 + 1 ;
87 for(
unsigned int i=0;i<primitive_tab.size();++i)
89 Point *p =
dynamic_cast<Point *
>(primitive_tab[i]) ;
93 if(p != NULL) spewPoint(p,out) ;
94 if(s != NULL) spewSegment(s,out) ;
95 if(P != NULL) spewPolygone(P,out) ;
98 vparams.
progress(i/(
float)primitive_tab.size(),QGLViewer::tr(
"Exporting to file %1").arg(filename)) ;
void setClearColor(float r, float g, float b)
void setClearBackground(bool b)
void setBoundingBox(float xmin, float ymin, float xmax, float ymax)
void setBlackAndWhite(bool b)
void progress(float, const QString &)
virtual void exportToFile(const QString &filename, const std::vector< PtrPrimitive > &, VRenderParams &)