DefaultCommandArg.c

Go to the documentation of this file.
00001 /*------------------------------------------------------------------------*/
00002 /* file: DefaultCommandArg.c                                              */
00003 /* Copyright INRIA 2006                                                   */
00004 /* Authors : Jean-Baptiste Silvy                                          */
00005 /* desc : access to default values for graphics arguments                 */
00006 /*------------------------------------------------------------------------*/
00007 
00008 #include <string.h>
00009 
00010 #include "DefaultCommandArg.h"
00011 
00012 /*------------------------------------------------------------------------*/
00013 /* The default values */
00014 static double def_rect[4]      = {0.0,0.0,0.0,0.0} ;
00015 static char   def_strf[4]      = DEFSTRF           ;
00016 static char   def_legend[]     = "X@Y@Z"           ;
00017 static double def_zminmax[2]   = {0.,0.}           ;
00018 static int    def_nax[4]       = {2,10,2,10}       ;
00019 static int    def_colminmax[2] = {0,0}             ;
00020 static int    def_colout[2]    = {-1,-1}           ;
00021 static BOOL   def_with_mesh    = FALSE             ;
00022 static char   def_logflags[4]  = DEFLOGFLAGS       ;
00023 /*------------------------------------------------------------------------*/
00024 
00025 /*------------------------------------------------------------------------*/
00026 double * getDefRect( void ) { return def_rect ; }
00027 /*------------------------------------------------------------------------*/
00028 char * getDefStrf( void ) { return def_strf ; }
00029 /*------------------------------------------------------------------------*/
00030 char * getDefLegend( void ) { return def_legend ; }
00031 /*------------------------------------------------------------------------*/
00032 double * getDefZminMax( void ) { return def_zminmax ; }
00033 /*------------------------------------------------------------------------*/
00034 int * getDefNax( void ) { return def_nax ; }
00035 /*------------------------------------------------------------------------*/
00036 int * getDefColMinMax( void ) { return def_colminmax ; }
00037 /*------------------------------------------------------------------------*/
00038 int * getDefColOut( void ) { return def_colout ; }
00039 /*------------------------------------------------------------------------*/
00040 BOOL getDefWithMesh( void ) { return def_with_mesh ; }
00041 /*------------------------------------------------------------------------*/
00042 char * getDefLogFlags( void ) { return def_logflags ; }
00043 /*------------------------------------------------------------------------*/
00044 
00045 /*------------------------------------------------------------------------*/
00046 void setDefRect( const double newDef[4] )
00047 {
00048   def_rect[0] = newDef[0] ;
00049   def_rect[1] = newDef[1] ;
00050   def_rect[2] = newDef[2] ;
00051   def_rect[3] = newDef[3] ;
00052 }
00053 /*------------------------------------------------------------------------*/
00054 void setDefStrf( const char newDef[4] )
00055 {
00056   def_strf[0] = newDef[0] ;
00057   def_strf[1] = newDef[1] ;
00058   def_strf[2] = newDef[2] ;
00059   /* last element shoud be /0 */
00060 }
00061 /*------------------------------------------------------------------------*/
00062 void setDefZminMax( const double newDef[2] )
00063 {
00064   def_zminmax[0] = newDef[0] ;
00065   def_zminmax[1] = newDef[1] ;
00066 }
00067 /*------------------------------------------------------------------------*/
00068 void setDefNax( const int newDef[4] )
00069 {
00070   def_nax[0] = newDef[0] ;
00071   def_nax[1] = newDef[1] ;
00072   def_nax[2] = newDef[2] ;
00073   def_nax[3] = newDef[3] ;
00074 }
00075 /*------------------------------------------------------------------------*/
00076 void setDefColMinMax( const int  newDef[2] )
00077 {
00078   def_colminmax[0] = newDef[0] ;
00079   def_colminmax[1] = newDef[1] ;
00080 }
00081 /*------------------------------------------------------------------------*/
00082 void setDefColOut( const int newDef[2] )
00083 {
00084   def_colout[0] = newDef[0] ;
00085   def_colout[1] = newDef[1] ;
00086 }
00087 /*------------------------------------------------------------------------*/
00088 void setDefWithMesh( BOOL newDef )
00089 {
00090   def_with_mesh = newDef ;
00091 }
00092 /*------------------------------------------------------------------------*/
00093 void setDefLogFlags( const char newDef[4] )
00094 {
00095   def_logflags[0] = newDef[0] ;
00096   def_logflags[1] = newDef[1] ;
00097   def_logflags[2] = newDef[2] ;
00098   /* last element shoud be /0 */
00099 }
00100 /*------------------------------------------------------------------------*/
00101 
00102 /*------------------------------------------------------------------------*/
00103 void reinitDefStrf( void )
00104 {
00105   strcpy( def_strf, DEFSTRF ) ;
00106 }
00107 /*------------------------------------------------------------------------*/
00108 void reinitDefStrfN( void )
00109 {
00110   strcpy( def_strf, DEFSTRFN ) ;
00111 }
00112 /*------------------------------------------------------------------------*/
00113 void reinitDefLogFlags( void )
00114 {
00115   strcpy( def_logflags, DEFLOGFLAGS ) ;
00116 }
00117 /*------------------------------------------------------------------------*/
00118 
00119 /*------------------------------------------------------------------------*/
00120 BOOL isDefRect( const double * rect )
00121 {
00122   return rect == def_rect ;
00123 }
00124 /*------------------------------------------------------------------------*/
00125 BOOL isDefStrf( const char * strf )
00126 {
00127   return strf == def_strf ;
00128 }
00129 /*------------------------------------------------------------------------*/
00130 BOOL isDefLegend( const char * legend )
00131 {
00132   return legend == def_legend ;
00133 }
00134 /*------------------------------------------------------------------------*/
00135 BOOL isDefZminMax( const double * zminmax )
00136 {
00137   return zminmax == def_zminmax ;
00138 }
00139 /*------------------------------------------------------------------------*/
00140 BOOL isDefNax( const int * nax )
00141 {
00142   return nax == def_nax ;
00143 }
00144 /*------------------------------------------------------------------------*/
00145 BOOL isDefColMinMax( const int * colminmax )
00146 {
00147   return colminmax == def_colminmax ;
00148 }
00149 /*------------------------------------------------------------------------*/
00150 BOOL isDefColOut( const int * colout )
00151 {
00152   return colout == def_colout ;
00153 }
00154 /*------------------------------------------------------------------------*/
00155 BOOL isDefWithMesh( const BOOL withmesh )
00156 {
00157   return withmesh == def_with_mesh ;
00158 }
00159 /*------------------------------------------------------------------------*/
00160 BOOL isDefLogFlags( const char * logflags  )
00161 {
00162   return logflags == def_logflags ;
00163 }
00164 /*------------------------------------------------------------------------*/

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