Changeset 684 in Sophya
- Timestamp:
- Dec 13, 1999, 12:13:36 AM (26 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/pidrwtools.cc
r563 r684 450 450 451 451 char strg[64]; 452 double xmin, xmax, ymin, ymax;453 int axrl = kAxeDirLtoR;454 int ayud = kAxeDirDownUp;455 452 int k, kk, kkk; 456 453 … … 458 455 459 456 case 2600 : 460 if ( mCurBW->kind() != PIScDrawWdg::ClassId ) { 457 { 458 double xmin, xmax, ymin, ymax; 459 int axrl = kAxeDirLtoR; 460 int ayud = kAxeDirDownUp; 461 PIScDrawWdg* scd=NULL; 462 scd = dynamic_cast<PIScDrawWdg*>(mCurBW); 463 if ( scd == NULL ) { 461 464 cerr << "PIDrwTools: SetAxes applicable to PIScDrawWdg only ! " << endl; 462 465 return; 463 466 } 464 sscanf(mText[0]->GetText().c_str(), "%lg %lg" , &xmin, &xmax); 465 sscanf(mText[1]->GetText().c_str(), "%lg %lg" , &ymin, &ymax); 467 if (mText[0]->GetText().length() > 1) { 468 xmin = -1.; xmax = 1.; 469 sscanf(mText[0]->GetText().c_str(), "%lg %lg" , &xmin, &xmax); 470 } 471 else { 472 xmin = scd->XMin(); 473 xmax = scd->XMax(); 474 } 475 if (mText[1]->GetText().length() > 1) { 476 ymin = -1.; ymax = 1.; 477 sscanf(mText[1]->GetText().c_str(), "%lg %lg" , &ymin, &ymax); 478 } 479 else { 480 ymin = scd->YMin(); 481 ymax = scd->YMax(); 482 } 466 483 if (mCkb[0]->GetState()) axrl = kAxeDirRtoL ; 467 484 if (mCkb[1]->GetState()) ayud = kAxeDirUpDown; 468 if ( mCurBW->kind() == PIScDrawWdg::ClassId ) { 469 ((PIScDrawWdg*)mCurBW)->SetLimits(xmin, xmax, ymin, ymax, axrl, ayud); 470 unsigned int flags = ((PIScDrawWdg*)mCurBW)->GetAxesFlags(); 471 if (mCkb[2]->GetState()) ((PIScDrawWdg*)mCurBW)->SetAxesFlags(flags | kGridOn); 472 else ((PIScDrawWdg*)mCurBW)->SetAxesFlags(flags & ~kGridOn); 473 ((PIScDrawWdg*)mCurBW)->SetLogScale(mCkb[3]->GetState(), 474 mCkb[4]->GetState() ); 475 } 485 scd->SetLimits(xmin, xmax, ymin, ymax, axrl, ayud); 486 unsigned int flags = scd->GetAxesFlags(); 487 if (mCkb[2]->GetState()) scd->SetAxesFlags(flags | kGridOn); 488 else scd->SetAxesFlags(flags & ~kGridOn); 489 scd->SetLogScale(mCkb[3]->GetState(), mCkb[4]->GetState() ); 490 476 491 // else mCurBW->SetDefaultDrawerLimits(xmin, xmax, ymin, ymax, axrl, ayud); 477 492 mCurBW->Refresh(); 493 } 478 494 break; 479 495 480 496 case 2700 : 481 if ( mCurBW->kind() == PIScDrawWdg::ClassId ) ((PIScDrawWdg*)mCurBW)->UpdateLimits(); 482 else if ( mCurBW->kind() == PIDraw3DWdg::ClassId) ((PIDraw3DWdg*)mCurBW)->Update3DView(); 497 { 498 PIScDrawWdg* scd=NULL; 499 scd = dynamic_cast<PIScDrawWdg*>(mCurBW); 500 if ( scd != NULL ) scd->UpdateLimits(); 501 else { 502 PIDraw3DWdg* dr3 = dynamic_cast<PIDraw3DWdg *>(mCurBW); 503 if (dr3 != NULL) dr3->Update3DView(); 504 } 505 } 483 506 break; 484 507 … … 502 525 kk = mOpt[3]->GetValue()-400; 503 526 if ( (kk < 1) || (kk > 27) ) kk = 1; 527 if ((k > 0) && (kk < 3)) { // Protection contre Marker taille 1 autre que Dotmarker 528 mOpt[3]->SetValue(403); 529 kk = 3; 530 } 504 531 drw->SetMarkerAtt(kk, mrk[k]); 505 532 k = (mOpt[4]->GetValue()-500); -
trunk/SophyaPI/PI/piimgtools.cc
r537 r684 320 320 case 2800 : 321 321 { 322 min = atof(mText[0]->GetText().c_str()); 323 max = atof(mText[1]->GetText().c_str()); 322 if (mText[0]->GetText().length() > 0) 323 min = atof(mText[0]->GetText().c_str()); 324 else min = mpii->Lut()->Min(); 325 if (mText[1]->GetText().length() > 0) 326 max = atof(mText[1]->GetText().c_str()); 327 else max = mpii->Lut()->Max(); 328 324 329 if (msg == 2700) { 325 330 del = max_lut-min_lut; -
trunk/SophyaPI/PI/psfile.cc
r547 r684 274 274 #define HEADER "\ 275 275 %%%%Title: %s\n\ 276 %%%%Creator: P SFile (N.R. 07/08/99)\n\276 %%%%Creator: PI-PSFile (N.R. 07/08/99)\n\ 277 277 %%%%CreationDate: %s\ 278 278 %%%%Pages: (atend)\n\ … … 604 604 } 605 605 } /* End if .ps */ 606 // On redefint la fonte par defaut - $CHECK$ Reza 11/12/99 607 mFontAtt = PI_RomanFont; 608 mFontSize = 10; 609 mFontName = PI_DefaultFont; 610 fprintf(mPSFile, "/Courier ff %d FS \n", mFontSize) ; 611 setFontDone = true; 606 612 currentPage->tmp = ftell(mPSFile); 607 613 } … … 662 668 currentBloc->Tx, currentBloc->Ty, 663 669 currentBloc->X0, currentBloc->Y0); 670 // On redefint la fonte par defaut - $CHECK$ Reza 11/12/99 671 mFontAtt = PI_RomanFont; 672 mFontSize = 10; 673 mFontName = PI_DefaultFont; 674 fprintf(mPSFile, "/Courier ff %d FS \n", mFontSize) ; 675 setFontDone = true; 664 676 currentBloc->tmp = ftell(mPSFile) ; 665 677 } … … 710 722 PIFontAtt FontAtt, 711 723 int FontSize) { 712 int change = 0;724 bool change = false; 713 725 714 726 /* Couleurs */ … … 721 733 //DBG printf("PSFile::DrawString(%s) : FontAtt a change : %d %d \n", s, mFontAtt, FontAtt) ; 722 734 mFontAtt = FontAtt; 723 change = 1;735 change = true; 724 736 } 725 737 if ( (FontSize != PI_NotDefFontSize) && (FontSize != mFontSize) ) { 726 738 //DBG printf("PSFile::DrawString(%s) : FontSize a change : %d %d \n", s, mFontSize, FontSize) ; 727 mFontSize = (PIFontSize) FontSize; // $CHECK$ EA ajoute le cast un peu au pif728 change = 1;739 mFontSize = FontSize; 740 change = true; 729 741 } 730 742 if( (FontName != mFontName) ) { 731 743 //DBG printf("PSFile::DrawString(%s) : FontName a change : %d %d \n", s, mFontName, FontName) ; 732 744 mFontName = (PIFontName) FontName ; 733 change = 1 ; 734 } 735 if (change) { 745 change = true ; 746 } 747 748 if (change || !setFontDone) { // $CHECK$ setFontDone Reza 11/12/99 736 749 string fname ; 737 750 switch(mFontName) { … … 764 777 } // endsw 765 778 fprintf(mPSFile, " ff %d FS ", FontSize) ; 766 }767 768 779 setFontDone = true ; // $CHECK$ - doit etre fait uniquement a ce moment 780 } 781 769 782 fprintf(mPSFile, "gs %.2f Ux %.2f Uy m (%s) S gr\n", x, y, s) ; 770 setFontDone = true ;771 783 } 772 784
Note:
See TracChangeset
for help on using the changeset viewer.