#include "ObjectStructure.h"Include dependency graph for PloEch.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Data Structures | |
| struct | wcscalelist |
| struct | scalelist |
Defines | |
| #define | Min(x, y) (((x)<(y))?(x):(y)) |
| #define | XDouble2Pixel(x) ((Cscale.logflag[0] == 'n') ? ( XScale(x)) : ( XLogScale(x))) |
| #define | YDouble2Pixel(y) ((Cscale.logflag[1] == 'n') ? ( YScale(y)) : ( YLogScale(y))) |
| #define | WScale(w) inint (Cscale.Wscx1 * (w)) |
| #define | WLogScale(x, w) inint (Cscale.Wscx1 * (log10 (((x) + (w)) / (x)))) |
| #define | HScale(h) inint (Cscale.Wscy1 * (h)) |
| #define | HLogScale(y, h) inint (Cscale.Wscy1 * (log10 ( ((y) + (h)) / (y) ) )) |
| #define | WDouble2Pixel(x, w) ((Cscale.logflag[0] == 'n') ? ( WScale(w)) : ( WLogScale(x,w))) |
| #define | HDouble2Pixel(y, h) ((Cscale.logflag[1] == 'n') ? ( HScale(h)) : ( HLogScale(y,h))) |
| #define | XPi2LogR(x) exp10( XPi2R(x)) |
| #define | YPi2LogR(y) exp10( YPi2R(y)) |
| #define | XPixel2Double(x) (( Cscale.logflag[0] == 'l') ? XPi2LogR(x) : XPi2R(x)) |
| #define | YPixel2Double(y) (( Cscale.logflag[1] == 'l') ? YPi2LogR(y) : YPi2R(y)) |
| #define | XDPi2LogR(x) exp10( XDPi2R(x)) |
| #define | YDPi2LogR(y) exp10( YDPi2R(y)) |
| #define | XDPixel2Double(x) (( Cscale.logflag[0] == 'l') ? XDPi2LogR(x) : XDPi2R(x)) |
| #define | YDPixel2Double(y) (( Cscale.logflag[1] == 'l') ? YDPi2LogR(y) : YDPi2R(y)) |
| #define | TRX(x1, y1, z1) ( Cscale.m[0][0]*(x1) +Cscale.m[0][1]*(y1) +Cscale.m[0][2]*(z1)) |
| #define | TRY(x1, y1, z1) ( Cscale.m[1][0]*(x1) +Cscale.m[1][1]*(y1) +Cscale.m[1][2]*(z1)) |
| #define | TRZ(x1, y1, z1) ( Cscale.m[2][0]*(x1) +Cscale.m[2][1]*(y1) +Cscale.m[2][2]*(z1)) |
| #define | GEOX(x1, y1, z1) XScale(TRX(x1,y1,z1)) |
| #define | GEOY(x1, y1, z1) YScale(TRY(x1,y1,z1)) |
| #define | TX3D(x1, y1, z1) Cscale.Wscx1*(TRX(x1,y1,z1)-Cscale.frect[0]) +Cscale.Wxofset1 ; |
| #define | TY3D(x1, y1, z1) Cscale.Wscy1*(-TRY(x1,y1,z1)+Cscale.frect[3])+Cscale.Wyofset1 ; |
Typedefs | |
| typedef wcscalelist | WCScaleList |
| typedef scalelist | ScaleList |
Functions | |
| void | ShowScales (void) |
| int C2F() | Nsetscale2d (double WRect[4], double ARect[4], double FRect[4], char *logscale, integer l1) |
| int | getscale2d (double WRect[4], double FRect[4], char *logscale, double ARect[4]) |
| void | set_scale (char flag[6], double subwin[4], double frame_values[4], integer aaint[4], char logflag[3], double axis_values[4]) |
| int | zoom (void) |
| int | zoom_box (double *bbox, int *x_pixel, int *y_pixel) |
| void | unzoom (void) |
| void | unzoom_one_axes (sciPointObj *psousfen) |
| void | scizoom (double bbox[4], sciPointObj *pobj) |
| int | XScale (double x) |
| int | XLogScale (double x) |
| int | YScale (double y) |
| int | YLogScale (double y) |
| double | XPi2R (int x) |
| double | YPi2R (int y) |
| double | XDPi2R (double x) |
| double | YDPi2R (double y) |
| void | getPixelCoordinates (sciPointObj *pSubWin, double coord3d[3], int pixCoord[2]) |
| int | PixelWidth2d (sciPointObj *parentSubWin, double posX, double width) |
| int | PixelHeight2d (sciPointObj *parentSubWin, double posY, double height) |
| void | rectangleDouble2Pixel (sciPointObj *parentSubWin, double ulPoint[3], double userSize[2], int edgesX[4], int edgesY[4]) |
| void | Plo2d2RealToPixel (integer *n1, integer *n2, double *x, double *y, integer *xm, integer *ym, char *xf) |
| void | Plo2d3RealToPixel (integer *n1, integer *n2, double *x, double *y, integer *xm, integer *ym, char *xf) |
| void | Plo2d4RealToPixel (integer *n1, integer *n2, double *x, double *y, integer *xm, integer *ym, char *xf) |
| int C2F() | echelle2d (double x[], double y[], integer x1[], integer yy1[], integer *n1, integer *n2, char dir[], integer lstr) |
| void C2F() | echelle2dl (double x[], double y[], integer x1[], integer yy1[], integer *n1, integer *n2, char *dir) |
| void C2F() | rect2d (double x[], integer x1[], integer *n, char *dir) |
| void C2F() | ellipse2d (double x[], integer x1[], integer *n, char *dir) |
| void C2F() | axis2d (double *alpha, double *initpoint, double *size, integer *initpoint1, double *size1) |
| int | get_window_scale (integer i, double *subwin) |
| void | del_window_scale (integer i) |
| void | Cscale2default (void) |
| void | set_window_scale_with_default (int i) |
Variables | |
| WCScaleList | Cscale |
Definition at line 101 of file PloEch.h.
Referenced by getStringBox(), rectangleDouble2Pixel(), and sciClip().
Definition at line 136 of file PloEch.h.
Referenced by DrawMerge3d(), fac3dn(), sciGetAxisBox(), and SetEch3d1().
| #define TX3D | ( | x1, | |||
| y1, | |||||
| z1 | ) | Cscale.Wscx1*(TRX(x1,y1,z1)-Cscale.frect[0]) +Cscale.Wxofset1 ; |
| #define TY3D | ( | x1, | |||
| y1, | |||||
| z1 | ) | Cscale.Wscy1*(-TRY(x1,y1,z1)+Cscale.frect[3])+Cscale.Wyofset1 ; |
Definition at line 100 of file PloEch.h.
Referenced by getStringBox(), rectangleDouble2Pixel(), and sciClip().
Definition at line 89 of file PloEch.h.
Referenced by boundingbox_1(), cleararea_1(), displaystring_1(), drawarc_1(), drawArcEntity(), drawTextEntity(), fillarc_1(), fillrectangle_1(), getPixelClipping(), getPixelCoordinates(), getStringBox(), getTextBoundingBox(), Objstring(), rectangleDouble2Pixel(), sciClip(), sciIsClicked(), xstringb_1(), and zoom_box().
Definition at line 118 of file PloEch.h.
Referenced by computeLabelAutoPos(), getChampDataBounds(), and zoom_box().
Definition at line 90 of file PloEch.h.
Referenced by boundingbox_1(), cleararea_1(), displaystring_1(), drawarc_1(), drawArcEntity(), drawTextEntity(), fillarc_1(), fillrectangle_1(), getPixelClipping(), getPixelCoordinates(), getStringBox(), getTextBoundingBox(), Objstring(), rectangleDouble2Pixel(), sciClip(), sciIsClicked(), xstringb_1(), and zoom_box().
Definition at line 119 of file PloEch.h.
Referenced by computeLabelAutoPos(), getChampDataBounds(), and zoom_box().
| typedef struct wcscalelist WCScaleList |
| void C2F() axis2d | ( | double * | alpha, | |
| double * | initpoint, | |||
| double * | size, | |||
| integer * | initpoint1, | |||
| double * | size1 | |||
| ) |
meme chose mais pour axis
Definition at line 1014 of file Plo2dEch.c.
References Abs, Cscale, M_PI, wcscalelist::Wscx1, wcscalelist::Wscy1, XScale(), and YScale().
Referenced by drawaxis_1().
01019 { 01020 double sina ,cosa; 01021 double xx,yy,scl; 01022 /* pour eviter des problemes numerique quand Cscale.scx1 ou Cscale.scy1 sont 01023 * tres petits et cosal ou sinal aussi 01024 */ 01025 if ( Abs(*alpha) == 90 ) 01026 { 01027 scl=Cscale.Wscy1; 01028 } 01029 else 01030 { 01031 if (Abs(*alpha) == 0) 01032 { 01033 scl=Cscale.Wscx1; 01034 } 01035 else 01036 { 01037 sina= sin(*alpha * M_PI/180.0); 01038 cosa= cos(*alpha * M_PI/180.0); 01039 xx= cosa*Cscale.Wscx1; xx *= xx; 01040 yy= sina*Cscale.Wscy1; yy *= yy; 01041 scl= sqrt(xx+yy); 01042 } 01043 } 01044 size1[0] = size[0]*scl; 01045 size1[1]= size[1]*scl; 01046 size1[2]= size[2]; 01047 initpoint1[0]= XScale(initpoint[0]); 01048 initpoint1[1]= YScale(initpoint[1]); 01049 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Cscale2default | ( | void | ) |
Definition at line 105 of file Plo2dEch.c.
References Cscale, curwin(), Defscale, scale_copy(), and set_window_scale().
Referenced by CleanPlots(), InitMissileXgc(), and initsubwin().
00106 { 00107 scale_copy(&Cscale,&Defscale); set_window_scale(curwin(),&Cscale); 00108 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void del_window_scale | ( | integer | i | ) |
Definition at line 281 of file Plo2dEch.c.
References DeleteWCScale(), FREE, scalelist::next, NULL, scalelist::scales, The_List, and scalelist::Win.
Referenced by CleanPlots(), and DeleteSGWin().
00282 { 00283 ScaleList *loc, *loc1; 00284 /* check head of The_List */ 00285 if ( The_List == NULL) return ; 00286 if ( The_List->Win == i) 00287 { 00288 loc1= The_List ; 00289 The_List = The_List->next; 00290 DeleteWCScale(loc1->scales); 00291 FREE(loc1); 00292 return; 00293 } 00294 loc1= The_List; 00295 loc = The_List->next; 00296 while ( loc != NULL) 00297 { 00298 if ( loc->Win == i ) 00299 { 00300 loc1->next = loc->next; 00301 DeleteWCScale(loc->scales); 00302 FREE(loc); 00303 return ; 00304 } 00305 else 00306 { 00307 loc1 = loc; 00308 loc = loc->next; 00309 } 00310 } 00311 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int C2F() echelle2d | ( | double | x[], | |
| double | y[], | |||
| integer | x1[], | |||
| integer | yy1[], | |||
| integer * | n1, | |||
| integer * | n2, | |||
| char | dir[], | |||
| integer | lstr | |||
| ) |
Definition at line 860 of file Plo2dEch.c.
References C2F, n, xechelle2d(), and yechelle2d().
Referenced by boundingbox_1(), displaynumbers_1(), drawarrows_1(), drawGrayplotEntity(), drawpolyline_1(), drawPolylineEntity(), drawpolylines_1(), drawpolymark_1(), drawsegments_1(), fillpolyline_1(), fillpolylines_1(), I3dRotation(), Objstring(), sci_xchange(), xclick_1(), xclick_2(), xclick_any_1(), xgetmouse2(), xgetmouse_1(), and xset_1().
00869 { 00870 int n=(*n1)*(*n2); 00871 C2F(xechelle2d)(x,x1,&n,dir,lstr); 00872 C2F(yechelle2d)(y,yy1,&n,dir,lstr); 00873 return(0); 00874 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void C2F() echelle2dl | ( | double | x[], | |
| double | y[], | |||
| integer | x1[], | |||
| integer | yy1[], | |||
| integer * | n1, | |||
| integer * | n2, | |||
| char * | dir | |||
| ) |
Definition at line 884 of file Plo2dEch.c.
References Cscale, i, inint, sciprint(), wcscalelist::Wscx1, and wcscalelist::Wscy1.
Referenced by boundingbox_1(), cleararea_1(), computeRealArrowSize(), drawarc_1(), drawarrows_1(), fillarc_1(), fillrectangle_1(), Objstring(), xset_1(), and xstringb_1().
00891 { 00892 integer i; 00893 if (strcmp("f2i",dir)==0) 00894 { 00895 for ( i=0 ; i < (*n1)*(*n2) ; i++) 00896 { 00897 x1[i]=inint( Cscale.Wscx1*( x[i])); 00898 yy1[i]=inint( Cscale.Wscy1*( y[i])); 00899 } 00900 } 00901 else if (strcmp("i2f",dir)==0) 00902 { 00903 for ( i=0 ; i < (*n1)*(*n2) ; i++) 00904 { 00905 x[i]=x1[i]/Cscale.Wscx1; 00906 y[i]=yy1[i]/Cscale.Wscy1; 00907 } 00908 } 00909 else 00910 sciprint(" Wrong dir %s argument in echelle2d\r\n",dir); 00911 }
Here is the call graph for this function:

Here is the caller graph for this function:

meme chose mais pour transformer des ellipses
double to integer (pixel) direction
Definition at line 915 of file Plo2dEch.c.
References Cscale, i, inint, sciprint(), wcscalelist::Wscx1, wcscalelist::Wscy1, XPi2R(), XScale(), YPi2R(), and YScale().
Referenced by drawarcs_1(), and fillarcs_1().
00916 { 00917 integer i; 00918 if (strcmp("f2i",dir)==0) 00919 { 00921 for ( i=0 ; i < (*n) ; i=i+6) 00922 { 00923 x1[i ]= XScale(x[i]); 00924 x1[i+1]= YScale(x[i+1]); 00925 x1[i+2]= inint( Cscale.Wscx1*( x[i+2])); 00926 x1[i+3]= inint( Cscale.Wscy1*( x[i+3])); 00927 x1[i+4]= inint( x[i+4]); 00928 x1[i+5]= inint( x[i+5]); 00929 } 00930 } 00931 else if (strcmp("i2f",dir)==0) 00932 { 00933 for ( i=0 ; i < (*n) ; i=i+6) 00934 { 00935 x[i]= XPi2R(x1[i]); 00936 x[i+1]= YPi2R( x1[i+1] ); 00937 x[i+2]= x1[i+2]/Cscale.Wscx1; 00938 x[i+3]= x1[i+3]/Cscale.Wscy1; 00939 x[i+4]= x1[i+4]; 00940 x[i+5]= x1[i+5]; 00941 } 00942 } 00943 else 00944 sciprint(" Wrong dir %s argument in echelle2d\r\n",dir); 00945 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 123 of file Plo2dEch.c.
References get_scale_win(), L, Max, and The_List.
Referenced by DeleteSGWin(), Nsetscale2d(), and SwitchWindow().
00124 { 00125 return get_scale_win(The_List,Max(0L,i),subwin); 00126 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void getPixelCoordinates | ( | sciPointObj * | pSubWin, | |
| double | coord3d[3], | |||
| int | pixCoord[2] | |||
| ) |
convert the coordinates of a 2d or 3d point to its pixel coordinates.
| pSubWin | SubWindow in which the point is, might be either in 2d or 3d. | |
| coord3d | Coordinates of the point in the axes. If the subwin is in 2d, only the first two coordinates are used. |
Definition at line 1846 of file Plo2dEch.c.
References pSUBWIN_FEATURE, ReverseDataFor3D(), trans3d(), XDouble2Pixel, and YDouble2Pixel.
Referenced by drawTextEntity(), and getTextBoundingBox().
01847 { 01848 01849 if ( pSUBWIN_FEATURE (pSubWin)->is3d ) 01850 { 01851 int n = 1 ; 01852 01853 double xvect = coord3d[0] ; 01854 double yvect = coord3d[1] ; 01855 double zvect = coord3d[2] ; 01856 01857 ReverseDataFor3D(pSubWin,&xvect,&yvect,&zvect,n); 01858 trans3d(pSubWin,n,&(pixCoord[0]),&(pixCoord[1]),&xvect,&yvect,&zvect ) ; 01859 } 01860 else 01861 { 01862 pixCoord[0] = XDouble2Pixel( coord3d[0] ) ; 01863 pixCoord[1] = YDouble2Pixel( coord3d[1] ) ; 01864 } 01865 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int getscale2d | ( | double | WRect[4], | |
| double | FRect[4], | |||
| char * | logscale, | |||
| double | ARect[4] | |||
| ) |
Definition at line 571 of file Plo2dEch.c.
References wcscalelist::axis, Cscale, wcscalelist::frect, i, wcscalelist::logflag, and wcscalelist::subwin_rect.
Referenced by sci_xgetech(), SetEch3d1(), and updateScale3d().
00572 { 00573 integer i; 00574 static double ten=10.0; 00575 logscale[0] = Cscale.logflag[0]; 00576 logscale[1] = Cscale.logflag[1]; 00577 for ( i=0; i < 4 ; i++) 00578 { 00579 WRect[i]=Cscale.subwin_rect[i]; 00580 FRect[i]=Cscale.frect[i]; 00581 ARect[i]=Cscale.axis[i]; 00582 } 00583 if (logscale[0]=='l') 00584 { 00585 FRect[0]=pow(ten,FRect[0]); 00586 FRect[2]=pow(ten,FRect[2]); 00587 } 00588 if (logscale[1]=='l') 00589 { 00590 FRect[1]=pow(ten,FRect[1]); 00591 FRect[3]=pow(ten,FRect[3]); 00592 } 00593 return(0); 00594 }
Here is the caller graph for this function:

| int C2F() Nsetscale2d | ( | double | WRect[4], | |
| double | ARect[4], | |||
| double | FRect[4], | |||
| char * | logscale, | |||
| integer | l1 | |||
| ) |
Definition at line 464 of file Plo2dEch.c.
References wcscalelist::axis, ConstructSubWin(), Cscale, curwin(), wcscalelist::flag, wcscalelist::frect, get_window_scale(), wcscalelist::logflag, NULL, pSUBWIN_FEATURE, same_subwin(), sciGetCurrentFigure(), sciGetCurrentSubWin(), sciIsExistingSubWin(), sciprint(), sciSetCurrentObj(), sciSetSelectedSubWin(), set_scale(), set_window_scale(), and wcscalelist::subwin_rect.
Referenced by sci_xsetech().
00469 { 00470 /* if some arguments are null pointer we set them to 00471 * the corresponding Cscale value. 00472 * this is only important for StoreNEch which do not work with null arguments 00473 */ 00474 /* char flag[] = "tfffff";*/ /* flag to specify which arguments have changed*/ 00475 /* 14/03/2002*/ 00476 sciPointObj *masousfen; 00477 00478 char flag[7]; 00479 strcpy(flag,"tfffff"); 00480 00482 if ( WRect != NULL) 00483 { 00484 /* Ajout djalel */ 00485 00486 if (( masousfen = sciIsExistingSubWin (WRect)) != (sciPointObj *)NULL) 00487 sciSetSelectedSubWin(masousfen); 00488 else if ((masousfen = ConstructSubWin (sciGetCurrentFigure(), 0)) != NULL) 00489 { 00490 /* F.Leray Adding here 26.03.04*/ 00491 sciSetCurrentObj(masousfen); 00492 sciSetSelectedSubWin(masousfen); 00493 pSUBWIN_FEATURE (masousfen)->WRect[0] = WRect[0]; 00494 pSUBWIN_FEATURE (masousfen)->WRect[1] = WRect[1]; 00495 pSUBWIN_FEATURE (masousfen)->WRect[2] = WRect[2]; 00496 pSUBWIN_FEATURE (masousfen)->WRect[3] = WRect[3]; 00497 } 00498 00499 /* a subwindow is specified */ 00500 flag[1]='t'; 00501 if (! same_subwin( WRect, Cscale.subwin_rect)) 00502 { 00503 /* we are using a new subwin we keep current state 00504 * in scale list 00505 */ 00506 set_window_scale(curwin(),&Cscale); 00507 /* now we try to extract a previous scale with WRect as subwin 00508 * which becomes the new Cscale if it is found 00509 */ 00510 if ( get_window_scale(curwin(),WRect) == 0 ) 00511 { 00512 /* this is the first time WRect is used : we reset Cscale flag 00513 * Note also that if FRect is also specified in this call 00514 * Cscale.flag will be set to 1 bellow 00515 */ 00516 Cscale.flag = 0; 00517 } 00518 } 00519 } 00520 else WRect = Cscale.subwin_rect; 00521 if (FRect != NULL) 00522 { 00523 masousfen=sciGetCurrentSubWin(); 00524 pSUBWIN_FEATURE (masousfen)->SRect[0] = FRect[0]; 00525 pSUBWIN_FEATURE (masousfen)->SRect[2] = FRect[1]; 00526 pSUBWIN_FEATURE (masousfen)->SRect[1] = FRect[2]; 00527 pSUBWIN_FEATURE (masousfen)->SRect[3] = FRect[3]; 00528 } 00529 if ( FRect != NULL) flag[2]='t'; else FRect = Cscale.frect; 00530 00531 00532 if (ARect != NULL) 00533 { 00534 masousfen=sciGetCurrentSubWin(); 00535 pSUBWIN_FEATURE (masousfen)->ARect[0] = ARect[0]; 00536 pSUBWIN_FEATURE (masousfen)->ARect[1] = ARect[1]; 00537 pSUBWIN_FEATURE (masousfen)->ARect[2] = ARect[2]; 00538 pSUBWIN_FEATURE (masousfen)->ARect[3] = ARect[3]; 00539 } 00540 00541 if ( ARect != NULL) flag[5]='t'; else ARect = Cscale.axis; 00542 if ( logscale != NULL) flag[4] ='t'; else logscale = Cscale.logflag; 00543 if ( flag[4] == 't' && flag[2] == 't' ) 00544 { 00545 if (logscale[0]=='l') 00546 { 00547 if ( FRect[0] <= 0 || FRect[2] <= 0 ) 00548 { 00549 sciprint("Warning: negative boundaries on x scale with a log scale \n"); 00550 FRect[0]=1.e-8;FRect[2]=1.e+8; 00551 } 00552 FRect[0]=log10(FRect[0]); 00553 FRect[2]=log10(FRect[2]); 00554 } 00555 if (logscale[1]=='l') 00556 { 00557 if ( FRect[1] <= 0 || FRect[3] <= 0 ) 00558 { 00559 sciprint("Warning: negative boundaries on y scale with a log scale \n"); 00560 FRect[1]=1.e-8;FRect[3]=1.e+8; 00561 } 00562 FRect[1]=log10(FRect[1]); 00563 FRect[3]=log10(FRect[3]); 00564 } 00565 } 00566 set_scale(flag,WRect,FRect,NULL,logscale,ARect); 00567 return(0); 00568 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int PixelHeight2d | ( | sciPointObj * | parentSubWin, | |
| double | posY, | |||
| double | height | |||
| ) |
Convert a length from user coord. to pixels in 2D. This function is similar to HDouble2Pixel, but also use the logmode in 3D.
| parentSubWin | Axes in which the length is computed. | |
| posY | Y coordinate of where the distance is transformed (only used in log mode). | |
| height | converted height in user coord. |
Definition at line 1867 of file Plo2dEch.c.
References HLogScale, HScale, and pSUBWIN_FEATURE.
Referenced by drawTextEntity(), and getTextBoundingBox().
01868 { 01869 if ( pSUBWIN_FEATURE( parentSubWin )->logflags[1] == 'l' ) 01870 { 01871 return HLogScale( posY, height ) ; 01872 } 01873 01874 return HScale( height ) ; 01875 01876 }
Here is the caller graph for this function:

| int PixelWidth2d | ( | sciPointObj * | parentSubWin, | |
| double | posX, | |||
| double | width | |||
| ) |
Convert a length from user coord. to pixels in 2D. This function is similar to WDouble2Pixel, but also use the logmode in 3D.
| parentSubWin | Axes in which the length is computed. | |
| posX | X coordinate of where the distance is transformed (only used in log mode). | |
| height | converted width in user coord. |
Definition at line 1878 of file Plo2dEch.c.
References pSUBWIN_FEATURE, WLogScale, and WScale.
Referenced by drawTextEntity(), and getTextBoundingBox().
01879 { 01880 if ( pSUBWIN_FEATURE( parentSubWin )->logflags[0] == 'l' ) 01881 { 01882 return WLogScale( posX, width ) ; 01883 } 01884 01885 return WScale( width ) ; 01886 01887 }
Here is the caller graph for this function:

| void Plo2d2RealToPixel | ( | integer * | n1, | |
| integer * | n2, | |||
| double * | x, | |||
| double * | y, | |||
| integer * | xm, | |||
| integer * | ym, | |||
| char * | xf | |||
| ) |
Definition at line 1958 of file Plo2dEch.c.
References i, j, XLogScale(), XScale(), YLogScale(), and YScale().
Referenced by drawPolylineEntity().
01959 { 01960 integer i,j; 01962 if ((int)strlen(xf) >= 3 && xf[2]=='l') 01963 { 01964 for ( i=0 ; i < (*n2) ; i++) 01965 for (j=0 ; j< (*n1) ; j++) 01966 ym[2*i+1+2*(*n2)*j]= ym[2*i+2*(*n2)*j]= YLogScale(y[i+(*n2)*j]); 01967 } 01968 else 01969 { 01970 for ( i=0 ; i < (*n2) ; i++) 01971 for (j=0 ; j< (*n1) ; j++) 01972 ym[2*i+1+2*(*n2)*j]= ym[2*i+2*(*n2)*j]= YScale(y[i+(*n2)*j]); 01973 } 01974 01976 switch (xf[0]) 01977 { 01978 case 'e' : 01980 if ((int)strlen(xf) >= 2 && xf[1]=='l') 01981 for (j=0 ; j< (*n1) ; j++) 01982 { 01983 for ( i=1 ; i < (*n2) ; i++) 01984 { 01985 xm[2*i+2*(*n2)*j]= XLogScale(i+1.0); 01986 xm[2*i-1+2*(*n2)*j]=xm[2*i+2*(*n2)*j]; 01987 01988 } 01989 xm[2*(*n2)*j]= XScale(0); 01990 xm[2*(*n2)-1+ 2*(*n2)*j]= xm[2*(*n2-1)+ 2*(*n2)*j]; 01991 } 01992 else 01993 for (j=0 ; j< (*n1) ; j++) 01994 { 01995 for ( i=1 ; i < (*n2) ; i++) 01996 { 01997 xm[2*i+2*(*n2)*j]= XScale((i+1.0)); 01998 xm[2*i-1+2*(*n2)*j]=xm[2*i+2*(*n2)*j]; 01999 02000 } 02001 xm[2*(*n2)*j]= XScale(1.0); 02002 xm[2*(*n2)-1+ 2*(*n2)*j]= xm[2*(*n2-1)+ 2*(*n2)*j]; 02003 } 02004 break ; 02005 case 'o' : 02006 if ((int)strlen(xf) >= 2 && xf[1]=='l') 02007 for (j=0 ; j< (*n1) ; j++) 02008 { 02009 for ( i=1 ; i < (*n2) ; i++) 02010 { 02011 02012 xm[2*i+2*(*n2)*j]= XLogScale(x[i]); 02013 xm[2*i-1+2*(*n2)*j]=xm[2*i+2*(*n2)*j]; 02014 } 02015 xm[2*(*n2)*j]= XLogScale(x[0]); 02016 xm[2*(*n2)-1+ 2*(*n2)*j]= xm[2*(*n2-1)+ 2*(*n2)*j]; 02017 } 02018 else 02019 for (j=0 ; j< (*n1) ; j++) 02020 { 02021 for ( i=1 ; i < (*n2) ; i++) 02022 { 02023 xm[2*i+2*(*n2)*j]= XScale(x[i]); 02024 xm[2*i-1+2*(*n2)*j]=xm[2*i+2*(*n2)*j]; 02025 02026 } 02027 xm[2*(*n2)*j]= XScale(x[0]); 02028 xm[2*(*n2)-1+ 2*(*n2)*j]= xm[2*(*n2-1)+ 2*(*n2)*j]; 02029 } 02030 break; 02031 case 'g' : 02032 default: 02033 if ((int)strlen(xf) >= 2 && xf[1]=='l') 02034 for (j=0 ; j< (*n1) ; j++) 02035 { 02036 for ( i=1 ; i < (*n2) ; i++) 02037 { 02038 xm[2*i+2*(*n2)*j]= XLogScale(x[i+(*n2)*j]); 02039 xm[2*i-1+2*(*n2)*j]=xm[2*i+2*(*n2)*j]; 02040 02041 } 02042 xm[2*(*n2)*j]= XLogScale(x[(*n2)*j]); 02043 xm[2*(*n2)-1+ 2*(*n2)*j]= xm[2*(*n2-1)+ 2*(*n2)*j]; 02044 } 02045 else 02046 for (j=0 ; j< (*n1) ; j++) 02047 { 02048 for ( i=1 ; i < (*n2) ; i++) 02049 { 02050 xm[2*i+2*(*n2)*j]= XScale(x[i+(*n2)*j]); 02051 xm[2*i-1+2*(*n2)*j]=xm[2*i+2*(*n2)*j]; 02052 02053 } 02054 xm[2*(*n2)*j]= XScale(x[(*n2)*j]); 02055 xm[2*(*n2)-1+ 2*(*n2)*j]= xm[2*(*n2-1)+ 2*(*n2)*j]; 02056 } 02057 break; 02058 } 02059 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Plo2d3RealToPixel | ( | integer * | n1, | |
| integer * | n2, | |||
| double * | x, | |||
| double * | y, | |||
| integer * | xm, | |||
| integer * | ym, | |||
| char * | xf | |||
| ) |
Definition at line 2061 of file Plo2dEch.c.
References sciSubWindow::FRect, i, j, sciSubWindow::logflags, pSUBWIN_FEATURE, sciGetCurrentSubWin(), XLogScale(), XScale(), YLogScale(), and YScale().
Referenced by drawPolylineEntity().
02062 { 02063 integer i,j; 02065 double y_zero = 0.; 02066 sciPointObj * psubwin = sciGetCurrentSubWin(); 02067 sciSubWindow * ppsubwin = pSUBWIN_FEATURE(psubwin); 02068 02069 if(ppsubwin->logflags[1]=='l') 02070 { 02071 y_zero = ppsubwin->FRect[1]; 02072 } 02073 02074 02075 02076 if ((int)strlen(xf) >= 3 && xf[2]=='l') 02077 { 02078 for ( i=0 ; i < (*n2) ; i++) 02079 for (j=0 ; j< (*n1) ; j++) 02080 { 02081 ym[2*i+1+2*(*n2)*j]= YScale(y_zero); 02082 ym[2*i+2*(*n2)*j]= YLogScale(y[i+(*n2)*j]); 02083 } 02084 } 02085 else 02086 { 02087 for ( i=0 ; i < (*n2) ; i++) 02088 for (j=0 ; j< (*n1) ; j++) 02089 { 02090 ym[2*i+1+2*(*n2)*j]= YScale(y_zero); 02091 ym[2*i+2*(*n2)*j]= YScale(y[i+(*n2)*j]); 02092 } 02093 } 02094 02096 switch (xf[0]) 02097 { 02098 case 'e' : 02100 if ((int)strlen(xf) >= 2 && xf[1]=='l') 02101 for (j=0 ; j< (*n1) ; j++) 02102 { 02103 for ( i=0 ; i < (*n2) ; i++) 02104 { 02105 xm[2*i+2*(*n2)*j]= XLogScale(i+1.0); 02106 xm[2*i+1+2*(*n2)*j]=xm[2*i+2*(*n2)*j]; 02107 02108 } 02109 } 02110 else 02111 for (j=0 ; j< (*n1) ; j++) 02112 { 02113 for ( i=0 ; i < (*n2) ; i++) 02114 { 02115 xm[2*i+2*(*n2)*j]= XScale((i+1.0)); 02116 xm[2*i+1+2*(*n2)*j]=xm[2*i+2*(*n2)*j]; 02117 02118 } 02119 } 02120 break ; 02121 case 'o' : 02122 if ((int)strlen(xf) >= 2 && xf[1]=='l') 02123 for (j=0 ; j< (*n1) ; j++) 02124 { 02125 for ( i=0 ; i < (*n2) ; i++) 02126 { 02127 02128 xm[2*i+2*(*n2)*j]= XLogScale(x[i]); 02129 xm[2*i+1+2*(*n2)*j]=xm[2*i+2*(*n2)*j]; 02130 } 02131 } 02132 else 02133 for (j=0 ; j< (*n1) ; j++) 02134 { 02135 for ( i=0 ; i < (*n2) ; i++) 02136 { 02137 xm[2*i+2*(*n2)*j]= XScale(x[i]); 02138 xm[2*i+1+2*(*n2)*j]=xm[2*i+2*(*n2)*j]; 02139 02140 } 02141 } 02142 break; 02143 case 'g' : 02144 default: 02145 if ((int)strlen(xf) >= 2 && xf[1]=='l') 02146 for (j=0 ; j< (*n1) ; j++) 02147 { 02148 for ( i=0 ; i < (*n2) ; i++) 02149 { 02150 xm[2*i+2*(*n2)*j]= XLogScale(x[i+(*n2)*j]); 02151 xm[2*i+1+2*(*n2)*j]=xm[2*i+2*(*n2)*j]; 02152 02153 } 02154 } 02155 else 02156 for (j=0 ; j< (*n1) ; j++) 02157 { 02158 for ( i=0 ; i < (*n2) ; i++) 02159 { 02160 xm[2*i+2*(*n2)*j]= XScale(x[i+(*n2)*j]); 02161 xm[2*i+1+2*(*n2)*j]=xm[2*i+2*(*n2)*j]; 02162 } 02163 } 02164 break; 02165 } 02166 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Plo2d4RealToPixel | ( | integer * | n1, | |
| integer * | n2, | |||
| double * | x, | |||
| double * | y, | |||
| integer * | xm, | |||
| integer * | ym, | |||
| char * | xf | |||
| ) |
Definition at line 2168 of file Plo2dEch.c.
References i, j, XLogScale(), XScale(), YLogScale(), and YScale().
Referenced by drawPolylineEntity().
02169 { 02170 integer i,j; 02172 if ((int)strlen(xf) >= 3 && xf[2]=='l') 02173 { 02174 for ( i=0 ; i < (*n2) ; i++) 02175 for (j=0 ; j< (*n1) ; j++) 02176 ym[2*i+2*(*n2)*j]= YLogScale(y[i+(*n2)*j]); 02177 for ( i=0 ; i < (*n2)-1 ; i++) 02178 for (j=0 ; j< (*n1) ; j++) 02179 ym[2*i+1+2*(*n2)*j]= ym[2*i+2+2*(*n2)*j]; 02180 } 02181 else 02182 { 02183 for ( i=0 ; i < (*n2) ; i++) 02184 for (j=0 ; j< (*n1) ; j++) 02185 ym[2*i+2*(*n2)*j]= YScale(y[i+(*n2)*j]); 02186 for ( i=0 ; i < (*n2)-1 ; i++) 02187 for (j=0 ; j< (*n1) ; j++) 02188 ym[2*i+1+2*(*n2)*j]= ym[2*i+2+2*(*n2)*j]; 02189 02190 } 02191 02193 switch (xf[0]) 02194 { 02195 case 'e' : 02197 if ((int)strlen(xf) >= 2 && xf[1]=='l') 02198 { 02199 for (j=0 ; j< (*n1) ; j++) 02200 for ( i=0 ; i < (*n2) ; i++) 02201 xm[2*i+2*(*n2)*j]= XLogScale(i+1.0); 02202 for (j=0 ; j< (*n1) ; j++) 02203 for ( i=0 ; i < (*n2)-1 ; i++) 02204 xm[2*i+1+2*(*n2)*j]= xm[2*i+2+2*(*n2)*j]; 02205 } 02206 else 02207 { 02208 for (j=0 ; j< (*n1) ; j++) 02209 for ( i=0 ; i < (*n2) ; i++) 02210 xm[2*i+2*(*n2)*j]= XScale((i+1.0)); 02211 for (j=0 ; j< (*n1) ; j++) 02212 for ( i=0 ; i < (*n2)-1 ; i++) 02213 xm[2*i+1+2*(*n2)*j]= xm[2*i+2+2*(*n2)*j]; 02214 } 02215 break ; 02216 case 'o' : 02217 if ((int)strlen(xf) >= 2 && xf[1]=='l') 02218 { 02219 for (j=0 ; j< (*n1) ; j++) 02220 for ( i=0 ; i < (*n2) ; i++) 02221 xm[2*i+2*(*n2)*j]= XLogScale(x[i]); 02222 for (j=0 ; j< (*n1) ; j++) 02223 for ( i=0 ; i < (*n2)-1 ; i++) 02224 xm[2*i+1+2*(*n2)*j]= xm[2*i+2+2*(*n2)*j]; 02225 } 02226 else 02227 02228 { 02229 for (j=0 ; j< (*n1) ; j++) 02230 for ( i=0 ; i < (*n2) ; i++) 02231 xm[2*i+2*(*n2)*j]= XScale(x[i]); 02232 for (j=0 ; j< (*n1) ; j++) 02233 for ( i=0 ; i < (*n2)-1 ; i++) 02234 xm[2*i+1+2*(*n2)*j]= xm[2*i+2+2*(*n2)*j]; 02235 02236 } 02237 break; 02238 case 'g' : 02239 default: 02240 if ((int)strlen(xf) >= 2 && xf[1]=='l') 02241 { 02242 for (j=0 ; j< (*n1) ; j++) 02243 for ( i=0 ; i < (*n2) ; i++) 02244 xm[2*i+2*(*n2)*j]= XLogScale(x[i+(*n2)*j]); 02245 for (j=0 ; j< (*n1) ; j++) 02246 for ( i=0 ; i < (*n2)-1 ; i++) 02247 xm[2*i+1+2*(*n2)*j]= xm[2*i+2+2*(*n2)*j]; 02248 02249 } 02250 else 02251 { 02252 for (j=0 ; j< (*n1) ; j++) 02253 for ( i=0 ; i < (*n2) ; i++) 02254 xm[2*i+2*(*n2)*j]= XScale(x[i+(*n2)*j]); 02255 for (j=0 ; j< (*n1) ; j++) 02256 for ( i=0 ; i < (*n2)-1 ; i++) 02257 xm[2*i+1+2*(*n2)*j]= xm[2*i+2+2*(*n2)*j]; 02258 02259 } 02260 break; 02261 } 02262 }
Here is the call graph for this function:

Here is the caller graph for this function:

meme chose mais pour transformer des rectangles
double to integer (pixel) direction
Definition at line 949 of file Plo2dEch.c.
References Cscale, i, inint, wcscalelist::logflag, wcscalelist::Wscx1, wcscalelist::Wscy1, XLogScale(), XScale(), YLogScale(), and YScale().
Referenced by drawrectangle_1(), drawrectangles_1(), and sciIsClicked().
00950 { 00951 integer i; 00952 if (strcmp("f2i",dir)==0) 00953 { 00955 for ( i=0 ; i < (*n) ; i= i+4) 00956 { 00957 if ( Cscale.logflag[0] == 'n' ) 00958 { 00959 x1[i]= XScale(x[i]); 00960 x1[i+2]=inint( Cscale.Wscx1*( x[i+2])); 00961 } 00962 else 00963 { 00964 x1[i]= XLogScale(x[i]); 00965 x1[i+2]=inint( Cscale.Wscx1*(log10((x[i]+x[i+2])/x[i]))); 00966 } 00967 if ( Cscale.logflag[1] == 'n' ) 00968 { 00969 x1[i+1]= YScale(x[i+1]); 00970 x1[i+3]=inint( Cscale.Wscy1*( x[i+3])); 00971 } 00972 else 00973 { 00974 x1[i+1]= YLogScale(x[i+1]); 00975 x1[i+3]=inint( Cscale.Wscy1*(log10(x[i+1]/(x[i+1]-x[i+3])))); 00976 } 00977 } 00978 } 00979 else if (strcmp("i2f",dir)==0) 00980 { 00981 for ( i=0 ; i < (*n) ; i=i+4) 00982 { 00983 if ( Cscale.logflag[0] == 'n' ) 00984 { 00985 x[i]= XPi2R(x1[i] ); 00986 x[i+2]=x1[i+2]/Cscale.Wscx1; 00987 } 00988 else 00989 { 00990 x[i]=exp10( XPi2R(x1[i])); 00991 x[i+2]=exp10(XPi2R( x1[i]+x1[i+2] )); 00992 x[i+2] -= x[i]; 00993 } 00994 if ( Cscale.logflag[1] == 'n' ) 00995 { 00996 x[i+1]= YPi2R( x1[i+1]); 00997 x[i+3]=x1[i+3]/Cscale.Wscy1; 00998 } 00999 else 01000 { 01001 x[i+1]=exp10( YPi2R( x1[i+1])); 01002 x[i+3]=exp10( YPi2R( x1[i+3]+x1[i+1])); 01003 x[i+2] -= x[i+1]; 01004 } 01005 } 01006 } 01007 else 01008 sciprint(" Wrong dir %s argument in echelle2d\r\n",dir); 01009 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void rectangleDouble2Pixel | ( | sciPointObj * | parentSubWin, | |
| double | ulPoint[3], | |||
| double | userSize[2], | |||
| int | edgesX[4], | |||
| int | edgesY[4] | |||
| ) |
Give the position of the 4 corners of a rectangle in pixels given the position of its upper left point in user coordiantes and its size. It works in every axes mode (2D/3D, log, reverse).
| parentSubWin | Subwindow in which the rectangle is drawn. | |
| ulPoint | Coordinates of the upper left point of the rectangle in user coord. | |
| userSize | Width and height of the rectangle in user coord. | |
| edgesX | X coordinates of the resulting positions. | |
| edgesY | Y coordinates of the resulting positions. |
Definition at line 1889 of file Plo2dEch.c.
References sciSubWindow::axes, HDouble2Pixel, sciSubWindow::is3d, pSUBWIN_FEATURE, AXES::reverse, ReverseDataFor3D(), trans3d(), WDouble2Pixel, XDouble2Pixel, and YDouble2Pixel.
Referenced by drawRectangleEntity().
01894 { 01895 sciSubWindow * ppSubWin = pSUBWIN_FEATURE( parentSubWin ) ; 01896 01897 if ( ppSubWin->is3d ) 01898 { 01899 double rectx[4],recty[4],rectz[4]; 01900 int n = 4 ; 01901 rectx[0] = rectx[3] = ulPoint[0] ; 01902 rectx[1] = rectx[2] = ulPoint[0] + userSize[0] ; 01903 recty[0] = recty[1] = ulPoint[1] ; 01904 recty[2] = recty[3] = ulPoint[1] - userSize[1]; 01905 rectz[0] = rectz[1] = rectz[2]= rectz[3] = ulPoint[2] ; 01906 01907 ReverseDataFor3D( parentSubWin, rectx, recty, rectz, n); 01908 01909 trans3d( parentSubWin,n,edgesX,edgesY,rectx,recty,rectz) ; 01910 } 01911 else 01912 { 01913 /* 2D mode */ 01914 /* position of the upper left point of the rectangle with reverse axes. */ 01915 double realPoint[2] ; 01916 int ulPointPix[2] ; 01917 int sizePix[2] ; 01918 01919 if ( ppSubWin->axes.reverse[0] ) 01920 { 01921 realPoint[0] = ulPoint[0] + userSize[0] ; 01922 } 01923 else 01924 { 01925 realPoint[0] = ulPoint[0] ; 01926 } 01927 01928 if ( ppSubWin->axes.reverse[1] ) 01929 { 01930 realPoint[1] = ulPoint[1] - userSize[1] ; 01931 } 01932 else 01933 { 01934 realPoint[1] = ulPoint[1] ; 01935 } 01936 01937 ulPointPix[0] = XDouble2Pixel( realPoint[0] ) ; 01938 ulPointPix[1] = YDouble2Pixel( realPoint[1] ) ; 01939 01940 /* Nouvelles fonctions de changement d'echelle pour les longueurs --> voir PloEch.h */ 01941 sizePix[0] = WDouble2Pixel( ulPoint[0], userSize[0] ) ; 01942 /* for y we take the length from the bottom left corner */ 01943 sizePix[1] = HDouble2Pixel( ulPoint[1] - userSize[1], userSize[1] ) ; 01944 01945 edgesX[0] = ulPointPix[0] ; 01946 edgesX[1] = ulPointPix[0] + sizePix[0] ; 01947 edgesX[2] = ulPointPix[0] + sizePix[0] ; 01948 edgesX[3] = ulPointPix[0] ; 01949 01950 edgesY[0] = ulPointPix[1] ; 01951 edgesY[1] = ulPointPix[1] ; 01952 edgesY[2] = ulPointPix[1] + sizePix[1] ; 01953 edgesY[3] = ulPointPix[1] + sizePix[1] ; 01954 01955 } 01956 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void scizoom | ( | double | bbox[4], | |
| sciPointObj * | pobj | |||
| ) |
Definition at line 1794 of file Plo2dEch.c.
References C2F, graduate(), lmax(), lmin(), max, min, pSUBWIN_FEATURE, sciGetZooming(), and sciSetZooming().
Referenced by set_zoom_box_property().
01795 { 01796 sciPointObj *psousfen; 01797 double fmin,fmax,lmin,lmax; 01798 integer min,max,puiss,deux=2,dix=10; 01799 psousfen= pobj; /* ??? */ 01800 01801 if ( !( sciGetZooming(pobj) ) ) 01802 { 01803 sciSetZooming(psousfen, 1); 01804 } 01806 fmin= bbox[0]; 01807 fmax= bbox[2]; 01808 if( pSUBWIN_FEATURE (psousfen)->logflags[0] == 'n' ) 01809 { 01810 C2F(graduate)(&fmin, &fmax,&lmin,&lmax,&deux,&dix,&min,&max,&puiss) ; 01811 pSUBWIN_FEATURE(psousfen)->axes.xlim[2]=puiss; 01812 pSUBWIN_FEATURE (psousfen)->ZRect[0]=lmin; 01813 pSUBWIN_FEATURE (psousfen)->ZRect[2]=lmax; 01814 } 01815 else 01816 { 01817 pSUBWIN_FEATURE(psousfen)->axes.xlim[2]=0; 01818 pSUBWIN_FEATURE (psousfen)->ZRect[0]=fmin; 01819 pSUBWIN_FEATURE (psousfen)->ZRect[2]=fmax; 01820 } 01821 01822 fmin= bbox[1]; 01823 fmax= bbox[3]; 01824 if ( pSUBWIN_FEATURE (psousfen)->logflags[1] == 'n' ) 01825 { 01826 C2F(graduate)(&fmin, &fmax,&lmin,&lmax,&deux,&dix,&min,&max,&puiss) ; 01827 pSUBWIN_FEATURE(psousfen)->axes.ylim[2]=puiss; 01828 pSUBWIN_FEATURE (psousfen)->ZRect[1]=lmin; 01829 pSUBWIN_FEATURE (psousfen)->ZRect[3]=lmax; 01830 } 01831 else 01832 { 01833 pSUBWIN_FEATURE(psousfen)->axes.ylim[2]=0; 01834 pSUBWIN_FEATURE (psousfen)->ZRect[1]=fmin; 01835 pSUBWIN_FEATURE (psousfen)->ZRect[3]=fmax; 01836 } 01837 01838 /* default values when zooming in 3d */ 01839 /* and scizoom takes only xmin ymin xmax ymax AND not zmin zmax (for now at least) */ 01840 /* F.Leray 29.09.05 */ 01841 pSUBWIN_FEATURE (psousfen)->ZRect[4] = pSUBWIN_FEATURE (psousfen)->SRect[4]; 01842 pSUBWIN_FEATURE (psousfen)->ZRect[5] = pSUBWIN_FEATURE (psousfen)->SRect[5]; 01843 01844 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void set_scale | ( | char | flag[6], | |
| double | subwin[4], | |||
| double | frame_values[4], | |||
| integer | aaint[4], | |||
| char | logflag[3], | |||
| double | axis_values[4] | |||
| ) |
Definition at line 632 of file Plo2dEch.c.
References C2F, Cscale, dr(), i, L, PD0, PI0, wcscalelist::subwin_rect, and wcscalelist::wdim.
Referenced by DrawAxes(), drawSubWinEntity(), Nsetscale2d(), sci_draw(), sciInitSelectedSubWin(), sciIsClicked(), set_axes_bounds_property(), SetEch3d1(), setscale2d(), updateScale3d(), and updateSubWinScale().
00644 { 00645 char c; 00646 char wdim_changed= 'f',subwin_changed='f'; 00647 char frame_values_changed='f',aaint_changed='f'; 00648 char logflag_changed='f'; 00649 char axis_changed = 'f'; 00650 integer verbose=0,narg,wdim[2]; 00651 int i; 00652 if ( flag[0] == 't' ) 00653 { 00654 C2F(dr)("xget","wdim",&verbose,wdim,&narg, PI0, PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 00655 if ( Cscale.wdim[0] != wdim[0] || Cscale.wdim[1] != wdim[1]) 00656 { 00657 Cscale.wdim[0] = wdim[0]; Cscale.wdim[1] = wdim[1]; 00658 wdim_changed='t'; 00659 } 00660 } 00661 if ( flag[1] == 't' ) 00662 { 00663 for (i=0; i < 4 ; i++ ) 00664 if ( subwin[i] != Cscale.subwin_rect[i]) { subwin_changed='t' ; break;} 00665 } 00666 if ( flag[2] == 't' ) 00667 { 00668 for (i=0; i < 4 ; i++ ) 00669 if ( frame_values[i] != Cscale.frect[i]) { frame_values_changed='t' ; break;} 00670 /* if no scales were present and the values given are the same as the 00671 * default frect values we must register that we are setting a scale 00672 */ 00673 if ( Cscale.flag == 0) frame_values_changed='t' ; 00674 } 00675 if ( flag[3] == 't' ) 00676 { 00677 for (i=0; i < 4 ; i++ ) 00678 if ( aaint[i] != Cscale.Waaint1[i]) { aaint_changed='t' ; break;} 00679 } 00680 if ( flag[4] == 't' ) 00681 { 00682 for (i=0; i < 2 ; i++ ) 00683 if ( logflag[i] != Cscale.logflag[i]) { logflag_changed='t' ; break;} 00684 } 00685 if ( flag[5] == 't' ) 00686 { 00687 for (i=0; i < 4 ; i++ ) 00688 if ( axis_values[i] != Cscale.axis[i]) { axis_changed='t' ; break;} 00689 } 00690 if ( axis_changed == 't') 00691 { 00692 for (i=0; i < 4 ; i++ ) Cscale.axis[i] = axis_values[i]; 00693 } 00694 00695 if ( subwin_changed == 't' ) 00696 { 00697 for (i=0; i < 4 ; i++ ) Cscale.subwin_rect[i] = subwin[i]; 00698 } 00699 if ( frame_values_changed == 't' ) 00700 { 00701 for (i=0; i < 4 ; i++) Cscale.frect[i]=frame_values[i]; 00702 /* the scale is no more a default scale */ 00703 Cscale.flag = 1; 00704 } 00705 if ( wdim_changed == 't' || subwin_changed == 't' || frame_values_changed == 't' 00706 || axis_changed == 't' ) 00707 { 00708 /* Upgrading constants for 2D transformation */ 00709 double scx,scy,xoff,yoff,val; 00710 00711 sciPointObj *pobj = sciGetCurrentSubWin(); 00712 sciSubWindow * ppsubwin = pSUBWIN_FEATURE (pobj); 00713 00714 scx = ((double) Cscale.wdim[0]*Cscale.subwin_rect[2]-Cscale.wdim[0]*Cscale.subwin_rect[2] 00715 *(Cscale.axis[0]+Cscale.axis[1])); 00716 scy = ((double) Cscale.wdim[1]*Cscale.subwin_rect[3]-Cscale.wdim[1]*Cscale.subwin_rect[3] 00717 *(Cscale.axis[2]+Cscale.axis[3])); 00718 xoff= ((double) Cscale.wdim[0]*Cscale.subwin_rect[2])*(Cscale.axis[0]); 00719 yoff= ((double) Cscale.wdim[1]*Cscale.subwin_rect[3])*(Cscale.axis[2]); 00720 00721 Cscale.Wxofset1= xoff+Cscale.subwin_rect[0]*((double)Cscale.wdim[0]); 00722 Cscale.Wyofset1= yoff+Cscale.subwin_rect[1]*((double)Cscale.wdim[1]); 00723 Cscale.Wscx1 = scx; 00724 Cscale.Wscy1 = scy; 00725 00726 val = Abs(Cscale.frect[0]- Cscale.frect[2]); 00727 Cscale.Wscx1 = (val <=SMDOUBLE) ? Cscale.Wscx1/SMDOUBLE : Cscale.Wscx1/val; 00728 val = Abs(Cscale.frect[1]- Cscale.frect[3]); 00729 Cscale.Wscy1 = (val <=SMDOUBLE) ? Cscale.Wscy1/SMDOUBLE : Cscale.Wscy1/val; 00730 00731 /* F.Leray 12.10.04 : MODIF named scale_modification*/ 00732 if(ppsubwin->axes.reverse[0]==TRUE && ppsubwin->is3d == FALSE) 00733 { 00734 Cscale.WIRect1[0] = XScale( Cscale.frect[2]); 00735 Cscale.WIRect1[2] = Abs(XScale( Cscale.frect[2]) - XScale( Cscale.frect[0])); 00736 } 00737 else 00738 { 00739 Cscale.WIRect1[0] = XScale( Cscale.frect[0]); 00740 Cscale.WIRect1[2] = Abs(XScale( Cscale.frect[2]) - XScale( Cscale.frect[0])); 00741 } 00742 00743 if(ppsubwin->axes.reverse[1]==TRUE && ppsubwin->is3d == FALSE) 00744 { 00745 Cscale.WIRect1[1] = YScale( Cscale.frect[1]); 00746 Cscale.WIRect1[3] = Abs(YScale( Cscale.frect[3]) - YScale( Cscale.frect[1])); 00747 } 00748 else 00749 { 00750 Cscale.WIRect1[1] = YScale( Cscale.frect[3]); 00751 Cscale.WIRect1[3] = Abs(YScale( Cscale.frect[3]) - YScale( Cscale.frect[1])); 00752 } 00753 } 00754 if ( aaint_changed== 't' ) 00755 { 00756 for (i=0; i < 4 ; i++) Cscale.Waaint1[i]=aaint[i]; 00757 } 00758 if ( logflag_changed== 't' ) 00759 { 00760 Cscale.logflag[0]=logflag[0]; Cscale.logflag[1]=logflag[1]; 00761 } 00762 if ( aaint_changed== 't' || frame_values_changed == 't') 00763 { 00764 Cscale.xtics[0] = Cscale.frect[0]; 00765 Cscale.xtics[1] = Cscale.frect[2]; 00766 Cscale.ytics[0] = Cscale.frect[1]; 00767 Cscale.ytics[1] = Cscale.frect[3]; 00768 Cscale.xtics[2] = 0.0; 00769 Cscale.ytics[2] = 0.0; 00770 Cscale.xtics[3] = Cscale.Waaint1[1]; 00771 Cscale.ytics[3] = Cscale.Waaint1[3]; 00772 } 00773 00775 if ( (c=GetDriver()) == 'X' || c == 'R' || c == 'I' || c == 'G' || c == 'W' ) 00776 { 00777 set_window_scale(curwin(),&Cscale); 00778 } 00779 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void set_window_scale_with_default | ( | int | i | ) |
Definition at line 110 of file Plo2dEch.c.
References Defscale, and set_window_scale().
Referenced by CleanPlots().
00110 { set_window_scale(i,&Defscale);}
Here is the call graph for this function:

Here is the caller graph for this function:

| void ShowScales | ( | void | ) |
Definition at line 380 of file Plo2dEch.c.
References Cscale, wcscalelist::flag, sciprint(), show_scales(), wcscalelist::subwin_rect, and The_List.
Referenced by sci_xsetech().
00381 { 00382 sciprint("-----------scales-------------\r\n"); 00383 show_scales(The_List); 00384 sciprint("----------current scale-------\r\n"); 00385 sciprint("\tsubwin=[%5.2f,%5.2f,%5.2f,%5.2f], flag=%d\r\n", 00386 Cscale.subwin_rect[0],Cscale.subwin_rect[1],Cscale.subwin_rect[2],Cscale.subwin_rect[3], 00387 Cscale.flag); 00388 sciprint("-----------end----------------\r\n"); 00389 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void unzoom | ( | void | ) |
Definition at line 1372 of file Plo2dEch.c.
References C2F, dr1(), graduate(), L, lmax(), lmin(), max, min, NULL, PD0, PI0, tagSons::pnext, tagSons::pointobj, pSUBWIN_FEATURE, SCI_SUBWIN, sciDrawObj(), sciGetCurrentFigure(), sciGetEntityType(), sciGetSons(), sciGetZooming(), and sciSetZooming().
Referenced by sci_unzoom(), scig_unzoom(), set_zoom_box_property(), and set_zoom_state_property().
01373 { 01374 integer ww,verbose=0,narg; 01376 double fmin,fmax,lmin,lmax; 01377 integer min,max,puiss,deux=2,dix=10; 01378 sciPointObj *psousfen; 01379 sciSons *psonstmp; 01380 01381 01382 C2F(dr1)("xclear","v",PI0,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 01383 C2F(dr1)("xget","window",&verbose,&ww,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 01384 /***** 02/10/2002 ****/ 01385 psonstmp = sciGetSons (sciGetCurrentFigure()); 01386 while (psonstmp != (sciSons *) NULL) 01387 { 01388 if(sciGetEntityType (psonstmp->pointobj) == SCI_SUBWIN) 01389 { 01390 psousfen= (sciPointObj *)psonstmp->pointobj; 01391 if (sciGetZooming(psousfen)) 01392 { 01393 sciSetZooming(psousfen, 0); 01394 /* pSUBWIN_FEATURE (psousfen)->ZRect[0] = pSUBWIN_FEATURE (psousfen)->ZRect_kp[0]; */ 01395 /* pSUBWIN_FEATURE (psousfen)->ZRect[1] = pSUBWIN_FEATURE (psousfen)->ZRect_kp[1]; */ 01396 /* pSUBWIN_FEATURE (psousfen)->ZRect[2] = pSUBWIN_FEATURE (psousfen)->ZRect_kp[2]; */ 01397 /* pSUBWIN_FEATURE (psousfen)->ZRect[3] = pSUBWIN_FEATURE (psousfen)->ZRect_kp[3]; */ 01398 01399 pSUBWIN_FEATURE (psousfen)->ZRect[0] = pSUBWIN_FEATURE (psousfen)->SRect[0]; 01400 pSUBWIN_FEATURE (psousfen)->ZRect[1] = pSUBWIN_FEATURE (psousfen)->SRect[1]; 01401 pSUBWIN_FEATURE (psousfen)->ZRect[2] = pSUBWIN_FEATURE (psousfen)->SRect[2]; 01402 pSUBWIN_FEATURE (psousfen)->ZRect[3] = pSUBWIN_FEATURE (psousfen)->SRect[3]; 01403 01404 /*} SS: moved below because if sciGetZooming(psousfen)==0 01405 ZRect is undefined -> code may enter in infinite recursion loop to compute graduation 01406 and there is no use to regraduate */ 01407 01409 fmin= pSUBWIN_FEATURE (psousfen)->ZRect[0]; 01410 fmax= pSUBWIN_FEATURE (psousfen)->ZRect[2]; 01411 C2F(graduate)(&fmin, &fmax,&lmin,&lmax,&deux,&dix,&min,&max,&puiss) ; 01412 pSUBWIN_FEATURE(psousfen)->axes.xlim[2]=puiss; 01413 01414 fmin= pSUBWIN_FEATURE (psousfen)->ZRect[1]; 01415 fmax= pSUBWIN_FEATURE (psousfen)->ZRect[3]; 01416 C2F(graduate)(&fmin, &fmax,&lmin,&lmax,&deux,&dix,&min,&max,&puiss) ; 01417 pSUBWIN_FEATURE(psousfen)->axes.ylim[2]=puiss; 01418 /*****/ 01419 } 01420 } 01421 psonstmp = psonstmp->pnext; 01422 } 01423 01424 sciDrawObj(sciGetCurrentFigure()); 01425 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void unzoom_one_axes | ( | sciPointObj * | psousfen | ) |
Definition at line 1427 of file Plo2dEch.c.
References C2F, graduate(), lmax(), lmin(), max, min, pSUBWIN_FEATURE, SCI_SUBWIN, sciDrawObj(), sciGetCurrentFigure(), sciGetEntityType(), sciGetZooming(), and sciSetZooming().
Referenced by sci_unzoom().
01428 { 01429 double fmin,fmax,lmin,lmax; 01430 integer min,max,puiss,deux=2,dix=10; 01431 01432 if (sciGetEntityType (psousfen) == SCI_SUBWIN) { 01433 if (sciGetZooming(psousfen)) { 01434 sciSetZooming(psousfen, 0); 01435 /* pSUBWIN_FEATURE (psousfen)->ZRect[0] = pSUBWIN_FEATURE (psousfen)->ZRect_kp[0]; */ 01436 /* pSUBWIN_FEATURE (psousfen)->ZRect[1] = pSUBWIN_FEATURE (psousfen)->ZRect_kp[1]; */ 01437 /* pSUBWIN_FEATURE (psousfen)->ZRect[2] = pSUBWIN_FEATURE (psousfen)->ZRect_kp[2]; */ 01438 /* pSUBWIN_FEATURE (psousfen)->ZRect[3] = pSUBWIN_FEATURE (psousfen)->ZRect_kp[3]; */ 01439 01440 pSUBWIN_FEATURE (psousfen)->ZRect[0] = pSUBWIN_FEATURE (psousfen)->SRect[0]; 01441 pSUBWIN_FEATURE (psousfen)->ZRect[1] = pSUBWIN_FEATURE (psousfen)->SRect[1]; 01442 pSUBWIN_FEATURE (psousfen)->ZRect[2] = pSUBWIN_FEATURE (psousfen)->SRect[2]; 01443 pSUBWIN_FEATURE (psousfen)->ZRect[3] = pSUBWIN_FEATURE (psousfen)->SRect[3]; 01444 01445 } 01446 01448 fmin= pSUBWIN_FEATURE (psousfen)->ZRect[0]; 01449 fmax= pSUBWIN_FEATURE (psousfen)->ZRect[2]; 01450 C2F(graduate)(&fmin, &fmax,&lmin,&lmax,&deux,&dix,&min,&max,&puiss) ; 01451 pSUBWIN_FEATURE(psousfen)->axes.xlim[2]=puiss; 01452 01453 fmin= pSUBWIN_FEATURE (psousfen)->ZRect[1]; 01454 fmax= pSUBWIN_FEATURE (psousfen)->ZRect[3]; 01455 C2F(graduate)(&fmin, &fmax,&lmin,&lmax,&deux,&dix,&min,&max,&puiss) ; 01456 pSUBWIN_FEATURE(psousfen)->axes.ylim[2]=puiss; 01457 01458 sciDrawObj(sciGetCurrentFigure()); 01459 } 01460 }
Here is the call graph for this function:

Here is the caller graph for this function:

| double XDPi2R | ( | double | x | ) |
Definition at line 1650 of file Plo2dEch.c.
References sciSubWindow::axes, Cscale, FALSE, wcscalelist::frect, sciSubWindow::is3d, pSUBWIN_FEATURE, AXES::reverse, sciGetCurrentSubWin(), sciprint(), TRUE, wcscalelist::Wscx1, and wcscalelist::Wxofset1.
01651 { 01652 /*F.Leray 12.10.04 : MODIF named scale_modification*/ 01653 sciPointObj *pobj = sciGetCurrentSubWin(); 01654 sciSubWindow * ppsubwin = pSUBWIN_FEATURE (pobj); 01655 01656 if(ppsubwin->axes.reverse[0]==TRUE && ppsubwin->is3d == FALSE) 01657 return Cscale.frect[2] - (1.0/Cscale.Wscx1)*((x) - Cscale.Wxofset1); 01658 else 01659 return Cscale.frect[0] + (1.0/Cscale.Wscx1)*((x) - Cscale.Wxofset1); 01660 01661 01662 sciprint("Error in XScale\n"); 01663 return -9000; 01664 }
Here is the call graph for this function:

| int XLogScale | ( | double | x | ) |
Definition at line 1553 of file Plo2dEch.c.
References sciSubWindow::axes, Cscale, FALSE, wcscalelist::frect, inint, sciSubWindow::is3d, pSUBWIN_FEATURE, AXES::reverse, sciGetCurrentSubWin(), sciprint(), TRUE, wcscalelist::Wscx1, and wcscalelist::Wxofset1.
Referenced by Plo2d2RealToPixel(), Plo2d3RealToPixel(), Plo2d4RealToPixel(), rect2d(), and xechelle2d().
01554 { 01555 /*F.Leray 12.10.04 : MODIF named scale_modification*/ 01556 01557 sciPointObj *pobj = sciGetCurrentSubWin(); 01558 sciSubWindow * ppsubwin = pSUBWIN_FEATURE (pobj); 01559 01560 if(ppsubwin->axes.reverse[0]==TRUE && ppsubwin->is3d == FALSE) 01561 return inint( Cscale.Wscx1*(Cscale.frect[2] - log10(x)) + Cscale.Wxofset1); 01562 else 01563 return inint( Cscale.Wscx1*(log10(x) -Cscale.frect[0]) + Cscale.Wxofset1); 01564 01565 01566 sciprint("Error in XLogScale\n"); 01567 return -9000; 01568 }
Here is the call graph for this function:

Here is the caller graph for this function:

| double XPi2R | ( | int | x | ) |
Definition at line 1616 of file Plo2dEch.c.
References sciSubWindow::axes, Cscale, FALSE, wcscalelist::frect, sciSubWindow::is3d, pSUBWIN_FEATURE, AXES::reverse, sciGetCurrentSubWin(), sciprint(), TRUE, wcscalelist::Wscx1, and wcscalelist::Wxofset1.
Referenced by drawSegsEntity(), ellipse2d(), and xechelle2d().
01617 { 01618 /*F.Leray 12.10.04 : MODIF named scale_modification*/ 01619 01620 sciPointObj *pobj = sciGetCurrentSubWin(); 01621 sciSubWindow * ppsubwin = pSUBWIN_FEATURE (pobj); 01622 01623 if(ppsubwin->axes.reverse[0]==TRUE && ppsubwin->is3d == FALSE) 01624 return Cscale.frect[2] - (1.0/Cscale.Wscx1)*((x) - Cscale.Wxofset1); 01625 else 01626 return Cscale.frect[0] + (1.0/Cscale.Wscx1)*((x) - Cscale.Wxofset1); 01627 01628 01629 sciprint("Error in XScale\n"); 01630 return -9000; 01631 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int XScale | ( | double | x | ) |
Definition at line 1523 of file Plo2dEch.c.
References sciSubWindow::axes, Cscale, FALSE, FLOAT_2_INT, wcscalelist::frect, sciSubWindow::is3d, pSUBWIN_FEATURE, AXES::reverse, sciGetCurrentSubWin(), sciprint(), TRUE, wcscalelist::Wscx1, and wcscalelist::Wxofset1.
Referenced by axis2d(), axis_3ddraw(), box3d(), checkXAxes2dTics(), checkYAxes2dTics(), Convex_Box(), DrawAxis(), drawFecEntity(), drawGrayplotEntity(), drawSegsEntity(), DrawXGrid(), DrawXSubTics(), DrawXTics(), DrawYGrid(), DrawYSubTics(), DrawYTics(), ellipse2d(), Plo2d2RealToPixel(), Plo2d3RealToPixel(), Plo2d4RealToPixel(), rect2d(), Sci_Axis(), sciChamp2DRealToPixel(), XDrawAxisLine(), xechelle2d(), and YDrawAxisLine().
01524 { 01525 /*F.Leray 12.10.04 : MODIF named scale_modification*/ 01526 01527 sciPointObj *pobj = sciGetCurrentSubWin(); 01528 sciSubWindow * ppsubwin = pSUBWIN_FEATURE (pobj); 01529 01530 if(ppsubwin->axes.reverse[0]==TRUE && ppsubwin->is3d == FALSE) 01531 { 01532 01533 /* 2147483647 == 2^31 - 1 == INT32MAX */ 01534 /*return inint( Max( Min(Cscale.Wscx1*(Cscale.frect[2] - (x)) + Cscale.Wxofset1, INT_MAX ), INT_MIN ) ) ;*/ 01535 double dRes = Cscale.Wscx1 * (Cscale.frect[2] - (x)) + Cscale.Wxofset1 ; 01536 return FLOAT_2_INT( dRes ) ; 01537 } 01538 else 01539 { 01540 /*return inint( Max( Min(Cscale.Wscx1*((x) -Cscale.frect[0]) + Cscale.Wxofset1, INT_MAX ), INT_MIN ) );*/ 01541 double dRes = Cscale.Wscx1 * ((x) -Cscale.frect[0]) + Cscale.Wxofset1 ; 01542 return FLOAT_2_INT( dRes ) ; 01543 } 01544 01545 01546 sciprint("Error in XScale\n"); 01547 return -9000; 01548 }
Here is the call graph for this function:

Here is the caller graph for this function:

| double YDPi2R | ( | double | y | ) |
Definition at line 1667 of file Plo2dEch.c.
References sciSubWindow::axes, Cscale, FALSE, wcscalelist::frect, sciSubWindow::is3d, pSUBWIN_FEATURE, AXES::reverse, sciGetCurrentSubWin(), sciprint(), TRUE, wcscalelist::Wscy1, and wcscalelist::Wyofset1.
01668 { 01669 /*F.Leray 12.10.04 : MODIF named scale_modification*/ 01670 sciPointObj *pobj = sciGetCurrentSubWin(); 01671 sciSubWindow * ppsubwin = pSUBWIN_FEATURE (pobj); 01672 01673 if(ppsubwin->axes.reverse[1]==TRUE && ppsubwin->is3d == FALSE) 01674 return Cscale.frect[1] + (1.0/Cscale.Wscy1)*((y) - Cscale.Wyofset1); 01675 else 01676 return Cscale.frect[3] - (1.0/Cscale.Wscy1)*((y) - Cscale.Wyofset1); 01677 01678 01679 01680 sciprint("Error in YScale\n"); 01681 return -9000; 01682 }
Here is the call graph for this function:

| int YLogScale | ( | double | y | ) |
Definition at line 1597 of file Plo2dEch.c.
References sciSubWindow::axes, Cscale, FALSE, wcscalelist::frect, inint, sciSubWindow::is3d, pSUBWIN_FEATURE, AXES::reverse, sciGetCurrentSubWin(), sciprint(), TRUE, wcscalelist::Wscy1, and wcscalelist::Wyofset1.
Referenced by Plo2d2RealToPixel(), Plo2d3RealToPixel(), Plo2d4RealToPixel(), rect2d(), and yechelle2d().
01598 { 01599 /*F.Leray 12.10.04 : MODIF named scale_modification*/ 01600 sciPointObj *pobj = sciGetCurrentSubWin(); 01601 sciSubWindow * ppsubwin = pSUBWIN_FEATURE (pobj); 01602 01603 if(ppsubwin->axes.reverse[1]==TRUE && ppsubwin->is3d == FALSE) 01604 return inint( Cscale.Wscy1*(log10(y)-Cscale.frect[1]) + Cscale.Wyofset1); 01605 else 01606 return inint( Cscale.Wscy1*(-log10(y)+Cscale.frect[3]) + Cscale.Wyofset1); 01607 01608 01609 01610 sciprint("Error in YLogScale\n"); 01611 return -9000; 01612 }
Here is the call graph for this function:

Here is the caller graph for this function:

| double YPi2R | ( | int | y | ) |
Definition at line 1634 of file Plo2dEch.c.
References sciSubWindow::axes, Cscale, FALSE, wcscalelist::frect, sciSubWindow::is3d, pSUBWIN_FEATURE, AXES::reverse, sciGetCurrentSubWin(), sciprint(), TRUE, wcscalelist::Wscy1, and wcscalelist::Wyofset1.
Referenced by drawSegsEntity(), ellipse2d(), and yechelle2d().
01635 { 01636 /*F.Leray 12.10.04 : MODIF named scale_modification*/ 01637 sciPointObj *pobj = sciGetCurrentSubWin(); 01638 sciSubWindow * ppsubwin = pSUBWIN_FEATURE (pobj); 01639 01640 if(ppsubwin->axes.reverse[1]==TRUE && ppsubwin->is3d == FALSE) 01641 return Cscale.frect[1] + (1.0/Cscale.Wscy1)*((y) - Cscale.Wyofset1); 01642 else 01643 return Cscale.frect[3] - (1.0/Cscale.Wscy1)*((y) - Cscale.Wyofset1); 01644 01645 01646 sciprint("Error in YScale\n"); 01647 return -9000; 01648 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int YScale | ( | double | y | ) |
Definition at line 1573 of file Plo2dEch.c.
References sciSubWindow::axes, Cscale, FLOAT_2_INT, wcscalelist::frect, sciSubWindow::is3d, pSUBWIN_FEATURE, AXES::reverse, sciGetCurrentSubWin(), sciprint(), wcscalelist::Wscy1, and wcscalelist::Wyofset1.
Referenced by axis2d(), axis_3ddraw(), box3d(), checkXAxes2dTics(), checkYAxes2dTics(), Convex_Box(), DrawAxis(), drawFecEntity(), drawGrayplotEntity(), drawSegsEntity(), DrawXGrid(), DrawXSubTics(), DrawXTics(), DrawYGrid(), DrawYSubTics(), DrawYTics(), ellipse2d(), Plo2d2RealToPixel(), Plo2d3RealToPixel(), Plo2d4RealToPixel(), rect2d(), Sci_Axis(), sciChamp2DRealToPixel(), XDrawAxisLine(), YDrawAxisLine(), and yechelle2d().
01574 { 01575 /*F.Leray 12.10.04 : MODIF named scale_modification*/ 01576 01577 sciPointObj *pobj = sciGetCurrentSubWin(); 01578 sciSubWindow * ppsubwin = pSUBWIN_FEATURE (pobj); 01579 01580 if( ppsubwin->axes.reverse[1] && !ppsubwin->is3d ) 01581 { 01582 double dRes = Cscale.Wscy1 * ( y - Cscale.frect[1] ) + Cscale.Wyofset1 ; 01583 return FLOAT_2_INT( dRes ) ; 01584 } 01585 else 01586 { 01587 double dRes = Cscale.Wscy1 * ( -y + Cscale.frect[3] ) + Cscale.Wyofset1 ; 01588 return FLOAT_2_INT( dRes ) ; 01589 } 01590 01591 01592 sciprint("Error in YScale\n"); 01593 return -9000; 01594 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int zoom | ( | void | ) |
Definition at line 1360 of file Plo2dEch.c.
References zoom_box(), and zoom_get_rectangle().
Referenced by sci_zoom_rect(), and scig_2dzoom().
01361 { 01362 double bbox[4]; 01363 int x_pixel[2], y_pixel[2]; 01364 01365 if ( zoom_get_rectangle(bbox,x_pixel,y_pixel) == 1 ) { return 1 ; } 01366 01367 zoom_box(bbox,x_pixel,y_pixel); 01368 return 0; 01369 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1154 of file Plo2dEch.c.
References sciSubWindow::axes, box3d(), C2F, Cscale, FALSE, sciSubWindow::FRect, FreeVertices(), getVertexIndex(), GetVerticesAt(), graduate(), i, InvAxis(), lmax(), lmin(), max, Max, min, Min, NULL, tagSons::pnext, tagSons::pointobj, pSUBWIN_FEATURE, AXES::reverse, SCI_SUBWIN, sciDrawObj(), sciGetCurrentFigure(), sciGetCurrentSubWin(), sciGetEntityType(), sciGetLastSons(), sciGetSons(), sciGetZooming(), sciIsAreaZoom(), sciSetSelectedSubWin(), sciSetZooming(), SetMinMaxVertices(), setVertexIndex(), setZoom3dStatus(), sciSubWindow::SRect, TRUE, wcscalelist::WIRect1, XDouble2Pixel, XPixel2Double, YDouble2Pixel, YPixel2Double, and z.
Referenced by sci_zoom_rect(), and zoom().
01155 { 01156 integer min,max,puiss,deux=2,dix=10,box[4],box1[4],section[4]; 01157 01158 double fmin,fmax,lmin,lmax; 01159 sciPointObj *psousfen,*tmpsousfen; 01160 sciPointObj * pfigure = NULL; 01161 sciSons *psonstmp; 01162 sciSubWindow * ppsubwin = NULL; /* debug */ 01163 01164 box[0]= Min(XDouble2Pixel(bbox[0]),XDouble2Pixel(bbox[2])); 01165 box[2]= Max(XDouble2Pixel(bbox[0]),XDouble2Pixel(bbox[2])); 01166 box[1]= Min(YDouble2Pixel(bbox[1]),YDouble2Pixel(bbox[3])); 01167 box[3]= Max(YDouble2Pixel(bbox[1]),YDouble2Pixel(bbox[3])); 01168 01169 pfigure = sciGetCurrentFigure(); 01170 tmpsousfen= sciGetCurrentSubWin(); 01171 psonstmp = sciGetSons (sciGetCurrentFigure()); 01172 while (psonstmp != (sciSons *) NULL) 01173 { 01174 if(sciGetEntityType (psonstmp->pointobj) == SCI_SUBWIN) 01175 { 01176 psousfen= (sciPointObj *)psonstmp->pointobj; 01177 if ( pSUBWIN_FEATURE (psousfen)->is3d == TRUE) { 01178 double xmin, ymin; 01179 double xmax, ymax; 01180 double zmin, zmax; 01181 sciSons *psonstmp2 = (sciSons *) NULL; 01182 double epsilon = 1e-16; 01183 01184 int box3d[4]; 01185 int section3d[4]; 01186 01187 sciSetSelectedSubWin(psousfen); 01188 ppsubwin = pSUBWIN_FEATURE (psousfen); 01189 01190 box3d[0] = x_pixel[0]; 01191 box3d[2] = x_pixel[1]; 01192 box3d[1] = y_pixel[0]; 01193 box3d[3] = y_pixel[1]; 01194 01195 box1[0]= Cscale.WIRect1[0]; 01196 box1[2]= Cscale.WIRect1[2]+Cscale.WIRect1[0]; 01197 box1[1]= Cscale.WIRect1[1]; 01198 box1[3]= Cscale.WIRect1[3]+Cscale.WIRect1[1]; 01199 01200 if (sciIsAreaZoom(box3d,box1,section3d)) 01201 { 01202 int tmp[4],i; 01203 01204 for(i=0;i<4;i++) tmp[i] = section3d[i]; 01205 01206 section3d[0] = Min(tmp[0],tmp[2]); 01207 section3d[2] = Max(tmp[0],tmp[2]); 01208 section3d[1] = Min(tmp[1],tmp[3]); 01209 section3d[3] = Max(tmp[1],tmp[3]); 01210 01211 /* determine how many vertices we will have to draw */ 01212 /* this is used for 3d zoom (to know size of the global vector) */ 01213 setVertexIndex( 0 ) ; 01214 01215 /* this flag is used inside trans3d called many times by sciDrawObj */ 01216 setZoom3dStatus( TRUE ); 01217 01218 psonstmp2 = sciGetLastSons (psousfen); 01219 01220 sciDrawObj(psousfen); /* see GlobalFlag_Zoom3dOn impact flag in sciDrawObj & trans3d functions */ 01221 01222 setZoom3dStatus( FALSE ); 01223 01224 SetMinMaxVertices(pSUBWIN_FEATURE(psousfen)->vertices_list, &xmin, &ymin, &zmin, &xmax, &ymax, &zmax); 01225 01226 01227 for( i = 0 ; i < getVertexIndex() ; i++ ) 01228 { 01229 int xp,yp; 01230 double x,y,z; 01231 01232 if(GetVerticesAt(pSUBWIN_FEATURE(psousfen)->vertices_list, &xp, &yp, &x, &y, &z)==-1) 01233 break; /* all the vertices have been scanned inside the current psubwin */ 01234 01235 if(xp >= section3d[0] && xp <= section3d[2] && yp >= section3d[1] && yp <= section3d[3]) 01236 { 01237 /* printf("ICI => xp = %d \t yp = %d et x = %lf \t y = %lf \t z = %lf\n",xp,yp,x,y,z); */ 01238 if(x < xmin) xmin=x; if(x > xmax) xmax=x; 01239 if(y < ymin) ymin=y; if(y > ymax) ymax=y; 01240 if(z < zmin) zmin=z; if(z > zmax) zmax=z; 01241 } 01242 } 01243 01244 if(ppsubwin->axes.reverse[0] == TRUE) { 01245 double tmp2; 01246 tmp2 = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],xmin); 01247 xmin = InvAxis(ppsubwin->FRect[0],ppsubwin->FRect[2],xmax); 01248 xmax = tmp2; 01249 } 01250 01251 if(ppsubwin->axes.reverse[1] == TRUE) { 01252 double tmp2; 01253 tmp2 = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],ymin); 01254 ymin = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],ymax); 01255 ymax = tmp2; 01256 } 01257 01258 if(ppsubwin->axes.reverse[2] == TRUE) { 01259 double tmp2; 01260 tmp2 = InvAxis(ppsubwin->FRect[4],ppsubwin->FRect[5],zmin); 01261 zmin = InvAxis(ppsubwin->FRect[4],ppsubwin->FRect[5],zmax); 01262 zmax = tmp2; 01263 } 01264 01265 FreeVertices(psousfen); 01266 01267 /* case where no vertex has been selected : */ 01268 /* no zoom is performed */ 01269 if(xmin > xmax || ymin > ymax || zmin > zmax) 01270 { 01271 xmin = ppsubwin->SRect[0]; 01272 xmax = ppsubwin->SRect[1]; 01273 01274 ymin = ppsubwin->SRect[2]; 01275 ymax = ppsubwin->SRect[3]; 01276 01277 zmin = ppsubwin->SRect[4]; 01278 zmax = ppsubwin->SRect[5]; 01279 } 01280 01281 if (!(sciGetZooming(psousfen))) 01282 sciSetZooming(psousfen, 1); 01283 01284 01285 /* case where a 3d rotated plot2d is zoomed */ 01286 if(fabs(zmin) < epsilon && fabs(zmax) < epsilon){ 01287 zmin = pSUBWIN_FEATURE (psousfen)->SRect[4]; 01288 zmax = pSUBWIN_FEATURE (psousfen)->SRect[5]; 01289 } 01290 01291 pSUBWIN_FEATURE (psousfen)->ZRect[0] = xmin; 01292 pSUBWIN_FEATURE (psousfen)->ZRect[2] = xmax; 01293 01294 pSUBWIN_FEATURE (psousfen)->ZRect[1] = ymin; 01295 pSUBWIN_FEATURE (psousfen)->ZRect[3] = ymax; 01296 01297 pSUBWIN_FEATURE (psousfen)->ZRect[4] = zmin; 01298 pSUBWIN_FEATURE (psousfen)->ZRect[5] = zmax; 01299 01300 } 01301 } 01302 sciSetSelectedSubWin(psousfen); 01303 ppsubwin = pSUBWIN_FEATURE (psousfen); 01304 01305 if ( pSUBWIN_FEATURE (psousfen)->is3d == FALSE) { 01306 01307 box1[0]= Cscale.WIRect1[0]; 01308 box1[2]= Cscale.WIRect1[2]+Cscale.WIRect1[0]; 01309 box1[1]= Cscale.WIRect1[1]; 01310 box1[3]= Cscale.WIRect1[3]+Cscale.WIRect1[1]; 01311 01312 if (sciIsAreaZoom(box,box1,section)) 01313 { 01314 bbox[0]= Min(XPixel2Double(section[0]),XPixel2Double(section[2])); 01315 bbox[2]= Max(XPixel2Double(section[0]),XPixel2Double(section[2])); 01316 bbox[1]= Min(YPixel2Double(section[1]),YPixel2Double(section[3])); 01317 bbox[3]= Max(YPixel2Double(section[1]),YPixel2Double(section[3])); 01318 01319 if (!(sciGetZooming(psousfen))) 01320 sciSetZooming(psousfen, 1); 01321 01323 fmin= bbox[0]; 01324 fmax= bbox[2]; 01325 if(pSUBWIN_FEATURE (psousfen)->logflags[0] == 'n') { 01326 C2F(graduate)(&fmin, &fmax,&lmin,&lmax,&deux,&dix,&min,&max,&puiss) ; 01327 pSUBWIN_FEATURE(psousfen)->axes.xlim[2]=puiss; 01328 pSUBWIN_FEATURE (psousfen)->ZRect[0]=lmin; 01329 pSUBWIN_FEATURE (psousfen)->ZRect[2]=lmax;} 01330 else { 01331 pSUBWIN_FEATURE(psousfen)->axes.xlim[2]=0; 01332 pSUBWIN_FEATURE (psousfen)->ZRect[0]=fmin; 01333 pSUBWIN_FEATURE (psousfen)->ZRect[2]=fmax; 01334 } 01335 01336 01337 fmin= bbox[1]; 01338 fmax= bbox[3]; 01339 if(pSUBWIN_FEATURE (psousfen)->logflags[1] == 'n') { 01340 C2F(graduate)(&fmin, &fmax,&lmin,&lmax,&deux,&dix,&min,&max,&puiss) ; 01341 pSUBWIN_FEATURE(psousfen)->axes.ylim[2]=puiss; 01342 pSUBWIN_FEATURE (psousfen)->ZRect[1]=lmin; 01343 pSUBWIN_FEATURE (psousfen)->ZRect[3]=lmax;} 01344 else { 01345 pSUBWIN_FEATURE(psousfen)->axes.ylim[2]=0; 01346 pSUBWIN_FEATURE (psousfen)->ZRect[1]=fmin; 01347 pSUBWIN_FEATURE (psousfen)->ZRect[3]=fmax;} 01348 } 01349 } 01350 } 01351 psonstmp = psonstmp->pnext; 01352 } 01353 sciSetSelectedSubWin(tmpsousfen); 01354 sciDrawObj(sciGetCurrentFigure()); 01355 01356 return 0; 01357 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 56 of file Plo2dEch.c.
Referenced by Axes3dStrings2(), axesplot(), axis2d(), axis_draw(), axis_draw2(), box3d(), CheckClickedSubwin(), checkXAxes2dTics(), checkYAxes2dTics(), computeArrowColor(), computeRealArrowSize(), Cscale2default(), DrawAxesBackground(), drawPolylineEntity(), DrawXSubTics(), DrawXTics(), DrawYSubTics(), DrawYTics(), echelle2dl(), ellipse2d(), frame_clip_on(), get_frame_in_pixel(), get_margin_in_pixel(), get_scale_win(), getscale2d(), I3dRotation(), InitAxesModel(), labels2D_draw(), Legends(), Nsetscale2d(), rect2d(), Sci_Axis(), sci_drawaxis(), sci_xchange(), SciAxisNew(), sciChamp2DRealToPixel(), sciUpdateScaleAngles(), set_scale(), SetEch3d1(), ShowScales(), updateScale3d(), XDPi2R(), xechelle2d(), XLogScale(), XPi2R(), XScale(), YDPi2R(), yechelle2d(), YLogScale(), YPi2R(), YScale(), Zoom3d_XPi2R(), Zoom3d_YPi2R(), and zoom_box().
1.5.1