#include <string.h>#include <stdio.h>#include <math.h>#include "math_graphics.h"#include "PloEch.h"#include "GetProperty.h"#include "SetProperty.h"#include "BuildObjects.h"#include "Interaction.h"#include "DrawObjects.h"#include "Xcall1.h"#include "Plo2dEch.h"#include "Vertices.h"#include "GraphicZoom.h"#include "axesScale.h"#include "sciprint.h"#include "periScreen.h"#include "Format.h"#include "scirun.h"#include "CurrentObjectsManagement.h"#include "MALLOC.h"Include dependency graph for Plo2dEch.c:

Go to the source code of this file.
Functions | |
| void | xgetmouse2 (char *fname, char *str, integer *ibutton, integer *iflag, integer *x1, integer *yy1, integer *x6, integer *x7, double *x, double *y, double *dx3, double *dx4, integer lx0, integer lx1) |
| void | xclick_2 (char *fname, char *str, integer *ibutton, integer *iflag, integer *istr, integer *x1, integer *yy1, integer *x7, double *x, double *y, double *dx3, double *dx4, integer lx0, integer lx1) |
| int | StoreCommand (char *command) |
| static void scale_copy | __PARAMS ((WCScaleList *s1, WCScaleList *s2)) |
| static integer curwin | __PARAMS ((void)) |
| static void | zoom_rect2 (int xpix_ini, int ypix_ini, int xpix_fin, int ypix_fin) |
| static void set_scale_win | __PARAMS ((ScaleList **listptr, integer i, WCScaleList *s)) |
| static WCScaleList *new_wcscale | __PARAMS ((WCScaleList *val)) |
| static WCScaleList *check_subwin_wcscale | __PARAMS ((WCScaleList *listptr, double *)) |
| static int same_subwin | __PARAMS ((double lsubwin_rect[4], double subwin_rect[4])) |
| static void set_window_scale | __PARAMS ((integer i, WCScaleList *scale)) |
| void | Cscale2default (void) |
| void | set_window_scale_with_default (int i) |
| static int get_scale_win | __PARAMS ((ScaleList *listptr, integer wi, double *subwin)) |
| int | get_window_scale (integer i, double *subwin) |
| static int | get_scale_win (ScaleList *listptr, integer wi, double *subwin) |
| static void | set_window_scale (integer i, WCScaleList *scale) |
| static void | set_scale_win (ScaleList **listptr, integer i, WCScaleList *scale) |
| static WCScaleList * | new_wcscale (WCScaleList *val) |
| static WCScaleList * | check_subwin_wcscale (WCScaleList *listptr, subwin_rect) |
| static int | same_subwin (lsubwin_rect, subwin_rect) |
| static void DeleteWCScale | __PARAMS ((WCScaleList *l)) |
| void | del_window_scale (integer i) |
| static void | DeleteWCScale (WCScaleList *l) |
| static void | scale_copy (WCScaleList *s1, WCScaleList *s2) |
| static integer | curwin (void) |
| static void show_scales | __PARAMS ((ScaleList *listptr)) |
| void | ShowScales (void) |
| static void | show_scales (ScaleList *listptr) |
| int C2F() | setscale2d (WRect, FRect, char *logscale, integer l1) |
| 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 | get_frame_in_pixel (integer WIRect[]) |
| void | get_margin_in_pixel (integer Margin[]) |
| void | set_scale (char flag[6], double subwin[4], double frame_values[4], integer aaint[4], char logflag[3], double axis_values[4]) |
| void | get_cwindow_dims (int wdims[2]) |
| int C2F() | xechelle2d (x, x1,*n1, dir, integer lstr) |
| int C2F() | yechelle2d (y, yy1,*n2, dir, integer lstr) |
| 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() | ellipse2d (double x[], integer x1[], integer *n, char *dir) |
| void C2F() | rect2d (double x[], integer x1[], integer *n, char *dir) |
| void C2F() | axis2d (double *alpha, double *initpoint, double *size, integer *initpoint1, double *size1) |
| int | EchCheckSCPlots () |
| int | zoom_get_rectangle (double *bbox, int *x_pixel, int *y_pixel) |
| int | zoom_box (double *bbox, int *x_pixel, int *y_pixel) |
| int | zoom () |
| void | unzoom () |
| void | unzoom_one_axes (sciPointObj *psousfen) |
| void | Gr_Rescale (char *logFlags, double *FRectI, integer *Xdec, integer *Ydec, integer *xnax, integer *ynax) |
| 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) |
| double | Zoom3d_XPi2R (int x) |
| double | Zoom3d_YPi2R (int y) |
| void | scizoom (double bbox[4], sciPointObj *pobj) |
| void | getPixelCoordinates (sciPointObj *pSubWin, double coord3d[3], int pixCoord[2]) |
| int | PixelHeight2d (sciPointObj *parentSubWin, double posY, double height) |
| int | PixelWidth2d (sciPointObj *parentSubWin, double posX, double width) |
| 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) |
Variables | |
| static ScaleList * | The_List = NULL |
| WCScaleList | Cscale |
| WCScaleList | Defscale |
| static void show_scales __PARAMS | ( | (ScaleList *listptr) | ) | [static] |
| static void DeleteWCScale __PARAMS | ( | (WCScaleList *l) | ) | [static] |
| static void set_window_scale __PARAMS | ( | (integer i, WCScaleList *scale) | ) | [static] |
| static int same_subwin __PARAMS | ( | (double lsubwin_rect[4], double subwin_rect[4]) | ) | [static] |
| static WCScaleList* check_subwin_wcscale __PARAMS | ( | (WCScaleList *listptr, double *) | ) | [static] |
| static WCScaleList* new_wcscale __PARAMS | ( | (WCScaleList *val) | ) | [static] |
| static void set_scale_win __PARAMS | ( | (ScaleList **listptr, integer i, WCScaleList *s) | ) | [static] |
| static integer curwin __PARAMS | ( | (void) | ) | [static] |
| static void scale_copy __PARAMS | ( | (WCScaleList *s1, WCScaleList *s2) | ) | [static] |
| 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:

| static WCScaleList* check_subwin_wcscale | ( | WCScaleList * | listptr, | |
| subwin_rect | ||||
| ) | [static] |
Definition at line 251 of file Plo2dEch.c.
References NULL, and same_subwin().
Referenced by get_scale_win(), and set_scale_win().
00254 { 00255 if ( listptr == (WCScaleList *) NULL) return NULL; 00256 if ( same_subwin( listptr->subwin_rect,subwin_rect)) 00257 return listptr; 00258 else 00259 return check_subwin_wcscale(listptr->next,subwin_rect); 00260 }
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:

| static integer curwin | ( | void | ) | [static] |
Definition at line 367 of file Plo2dEch.c.
References C2F, dr(), L, PD0, and PI0.
Referenced by Cscale2default(), DeleteSGWin(), and Nsetscale2d().
00368 { 00369 integer verbose=0,narg,winnum; 00370 C2F(dr)("xget","window",&verbose,&winnum,&narg ,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 00371 return(winnum); 00372 }
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:

| static void DeleteWCScale | ( | WCScaleList * | l | ) | [static] |
Definition at line 313 of file Plo2dEch.c.
Referenced by del_window_scale().
Here is the caller graph for this function:

| int EchCheckSCPlots | ( | ) |
Changement interactif d'echelle
| 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:

| void get_cwindow_dims | ( | int | wdims[2] | ) |
| void get_frame_in_pixel | ( | integer | WIRect[] | ) |
Definition at line 596 of file Plo2dEch.c.
References Cscale, and wcscalelist::WIRect1.
00597 { 00598 /* ajout bruno */ 00599 WIRect[0] = Cscale.WIRect1[0]; 00600 WIRect[1] = Cscale.WIRect1[1]; 00601 WIRect[2] = Cscale.WIRect1[0] + Cscale.WIRect1[2]; 00602 WIRect[3] = Cscale.WIRect1[1] + Cscale.WIRect1[3]; 00603 }
| void get_margin_in_pixel | ( | integer | Margin[] | ) |
Definition at line 605 of file Plo2dEch.c.
References wcscalelist::axis, Cscale, and wcscalelist::WIRect1.
00606 { 00607 /* added by bruno 00608 * Margin[0]: left margin 00609 * Margin[1]: right margin 00610 * Margin[2]: up margin 00611 * Margin[3]: down margin 00612 */ 00613 double coef_w = 1.0 - Cscale.axis[0] - Cscale.axis[1]; 00614 double coef_h = 1.0 - Cscale.axis[2] - Cscale.axis[3]; 00615 Margin[0] = (integer) ( Cscale.axis[0]/coef_w * (double) Cscale.WIRect1[2]); 00616 Margin[1] = (integer) ( Cscale.axis[1]/coef_w * (double) Cscale.WIRect1[2]); 00617 Margin[2] = (integer) ( Cscale.axis[2]/coef_h * (double) Cscale.WIRect1[3]); 00618 Margin[3] = (integer) ( Cscale.axis[3]/coef_h * (double) Cscale.WIRect1[3]); 00619 }
Definition at line 128 of file Plo2dEch.c.
References check_subwin_wcscale(), Cscale, NULL, and scale_copy().
Referenced by get_window_scale().
00132 { 00133 if (listptr != (ScaleList *) NULL) 00134 { 00135 if ((listptr->Win) == wi) 00136 { 00137 if ( subwin == NULL) 00138 { 00139 scale_copy(&Cscale,listptr->scales); 00140 return 1; 00141 } 00142 else 00143 { 00144 WCScaleList *loc = check_subwin_wcscale(listptr->scales,subwin); 00145 if ( loc != NULL) 00146 { 00147 scale_copy(&Cscale,loc); 00148 return 1; 00149 } 00150 else 00151 { 00152 return 0; 00153 } 00154 } 00155 } 00156 else 00157 return get_scale_win(listptr->next,wi,subwin); 00158 } 00159 return 0; 00160 }
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:

| void Gr_Rescale | ( | char * | logFlags, | |
| double * | FRectI, | |||
| integer * | Xdec, | |||
| integer * | Ydec, | |||
| integer * | xnax, | |||
| integer * | ynax | |||
| ) |
Definition at line 1470 of file Plo2dEch.c.
References C2F, graduate(), i, inint, pSUBWIN_FEATURE, and sciGetCurrentSubWin().
01471 { 01472 double FRectO[4]; 01473 sciPointObj *psubwin; 01474 int i; 01475 01477 psubwin = sciGetCurrentSubWin(); 01478 for (i=0;i<4 ; i++) 01479 pSUBWIN_FEATURE (psubwin)->axes.limits[i+1]=FRectI[i]; 01480 01481 01482 if (logFlags[0] == 'n') 01483 { 01484 if (!pSUBWIN_FEATURE (psubwin)->tight_limits ) 01485 { 01486 C2F(graduate)(FRectI,FRectI+2,FRectO,FRectO+2,xnax,xnax+1,Xdec,Xdec+1,Xdec+2); 01487 FRectI[0]=FRectO[0];FRectI[2]=FRectO[2]; 01488 } 01489 01490 else 01491 { 01492 C2F(graduate)(FRectI,FRectI+2,FRectO,FRectO+2,xnax,xnax+1,Xdec,Xdec+1,Xdec+2); 01493 } 01494 } 01495 else 01496 { 01497 Xdec[0]=inint(FRectI[0]); 01498 Xdec[1]=inint(FRectI[2]); 01499 Xdec[2]=0; 01500 } 01501 if (logFlags[1] == 'n') 01502 { 01503 if ( !pSUBWIN_FEATURE (psubwin)->tight_limits) 01504 { 01505 C2F(graduate)(FRectI+1,FRectI+3,FRectO+1,FRectO+3,ynax,ynax+1,Ydec,Ydec+1,Ydec+2); 01506 FRectI[1]=FRectO[1];FRectI[3]=FRectO[3]; 01507 } 01508 else 01509 { 01510 C2F(graduate)(FRectI+1,FRectI+3,FRectO+1,FRectO+3,ynax,ynax+1,Ydec,Ydec+1,Ydec+2); 01511 } 01512 } 01513 else 01514 { 01515 Ydec[0]=inint(FRectI[1]);Ydec[1]=inint(FRectI[3]);Ydec[2]=0; 01516 } 01517 01518 01519 }
Here is the call graph for this function:

| static WCScaleList* new_wcscale | ( | WCScaleList * | val | ) | [static] |
Definition at line 239 of file Plo2dEch.c.
References MALLOC, NULL, and scale_copy().
Referenced by set_scale_win().
00241 { 00242 WCScaleList *new ; 00243 if ((new = (WCScaleList *) MALLOC( sizeof (WCScaleList))) == NULL) 00244 return NULL; 00245 new->next = (WCScaleList *) 0; 00246 new->prev = (WCScaleList *) 0; 00247 scale_copy(new,val); 00248 return new; 00249 }
Here is the call graph for this function:

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:

| static int same_subwin | ( | lsubwin_rect | , | |
| subwin_rect | ||||
| ) | [static] |
Definition at line 262 of file Plo2dEch.c.
References Abs.
Referenced by check_subwin_wcscale(), and Nsetscale2d().
00264 { 00265 if ( Abs(lsubwin_rect[0] - subwin_rect[0]) < 1.e-8 00266 && Abs(lsubwin_rect[1] - subwin_rect[1]) < 1.e-8 00267 && Abs(lsubwin_rect[2] - subwin_rect[2]) < 1.e-8 00268 && Abs(lsubwin_rect[3] - subwin_rect[3]) < 1.e-8 ) 00269 return 1; 00270 else 00271 return 0; 00272 }
Here is the caller graph for this function:

| static void scale_copy | ( | WCScaleList * | s1, | |
| WCScaleList * | s2 | |||
| ) | [static] |
Definition at line 328 of file Plo2dEch.c.
Referenced by Cscale2default(), get_scale_win(), new_wcscale(), and set_scale_win().
00329 { 00330 int i,j; 00331 s1->flag=s2->flag; 00332 s1->wdim[0]= s2->wdim[0]; 00333 s1->wdim[1]= s2->wdim[1]; 00334 for ( i = 0 ; i < 4 ; i++ ) 00335 { 00336 s1->subwin_rect[i]=s2->subwin_rect[i]; 00337 s1->frect[i]=s2->frect[i]; 00338 s1->WIRect1[i]=s2->WIRect1[i]; 00339 s1->Waaint1[i]=s2->Waaint1[i]; 00340 s1->xtics[i]=s2->xtics[i]; 00341 s1->ytics[i]=s2->ytics[i]; 00342 s1->axis[i]=s2->axis[i]; 00343 } 00344 for ( i = 0 ; i < 3 ; i++ ) 00345 { 00346 for ( j = 0 ; j < 3 ; j++ ) 00347 { 00348 s1->m[i][j] = s2->m[i][j] ; 00349 } 00350 } 00351 for (i=0; i< 6; i++ ) 00352 { 00353 s1->bbox1[i] = s2->bbox1[i] ; 00354 } 00355 s1->Wxofset1=s2->Wxofset1; 00356 s1->Wyofset1=s2->Wyofset1; 00357 s1->Wscx1=s2->Wscx1; 00358 s1->Wscy1=s2->Wscy1; 00359 s1->logflag[0] = s2->logflag[0]; 00360 s1->logflag[1] = s2->logflag[1]; 00361 }
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:

| static void set_scale_win | ( | ScaleList ** | listptr, | |
| integer | i, | |||
| WCScaleList * | scale | |||
| ) | [static] |
Definition at line 175 of file Plo2dEch.c.
References check_subwin_wcscale(), MALLOC, new_wcscale(), wcscalelist::next, NULL, wcscalelist::prev, scale, scale_copy(), and sciprint().
Referenced by set_window_scale().
00179 { 00180 if ( *listptr == (ScaleList *) NULL) 00181 { 00182 /* window i does not exist add an entry for it */ 00183 if ((*listptr = (ScaleList *) MALLOC( sizeof (ScaleList)))==0) 00184 { 00185 sciprint("AddWindowScale_ memory exhausted\n"); 00186 return; 00187 } 00188 else 00189 { 00190 (*listptr)->Win = i; 00191 (*listptr)->next = (ScaleList *) NULL ; 00192 (*listptr)->scales = new_wcscale(scale); 00193 if ( (*listptr)->scales == 0) 00194 { 00195 *listptr = 0; 00196 sciprint("AddWindowScale_ memory exhausted\n"); 00197 } 00198 return ; 00199 } 00200 } 00201 if ( (*listptr)->Win == i) 00202 { 00203 /* try to find a scale for Cscale.subwin_rect for window i */ 00204 WCScaleList *loc = check_subwin_wcscale((*listptr)->scales,scale->subwin_rect); 00205 if ( loc != NULL) 00206 { 00207 /* subwin exists we update it */ 00208 scale_copy(loc,scale); 00209 /* we move loc to the top of the list */ 00210 if ( loc != (*listptr)->scales ) 00211 { 00212 (loc->prev)->next = loc->next ; 00213 if ( loc->next != NULL) (loc->next)->prev = loc->prev ; 00214 loc->next = (*listptr)->scales; 00215 loc->next->prev = loc ; 00216 (*listptr)->scales = loc; 00217 } 00218 } 00219 else 00220 { 00221 /* subwin does not exists we add it a the begining of the list */ 00222 if (( loc = new_wcscale(scale))== NULL) 00223 { 00224 sciprint("AddWindowScale_ memory exhausted\n"); 00225 return ; 00226 } 00227 else 00228 { 00229 loc->next = (*listptr)->scales; 00230 if (loc->next != NULL) loc->next->prev = loc; 00231 (*listptr)->scales = loc; 00232 } 00233 } 00234 } 00235 else 00236 set_scale_win( &((*listptr)->next),i,scale); 00237 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static void set_window_scale | ( | integer | i, | |
| WCScaleList * | scale | |||
| ) | [static] |
Definition at line 168 of file Plo2dEch.c.
References L, Max, scale, set_scale_win(), and The_List.
Referenced by Cscale2default(), Nsetscale2d(), and set_window_scale_with_default().
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:

Definition at line 422 of file Plo2dEch.c.
References NULL, and set_scale().
Referenced by cmscope(), and cscope().
00426 { 00427 static integer aaint[]={2,10,2,10}; 00428 if (logscale[0]=='l') 00429 { 00430 FRect[0]=log10(FRect[0]); 00431 FRect[2]=log10(FRect[2]); 00432 } 00433 if (logscale[1]=='l') 00434 { 00435 FRect[1]=log10(FRect[1]); 00436 FRect[3]=log10(FRect[3]); 00437 } 00438 set_scale("tttftf",WRect,FRect,aaint,logscale,NULL); 00439 return(0); 00440 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static void show_scales | ( | ScaleList * | listptr | ) | [static] |
Definition at line 391 of file Plo2dEch.c.
References wcscalelist::flag, wcscalelist::next, NULL, sciprint(), and wcscalelist::subwin_rect.
Referenced by ShowScales().
00393 { 00394 if (listptr != (ScaleList *) NULL) 00395 { 00396 WCScaleList *loc = listptr->scales; 00397 sciprint("Window %d \r\n",listptr->Win); 00398 while ( loc != NULL) 00399 { 00400 sciprint("\tsubwin=[%5.2f,%5.2f,%5.2f,%5.2f], flag=%d\r\n", 00401 loc->subwin_rect[0],loc->subwin_rect[1],loc->subwin_rect[2],loc->subwin_rect[3], 00402 loc->flag); 00403 loc = loc->next ; 00404 } 00405 show_scales(listptr->next); 00406 } 00407 }
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:

| int StoreCommand | ( | char * | command | ) |
Definition at line 82 of file dynamic_menus.c.
00083 { 00084 return (StoreCommand1 (command, 0)); /* jpc 1->0 */ 00085 }
| 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:

| void xclick_2 | ( | char * | fname, | |
| char * | str, | |||
| integer * | ibutton, | |||
| integer * | iflag, | |||
| integer * | istr, | |||
| integer * | x1, | |||
| integer * | yy1, | |||
| integer * | x7, | |||
| double * | x, | |||
| double * | y, | |||
| double * | dx3, | |||
| double * | dx4, | |||
| integer | lx0, | |||
| integer | lx1 | |||
| ) |
Definition at line 445 of file Xcall1.c.
References C2F, dr(), echelle2d(), L, n, and PD0.
Referenced by zoom_get_rectangle().
00446 { 00447 integer n=1; 00448 C2F(dr)(fname,str,ibutton,x1,yy1,iflag,istr,x7,PD0,PD0,dx3,dx4,lx0,lx1); 00449 if (*ibutton != -100) C2F(echelle2d)(x,y,x1,yy1,&n,&n,"i2f",3L); 00450 }
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:

Definition at line 793 of file Plo2dEch.c.
References Cscale, i, wcscalelist::logflag, sciprint(), x, XLogScale(), XPi2R(), and XScale().
Referenced by echelle2d().
00798 { 00799 integer i; 00800 if (strcmp("f2i",dir)==0) 00801 { 00802 00803 if (Cscale.logflag[0] == 'n') 00804 for ( i=0 ; i < (*n1) ; i++) x1[i]= XScale(x[i]); 00805 else 00806 for ( i=0 ; i < (*n1) ; i++) x1[i]= XLogScale(x[i]); 00807 } 00808 else if (strcmp("i2f",dir)==0) 00809 { 00810 if (Cscale.logflag[0] == 'n') 00811 for ( i=0 ; i < (*n1) ; i++) x[i]= XPi2R( x1[i] ); 00812 else 00813 for ( i=0 ; i < (*n1) ; i++) x[i]= exp10(XPi2R( x1[i])); 00814 } 00815 else 00816 sciprint(" Wrong dir %s argument in echelle2d\r\n",dir); 00817 00818 return(0); 00819 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void xgetmouse2 | ( | char * | fname, | |
| char * | str, | |||
| integer * | ibutton, | |||
| integer * | iflag, | |||
| integer * | x1, | |||
| integer * | yy1, | |||
| integer * | x6, | |||
| integer * | x7, | |||
| double * | x, | |||
| double * | y, | |||
| double * | dx3, | |||
| double * | dx4, | |||
| integer | lx0, | |||
| integer | lx1 | |||
| ) |
Definition at line 480 of file Xcall1.c.
References C2F, dr(), echelle2d(), L, n, and PD0.
Referenced by zoom_get_rectangle().
00481 { 00482 integer n=1; 00483 C2F(dr)(fname,str,ibutton,x1,yy1,iflag,x6,x7,PD0,PD0,dx3,dx4,lx0,lx1); 00484 00485 if (*ibutton != -100) C2F(echelle2d)(x,y,x1,yy1,&n,&n,"i2f",3L); 00486 }
Here is the call graph for this function:

Here is the caller 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:

Definition at line 823 of file Plo2dEch.c.
References Cscale, i, wcscalelist::logflag, sciprint(), YLogScale(), YPi2R(), and YScale().
Referenced by echelle2d().
00828 { 00829 integer i; 00830 if (strcmp("f2i",dir)==0) 00831 { 00832 if (Cscale.logflag[1] == 'n') 00833 for ( i=0 ; i < (*n2) ; i++) yy1[i]= YScale(y[i]); 00834 else 00835 for ( i=0 ; i < (*n2) ; i++) yy1[i]= YLogScale(y[i]); 00836 } 00837 else if (strcmp("i2f",dir)==0) 00838 { 00839 if (Cscale.logflag[1] == 'n') 00840 for ( i=0 ; i < (*n2) ; i++) y[i]= YPi2R( yy1[i] ); 00841 else 00842 for ( i=0 ; i < (*n2) ; i++) y[i]= exp10(YPi2R( yy1[i])); 00843 } 00844 else 00845 sciprint(" Wrong dir %s argument in echelle2d\r\n",dir); 00846 00847 return(0); 00848 }
Here is the call graph for this function:

Here is the caller 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:

| double Zoom3d_XPi2R | ( | int | x | ) |
Definition at line 1684 of file Plo2dEch.c.
References sciSubWindow::axes, Cscale, wcscalelist::frect, pSUBWIN_FEATURE, AXES::reverse, sciGetCurrentSubWin(), sciprint(), TRUE, wcscalelist::Wscx1, and wcscalelist::Wxofset1.
01685 { 01686 /*F.Leray 12.10.04 : MODIF named scale_modification*/ 01687 sciPointObj *pobj = sciGetCurrentSubWin(); 01688 sciSubWindow * ppsubwin = pSUBWIN_FEATURE (pobj); 01689 01690 if(ppsubwin->axes.reverse[0]==TRUE) /* difference is HERE */ 01691 return Cscale.frect[2] - (1.0/Cscale.Wscx1)*((x) - Cscale.Wxofset1); 01692 else 01693 return Cscale.frect[0] + (1.0/Cscale.Wscx1)*((x) - Cscale.Wxofset1); 01694 01695 01696 sciprint("Error in Zoom3d_XScale\n"); 01697 return -9000; 01698 }
Here is the call graph for this function:

| double Zoom3d_YPi2R | ( | int | y | ) |
Definition at line 1701 of file Plo2dEch.c.
References sciSubWindow::axes, Cscale, wcscalelist::frect, pSUBWIN_FEATURE, AXES::reverse, sciGetCurrentSubWin(), sciprint(), TRUE, wcscalelist::Wscy1, and wcscalelist::Wyofset1.
01702 { 01703 /*F.Leray 12.10.04 : MODIF named scale_modification*/ 01704 01705 sciPointObj *pobj = sciGetCurrentSubWin(); 01706 sciSubWindow * ppsubwin = pSUBWIN_FEATURE (pobj); 01707 01708 if(ppsubwin->axes.reverse[1]==TRUE) /* difference is HERE */ 01709 return Cscale.frect[1] + (1.0/Cscale.Wscy1)*((y) - Cscale.Wyofset1); 01710 else 01711 return Cscale.frect[3] - (1.0/Cscale.Wscy1)*((y) - Cscale.Wyofset1); 01712 01713 01714 01715 sciprint("Error in Zoom3d_YScale\n"); 01716 return -9000; 01717 }
Here is the call 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:

get a rectangle interactively
XXXXXX : a regler pour Win32 in = 6
XXXX
Definition at line 1057 of file Plo2dEch.c.
References C2F, dr(), dr1(), L, Max, Min, PD0, PI0, ReleaseWinHdc(), SciMouseCapture(), SciMouseRelease(), sciprint(), SetDriver(), SetWinhdc(), style, xclick_2(), xgetmouse2(), and zoom_rect2().
Referenced by zoom().
01058 { 01059 /* Using the mouse to get the new rectangle to fix boundaries */ 01060 integer th,th1=1; 01061 integer pixmode,alumode,color,style[10],fg,verbose=0,narg; 01062 integer ibutton,in,iwait=0,istr=0; 01063 integer modes[2]; 01064 double x0,yy0,x,y,xl,yl; 01065 int pixel_x, pixel_y; 01066 int pixel_x0, pixel_y0; 01067 /* int i; */ 01068 01069 modes[0]=1;modes[1]=0; /* for xgemouse only get mouse mouvement*/ 01070 01071 C2F(dr)("xget","pixmap",&verbose,&pixmode,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 01072 C2F(dr)("xget","alufunction",&verbose,&alumode,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 01073 C2F(dr)("xget","thickness",&verbose,&th,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 01074 C2F(dr)("xget","color",&verbose,&color,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 01075 C2F(dr)("xget","line style",&verbose,style,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 01076 C2F(dr)("xget","foreground",&verbose,&fg,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 01077 01078 #ifdef _MSC_VER 01079 SetWinhdc(); 01080 SciMouseCapture(); 01081 #endif 01082 C2F(SetDriver)("X11",PI0,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0); 01083 C2F(dr)("xset","thickness",&th1,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 01084 C2F(dr)("xset","line style",(in=1,&in),PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 01085 C2F(dr)("xset","color",&fg,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 01086 01088 C2F(dr1)("xset","alufunction",(in=6,&in),PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 01089 /* C2F(dr1)("xclick","one",&ibutton,&iwait,&istr,PI0,PI0,PI0,&x0,&yy0,PD0,PD0,0L,0L); */ 01090 xclick_2("xclick","one",&ibutton,&iwait,&istr,&x_pixel[0],&y_pixel[0],PI0,&x0,&yy0,PD0,PD0,0L,0L); 01091 01092 01093 if(ibutton == -100){ 01094 sciprint("Error: window closed while zooming\t\n"); 01095 return 1; /* error catch : no need to go further F.Leray 07.09.05 */ 01096 } 01097 01098 x=x0;y=yy0; 01099 01100 pixel_x = pixel_x0 = x_pixel[0]; 01101 pixel_y = pixel_y0 = y_pixel[0]; 01102 01103 ibutton=-1; 01104 while ( ibutton == -1 ) 01105 { 01106 /* dessin d'un rectangle */ 01107 /* following line commented to solve bug 1314 */ 01108 /* C2F (dr) ("xset", "color",&noir,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0, PD0,0L,0L); */ 01109 zoom_rect2(pixel_x0,pixel_y0,pixel_x,pixel_y); 01110 if ( pixmode == 1) C2F(dr1)("xset","wshow",PI0,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 01111 xgetmouse2("xgetmouse","one",&ibutton,&iwait,&x_pixel[1],&y_pixel[1],modes,PI0,&xl, &yl,PD0,PD0,0L,0L); 01112 01113 if (ibutton==-100) return 1; /* the window has been closed */ /* error catch : no need to go further F.Leray 07.09.05 */ 01114 /* effacement du rectangle */ 01115 zoom_rect2(pixel_x0,pixel_y0,pixel_x,pixel_y); 01116 if ( pixmode == 1) C2F(dr1)("xset","wshow",PI0,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 01117 x=xl;y=yl; 01118 01119 pixel_x = x_pixel[1]; 01120 pixel_y = y_pixel[1]; 01121 } 01122 #ifndef _MSC_VER 01123 01124 C2F(dr1)("xset","alufunction",(in=3,&in),PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 01125 #endif 01126 /* Back to the default driver which must be Rec and redraw the recorded 01127 * graphics with the new scales 01128 */ 01129 /* F.Leray With the new graphic standard, driver has not to be Rec*/ 01130 01131 01132 /* printf("JE SORS et...\n"); */ 01133 01134 bbox[0]=Min(x0,x); 01135 bbox[1]=Min(yy0,y); 01136 bbox[2]=Max(x0,x); 01137 bbox[3]=Max(yy0,y); 01138 01139 01140 C2F(dr1)("xset","alufunction",&alumode,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 01141 C2F(dr)("xset","thickness",&th,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 01142 C2F(dr)("xset","line style",style,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 01143 C2F(dr)("xset","color",&color,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 01144 01145 #ifdef _MSC_VER 01146 ReleaseWinHdc(); 01147 SciMouseRelease(); 01148 #endif 01149 return 0; 01150 }
Here is the call graph for this function:

Here is the caller graph for this function:

Win32, warning when using xor mode colors are changed and black is turned to white so we must use an other pattern than the black one inside dbox
Definition at line 1732 of file Plo2dEch.c.
References C2F, dr(), L, PD0, and PI0.
Referenced by zoom_get_rectangle().
01733 { 01734 int closeflag=0; 01735 int cinq=5; 01736 01737 int xm[5], ym[5]; 01738 01739 #ifdef _MSC_VER 01740 integer verbose=0,pat,pat1=3,narg; 01741 #endif 01742 01743 if(xpix_ini < xpix_fin){ 01744 xm[0] = xpix_ini; 01745 xm[1] = xpix_ini; 01746 xm[4] = xpix_ini; 01747 01748 xm[2] = xpix_fin; 01749 xm[3] = xpix_fin; 01750 } 01751 else{ 01752 xm[0] = xpix_fin; 01753 xm[1] = xpix_fin; 01754 xm[4] = xpix_fin; 01755 01756 xm[2] = xpix_ini; 01757 xm[3] = xpix_ini; 01758 } 01759 01760 if(ypix_ini < ypix_fin){ 01761 ym[0] = ypix_ini; 01762 ym[3] = ypix_ini; 01763 ym[4] = ypix_ini; 01764 01765 ym[1] = ypix_fin; 01766 ym[2] = ypix_fin; 01767 } 01768 else{ 01769 ym[0] = ypix_fin; 01770 ym[3] = ypix_fin; 01771 ym[4] = ypix_fin; 01772 01773 ym[1] = ypix_ini; 01774 ym[2] = ypix_ini; 01775 } 01776 01777 #ifdef _MSC_VER 01778 C2F(dr)("xget","pattern",&verbose,&pat,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 01779 C2F(dr)("xset","pattern",&pat1,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 01780 #endif 01781 01782 /* C2F(dr1)("xrect","v",PI0,PI0,PI0,PI0,PI0,PI0,&xi,&yi,&w,&h,0L,0L); */ 01783 01784 01785 C2F (dr) ("xlines", "xv", &cinq, xm, ym, &closeflag, PI0, PI0, PD0, PD0, PD0, PD0,6L,2L); 01786 01787 01788 01789 #ifdef _MSC_VER 01790 C2F(dr)("xset","pattern",&pat,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 01791 #endif 01792 }
Here is the call graph for this function:

Here is the caller graph for this function:

Initial value:
{
0,
{600,400},
{0.0,0.0,1.0,1.0},
{0.0,0.0,1.0,1.0},
{1/8.0,1/8.0,1/8.0,1/8.0},
{0.0,1.0,0.0,10},
{0.0,1.0,0.0,10},
75.0,53.0,450.0,318.0,
{'n','n'},
{75,53,450,318},
{2,10,2,10},
{{1.0,0.0,0.0},{0.0,1.0,0.0},{0.0,0.0,1.0}},
{0.0,1.0,0.0,1.0,0.0,1.0},
35.0,45.0,
1,
(WCScaleList *) 0,
(WCScaleList *) 0
}
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().
Initial value:
{
0,
{600,400},
{0.0,0.0,1.0,1.0},
{0.0,0.0,1.0,1.0},
{1/8.0,1/8.0,1/8.0,1/8.0},
{0.0,1.0,0.0,10},
{0.0,1.0,0.0,10},
75.0,53.0,450.0,318.0,
{'n','n'},
{75,53,450,318},
{2,10,2,10},
{{1.0,0.0,0.0},{0.0,1.0,0.0},{0.0,0.0,1.0}},
{0.0,1.0,0.0,1.0,0.0,1.0},
35.0,45.0,
1,
(WCScaleList *) 0,
(WCScaleList *) 0
}
Definition at line 79 of file Plo2dEch.c.
Referenced by Cscale2default(), and set_window_scale_with_default().
Definition at line 52 of file Plo2dEch.c.
Referenced by addWindowItem(), del_window_scale(), findWindowItem(), get_window_scale(), getFirstWindow(), getLastWindowItem(), getScilabWindowList(), getWindowXgcNumber(), getWins(), getWinsMaxId(), isWindowListEmpty(), removeWindowItem(), set_window_scale(), and ShowScales().
1.5.1