Changeset 1549 in Sophya
- Timestamp:
- Jun 27, 2001, 10:11:31 AM (24 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/parradapter.cc
r1040 r1549 113 113 invX = invY = eXY = false; 114 114 DefineXYCoordinates(0.,0.,1.,1.); 115 SetInfoStringFunction(NULL); 115 116 } 116 117 … … 143 144 x = mOx+ix*mDx; 144 145 y = mOy+iy*mDy; 146 } 147 148 static char ibuff[256]; 149 150 /* --Methode-- */ 151 char * P2DArrayAdapter::InfoString(int ix, int iy) 152 { 153 double x,y; 154 this->Coord(ix, iy, x, y); 155 char * isr = ""; 156 if (ISFunc) isr = ISFunc(this, ix, iy); 157 sprintf(ibuff,"X= %g Y= %g Pix= %8g %s ", 158 x, y , this->Value(ix, iy), isr ); 159 return (ibuff); 145 160 } 146 161 -
trunk/SophyaPI/PI/parradapter.h
r292 r1549 28 28 // autres classes de PI qui operent sur des structures 29 29 // de type Tableaux 2-D (images, ...) 30 class P2DArrayAdapter; 30 31 32 typedef char * (* P2DAA_InfoStringFunc) (P2DArrayAdapter * aa, int ix, int iy); 33 /* Longueur de retour de P2DAA_InfoString : 128 char */ 34 31 35 class P2DArrayAdapter { 32 36 public : … … 45 49 46 50 virtual void XYfromxy(int ix, int iy, double& x, double& y); 51 52 virtual char * InfoString(int ix, int iy); 53 54 inline void SetInfoStringFunction(P2DAA_InfoStringFunc isf) 55 { ISFunc = isf; } 47 56 48 57 inline int XSize() { return ( eXY ? sY : sX ) ; } … … 78 87 int offX, offY; 79 88 bool invX, invY, eXY; 89 90 P2DAA_InfoStringFunc ISFunc; 91 80 92 }; 81 93 -
trunk/SophyaPI/PI/piimage.cc
r1503 r1549 310 310 showinfo = si; 311 311 if (showinfo && img) { 312 char buff[256]; 313 double x,y; 314 img->Coord(xpav, ypav, x, y); 315 sprintf(buff," X= %g , Y= %g Pix= %g (%d,%d) ", 316 x, y , (*img)(xpav, ypav), xpav, ypav ); 317 DrawInfo(mWGrC, buff); 312 char * ibuff = img->InfoString(xpav, ypav); 313 DrawInfo(mWGrC, ibuff); 318 314 } 319 315 else DrawInfo(mWGrC, NULL); … … 572 568 } 573 569 else { 574 char buff[256]; 575 double x,y; 576 img->Coord(xpav, ypav, x, y); 577 sprintf(buff," X= %g , Y= %g Pix= %g (%d,%d) ", 578 x, y , (*img)(xpav, ypav), xpav, ypav ); 579 if (ustrtw || atrtw) trtlb->SetLabel((string)buff); 580 else DrawInfo(mWGrC, buff); 570 char * ibuff = img->InfoString(xpav, ypav); 571 if (ustrtw || atrtw) trtlb->SetLabel((string)ibuff); 572 else DrawInfo(mWGrC, ibuff); 581 573 } 582 574 if (zow != NULL) ComputeZoomPixmap(); … … 616 608 617 609 if (showinfo && img) { 618 char buff[256]; 619 double x,y; 620 img->Coord(xpav, ypav, x, y); 621 sprintf(buff," X= %g , Y= %g Pix= %g (%d,%d) ", 622 x, y , (*img)(xpav, ypav), xpav, ypav ); 623 DrawInfo(mWGrC, buff); 610 char * ibuff = img->InfoString(xpav, ypav); 611 DrawInfo(mWGrC, ibuff); 624 612 } 625 613 … … 773 761 774 762 { 775 char buff[256]; 776 double x,y; 777 img->Coord(xp, yp, x, y); 778 sprintf(buff," X= %g , Y= %g Pix= %g (C= %d,%d) ", 779 x, y , (*img)(xp, yp), (xp+xpv0)/2, (yp+ypv0)/2 ); 780 if (ustrtw || atrtw) trtlb->SetLabel((string)buff); 781 else DrawInfo(mWGrC, buff); 763 char * ibuff = img->InfoString((xp+xpv0)/2, (yp+ypv0)/2 ); 764 if (ustrtw || atrtw) trtlb->SetLabel((string)ibuff); 765 else DrawInfo(mWGrC, ibuff); 782 766 } 783 767
Note:
See TracChangeset
for help on using the changeset viewer.