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

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

Go to the source code of this file.
Functions | |
| double | InvAxis (double min, double max, double u) |
| int | ReverseDataFor3DXonly (sciPointObj *psubwin, double xvect[], int n1) |
| int | ReverseDataFor3DYonly (sciPointObj *psubwin, double yvect[], int n1) |
| int | ReverseDataFor3DZonly (sciPointObj *psubwin, double zvect[], int n1) |
| int | ReverseDataFor3D (sciPointObj *psubwin, double xvect[], double yvect[], double zvect[], int n1) |
| int | trans3d (sciPointObj *pobj, integer n, integer xm[], integer ym[], double x[], double y[], double z[]) |
| double InvAxis | ( | double | min, | |
| double | max, | |||
| double | u | |||
| ) |
Definition at line 20 of file axesScale.c.
Referenced by AdaptGraduationsOnXBottomLeft(), AdaptGraduationsOnXBottomRight(), AdaptGraduationsOnYBottomLeft(), AdaptGraduationsOnYBottomRight(), AdaptGraduationsOnZ(), DrawMerge3d(), geom3d(), ReverseDataFor3DXonly(), ReverseDataFor3DYonly(), ReverseDataFor3DZonly(), and zoom_box().
00021 { 00022 /*return (u-min) / (max-min) * min + (u-max) / (min-max) * max ;*/ 00023 return min + max - u ; /* ahah little simplification */ 00024 }
Here is the caller graph for this function:

| int ReverseDataFor3D | ( | sciPointObj * | psubwin, | |
| double | xvect[], | |||
| double | yvect[], | |||
| double | zvect[], | |||
| int | n1 | |||
| ) |
Definition at line 114 of file axesScale.c.
References ReverseDataFor3DXonly(), ReverseDataFor3DYonly(), and ReverseDataFor3DZonly().
Referenced by drawArcEntity(), DrawMerge3d(), drawPolylineEntity(), drawSegsEntity(), fac3dn(), getPixelCoordinates(), rectangleDouble2Pixel(), and retrieveFacetVertices().
00115 { 00116 00117 ReverseDataFor3DXonly(psubwin, xvect, n1); 00118 ReverseDataFor3DYonly(psubwin, yvect, n1); 00119 ReverseDataFor3DZonly(psubwin, zvect, n1); 00120 00121 return 0; 00122 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int ReverseDataFor3DXonly | ( | sciPointObj * | psubwin, | |
| double | xvect[], | |||
| int | n1 | |||
| ) |
Definition at line 26 of file axesScale.c.
References sciSubWindow::axes, sciSubWindow::FRect, InvAxis(), sciSubWindow::logflags, pSUBWIN_FEATURE, and AXES::reverse.
Referenced by drawFecEntity(), drawGrayplotEntity(), plot3dn(), and ReverseDataFor3D().
00027 { 00028 sciSubWindow * ppsubwin = pSUBWIN_FEATURE(psubwin) ; 00029 int cmp; 00030 00031 if( ppsubwin->axes.reverse[0] ) 00032 { 00033 /* agir sur x */ 00034 if( ppsubwin->logflags[0] == 'l' ) 00035 { 00036 for( cmp = 0 ; cmp < n1 ; cmp++ ) 00037 { 00038 xvect[cmp] = log10( xvect[cmp] ) ; 00039 xvect[cmp] = InvAxis( ppsubwin->FRect[0], ppsubwin->FRect[2], xvect[cmp] ) ; 00040 xvect[cmp] = exp10( xvect[cmp] ) ; 00041 } 00042 } 00043 else 00044 { 00045 for( cmp = 0 ; cmp < n1 ; cmp++ ) 00046 { 00047 xvect[cmp] = InvAxis( ppsubwin->FRect[0], ppsubwin->FRect[2], xvect[cmp] ) ; 00048 } 00049 } 00050 } 00051 00052 return 0 ; 00053 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int ReverseDataFor3DYonly | ( | sciPointObj * | psubwin, | |
| double | yvect[], | |||
| int | n1 | |||
| ) |
Definition at line 55 of file axesScale.c.
References sciSubWindow::axes, sciSubWindow::FRect, InvAxis(), sciSubWindow::logflags, pSUBWIN_FEATURE, and AXES::reverse.
Referenced by drawFecEntity(), drawGrayplotEntity(), plot3dn(), and ReverseDataFor3D().
00056 { 00057 sciSubWindow * ppsubwin = pSUBWIN_FEATURE(psubwin); 00058 int cmp; 00059 00060 if( ppsubwin->axes.reverse[1] ) 00061 { 00062 /* agir sur y */ 00063 if(ppsubwin->logflags[1]=='l'){ 00064 for(cmp=0;cmp<n1;cmp++) 00065 { 00066 yvect[cmp] = log10(yvect[cmp]); 00067 yvect[cmp] = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],yvect[cmp]); 00068 yvect[cmp] = exp10(yvect[cmp]); 00069 } 00070 } 00071 else 00072 { 00073 for(cmp=0;cmp<n1;cmp++) 00074 { 00075 yvect[cmp] = InvAxis(ppsubwin->FRect[1],ppsubwin->FRect[3],yvect[cmp]); 00076 } 00077 } 00078 } 00079 00080 return 0; 00081 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int ReverseDataFor3DZonly | ( | sciPointObj * | psubwin, | |
| double | zvect[], | |||
| int | n1 | |||
| ) |
Definition at line 83 of file axesScale.c.
References sciSubWindow::axes, sciSubWindow::FRect, InvAxis(), sciSubWindow::logflags, NULL, pSUBWIN_FEATURE, and AXES::reverse.
Referenced by plot3dn(), and ReverseDataFor3D().
00084 { 00085 sciSubWindow * ppsubwin = pSUBWIN_FEATURE(psubwin); 00086 int cmp; 00087 00088 if( zvect == NULL ) { return 0 ; } 00089 00090 if( ppsubwin->axes.reverse[2] ) 00091 { 00092 /* agir sur z */ 00093 if(ppsubwin->logflags[2]=='l') 00094 { 00095 for(cmp=0;cmp<n1;cmp++) 00096 { 00097 zvect[cmp] = log10(zvect[cmp]); 00098 zvect[cmp] = InvAxis(ppsubwin->FRect[4],ppsubwin->FRect[5],zvect[cmp]); 00099 zvect[cmp] = exp10(zvect[cmp]); 00100 } 00101 } 00102 else 00103 { 00104 for(cmp=0;cmp<n1;cmp++) 00105 { 00106 zvect[cmp] = InvAxis(ppsubwin->FRect[4],ppsubwin->FRect[5],zvect[cmp]); 00107 } 00108 } 00109 } 00110 00111 return 0; 00112 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int trans3d | ( | sciPointObj * | pobj, | |
| integer | n, | |||
| integer | xm[], | |||
| integer | ym[], | |||
| double | x[], | |||
| double | y[], | |||
| double | z[] | |||
| ) |
Definition at line 124 of file axesScale.c.
References finite(), FREE, i, inint, isZoom3dOn(), sciSubWindow::logflags, MALLOC, NULL, pSUBWIN_FEATURE, SCI_SUBWIN, sciGetEntityType(), sciprint(), Store3DPixelValues(), TX3D, and TY3D.
Referenced by ComputeGoodTrans3d(), drawArcEntity(), drawFecEntity(), drawGrayplotEntity(), DrawMerge3d(), drawPolylineEntity(), drawSegsEntity(), fac3dn(), Gen3DPoints(), getPixelCoordinates(), and rectangleDouble2Pixel().
00131 { 00132 integer i; 00133 double tmpx,tmpy,tmpz; 00134 double tmpx1,tmpy1,tmpz1; 00135 /* TEST F.Leray 20.04.04: I fix HERE temporarily BOOL cube_scaling = FALSE; */ 00136 BOOL cube_scaling; 00137 /* Test to enable reverse axis in 3D */ /* F.Leray 14.10.04 */ 00138 sciSubWindow * ppsubwin = pSUBWIN_FEATURE(pobj); 00139 00140 double *xtmp = NULL; 00141 double *ytmp = NULL; 00142 double xz1 ; 00143 double yz1 ; 00144 00145 if (sciGetEntityType(pobj) != SCI_SUBWIN) { return 1 ; } 00146 00147 xtmp = MALLOC(n*sizeof(double)); 00148 ytmp = MALLOC(n*sizeof(double)); 00149 00150 cube_scaling = pSUBWIN_FEATURE(pobj)->cube_scaling; 00151 00152 if( !cube_scaling) 00153 { 00154 if (z == (double *) NULL) 00155 { 00156 for ( i=0 ; i < n ; i++) 00157 { 00158 /* F.Leray 19.10.04 */ 00159 /* Test to export logscale in 3D */ 00160 00161 if(ppsubwin->logflags[0] == 'l') 00162 { 00163 tmpx = log10(x[i]); 00164 } 00165 else 00166 { 00167 tmpx = x[i]; 00168 } 00169 00170 if(ppsubwin->logflags[1] == 'l') 00171 { 00172 tmpy = log10(y[i]); 00173 } 00174 else 00175 { 00176 tmpy = y[i]; 00177 } 00178 00179 if(ppsubwin->logflags[2] == 'l'){ 00180 sciprint("Warning: Value on z data is negative or zero while logarithmic scale enabled\n"); 00181 sciprint("Object not drawn\n"); 00182 FREE(xtmp); xtmp = NULL; FREE(ytmp); ytmp = NULL; 00183 return 0; 00184 } 00185 00186 xz1 = TX3D(tmpx,tmpy,0.0); 00187 yz1 = TY3D(tmpx,tmpy,0.0); 00188 xm[i] = inint( xz1 ) ; 00189 ym[i] = inint( yz1 ) ; 00190 00191 if( isZoom3dOn() ) 00192 { 00193 Store3DPixelValues(pobj,xm[i],ym[i],tmpx,tmpy,0.); /* stockage des xm, ym pour le zoom */ 00194 } 00195 00196 if ( finite(xz1)==0||finite(yz1)==0 ){ 00197 FREE(xtmp); xtmp = NULL; FREE(ytmp); ytmp = NULL; 00198 return(0); 00199 } 00200 } 00201 } 00202 else /* z != NULL */ 00203 { 00204 for ( i=0 ; i < n ; i++) /* cas 3d le + general */ 00205 { 00206 00207 /* F.Leray 19.10.04 */ 00208 /* Test to export logscale in 3D */ 00209 00210 if(ppsubwin->logflags[0] == 'l') 00211 tmpx = log10(x[i]); 00212 else 00213 tmpx = x[i]; 00214 00215 if(ppsubwin->logflags[1] == 'l') 00216 tmpy = log10(y[i]); 00217 else 00218 tmpy = y[i]; 00219 00220 if(ppsubwin->logflags[2] == 'l') 00221 tmpz = log10(z[i]); 00222 else 00223 tmpz = z[i]; 00224 00225 00226 xz1 = TX3D(tmpx,tmpy,tmpz); 00227 yz1 = TY3D(tmpx,tmpy,tmpz); 00228 xm[i] = inint( xz1 ) ; 00229 ym[i] = inint( yz1 ) ; 00230 00231 if( isZoom3dOn() ) 00232 Store3DPixelValues(pobj,xm[i],ym[i],tmpx,tmpy,tmpz); /* stockage des xm, ym pour le zoom */ 00233 00234 if ( finite(xz1)==0||finite(yz1)==0 ){ 00235 FREE(xtmp); xtmp = NULL; FREE(ytmp); ytmp = NULL; 00236 return(0); 00237 } 00238 /* } */ 00239 } 00240 FREE(xtmp); xtmp = NULL; FREE(ytmp); ytmp = NULL; 00241 } 00242 } 00243 else /* cube_scaling == TRUE now */ 00244 { 00245 if (z == (double *) NULL) 00246 { 00247 for ( i=0 ; i < n ; i++) 00248 { 00249 00250 /* F.Leray 03.11.04 */ 00251 /* Test to export logscale in 3D */ 00252 00253 if(ppsubwin->logflags[0] == 'l') 00254 tmpx = log10(x[i]); 00255 else 00256 tmpx = x[i]; 00257 00258 if(ppsubwin->logflags[1] == 'l') 00259 tmpy = log10(y[i]); 00260 else 00261 tmpy = y[i]; 00262 00263 if(ppsubwin->logflags[2] == 'l'){ 00264 sciprint("Warning: Value on z data is negative or zero while logarithmic scale enabled\n"); 00265 sciprint("Object not drawn\n"); 00266 FREE(xtmp); xtmp = NULL; FREE(ytmp); ytmp = NULL; 00267 return 0; 00268 } 00269 00270 tmpx1 = tmpx; 00271 tmpy1 = tmpy; 00272 tmpz1 = 0.; 00273 00274 tmpx=(tmpx-pSUBWIN_FEATURE (pobj)->FRect[0])/(pSUBWIN_FEATURE (pobj)->FRect[2]-pSUBWIN_FEATURE (pobj)->FRect[0]); 00275 tmpy=(tmpy-pSUBWIN_FEATURE (pobj)->FRect[1])/(pSUBWIN_FEATURE (pobj)->FRect[3]-pSUBWIN_FEATURE (pobj)->FRect[1]); 00276 tmpz=(0.-pSUBWIN_FEATURE (pobj)->FRect[4])/(pSUBWIN_FEATURE (pobj)->FRect[5]-pSUBWIN_FEATURE (pobj)->FRect[4]); /* Adding F.Leray 04.11.04 */ 00277 00278 xz1 = TX3D(tmpx,tmpy,tmpz); 00279 yz1 = TY3D(tmpx,tmpy,tmpz); 00280 xm[i] = inint( xz1 ) ; 00281 ym[i] = inint( yz1 ) ; 00282 00283 if( isZoom3dOn()) 00284 Store3DPixelValues(pobj,xm[i],ym[i],tmpx1,tmpy1,tmpz1); /* stockage des xm, ym pour le zoom */ 00285 00286 if ( finite(xz1)==0||finite(yz1)==0 ){ 00287 FREE(xtmp); xtmp = NULL; FREE(ytmp); ytmp = NULL; 00288 return(0); 00289 } 00290 } 00291 } 00292 else /* z != NULL */ 00293 { 00294 for ( i=0 ; i < n ; i++) 00295 { 00296 00297 /* F.Leray 03.11.04 */ 00298 /* Test to export logscale in 3D */ 00299 00300 if(ppsubwin->logflags[0] == 'l') 00301 tmpx = log10(x[i]); 00302 else 00303 tmpx = x[i]; 00304 00305 if(ppsubwin->logflags[1] == 'l') 00306 tmpy = log10(y[i]); 00307 else 00308 tmpy = y[i]; 00309 00310 if(ppsubwin->logflags[2] == 'l') 00311 tmpz = log10(z[i]); 00312 else 00313 tmpz = z[i]; 00314 00315 tmpx1 = tmpx; 00316 tmpy1 = tmpy; 00317 tmpz1 = tmpz; 00318 00319 tmpx= (tmpx-pSUBWIN_FEATURE (pobj)->FRect[0])/(pSUBWIN_FEATURE (pobj)->FRect[2]-pSUBWIN_FEATURE (pobj)->FRect[0]); 00320 tmpy= (tmpy-pSUBWIN_FEATURE (pobj)->FRect[1])/(pSUBWIN_FEATURE (pobj)->FRect[3]-pSUBWIN_FEATURE (pobj)->FRect[1]); 00321 tmpz= (tmpz-pSUBWIN_FEATURE (pobj)->FRect[4])/(pSUBWIN_FEATURE (pobj)->FRect[5]-pSUBWIN_FEATURE (pobj)->FRect[4]); /* Adding F.Leray 28.04.04 */ 00322 00323 xz1 = TX3D(tmpx,tmpy,tmpz); 00324 yz1 = TY3D(tmpx,tmpy,tmpz); 00325 xm[i] = inint( xz1 ) ; 00326 ym[i] = inint( yz1 ) ; 00327 00328 if( isZoom3dOn() ) 00329 Store3DPixelValues(pobj,xm[i],ym[i],tmpx1,tmpy1,tmpz1); /* stockage des xm, ym pour le zoom */ 00330 00331 if ( finite(xz1)==0||finite(yz1)==0 ){ 00332 FREE(xtmp); xtmp = NULL; FREE(ytmp); ytmp = NULL; 00333 return(0); 00334 } 00335 } 00336 } 00337 } 00338 FREE(xtmp); xtmp = NULL; FREE(ytmp); ytmp = NULL; 00339 return(1); 00340 }
Here is the call graph for this function:

Here is the caller graph for this function:

1.5.1