DrawObjects.h

Go to the documentation of this file.
00001 /*------------------------------------------------------------------------
00002  *    Graphic library 
00003  *    Copyright INRIA
00004  *    newGraph Library header
00005  *    Matthieu PHILIPPE, INRIA 2001-2002
00006  *    Djalel ABDEMOUCHE, INRIA 2002-2004
00007  *    Fabrice Leray,     INRIA 2004-xxxx
00008  *    Comment:
00009  *    This file contains all functions used to Draw the content of a window.
00010  *    The main functions is sciDrawObj that draws the objects recursively.
00011  --------------------------------------------------------------------------*/
00012 
00013 #include "ObjectStructure.h"
00014 #include "HandleManagement.h"
00015 
00016 
00017 #ifndef __SCI_DRAWINGS__
00018 #define __SCI_DRAWINGS__
00019 
00020 #define spINSIDE_SPARSE /* F.Leray to have LARGEST_REAL*/
00021 #include "../../sparse/includes/spConfig.h"
00022 
00023 
00024 #include "bcg.h"
00025 #include "PloEch.h"
00026 #include "Vect2Matrix.h"
00027 #include "StringMatrix.h"
00028 
00029 void wininfo  __PARAMS((char *fmt,...));
00030 
00031 int get_cf_type( void ) ;
00032 
00033 extern void GPopupResize (struct BCG * ScilabXgc,int * width,int * height);
00034 /* static struct BCG *tmpScilabXgc; */
00035 
00036 void set_cf_type( int val ) ;
00037 
00038 
00039 
00040 char ** FreeUserLabels(char ** u_xlabels, int *u_nxgrads);
00041 double * AllocUserGrads(double * u_xgrads, int nb);
00042 int CopyUserGrads(double *u_xgrad_SRC, double *u_xgrad_DEST, int dim);
00043 char ** AllocAndSetUserLabelsFromMdl(char ** u_xlabels, char ** u_xlabels_MDL, int u_nxgrads);
00044 
00045 
00046 extern int cf_type ; /* used by gcf to determine if current figure is a graphic (1) or a tksci (0) one */
00047 
00048 
00049 /*******************************************************/
00050 
00051 #ifdef _MSC_VER
00052 extern HFONT sciCreateFont (HDC hdc, char *szFaceName, int iDeciPtHeight, int iDeciPtWidth, int iAttributes, BOOL fLogRes);  /* DRAWINGS */
00053 /* extern HDC sciGetHDC (sciPointObj * pobj);    /\* DRAWINGS *\/ */ /* inexistant in Entities.c */
00054 #endif
00055 
00056 extern void sciRedrawFigure(void); /* DRAWINGS */
00057 extern void sciRedrawF(int *num); /* DRAWINGS */
00058 extern void sciXbasc(void);  /* DRAWINGS */
00059 extern void sciXclear(void); /* DRAWINGS */
00060  
00061 /* 3 next are in plo3d.c*/
00062 extern void SetEch3d1(double *xbox, double *ybox, double *zbox, double *bbox, double *teta, double *alpha, integer flag); /* DRAWINGS */
00063 extern void Convex_Box(double *xbox, double *ybox, integer *InsideU, integer *InsideD, char *legend, integer *flag, double *bbox); /* DRAWINGS */
00064 
00065 extern void Nextind(integer ind1, integer *ind2, integer *ind3); /* DRAWINGS */
00066 extern int GradLog(double _min, double _max, double *_grads, int * n_grads, int compNgrads );
00067 extern BOOL Ishidden(sciPointObj *pobj); /* DRAWINGS */
00068 extern BOOL IsDownAxes(sciPointObj *pobj); /* DRAWINGS */
00069 extern void sciGetDisplayedBounds( sciPointObj * pSubWin,
00070                                    double      * xmin   ,
00071                                    double      * xmax   ,
00072                                    double      * ymin   ,
00073                                    double      * ymax   ,
00074                                    double      * zmin   ,
00075                                    double      * zmax    ) ;
00076 extern void updateScale3d( sciPointObj * pobj    ,
00077                            double        dbox[6] ,
00078                            double        xbox[8] ,
00079                            double        ybox[8] ,
00080                            double        zbox[8]  );
00081 extern BOOL sci_update_frame_bounds_3d(sciPointObj *pobj);  /* DRAWINGS */
00082 extern BOOL sci_update_frame_bounds_2d(sciPointObj *pobj);  /* DRAWINGS */
00083 
00084 extern int ComputeNbSubTics(sciPointObj * pobj, int nbtics, char logflag, double * grads, int nbsubtics_input); /* DRAWINGS */
00085 extern int ComputeNbSubTicsFor3dUse(sciPointObj * pobj, int nbtics, char logflag, double * grads, int nbsubtics_input);
00086 extern int ComputeCorrectXindAndInsideUD(double Teta,double Alpha, double * dbox, integer *xind, integer *InsideU, integer *InsideD); /* DRAWINGS */
00087 extern int Axes3dStrings2(integer *ixbox, integer *iybox, integer *xind); /* DRAWINGS */
00088 extern int AdaptGraduationsOnZ(int x, int y, int size, integer *Ticsdir, int *fontid, sciPointObj * psubwin, double zminval, double zmaxval, double fx, double fy, double fz);
00089 extern int AdaptGraduationsOnXBottomRight(int iof, int x, int y, int size, integer *Ticsdir, int *fontid, sciPointObj * psubwin, double xminval, double xmaxval, double fx, double fy, double fz);
00090 extern int AdaptGraduationsOnYBottomRight(int iof, int x, int y, int size, integer *Ticsdir, int *fontid, sciPointObj * psubwin, double yminval, double ymaxval, double fx, double fy, double fz);
00091 extern int AdaptGraduationsOnXBottomLeft(int iof, int x, int y, int size, integer *Ticsdir, int *fontid, sciPointObj * psubwin, double xminval, double xmaxval, double fx, double fy, double fz);
00092 extern int AdaptGraduationsOnYBottomLeft(int iof, int x, int y, int size, integer *Ticsdir, int *fontid, sciPointObj * psubwin, double yminval, double ymaxval, double fx, double fy, double fz);
00093 
00094 extern int CheckDisplay(double fact_h, double fact_w, char logflag, char *foo,int *posi,int *fontid,int *old_rect);
00095 
00096 extern int IsInsideRectangle(int * rect, int *point);
00097 
00098 extern int ComputeGoodTrans3d( sciPointObj * psubwin, int n, int *xm, int *ym, double * fx, double *fy, double *fz); /* DRAWINGS */
00099 extern void DrawAxesIfRequired(sciPointObj*); /* DRAWINGS */
00100 extern void DrawAxes(sciPointObj*); /* DRAWINGS */
00101 
00102 extern void UpdateSubwinScale(sciPointObj * pobj); /* DRAWINGS */
00103 
00104 extern int sciDrawObj (sciPointObj * pobj); /* DRAWINGS */
00105 extern int sciDrawObjIfRequired (sciPointObj * pobj); /* DRAWINGS */
00106 extern int sciRefreshObj( sciPointObj * pobj ) ; /* DRAWINGS */
00107 
00108 
00109 extern int ComputeXIntervals(sciPointObj *pobj, char xy_type, double **vector, int * N, int checkdim); /* DRAWINGS */ /* inside matdes.c */
00110 
00111 /* Other functions coming from Entities.c (old file) */
00112 
00113 
00116 extern int Gen3DPoints (integer type,integer *polyx,integer *polyy,integer *fill,integer whiteid,double zmin,double zmax,double *,double *,double *,integer i,integer j,integer jj1,integer *p,integer dc,integer fg, sciPointObj *psurface); /* DRAWINGS */
00117 extern void Merge3d(sciPointObj *psubwin);/*DJ.A merge*/   /* DRAWINGS */
00118 extern void Merge3dBuildTable(sciPointObj *pparent, int *index_in_entity, long *from_entity, int *pos);
00119 extern int Merge3dDimension(sciPointObj *pparent);
00120 
00121 extern int CheckPixelStatus(void);
00122 
00123 extern int GetDPIFromDriver(int * DPI);
00124 extern int ChooseFormatForOneGrad(char *c_format, double *grad);
00125 extern int ChildrenCounter(sciPointObj *pparent);
00126 extern int GetBarNumber(sciPointObj * pobj);
00127 extern double FindWidth(sciPointObj * pobj, int n1, int bar_number, double *x);
00128 
00129 extern void sciGetAxisBox( double limits[6], double xbox[8], double ybox[8], double zbox[8] ) ;
00130 extern void sciUpdateScaleAngles( double theta, double alpha ) ;
00131 extern void sciAxesVerticesIndices( integer insideU[4],
00132                                     integer insideD[4],
00133                                     double  xbox[8]   ,
00134                                     double  ybox[8]   ,
00135                                     integer xind[8]    ) ;
00136 
00137 extern void matrixLine2String( char ** matrix, int matrixSize[2], int numLine, char * dest ) ;
00138 
00139 
00140 void computeLabelAutoPos( sciPointObj * pLabel, int axisStart[2], int axisEnd[2], int offsets[2] ) ;
00141 
00142 void sciDrawFigure( int numFigure ) ;
00143 
00144 
00145 extern int computeRealArrowSize( sciPointObj * pSegs,
00146                                 int nbSegs         ,
00147                                 int xCoord[]       ,
00148                                 int yCoord[]         ) ;
00149 
00150 #endif /* __SCI_DRAWINGS__ */

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