Changeset 147 in Sophya for trunk/SophyaPI
- Timestamp:
- Oct 1, 1998, 2:50:47 PM (27 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/pigraphgen.cc
r113 r147 6 6 7 7 #include "pigraphgen.h" 8 9 //++ 10 // Class PIGraphic 11 // Lib PI 12 // include pigraphgen.h 13 // 14 // Classe de base fournissant les services de tracé graphique. 15 // La classe PIGraphicGen définit l'interface à travers des méthodes 16 // virtuelles pures. Les objets instanciés doivent être de la classe 17 // "PIGraphicWin" ou "PIGraphicUC" ou ... 18 // La classe "PIGraphicWin" a une implementation dépendante du système 19 // utilisé et sa 20 // " 21 // Un type particulier *PIGrCoord* permettant de passer les coordonnées 22 // graphiques en entier ("int") ou en flottant ("float"). 23 //-- 24 25 // 26 // " 27 // " 28 // " 29 // " 30 // " 31 // " 8 32 9 33 /* --Methode-- */ -
trunk/SophyaPI/PI/pigraphps.cc
r130 r147 48 48 SelMarker(1, PI_DotMarker); 49 49 50 if (psf) psf->NewBloc(x0, y0, dx, d x, dy, dy);50 if (psf) psf->NewBloc(x0, y0, dx, dy, dx, dy); 51 51 mXmin = mYmin = 0.; 52 52 mXmax = dx; mYmax = dy; -
trunk/SophyaPI/PI/piscdrawwdg.cc
r134 r147 331 331 // Trace des lignes 332 332 float xp2, yp2; 333 if (mAy) { xp = mAx->Value(0); yp= mAy->Value(0); }334 else { xp = mAx->X(0); yp= mAx->Value(0); }333 if (mAy) { xp2 = mAx->Value(0); yp2 = mAy->Value(0); } 334 else { xp2 = mAx->X(0); yp2 = mAx->Value(0); } 335 335 for(i=1; i<mSz; i++) { 336 xp = xp2; yp = yp2; 336 337 if (mAy) { xp2 = mAx->Value(i); yp2 = mAy->Value(i); } 337 338 else { xp2 = mAx->X(i); yp2 = mAx->Value(i); } … … 339 340 ((xp2 < xmin) || (xp2 > xmax) || (yp2 < ymin) || (yp2 > ymax)) ) continue; 340 341 g->DrawLine(xp, yp, xp2, yp2); 341 xp = xp2; yp = yp2; 342 } 343 } 342 } 343 } -
trunk/SophyaPI/PI/psfile.cc
r130 r147 31 31 PI_ColorFromMap, PI_Black, PI_White, PI_Grey, PI_Red, PI_Blue,\ 32 32 PI_Green, PI_Yellow, PI_Magenta, PI_NotDefColor,\ 33 PI_Cyan, PI_Turquoise, PI_NavyBlue,\ 34 PI_Orange, PI_SiennaRed, PI_Purple,\ 35 PI_LimeGreen, PI_Gold,\ 33 36 \ 34 37 PI_RomanFont, PI_BoldFont, PI_ItalicFont, PI_NotDefFontAtt,\ … … 51 54 /C%-2d {0.996 0.0 0.996 setrgbcolor} bind def %% PI_Magenta\n\ 52 55 /C%-2d {} bind def %% PI_NotDefColor\n\ 56 /C%-2d {0.0 0.996 0.996 setrgbcolor} bind def %% PI_Cyan\n\ 57 /C%-2d {0.250 0.875 0.813 setrgbcolor} bind def %% PI_Turquoise\n\ 58 /C%-2d {0.0 0.0 0.500 setrgbcolor} bind def %% PI_NavyBlue\n\ 59 /C%-2d {0.996 0.644 0.0 setrgbcolor} bind def %% PI_Orange\n\ 60 /C%-2d {0.625 0.320 0.176 setrgbcolor} bind def %% PI_SiennaRed\n\ 61 /C%-2d {0.625 0.125 0.937 setrgbcolor} bind def %% PI_Purple\n\ 62 /C%-2d {0.195 0.800 0.195 setrgbcolor} bind def %% PI_LimeGreen\n\ 63 /C%-2d {0.996 0.840 0.0 setrgbcolor} bind def %% PI_Gold\n\ 53 64 /F%-2d {/Courier findfont} bind def %% PI_RomanFont\n\ 54 65 /F%-2d {/Courier-Bold findfont} bind def %% PI_BoldFont\n\ … … 273 284 mFontSize(PI_NormalSizeFont), 274 285 mLineAtt(PI_NormalLine), 275 mMarker(PI_DotMarker) 286 mMarker(PI_DotMarker), 287 setFontDone(true) 276 288 { 277 289 char* date = new (char[64] ) ; … … 335 347 mFontSize(PI_NormalSizeFont), 336 348 mLineAtt(PI_NormalLine), 337 mMarker(PI_DotMarker) 349 mMarker(PI_DotMarker), 350 setFontDone(true) 338 351 { 339 352 char * date = new(char[64]) ; … … 492 505 */ 493 506 else { 507 // Si marges <= 0 on les met a 2cm 508 if(WMargin<=0) WMargin = 2. ; 509 if(HMargin<=0) HMargin = 2. ; 494 510 /* Eviter image reduite a un point...ou moins... */ 495 511 if((tw = Tw - 2*WMargin) < (Tw/10)) { … … 503 519 /* Portrait ou Landscape ? */ 504 520 if(orientation == PI_Auto) 505 if( ((tw < th) && (Dx < Dy)) ||521 if( ((tw < th) && (Dx < 1.2*Dy)) || 506 522 ((tw > th) && (Dx > Dy) )) 507 523 currentPage->orientation = PI_Portrait ; … … 511 527 if(currentPage->orientation == PI_Portrait) { 512 528 if( (tw/Dx) < (th/Dy) ) 513 scale = tw/Dx ; 529 // scale = tw/Dx ; 530 scale = tw/Tw ; 514 531 else 515 scale = th/Dy; 532 // scale = th/Dy; 533 scale = th/Th; 516 534 fprintf(mPSFile, 517 535 "%.2f %.2f %.2f cm %.2f cm %.2f cm %.2f cm newref\n", 518 536 Dx, Dy, 519 Dx*scale, Dy*scale, 537 // Dx*scale, Dy*scale, 538 Tw*scale, Th*scale, 520 539 0.5*(Tw-tw), -0.5*(Th+th)) ; 521 540 } … … 523 542 /* Idem avec X<->Y */ 524 543 if( (th/Dx) < (th/Dy) ) 525 scale = th/Dx; 544 // scale = th/Dx; 545 scale = th/Tw; 526 546 else 527 scale = tw/Dy ; 547 // scale = tw/Dy ; 548 scale = tw/Th; 528 549 fprintf(mPSFile, 529 550 "-90 rotate %.2f %.2f %.2f cm %.2f cm %.2f cm %.2f cm newref\n", 530 551 Dx, Dy, 531 Dx*scale, Dy*scale, 552 // Dx*scale, Dy*scale, 553 Th*scale, Tw*scale, 532 554 0.5*(Th-th), 0.5*(Tw-tw)); 533 555 } … … 656 678 657 679 fprintf(mPSFile, "gs %.2f Ux %.2f Uy m (%s) S gr\n", x, y, s) ; 680 setFontDone = true ; 658 681 } 659 682 … … 881 904 mMarker = MrkType; 882 905 883 if(MarkerSize != mMarkerSize ) {906 if(MarkerSize != mMarkerSize || setFontDone) { 884 907 mMarkerSize = MarkerSize ; 885 908 fprintf(mPSFile, "/PIMarkers ff %d scf sf\n", mMarkerSize) ; 909 setFontDone = false ; 886 910 } 887 911 /* Dessin */ 888 912 fprintf(mPSFile, "%.2f Ux %.2f Uy m (\\%#o) show\n", x0, y0, mMarker) ; 889 890 913 } 891 914 … … 908 931 mMarker = MrkType; 909 932 910 if(MarkerSize != mMarkerSize ) {933 if(MarkerSize != mMarkerSize || setFontDone) { 911 934 mMarkerSize = MarkerSize ; 912 935 fprintf(mPSFile, "/PIMarkers ff %d scf sf\n", mMarkerSize) ; 936 setFontDone = false ; 913 937 } 914 938 /* Dessin */ -
trunk/SophyaPI/PI/psfile.h
r130 r147 76 76 PSFile (const char * FileName, PIOrientation orientation, 77 77 PIPaperSize paperSize= PI_A4, 78 float marginX = 1.0, float marginY = 1.0 ) ;78 float marginX = 5.0, float marginY = 5.0 ) ; 79 79 80 80 virtual ~PSFile(); … … 203 203 enum PIMarker mMarker; /* Marker courant */ 204 204 int mMarkerSize; /* Taille (en points) du marker courant */ 205 bool setFontDone ; /* Pour forcer la selection de Marker apres DrawString() */ 205 206 } ; 206 207
Note:
See TracChangeset
for help on using the changeset viewer.