36#define STRDUP(str) ((str) != NULL ? (::strcpy((char*)::malloc((unsigned)::strlen(str) + 1), str)) : (char*)NULL)
37#define STRDEL(str) {if((str)!=NULL) {::free(str);str=NULL;}}
47#define METAFILE_DEFAULT "out.ps"
48#define METAFILE_SCALE 1.
50static char* GetDate();
51static double ConvertRGB_ToGrey(
double,
double,
double);
67 fParams.shade = Color;
71 fParams.lineWidth = -1.;
72 fBufferPointer[0] =
'\0';
74 ::setlocale(LC_NUMERIC,
"USA");
84 if(fBufferString!=NULL)
::free(fBufferString);
87 ::printf(
"SbPainterPS : bad gsave/grestore balance : %d.\n",fGSave);
99 if(fFile==NULL)
return;
110 if(fFile==NULL)
return;
124 if(fFile==NULL)
return;
130void SbPainterPS::drawPrimitive (
131 SbPrimitiveType aType
136,const SbPainterContext& aAtb
141 if(fFile==NULL) return;
143 case SbPrimitivePoints:
146 aAtb.fRed,aAtb.fGreen,aAtb.fBlue,
147 aAtb.fMarkerStyle,aAtb.fMarkerSize);
149 case SbPrimitiveLineStrip:
150 case SbPrimitiveLineLoop:
153 aAtb.fRed,aAtb.fGreen,aAtb.fBlue,
154 aAtb.fLineStyle,aAtb.fLineWidth);
156 case SbPrimitivePolygon:
159 aAtb.fRed,aAtb.fGreen,aAtb.fBlue,
167void SbPainterPS::drawPolygon(
174,const SbAreaStyle& //aStyle
179 if(fFile==NULL) return;
180 if(aPointn<=0) return;
181 putNewPathInStream();
182 putMoveInStream(aXs[0],aYs[0]);
183 for(int count=1;count<aPointn;count++) {
184 putLineToInStream(aXs[count] - aXs[count-1],
185 aYs[count] - aYs[count-1]);
187 if ( (aXs[0]==aXs[aPointn-1]) &&
188 (aYs[0]==aYs[aPointn-1]) )
189 putClosePathInStream();
190 putRGB_InStream(aRed,aGreen,aBlue);
194void SbPainterPS::drawLines(
201,const SbLineStyle& aStyle
207 if(fFile==NULL) return;
208 if(aPointn<=0) return;
209 putMoveInStream(aXs[0],aYs[0]);
210 for(int count=1;count<aPointn;count++) {
211 putLineToInStream(aXs[count] - aXs[count-1],
212 aYs[count] - aYs[count-1]);
214 if ( (aXs[0]==aXs[aPointn-1]) &&
215 (aYs[0]==aYs[aPointn-1]) )
216 putClosePathInStream();
217 putRGB_InStream(aRed,aGreen,aBlue);
218 putLineWidthInStream(aWidth);
220 putLineStyleInStream(aStyle);
224void SbPainterPS::drawMarkers (
231,const SbMarkerStyle& aStyle
237 if(fFile==NULL) return;
238 float mark_size = (float)(aSize <=0 ? 1. : aSize);
240 if(aStyle==SbMarkerCircleLine) {
241 putNewPathInStream();
243 for(int count=0;count<aPointn;count++) {
244 putCircleInStream(aXs[count],aYs[count],mark_size);
245#define MAX_PATH_POINT 100
246 if(icount==MAX_PATH_POINT) {
247 putRGB_InStream(aRed,aGreen,aBlue);
248 putLineWidthInStream(1);
252 if(count!=aPointn-1) putNewPathInStream();
257 putRGB_InStream(aRed,aGreen,aBlue);
258 putLineWidthInStream(1);
262 putNewPathInStream();
264 for(int count=0;count<aPointn;count++) {
265 putMoveInStream(aXs[count],aYs[count]);
266 putMarkerSizeInStream(mark_size);
267 putMarkerStyleInStream(aStyle);
268 if(icount==MAX_PATH_POINT) {
269 putRGB_InStream(aRed,aGreen,aBlue);
270 putLineWidthInStream(1);
274 if(count!=aPointn-1) putNewPathInStream();
279 putRGB_InStream(aRed,aGreen,aBlue);
280 putLineWidthInStream(1);
296 fParams.shade = aShade;
305 fParams.portrait = aPortrait;
314 fParams.doBack = aDoback;
323 if( (aNbit==2) || (aNbit==4) || (aNbit==8) )
324 fParams.nbit = aNbit;
335 fParams.lineWidth = (float)aWidth;
347 fFileName =
STRDUP(aString);
373 if( (aString==NULL) || (*aString==
'\0') ) {
374 if( (fFileName==NULL) || (*fFileName==
'\0') ) {
379 fFile = ::fopen(fFileName,
"wb");
382 fFile = ::fopen(aString,
"wb");
384 fFileName =
STRDUP(aString);
386 if(fFile==NULL)
return;
392 printFLN (
"%%!PS-Adobe-2.0");
393 printFLN (
"%%%%Creator: HEPVis::SbPainterPS.");
394 printFLN(
"%%%%CreationDate: %s",GetDate());
395 printFLN(
"%%%%Title: %s",fFileName);
396 printFLN(
"%%%%Pages: (atend)");
397 printFLN(
"%%%%BoundingBox: 0 0 %d %d",
398 (
int)fDeviceWidth,(
int)fDeviceHeight);
399 printFLN(
"%%%%DocumentFonts: Courier-Bold");
400 printFLN(
"%%%%DocumentPaperSizes: a4");
401 printFLN(
"%%%%EndComments");
405 putInStreamF(
"/n {newpath} def ");
406 putInStreamF(
"/cl {closepath} def ");
407 putInStreamF(
"/s {stroke} def ");
408 putInStreamF(
"/f {fill} def ");
410 putInStreamF(
"/m {moveto} def ");
411 putInStreamF(
"/rm {rmoveto} def ");
412 putInStreamF(
"/rl {rlineto} def ");
414 putInStreamF(
"/lc {setlinecap} def ");
415 putInStreamF(
"/lw {setlinewidth} def ");
416 putInStreamF(
"/rgb {setrgbcolor} def ");
417 putInStreamF(
"/ss {[] 0 setdash} def ") ;
418 putInStreamF(
"/sd {[12 6] 0 setdash} def ");
419 putInStreamF(
"/so {[6 12] 0 setdash} def ");
420 putInStreamF(
"/sdo {[18 12 6 12] 0 setdash} def ");
423 putInStreamF(
"/ms 2. def /msi .5 def ");
424 putInStreamF(
"/cross {ms ms scale -1. -1. rm ");
425 putInStreamF(
"2. 2. rl 0. -2. rm -2. 2. rl msi msi scale} def ");
426 putInStreamF(
"/plus {ms ms scale -1. 0. rm 2. 0. rl ");
427 putInStreamF(
"-1. 1. rm 0. -2. rl msi msi scale} def ");
428 putInStreamF(
"/asterisk {ms ms scale -1. 0. rm 2. 0. rl -1. 1. rm ");
429 putInStreamF(
"0. -2. rl 0. 1. rm -0.707 -0.707 rm 1.414 1.414 rl ");
430 putInStreamF(
"0. -1.414 rm -1.414 1.414 rl msi msi scale} def ");
431 putInStreamF(
"/triangle {ms ms scale 0. 1. rm -0.6 -1.5 rl ");
432 putInStreamF(
"1.2 0. rl -0.6 1.5 rl msi msi scale} def ");
434 putInStreamF(
"/sh {show} def ");
435 putInStreamF(
"/df {/Courier-Bold findfont} def ");
436 putInStreamF(
"/mf {makefont setfont} def ");
437 printFLN(
"%%%%EndProlog");
445 if(fFile==NULL)
return;
447 printFLN(
"%%%%Trailer");
448 printFLN(
"%%%%Pages: %d",fPageNumber);
450 if(fFile!=NULL) ::fclose(fFile);
456void SbPainterPS::putInStreamF(
463 if(fFile==NULL)
return;
465 va_start(args,aFormat);
466 printV(aFormat,args);
468 int length = (int)strlen(fBufferString);
470 ::printf(
"SoPostScript::putInStreamF overflow\n");
473 int nlength = fBufferCount + length;
475 fBufferPointer[fBufferCount] =
'\0';
476 if(::fprintf(fFile,
"%s\n",(
char*)fBufferPointer)<0) {
477 ::printf(
"SoPostScript::putInStreamF fprintf error\n");
482 unsigned char* pointer = fBufferPointer + fBufferCount;
483 ::strcpy((
char*)pointer,fBufferString);
484 fBufferCount = nlength;
487void SbPainterPS::printFLN(
494 if(fFile==NULL)
return;
496 va_start(args,aFormat);
497 printV(aFormat,args);
501 fBufferPointer[fBufferCount] =
'\0';
502 if(::fprintf (fFile,
"%s\n",(
char*)fBufferPointer)<0) {
503 ::printf(
"SbPainterPS::printFLN fprintf error\n");
508 if(::fprintf (fFile,
"%s\n",fBufferString)<0) {
509 ::printf(
"SbPainterPS::printFLN fprintf error\n");
513void SbPainterPS::printV(
521 if(fBufferString==NULL) {
522 fBufferString = (
char*)::malloc(
MAX_STR *
sizeof(
char));
523 if(fBufferString==NULL)
return;
525 fBufferString[
MAX_STR-1] =
'\0';
526 ::vsnprintf(fBufferString,
MAX_STR-1, This,aArgs);
527 if(fBufferString[
MAX_STR-1]!=
'\0') {
528 ::printf(
"SbPainterPS::printV overflow\n");
529 fBufferString[0] =
'\0';
543 if(aWidth <=0.) aWidth = 100.;
544 if(aHeight<=0.) aHeight = 100.;
548 (
float)(fDeviceHeight/30.));
551 if(fDeviceWidth<=fDeviceHeight)
552 scale = (aHeight<=aWidth ?
553 fDeviceWidth /aWidth : fDeviceWidth /aHeight );
555 scale = (aHeight<=aWidth ?
556 fDeviceHeight /aWidth : fDeviceHeight /aHeight );
559 if(fParams.portrait==1) {
560 xtra = (fDeviceWidth - scale * aWidth)/2;
561 ytra = (fDeviceHeight - scale * aHeight)/2;
565 xtra = (fDeviceHeight - scale * aWidth)/2;
566 ytra = (fDeviceWidth - scale * aHeight)/2;
581 putInStreamF(
"gsave ");
590 putInStreamF(
"grestore ");
601 putInStreamF(
"%.2f %.2f translate ",aX,aY);
611 putInStreamF(
"%.2f %.2f scale ",aX,aY);
620 printFLN(
"%%%%Page: %d %d",fPageNumber,fPageNumber);
629 putInStreamF(
"showpage ");
641 if(fParams.shade==Color)
642 putInStreamF(
"%.2f %.2f %.2f rgb ",aR,aG,aB);
643 else if(fParams.shade==Grey)
644 putInStreamF(
"%.2f setgray ",convertRGB_ToGrey(aR,aG,aB));
645 else if(fParams.shade==BlackWhite)
646 putInStreamF(
"0. setgray ",convertRGB_ToGrey(aR,aG,aB));
655 if(fParams.lineWidth<0.) {
657 putInStreamF(
"%.1f lw ",0.5);
659 putInStreamF(
"%.1f lw ",(
float)(aWidth));
662 putInStreamF(
"%.1f lw ",fParams.lineWidth);
672 if(aSize==fMarkerSize)
return;
674 putInStreamF(
"/ms %g def /msi %g def ",aSize,1./aSize);
678void SbPainterPS::putMarkerStyleInStream (
686 putInStreamF("plus ");
688 case SbMarkerAsterisk:
690 putInStreamF("asterisk ");
693 putInStreamF("cross ");
695 case SbMarkerTriangleUpLine:
696 putInStreamF("triangle ");
699 putLineToInStream(0.,0.);
722 if(fParams.doBack==1) {
730 putInStreamF(
"clip ");
757float SbPainterPS::convertRGB_ToGrey (
765 return (0.3F * aRed + 0.59F * aGreen + 0.11F * aBlue);
774 putInStreamF(
"%.2f rotate ",aX);
815 putInStreamF(
"%1d lc ",aX);
825 putInStreamF (
"%.2f %.2f rl ",aX,aY);
835 putInStreamF (
"%.2f %.2f m ",aX,aY);
846 putInStreamF(
"%.2f %.2f %.2f 0 360 arc s ",aX,aY,aR);
850void SbPainterPS::putLineStyleInStream(
857 case SbLineSolid:putInStreamF("ss ") ;break;
858 case SbLineDashed:putInStreamF("sd ") ;break;
859 case SbLineDotted:putInStreamF("so ") ;break;
860 case SbLineDashDotted:putInStreamF("sdo ");break;
872,GetRGB_Function aProc
877 if((aWidth<=0)||(aHeight<=0))
return;
881 putInStreamF (
"%d %d scale ", aWidth, aHeight );
884 unsigned int row,col,col_max;
886 typedef unsigned char Uchar;
887 Uchar red,green,blue,b;
888 if(fParams.shade!=0) {
889 putInStreamF (
"/picstr %d string def ",aWidth);
890 putInStreamF (
"%d %d %d ",aWidth,aHeight,8);
891 putInStreamF (
"[ %d 0 0 -%d 0 %d ] ",aWidth,aHeight,aHeight);
892 putInStreamF (
"{ currentfile picstr readhexstring pop } " );
893 printFLN (
"image " );
894 for ( row = 0; row < aHeight; row++ ){
895 for ( col = 0; col < aWidth; col++){
898 status = aProc(col,row,dr,dg,db)==0 ? 0 : status;
899 fgrey = ConvertRGB_ToGrey(dr,dg,db);
900 grey = (
Uchar) ( 255. * fgrey);
904 nbhex = aWidth * aHeight * 2;
905 printFLN (
"%%%% nbhex digit :%d ",nbhex);
908 }
else if(fParams.nbit==2){
910 nbyte2 = (aWidth * 3)/4;
913 col_max = (nbyte2 * 4)/3;
916 putInStreamF (
"/rgbstr %d string def ",nbyte2);
917 putInStreamF (
"%d %d %d ",col_max,aHeight,2);
918 putInStreamF (
"[ %d 0 0 -%d 0 %d ] ",col_max,aHeight,aHeight);
919 putInStreamF (
"{ currentfile rgbstr readhexstring pop } " );
920 putInStreamF (
"false 3 " );
921 printFLN (
"colorimage " );
922 for ( row = 0; row < aHeight; row++ ){
923 for ( col = 0; col < col_max; col+=4){
924 status = aProc(col,row,dr,dg,db)==0 ? 0 : status;
925 red = (
Uchar) ( 3. * dr);
926 green = (
Uchar) ( 3. * dg);
927 blue = (
Uchar) ( 3. * db);
931 status = aProc(col+1,row,dr,dg,db)==0 ? 0 : status;
932 red = (
Uchar) ( 3. * dr);
933 green = (
Uchar) ( 3. * dg);
934 blue = (
Uchar) ( 3. * db);
940 status = aProc(col+2,row,dr,dg,db)==0 ? 0 : status;
941 red = (
Uchar) ( 3. * dr);
942 green = (
Uchar) ( 3. * dg);
943 blue = (
Uchar) ( 3. * db);
949 status = aProc(col+3,row,dr,dg,db)==0 ? 0 : status;
950 red = (
Uchar) ( 3. * dr);
951 green = (
Uchar) ( 3. * dg);
952 blue = (
Uchar) ( 3. * db);
959 }
else if(fParams.nbit==4){
961 nbyte4 = (aWidth * 3)/2;
964 col_max = (nbyte4 * 2)/3;
967 putInStreamF (
"/rgbstr %d string def ",nbyte4);
968 putInStreamF (
"%d %d %d ",col_max,aHeight,4);
969 putInStreamF (
"[ %d 0 0 -%d 0 %d ] ",col_max,aHeight,aHeight);
970 putInStreamF (
"{ currentfile rgbstr readhexstring pop } " );
971 putInStreamF (
"false 3 " );
972 printFLN (
"colorimage " );
973 for ( row = 0; row < aHeight; row++ ){
974 for ( col = 0; col < col_max; col+=2){
975 status = aProc(col,row,dr,dg,db)==0 ? 0 : status;
976 red = (
Uchar) ( 15. * dr);
977 green = (
Uchar) ( 15. * dg);
978 putInStreamF (
"%x%x",red,green);
979 blue = (
Uchar) ( 15. * db);
981 status = aProc(col+1,row,dr,dg,db)==0 ? 0 : status;
982 red = (
Uchar) ( 15. * dr);
983 putInStreamF (
"%x%x",blue,red);
984 green = (
Uchar) ( 15. * dg);
985 blue = (
Uchar) ( 15. * db);
986 putInStreamF (
"%x%x",green,blue);
993 putInStreamF (
"/rgbstr %d string def ",nbyte8);
994 putInStreamF (
"%d %d %d ",aWidth,aHeight,8);
995 putInStreamF (
"[ %d 0 0 -%d 0 %d ] ",aWidth,aHeight,aHeight);
996 putInStreamF (
"{ currentfile rgbstr readhexstring pop } " );
997 putInStreamF (
"false 3 " );
998 printFLN (
"colorimage " );
999 for ( row = 0; row < aHeight; row++ ){
1000 for ( col = 0; col < aWidth; col++){
1001 status = aProc(col,row,dr,dg,db)==0 ? 0 : status;
1002 red = (
Uchar) ( 255. * dr);
1004 green = (
Uchar) ( 255. * dg);
1006 blue = (
Uchar) ( 255. * db);
1012 ::printf(
"SbPainterPS::putImageInStream: problem to retrieve some pixel rgb.\n");
1016void SbPainterPS::writeByte (
1017 unsigned char a_byte
1022 unsigned char h = a_byte / 16;
1023 unsigned char l = a_byte % 16;
1024 putInStreamF (
"%x%x",h,l);
1037 char*
string = ctime(&d);
1042double ConvertRGB_ToGrey(
1050 return (0.30 * a_red + 0.59 * a_green + 0.11 * a_blue);
#define METAFILE_RECORD_LENGTH
void putMoveInStream(float, float)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void endTraversal()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void putStrokeInStream()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void putCircleInStream(float, float, float)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void putBeginPageInStream()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void putClosePathInStream()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void setOrientation(int)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void beginTraversal()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void putSaveStateInStream()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void putImageInStream(unsigned int, unsigned int, GetRGB_Function)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void setBackgroundDrawn(int)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void putNewPathInStream()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void setFileName(const char *)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void putCapInStream(int)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void setBitsPerPixel(int)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void clearColorBuffer(float, float, float)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void setColorScheme(int)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void putPageScaleInStream(float, float)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void putLineToInStream(float, float)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void openFileForWriting(const char *)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
~SbPainterPS()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void setLineWidth(int)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void putRestoreStateInStream()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void putEndPageInStream()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void * getStream()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void putRotateInStream(float)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void putLineWidthInStream(int)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void putMarkerSizeInStream(float)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void putRGB_InStream(float, float, float)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void putFillInStream()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void putBackgroundInStream(float, float, float, float, float)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void putFrameInStream(float, float, float, float, float)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
const char * getFileName() const
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void putScaleInStream(float, float)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void putTranslationInStream(float, float)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void closeStream()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//