InitObjects.c File Reference

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <stdarg.h>
#include <time.h>
#include "InitObjects.h"
#include "SetProperty.h"
#include "GetProperty.h"
#include "bcg.h"
#include "PloEch.h"
#include "Axes.h"
#include "DestroyObjects.h"
#include "CloneObjects.h"
#include "BuildObjects.h"
#include "Xcall1.h"
#include "sciprint.h"
#include "CurrentObjectsManagement.h"
#include "ObjectSelection.h"
#include "MALLOC.h"

Include dependency graph for InitObjects.c:

Go to the source code of this file.

Functions

sciPointObjgetFigureModel (void)
sciPointObjgetAxesModel (void)
int C2F() graphicsmodels (void)
int sciInitGraphicContext (sciPointObj *pobj)
int initFCfromCopy (sciPointObj *pObjSource, sciPointObj *pObjDest)
int sciInitFontContext (sciPointObj *pobj)
void initsubwin ()
int InitFigureModel (void)
int InitAxesModel ()
int ResetFigureToDefaultValues (sciPointObj *pobj)
int sciInitGraphicMode (sciPointObj *pobj)
sciPointObjinitLabel (sciPointObj *pParentObj)
void destroyDefaultObjects (void)

Variables

static char error_message [70]
unsigned short defcolors []
static sciPointObjpfiguremdl = (sciPointObj *) NULL
static sciPointObjpaxesmdl = (sciPointObj *) NULL


Function Documentation

void destroyDefaultObjects ( void   ) 

Definition at line 960 of file InitObjects.c.

References DestroyAllGraphicsSons(), DestroyFigure(), and NULL.

Referenced by closeGraphicModule().

00961 {
00962   DestroyAllGraphicsSons( pfiguremdl ) ;
00963   DestroyFigure( pfiguremdl ) ;
00964   pfiguremdl = NULL ;
00965 }

Here is the call graph for this function:

Here is the caller graph for this function:

sciPointObj* getAxesModel ( void   ) 

Definition at line 47 of file InitObjects.c.

Referenced by ConstructSubWin(), get_default_axes_property(), initSubWinAngles(), initSubWinBounds(), initSubWinSize(), sci_get(), sci_set(), sciGetPointerFromHandle(), sciInitDim(), sciInitResize(), sciInitXorMode(), sciSetHandle(), and set_default_values_property().

00048 {
00049   return paxesmdl ;
00050 }

Here is the caller graph for this function:

sciPointObj* getFigureModel ( void   ) 

Definition at line 42 of file InitObjects.c.

Referenced by ConstructFigure(), get_axes_size_property(), get_default_figure_property(), get_figure_position_property(), get_figure_size_property(), sci_get(), sci_set(), sciGetPointerFromHandle(), sciInitAutoScale(), sciInitResize(), sciInitScreenPosition(), sciInitXorMode(), sciSetColormap(), sciSetHandle(), sciSetName(), set_axes_size_property(), set_default_values_property(), set_figure_id_property(), and set_figure_size_property().

00043 {
00044   return pfiguremdl ;
00045 }

Here is the caller graph for this function:

int C2F() graphicsmodels ( void   ) 

Definition at line 54 of file InitObjects.c.

References sciSubWindow::ARect, sciSubWindow::clip_region, sciSubWindow::clip_region_set, error_message, sciSubWindow::FirstPlot, FREE, tagHandleTab::index, InitAxesModel(), InitFigureModel(), long, MALLOC, NULL, sciPointObj::pfeatures, pFIGURE_FEATURE, sciRelationShip::plastsons, tagHandleTab::pnext, tagHandleTab::pprev, sciRelationShip::psons, pSUBWIN_FEATURE, sciSubWindow::relationship, SCI_FIGURE, SCI_SUBWIN, sciAddThisToItsParent(), sciDelHandle(), sciDelThisToItsParent(), sciGetParent(), sciGetRelationship(), sciInitSelectedSons(), sciSetEntityType(), TRUE, and sciSubWindow::with_leg.

Referenced by loadGraphicModule().

00055 {
00056   sciHandleTab * newhd1 ;
00057   sciHandleTab * newhd2 ;
00058   sciSubWindow * ppaxesmdl = NULL ;
00059 
00060   if ((pfiguremdl = MALLOC ((sizeof (sciPointObj)))) == NULL)
00061     {
00062       strcpy(error_message,"Default figure cannot be create");
00063       return 0;           
00064     }
00065   sciSetEntityType (pfiguremdl, SCI_FIGURE);
00066   if ((pfiguremdl->pfeatures = MALLOC ((sizeof (sciFigure)))) == NULL)
00067     {
00068       FREE(pfiguremdl);
00069       strcpy(error_message,"Default figure cannot be create");
00070       return 0;
00071     }
00072   
00073   if ((newhd1 = MALLOC ((sizeof (sciHandleTab)))) == NULL)
00074     {
00075       FREE(pfiguremdl->pfeatures);
00076       FREE(pfiguremdl);
00077       strcpy(error_message,"Default figure cannot be create");
00078       return 0;
00079     }
00080   newhd1->pnext = (sciHandleTab *) NULL;
00081   newhd1->pprev = (sciHandleTab *) NULL;
00082   newhd1->index = (long)pfiguremdl;
00083   (sciGetRelationship (pfiguremdl))->phandle = newhd1;
00084     
00085   if (!(sciAddThisToItsParent(pfiguremdl, (sciPointObj *)NULL))) 
00086     {
00087       sciDelHandle (pfiguremdl);
00088       FREE(pfiguremdl->pfeatures);
00089       FREE(pfiguremdl);
00090       strcpy(error_message,"Default figure cannot be create");
00091       return 0;
00092     }
00093   
00094   sciInitSelectedSons( pfiguremdl ) ;
00095 
00096   pFIGURE_FEATURE (pfiguremdl)->relationship.psons = (sciSons *) NULL;
00097   pFIGURE_FEATURE (pfiguremdl)->relationship.plastsons = (sciSons *) NULL;
00098 
00099   /* set default properties */
00100   if ( InitFigureModel() < 0 )
00101   {
00102     sciDelHandle (pfiguremdl);
00103     FREE(pfiguremdl->pfeatures);
00104     FREE(pfiguremdl);
00105     strcpy(error_message,"Default figure cannot be create");
00106     return 0;
00107   }
00108 
00109   /* F.Leray Adding some FontContext Info for InitFontContext function */
00110   /*  pFIGURE_FEATURE (pfiguremdl)->fontcontext.backgroundcolor = */
00111 
00112   
00113   if ((paxesmdl = MALLOC ((sizeof (sciPointObj)))) == NULL)
00114     {
00115       strcpy(error_message,"Default axes cannot be create");
00116       return 0;
00117     }
00118   sciSetEntityType (paxesmdl, SCI_SUBWIN);
00119   if ((paxesmdl->pfeatures = MALLOC ((sizeof (sciSubWindow)))) == NULL)
00120     {
00121       FREE(paxesmdl);
00122       strcpy(error_message,"Default axes cannot be create");
00123       return 0;
00124     }
00125   if ((newhd2 = MALLOC ((sizeof (sciHandleTab)))) == NULL)
00126     {
00127       FREE(paxesmdl->pfeatures);
00128       FREE(paxesmdl);
00129       strcpy(error_message,"Default axes cannot be create");
00130       return 0;
00131     }
00132   newhd2->pnext = (sciHandleTab *) NULL;
00133   newhd2->pprev = (sciHandleTab *) NULL;
00134   newhd2->index = (long)paxesmdl;
00135   (sciGetRelationship (paxesmdl))->phandle = newhd2;
00136   
00137   if (!(sciAddThisToItsParent (paxesmdl, pfiguremdl)))
00138     {
00139       sciDelHandle (paxesmdl);
00140       FREE(paxesmdl->pfeatures);
00141       FREE(paxesmdl);
00142       strcpy(error_message,"Default axes cannot be create");
00143       return 0;
00144     }
00145   
00146   ppaxesmdl =  pSUBWIN_FEATURE (paxesmdl);
00147 
00148   sciInitSelectedSons( paxesmdl ) ;
00149   ppaxesmdl->relationship.psons = (sciSons *) NULL;
00150   ppaxesmdl->relationship.plastsons = (sciSons *) NULL;
00151   
00152   if ( InitAxesModel() < 0 )
00153   {
00154     sciDelThisToItsParent (paxesmdl, sciGetParent (paxesmdl));
00155     sciDelHandle (paxesmdl);
00156     FREE(paxesmdl->pfeatures);
00157     FREE(paxesmdl);          
00158     strcpy(error_message,"Default axes cannot be create");
00159     return 0;
00160   }
00161 
00162   /* there are properties not initialized bu InitAxesModel */
00163   /* Is it a missing ? */
00164      
00165   ppaxesmdl->FirstPlot = TRUE;
00166   ppaxesmdl->with_leg = 0;
00167      
00168   ppaxesmdl->ARect[0]   = 0.125;
00169   ppaxesmdl->ARect[1]   = 0.125;
00170   ppaxesmdl->ARect[2]   = 0.125;
00171   ppaxesmdl->ARect[3]   = 0.125;
00172   
00173   ppaxesmdl->clip_region[0] = 0.;
00174   ppaxesmdl->clip_region[1] = 0.;
00175   ppaxesmdl->clip_region[2] = 0.;
00176   ppaxesmdl->clip_region[3] = 0.;
00177 
00178   /* the model has not been changed !!! */
00179   ppaxesmdl->clip_region_set = 0 ;
00180   
00181   
00182  
00183   
00184   return 1;
00185 }

Here is the call graph for this function:

Here is the caller graph for this function:

int InitAxesModel ( void   ) 

Definition at line 529 of file InitObjects.c.

References sciSubWindow::alpha, sciSubWindow::alpha_kp, sciSubWindow::axes, BT_OFF, sciSubWindow::callback, sciSubWindow::callbackevent, sciSubWindow::callbacklen, Cscale, sciSubWindow::cube_scaling, sciSubWindow::facetmerge, FALSE, AXES::flag, sciSubWindow::flagNax, sciSubWindow::FRect, sciSubWindow::grid, AXES::hiddenAxisColor, sciSubWindow::hiddencolor, sciSubWindow::hiddenstate, i, initLabel(), sciSubWindow::is3d, sciSubWindow::isclip, sciSubWindow::isoview, AXES::limits, sciSubWindow::logflags, sciSubWindow::mon_title, sciSubWindow::mon_x_label, sciSubWindow::mon_y_label, sciSubWindow::mon_z_label, AXES::nbsubtics, NULL, pLABEL_FEATURE, sciSubWindow::pPopMenu, sciSubWindow::project, pSUBWIN_FEATURE, AXES::rect, sciGetVisibility(), sciInitFontContext(), sciInitGraphicContext(), sciInitGraphicMode(), sciSubWindow::size_of_user_data, sciSubWindow::SRect, AXES::subint, sciSubWindow::theta, sciSubWindow::theta_kp, AXES::ticscolor, sciSubWindow::tight_limits, TRUE, sciSubWindow::user_data, sciSubWindow::visible, sciSubWindow::WRect, AXES::xdir, AXES::xgrads, AXES::xlim, wcscalelist::xtics, AXES::ydir, AXES::ygrads, AXES::ylim, wcscalelist::ytics, and AXES::zlim.

Referenced by graphicsmodels(), and set_default_values_property().

00530 { 
00531   int i;
00532   double tab[] = {0.,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.}; /* graduations init. tmptab */
00533   sciPointObj * pobj = NULL;
00534   sciSubWindow * ppobj = NULL;
00535   sciSubWindow * ppaxesmdl = pSUBWIN_FEATURE (paxesmdl);
00536 
00537   sciInitGraphicContext (paxesmdl);
00538   sciInitGraphicMode (paxesmdl);
00539   sciInitFontContext (paxesmdl);  /* F.Leray 10.06.04 */
00540   ppaxesmdl->cube_scaling = FALSE;
00541   ppaxesmdl->callback = (char *)NULL;
00542   ppaxesmdl->callbacklen = 0;
00543   ppaxesmdl->callbackevent = 100;  
00544   ppaxesmdl->logflags[0] = 'n';
00545   ppaxesmdl->logflags[1] = 'n';
00546   ppaxesmdl->logflags[2] = 'n';
00547   ppaxesmdl->axes.ticscolor  = -1;
00548   ppaxesmdl->axes.subint[0]  = 1;   
00549   ppaxesmdl->axes.subint[1]  = 1; 
00550   ppaxesmdl->axes.subint[2]  = 1;
00551   ppaxesmdl->axes.xdir='d'; 
00552   ppaxesmdl->axes.ydir='l';  
00553   ppaxesmdl->axes.rect  = BT_OFF;
00554   
00555   ppaxesmdl->user_data = (int *) NULL; /* to be complete */
00556   ppaxesmdl->size_of_user_data = 0;
00557 
00558   for (i=0 ; i<7 ; i++)
00559   {
00560     ppaxesmdl->axes.limits[i] = 0;
00561   }
00562 
00563   for (i=0 ; i<3 ; i++)
00564   {
00565     ppaxesmdl->grid[i]  = -1;
00566   }
00567 
00568   ppaxesmdl->alpha  = 0.0;
00569   ppaxesmdl->theta  = 270.0;
00570   ppaxesmdl->alpha_kp  = 45.0;
00571   ppaxesmdl->theta_kp  = 215.0;
00572   ppaxesmdl->is3d  = FALSE;
00573 
00574   for (i=0 ; i<4 ; i++)
00575     {  
00576       ppaxesmdl->axes.xlim[i]= Cscale.xtics[i]; 
00577       ppaxesmdl->axes.ylim[i]= Cscale.ytics[i]; 
00578     }
00579 
00580   /* F.Leray 22.09.04 */
00581   (ppaxesmdl->axes).axes_visible[0] = FALSE;
00582   (ppaxesmdl->axes).axes_visible[1] = FALSE;
00583   (ppaxesmdl->axes).axes_visible[2] = FALSE;
00584   (ppaxesmdl->axes).reverse[0] = FALSE;
00585   (ppaxesmdl->axes).reverse[1] = FALSE;
00586   (ppaxesmdl->axes).reverse[2] = FALSE;
00587   ppaxesmdl->flagNax = FALSE;
00588   
00589   /*F.Leray : just for completion : */
00590   ppaxesmdl->axes.nbsubtics[0] = 1; /* not used at all because needs ppaxesmdl->flagNax = TRUE */
00591   ppaxesmdl->axes.nbsubtics[1] = 1; /* and when it is TRUE, it means WE have given the corresponding */
00592   ppaxesmdl->axes.nbsubtics[2] = 1; /* ppaxesmdl->axes.nbsubtics[0,1,2] !! */
00593 
00594   (ppaxesmdl->axes).nxgrads = 11; /* computed ticks */
00595   (ppaxesmdl->axes).nygrads = 11;
00596   (ppaxesmdl->axes).nzgrads = 3;
00597 
00598   for(i=0;i<11;i++)
00599   {
00600     ppaxesmdl->axes.xgrads[i] = tab[i];
00601   }
00602   
00603   for(i=0;i<11;i++)
00604   {
00605     ppaxesmdl->axes.ygrads[i] = tab[i];
00606   }
00607 
00608   (ppaxesmdl->axes).zgrads[0] = -1.;
00609   (ppaxesmdl->axes).zgrads[1]  = 0.;
00610   (ppaxesmdl->axes).zgrads[2]  = 1.;
00611 
00612   (ppaxesmdl->axes).u_xgrads = (double *)NULL;
00613   (ppaxesmdl->axes).u_ygrads = (double *)NULL;
00614   (ppaxesmdl->axes).u_zgrads = (double *)NULL;
00615   (ppaxesmdl->axes).u_nxgrads = 0; /* user ticks */
00616   (ppaxesmdl->axes).u_nygrads = 0;
00617   (ppaxesmdl->axes).u_nzgrads = 0;
00618   (ppaxesmdl->axes).u_xlabels= (char **) NULL;
00619   (ppaxesmdl->axes).u_ylabels= (char **) NULL;
00620   (ppaxesmdl->axes).u_zlabels= (char **) NULL;
00621 
00622   (ppaxesmdl->axes).auto_ticks[0] = TRUE;
00623   (ppaxesmdl->axes).auto_ticks[1] = TRUE;
00624   (ppaxesmdl->axes).auto_ticks[2] = TRUE;
00625   /* end 22.09.04 */
00626 
00627   ppaxesmdl->axes.zlim[0]= -1.0;
00628   ppaxesmdl->axes.zlim[1]= 1.0;  
00629   ppaxesmdl->axes.flag[0]= 2;
00630   ppaxesmdl->axes.flag[1]= 2;
00631   ppaxesmdl->axes.flag[2]= 4;
00632   ppaxesmdl->axes.hiddenAxisColor = 4 ;
00633   ppaxesmdl->project[0]= 1;
00634   ppaxesmdl->project[1]= 1;
00635   ppaxesmdl->project[2]= 0;
00636   ppaxesmdl->hiddencolor=4;
00637   ppaxesmdl->hiddenstate=0; 
00638   ppaxesmdl->isoview= FALSE;/*TRUE;*/
00639  
00640   ppaxesmdl->facetmerge = FALSE; 
00641   ppaxesmdl->WRect[0]   = 0;
00642   ppaxesmdl->WRect[1]   = 0;
00643   ppaxesmdl->WRect[2]   = 1;
00644   ppaxesmdl->WRect[3]   = 1;  
00645   ppaxesmdl->FRect[0]   = 0.0; /* xmin */
00646   ppaxesmdl->FRect[1]   = 0.0; /* ymin */
00647   ppaxesmdl->FRect[2]   = 1.0; /* xmax */
00648   ppaxesmdl->FRect[3]   = 1.0; /* ymax */
00649   ppaxesmdl->FRect[4]   = -1.0;/* zmin */
00650   ppaxesmdl->FRect[5]   = 1.0;   /* zmax */
00651   ppaxesmdl->visible = sciGetVisibility(pfiguremdl); 
00652   /* /\*   ppaxesmdl->drawlater = sciGetDrawLater(pfiguremdl); *\/ */
00653   /*   ppaxesmdl->drawlater = FALSE; */
00654 
00655   ppaxesmdl->isclip = -1;  
00656   ppaxesmdl->pPopMenu = (sciPointObj *)NULL;
00657 
00658   /* Les SRect sont rentres dans l'ordre: 
00659      [xmin ymin zmin xmax ymax zmax] */
00660   ppaxesmdl->SRect[0]   = 0.0; /* xmin */
00661   ppaxesmdl->SRect[1]   = 1.0; /* xmax */
00662   ppaxesmdl->SRect[2]   = 0.0; /* ymin */
00663   ppaxesmdl->SRect[3]   = 1.0; /* ymax */
00664   ppaxesmdl->SRect[4]   = -1.0;/* zmin */
00665   ppaxesmdl->SRect[5]   = 1.0;  /* zmax */
00666   
00667   ppaxesmdl->tight_limits = FALSE;
00668 
00669   /* F.Leray 10.06.04 */
00670   /* Adding default Labels inside Axes */
00671   /*------------------------------------------------------------------------------------*/
00672  
00673   pobj = paxesmdl;
00674   ppobj = pSUBWIN_FEATURE(paxesmdl);
00675   
00676    /******************************  title *************************/
00677   
00678   ppobj->mon_title = initLabel( paxesmdl ) ;
00679 
00680   if ( ppobj->mon_title == NULL )
00681   {
00682     return -1 ;
00683   }
00684   
00685   pLABEL_FEATURE(ppobj->mon_title)->ptype = 1;
00686   
00687   /******************************  x_label *************************/
00688   
00689   ppobj->mon_x_label = initLabel( paxesmdl ) ;
00690   
00691   if ( ppobj->mon_x_label == NULL )
00692   {
00693     return -1 ;
00694   }
00695   
00696   pLABEL_FEATURE( ppobj->mon_x_label )->ptype = 2 ;
00697   
00698   /******************************  y_label *************************/
00699   
00700   ppobj->mon_y_label = initLabel( paxesmdl ) ;
00701   
00702   if ( ppobj->mon_y_label == NULL )
00703   {
00704     return -1 ;
00705   }
00706   
00707   pLABEL_FEATURE( ppobj->mon_y_label )->ptype = 3 ;
00708   
00709   /******************************  z_label *************************/
00710   
00711   ppobj->mon_z_label = initLabel( paxesmdl ) ;
00712   
00713   if ( ppobj->mon_z_label == NULL )
00714   {
00715     return -1 ;
00716   }
00717   
00718   pLABEL_FEATURE( ppobj->mon_z_label )->ptype = 4 ;
00719   
00720   return 0; 
00721 }

Here is the call graph for this function:

Here is the caller graph for this function:

int initFCfromCopy ( sciPointObj pObjSource,
sciPointObj pObjDest 
)

Inits the font context of an object byt copying the one of an other.

Parameters:
pObjSource the object from which the FC is taken
pObjDest the object in which the FC is paste

Definition at line 307 of file InitObjects.c.

References cloneFontContext(), sciFont::fontnamelen, NULL, sciFont::pfontname, and sciGetFontContext().

Referenced by sciInitFontContext().

00308 {
00309   sciGetFontContext( pObjDest )->fontnamelen = 0 ;
00310   sciGetFontContext( pObjDest )->pfontname = NULL ;
00311   return cloneFontContext( pObjSource, pObjDest ) ;
00312 }

Here is the call graph for this function:

Here is the caller graph for this function:

int InitFigureModel ( void   ) 

Definition at line 465 of file InitObjects.c.

References defcolors, error_message, FALSE, i, m, MALLOC, Min, name, NULL, NUMCOLORS_SCI, pFIGURE_FEATURE, sciInitFontContext(), sciInitGraphicContext(), sciInitGraphicMode(), sciSetInfoMessage(), and TRUE.

Referenced by graphicsmodels(), and set_default_values_property().

00466 { 
00467   int i ;
00468   int m = NUMCOLORS_SCI ;
00469 
00470   pFIGURE_FEATURE (pfiguremdl)->allredraw = FALSE;
00471 
00472   if ( sciInitGraphicContext(pfiguremdl) < 0 )
00473   {
00474     return -1 ;
00475   }
00476   if ( sciInitGraphicMode(pfiguremdl) < 0 )
00477   {
00478     return -1 ;
00479   }
00480   if ( sciInitFontContext(pfiguremdl) < 0)
00481   {
00482     /* F.Leray 10.06.04 */
00483     return -1 ;
00484   }
00485   strncpy (pFIGURE_FEATURE (pfiguremdl)->name, "Scilab Graphic", sizeof ("Scilab Graphic") + 4);
00486   pFIGURE_FEATURE (pfiguremdl)->namelen = Min (sizeof ("Scilab Graphic") + 4, 14); 
00487   pFIGURE_FEATURE (pfiguremdl)->number          = 0   ;
00488   pFIGURE_FEATURE (pfiguremdl)->figuredimwidth  = 610 ;
00489   pFIGURE_FEATURE (pfiguremdl)->figuredimheight = 461 ;
00490   pFIGURE_FEATURE (pfiguremdl)->windowdimwidth  = 600 ;
00491   pFIGURE_FEATURE (pfiguremdl)->windowdimheight = 400 ;
00492   pFIGURE_FEATURE (pfiguremdl)->inrootposx      = 200 ;
00493   pFIGURE_FEATURE (pfiguremdl)->inrootposy      = 200 ;
00494   
00495   if((pFIGURE_FEATURE(pfiguremdl)->pcolormap = (double *) MALLOC (m * 3 * sizeof (double))) == (double *) NULL)
00496     {
00497       strcpy(error_message,"Cannot init color map");
00498       return -1 ;
00499     }  
00500   for (i= 0 ; i < m ; i++)
00501   {
00502     pFIGURE_FEATURE(pfiguremdl)->pcolormap[i] = (double) (defcolors[3*i]/255.0);
00503     pFIGURE_FEATURE(pfiguremdl)->pcolormap[i+m] = (double) (defcolors[3*i+1]/255.0); 
00504     pFIGURE_FEATURE(pfiguremdl)->pcolormap[i+2*m] = (double) (defcolors[3*i+2]/255.0);
00505   }
00506   
00507   pFIGURE_FEATURE (pfiguremdl)->numcolors = m;
00508   pFIGURE_FEATURE (pfiguremdl)->isiconified = FALSE;
00509   pFIGURE_FEATURE (pfiguremdl)->isselected = TRUE;
00510   pFIGURE_FEATURE (pfiguremdl)->rotstyle = 0;
00511   pFIGURE_FEATURE (pfiguremdl)->visible = TRUE;
00512   pFIGURE_FEATURE (pfiguremdl)->auto_redraw = TRUE; /* by default, we draw live */ /* F.Leray 29.12.04 modified on 04.01.05 */
00513 
00514   pFIGURE_FEATURE (pfiguremdl)->user_data = (int *) NULL; /* pour completude */
00515   pFIGURE_FEATURE (pfiguremdl)->size_of_user_data = 0; /* pour completude */
00516 
00517   pFIGURE_FEATURE (pfiguremdl)->numsubwinselected = 0; 
00518   pFIGURE_FEATURE (pfiguremdl)->pixmap = 0 ; 
00519   pFIGURE_FEATURE (pfiguremdl)->wshow = 0 ;
00520 
00521   pFIGURE_FEATURE(pfiguremdl)->infoMessage = NULL ;
00522   sciSetInfoMessage( pfiguremdl, "" ) ;
00523 
00524   return 0;
00525 }

Here is the call graph for this function:

Here is the caller graph for this function:

sciPointObj* initLabel ( sciPointObj pParentObj  ) 

Definition at line 881 of file InitObjects.c.

References ALIGN_LEFT, allocateText(), sciLabel::auto_position, sciLabel::auto_rotation, deallocateText(), DestroyLabel(), FALSE, FREE, sciLabel::isselected, MALLOC, NULL, sciPointObj::pfeatures, pLABEL_FEATURE, sciLabel::ptype, SCI_LABEL, sciAddNewHandle(), sciAddThisToItsParent(), sciDelHandle(), sciInitFontContext(), sciInitGraphicContext(), sciInitIs3d(), sciInitSelectedSons(), sciSetEntityType(), sciLabel::text, and TRUE.

Referenced by InitAxesModel().

00882 {
00883   sciPointObj * newLabel = MALLOC (sizeof (sciPointObj)) ;
00884   sciLabel    * ppLabel ;
00885   char        * emptyString = "" ;
00886 
00887   if ( newLabel == NULL )
00888   {
00889     return NULL ;
00890   }
00891 
00892   sciSetEntityType( newLabel, SCI_LABEL ) ;
00893 
00894   newLabel->pfeatures = MALLOC ( sizeof (sciLabel) ) ;
00895   if ( newLabel->pfeatures == NULL)
00896   {
00897     FREE( newLabel );
00898     return NULL ;
00899   }
00900   
00901   ppLabel = pLABEL_FEATURE( newLabel ) ;
00902   
00903   /* we must first construct the text object inside the label */
00904   ppLabel->text = allocateText( pParentObj, &emptyString, 1, 1,
00905                                 0.0, 0.0, TRUE, NULL, FALSE, NULL, NULL,
00906                                 FALSE, FALSE, FALSE, ALIGN_LEFT ) ;
00907   
00908   if ( ppLabel->text == NULL )
00909   {
00910     deallocateText( ppLabel->text ) ;
00911     FREE( ppLabel ) ;
00912     FREE( newLabel  );
00913     return NULL ;
00914   }
00915 
00916   if ( sciAddNewHandle ( newLabel ) == -1 )
00917   {
00918     FREE( ppLabel ) ;
00919     FREE( newLabel ) ;
00920     return NULL ;
00921   }
00922   
00923   if ( !sciAddThisToItsParent( newLabel, pParentObj ) )
00924   {
00925     sciDelHandle (newLabel);
00926     FREE( ppLabel ) ;
00927     FREE( newLabel  );
00928     return NULL ;
00929   }
00930 
00931   sciInitSelectedSons( newLabel ) ;
00932 
00933   ppLabel->auto_position = TRUE;
00934   ppLabel->auto_rotation = TRUE;
00935 
00936   ppLabel->isselected = TRUE;
00937 
00938   ppLabel->ptype = 0 ; /* must be changed : 1 for title, 2 x_label, 3 y_label, 4 z_label */
00939  
00940   sciInitIs3d( newLabel, FALSE ) ;
00941 
00942   if ( sciInitGraphicContext( newLabel ) == -1 )
00943   {
00944     DestroyLabel( newLabel ) ;
00945     return NULL ;
00946   }
00947  
00948   if ( sciInitFontContext( newLabel ) == -1 )
00949   {
00950     DestroyLabel( newLabel ) ;
00951     return NULL ;
00952   }
00953   
00954   
00955 
00956   return newLabel ;
00957 }

Here is the call graph for this function:

Here is the caller graph for this function:

void initsubwin ( void   ) 

Definition at line 431 of file InitObjects.c.

References sciSubWindow::axes, BT_OFF, clearUserData(), Cscale2default(), FALSE, initSubWinSize(), AXES::limits, pSUBWIN_FEATURE, AXES::rect, reinitSubWin(), sciGetCurrentSubWin(), AXES::subint, and AXES::ticscolor.

00432 {
00433   sciPointObj  * psubwin  ;
00434   sciSubWindow * ppSubWin ;
00435   
00436 
00437   Cscale2default(); 
00438   psubwin = sciGetCurrentSubWin();
00439   ppSubWin = pSUBWIN_FEATURE (psubwin) ;
00440 
00441 
00442   initSubWinSize( psubwin  ) ;
00443 
00444   clearUserData( psubwin ) ;
00445 
00446   reinitSubWin( psubwin ) ;
00447   
00448   (ppSubWin->axes).axes_visible[0] = FALSE;
00449   (ppSubWin->axes).axes_visible[1] = FALSE;
00450   (ppSubWin->axes).axes_visible[2] = FALSE;
00451 
00452   (ppSubWin->axes).reverse[0] = FALSE;
00453   (ppSubWin->axes).reverse[1] = FALSE;
00454   (ppSubWin->axes).reverse[2] = FALSE;
00455   
00456   ppSubWin->axes.rect = BT_OFF;  
00457   ppSubWin->axes.ticscolor = -1;
00458   ppSubWin->axes.subint[0] =  1;
00459   ppSubWin->axes.subint[1] =  1;
00460   ppSubWin->axes.subint[2] =  1;
00461   ppSubWin->axes.limits[0]  = 0; 
00462 
00463 }

Here is the call graph for this function:

int ResetFigureToDefaultValues ( sciPointObj pobj  ) 

Definition at line 725 of file InitObjects.c.

References C2F, BCG::CurWindow, dr(), FREE, L, NULL, PD0, pFIGURE_FEATURE, PI0, SCI_FIGURE, sciDelHandle(), sciGetEntityType(), sciGetName(), sciGetNameLength(), sciGetNumColors(), sciGetResize(), sciInitFontContext(), sciInitGraphicContext(), sciInitGraphicMode(), sciInitNumColors(), sciSetColormap(), sciSetName(), sciSetNum(), sciSetResize(), sciSetScreenPosition(), and x.

Referenced by sci_xset().

00726 {
00727   //integer i , m, n;
00728   integer x[2], verbose=0, narg=0; 
00729   struct BCG *XGC=NULL;
00730   int succeed = 0;
00731   
00732 
00733   if(sciGetEntityType(pobj)!=SCI_FIGURE) /* MUST BE used for figure entities only */
00734     return -1;
00735 
00736   XGC = pFIGURE_FEATURE (pobj)->pScilabXgc;
00737   
00738   pFIGURE_FEATURE (pobj)->relationship.psons = (sciSons *) NULL;
00739   pFIGURE_FEATURE (pobj)->relationship.plastsons = (sciSons *) NULL;
00740 
00742   /* try to install the colormap in the graphic context */
00743 
00744   pFIGURE_FEATURE (pobj)->pcolormap = NULL ;
00745   sciInitNumColors(pobj, 0) ;
00746 
00747   sciSetColormap( pobj, pFIGURE_FEATURE(pfiguremdl)->pcolormap, sciGetNumColors(pfiguremdl), 3 ) ;
00748 
00749    
00750   /* initialisation de context et mode graphique par defaut (figure model)*/
00751   if (sciInitGraphicContext (pobj) == -1)
00752     {
00753       sciDelHandle (pobj);
00754       FREE(pFIGURE_FEATURE(pobj)->pcolormap);
00755       FREE(pobj->pfeatures);
00756       FREE(pobj);
00757       return -1;
00758     }
00759   if (sciInitGraphicMode (pobj) == -1)
00760     {
00761       sciDelHandle (pobj);    
00762       FREE(pFIGURE_FEATURE(pobj)->pcolormap);
00763       FREE(pobj->pfeatures);
00764       FREE(pobj);
00765       return -1;
00766     }   
00767 
00768   /* F.Leray 08.04.04 */
00769   if (sciInitFontContext (pobj) == -1)
00770     {
00771       sciDelHandle (pobj);
00772       FREE(pobj->pfeatures);      
00773       FREE(pobj);
00774       return -1;
00775     }
00776   sciSetNum (pobj, &(XGC->CurWindow));             
00777   sciSetName(pobj, sciGetName(pfiguremdl), sciGetNameLength(pfiguremdl));
00778   sciSetResize((sciPointObj *) pobj,sciGetResize(pobj));
00779   pFIGURE_FEATURE(pobj)->windowdimwidth=pFIGURE_FEATURE(pfiguremdl)->windowdimwidth;  
00780   pFIGURE_FEATURE(pobj)->windowdimheight=pFIGURE_FEATURE(pfiguremdl)->windowdimheight;
00781   C2F(dr)("xset","wdim",&(pFIGURE_FEATURE(pobj)->windowdimwidth),
00782           &(pFIGURE_FEATURE(pobj)->windowdimheight),PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 
00783   pFIGURE_FEATURE (pobj)->figuredimwidth = pFIGURE_FEATURE (pfiguremdl)->figuredimwidth;
00784   pFIGURE_FEATURE (pobj)->figuredimheight = pFIGURE_FEATURE (pfiguremdl)->figuredimheight;
00785   C2F(dr)("xset","wpdim",&(pFIGURE_FEATURE(pobj)->figuredimwidth),
00786           &(pFIGURE_FEATURE(pobj)->figuredimheight),PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
00787   C2F(dr)("xget","wpos",&verbose,x,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,4L,4L);
00788   x[0]=(pFIGURE_FEATURE (pfiguremdl)->inrootposx <0)?x[0]:pFIGURE_FEATURE (pfiguremdl)->inrootposx;
00789   x[1]=(pFIGURE_FEATURE (pfiguremdl)->inrootposy <0)?x[1]:pFIGURE_FEATURE (pfiguremdl)->inrootposy;
00790   x[0]=(pFIGURE_FEATURE (pfiguremdl)->inrootposx <0)?x[0]:pFIGURE_FEATURE (pfiguremdl)->inrootposx;
00791   x[1]=(pFIGURE_FEATURE (pfiguremdl)->inrootposy <0)?x[1]:pFIGURE_FEATURE (pfiguremdl)->inrootposy;
00792   sciSetScreenPosition(pobj,x[0],x[1]);
00793   pFIGURE_FEATURE (pobj)->isiconified = pFIGURE_FEATURE (pfiguremdl)->isiconified;
00794   pFIGURE_FEATURE (pobj)->isselected = pFIGURE_FEATURE (pfiguremdl)->isselected; 
00795   pFIGURE_FEATURE (pobj)->rotstyle = pFIGURE_FEATURE (pfiguremdl)->rotstyle;
00796   pFIGURE_FEATURE (pobj)->visible = pFIGURE_FEATURE (pfiguremdl)->visible;
00797   pFIGURE_FEATURE (pobj)->auto_redraw = pFIGURE_FEATURE (pfiguremdl)->auto_redraw;
00798   pFIGURE_FEATURE (pobj)->numsubwinselected = pFIGURE_FEATURE (pfiguremdl)->numsubwinselected;
00799   pFIGURE_FEATURE (pobj)->pixmap = pFIGURE_FEATURE (pfiguremdl)->pixmap ; 
00800   pFIGURE_FEATURE (pobj)->wshow = pFIGURE_FEATURE (pfiguremdl)->wshow ; 
00801 
00802   return 0;
00803 }

Here is the call graph for this function:

Here is the caller graph for this function:

int sciInitFontContext ( sciPointObj pobj  ) 

sciInitFontContext Inits the graphic context of this object with the default value

Parameters:
sciPointObj * pobj: the pointer to the entity

Definition at line 319 of file InitObjects.c.

References CALLOC, initFCfromCopy(), NULL, pLABEL_FEATURE, pSUBWIN_FEATURE, SCI_AGREG, SCI_ARC, SCI_AXES, SCI_FEC, SCI_FIGURE, SCI_GRAYPLOT, SCI_LABEL, SCI_LEGEND, SCI_LIGHT, SCI_MENU, SCI_MENUCONTEXT, SCI_PANNER, SCI_POLYLINE, SCI_RECTANGLE, SCI_SBH, SCI_SBV, SCI_SEGS, SCI_STATUSB, SCI_SUBWIN, SCI_SURFACE, SCI_TEXT, SCI_TITLE, SCI_UIMENU, sciGetEntityType(), sciGetFontContext(), sciGetParent(), sciInitFontStyle(), and sciprint().

Referenced by ConstructFigure(), ConstructLabel(), ConstructLegend(), ConstructMenu(), ConstructMenuContext(), ConstructStatusBar(), ConstructSubWin(), ConstructText(), ConstructTitle(), InitAxesModel(), InitFigureModel(), initLabel(), ResetFigureToDefaultValues(), and sciSetDefaultValues().

00320 {
00321 
00322   /* 
00323    * initialisation du contexte font par defaut 
00324    * que l'on peut recuperer sur les structures de base de scilab 
00325    * la colormap des fils est heritee du parent
00326    * nous prenons le couleur de background et foreground
00327    * plutot que fontforeground pour l'initialisation
00328    */
00329 
00330   /* unknown function initfontname "Win-stand"!! */
00331   /* static TCHAR inifontname[] = TEXT ("Times New Roman");*/  
00332   
00333 
00334   switch (sciGetEntityType (pobj))
00335   {
00336   case SCI_TEXT:
00337   case SCI_TITLE:
00338   case SCI_LEGEND:
00339   case SCI_AXES:
00340   case SCI_MENU:
00341   case SCI_MENUCONTEXT:
00342   case SCI_STATUSB:
00343   {
00344     initFCfromCopy( sciGetParent(pobj), pobj ) ;
00345   }
00346   break;
00347   case SCI_LABEL: /* Re-init here must be better F.Leray 28.05.04 */
00348     if ( sciGetParent(pobj) == paxesmdl )
00349     {
00350       initFCfromCopy( sciGetParent(pobj), pobj ) ;
00351     }
00352     else
00353     {
00354       sciPointObj * plabelmdl = NULL;
00355           
00356       if(pLABEL_FEATURE(pobj)->ptype == 1) /* title */
00357       {
00358         plabelmdl = pSUBWIN_FEATURE(paxesmdl)->mon_title;
00359       }
00360       else if(pLABEL_FEATURE(pobj)->ptype == 2) /* x_label */
00361       {
00362         plabelmdl = pSUBWIN_FEATURE(paxesmdl)->mon_x_label;
00363       }
00364       else if(pLABEL_FEATURE(pobj)->ptype == 3) /* y_label */
00365       {
00366         plabelmdl = pSUBWIN_FEATURE(paxesmdl)->mon_y_label;
00367       }
00368       else if(pLABEL_FEATURE(pobj)->ptype == 4) /* z_label */
00369       {
00370         plabelmdl = pSUBWIN_FEATURE(paxesmdl)->mon_z_label;
00371       }
00372         
00373       initFCfromCopy( plabelmdl, pobj ) ;
00374 
00375     }
00376     break;
00377   case SCI_SUBWIN: 
00378     if (pobj == paxesmdl)
00379     {
00380       initFCfromCopy( sciGetParent( pobj ), pobj ) ;
00381     }
00382     else
00383     {
00384       initFCfromCopy( paxesmdl, pobj ) ;
00385     } 
00386     break;
00387   case SCI_FIGURE:
00388     if (pobj == pfiguremdl)
00389     {
00390       sciInitFontStyle (pobj, 6); /* set helvetica font */
00391       (sciGetFontContext(pobj))->backgroundcolor = -3;
00392       (sciGetFontContext(pobj))->foregroundcolor = -2;
00393       (sciGetFontContext(pobj))->fontdeciwidth = 100;
00394       (sciGetFontContext(pobj))->textorientation = 0;
00395       (sciGetFontContext(pobj))->fontnamelen=1; /*fontname not used */
00396           
00397       if (
00398         ((sciGetFontContext(pobj))->pfontname = CALLOC ((sciGetFontContext(pobj))->fontnamelen + 1,
00399                                                         sizeof (char))) == NULL)
00400       {
00401         sciprint ("No more Memory for fontname\n");
00402         return 0;
00403       }
00404       /* END ADDING F.Leray 08.04.04*/ 
00405     }
00406     else
00407     {
00408       initFCfromCopy( pfiguremdl, pobj ) ;
00409     }
00410     break;
00411   case SCI_PANNER:              /* pas de context graphics */
00412   case SCI_SBH:         /* pas de context graphics */
00413   case SCI_SBV:         /* pas de context graphics */
00414   case SCI_ARC:
00415   case SCI_SEGS: 
00416   case SCI_FEC: 
00417   case SCI_GRAYPLOT: 
00418   case SCI_POLYLINE:
00419   case SCI_RECTANGLE:
00420   case SCI_SURFACE:
00421   case SCI_LIGHT:
00422   case SCI_AGREG:
00423   case SCI_UIMENU:
00424   default:
00425     return -1;
00426     break;
00427   }
00428   return 0;
00429 }

Here is the call graph for this function:

Here is the caller graph for this function:

int sciInitGraphicContext ( sciPointObj pobj  ) 

sciInitGraphicContext Inits the graphic context of this object with the default value. the new graphic object inherits parent's features by sciGetParent()

Definition at line 192 of file InitObjects.c.

References sciGraphicContext::backgroundcolor, cloneGraphicContext(), FALSE, sciGraphicContext::foregroundcolor, HS_HORIZONTAL, sciGraphicContext::markbackground, sciGraphicContext::markforeground, NULL, pLABEL_FEATURE, PS_SOLID, pSUBWIN_FEATURE, SCI_AGREG, SCI_ARC, SCI_AXES, SCI_FEC, SCI_FIGURE, SCI_GRAYPLOT, SCI_LABEL, SCI_LEGEND, SCI_LIGHT, SCI_MENU, SCI_MENUCONTEXT, SCI_PANNER, SCI_POLYLINE, SCI_RECTANGLE, SCI_SBH, SCI_SBV, SCI_SEGS, SCI_STATUSB, SCI_SUBWIN, SCI_SURFACE, SCI_TEXT, SCI_TITLE, SCI_UIMENU, sciGetEntityType(), sciGetGraphicContext(), sciGetParent(), and TRUE.

Referenced by ConstructArc(), ConstructAxes(), ConstructFec(), ConstructFigure(), ConstructGrayplot(), ConstructLegend(), ConstructMenu(), ConstructMenuContext(), ConstructPolyline(), ConstructRectangle(), ConstructSegs(), ConstructStatusBar(), ConstructSubWin(), ConstructSurface(), ConstructText(), InitAxesModel(), InitFigureModel(), initLabel(), ResetFigureToDefaultValues(), and sciSetDefaultValues().

00193 {
00194   /* 
00195    * initialisation du contexte graphique par defaut 
00196    * que l'on peut recuperer sur les structure de base de scilab 
00197    * la colormap des fils est heritee du parent
00198    */
00199 
00200   switch (sciGetEntityType (pobj))
00201   {
00202   case SCI_FIGURE:
00203     if ( pobj == pfiguremdl )
00204     {
00205       (sciGetGraphicContext(pobj))->backgroundcolor = -3; /*33;*/  /* F.Leray 29.03.04: Wrong index here: 32+1 (old method) must be changed to -1 new method*/
00206       (sciGetGraphicContext(pobj))->foregroundcolor = -2; /*32;*/  /* F.Leray 29.03.04: Wrong index here: 32+2 (old method) must be changed to -2 new method*/
00207       (sciGetGraphicContext(pobj))->fillstyle = HS_HORIZONTAL;
00208       (sciGetGraphicContext(pobj))->fillcolor = (sciGetGraphicContext(pobj))->backgroundcolor;
00209       (sciGetGraphicContext(pobj))->linewidth = 1;
00210       (sciGetGraphicContext(pobj))->linestyle = PS_SOLID;
00211       (sciGetGraphicContext(pobj))->ismark    = FALSE;
00212       (sciGetGraphicContext(pobj))->isline    = TRUE;
00213       (sciGetGraphicContext(pobj))->markstyle = 0;
00214       (sciGetGraphicContext(pobj))->marksize = 0 ; /* New F.Leray 21.01.05 */
00215       (sciGetGraphicContext(pobj))->markbackground = -3; /* New F.Leray 21.01.05 */
00216       (sciGetGraphicContext(pobj))->markforeground = -2; /* New F.Leray 21.01.05 */
00217       (sciGetGraphicContext(pobj))->marksizeunit = 2; /* New F.Leray 22.02.05 */ /* 1 : points, 2 : tabulated */
00218     }
00219     else
00220     {
00221       cloneGraphicContext( pfiguremdl, pobj ) ;
00222     }
00223     return 0;
00224     break;
00225   case SCI_SUBWIN:
00226     if ( pobj == paxesmdl )
00227     {
00228       cloneGraphicContext( sciGetParent (pobj), pobj ) ;
00229       sciGetGraphicContext(pobj)->backgroundcolor = -3 ;
00230       sciGetGraphicContext(pobj)->foregroundcolor = -2 ;
00231       sciGetGraphicContext(pobj)->markbackground  = -3 ;
00232       sciGetGraphicContext(pobj)->markforeground  = -2 ;
00233     }
00234     else
00235     {
00236       cloneGraphicContext( paxesmdl, pobj ) ;
00237     }
00238     return 0;
00239     break;
00240   case SCI_ARC:
00241   case SCI_SEGS: 
00242   case SCI_FEC: 
00243   case SCI_GRAYPLOT: 
00244   case SCI_POLYLINE:
00245   case SCI_RECTANGLE:
00246   case SCI_SURFACE:
00247   case SCI_LIGHT:
00248   case SCI_AXES:
00249   case SCI_MENU:
00250   case SCI_MENUCONTEXT:
00251   case SCI_STATUSB: 
00252   case SCI_LEGEND: /* Adding a graphic context to legend object F.Leray 21.01.05 */
00253   case SCI_TEXT:
00254     cloneGraphicContext( sciGetParent (pobj), pobj ) ;
00255     return 0;
00256     break;
00257   case SCI_LABEL: /* F.Leray 28.05.04, modif JB.Silvy 03/2006 */
00258     if ( sciGetParent(pobj) == paxesmdl )
00259     {
00260       /* this is a label model */
00261       cloneGraphicContext( sciGetParent( pobj ), pobj ) ;
00262       return 0;
00263     }
00264     else
00265     {
00266       sciPointObj * plabelmdl = NULL ;
00267       switch ( pLABEL_FEATURE(pobj)->ptype )
00268       {
00269       case 1:
00270         plabelmdl = pSUBWIN_FEATURE(paxesmdl)->mon_title;
00271         break ;
00272       case 2:
00273         plabelmdl = pSUBWIN_FEATURE(paxesmdl)->mon_x_label;
00274         break ;
00275       case 3:
00276         plabelmdl = pSUBWIN_FEATURE(paxesmdl)->mon_y_label;
00277         break ;
00278       case 4:
00279         plabelmdl = pSUBWIN_FEATURE(paxesmdl)->mon_z_label;
00280         break ;
00281       default:
00282         /* arrgh*/
00283         return -1 ;
00284         break ;
00285       }
00286       cloneGraphicContext( plabelmdl, pobj ) ;
00287       return 0 ;
00288     }
00289   case SCI_AGREG:
00290   case SCI_TITLE:
00291   case SCI_PANNER:              /* pas de context graphics */
00292   case SCI_SBH:         /* pas de context graphics */
00293   case SCI_SBV:         /* pas de context graphics */
00294   case SCI_UIMENU:
00295   default:
00296     return -1;
00297     break;
00298   }
00299   return 0;
00300 }

Here is the call graph for this function:

Here is the caller graph for this function:

int sciInitGraphicMode ( sciPointObj pobj  ) 

sciInitGraphicMode Inits the graphic mode of this object with the default value

Definition at line 811 of file InitObjects.c.

References FALSE, SCI_AGREG, SCI_ARC, SCI_AXES, SCI_FEC, SCI_FIGURE, SCI_GRAYPLOT, SCI_LABEL, SCI_LEGEND, SCI_LIGHT, SCI_MENU, SCI_MENUCONTEXT, SCI_PANNER, SCI_POLYLINE, SCI_RECTANGLE, SCI_SBH, SCI_SBV, SCI_SEGS, SCI_STATUSB, SCI_SUBWIN, SCI_SURFACE, SCI_TEXT, SCI_TITLE, SCI_UIMENU, sciGetAddPlot(), sciGetAutoScale(), sciGetEntityType(), sciGetGraphicMode(), sciGetParent(), sciGetResize(), sciGetXorMode(), sciGetZooming(), sciprint(), and TRUE.

Referenced by ConstructFigure(), ConstructSubWin(), InitAxesModel(), InitFigureModel(), ResetFigureToDefaultValues(), and sciSetDefaultValues().

00812 {
00813   switch (sciGetEntityType (pobj))
00814     {
00815     case SCI_FIGURE:
00816       if (pobj == pfiguremdl)
00817         {
00818           (sciGetGraphicMode (pobj))->wresize = TRUE;
00819           (sciGetGraphicMode (pobj))->addplot = TRUE;
00820           (sciGetGraphicMode (pobj))->autoscaling = TRUE;
00821           (sciGetGraphicMode (pobj))->zooming = FALSE;
00822           (sciGetGraphicMode (pobj))->xormode = 3;
00823         }
00824       else
00825         {
00826           (sciGetGraphicMode (pobj))->wresize = (sciGetGraphicMode (pfiguremdl))->wresize;
00827           (sciGetGraphicMode (pobj))->addplot = (sciGetGraphicMode (pfiguremdl))->addplot;
00828           (sciGetGraphicMode (pobj))->autoscaling = (sciGetGraphicMode (pfiguremdl))->autoscaling;
00829           (sciGetGraphicMode (pobj))->zooming = (sciGetGraphicMode (pfiguremdl))->zooming;
00830           (sciGetGraphicMode (pobj))->xormode = (sciGetGraphicMode (pfiguremdl))->xormode;
00831         }
00832       break;
00833     case SCI_SUBWIN:
00834       if (pobj == paxesmdl)
00835         {
00836           (sciGetGraphicMode (pobj))->wresize =sciGetResize (sciGetParent (pobj));
00837           (sciGetGraphicMode (pobj))->addplot =sciGetAddPlot (sciGetParent (pobj));
00838           (sciGetGraphicMode (pobj))->autoscaling =sciGetAutoScale (sciGetParent (pobj));
00839           (sciGetGraphicMode (pobj))->zooming =sciGetZooming (sciGetParent (pobj));
00840           (sciGetGraphicMode (pobj))->xormode =sciGetXorMode (sciGetParent (pobj));
00841         }
00842       else
00843         {
00844           (sciGetGraphicMode (pobj))->addplot =(sciGetGraphicMode (paxesmdl))->addplot;
00845           (sciGetGraphicMode (pobj))->autoscaling = (sciGetGraphicMode (paxesmdl))->autoscaling;
00846           (sciGetGraphicMode (pobj))->zooming =(sciGetGraphicMode (paxesmdl))->zooming;
00847           (sciGetGraphicMode (pobj))->xormode =(sciGetGraphicMode (paxesmdl))->xormode;
00848         }
00849       break;
00850     case SCI_TEXT:
00851     case SCI_TITLE:
00852     case SCI_LEGEND:
00853     case SCI_ARC:
00854     case SCI_SEGS: 
00855     case SCI_FEC: 
00856     case SCI_GRAYPLOT: 
00857     case SCI_POLYLINE:
00858     case SCI_RECTANGLE:
00859     case SCI_SURFACE:
00860     case SCI_LIGHT:
00861     case SCI_AXES:
00862     case SCI_PANNER:            /* pas de context graphics */
00863     case SCI_SBH:               /* pas de context graphics */
00864     case SCI_SBV:               /* pas de context graphics */
00865     case SCI_MENU:
00866     case SCI_MENUCONTEXT:
00867     case SCI_STATUSB:
00868     case SCI_AGREG:
00869     case SCI_LABEL: /* F.Leray 28.05.04 */
00870     case SCI_UIMENU:
00871     default:
00872       sciprint ("This object haven't any graphic mode\n");
00873       return -1;
00874       break;
00875     }
00876   return 0;
00877 }

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

unsigned short defcolors[]

Definition at line 77 of file DrawObjects.c.

char error_message[70] [static]

Definition at line 36 of file InitObjects.c.

sciPointObj* paxesmdl = (sciPointObj *) NULL [static]

Definition at line 40 of file InitObjects.c.

sciPointObj* pfiguremdl = (sciPointObj *) NULL [static]

Definition at line 39 of file InitObjects.c.


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