Axes.h

Go to the documentation of this file.
00001 /*======================================================================================*/
00002 /* Copyrigth INRIA 2006                                                                 */
00003 /* File   : Axes.h                                                                      */
00004 /* Author : Jean-Baptiste Silvy INRIA                                                   */
00005 /* Desc   : Various functions to manipulate SubWindow objects                           */
00006 /*======================================================================================*/
00007 
00008 #ifndef __SCI_AXES_H__
00009 #define __SCI_AXES_H__
00010 
00011 #include "ObjectStructure.h"
00012 
00013 /*--------------------------------------------------------------------------------------*/
00014 /* check if the graduation text foo is inside the old_rect */
00015 /* in this case it should not been displayed */
00016 BOOL CheckDisplay( double fact_h, double fact_w, char logflag, char *foo,int *posi,int *fontid,int *old_rect) ;
00017 
00018 /* The unit is the pixel */
00019 /* return 0 if the point is inside the rect */
00020 /* 1 if it is actually outside the rect */
00021 /* (rect[0],rect[1]) : upper left point of the bounding box  in pixel */
00022 /* (rect[2],rect[3]) : width and height in pixel */
00023 /* point[0] : x component */
00024 /* point[1] : y component */
00025 BOOL IsInsideRectangle(int * rect, int *point) ;
00026 
00027 /* get the bounding rectangle of a label of a ticks */
00028 /* similar to stringBoundingRect but only for ticks labels */
00029 void getTicksLabelBox( double   fact_h   ,
00030                        double   fact_w   , 
00031                        char   * label    ,
00032                        int      pos[2]   ,
00033                        int      fontId[2],
00034                        char     logflag  ,
00035                        int      bbox[4]  ,
00036                        BOOL     changeFont ) ;
00037 
00038 /* remove the concealed ticks before display on the X and Y axis */
00039 BOOL checkXAxes2dTics( sciPointObj * psubwin  ,
00040                        char          side     ,
00041                        double        y        ,
00042                        char        * cFormat  ,
00043                        int           fontId[2],
00044                        int           smallersize ) ;
00045 
00046 /* remove the concealed ticks before display on the X and Y axis */
00047 BOOL checkYAxes2dTics( sciPointObj * psubwin  ,
00048                        char          side     ,
00049                        double        x        ,
00050                        char        * cFormat  ,
00051                        int           fontId[2],
00052                        int           smallersize ) ;
00053 
00054 
00055 void updateXaxesTics( sciPointObj * psubwin  ,
00056                       char          side     ,
00057                       double        y        ,
00058                       int           fontId[2],
00059                       int           smallersize ) ;
00060 
00061 void updateYaxesTics( sciPointObj * psubwin  ,
00062                       char          side     ,
00063                       double        x        ,
00064                       int           fontId[2],
00065                       int           smallersize ) ;
00066 
00067 /* remove in the ticks array the indices i such as removedTicks[i] */
00068 /* is true. The value nbtics is an in-out variable */
00069 void removeBadTicks( double * ticks, BOOL * removedTicks, int * nbTicks ) ;
00070 
00071 /* remove an element in the array from translating the next
00072    elements on step backward */
00073 void removeIndex( double * changedArray, int size, int ind ) ;
00074 
00075 /* compute the needed formats to display the ticks of a subWin */
00076 void findFormat( sciPointObj * pSubWin, char formatX[5], char formatY[5] ) ;
00077 
00078 /*--------------------------------------------------------------------------------------*/
00079 
00080 /*--------------------------------------------------------------------------------------*/
00081 
00082 /* clear a subwindow from all of its children */
00083 void clearSubWin( sciPointObj * pSubWin ) ;
00084 
00085 /* reinit a subwindow (but don't change position) */
00086 void reinitSubWin( sciPointObj * pSubWin ) ;
00087 
00088 /* reinit the viewing angles of a subwindow */
00089 void initSubWinAngles( sciPointObj * pSubWin ) ;
00090 
00091 /* set the size and position of the subwindow to the default */
00092 void initSubWinSize( sciPointObj * pSubWin ) ;
00093 
00094 /* set the data_bounds of the axes to the default value */
00095 void initSubWinBounds( sciPointObj * pSubWin ) ;
00096 
00097 /* reinit the selected subwindow if the auto_clear property is set to on */
00098 /* return TRUE if the window has been redrawn */
00099 BOOL checkRedrawing( void ) ;
00100 
00101 /*--------------------------------------------------------------------------------------*/
00106 void updateSubWinScale( sciPointObj * pSubWin ) ;
00107 
00112 void updateScaleIfRequired( sciPointObj * pSubWin ) ;
00113 /*--------------------------------------------------------------------------------------*/
00117 void drawAxesGrid( sciPointObj * psubwin ) ;
00118 /*--------------------------------------------------------------------------------------*/
00119 extern void axis_3ddraw(sciPointObj *pobj, double *xbox, double *ybox, double *zbox, integer *InsideU, integer *InsideD); /* DRAWINGS */
00120 extern void triedre(sciPointObj *pobj, double *xbox, double *ybox, double *zbox, integer *InsideU, integer *InsideD); /* DRAWINGS */
00121 void DrawAxesBackground( void ) ;
00122 int labels2D_draw( sciPointObj * psubwin ) ;
00123 void rebuild_strflag( sciPointObj * psubwin, char * STRFLAG) ;
00124 void axis_draw2(char strflag[]) ;
00125 void Sci_Axis(char pos, char xy_type, double *x, int *nx, double *y, int *ny,
00126               char *str[], int subtics, char *format, int fontsize, int textcolor, 
00127               int fontstyle, int ticscolor, char logflag, int seg_flag, int axisbuild_flag) ;
00132 void DrawAxis(double xbox[8], double ybox[8], integer Indices[4], integer style) ;
00133 
00137 int Axes3dStrings2( integer * ixbox, integer * iybox, integer * xind ) ;
00138 
00139 /*--------------------------------------------------------------------------------------*/
00140 
00141 #endif /*__SCI_AXES_H_*/

Generated on Sun Mar 4 15:03:49 2007 for Scilab [trunk] by  doxygen 1.5.1