47 #include "../qglviewer.h"
50 #include <QMessageBox>
57 _xmin=_xmax=_ymin=_ymax=_zmin=_zmax = 0.0 ;
61 void Exporter::exportToFile(
const QString& filename,
62 const vector<PtrPrimitive>& primitive_tab,
67 if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
68 QMessageBox::warning(NULL, QGLViewer::tr(
"Exporter error",
"Message box window title"), QGLViewer::tr(
"Unable to open file %1.").arg(filename));
72 QTextStream out(&file);
76 unsigned int N = primitive_tab.size()/200 + 1 ;
78 for(
unsigned int i=0;i<primitive_tab.size();++i)
80 Point *p =
dynamic_cast<Point *
>(primitive_tab[i]) ;
84 if(p != NULL) spewPoint(p,out) ;
85 if(s != NULL) spewSegment(s,out) ;
86 if(P != NULL) spewPolygone(P,out) ;
89 vparams.progress(i/(
float)primitive_tab.size(),QGLViewer::tr(
"Exporting to file %1").arg(filename)) ;
97 void Exporter::setBoundingBox(
float xmin,
float ymin,
float xmax,
float ymax)
105 void Exporter::setClearColor(
float r,
float g,
float b) { _clearR=r; _clearG=g; _clearB=b; }
106 void Exporter::setClearBackground(
bool b) { _clearBG=b; }
107 void Exporter::setBlackAndWhite(
bool b) { _blackAndWhite = b; }