45 #ifndef _VRENDER_EXPORTER_H
46 #define _VRENDER_EXPORTER_H
50 #include "Primitive.h"
52 #include "../config.h"
53 #include <QTextStream>
65 virtual void exportToFile(
const QString& filename,
const std::vector<PtrPrimitive>&,
VRenderParams&) ;
67 void setBoundingBox(
float xmin,
float ymin,
float xmax,
float ymax) ;
68 void setClearColor(
float r,
float g,
float b) ;
69 void setClearBackground(
bool b) ;
70 void setBlackAndWhite(
bool b) ;
73 virtual void spewPoint(
const Point *, QTextStream& out) = 0 ;
74 virtual void spewSegment(
const Segment *, QTextStream& out) = 0 ;
75 virtual void spewPolygone(
const Polygone *, QTextStream& out) = 0 ;
77 virtual void writeHeader(QTextStream& out)
const = 0 ;
78 virtual void writeFooter(QTextStream& out)
const = 0 ;
80 float _clearR,_clearG,_clearB ;
84 GLfloat _xmin,_xmax,_ymin,_ymax,_zmin,_zmax ;
86 bool _clearBG,_blackAndWhite ;
98 virtual void spewPoint(
const Point *, QTextStream& out) ;
99 virtual void spewSegment(
const Segment *, QTextStream& out) ;
100 virtual void spewPolygone(
const Polygone *, QTextStream& out) ;
102 virtual void writeHeader(QTextStream& out)
const ;
103 virtual void writeFooter(QTextStream& out)
const ;
106 void setColor(QTextStream& out,
float,
float,
float) ;
108 static const double EPS_GOURAUD_THRESHOLD ;
109 static const char *GOURAUD_TRIANGLE_EPS[] ;
110 static const char *CREATOR ;
112 static float last_r ;
113 static float last_g ;
114 static float last_b ;
125 virtual void writeFooter(QTextStream& out)
const ;
135 virtual void spewPoint(
const Point *, QTextStream& out) ;
136 virtual void spewSegment(
const Segment *, QTextStream& out) ;
137 virtual void spewPolygone(
const Polygone *, QTextStream& out) ;
139 virtual void writeHeader(QTextStream& out)
const ;
140 virtual void writeFooter(QTextStream& out)
const ;
147 int FigCoordX(
double)
const ;
148 int FigCoordY(
double)
const ;
149 int FigGrayScaleIndex(
float red,
float green,
float blue)
const ;
155 virtual void spewPoint(
const Point *, QTextStream& out) ;
156 virtual void spewSegment(
const Segment *, QTextStream& out) ;
157 virtual void spewPolygone(
const Polygone *, QTextStream& out) ;
159 virtual void writeHeader(QTextStream& out)
const ;
160 virtual void writeFooter(QTextStream& out)
const ;