54 float MaxY = MaxX * _sizeY/(float)_sizeX ;
58 MaxX *= 7000/(float)MaxY ;
62 return int(0.5f + x/_sizeX*MaxX) ;
68 float MaxY = MaxX * _sizeY/(float)_sizeX ;
72 MaxX *= 7000/(float)MaxY ;
76 return int(0.5f + (1.0 - y/_sizeY)*MaxY) ;
81 float intensity = 0.3f*red+0.6f*green+0.1f*blue ;
83 return int(intensity * 20.0) ;
92 out <<
"#FIG 3.2\nPortrait\nCenter\nInches\nLetter\n100.00\nSingle\n0\n1200 2\n";
94 _sizeX = int(0.5f + _xmax - _xmin) ;
95 _sizeY = int(0.5f + _ymax - _ymin) ;
105 out <<
"2 1 0 5 0 7 " << (_depth--) <<
" 0 -1 0.000 0 1 -1 0 0 1\n";
107 out <<
"\t " << FigCoordX(P->
vertex(0)[0]) <<
" " << FigCoordY(P->
vertex(0)[1]) <<
"\n";
108 if(_depth > 0) _depth = 0 ;
117 GLfloat dr, dg, db, absR, absG, absB, colormax;
119 GLdouble xstep, ystep;
120 GLfloat rstep, gstep, bstep;
121 GLdouble xnext, ynext, distance;
122 GLfloat rnext, gnext, bnext;
125 dg = P2.green() - P1.
green();
126 db = P2.blue() - P1.
blue();
128 if (dr != 0 || dg != 0 || db != 0)
132 dx = P2.x() - P1.
x();
133 dy = P2.y() - P1.
y();
135 distance = sqrt(dx * dx + dy * dy);
141 colormax = max(absR, max(absG, absB));
160 xnext -= xstep / 2.0;
161 ynext -= ystep / 2.0;
162 rnext -= rstep / 2.0f;
163 gnext -= gstep / 2.0f;
164 bnext -= bstep / 2.0f;
172 out <<
"2 1 0 1 0 7 " << (_depth--) <<
" 0 -1 0.000 0 0 -1 0 0 2\n";
173 out <<
"\t " << FigCoordX(P1.
x()) <<
" " << FigCoordY(P1.
y());
175 out <<
" " << FigCoordX(P2.x()) <<
" " << FigCoordY(P2.y())<<
"\n";
176 if(_depth > 0) _depth = 0 ;
182 GLfloat red, green, blue;
194 for(
int i = 0; i < nvertices; i++)
208 out <<
"2 3 0 0 0 7 " << (_depth--) <<
" 0 20 0.000 0 0 -1 0 0 " << (nvertices+1) <<
"\n";
210 out <<
"2 3 0 0 0 7 " << (_depth--) <<
" 0 " << (FigGrayScaleIndex(red,green,blue)) <<
" 0.000 0 0 -1 0 0 " << (nvertices+1) <<
"\n";
216 for (
int j = 0; j < nvertices; j++)
222 if(_depth > 0) _depth = 0 ;
int FigCoordY(double) const
virtual void spewPolygone(const Polygone *, QTextStream &out)
virtual const Vector3 & vertex(size_t) const
virtual void spewSegment(const Segment *, QTextStream &out)
virtual const Feedback3DColor & sommet3DColor(size_t) const
int FigGrayScaleIndex(float red, float green, float blue) const
int FigCoordX(double) const
virtual size_t nbVertices() const
virtual void writeFooter(QTextStream &out) const
virtual void spewPoint(const Point *, QTextStream &out)
#define EPS_SMOOTH_LINE_FACTOR
virtual void writeHeader(QTextStream &out) const
virtual const Feedback3DColor & sommet3DColor(size_t i) const