#include <stdio.h>#include <string.h>#include <math.h>#include <stdlib.h>#include <stdarg.h>#include <time.h>#include "BuildObjects.h"#include "GetProperty.h"#include "InitObjects.h"#include "DestroyObjects.h"#include "bcg.h"#include "SetProperty.h"#include "CloneObjects.h"#include "StringMatrix.h"#include "Xcall1.h"#include "sciprint.h"#include "CurrentObjectsManagement.h"#include "ObjectSelection.h"#include "MALLOC.h"Include dependency graph for BuildObjects.c:

Go to the source code of this file.
Functions | |
| int | LinearScaling2Colormap (sciPointObj *pobj) |
| double * | AllocUserGrads (double *u_xgrads, int nb) |
| char ** | AllocAndSetUserLabelsFromMdl (char **u_xlabels, char **u_xlabels_MDL, int u_nxgrads) |
| int | CopyUserGrads (double *u_xgrad_SRC, double *u_xgrad_DEST, int dim) |
| sciPointObj * | ConstructStatusBar (sciPointObj *pparentfigure) |
| int C2F() | sciwin (void) |
| sciPointObj * | ConstructFigure (sciPointObj *pparent, struct BCG *XGC) |
| sciPointObj * | ConstructSubWin (sciPointObj *pparentfigure, int pwinnum) |
| sciPointObj * | ConstructScrollV (sciPointObj *pparentfigure) |
| sciPointObj * | ConstructScrollH (sciPointObj *pparentfigure) |
| sciPointObj * | allocateText (sciPointObj *pparentsubwin, char **text, int nbRow, int nbCol, double x, double y, BOOL autoSize, double userSize[2], BOOL centerPos, int *foreground, int *background, BOOL isboxed, BOOL isline, BOOL isfilled, sciTextAlignment align) |
| sciPointObj * | ConstructText (sciPointObj *pparentsubwin, char **text, int nbRow, int nbCol, double x, double y, BOOL autoSize, double userSize[2], BOOL centerPos, int *foreground, int *background, BOOL isboxed, BOOL isline, BOOL isfilled, sciTextAlignment align) |
| sciPointObj * | ConstructTitle (sciPointObj *pparentsubwin, char text[], int type) |
| sciPointObj * | ConstructLegend (sciPointObj *pparentsubwin, char text[], int n, int nblegends, int *pstyle, sciPointObj **pptabofpointobj) |
| sciPointObj * | ConstructPolyline (sciPointObj *pparentsubwin, double *pvecx, double *pvecy, double *pvecz, int closed, int n1, int n2, int plot, int *foreground, int *background, int *mark_style, int *mark_foreground, int *mark_background, BOOL isline, BOOL isfilled, BOOL ismark, BOOL isinterpshaded) |
| sciPointObj * | ConstructArc (sciPointObj *pparentsubwin, double x, double y, double height, double width, double alphabegin, double alphaend, int *foreground, int *background, BOOL isfilled, BOOL isline) |
| sciPointObj * | ConstructRectangle (sciPointObj *pparentsubwin, double x, double y, double height, double width, double horzcurvature, double vertcurvature, int *foreground, int *background, int isfilled, int isline, int str, BOOL flagstring) |
| sciPointObj * | ConstructSurface (sciPointObj *pparentsubwin, sciTypeOf3D typeof3d, double *pvecx, double *pvecy, double *pvecz, double *zcol, integer izcol, integer dimzx, integer dimzy, integer *flag, double *ebox, integer flagcolor, integer *isfac, integer *m1, integer *n1, integer *m2, integer *n2, integer *m3, integer *n3, integer *m3n, integer *n3n) |
| sciPointObj * | ConstructMerge (sciPointObj *pparentsubwin, int N, int *index_in_entity, long *from_entity) |
| sciPointObj * | ConstructGrayplot (sciPointObj *pparentsubwin, double *pvecx, double *pvecy, double *pvecz, int n1, int n2, int type) |
| sciPointObj * | ConstructAxes (sciPointObj *pparentsubwin, char dir, char tics, double *vx, int nx, double *vy, int ny, char **str, int subint, char *format, int fontsize, int textcolor, int ticscolor, char logscale, int seg, int nb_tics_labels) |
| sciPointObj * | ConstructFec (sciPointObj *pparentsubwin, double *pvecx, double *pvecy, double *pnoeud, double *pfun, int Nnode, int Ntr, double *zminmax, integer *colminmax, integer *colout, BOOL with_mesh) |
| sciPointObj * | ConstructSegs (sciPointObj *pparentsubwin, integer type, double *vx, double *vy, integer Nbr1, integer Nbr2, double *vfx, double *vfy, integer flag, integer *style, double arsize, integer colored, double arfact, int typeofchamp) |
| sciPointObj * | ConstructCompound (long *handelsvalue, int number) |
| sciPointObj * | ConstructCompoundSeq (int number) |
| sciPointObj * | ConstructLabel (sciPointObj *pparentsubwin, char *text, int type) |
| sciPointObj * | ConstructMenu (sciPointObj *pparentfigure, char plabel[], int n) |
| sciPointObj * | ConstructMenuContext (sciPointObj *pparentfigure) |
| int | sciAddLabelMenu (sciPointObj *pthis, char plabel[], int n) |
| int | sciAttachPopMenu (sciPointObj *pthis, sciPointObj *pPopMenu) |
| sciPointObj * | ConstructUimenu (sciPointObj *pparent, char *label, char *callback, BOOL handle_visible) |
| sciPointObj * | sciConstructConsole (sciPointObj *pparent) |
| sciPointObj * | sciStandrardBuildOperations (sciPointObj *pObj, sciPointObj *parent) |
| sciPointObj * | sciConstructFrame (sciPointObj *pparent) |
| sciPointObj * | sciConstructWindow (sciPointObj *pparent) |
| sciPointObj * | sciConstructWindowFrame (sciPointObj *pparent) |
| sciPointObj * | sciConstructScreen (sciPointObj *pparent) |
Variables | |
| unsigned short | defcolors [] |
| char** AllocAndSetUserLabelsFromMdl | ( | char ** | u_xlabels, | |
| char ** | u_xlabels_MDL, | |||
| int | u_nxgrads | |||
| ) |
| sciPointObj* allocateText | ( | sciPointObj * | pparentsubwin, | |
| char ** | text, | |||
| int | nbRow, | |||
| int | nbCol, | |||
| double | x, | |||
| double | y, | |||
| BOOL | autoSize, | |||
| double | userSize[2], | |||
| BOOL | centerPos, | |||
| int * | foreground, | |||
| int * | background, | |||
| BOOL | isboxed, | |||
| BOOL | isline, | |||
| BOOL | isfilled, | |||
| sciTextAlignment | align | |||
| ) |
creates a new text object. However the object is not added in the handle list. Its graphic and font context are also not initialized. this function is to be used with objects including a text object.
DJ.Abdemouche 2003
Definition at line 624 of file BuildObjects.c.
References sciText::autoSize, sciText::callback, sciText::callbackevent, sciText::callbacklen, sciText::centeredPos, sciText::clip_region_set, FREE, sciText::is3d, MALLOC, newFullStringMatrix(), NULL, sciPointObj::pfeatures, sciRelationShip::plastsons, sciRelationShip::psons, sciText::pStrings, pTEXT_FEATURE, sciText::relationship, SCI_TEXT, sciGetClipping(), sciGetIsClipping(), sciGetVisibility(), sciInitBackground(), sciInitForeground(), sciInitIsBoxed(), sciInitIsClipping(), sciInitIsFilled(), sciInitIsLine(), sciInitSelectedSons(), sciSetClipping(), sciSetEntityType(), sciSetParent(), sciText::size_of_user_data, sciText::stringsAlign, TRUE, sciText::user_data, sciText::userSize, sciText::visible, sciText::x, sciText::y, and sciText::z.
Referenced by ConstructLabel(), ConstructText(), and initLabel().
00639 { 00640 sciPointObj * pObj = NULL ; 00641 sciText * ppText ; 00642 if ( ( pObj = MALLOC( sizeof(sciPointObj) ) ) == NULL ) 00643 { 00644 return NULL; 00645 } 00646 00647 sciSetEntityType (pObj, SCI_TEXT); 00648 00649 if ( ( pObj->pfeatures = MALLOC( sizeof (sciText) ) ) == NULL ) 00650 { 00651 FREE( pObj ) ; 00652 return NULL; 00653 } 00654 00655 ppText = pTEXT_FEATURE( pObj ) ; 00656 00657 ppText->user_data = (int *) NULL; 00658 ppText->size_of_user_data = 0; 00659 sciInitSelectedSons( pObj ) ; 00660 ppText->relationship.psons = NULL; 00661 ppText->relationship.plastsons = NULL; 00662 00663 /* it must be specified for some functions */ 00664 sciSetParent( pObj, pparentsubwin ) ; 00665 00666 ppText->callback = (char *)NULL; 00667 ppText->callbacklen = 0; 00668 ppText->callbackevent = 100; 00669 ppText->visible = sciGetVisibility( pparentsubwin ); 00670 00671 ppText->clip_region_set = 0 ; 00672 sciInitIsClipping( pObj, sciGetIsClipping( pparentsubwin ) ) ; 00673 sciSetClipping( pObj, sciGetClipping(pparentsubwin) ); 00674 00675 /* allocate the matrix */ 00676 ppText->pStrings = newFullStringMatrix( text, nbRow, nbCol ) ; 00677 if ( ppText->pStrings == NULL ) 00678 { 00679 FREE(pObj->pfeatures); 00680 FREE(pObj); 00681 return NULL ; 00682 } 00683 00684 /* initialize position */ 00685 ppText->is3d = TRUE ; 00686 ppText->x = x; 00687 ppText->y = y; 00688 ppText->z = 0.0; 00690 ppText->centeredPos = centerPos ; 00691 ppText->autoSize = autoSize ; 00692 00693 /* userSize must be specified if the size is given by the user */ 00694 /* or the user specified a rectangle */ 00695 00696 if ( !autoSize || centerPos ) 00697 { 00698 ppText->userSize[0] = userSize[0] ; 00699 ppText->userSize[1] = userSize[1] ; 00700 } 00701 else 00702 { 00703 ppText->userSize[0] = 0.0 ; 00704 ppText->userSize[1] = 0.0 ; 00705 } 00706 00707 ppText->stringsAlign = align ; 00708 00709 sciInitIsBoxed(pObj,isboxed); 00710 sciInitIsLine(pObj,isline); 00711 sciInitIsFilled(pObj,isfilled); 00712 00713 if ( foreground != NULL ) 00714 { 00715 sciInitForeground(pObj,(*foreground)); 00716 } 00717 00718 if ( background != NULL ) 00719 { 00720 sciInitBackground(pObj,(*background)); 00721 } 00722 00723 return pObj; 00724 }
Here is the call graph for this function:

Here is the caller graph for this function:

| double* AllocUserGrads | ( | double * | u_xgrads, | |
| int | nb | |||
| ) |
| sciPointObj* ConstructArc | ( | sciPointObj * | pparentsubwin, | |
| double | x, | |||
| double | y, | |||
| double | height, | |||
| double | width, | |||
| double | alphabegin, | |||
| double | alphaend, | |||
| int * | foreground, | |||
| int * | background, | |||
| BOOL | isfilled, | |||
| BOOL | isline | |||
| ) |
ConstructArc This function creates an Arc structure
Definition at line 1192 of file BuildObjects.c.
References sciArc::alphabegin, sciArc::alphaend, sciArc::callback, sciArc::callbackevent, sciArc::callbacklen, sciArc::clip_region_set, FREE, sciArc::height, sciArc::isselected, MALLOC, NULL, sciPointObj::pfeatures, SCI_ARC, SCI_SUBWIN, sciDelHandle(), sciDelThisToItsParent(), sciGetClipping(), sciGetEntityType(), sciGetIsClipping(), sciGetParent(), sciGetParentSubwin(), sciGetVisibility(), sciInitBackground(), sciInitForeground(), sciInitGraphicContext(), sciInitIsClipping(), sciInitIsFilled(), sciInitIsLine(), sciprint(), sciSetClipping(), sciSetEntityType(), sciStandrardBuildOperations(), TRUE, sciArc::visible, sciArc::width, sciArc::x, sciArc::y, and sciArc::z.
Referenced by CloneArc(), and Objarc().
01195 { 01196 sciPointObj * pobj = (sciPointObj *) NULL; 01197 sciArc * ppArc = NULL ; 01198 01199 if (sciGetEntityType (pparentsubwin) == SCI_SUBWIN) 01200 { 01201 if ((pobj = MALLOC ((sizeof (sciPointObj)))) == NULL) 01202 return (sciPointObj *) NULL; 01203 sciSetEntityType (pobj, SCI_ARC); 01204 if ((pobj->pfeatures = MALLOC ((sizeof (sciArc)))) == NULL) 01205 { 01206 FREE(pobj); 01207 return (sciPointObj *) NULL; 01208 } 01209 01210 /* get the pointer to features */ 01211 ppArc = pobj->pfeatures ; 01212 01213 if ( sciStandrardBuildOperations( pobj, pparentsubwin ) == NULL ) 01214 { 01215 return NULL ; 01216 } 01217 01218 ppArc->callback = (char *)NULL; 01219 ppArc->callbacklen = 0; 01220 ppArc->callbackevent = 100; 01221 01222 ppArc->x = x; 01223 ppArc->y = y; 01224 ppArc->z = 0; 01225 ppArc->height = height; 01226 ppArc->width = width; 01227 ppArc->alphabegin = alphabegin; 01228 ppArc->alphaend = alphaend; 01229 ppArc->isselected = TRUE; 01230 ppArc->visible = sciGetVisibility(sciGetParentSubwin(pobj)); 01231 01232 ppArc->clip_region_set = 0; 01233 /*ppArc->isclip = sciGetIsClipping((sciPointObj *) sciGetParentSubwin(pobj)); */ 01234 sciInitIsClipping( pobj, sciGetIsClipping((sciPointObj *) sciGetParentSubwin(pobj)) ) ; 01235 sciSetClipping(pobj,sciGetClipping(sciGetParentSubwin(pobj))); 01236 /* pARC_FEATURE (pobj)->clip_region = (double *) NULL; */ 01237 01238 01239 if (sciInitGraphicContext (pobj) == -1) 01240 { 01241 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 01242 sciDelHandle (pobj); 01243 FREE(ppArc); 01244 FREE(pobj); 01245 sciprint("pas de context"); 01246 return (sciPointObj *) NULL; 01247 } 01248 01249 sciInitIsFilled(pobj,isfilled); 01250 /* should be put after graphicContext initialization */ 01251 sciInitIsLine(pobj,isline); 01252 01253 if(foreground != NULL) 01254 { 01255 sciInitForeground(pobj,(*foreground)); 01256 } 01257 01258 if(background != NULL) 01259 { 01260 sciInitBackground(pobj,(*background)); 01261 } 01262 01263 return pobj; 01264 } 01265 else 01266 { 01267 sciprint ("The parent has to be a SUBWIN \n"); 01268 return (sciPointObj *) NULL; 01269 } 01270 }
Here is the call graph for this function:

Here is the caller graph for this function:

| sciPointObj* ConstructAxes | ( | sciPointObj * | pparentsubwin, | |
| char | dir, | |||
| char | tics, | |||
| double * | vx, | |||
| int | nx, | |||
| double * | vy, | |||
| int | ny, | |||
| char ** | str, | |||
| int | subint, | |||
| char * | format, | |||
| int | fontsize, | |||
| int | textcolor, | |||
| int | ticscolor, | |||
| char | logscale, | |||
| int | seg, | |||
| int | nb_tics_labels | |||
| ) |
ConstructAxes This function creates Axes structure
Definition at line 1792 of file BuildObjects.c.
References FREE, i, MALLOC, Max, NULL, pAXES_FEATURE, sciPointObj::pfeatures, pPOLYLINE_FEATURE, SCI_AXES, SCI_SUBWIN, sciDelHandle(), sciDelThisToItsParent(), sciGetClipping(), sciGetEntityType(), sciGetParent(), sciGetParentSubwin(), sciGetVisibility(), sciInitGraphicContext(), sciInitIsClipping(), sciprint(), sciSetClipping(), sciSetEntityType(), sciStandrardBuildOperations(), sciAxes::vector, sciAxes::vx, and sciAxes::vy.
01795 { 01796 sciPointObj *pobj = (sciPointObj *) NULL; 01797 sciAxes *paxes = (sciAxes *) NULL; 01798 int i; 01799 01800 if (sciGetEntityType (pparentsubwin) == SCI_SUBWIN) 01801 { 01802 if ((pobj = MALLOC ((sizeof (sciPointObj)))) == NULL) 01803 return (sciPointObj *) NULL; 01804 sciSetEntityType (pobj, SCI_AXES); 01805 if ((pobj->pfeatures = MALLOC ((sizeof (sciAxes)))) == NULL) 01806 { 01807 FREE(pobj); 01808 return (sciPointObj *) NULL; 01809 } 01810 if ( sciStandrardBuildOperations( pobj, pparentsubwin ) == NULL ) 01811 { 01812 return NULL ; 01813 } 01814 01815 pAXES_FEATURE (pobj)->callback = (char *)NULL; 01816 pAXES_FEATURE (pobj)->callbacklen = 0; 01817 pAXES_FEATURE (pobj)->callbackevent = 100; 01818 pAXES_FEATURE (pobj)->visible = sciGetVisibility(sciGetParentSubwin(pobj)); 01819 01820 /*pAXES_FEATURE (pobj)->isclip = sciGetIsClipping((sciPointObj *) sciGetParentSubwin(pobj)); */ 01821 pAXES_FEATURE (pobj)->clip_region_set = 0; 01822 /*pAXES_FEATURE (pobj)->isclip = -1;*/ /*F.Leray Change here: by default Axis are not clipped. 10.03.04 */ 01823 sciInitIsClipping( pobj, -1 ) ; 01824 sciSetClipping(pobj,sciGetClipping(sciGetParentSubwin(pobj))); 01825 /* pAXES_FEATURE (pobj)->clip_region = (double *) NULL; */ 01826 01827 pAXES_FEATURE (pobj)->dir =dir; 01828 pAXES_FEATURE (pobj)->tics =tics; 01829 01830 paxes = pAXES_FEATURE (pobj); 01831 if ((paxes->vector = MALLOC (Max(nx,ny) * sizeof (POINT2D))) == NULL) 01832 { 01833 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 01834 sciDelHandle (pobj); 01835 FREE(pPOLYLINE_FEATURE(pobj)); 01836 FREE(pobj); 01837 return (sciPointObj *) NULL; 01838 } 01839 /* pour le moment je garde les vecteurs separes, et non en POINT2D */ 01840 if ((paxes->vx = MALLOC (nx * sizeof (double))) == NULL) 01841 { 01842 FREE(pAXES_FEATURE (pobj)->vector); 01843 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 01844 sciDelHandle (pobj); 01845 FREE(pAXES_FEATURE(pobj)); 01846 FREE(pobj); 01847 return (sciPointObj *) NULL; 01848 } 01849 if ((paxes->vy = MALLOC (ny * sizeof (double))) == NULL) 01850 { 01851 FREE(pAXES_FEATURE (pobj)->vector); 01852 FREE(pAXES_FEATURE (pobj)->vx); 01853 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 01854 sciDelHandle (pobj); 01855 FREE(pAXES_FEATURE(pobj)); 01856 FREE(pobj); 01857 return (sciPointObj *) NULL; 01858 } 01859 01860 for (i = 0; i < nx; i++) 01861 { 01862 paxes->vx[i] = vx[i]; 01863 } 01864 for (i = 0; i < ny; i++) 01865 { 01866 paxes->vy[i] = vy[i]; 01867 } 01868 01869 01870 01871 pAXES_FEATURE (pobj)->nx =nx; 01872 01873 01874 pAXES_FEATURE (pobj)->ny =ny; 01875 01876 pAXES_FEATURE (pobj)->nb_tics_labels = nb_tics_labels; /* F.Leray 29.04.05 */ 01877 01878 /* pAXES_FEATURE(pobj)->str = str;*/ /* Pb here, F.Leray : Weird init.: can not copy a string using '='*/ 01879 if(str != (char **) NULL) 01880 { 01881 if(pAXES_FEATURE (pobj)->nb_tics_labels == -1){ 01882 sciprint("Impossible case when buyilding axis\n"); 01883 return (sciPointObj *) NULL; 01884 } 01885 01886 if ((pAXES_FEATURE(pobj)->str= MALLOC (pAXES_FEATURE (pobj)->nb_tics_labels * sizeof (char*))) == NULL) 01887 return (sciPointObj *) NULL; 01888 01889 for(i=0;i<pAXES_FEATURE (pobj)->nb_tics_labels;i++) 01890 { 01891 if(str[i] != (char *) NULL) 01892 { 01893 if((pAXES_FEATURE (pobj)->str[i] = MALLOC( (strlen(str[i])+1) * sizeof(char))) == NULL) 01894 return (sciPointObj *) NULL; 01895 else 01896 strcpy(pAXES_FEATURE (pobj)->str[i],str[i]); 01897 } 01898 else 01899 pAXES_FEATURE (pobj)->str[i] = (char *) NULL; 01900 } 01901 } 01902 else 01903 { 01904 pAXES_FEATURE (pobj)->str = (char **) NULL; 01905 } 01906 01907 pAXES_FEATURE (pobj)->subint = subint; 01908 pAXES_FEATURE (pobj)->fontsize =fontsize; 01909 pAXES_FEATURE (pobj)->textcolor =textcolor; 01910 pAXES_FEATURE (pobj)->ticscolor =ticscolor; 01911 pAXES_FEATURE (pobj)->seg =seg; 01912 /* pAXES_FEATURE (pobj)->format =format; */ /* Pb here, F.Leray : Weird init.: can not copy a string using '='*/ 01913 pAXES_FEATURE (pobj)->logscale=logscale; 01914 if(format != (char *) NULL) 01915 { 01916 if((pAXES_FEATURE (pobj)->format = MALLOC( (strlen(format)+1) * sizeof(char))) == NULL) 01917 return (sciPointObj *) NULL; 01918 else 01919 strcpy(pAXES_FEATURE (pobj)->format,format); 01920 } 01921 else 01922 pAXES_FEATURE (pobj)->format = (char *) NULL; 01923 01924 if (sciInitGraphicContext (pobj) == -1) 01925 { 01926 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 01927 sciDelHandle (pobj); 01928 FREE(pAXES_FEATURE (pobj)); 01929 FREE(pobj); 01930 return (sciPointObj *) NULL; 01931 } 01932 01933 01934 return pobj; 01935 } 01936 else 01937 { 01938 sciprint ("The parent has to be a SUBWIN \n"); 01939 return (sciPointObj *) NULL; 01940 } 01941 }
Here is the call graph for this function:

| sciPointObj* ConstructCompound | ( | long * | handelsvalue, | |
| int | number | |||
| ) |
sciConstructCompound constructes an Compound of entities do only a association with a parent and a handle reservation ! check for valid handle can be done using CheckForCompound
Definition at line 2290 of file BuildObjects.c.
References sciAgreg::callback, sciAgreg::callbacklen, i, sciAgreg::isselected, long, MALLOC, NULL, pAGREG_FEATURE, sciPointObj::pfeatures, SCI_AGREG, sciAddThisToItsParent(), sciDelThisToItsParent(), sciGetParent(), sciGetParentSubwin(), sciGetPointerFromHandle(), sciGetVisibility(), sciSetEntityType(), sciStandrardBuildOperations(), TRUE, and sciAgreg::visible.
Referenced by fec(), Objplot3d(), plot2dn(), and sci_glue().
02291 { 02292 /* sciSons *sons, *sonsnext; */ 02293 sciPointObj * pobj ; 02294 sciAgreg * ppCompound ; 02295 int i; 02296 long xtmp; 02297 02298 02299 if ((pobj = MALLOC ((sizeof (sciPointObj)))) == NULL) 02300 return (sciPointObj *) NULL; 02301 02302 sciSetEntityType (pobj, SCI_AGREG); 02303 if ((pobj->pfeatures = MALLOC ((sizeof (sciAgreg)))) == NULL) 02304 return (sciPointObj *) NULL; 02305 02306 /* get the pointer on features */ 02307 ppCompound = pAGREG_FEATURE (pobj) ; 02308 02309 if ( sciStandrardBuildOperations( pobj, sciGetParent(sciGetPointerFromHandle( (long) handelsvalue[0])) ) == NULL ) 02310 { 02311 return NULL ; 02312 } 02313 02314 ppCompound->callback = (char *)NULL; 02315 ppCompound->callbacklen = 0; 02316 ppCompound->visible = sciGetVisibility(sciGetParentSubwin(pobj)); 02317 02318 /* sonsnext = (sciSons *) NULL */ 02319 02320 /* initialisation with the first son */ 02321 xtmp = (long) handelsvalue[0]; 02322 for ( i = 0 ; i < number ; i++ ) 02323 { 02324 02325 02326 /* jb Silvy 10/01/06 */ 02327 /* the handle id moved from the current parent (ex axis) to the compund */ 02328 sciPointObj * movedObject ; 02329 xtmp = handelsvalue[i] ; 02330 movedObject = sciGetPointerFromHandle(xtmp) ; 02331 if ( movedObject != NULL ) 02332 { 02333 sciDelThisToItsParent( movedObject, sciGetParent(movedObject) ) ; 02334 sciAddThisToItsParent( movedObject, pobj ) ; 02335 } 02336 } 02337 02338 /* ppCompound->relationship.psons = sons; */ 02339 ppCompound->isselected = TRUE; 02340 02341 return (sciPointObj *)pobj; 02342 }
Here is the call graph for this function:

Here is the caller graph for this function:

| sciPointObj* ConstructCompoundSeq | ( | int | number | ) |
sciConstructCompoundSeq constructes an Compound of with the last n entities created in the current subwindow on entry subwin children list is null->s1->s2->...->sn->sn+1->...->null on exit it is null->A->sn+1->...->null with A an Compound whose children list is: null->s1->s2->...->sn->null
Definition at line 2354 of file BuildObjects.c.
References sciAgreg::callback, sciAgreg::callbacklen, FREE, i, sciAgreg::isselected, MALLOC, NULL, pAGREG_FEATURE, sciPointObj::pfeatures, sciRelationShip::plastsons, tagSons::pnext, tagSons::pointobj, tagSons::pprev, sciRelationShip::psons, pSUBWIN_FEATURE, sciAgreg::relationship, sciSubWindow::relationship, SCI_AGREG, sciAddNewHandle(), sciAddThisToItsParent(), sciGetCurrentSubWin(), sciGetParentFigure(), sciGetRelationship(), sciGetVisibility(), sciInitSelectedSons(), sciprint(), sciSetEntityType(), sciAgreg::size_of_user_data, TRUE, sciAgreg::user_data, and sciAgreg::visible.
Referenced by sci_xarcs(), sci_xfarcs(), sci_xfpolys(), sci_xpolys(), and sci_xrects().
02355 { 02356 sciSons *sons, *lastsons; 02357 sciPointObj *pobj; 02358 int i; 02359 02360 sciPointObj *psubwin; 02361 sciSubWindow *ppsubwin; 02362 sciAgreg *ppagr; 02363 02364 psubwin = sciGetCurrentSubWin(); 02365 ppsubwin=pSUBWIN_FEATURE(psubwin); 02366 02367 /* initialize the A Compound data structure */ 02368 if ((pobj = MALLOC ((sizeof (sciPointObj)))) == NULL) 02369 return (sciPointObj *) NULL; 02370 02371 sciSetEntityType (pobj, SCI_AGREG); 02372 if ((pobj->pfeatures = MALLOC ((sizeof (sciAgreg)))) == NULL) 02373 return (sciPointObj *) NULL; 02374 ppagr=pAGREG_FEATURE(pobj); 02375 02376 if (sciAddNewHandle (pobj) == -1) 02377 { 02378 sciprint("no handle to allocate\n"); 02379 FREE(pobj->pfeatures);FREE(pobj); 02380 return (sciPointObj *) NULL; 02381 } 02382 02383 02384 sons=ppsubwin->relationship.psons; 02385 /* check if s1 predecessor is null*/ 02386 if (sons->pprev != (sciSons *)NULL) { 02387 sciprint("Unexpected case, please report\n"); 02388 FREE(pobj->pfeatures);FREE(pobj); 02389 return (sciPointObj *) NULL; 02390 } 02391 02392 /* change parent of all sons s1,...,sn*/ 02393 lastsons=sons; 02394 02395 02396 /* sciprint("debut\n"); */ 02397 02398 for (i=0;i<number;i++) { 02399 02400 /* sciprint("%8x %8x %8x | %8x\n",lastsons->pprev,lastsons->pointobj,lastsons->pnext, */ 02401 /* sciGetRelationship (lastsons->pointobj)->pparent); */ 02402 02403 (sciGetRelationship (lastsons->pointobj))->pparent=pobj; 02404 lastsons=lastsons->pnext; 02405 } 02406 02407 lastsons=lastsons->pprev; /* lastsons is sn */ 02408 02409 /* disconnect chain s1->s2->...->sn out of subwin children list */ 02410 ppsubwin->relationship.psons = lastsons->pnext; 02411 ppsubwin->relationship.psons->pprev = (sciSons *)NULL; 02412 /* attach the Compound to the current subwin */ 02413 /* the subwin children list is now null->A->sn+1->...->null */ 02414 if (!(sciAddThisToItsParent (pobj, (sciPointObj *)psubwin))) { 02415 FREE(pobj->pfeatures);FREE(pobj); 02416 return (sciPointObj *) NULL; 02417 } 02418 sciInitSelectedSons(pobj); 02419 /* the subwin children list is now null->A->sn+1->...->null */ 02420 02421 /* set Compound properties*/ 02422 ppagr->user_data = (int *) NULL; /* add missing init. 29.06.05 */ 02423 ppagr->size_of_user_data = 0; 02424 ppagr->callback = (char *)NULL; 02425 ppagr->callbacklen = 0; 02426 ppagr->visible = sciGetVisibility (sciGetParentFigure(pobj)); 02427 02428 ppagr->isselected = TRUE; 02429 02430 /* re chain A sons lists */ 02431 ppagr->relationship.psons = sons; 02432 02433 ppagr->relationship.plastsons = lastsons; 02434 ppagr->relationship.plastsons->pnext = (sciSons *)NULL; 02435 ppagr->relationship.psons->pprev = (sciSons *)NULL; /* this should do nothing*/ 02436 /* the Compound children list is now null->s1->s2->...->sn->null*/ 02437 02438 02439 return (sciPointObj *)pobj; 02440 }
Here is the call graph for this function:

Here is the caller graph for this function:

| sciPointObj* ConstructFec | ( | sciPointObj * | pparentsubwin, | |
| double * | pvecx, | |||
| double * | pvecy, | |||
| double * | pnoeud, | |||
| double * | pfun, | |||
| int | Nnode, | |||
| int | Ntr, | |||
| double * | zminmax, | |||
| integer * | colminmax, | |||
| integer * | colout, | |||
| BOOL | with_mesh | |||
| ) |
Definition at line 1952 of file BuildObjects.c.
References sciFec::colminmax, sciFec::colout, FREE, i, MALLOC, sciFec::Nnode, sciFec::Ntr, NULL, sciPointObj::pfeatures, pFEC_FEATURE, sciFec::pfun, sciFec::pnoeud, sciFec::pvecx, sciFec::pvecy, SCI_FEC, SCI_SUBWIN, sciDelHandle(), sciDelThisToItsParent(), sciGetEntityType(), sciGetParent(), sciGetParentSubwin(), sciGetVisibility(), sciInitGraphicContext(), sciprint(), sciSetEntityType(), sciStandrardBuildOperations(), TRUE, sciFec::with_mesh, and sciFec::zminmax.
Referenced by fec().
01955 { 01956 sciPointObj *pobj = (sciPointObj *) NULL; 01957 sciFec *pfec = (sciFec *) NULL; 01958 int i = 0; 01959 01960 if (sciGetEntityType (pparentsubwin) == SCI_SUBWIN) 01961 { 01962 if ((pobj = MALLOC ((sizeof (sciPointObj)))) == NULL) 01963 return (sciPointObj *) NULL; 01964 sciSetEntityType (pobj, SCI_FEC); 01965 if ((pobj->pfeatures = MALLOC ((sizeof (sciFec)))) == NULL) 01966 { 01967 FREE(pobj); 01968 return (sciPointObj *) NULL; 01969 } 01970 if ( sciStandrardBuildOperations( pobj, pparentsubwin ) == NULL ) 01971 { 01972 return NULL ; 01973 } 01974 01975 pFEC_FEATURE (pobj)->callback = (char *)NULL; 01976 pFEC_FEATURE (pobj)->callbacklen = 0; 01977 pFEC_FEATURE (pobj)->callbackevent = 100; 01978 01979 pFEC_FEATURE (pobj)->isselected = TRUE; 01980 pFEC_FEATURE (pobj)->visible = sciGetVisibility(sciGetParentSubwin(pobj)); 01981 01982 pfec = pFEC_FEATURE (pobj); 01983 01984 if ((pfec->pvecx = MALLOC (Nnode * sizeof (double))) == NULL) 01985 { 01986 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 01987 sciDelHandle (pobj); 01988 FREE(pFEC_FEATURE(pobj)); 01989 FREE(pobj); 01990 return (sciPointObj *) NULL; 01991 } 01992 if ((pfec->pvecy = MALLOC (Nnode * sizeof (double))) == NULL) 01993 { 01994 FREE(pFEC_FEATURE (pobj)->pvecx); 01995 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 01996 sciDelHandle (pobj); 01997 FREE(pFEC_FEATURE(pobj)); 01998 FREE(pobj); 01999 return (sciPointObj *) NULL; 02000 } 02001 if ((pfec->pnoeud = MALLOC ((5*Ntr) * sizeof (double))) == NULL) 02002 { 02003 FREE(pFEC_FEATURE (pobj)->pvecx); 02004 FREE(pFEC_FEATURE (pobj)->pvecy); 02005 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 02006 sciDelHandle (pobj); 02007 FREE(pFEC_FEATURE(pobj)); 02008 FREE(pobj); 02009 return (sciPointObj *) NULL; 02010 } 02011 if ((pfec->pfun = MALLOC (Nnode * sizeof (double))) == NULL) 02012 { 02013 FREE(pFEC_FEATURE (pobj)->pvecx); 02014 FREE(pFEC_FEATURE (pobj)->pvecy); 02015 FREE(pFEC_FEATURE (pobj)->pnoeud); 02016 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 02017 sciDelHandle (pobj); 02018 FREE(pFEC_FEATURE(pobj)); 02019 FREE(pobj); 02020 return (sciPointObj *) NULL; 02021 } 02022 if ((pfec->zminmax = MALLOC (2 * sizeof (double))) == NULL) 02023 { 02024 FREE(pFEC_FEATURE (pobj)->pvecx); 02025 FREE(pFEC_FEATURE (pobj)->pvecy); 02026 FREE(pFEC_FEATURE (pobj)->pnoeud); 02027 FREE(pFEC_FEATURE (pobj)->pfun); 02028 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 02029 sciDelHandle (pobj); 02030 FREE(pFEC_FEATURE(pobj)); 02031 FREE(pobj); 02032 return (sciPointObj *) NULL; 02033 } 02034 if ((pfec->colminmax = MALLOC (2 * sizeof (integer))) == NULL) 02035 { 02036 FREE(pFEC_FEATURE (pobj)->pvecx); 02037 FREE(pFEC_FEATURE (pobj)->pvecy); 02038 FREE(pFEC_FEATURE (pobj)->pnoeud); 02039 FREE(pFEC_FEATURE (pobj)->pfun); 02040 FREE(pFEC_FEATURE (pobj)->zminmax); 02041 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 02042 sciDelHandle (pobj); 02043 FREE(pFEC_FEATURE(pobj)); 02044 FREE(pobj); 02045 return (sciPointObj *) NULL; 02046 } 02047 02048 if ((pfec->colout = MALLOC (2 * sizeof (integer))) == NULL) 02049 { 02050 FREE(pFEC_FEATURE (pobj)->pvecx); 02051 FREE(pFEC_FEATURE (pobj)->pvecy); 02052 FREE(pFEC_FEATURE (pobj)->pnoeud); 02053 FREE(pFEC_FEATURE (pobj)->pfun); 02054 FREE(pFEC_FEATURE (pobj)->zminmax); 02055 FREE(pFEC_FEATURE (pobj)->colminmax); 02056 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 02057 sciDelHandle (pobj); 02058 FREE(pFEC_FEATURE(pobj)); 02059 FREE(pobj); 02060 return (sciPointObj *) NULL; 02061 } 02062 02063 for (i = 0; i < Nnode; i++) 02064 { 02065 pfec->pvecx[i] = pvecx[i]; 02066 pfec->pvecy[i] = pvecy[i]; 02067 pfec->pfun[i] = pfun[i]; 02068 } 02069 for (i = 0; i < (5*Ntr); i++) 02070 { 02071 pfec->pnoeud[i] = pnoeud[i]; 02072 } 02073 for (i = 0; i < 2; i++) 02074 { 02075 pfec->zminmax[i] = zminmax[i]; 02076 pfec->colminmax[i] = colminmax[i]; 02077 pfec->colout[i] = colout[i]; 02078 } 02079 pfec->with_mesh = with_mesh; 02080 pfec->Nnode = Nnode; 02081 pfec->Ntr = Ntr; 02082 if (sciInitGraphicContext (pobj) == -1) 02083 { 02084 FREE(pFEC_FEATURE (pobj)->pvecx); 02085 FREE(pFEC_FEATURE (pobj)->pvecy); 02086 FREE(pFEC_FEATURE (pobj)->pnoeud); 02087 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 02088 sciDelHandle (pobj); 02089 FREE(pFEC_FEATURE(pobj)); 02090 FREE(pobj); 02091 return (sciPointObj *) NULL; 02092 } 02093 return pobj; 02094 } 02095 else 02096 { 02097 sciprint ("The parent has to be a SUBWIN \n"); 02098 return (sciPointObj *) NULL; 02099 } 02100 }
Here is the call graph for this function:

Here is the caller graph for this function:

| sciPointObj* ConstructFigure | ( | sciPointObj * | pparent, | |
| struct BCG * | XGC | |||
| ) |
ConstructFigure This function creates the parents window (manager) and the elementaries structures
Initialize the colormap
Definition at line 120 of file BuildObjects.c.
References sciFigure::allredraw, sciFigure::auto_redraw, C2F, BCG::CurWindow, dr(), sciFigure::figuredimheight, sciFigure::figuredimwidth, FREE, getFigureModel(), sciFigure::infoMessage, sciFigure::inrootposx, sciFigure::inrootposy, sciFigure::isiconified, sciFigure::isselected, L, BCG::mafigure, MALLOC, NULL, sciFigure::numsubwinselected, sciFigure::pcolormap, PD0, sciPointObj::pfeatures, pFIGURE_FEATURE, pfiguremdl, PI0, sciFigure::pixmap, sciFigure::pScilabXgc, sciFigure::rotstyle, SCI_FIGURE, sciDelHandle(), sciGetInfoMessage(), sciGetName(), sciGetNameLength(), sciGetNumColors(), sciGetResize(), sciInitFontContext(), sciInitGraphicContext(), sciInitGraphicMode(), sciInitNum(), sciInitNumColors(), sciInitResize(), sciInitScreenPosition(), sciSetColormap(), sciSetEntityType(), sciSetInfoMessage(), sciSetName(), sciStandrardBuildOperations(), sciFigure::visible, sciFigure::windowdimheight, sciFigure::windowdimwidth, sciFigure::wshow, and x.
Referenced by sciGetCurrentFigure(), and sciSwitchWindow().
00121 { 00122 00123 sciPointObj *pobj = (sciPointObj *) NULL; 00124 integer x[2], verbose=0, narg=0; 00125 int succeed = 0; 00126 sciPointObj * pfiguremdl = getFigureModel() ; 00127 sciFigure * ppFigure = NULL ; 00128 sciFigure * ppModel = pFIGURE_FEATURE(pfiguremdl) ; 00129 00130 /* memory allocation for the new Figure affectation du type allocation de la structure */ 00131 00132 if ((pobj = MALLOC ((sizeof (sciPointObj)))) == NULL) 00133 { 00134 return NULL; 00135 } 00136 sciSetEntityType (pobj, SCI_FIGURE); 00137 if ((pobj->pfeatures = MALLOC ((sizeof (sciFigure)))) == NULL) 00138 { 00139 FREE(pobj); 00140 return (sciPointObj *) NULL; 00141 } 00142 /* add a number in the HandelTable reallocation de la table + 1 puis affectation de l'indice */ 00143 00144 ppFigure = pFIGURE_FEATURE(pobj) ; 00145 00146 if ( sciStandrardBuildOperations( pobj, pparent ) == NULL ) 00147 { 00148 return NULL ; 00149 } 00150 00151 ppFigure->pScilabXgc = XGC; 00152 XGC->mafigure = pobj ; 00153 00154 /* initialisation de context et mode graphique par defaut (figure model)*/ 00155 if (sciInitGraphicContext (pobj) == -1) 00156 { 00157 sciDelHandle (pobj); 00158 FREE(pobj->pfeatures); 00159 FREE(pobj); 00160 return (sciPointObj *) NULL; 00161 } 00162 if (sciInitGraphicMode (pobj) == -1) 00163 { 00164 sciDelHandle (pobj); 00165 FREE(pobj->pfeatures); 00166 FREE(pobj); 00167 return (sciPointObj *) NULL; 00168 } 00169 00170 /* F.Leray 08.04.04 */ 00171 if (sciInitFontContext (pobj) == -1) 00172 { 00173 sciDelHandle (pobj); 00174 FREE(pobj->pfeatures); 00175 FREE(pobj); 00176 return (sciPointObj *) NULL; 00177 } 00178 sciInitNum (pobj, &(XGC->CurWindow)); 00179 sciSetName(pobj, sciGetName(pfiguremdl), sciGetNameLength(pfiguremdl)); 00180 sciInitResize((sciPointObj *) pobj,sciGetResize(pobj)); 00181 ppFigure->windowdimwidth=ppModel->windowdimwidth; 00182 ppFigure->windowdimheight=ppModel->windowdimheight; 00183 C2F(dr)("xset","wdim",&(ppFigure->windowdimwidth), 00184 &(ppFigure->windowdimheight),PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 00185 ppFigure->figuredimwidth = ppModel->figuredimwidth; 00186 ppFigure->figuredimheight = ppModel->figuredimheight; 00187 C2F(dr)("xset","wpdim",&(ppFigure->figuredimwidth), 00188 &(ppFigure->figuredimheight),PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L); 00189 C2F(dr)("xget","wpos",&verbose,x,&narg,PI0,PI0,PI0,PD0,PD0,PD0,PD0,4L,4L); 00190 x[0]=(ppModel->inrootposx <0)?x[0]:ppModel->inrootposx; 00191 x[1]=(ppModel->inrootposy <0)?x[1]:ppModel->inrootposy; 00192 x[0]=(ppModel->inrootposx <0)?x[0]:ppModel->inrootposx; 00193 x[1]=(ppModel->inrootposy <0)?x[1]:ppModel->inrootposy; 00194 sciInitScreenPosition(pobj,x[0],x[1]); 00195 ppFigure->isiconified = ppModel->isiconified; 00196 ppFigure->isselected = ppModel->isselected; 00197 ppFigure->rotstyle = ppModel->rotstyle; 00198 ppFigure->visible = ppModel->visible; 00199 ppFigure->auto_redraw = ppModel->auto_redraw; 00200 00201 ppFigure->numsubwinselected = ppModel->numsubwinselected; 00202 ppFigure->pixmap = ppModel->pixmap ; 00203 ppFigure->wshow = ppModel->wshow ; 00204 ppFigure->allredraw = ppModel->allredraw; 00205 00206 ppFigure->infoMessage = NULL ; /* needed otherwise it will be realloc */ 00207 sciSetInfoMessage( pobj, sciGetInfoMessage(pfiguremdl) ) ; 00208 00210 /* try to install the colormap in the graphic context */ 00211 00212 ppFigure->pcolormap = NULL ; 00213 sciInitNumColors(pobj, 0) ; 00214 00215 sciSetColormap( pobj, ppModel->pcolormap, sciGetNumColors(pfiguremdl), 3 ) ; 00216 00217 return pobj; 00218 }
Here is the call graph for this function:

Here is the caller graph for this function:

| sciPointObj* ConstructGrayplot | ( | sciPointObj * | pparentsubwin, | |
| double * | pvecx, | |||
| double * | pvecy, | |||
| double * | pvecz, | |||
| int | n1, | |||
| int | n2, | |||
| int | type | |||
| ) |
Definition at line 1684 of file BuildObjects.c.
References FREE, i, MALLOC, NULL, sciGrayplot::nx, sciGrayplot::ny, sciPointObj::pfeatures, pGRAYPLOT_FEATURE, sciGrayplot::pvecx, sciGrayplot::pvecy, sciGrayplot::pvecz, SCI_GRAYPLOT, SCI_SUBWIN, sciDelHandle(), sciDelThisToItsParent(), sciGetEntityType(), sciGetParent(), sciGetParentSubwin(), sciGetVisibility(), sciInitGraphicContext(), sciprint(), sciSetEntityType(), sciStandrardBuildOperations(), and TRUE.
Referenced by xgray(), xgray1(), and xgray2().
01686 { 01687 sciPointObj *pobj = (sciPointObj *) NULL; 01688 sciGrayplot *pgray = (sciGrayplot *) NULL; 01689 int i = 0,cmpt; 01690 01691 if (sciGetEntityType (pparentsubwin) == SCI_SUBWIN) 01692 { 01693 if ((pobj = MALLOC ((sizeof (sciPointObj)))) == NULL) 01694 return (sciPointObj *) NULL; 01695 sciSetEntityType (pobj, SCI_GRAYPLOT); 01696 if ((pobj->pfeatures = MALLOC ((sizeof (sciGrayplot)))) == NULL) 01697 { 01698 FREE(pobj); 01699 return (sciPointObj *) NULL; 01700 } 01701 if ( sciStandrardBuildOperations( pobj, pparentsubwin ) == NULL ) 01702 { 01703 return NULL ; 01704 } 01705 01706 pGRAYPLOT_FEATURE (pobj)->callback = (char *)NULL; 01707 pGRAYPLOT_FEATURE (pobj)->callbacklen = 0; 01708 pGRAYPLOT_FEATURE (pobj)->callbackevent = 100; 01709 01710 pGRAYPLOT_FEATURE (pobj)->isselected = TRUE; 01711 pGRAYPLOT_FEATURE (pobj)->visible = sciGetVisibility(sciGetParentSubwin(pobj)); 01712 01713 pGRAYPLOT_FEATURE (pobj)->type = type; 01714 pGRAYPLOT_FEATURE (pobj)->pvecx = (double *)NULL; 01715 pGRAYPLOT_FEATURE (pobj)->pvecy = (double *)NULL; 01716 01717 strcpy( pGRAYPLOT_FEATURE (pobj)->datamapping, "scaled" ) ; 01718 pgray = pGRAYPLOT_FEATURE (pobj); 01719 01720 if (pvecx && (pgray->pvecx = MALLOC (n1 * sizeof (double))) == NULL) 01721 { 01722 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 01723 sciDelHandle (pobj); 01724 FREE(pGRAYPLOT_FEATURE(pobj)); 01725 FREE(pobj); 01726 return (sciPointObj *) NULL; 01727 } 01728 cmpt = (type == 2)? 4:n2 ; 01729 if (type != 2) 01730 if (pvecy && (pgray->pvecy = MALLOC (cmpt * sizeof (double))) == NULL) 01731 { 01732 if (pvecx) FREE(pGRAYPLOT_FEATURE (pobj)->pvecx); 01733 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 01734 sciDelHandle (pobj); 01735 FREE(pGRAYPLOT_FEATURE(pobj)); 01736 FREE(pobj); 01737 return (sciPointObj *) NULL; 01738 } 01739 if ((pgray->pvecz = MALLOC ((n1*n2) * sizeof (double))) == NULL){ 01740 if (pvecx) FREE(pGRAYPLOT_FEATURE (pobj)->pvecx); 01741 if (pvecy) FREE(pGRAYPLOT_FEATURE (pobj)->pvecy); 01742 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 01743 sciDelHandle (pobj); 01744 FREE(pGRAYPLOT_FEATURE(pobj)); 01745 FREE(pobj); 01746 return (sciPointObj *) NULL; 01747 } 01748 if (pvecx) { 01749 for (i = 0; i < n1; i++) pgray->pvecx[i] = pvecx[i]; 01750 } 01751 01752 01753 if (pvecy) { 01754 if (type != 2) 01755 for (i = 0; i < n2; i++) pgray->pvecy[i] = pvecy[i]; 01756 } 01757 01758 pgray->nx = n1;pgray->ny = n2; 01759 for (i = 0; i < (n1*n2); i++) pgray->pvecz[i] = pvecz[i]; 01760 01761 if (sciInitGraphicContext (pobj) == -1) 01762 { 01763 if (pvecx) FREE(pGRAYPLOT_FEATURE (pobj)->pvecx); 01764 if (pvecy) FREE(pGRAYPLOT_FEATURE (pobj)->pvecy); 01765 FREE(pGRAYPLOT_FEATURE (pobj)->pvecz); 01766 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 01767 sciDelHandle (pobj); 01768 FREE(pGRAYPLOT_FEATURE(pobj)); 01769 FREE(pobj); 01770 return (sciPointObj *) NULL; 01771 } 01772 return pobj; 01773 } 01774 else 01775 { 01776 sciprint ("The parent has to be a SUBWIN \n"); 01777 return (sciPointObj *) NULL; 01778 } 01779 }
Here is the call graph for this function:

Here is the caller graph for this function:

| sciPointObj* ConstructLabel | ( | sciPointObj * | pparentsubwin, | |
| char * | text, | |||
| int | type | |||
| ) |
ConstructLabel This function creates Label structure used for x,y,z labels and for the Title.
| sciPointObj | *pparentsubwin | |
| char | text[] : intial text string. | |
| int | type to get info. on the type of label |
Definition at line 2452 of file BuildObjects.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, SCI_SUBWIN, sciAddNewHandle(), sciAddThisToItsParent(), sciDelHandle(), sciGetEntityType(), sciInitFontContext(), sciInitIs3d(), sciInitIsFilled(), sciInitSelectedSons(), sciprint(), sciSetEntityType(), sciLabel::text, and TRUE.
Referenced by ConstructSubWin().
02453 { 02454 sciPointObj * pobj = NULL; 02455 /* get a pointer on the feature */ 02456 sciLabel * ppLabel ; 02457 char * emptyString = "" ; 02458 int defaultColor = 0 ; 02459 02460 if (sciGetEntityType (pparentsubwin) == SCI_SUBWIN) 02461 { 02462 if ((pobj = MALLOC (sizeof (sciPointObj))) == NULL) 02463 { 02464 return (sciPointObj *) NULL; 02465 } 02466 02467 sciSetEntityType (pobj, SCI_LABEL); 02468 if ((pobj->pfeatures = MALLOC ((sizeof (sciLabel)))) == NULL) 02469 { 02470 FREE(pobj); 02471 return (sciPointObj *) NULL; 02472 } 02473 02474 ppLabel = pLABEL_FEATURE( pobj ) ; 02475 02476 ppLabel->text = allocateText( pparentsubwin, &emptyString, 1, 1, 02477 0.0, 0.0, TRUE, NULL, FALSE, &defaultColor, &defaultColor, 02478 FALSE, FALSE, FALSE, ALIGN_LEFT ) ; 02479 02480 if ( ppLabel->text == NULL ) 02481 { 02482 FREE(ppLabel); 02483 FREE(pobj); 02484 return NULL ; 02485 } 02486 02487 if (sciAddNewHandle (pobj) == -1) 02488 { 02489 deallocateText( ppLabel->text ) ; 02490 FREE(ppLabel); 02491 FREE(pobj); 02492 return NULL; 02493 } 02494 02495 if (!(sciAddThisToItsParent (pobj, pparentsubwin))) 02496 { 02497 deallocateText( ppLabel->text ) ; 02498 sciDelHandle (pobj); 02499 FREE(ppLabel); 02500 FREE(pobj); 02501 return NULL; 02502 } 02503 02504 sciInitSelectedSons(pobj); 02505 sciInitIsFilled(pobj,FALSE); /* by default a simple text is display (if existing) */ 02506 02507 sciInitIs3d( pobj, FALSE ) ; /* the text of labels is displayed using 2d scale */ 02508 02509 ppLabel->ptype = type; 02510 ppLabel->auto_position = TRUE; 02511 ppLabel->auto_rotation = TRUE; 02512 02513 ppLabel->isselected = TRUE; 02514 if (sciInitFontContext (pobj) == -1) 02515 { 02516 DestroyLabel( pobj ) ; 02517 return (sciPointObj *) NULL; 02518 } 02519 02520 return (sciPointObj *) pobj; 02521 } 02522 else 02523 { 02524 sciprint ("The parent has to be a SUBWIN \n"); 02525 return (sciPointObj *) NULL; 02526 } 02527 }
Here is the call graph for this function:

Here is the caller graph for this function:

| sciPointObj* ConstructLegend | ( | sciPointObj * | pparentsubwin, | |
| char | text[], | |||
| int | n, | |||
| int | nblegends, | |||
| int * | pstyle, | |||
| sciPointObj ** | pptabofpointobj | |||
| ) |
constructLegend This function creates Legend structure
Definition at line 869 of file BuildObjects.c.
References sciText::callback, sciText::callbackevent, sciText::callbacklen, deleteMatrix(), DestroyLegend(), FALSE, sciText::fontcontext, FREE, sciLegend::height, i, sciText::isboxed, sciText::isline, sciLegend::isselected, sciLegend::issurround, MALLOC, sciLegend::nblegends, newFullStringMatrix(), NULL, sciPointObj::pfeatures, sciLegend::place, sciRelationShip::plastsons, pLEGEND_FEATURE, tagSons::pnext, tagSons::pointobj, sciLegend::pos, sciLegend::pptabofpointobj, sciRelationShip::psons, sciText::pStrings, sciLegend::pstyle, sciText::relationship, SCI_LEGEND, SCI_LEGEND_IN_INSIDE, SCI_SUBWIN, sciDelHandle(), sciDelThisToItsParent(), sciGetEntityType(), sciGetParent(), sciGetParentSubwin(), sciGetSons(), sciGetVisibility(), sciInitFontContext(), sciInitGraphicContext(), sciprint(), sciSetEntityType(), sciStandrardBuildOperations(), sciLegend::text, sciFont::textorientation, TRUE, sciLegend::visible, sciLegend::width, tagPOINT2D::x, and tagPOINT2D::y.
Referenced by fec(), and plot2dn().
00871 { 00872 sciPointObj * pobj = (sciPointObj *) NULL; 00873 sciLegend * ppLegend ; 00874 00875 /* 00876 * verifier qu'il n'y a pas d'objet existant !!!! 00877 * si oui alors le detruire puis le reconstruire. 00878 * car il ne peut y avoir qu'une legende 00879 */ 00880 sciSons *psonstmp; 00881 int i=0; 00882 00883 psonstmp = sciGetSons (pparentsubwin); 00884 /* init */ 00885 if (psonstmp != (sciSons *) NULL) /* on peut commencer sur le next */ 00886 /* tant que le fils n'est pas une legende */ 00887 while ((psonstmp->pnext != (sciSons *) NULL) 00888 && sciGetEntityType (psonstmp->pointobj) != SCI_LEGEND) 00889 psonstmp = psonstmp->pnext; 00890 00891 if (sciGetEntityType (psonstmp->pointobj) == SCI_LEGEND) 00892 DestroyLegend (psonstmp->pointobj); 00893 00894 if (sciGetEntityType (pparentsubwin) == SCI_SUBWIN) 00895 { 00896 if ((pobj = MALLOC ((sizeof (sciPointObj)))) == NULL) 00897 return (sciPointObj *) NULL; 00898 sciSetEntityType (pobj, SCI_LEGEND); 00899 if ((pobj->pfeatures = MALLOC ((sizeof (sciLegend)))) == NULL) 00900 { 00901 FREE(pobj); 00902 return (sciPointObj *) NULL; 00903 } 00904 /* get the pointer on the features */ 00905 ppLegend = pLEGEND_FEATURE( pobj ); 00906 00907 if ( sciStandrardBuildOperations( pobj, pparentsubwin ) == NULL ) 00908 { 00909 return NULL ; 00910 } 00911 00912 ppLegend->text.relationship.psons = (sciSons *) NULL; 00913 ppLegend->text.relationship.plastsons = (sciSons *) NULL; 00914 ppLegend->text.callback = (char *)NULL; 00915 ppLegend->text.callbacklen = 0; 00916 ppLegend->text.callbackevent = 100; 00917 ppLegend->text.isboxed = FALSE ; 00918 ppLegend->text.isline = TRUE ; 00919 00920 ppLegend->visible = sciGetVisibility(sciGetParentSubwin(pobj)); 00921 00922 ppLegend->text.pStrings = newFullStringMatrix( &text, 1, 1 ) ; 00923 00924 /* Allocation de la structure sciText */ 00925 if ( ppLegend->text.pStrings == NULL) 00926 { 00927 sciprint("\nNo more place to allocates text string, try a shorter string\n"); 00928 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 00929 sciDelHandle (pobj); 00930 FREE(ppLegend); 00931 FREE(pobj); 00932 return (sciPointObj *) NULL; 00933 } 00934 /* on copie le texte du titre dans le champs specifique de l'objet */ 00935 ppLegend->nblegends = nblegends; 00936 00937 if ((ppLegend->pptabofpointobj = 00938 MALLOC(nblegends*sizeof(sciPointObj*))) == NULL) 00939 { 00940 sciprint("No more memory for legend\n"); 00941 deleteMatrix( ppLegend->text.pStrings ) ; 00942 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 00943 sciDelHandle (pobj); 00944 FREE(ppLegend); 00945 FREE(pobj); 00946 return (sciPointObj *) NULL; 00947 } 00948 00949 if ((ppLegend->pstyle = MALLOC(nblegends*sizeof(int))) != NULL) 00950 { 00951 for (i=0; i < nblegends; i++) 00952 { 00953 ppLegend->pstyle[i] = pstyle[i]; 00954 ppLegend->pptabofpointobj[i] = pptabofpointobj[i]; 00955 } 00956 } 00957 else 00958 { 00959 sciprint("\nNo more place to allocates style\n"); 00960 FREE(ppLegend->pptabofpointobj); 00961 deleteMatrix( ppLegend->text.pStrings ) ; 00962 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 00963 sciDelHandle (pobj); 00964 FREE(ppLegend); 00965 FREE(pobj); 00966 return (sciPointObj *) NULL; 00967 } 00968 00969 00970 00971 ppLegend->text.fontcontext.textorientation = 0; 00972 ppLegend->pos.x = 0; 00973 ppLegend->pos.y = 0; 00974 ppLegend->width = 0; 00975 ppLegend->height = 0; 00976 ppLegend->place = SCI_LEGEND_IN_INSIDE; 00977 ppLegend->isselected = TRUE; 00978 ppLegend->issurround = FALSE; 00979 00980 if (sciInitGraphicContext (pobj) == -1) /* NEW : used to draw the line and marks of the curve F.Leray 21.01.05 */ 00981 { 00982 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 00983 sciDelHandle (pobj); 00984 FREE(pobj->pfeatures); 00985 FREE(pobj); 00986 return (sciPointObj *) NULL; 00987 } 00988 00989 if (sciInitFontContext (pobj) == -1) 00990 { 00991 sciprint("Problem with sciInitFontContext\n"); 00992 FREE(ppLegend->pptabofpointobj); 00993 deleteMatrix( ppLegend->text.pStrings ) ; 00994 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 00995 sciDelHandle (pobj); 00996 FREE(ppLegend); 00997 FREE(pobj); 00998 return (sciPointObj *) NULL; 00999 } 01000 01001 return pobj; 01002 } 01003 else 01004 { 01005 sciprint ("The parent has to be a SUBWIN \n"); 01006 return (sciPointObj *) NULL; 01007 } 01008 }
Here is the call graph for this function:

Here is the caller graph for this function:

| sciPointObj* ConstructMenu | ( | sciPointObj * | pparentfigure, | |
| char | plabel[], | |||
| int | n | |||
| ) |
ConstructMenu This function creates Menu structure
Definition at line 2534 of file BuildObjects.c.
References FREE, MALLOC, NULL, sciPointObj::pfeatures, pMENU_FEATURE, SCI_FIGURE, SCI_MENU, sciAddLabelMenu(), sciDelHandle(), sciDelLabelsMenu(), sciDelThisToItsParent(), sciGetEntityType(), sciGetParent(), sciInitFontContext(), sciInitGraphicContext(), sciprint(), sciSetEntityType(), and sciStandrardBuildOperations().
02535 { 02536 sciPointObj *pobj = (sciPointObj *) NULL; 02537 02538 if (sciGetEntityType (pparentfigure) == SCI_FIGURE) 02539 { 02540 if ((pobj = MALLOC ((sizeof (sciPointObj)))) == NULL) 02541 return (sciPointObj *) NULL; 02542 sciSetEntityType (pobj, SCI_MENU); 02543 if ((pobj->pfeatures = MALLOC ((sizeof (sciMenu)))) == NULL) 02544 { 02545 FREE(pobj); 02546 return (sciPointObj *) NULL; 02547 } 02548 02549 if ( sciStandrardBuildOperations( pobj, pparentfigure ) == NULL ) 02550 { 02551 return NULL ; 02552 } 02553 02554 if (sciAddLabelMenu (pobj, plabel, n) == -1) 02555 { 02556 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 02557 sciDelHandle (pobj); 02558 FREE(pMENU_FEATURE (pobj)); 02559 FREE(pobj); 02560 return (sciPointObj *) NULL; 02561 } 02562 02563 if (sciInitGraphicContext (pobj) == -1) 02564 { 02565 sciDelLabelsMenu (pobj); 02566 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 02567 sciDelHandle (pobj); 02568 FREE(pMENU_FEATURE (pobj)); 02569 FREE(pobj); 02570 return (sciPointObj *) NULL; 02571 } 02572 sciInitFontContext (pobj); 02573 02574 return (sciPointObj *) pobj; 02575 } 02576 else 02577 { 02578 sciprint ("The parent has to be a SUBWIN \n"); 02579 return (sciPointObj *) NULL; 02580 } 02581 }
Here is the call graph for this function:

| sciPointObj* ConstructMenuContext | ( | sciPointObj * | pparentfigure | ) |
ConstructMenuContext This function creates MenuContext structure only for tests on Widows system during developpement. ths function may be not incuded in the final version pour obtenir un menu de contexe vide pour chacune des entites. L'utilisateur specifie avec un addlabel les label et callback necessaire ensuite.
| sciPointObj | * pparentfigure: the parent entity |
Definition at line 2591 of file BuildObjects.c.
References FREE, MALLOC, NULL, sciPointObj::pfeatures, pMENUCONTEXT_FEATURE, SCI_FIGURE, SCI_MENUCONTEXT, sciDelHandle(), sciDelThisToItsParent(), sciGetEntityType(), sciGetParent(), sciInitFontContext(), sciInitGraphicContext(), sciprint(), sciSetEntityType(), and sciStandrardBuildOperations().
02592 { 02593 sciPointObj *pobj = (sciPointObj *) NULL; 02594 02595 if (sciGetEntityType (pparentfigure) == SCI_FIGURE) 02596 { 02597 if ((pobj = MALLOC ((sizeof (sciPointObj)))) == NULL) 02598 return (sciPointObj *) NULL; 02599 sciSetEntityType (pobj, SCI_MENUCONTEXT); 02600 if ((pobj->pfeatures = MALLOC ((sizeof (sciMenuContext)))) == NULL) 02601 { 02602 FREE(pobj); 02603 return (sciPointObj *) NULL; 02604 } 02605 if ( sciStandrardBuildOperations( pobj, pparentfigure ) == NULL ) 02606 { 02607 return NULL ; 02608 } 02609 02610 if (sciInitGraphicContext (pobj) == -1) 02611 { 02612 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 02613 sciDelHandle (pobj); 02614 FREE(pMENUCONTEXT_FEATURE (pobj)); 02615 FREE(pobj); 02616 return (sciPointObj *) NULL; 02617 } 02618 sciInitFontContext (pobj); 02619 02620 /* windows dependant*/ 02621 /* if ((pMENUCONTEXT_FEATURE(pobj)->hPopMenu = CreatePopupMenu ()) == NULL) 02622 { 02623 sciprint ("Scilab can't have more menu \n"); 02624 FREE ((sciGetFontContext(pobj))->pfontname); 02625 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 02626 sciDelHandle (pobj); 02627 FREE(pMENUCONTEXT_FEATURE (pobj)); 02628 FREE(pobj); 02629 return (sciPointObj *) NULL; 02630 } 02631 AppendMenu (pMENUCONTEXT_FEATURE(pobj)->hPopMenu, MF_SEPARATOR , 0, NULL);*/ 02632 /*AppendMenu (sciGethPopMenu (pobj), MF_STRING, 4401, plabel);*/ 02633 02634 return (sciPointObj *) pobj; 02635 } 02636 else 02637 { 02638 sciprint ("The parent has to be a SUBWIN \n"); 02639 return (sciPointObj *) NULL; 02640 } 02641 }
Here is the call graph for this function:

| sciPointObj* ConstructMerge | ( | sciPointObj * | pparentsubwin, | |
| int | N, | |||
| int * | index_in_entity, | |||
| long * | from_entity | |||
| ) |
Definition at line 1649 of file BuildObjects.c.
References FREE, MALLOC, NULL, sciPointObj::pfeatures, pMERGE_FEATURE, SCI_MERGE, SCI_SUBWIN, sciGetEntityType(), sciSetEntityType(), and sciStandrardBuildOperations().
Referenced by Merge3d().
01650 { 01651 sciPointObj *pobj = (sciPointObj *) NULL; 01652 01653 if (sciGetEntityType (pparentsubwin) == SCI_SUBWIN) 01654 { 01655 if ((pobj = MALLOC ((sizeof (sciPointObj)))) == NULL) return (sciPointObj *) NULL; 01656 01657 sciSetEntityType (pobj, SCI_MERGE); 01658 if ((pobj->pfeatures = MALLOC ((sizeof (sciMerge)))) == NULL) { 01659 FREE(pobj); 01660 return (sciPointObj *) NULL; 01661 } 01662 if ( sciStandrardBuildOperations( pobj, pparentsubwin ) == NULL ) 01663 { 01664 return NULL ; 01665 } 01666 pMERGE_FEATURE (pobj)->index_in_entity=index_in_entity; 01667 pMERGE_FEATURE (pobj)->from_entity=from_entity; 01668 pMERGE_FEATURE (pobj)->N=N; 01669 return pobj; 01670 } 01671 else 01672 { 01673 return NULL; 01674 } 01675 }
Here is the call graph for this function:

Here is the caller graph for this function:

| sciPointObj* ConstructPolyline | ( | sciPointObj * | pparentsubwin, | |
| double * | pvecx, | |||
| double * | pvecy, | |||
| double * | pvecz, | |||
| int | closed, | |||
| int | n1, | |||
| int | n2, | |||
| int | plot, | |||
| int * | foreground, | |||
| int * | background, | |||
| int * | mark_style, | |||
| int * | mark_foreground, | |||
| int * | mark_background, | |||
| BOOL | isline, | |||
| BOOL | isfilled, | |||
| BOOL | ismark, | |||
| BOOL | isinterpshaded | |||
| ) |
ConstructPolyline This function creates Polyline 2d structure
DJ.Abdemouche 2003
Definition at line 1016 of file BuildObjects.c.
References sciPolyline::closed, sciPolyline::dim_icv, FREE, i, sciPolyline::isinterpshaded, MALLOC, sciPolyline::n1, sciPolyline::n2, NULL, sciPointObj::pfeatures, sciPolyline::plot, pPOLYLINE_FEATURE, sciPolyline::pvx, sciPolyline::pvy, sciPolyline::pvz, SCI_POLYLINE, SCI_SUBWIN, sciDelHandle(), sciDelThisToItsParent(), sciGetClipping(), sciGetEntityType(), sciGetIsClipping(), sciGetParent(), sciGetParentSubwin(), sciGetVisibility(), sciInitBackground(), sciInitForeground(), sciInitGraphicContext(), sciInitIsClipping(), sciInitIsFilled(), sciInitIsLine(), sciInitIsMark(), sciInitMarkBackground(), sciInitMarkForeground(), sciInitMarkStyle(), sciprint(), sciSetClipping(), sciSetEntityType(), sciSetInterpVector(), sciStandrardBuildOperations(), sciPolyline::scvector, and TRUE.
Referenced by ClonePolyline(), Objfpoly(), Objplot3d(), Objpoly(), and plot2dn().
01020 { 01021 sciPointObj *pobj = (sciPointObj *) NULL; 01022 sciPolyline *ppoly = (sciPolyline *) NULL; 01023 int i = 0; 01024 01025 if (sciGetEntityType (pparentsubwin) == SCI_SUBWIN) 01026 { 01027 if ((pobj = MALLOC ((sizeof (sciPointObj)))) == NULL) 01028 return (sciPointObj *) NULL; 01029 sciSetEntityType (pobj, SCI_POLYLINE); 01030 if ((pobj->pfeatures = MALLOC ((sizeof (sciPolyline)))) == NULL) 01031 { 01032 FREE(pobj); 01033 return (sciPointObj *) NULL; 01034 } 01035 if ( sciStandrardBuildOperations( pobj, pparentsubwin ) == NULL ) 01036 { 01037 return NULL ; 01038 } 01039 pPOLYLINE_FEATURE (pobj)->x_shift = (double *) NULL; 01040 pPOLYLINE_FEATURE (pobj)->y_shift = (double *) NULL; 01041 pPOLYLINE_FEATURE (pobj)->z_shift = (double *) NULL; 01042 pPOLYLINE_FEATURE (pobj)->bar_width = 0.; 01043 01044 pPOLYLINE_FEATURE (pobj)->callback = (char *)NULL; 01045 pPOLYLINE_FEATURE (pobj)->callbacklen = 0; 01046 pPOLYLINE_FEATURE (pobj)->callbackevent = 100; 01047 pPOLYLINE_FEATURE (pobj)->visible = sciGetVisibility(sciGetParentSubwin(pobj)); 01048 01049 pPOLYLINE_FEATURE (pobj)->clip_region_set = 0; 01050 sciInitIsClipping( pobj, sciGetIsClipping((sciPointObj *) sciGetParentSubwin(pobj)) ) ; 01051 sciSetClipping(pobj,sciGetClipping(sciGetParentSubwin(pobj))); 01052 01053 01054 pPOLYLINE_FEATURE (pobj)->arsize_factor = 1; 01055 01056 pPOLYLINE_FEATURE (pobj)->isselected = TRUE; 01057 ppoly = pPOLYLINE_FEATURE (pobj); 01058 01059 if ( n1 != 0 ) 01060 { 01061 if ((ppoly->pvx = MALLOC (n1 * sizeof (double))) == NULL) 01062 { 01063 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 01064 sciDelHandle (pobj); 01065 FREE(pPOLYLINE_FEATURE(pobj)); 01066 FREE(pobj); 01067 return (sciPointObj *) NULL; 01068 } 01069 01070 if ((ppoly->pvy = MALLOC (n1 * sizeof (double))) == NULL) 01071 { 01072 FREE(pPOLYLINE_FEATURE (pobj)->pvx); 01073 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 01074 sciDelHandle (pobj); 01075 FREE(pPOLYLINE_FEATURE(pobj)); 01076 FREE(pobj); 01077 return (sciPointObj *) NULL; 01078 } 01079 01080 if ((pvecx != (double *)NULL)&&(pvecy != (double *)NULL)) 01081 { 01082 for (i = 0; i < n1; i++) 01083 { 01084 ppoly->pvx[i] = pvecx[i] ; 01085 ppoly->pvy[i] = pvecy[i] ; 01086 } 01087 } 01088 else 01089 { 01090 for (i = 0; i < n1; i++) 01091 { 01092 ppoly->pvx[i] = 0.0; 01093 ppoly->pvy[i] = 0.0; 01094 } 01095 } 01096 01097 01099 if (pvecz == (double *) NULL) 01100 { 01101 pPOLYLINE_FEATURE (pobj)->pvz=NULL; 01102 } 01103 else 01104 { 01105 if ((ppoly->pvz = MALLOC (n1 * sizeof (double))) == NULL) 01106 { 01107 FREE(pPOLYLINE_FEATURE (pobj)->pvx); 01108 FREE(pPOLYLINE_FEATURE (pobj)->pvy); 01109 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 01110 sciDelHandle (pobj); 01111 FREE(pPOLYLINE_FEATURE(pobj)); 01112 FREE(pobj); 01113 return (sciPointObj *) NULL; 01114 } 01115 for (i = 0; i < n1; i++) 01116 { 01117 ppoly->pvz[i] = pvecz[i]; 01118 } 01119 } 01120 } 01121 else 01122 { 01123 ppoly->pvx = NULL ; 01124 ppoly->pvy = NULL ; 01125 ppoly->pvz = NULL ; 01126 } 01127 01128 ppoly->n1 = n1; /* memorisation du nombre de points */ 01129 ppoly->n2 = n2; /* memorisation du nombre des courbes */ 01130 ppoly->closed = (closed > 0) ? 1 : 0; 01131 ppoly->plot = plot; 01132 01133 if (sciInitGraphicContext (pobj) == -1) 01134 { 01135 FREE(pPOLYLINE_FEATURE (pobj)->pvy); 01136 FREE(pPOLYLINE_FEATURE (pobj)->pvx); 01137 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 01138 sciDelHandle (pobj); 01139 FREE(pPOLYLINE_FEATURE(pobj)); 01140 FREE(pobj); 01141 return (sciPointObj *) NULL; 01142 } 01143 01144 /* colors and marks setting */ 01145 sciInitIsMark(pobj,ismark); 01146 sciInitIsLine(pobj,isline); 01147 sciInitIsFilled(pobj,isfilled); 01148 /* sciSetIsInterpShaded(pobj,isinterpshaded); */ 01149 01150 ppoly->isinterpshaded = isinterpshaded; /* set the isinterpshaded mode */ 01151 01152 if(foreground != NULL) 01153 sciInitForeground(pobj,(*foreground)); 01154 01155 ppoly->scvector = (int *) NULL; 01156 01157 ppoly->dim_icv = n1; 01158 01159 if(background != NULL){ 01160 if(isinterpshaded == TRUE){ /* 3 or 4 values to store */ 01161 01162 sciSetInterpVector(pobj,n1,background); 01163 } 01164 else 01165 sciInitBackground(pobj,(*background)); 01166 } 01167 01168 if(mark_style != NULL) 01169 sciInitMarkStyle(pobj,(*mark_style)); 01170 01171 if(mark_foreground != NULL) 01172 sciInitMarkForeground(pobj,(*mark_foreground)); 01173 01174 if(mark_background != NULL) 01175 sciInitMarkBackground(pobj,(*mark_background)); 01176 01177 return pobj; 01178 } 01179 else 01180 { 01181 sciprint ("The parent has to be a SUBWIN \n"); 01182 return (sciPointObj *) NULL; 01183 } 01184 }
Here is the call graph for this function:

Here is the caller graph for this function:

| sciPointObj* ConstructRectangle | ( | sciPointObj * | pparentsubwin, | |
| double | x, | |||
| double | y, | |||
| double | height, | |||
| double | width, | |||
| double | horzcurvature, | |||
| double | vertcurvature, | |||
| int * | foreground, | |||
| int * | background, | |||
| int | isfilled, | |||
| int | isline, | |||
| int | str, | |||
| BOOL | flagstring | |||
| ) |
ConstructRectangle This function creates Rectangle structure and only this to destroy all sons use DelGraphicsSon
Definition at line 1278 of file BuildObjects.c.
References FREE, MALLOC, NULL, sciPointObj::pfeatures, pRECTANGLE_FEATURE, SCI_RECTANGLE, SCI_SUBWIN, sciDelHandle(), sciDelThisToItsParent(), sciGetClipping(), sciGetEntityType(), sciGetIsClipping(), sciGetParent(), sciGetParentSubwin(), sciGetVisibility(), sciInitBackground(), sciInitForeground(), sciInitGraphicContext(), sciInitIsClipping(), sciInitIsFilled(), sciInitIsLine(), sciprint(), sciSetClipping(), sciSetEntityType(), sciStandrardBuildOperations(), and TRUE.
Referenced by CloneRectangle(), and Objrect().
01282 { 01283 sciPointObj *pobj = (sciPointObj *) NULL; 01284 01285 if ( height < 0.0 || width < 0.0 ) 01286 { 01287 Scierror(999,"Width and height must be positive.\n"); 01288 return NULL ; 01289 } 01290 01291 if (sciGetEntityType (pparentsubwin) == SCI_SUBWIN) 01292 { 01293 if ((pobj = MALLOC ((sizeof (sciPointObj)))) == NULL) 01294 return (sciPointObj *) NULL; 01295 sciSetEntityType (pobj, SCI_RECTANGLE); 01296 if ((pobj->pfeatures = MALLOC ((sizeof (sciRectangle)))) == NULL) 01297 { 01298 FREE(pobj); 01299 return (sciPointObj *) NULL; 01300 } 01301 if ( sciStandrardBuildOperations( pobj, pparentsubwin ) == NULL ) 01302 { 01303 return NULL ; 01304 } 01305 01306 pRECTANGLE_FEATURE (pobj)->callback = (char *)NULL; 01307 pRECTANGLE_FEATURE (pobj)->callbacklen = 0; 01308 pRECTANGLE_FEATURE (pobj)->callbackevent = 100; 01309 01310 01311 pRECTANGLE_FEATURE (pobj)->flagstring = flagstring; 01312 pRECTANGLE_FEATURE (pobj)->x = x; 01313 pRECTANGLE_FEATURE (pobj)->y = y; 01314 pRECTANGLE_FEATURE (pobj)->z = 0; 01315 pRECTANGLE_FEATURE (pobj)->height = height; 01316 pRECTANGLE_FEATURE (pobj)->width = width; 01317 pRECTANGLE_FEATURE (pobj)->str = str; 01318 pRECTANGLE_FEATURE (pobj)->strheight = 0; 01319 pRECTANGLE_FEATURE (pobj)->strwidth = 0; 01320 pRECTANGLE_FEATURE (pobj)->horzcurvature = horzcurvature; 01321 pRECTANGLE_FEATURE (pobj)->vertcurvature = vertcurvature; 01322 pRECTANGLE_FEATURE (pobj)->isselected = TRUE; 01323 pRECTANGLE_FEATURE (pobj)->visible = sciGetVisibility(sciGetParentSubwin(pobj)); 01324 01325 pRECTANGLE_FEATURE (pobj)->clip_region_set = 0; 01326 /*pRECTANGLE_FEATURE (pobj)->isclip = sciGetIsClipping((sciPointObj *) sciGetParentSubwin(pobj)); */ 01327 sciInitIsClipping( pobj, sciGetIsClipping((sciPointObj *) sciGetParentSubwin(pobj)) ) ; 01328 sciSetClipping(pobj,sciGetClipping(sciGetParentSubwin(pobj))); 01329 01330 /* pRECTANGLE_FEATURE (pobj)->clip_region = (double *) NULL; */ 01331 01332 if (sciInitGraphicContext (pobj) == -1) 01333 { 01334 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 01335 sciDelHandle (pobj); 01336 FREE(pRECTANGLE_FEATURE (pobj)); 01337 FREE(pobj); 01338 return (sciPointObj *) NULL; 01339 } 01340 01341 sciInitIsLine(pobj,isline); 01342 sciInitIsFilled(pobj,isfilled); 01343 01344 if(foreground != NULL) 01345 sciInitForeground(pobj,(*foreground)); 01346 01347 if(background != NULL) 01348 sciInitBackground(pobj,(*background)); 01349 01350 return pobj; 01351 } 01352 else 01353 { 01354 sciprint ("The parent has to be a SUBWIN \n"); 01355 return (sciPointObj *) NULL; 01356 } 01357 }
Here is the call graph for this function:

Here is the caller graph for this function:

| sciPointObj* ConstructScrollH | ( | sciPointObj * | pparentfigure | ) |
ConstructScrollH This function creates horizontal scroll bar
Definition at line 589 of file BuildObjects.c.
References FREE, MALLOC, NULL, sciPointObj::pfeatures, SCI_FIGURE, SCI_SBH, sciGetEntityType(), sciprint(), sciSetEntityType(), and sciStandrardBuildOperations().
00590 { 00591 sciPointObj *pobjsbh = (sciPointObj *) NULL; 00592 00593 if (sciGetEntityType (pparentfigure) == SCI_FIGURE) 00594 { 00595 /* definition of scrollbars with original code */ 00596 /* definition of the horizontal scroll bar in the new struct */ 00597 if ((pobjsbh = MALLOC ((sizeof (sciPointObj)))) == NULL) 00598 return NULL; 00599 sciSetEntityType (pobjsbh, SCI_SBH); 00600 if ((pobjsbh->pfeatures = MALLOC ((sizeof (sciScrollBarHorz)))) == NULL) 00601 { 00602 FREE(pobjsbh); 00603 return (sciPointObj *) NULL; 00604 } 00605 if ( sciStandrardBuildOperations( pobjsbh, pparentfigure ) == NULL ) 00606 { 00607 return NULL ; 00608 } 00609 return pobjsbh; 00610 } 00611 else 00612 { 00613 sciprint ("The parent has to be a FIGURE \n"); 00614 return (sciPointObj *) NULL; 00615 } 00616 }
Here is the call graph for this function:

| sciPointObj* ConstructScrollV | ( | sciPointObj * | pparentfigure | ) |
ConstructScrollV This function creates the scroll bar erticall
Definition at line 554 of file BuildObjects.c.
References FREE, MALLOC, NULL, sciPointObj::pfeatures, SCI_FIGURE, SCI_SBV, sciGetEntityType(), sciprint(), sciSetEntityType(), and sciStandrardBuildOperations().
00555 { 00556 sciPointObj *pobjsbv = (sciPointObj *) NULL; 00557 00558 if (sciGetEntityType (pparentfigure) == SCI_FIGURE) 00559 { 00560 /* definition of scrollbars with original code */ 00561 /* definition of the vertical scroll bar in the new struct */ 00562 if ((pobjsbv = MALLOC ((sizeof (sciPointObj)))) == NULL) 00563 return NULL; 00564 sciSetEntityType (pobjsbv, SCI_SBV); 00565 if ((pobjsbv->pfeatures = MALLOC ((sizeof (sciScrollBarVert)))) == NULL) 00566 { 00567 FREE(pobjsbv); 00568 return (sciPointObj *) NULL; 00569 } 00570 if ( sciStandrardBuildOperations( pobjsbv, pparentfigure ) == NULL ) 00571 { 00572 return NULL ; 00573 } 00574 return pobjsbv; 00575 } 00576 else 00577 { 00578 sciprint ("The parent has to be a FIGURE \n"); 00579 return (sciPointObj *) NULL; 00580 } 00581 }
Here is the call graph for this function:

| sciPointObj* ConstructSegs | ( | sciPointObj * | pparentsubwin, | |
| integer | type, | |||
| double * | vx, | |||
| double * | vy, | |||
| integer | Nbr1, | |||
| integer | Nbr2, | |||
| double * | vfx, | |||
| double * | vfy, | |||
| integer | flag, | |||
| integer * | style, | |||
| double | arsize, | |||
| integer | colored, | |||
| double | arfact, | |||
| int | typeofchamp | |||
| ) |
ConstructSegs This function creates Segments
DJ.Abdemouche 2003
100
DJ.Abdemouche 2003
Definition at line 2111 of file BuildObjects.c.
References sciSegs::arrowsize, sciSegs::callback, sciSegs::callbackevent, sciSegs::callbacklen, sciSegs::clip_region_set, FREE, i, sciSegs::iflag, sciSegs::isselected, MALLOC, sciSegs::Nbr1, sciSegs::Nbr2, NULL, sciSegs::parfact, sciPointObj::pfeatures, pSEGS_FEATURE, sciSegs::pstyle, sciSegs::ptype, SCI_SEGS, SCI_SUBWIN, sciDelHandle(), sciDelThisToItsParent(), sciGetClipping(), sciGetCurrentSubWin(), sciGetEntityType(), sciGetForeground(), sciGetIsClipping(), sciGetParent(), sciGetParentSubwin(), sciGetVisibility(), sciInitForeground(), sciInitGraphicContext(), sciInitIsClipping(), sciprint(), sciSetClipping(), sciSetEntityType(), sciStandrardBuildOperations(), TRUE, sciSegs::typeofchamp, sciSegs::vfx, sciSegs::vfy, sciSegs::visible, sciSegs::vx, and sciSegs::vy.
Referenced by champg(), and Objsegs().
02114 { 02115 sciPointObj *pobj = (sciPointObj *) NULL; 02116 sciSegs * ppSegs = (sciSegs *) NULL; 02117 integer i; 02118 02119 if (sciGetEntityType (pparentsubwin) == SCI_SUBWIN) 02120 { 02121 if ((pobj = MALLOC ((sizeof (sciPointObj)))) == NULL) 02122 return (sciPointObj *) NULL; 02123 sciSetEntityType (pobj, SCI_SEGS); 02124 if ((pobj->pfeatures = MALLOC ((sizeof (sciSegs)))) == NULL) 02125 { 02126 FREE(pobj); 02127 return (sciPointObj *) NULL; 02128 } 02129 if ( sciStandrardBuildOperations( pobj, pparentsubwin ) == NULL ) 02130 { 02131 return NULL ; 02132 } 02133 02134 ppSegs = pSEGS_FEATURE(pobj) ; 02135 02136 ppSegs->callback = (char *)NULL; 02137 ppSegs->callbacklen = 0; 02138 ppSegs->callbackevent = 100; 02139 02140 ppSegs->isselected = TRUE; 02141 ppSegs->visible = sciGetVisibility(sciGetParentSubwin(pobj)); 02142 02143 /* this must be done prior to the call of sciSetClipping to know */ 02144 /* if the clip_state has been set */ 02145 ppSegs->clip_region_set = 0; 02146 sciInitIsClipping( pobj, sciGetIsClipping(sciGetParentSubwin(pobj) )); 02147 sciSetClipping(pobj,sciGetClipping(sciGetParentSubwin(pobj))); 02148 02149 02150 ppSegs = pSEGS_FEATURE (pobj); 02151 ppSegs->ptype = type; 02152 02153 ppSegs->pstyle = NULL ; 02154 02155 if ((ppSegs->vx = MALLOC (Nbr1 * sizeof (double))) == NULL) 02156 { 02157 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 02158 sciDelHandle (pobj); 02159 FREE(ppSegs); 02160 FREE(pobj); 02161 return (sciPointObj *) NULL; 02162 } 02163 if ((ppSegs->vy = MALLOC (Nbr2 * sizeof (double))) == NULL) 02164 { 02165 FREE(ppSegs->vx); 02166 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 02167 sciDelHandle (pobj); 02168 FREE(ppSegs); 02169 FREE(pobj); 02170 return (sciPointObj *) NULL; 02171 } 02172 02173 for (i = 0; i < Nbr1; i++) 02174 { 02175 ppSegs->vx[i] = vx[i]; 02176 } 02177 for (i = 0; i < Nbr2; i++) 02178 { 02179 ppSegs->vy[i] = vy[i]; 02180 } 02181 pSEGS_FEATURE (pobj)->vz=(double *) NULL; 02182 ppSegs->ptype = type; 02183 02184 /* F.Leray Test imprortant sur type ici*/ 02185 if (type == 0) /* attention ici type = 0 donc...*/ 02186 { 02187 ppSegs->typeofchamp = -1; /* useless property in the case type == 0 */ 02188 ppSegs->arrowsize = arsize ; /* A revoir: F.Leray 06.04.04 */ 02189 if ((ppSegs->pstyle = MALLOC (Nbr1 * sizeof (integer))) == NULL) 02190 { 02191 FREE(ppSegs->vx); 02192 FREE(ppSegs->vy); 02193 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 02194 sciDelHandle (pobj); 02195 FREE(ppSegs); 02196 FREE(pobj); 02197 return (sciPointObj *) NULL; 02198 } 02199 if (flag == 1) 02200 { 02201 for (i = 0; i < Nbr1; i++) 02202 { 02203 ppSegs->pstyle[i] = style[i]; 02204 } 02205 } 02206 else 02207 { 02208 for (i = 0; i < Nbr1; i++) 02209 { 02210 ppSegs->pstyle[i] = style[0]; 02211 } 02212 } 02213 02214 ppSegs->iflag = flag; 02215 ppSegs->Nbr1 = Nbr1; 02216 } 02217 else /* Warning here type = 1 so... building comes from champg */ 02218 { 02219 /* Rajout de psegs->arrowsize = arsize; F.Leray 18.02.04*/ 02220 ppSegs->arrowsize = arsize /* * 100 */; 02221 ppSegs->Nbr1 = Nbr1; 02222 ppSegs->Nbr2 = Nbr2; 02223 sciInitForeground(pobj,sciGetForeground(sciGetCurrentSubWin())); /* set sciGetForeground(psubwin) as the current foreground */ 02224 ppSegs->typeofchamp = typeofchamp; /* to know if it is a champ or champ1 */ 02225 ppSegs->parfact = arfact; 02226 if ((ppSegs->vfx = MALLOC ((Nbr1*Nbr2) * sizeof (double))) == NULL) 02227 { 02228 FREE(ppSegs->vx); 02229 FREE(ppSegs->vy); 02230 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 02231 sciDelHandle (pobj); 02232 FREE(ppSegs); 02233 FREE(pobj); 02234 return (sciPointObj *) NULL; 02235 } 02236 if ((ppSegs->vfy = MALLOC ((Nbr1*Nbr2) * sizeof (double))) == NULL) 02237 { 02238 FREE(ppSegs->vx); 02239 FREE(ppSegs->vy); 02240 FREE(ppSegs->vfx); 02241 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 02242 sciDelHandle (pobj); 02243 FREE(ppSegs); 02244 FREE(pobj); 02245 return (sciPointObj *) NULL; 02246 } 02247 02248 for (i = 0; i < (Nbr1*Nbr2); i++) 02249 { 02250 ppSegs->vfx[i] = vfx[i]; 02251 ppSegs->vfy[i] = vfy[i]; 02252 } 02253 pSEGS_FEATURE (pobj)->vfz=(double *) NULL; 02254 } 02255 if (sciInitGraphicContext (pobj) == -1) 02256 { 02257 FREE(ppSegs->vx); 02258 FREE(ppSegs->vy); 02259 if (type ==0) 02260 { 02261 FREE(ppSegs->pstyle); 02262 } 02263 else 02264 { 02265 FREE(ppSegs->vfx); 02266 FREE(ppSegs->vfy); 02267 } 02268 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 02269 sciDelHandle (pobj); 02270 FREE(ppSegs); 02271 FREE(pobj); 02272 return (sciPointObj *) NULL; 02273 } 02274 return pobj; 02275 } 02276 else 02277 { 02278 sciprint ("The parent has to be a SUBWIN \n"); 02279 return (sciPointObj *) NULL; 02280 } 02281 }
Here is the call graph for this function:

Here is the caller graph for this function:

| sciPointObj* ConstructStatusBar | ( | sciPointObj * | pparentfigure | ) |
ConstructStatusBar this function creates the StatusBar of Figure and the elementaries structures
Definition at line 54 of file BuildObjects.c.
References FREE, MALLOC, NULL, sciPointObj::pfeatures, SCI_FIGURE, SCI_STATUSB, sciDelHandle(), sciDelThisToItsParent(), sciGetEntityType(), sciGetParent(), sciInitFontContext(), sciInitGraphicContext(), sciprint(), sciSetEntityType(), and sciStandrardBuildOperations().
00055 { 00056 sciPointObj *pobj = (sciPointObj *) NULL; 00057 00058 if (sciGetEntityType (pparentfigure) == SCI_FIGURE) 00059 { 00060 if ((pobj = MALLOC ((sizeof (sciPointObj)))) == NULL) 00061 return NULL; 00062 sciSetEntityType (pobj, SCI_STATUSB); 00063 if ((pobj->pfeatures = MALLOC ((sizeof (sciStatusBar)))) == NULL) 00064 { 00065 FREE(pobj); 00066 return (sciPointObj *) NULL; 00067 } 00068 if ( sciStandrardBuildOperations( pobj, pparentfigure ) == NULL ) 00069 { 00070 return NULL ; 00071 } 00072 00073 if (sciInitGraphicContext (pobj) == -1) 00074 { 00075 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 00076 sciDelHandle (pobj); 00077 FREE(pobj->pfeatures); 00078 FREE(pobj); 00079 return (sciPointObj *) NULL; 00080 } 00081 if (sciInitFontContext (pobj) == -1) 00082 { 00083 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 00084 sciDelHandle (pobj); 00085 FREE(pobj->pfeatures); 00086 FREE(pobj); 00087 return (sciPointObj *) NULL; 00088 } 00089 return (sciPointObj *)pobj; 00090 } 00091 else 00092 { 00093 sciprint ("The parent has to be a FIGURE \n"); 00094 return (sciPointObj *) NULL; 00095 } 00096 }
Here is the call graph for this function:

| sciPointObj* ConstructSubWin | ( | sciPointObj * | pparentfigure, | |
| int | pwinnum | |||
| ) |
ConstructSubWin This function creates the Subwindow (the Axe) and the elementaries structures
Definition at line 230 of file BuildObjects.c.
References AllocAndSetUserLabelsFromMdl(), AllocUserGrads(), sciSubWindow::alpha, sciSubWindow::alpha_kp, sciSubWindow::ARect, AXES::auto_ticks, sciSubWindow::axes, AXES::axes_visible, sciSubWindow::callback, sciSubWindow::callbackevent, sciSubWindow::callbacklen, sciSubWindow::clip_region_set, cloneGraphicContext(), ConstructLabel(), CopyUserGrads(), sciSubWindow::cube_scaling, DestroyLabel(), dir, sciSubWindow::facetmerge, sciSubWindow::FirstPlot, AXES::flag, sciSubWindow::flagNax, sciSubWindow::FRect, FREE, getAxesModel(), sciSubWindow::grid, AXES::hiddenAxisColor, sciSubWindow::hiddencolor, sciSubWindow::hiddenstate, i, sciSubWindow::is3d, sciSubWindow::isoview, AXES::limits, sciSubWindow::logflags, MALLOC, sciSubWindow::mon_title, sciSubWindow::mon_x_label, sciSubWindow::mon_y_label, sciSubWindow::mon_z_label, AXES::nbsubtics, NULL, AXES::nxgrads, AXES::nygrads, AXES::nzgrads, paxesmdl, sciPointObj::pfeatures, pLABEL_FEATURE, sciSubWindow::pPopMenu, sciSubWindow::project, pSUBWIN_FEATURE, AXES::rect, AXES::reverse, SCI_FIGURE, SCI_SUBWIN, sciDelHandle(), sciDelThisToItsParent(), sciGetClipping(), sciGetEntityType(), sciGetIsClipping(), sciGetParent(), sciGetText(), sciInitFontContext(), sciInitGraphicContext(), sciInitGraphicMode(), sciInitIsClipping(), sciInitSelectedSubWin(), sciprint(), sciSetClipping(), sciSetEntityType(), sciSetStrings(), sciStandrardBuildOperations(), sciSubWindow::SRect, AXES::subint, sciSubWindow::surfcounter, sciSubWindow::theta, sciSubWindow::theta_kp, AXES::ticscolor, sciSubWindow::tight_limits, AXES::u_nxgrads, AXES::u_nygrads, AXES::u_nzgrads, AXES::u_xgrads, AXES::u_xlabels, AXES::u_ygrads, AXES::u_ylabels, AXES::u_zgrads, AXES::u_zlabels, sciSubWindow::vertices_list, sciSubWindow::visible, sciSubWindow::with_leg, sciSubWindow::WRect, AXES::xdir, AXES::xgrads, AXES::xlim, AXES::ydir, AXES::ygrads, AXES::ylim, AXES::zgrads, and AXES::zlim.
Referenced by Nsetscale2d(), sci_newaxes(), sciGetCurrentFigure(), sciRelocateObject(), sciSwitchWindow(), and sciXbasc().
00231 { 00232 00233 char dir; 00234 int i; 00235 sciPointObj *pobj = (sciPointObj *) NULL; 00236 sciSubWindow * ppsubwin = NULL; 00237 sciPointObj * paxesmdl = getAxesModel() ; 00238 sciSubWindow * ppaxesmdl = pSUBWIN_FEATURE (paxesmdl); 00239 00240 00241 if (sciGetEntityType (pparentfigure) == SCI_FIGURE) 00242 { 00243 00244 if ((pobj = MALLOC ((sizeof (sciPointObj)))) == NULL) 00245 return NULL; 00246 sciSetEntityType (pobj, SCI_SUBWIN); 00247 if ((pobj->pfeatures = MALLOC ((sizeof (sciSubWindow)))) == NULL) 00248 { 00249 FREE(pobj); 00250 return (sciPointObj *) NULL; 00251 } 00252 00253 if ( sciStandrardBuildOperations( pobj, pparentfigure ) == NULL ) 00254 { 00255 return NULL ; 00256 } 00257 00258 ppsubwin = pSUBWIN_FEATURE (pobj); /* debug */ 00259 00260 ppsubwin->vertices_list = (Vertices*) NULL; 00261 00262 00263 ppsubwin->callback = (char *)NULL; 00264 ppsubwin->callbacklen = 0; 00265 ppsubwin->callbackevent = 100; 00266 00267 if (sciInitGraphicContext (pobj) == -1) 00268 { 00269 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 00270 sciDelHandle (pobj); 00271 FREE(pobj->pfeatures); 00272 FREE(pobj); 00273 return (sciPointObj *) NULL; 00274 } 00275 if (sciInitGraphicMode (pobj) == -1) 00276 { 00277 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 00278 sciDelHandle (pobj); 00279 FREE(pobj->pfeatures); 00280 FREE(pobj); 00281 return (sciPointObj *) NULL; 00282 } 00283 00284 /* F.Leray 08.04.04 */ 00285 if (sciInitFontContext (pobj) == -1) 00286 { 00287 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 00288 sciDelHandle (pobj); 00289 FREE(pobj->pfeatures); 00290 FREE(pobj); 00291 return (sciPointObj *) NULL; 00292 } 00293 00294 dir= ppaxesmdl->logflags[0]; 00295 ppsubwin->logflags[0] = dir; 00296 00297 dir= ppaxesmdl->logflags[1]; 00298 ppsubwin->logflags[1] = dir; 00299 00300 dir= ppaxesmdl->logflags[2]; 00301 ppsubwin->logflags[2] = dir; 00302 00303 ppsubwin->axes.ticscolor = ppaxesmdl->axes.ticscolor; 00304 ppsubwin->axes.subint[0] = ppaxesmdl->axes.subint[0]; 00305 ppsubwin->axes.subint[1] = ppaxesmdl->axes.subint[1]; 00306 ppsubwin->axes.subint[2] = ppaxesmdl->axes.subint[2]; 00307 00308 dir= ppaxesmdl->axes.xdir; 00309 ppsubwin->axes.xdir = dir; 00310 dir= ppaxesmdl->axes.ydir; 00311 ppsubwin->axes.ydir = dir; 00312 00313 ppsubwin->axes.rect = ppaxesmdl->axes.rect; 00314 for (i=0 ; i<7 ; i++) 00315 ppsubwin->axes.limits[i] = ppaxesmdl->axes.limits[i] ; 00316 00317 for (i=0 ; i<3 ; i++) 00318 ppsubwin->grid[i] = ppaxesmdl->grid[i] ; 00319 ppsubwin->alpha = ppaxesmdl->alpha; 00320 ppsubwin->theta = ppaxesmdl->theta; 00321 ppsubwin->alpha_kp = ppaxesmdl->alpha_kp; 00322 ppsubwin->theta_kp = ppaxesmdl->theta_kp; 00323 ppsubwin->is3d = ppaxesmdl->is3d; 00324 00325 for (i=0 ; i<4 ; i++) 00326 { 00327 ppsubwin->axes.xlim[i]= ppaxesmdl->axes.xlim[i]; 00328 ppsubwin->axes.ylim[i]= ppaxesmdl->axes.ylim[i]; 00329 } 00330 00331 /* F.Leray 22.09.04 */ 00332 00333 ppsubwin->axes.u_xlabels = (char **) NULL; /* init. ci-apres */ 00334 ppsubwin->axes.u_ylabels = (char **) NULL; /* init. ci-apres */ 00335 ppsubwin->axes.u_zlabels = (char **) NULL; /* init. ci-apres */ 00336 ppsubwin->axes.u_xgrads = (double *)NULL; 00337 ppsubwin->axes.u_ygrads = (double *)NULL; 00338 ppsubwin->axes.u_zgrads = (double *)NULL; 00339 00340 00341 (ppsubwin->axes).axes_visible[0] = ppaxesmdl->axes.axes_visible[0]; 00342 (ppsubwin->axes).axes_visible[1] = ppaxesmdl->axes.axes_visible[1]; 00343 (ppsubwin->axes).axes_visible[2] = ppaxesmdl->axes.axes_visible[2]; 00344 (ppsubwin->axes).reverse[0] = ppaxesmdl->axes.reverse[0]; 00345 (ppsubwin->axes).reverse[1] = ppaxesmdl->axes.reverse[1]; 00346 (ppsubwin->axes).reverse[2] = ppaxesmdl->axes.reverse[2]; 00347 ppsubwin->flagNax = ppaxesmdl->flagNax; 00348 00349 /* do not forget the nbsubtics ! */ 00350 (ppsubwin->axes).nbsubtics[0] = ppaxesmdl->axes.nbsubtics[0]; 00351 (ppsubwin->axes).nbsubtics[1] = ppaxesmdl->axes.nbsubtics[1]; 00352 (ppsubwin->axes).nbsubtics[2] = ppaxesmdl->axes.nbsubtics[2]; 00353 00354 (ppsubwin->axes).nxgrads = ppaxesmdl->axes.nxgrads; 00355 (ppsubwin->axes).nygrads = ppaxesmdl->axes.nygrads; 00356 (ppsubwin->axes).nzgrads = ppaxesmdl->axes.nzgrads; 00357 00358 for(i=0;i<(ppsubwin->axes).nxgrads;i++) ppsubwin->axes.xgrads[i] = ppaxesmdl->axes.xgrads[i]; 00359 for(i=0;i<(ppsubwin->axes).nygrads;i++) ppsubwin->axes.ygrads[i] = ppaxesmdl->axes.ygrads[i]; 00360 for(i=0;i<(ppsubwin->axes).nzgrads;i++) ppsubwin->axes.zgrads[i] = ppaxesmdl->axes.zgrads[i]; 00361 00362 (ppsubwin->axes).u_nxgrads = ppaxesmdl->axes.u_nxgrads; 00363 (ppsubwin->axes).u_nygrads = ppaxesmdl->axes.u_nygrads; 00364 (ppsubwin->axes).u_nzgrads = ppaxesmdl->axes.u_nzgrads; 00365 (ppsubwin->axes).u_xgrads = AllocUserGrads(ppsubwin->axes.u_xgrads,ppaxesmdl->axes.u_nxgrads); 00366 CopyUserGrads(ppaxesmdl->axes.u_xgrads, 00367 ppsubwin->axes.u_xgrads, 00368 ppsubwin->axes.u_nxgrads); 00369 (ppsubwin->axes).u_ygrads = AllocUserGrads(ppsubwin->axes.u_ygrads,ppaxesmdl->axes.u_nygrads); 00370 CopyUserGrads(ppaxesmdl->axes.u_ygrads, 00371 ppsubwin->axes.u_ygrads, 00372 ppsubwin->axes.u_nygrads); 00373 (ppsubwin->axes).u_zgrads = AllocUserGrads(ppsubwin->axes.u_zgrads,ppaxesmdl->axes.u_nzgrads); 00374 CopyUserGrads(ppaxesmdl->axes.u_zgrads, 00375 ppsubwin->axes.u_zgrads, 00376 ppsubwin->axes.u_nzgrads); 00377 (ppsubwin->axes).u_xlabels = AllocAndSetUserLabelsFromMdl(ppsubwin->axes.u_xlabels, 00378 ppaxesmdl->axes.u_xlabels, 00379 ppsubwin->axes.u_nxgrads); 00380 00381 (ppsubwin->axes).u_ylabels = AllocAndSetUserLabelsFromMdl(ppsubwin->axes.u_ylabels, 00382 ppaxesmdl->axes.u_ylabels, 00383 ppsubwin->axes.u_nygrads); 00384 00385 (ppsubwin->axes).u_zlabels = AllocAndSetUserLabelsFromMdl(ppsubwin->axes.u_zlabels, 00386 ppaxesmdl->axes.u_zlabels, 00387 ppsubwin->axes.u_nzgrads); 00388 00389 (ppsubwin->axes).auto_ticks[0] = ppaxesmdl->axes.auto_ticks[0]; 00390 (ppsubwin->axes).auto_ticks[1] = ppaxesmdl->axes.auto_ticks[1]; 00391 (ppsubwin->axes).auto_ticks[2] = ppaxesmdl->axes.auto_ticks[2]; 00392 /* end 22.09.04 */ 00393 00394 ppsubwin->axes.zlim[0]= ppaxesmdl->axes.zlim[0]; 00395 ppsubwin->axes.zlim[1]= ppaxesmdl->axes.zlim[1]; 00396 ppsubwin->axes.flag[0]= ppaxesmdl->axes.flag[0]; 00397 ppsubwin->axes.flag[1]= ppaxesmdl->axes.flag[1]; 00398 ppsubwin->axes.flag[2]= ppaxesmdl->axes.flag[2]; 00399 ppsubwin->axes.hiddenAxisColor = ppaxesmdl->axes.hiddenAxisColor ; 00400 ppsubwin->project[0]= ppaxesmdl->project[0]; 00401 ppsubwin->project[1]= ppaxesmdl->project[1]; 00402 ppsubwin->project[2]= ppaxesmdl->project[2]; 00403 ppsubwin->hiddencolor= ppaxesmdl->hiddencolor; 00404 ppsubwin->hiddenstate= ppaxesmdl->hiddenstate; 00405 ppsubwin->isoview= ppaxesmdl->isoview; 00406 ppsubwin->facetmerge = ppaxesmdl->facetmerge; 00407 ppsubwin->WRect[0] = ppaxesmdl->WRect[0]; 00408 ppsubwin->WRect[1] = ppaxesmdl->WRect[1]; 00409 ppsubwin->WRect[2] = ppaxesmdl->WRect[2]; 00410 ppsubwin->WRect[3] = ppaxesmdl->WRect[3]; 00411 00412 ppsubwin->ARect[0] = ppaxesmdl->ARect[0]; 00413 ppsubwin->ARect[1] = ppaxesmdl->ARect[1]; 00414 ppsubwin->ARect[2] = ppaxesmdl->ARect[2]; 00415 ppsubwin->ARect[3] = ppaxesmdl->ARect[3]; 00416 00417 ppsubwin->FRect[0] = ppaxesmdl->FRect[0]; 00418 ppsubwin->FRect[1] = ppaxesmdl->FRect[1] ; 00419 ppsubwin->FRect[2] = ppaxesmdl->FRect[2]; 00420 ppsubwin->FRect[3] = ppaxesmdl->FRect[3]; 00421 ppsubwin->FRect[4] = ppaxesmdl->FRect[4] ; 00422 ppsubwin->FRect[5] = ppaxesmdl->FRect[5]; 00423 00424 ppsubwin->visible = ppaxesmdl->visible; 00425 00426 ppsubwin->clip_region_set = 0 ; 00427 sciInitIsClipping( pobj, sciGetIsClipping(paxesmdl) ) ; 00428 sciSetClipping( pobj, sciGetClipping( paxesmdl) ) ; 00429 00430 ppsubwin->cube_scaling = ppaxesmdl->cube_scaling; 00431 00432 ppsubwin->SRect[0] = ppaxesmdl->SRect[0]; 00433 ppsubwin->SRect[1] = ppaxesmdl->SRect[1]; 00434 ppsubwin->SRect[2] = ppaxesmdl->SRect[2]; 00435 ppsubwin->SRect[3] = ppaxesmdl->SRect[3]; 00436 ppsubwin->SRect[4] = ppaxesmdl->SRect[4]; 00437 ppsubwin->SRect[5] = ppaxesmdl->SRect[5]; 00438 00439 ppsubwin->tight_limits = ppaxesmdl->tight_limits; 00440 ppsubwin->FirstPlot = ppaxesmdl->FirstPlot; 00441 ppsubwin->with_leg = ppaxesmdl->with_leg; 00442 00443 if (sciInitSelectedSubWin(pobj) < 0 ) 00444 { 00445 return (sciPointObj *)NULL ; 00446 } 00447 00448 /* Construction des labels: x,y,z et Title */ 00449 00450 if ((ppsubwin->mon_title = ConstructLabel (pobj, "",1)) == NULL){ 00451 sciDelThisToItsParent (pobj, sciGetParent (pobj)); /* pobj type = scisubwindow*/ 00452 sciDelHandle (pobj); 00453 FREE(pobj->pfeatures); 00454 FREE(pobj); 00455 return (sciPointObj *) NULL; 00456 } 00457 00458 sciSetStrings( ppsubwin->mon_title, 00459 sciGetText( pSUBWIN_FEATURE(paxesmdl)->mon_title) ) ; 00460 00461 00462 /*------------------------------------*/ 00463 if ((ppsubwin->mon_x_label = ConstructLabel (pobj, "",2)) == NULL){ 00464 DestroyLabel(ppsubwin->mon_title); 00465 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 00466 sciDelHandle (pobj); 00467 FREE(pobj->pfeatures); 00468 FREE(pobj); 00469 return (sciPointObj *) NULL; 00470 } 00471 00472 sciSetStrings( ppsubwin->mon_x_label, 00473 sciGetText(pSUBWIN_FEATURE(paxesmdl)->mon_x_label) ) ; 00474 00475 00476 /*------------------------------------*/ 00477 if ((ppsubwin->mon_y_label = ConstructLabel (pobj, "",3)) == NULL){ 00478 DestroyLabel(ppsubwin->mon_title); 00479 DestroyLabel(ppsubwin->mon_x_label); 00480 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 00481 sciDelHandle (pobj); 00482 FREE(pobj->pfeatures); 00483 FREE(pobj); 00484 return (sciPointObj *) NULL; 00485 } 00486 sciSetStrings( ppsubwin->mon_y_label, 00487 sciGetText( pSUBWIN_FEATURE(paxesmdl)->mon_y_label) ) ; 00488 00489 /*------------------------------------*/ 00490 if ((ppsubwin->mon_z_label = ConstructLabel (pobj, "",4)) == NULL){ 00491 DestroyLabel(ppsubwin->mon_title); 00492 DestroyLabel(ppsubwin->mon_x_label); 00493 DestroyLabel(ppsubwin->mon_y_label); 00494 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 00495 sciDelHandle (pobj); 00496 FREE(pobj->pfeatures); 00497 FREE(pobj); 00498 return (sciPointObj *) NULL; 00499 } 00500 sciSetStrings( ppsubwin->mon_z_label, 00501 sciGetText(pSUBWIN_FEATURE(paxesmdl)->mon_z_label) ) ; 00502 00503 /* labels auto_position modes */ 00504 pLABEL_FEATURE(ppsubwin->mon_x_label)->auto_position = 00505 pLABEL_FEATURE(ppaxesmdl->mon_x_label)->auto_position; 00506 00507 pLABEL_FEATURE(ppsubwin->mon_y_label)->auto_position = 00508 pLABEL_FEATURE(ppaxesmdl->mon_y_label)->auto_position; 00509 00510 pLABEL_FEATURE(ppsubwin->mon_z_label)->auto_position = 00511 pLABEL_FEATURE(ppaxesmdl->mon_z_label)->auto_position; 00512 00513 pLABEL_FEATURE(ppsubwin->mon_title)->auto_position = 00514 pLABEL_FEATURE(ppaxesmdl->mon_title)->auto_position; 00515 00516 /* labels auto_rotation modes */ 00517 pLABEL_FEATURE(ppsubwin->mon_x_label)->auto_rotation = 00518 pLABEL_FEATURE(ppaxesmdl->mon_x_label)->auto_rotation; 00519 00520 pLABEL_FEATURE(ppsubwin->mon_y_label)->auto_rotation = 00521 pLABEL_FEATURE(ppaxesmdl->mon_y_label)->auto_rotation; 00522 00523 pLABEL_FEATURE(ppsubwin->mon_z_label)->auto_rotation = 00524 pLABEL_FEATURE(ppaxesmdl->mon_z_label)->auto_rotation; 00525 00526 pLABEL_FEATURE(ppsubwin->mon_title)->auto_rotation = 00527 pLABEL_FEATURE(ppaxesmdl->mon_title)->auto_rotation; 00528 00529 cloneGraphicContext( ppaxesmdl->mon_x_label, ppsubwin->mon_x_label ) ; 00530 cloneGraphicContext( ppaxesmdl->mon_y_label, ppsubwin->mon_y_label ) ; 00531 cloneGraphicContext( ppaxesmdl->mon_z_label, ppsubwin->mon_z_label ) ; 00532 cloneGraphicContext( ppaxesmdl->mon_title , ppsubwin->mon_title ) ; 00533 00534 ppsubwin->pPopMenu = (sciPointObj *)NULL;/* initialisation of popup menu*/ 00535 ppsubwin->surfcounter = 0; 00536 return (sciPointObj *)pobj; 00537 00538 } 00539 else 00540 { 00541 sciprint ("The parent has to be a FIGURE \n"); 00542 return (sciPointObj *) NULL; 00543 } 00544 00545 return (sciPointObj *) NULL; 00546 }
Here is the call graph for this function:

Here is the caller graph for this function:

| sciPointObj* ConstructSurface | ( | sciPointObj * | pparentsubwin, | |
| sciTypeOf3D | typeof3d, | |||
| double * | pvecx, | |||
| double * | pvecy, | |||
| double * | pvecz, | |||
| double * | zcol, | |||
| integer | izcol, | |||
| integer | dimzx, | |||
| integer | dimzy, | |||
| integer * | flag, | |||
| double * | ebox, | |||
| integer | flagcolor, | |||
| integer * | isfac, | |||
| integer * | m1, | |||
| integer * | n1, | |||
| integer * | m2, | |||
| integer * | n2, | |||
| integer * | m3, | |||
| integer * | n3, | |||
| integer * | m3n, | |||
| integer * | n3n | |||
| ) |
ConstructSurface This function creates Surface Structure
Definition at line 1365 of file BuildObjects.c.
References sciSurface::callback, sciSurface::callbackevent, sciSurface::callbacklen, sciSurface::cdatamapping, sciSurface::color, sciSurface::dimzx, sciSurface::dimzy, sciSurface::ebox, sciSurface::flag, sciSurface::flagcolor, FREE, sciSurface::hiddencolor, i, sciSurface::inputCMoV, sciSurface::isfac, sciSurface::isselected, sciSurface::izcol, j, LinearScaling2Colormap(), sciSurface::m1, sciSurface::m2, sciSurface::m3, sciSurface::m3n, MALLOC, sciSurface::n1, sciSurface::n2, sciSurface::n3, sciSurface::n3n, sciSurface::nc, nc, NULL, sciSurface::nx, sciSurface::ny, sciSurface::nz, sciPointObj::pfeatures, pSUBWIN_FEATURE, pSURFACE_FEATURE, sciSurface::pvecx, sciSurface::pvecy, sciSurface::pvecz, SCI_PLOT3D, SCI_SUBWIN, SCI_SURFACE, sciDelHandle(), sciDelThisToItsParent(), sciGetEntityType(), sciGetParent(), sciGetParentSubwin(), sciGetVisibility(), sciInitGraphicContext(), sciSetEntityType(), sciStandrardBuildOperations(), TRUE, sciSurface::typeof3d, sciSurface::visible, and sciSurface::zcol.
Referenced by Objplot3d().
01371 { 01372 sciPointObj *pobj = (sciPointObj *) NULL; 01373 /*debug F.Leray*/ 01374 sciSurface *psurf; 01375 01376 int i=0, j=0; 01377 int nx,ny,nz,nc,izc=izcol; 01378 01379 if (typeof3d == SCI_PLOT3D) { 01380 nx=dimzx; 01381 ny=dimzy; 01382 nz=dimzx*dimzy; 01383 if (flagcolor == 2) 01384 nc=nz; /* one color per facet */ /* nc = dimzx * dimzy */ 01385 else if (flagcolor == 3) 01386 nc=nz*4; /*one color per edge */ /* nc = 4* dimzx * dimzy ?????? */ /* 3 or 4 vectices are needed: 01387 I think we take 4 to have enough allocated memory*/ 01388 /* made by Djalel : comes from the genfac3d case*/ 01389 else 01390 nc=0; 01391 } 01392 /* DJ.A 2003 */ 01393 else { /* case SCI_FAC3D */ 01394 nx=dimzx*dimzy; 01395 ny=dimzx*dimzy; 01396 nz=dimzx*dimzy; 01397 if (flagcolor == 2) 01398 nc=dimzy; /* one color per facet */ /* nc = dimzy */ 01399 else if (flagcolor == 3) 01400 nc=nz; /*one color per edge */ /* nc = dimzx * dimzy */ 01401 else 01402 nc=0; 01403 } 01404 01405 01406 if (sciGetEntityType (pparentsubwin) == SCI_SUBWIN) 01407 { 01408 if ((pobj = MALLOC ((sizeof (sciPointObj)))) == NULL) 01409 return (sciPointObj *) NULL; 01410 sciSetEntityType (pobj, SCI_SURFACE); 01411 if ((pobj->pfeatures = MALLOC ((sizeof (sciSurface)))) == NULL) 01412 { 01413 FREE(pobj); 01414 return (sciPointObj *) NULL; 01415 } 01416 /*debug F.Leray*/ 01417 psurf = pSURFACE_FEATURE (pobj); 01418 if ( sciStandrardBuildOperations( pobj, pparentsubwin ) == NULL ) 01419 { 01420 return NULL ; 01421 } 01422 01423 psurf->callback = (char *)NULL; 01424 psurf->callbacklen = 0; 01425 psurf->callbackevent = 100; 01426 psurf->visible = sciGetVisibility(sciGetParentSubwin(pobj)); 01427 01428 01429 01430 /*F.Leray 12.03.04 Adding here to know the length of arrays pvecx, pvecy and pvecz*/ 01431 psurf->nc = nc; 01432 psurf->nx = nx; 01433 psurf->ny = ny; 01434 psurf->nz = nz; 01435 psurf->isfac = *isfac; 01436 psurf->m1= *m1; 01437 psurf->m2= *m2; 01438 psurf->m3= *m3; 01439 psurf->n1= *n1; 01440 psurf->n2= *n2; 01441 psurf->n3= *n3; 01442 01443 /*Adding F.Leray 19.03.04*/ 01444 psurf->m3n= *m3n; 01445 psurf->n3n= *n3n; 01446 01447 if (((psurf->pvecx = MALLOC ((nx * sizeof (double)))) == NULL)) 01448 { 01449 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 01450 sciDelHandle (pobj); 01451 FREE(psurf); 01452 FREE(pobj); pobj = NULL; 01453 return (sciPointObj *) NULL; 01454 } 01455 else 01456 { 01457 for (i = 0;i < nx; i++) 01458 psurf->pvecx[i] = pvecx[i]; 01459 } 01460 if (((psurf->pvecy = MALLOC ((ny * sizeof (double)))) == NULL)) 01461 { 01462 FREE(psurf->pvecx); 01463 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 01464 sciDelHandle (pobj); 01465 FREE(psurf); 01466 FREE(pobj); pobj = NULL; 01467 return (sciPointObj *) NULL; 01468 } 01469 else 01470 { 01471 for (j = 0;j < ny; j++) 01472 psurf->pvecy[j] = pvecy[j]; 01473 } 01474 01475 if (((psurf->pvecz = MALLOC ((nz * sizeof (double)))) == NULL)) 01476 { 01477 FREE(psurf->pvecy); 01478 FREE(psurf->pvecx); 01479 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 01480 sciDelHandle (pobj); 01481 FREE(psurf); 01482 FREE(pobj); pobj = NULL; 01483 return (sciPointObj *) NULL; 01484 } 01485 else 01486 { 01487 for (j = 0;j < nz; j++) 01488 psurf->pvecz[j] = pvecz[j]; 01489 } 01490 01491 /*Storage of the input Color Matrix or Vector Data */ /* F.Leray 23.03.04*/ 01492 psurf->inputCMoV = NULL; 01493 01494 if((*m3n)*(*n3n) != 0){ 01495 if (((psurf->inputCMoV = MALLOC (( (*m3n)*(*n3n) * sizeof (double)))) == NULL)) 01496 { 01497 FREE(psurf->pvecy); psurf->pvecy = NULL; 01498 FREE(psurf->pvecx); psurf->pvecx = NULL; 01499 FREE(psurf->pvecz); psurf->pvecz = NULL; 01500 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 01501 sciDelHandle (pobj); 01502 FREE(psurf); 01503 FREE(pobj); pobj = NULL; 01504 return (sciPointObj *) NULL; 01505 } 01506 } 01507 01508 for (j = 0;j < (*m3n)*(*n3n); j++) 01509 psurf->inputCMoV[j] = zcol[j]; 01510 01511 /* Init. zcol & zcolReal to NULL F.Leray 17.03.04*/ 01512 psurf->zcol = NULL; 01513 psurf->color = NULL; 01514 01515 01516 /*-------Replaced by: --------*/ 01517 01518 if (izc !=0&&nc>0 ) { /* Allocation of good size depending on flagcolor for nc (see above)*/ 01519 if (((psurf->zcol = MALLOC ((nc * sizeof (double)))) == NULL)) 01520 { 01521 FREE(psurf->pvecy); psurf->pvecy = NULL; 01522 FREE(psurf->pvecx); psurf->pvecx = NULL; 01523 FREE(psurf->pvecz); psurf->pvecz = NULL; 01524 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 01525 sciDelHandle (pobj); 01526 FREE(psurf); 01527 FREE(pobj); pobj = NULL; 01528 return (sciPointObj *) NULL; 01529 } 01530 } 01531 01532 if(nc>0) 01533 { 01534 /* case flagcolor == 2*/ 01535 if(flagcolor==2 && ( *m3n==1 || *n3n ==1)) /* it means we have a vector in Color input: 1 color per facet in input*/ 01536 { 01537 /* We have just enough information to fill the psurf->zcol array*/ 01538 for (j = 0;j < nc; j++) /* nc value is dimzx*dimzy == m3 * n3 */ 01539 psurf->zcol[j]= psurf->inputCMoV[j]; /* DJ.A 2003 */ 01540 } 01541 else if(flagcolor==2 && !( *m3n==1 || *n3n ==1)) /* it means we have a matrix in Color input: 1 color per vertex in input*/ 01542 { 01543 /* We have too much information and we take only the first dimzy colors to fill the psurf->zcol array*/ 01544 /* NO !! Let's do better; F.Leray 08.05.04 : */ 01545 /* We compute the average value (sum of the value of the nf=m3n vertices on a facet) / (nb of vertices per facet which is nf=m3n) */ 01546 /* in our example: m3n=4 and n3n=400 */ 01547 for (j = 0;j < nc; j++) /* nc value is dimzy*/ 01548 { 01549 double tmp = 0; 01550 int ii=0; 01551 for(ii=0;ii<(*m3n);ii++) 01552 tmp = tmp + psurf->inputCMoV[j*(*m3n) + ii]; 01553 tmp = tmp / (*m3n); 01554 psurf->zcol[j]= tmp; 01555 } 01556 } 01557 /* case flagcolor == 3*/ 01558 else if(flagcolor==3 && ( *m3n==1 || *n3n ==1)) /* it means we have a vector in Color input: 1 color per facet in input*/ 01559 { 01560 /* We have insufficient info. to fill the entire zcol array of dimension nc = dimzx*dimzy*/ 01561 /* We repeat the data:*/ 01562 for(i = 0; i< dimzy; i++){ 01563 for (j = 0;j < dimzx; j++) /* nc value is dimzx*dimzy == m3 * n3 */ 01564 psurf->zcol[dimzx*i+j]= psurf->inputCMoV[i]; /* DJ.A 2003 */ 01565 } 01566 } 01567 else if(flagcolor==3 && !( *m3n==1 || *n3n ==1)) /* it means we have a matrix in Color input: 1 color per vertex in input*/ 01568 { 01569 /* We have just enough information to fill the psurf->zcol array*/ 01570 for (j = 0;j < nc; j++) /* nc value is dimzy*/ 01571 psurf->zcol[j]= psurf->inputCMoV[j]; 01572 } 01573 /* Notice that the new case flagcolor == 4 is not available at the construction state */ 01574 /* It is a flat mode display (like flagcolor == 2 case) with a different computation */ 01575 /* manner to simulate Matlab flat mode. It can be enabled by setting color_flag to 4. */ 01576 01577 } 01578 01579 01580 psurf->cdatamapping = 1; /* direct mode enabled by default */ 01581 01582 01583 /* We need to rebuild ...->color matrix */ 01584 if(psurf->cdatamapping == 0){ /* scaled */ 01585 FREE(psurf->color); 01586 LinearScaling2Colormap(pobj); 01587 } 01588 else{ 01589 01590 FREE(psurf->color); 01591 01592 if(nc>0){ 01593 if ((psurf->color = MALLOC (nc * sizeof (double))) == NULL) 01594 return (sciPointObj *) NULL; 01595 } 01596 01597 for(i=0;i<nc;i++) 01598 psurf->color[i] = psurf->zcol[i]; 01599 /* copy zcol that has just been freed and re-alloc + filled in */ 01600 } 01601 01602 /*-------END Replaced by: --------*/ 01603 01604 psurf->dimzx = dimzx; /* dimzx is completly equal to m3*/ 01605 psurf->dimzy = dimzy; /* dimzx is completly equal to n3*/ 01606 psurf->izcol = izc; 01607 psurf->isselected = TRUE; 01608 01609 psurf->flag[0] = flag[0]; /* F.Leray 16.04.04 HERE We store the flag=[mode (hidden part ), type (scaling), box (frame around the plot)] */ 01610 psurf->flag[1] = flag[1]; 01611 psurf->flag[2] = flag[2]; 01612 01613 /* DJ.A 2003 */ 01614 01615 psurf->ebox[0] = ebox[0]; 01616 psurf->ebox[1] = ebox[1]; 01617 psurf->ebox[2] = ebox[2]; 01618 psurf->ebox[3] = ebox[3]; 01619 psurf->ebox[4] = ebox[4]; 01620 psurf->ebox[5] = ebox[5]; 01621 psurf->flagcolor =flagcolor; 01622 psurf->typeof3d = typeof3d; 01623 psurf->hiddencolor = pSUBWIN_FEATURE(pparentsubwin)->hiddencolor; 01624 01625 if (sciInitGraphicContext (pobj) == -1) 01626 { 01627 FREE(psurf->pvecz); 01628 FREE(psurf->pvecy); 01629 FREE(psurf->pvecx); 01630 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 01631 sciDelHandle (pobj); 01632 FREE(psurf); 01633 FREE(pobj); 01634 return (sciPointObj *) NULL; 01635 } 01636 pSUBWIN_FEATURE(pparentsubwin)->surfcounter++; 01637 return pobj; 01638 } 01639 else 01640 { 01641 sciprint ("The parent has to be a SUBWIN \n"); 01642 return (sciPointObj *) NULL; 01643 } 01644 }
Here is the call graph for this function:

Here is the caller graph for this function:

| sciPointObj* ConstructText | ( | sciPointObj * | pparentsubwin, | |
| char ** | text, | |||
| int | nbRow, | |||
| int | nbCol, | |||
| double | x, | |||
| double | y, | |||
| BOOL | autoSize, | |||
| double | userSize[2], | |||
| BOOL | centerPos, | |||
| int * | foreground, | |||
| int * | background, | |||
| BOOL | isboxed, | |||
| BOOL | isline, | |||
| BOOL | isfilled, | |||
| sciTextAlignment | align | |||
| ) |
ConstructText This function creates the parents window (manager) and the elementaries structures
| sciPointObj | *pparentsubwin : | |
| char | * text[] : intial text matrix string. | |
| int | nbCol : the number column of the text | |
| int | nbRow : the number of row of the text |
Definition at line 735 of file BuildObjects.c.
References allocateText(), deallocateText(), deleteMatrix(), FREE, NULL, sciPointObj::pfeatures, pTEXT_FEATURE, SCI_SUBWIN, sciAddNewHandle(), sciAddThisToItsParent(), sciDelHandle(), sciGetEntityType(), sciInitFontContext(), sciInitGraphicContext(), and sciprint().
Referenced by CloneText(), and Objstring().
00738 { 00739 if ( sciGetEntityType( pparentsubwin ) == SCI_SUBWIN ) 00740 { 00741 sciPointObj * pobj = allocateText( pparentsubwin, text, nbRow, nbCol, x, y, 00742 autoSize, userSize, centerPos, foreground, background, 00743 isboxed, isline, isfilled, align ) ; 00744 00745 if ( pobj == NULL ) 00746 { 00747 return NULL ; 00748 } 00749 00750 if ( sciInitFontContext( pobj ) == -1 ) 00751 { 00752 FREE(pobj->pfeatures); 00753 FREE(pobj); 00754 return NULL ; 00755 } 00756 00757 if ( sciInitGraphicContext( pobj ) == -1 ) 00758 { 00759 deallocateText( pobj ) ; 00760 return NULL ; 00761 } 00762 00763 if (sciAddNewHandle (pobj) == -1) 00764 { 00765 deallocateText( pobj ) ; 00766 return NULL; 00767 } 00768 00769 if ( !(sciAddThisToItsParent (pobj, pparentsubwin)) ) 00770 { 00771 deleteMatrix( pTEXT_FEATURE( pobj )->pStrings ) ; 00772 sciDelHandle (pobj); 00773 FREE(pobj->pfeatures); 00774 FREE(pobj); 00775 return NULL; 00776 } 00777 00778 return pobj ; 00779 00780 } 00781 00782 sciprint ("The parent has to be a SUBWIN \n"); 00783 return NULL; 00784 }
Here is the call graph for this function:

Here is the caller graph for this function:

| sciPointObj* ConstructTitle | ( | sciPointObj * | pparentsubwin, | |
| char | text[], | |||
| int | type | |||
| ) |
ConstructTitle This function creates Title structure
| sciPointObj | *pparentsubwin | |
| char | text[] : intial text string. | |
| int | n the number of element in text | |
| sciTitlePlace | place : the title's place (SCI_TITLE_IN_TOP, SCI_TITLE_IN_BOTTOM) |
Definition at line 797 of file BuildObjects.c.
References sciText::callback, sciText::callbacklen, deleteMatrix(), FALSE, sciText::fontcontext, FREE, sciText::isboxed, sciText::isline, sciTitle::isselected, MALLOC, newFullStringMatrix(), NULL, sciPointObj::pfeatures, sciText::pStrings, pTITLE_FEATURE, sciTitle::ptype, SCI_SUBWIN, SCI_TITLE, SCI_TITLE_IN_TOP, sciDelHandle(), sciDelThisToItsParent(), sciGetEntityType(), sciGetParent(), sciGetParentSubwin(), sciGetVisibility(), sciInitFontContext(), sciprint(), sciSetEntityType(), sciStandrardBuildOperations(), sciTitle::text, sciFont::textorientation, sciTitle::titleplace, TRUE, and sciTitle::visible.
Referenced by Objtitle().
00798 { 00799 sciPointObj * pobj = (sciPointObj *) NULL; 00800 sciTitle * ppTitle ; 00801 00802 if (sciGetEntityType (pparentsubwin) == SCI_SUBWIN) 00803 { 00804 if ((pobj = MALLOC (sizeof (sciPointObj))) == NULL) 00805 return (sciPointObj *) NULL; 00806 sciSetEntityType (pobj, SCI_TITLE); 00807 if ((pobj->pfeatures = MALLOC ((sizeof (sciTitle)))) == NULL) 00808 { 00809 FREE(pobj); 00810 return (sciPointObj *) NULL; 00811 } 00812 00813 ppTitle = pTITLE_FEATURE(pobj) ; 00814 00815 if ( sciStandrardBuildOperations( pobj, pparentsubwin ) == NULL ) 00816 { 00817 return NULL ; 00818 } 00819 00820 ppTitle->text.callback = (char *)NULL; 00821 ppTitle->text.callbacklen = 0; 00822 ppTitle->visible = sciGetVisibility(sciGetParentSubwin(pobj)); 00823 ppTitle->text.isboxed = FALSE ; 00824 ppTitle->text.isline = TRUE ; 00825 00826 ppTitle->text.pStrings = newFullStringMatrix( &text, 1, 1 ) ; 00827 00828 if ( ppTitle->text.pStrings == NULL ) 00829 { 00830 sciprint("No more place to allocates text string, try a shorter string"); 00831 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 00832 sciDelHandle (pobj); 00833 FREE(ppTitle); 00834 FREE(pobj); 00835 return (sciPointObj *) NULL; 00836 } 00837 /* on copie le texte du titre dans le champs specifique de l'objet */ 00838 00839 ppTitle->ptype = type; 00840 00841 ppTitle->text.fontcontext.textorientation = 0; 00842 00843 ppTitle->titleplace = SCI_TITLE_IN_TOP; 00844 ppTitle->isselected = TRUE; 00845 if (sciInitFontContext (pobj) == -1 ) 00846 { 00847 deleteMatrix(ppTitle->text.pStrings); 00848 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 00849 sciDelHandle (pobj); 00850 FREE(ppTitle); 00851 FREE(pobj); 00852 return (sciPointObj *) NULL; 00853 } 00854 return (sciPointObj *) pobj; 00855 } 00856 else 00857 { 00858 sciprint ("The parent has to be a SUBWIN \n"); 00859 return (sciPointObj *) NULL; 00860 } 00861 }
Here is the call graph for this function:

Here is the caller graph for this function:

| sciPointObj* ConstructUimenu | ( | sciPointObj * | pparent, | |
| char * | label, | |||
| char * | callback, | |||
| BOOL | handle_visible | |||
| ) |
ConstructUimenu This function creates Uimenu structure.
| sciPointObj | *pparentfigure | |
| char | label[] : intial label string. | |
| char | callback[] : intial text callback string . | |
| BOOL | handle_visible : handle visibility in child list . |
Definition at line 2740 of file BuildObjects.c.
References CALLOC, FREE, MALLOC, newFullStringMatrix(), NULL, sciPointObj::pfeatures, pUIMENU_FEATURE, SCI_FIGURE, SCI_UIMENU, sciDelHandle(), sciDelThisToItsParent(), sciGetEntityType(), sciGetParent(), sciprint(), sciSetEntityType(), sciStandrardBuildOperations(), and TRUE.
Referenced by sci_UImenu().
02741 { 02742 sciPointObj *pobj = (sciPointObj *) NULL; 02743 sciUimenu *ppobj=NULL; 02744 02745 if ( (sciGetEntityType (pparent) == SCI_FIGURE) || (sciGetEntityType (pparent) == SCI_UIMENU) ) 02746 { 02747 if ((pobj = MALLOC (sizeof (sciPointObj))) == NULL) return (sciPointObj *) NULL; 02748 02749 sciSetEntityType (pobj, SCI_UIMENU); 02750 02751 if ((pobj->pfeatures = MALLOC ((sizeof (sciUimenu)))) == NULL) 02752 { 02753 FREE(pobj); 02754 return (sciPointObj *) NULL; 02755 } 02756 ppobj=pUIMENU_FEATURE (pobj); 02757 if ( sciStandrardBuildOperations( pobj, pparent ) == NULL ) 02758 { 02759 return NULL ; 02760 } 02761 02762 if ((pUIMENU_FEATURE (pobj)->label.callback = CALLOC(strlen(callback)+1,sizeof(char))) == NULL ) 02763 { 02764 sciprint("No more place to allocates text string, try a shorter string"); 02765 return (sciPointObj *) NULL; 02766 } 02767 02768 strcpy(pUIMENU_FEATURE (pobj)->label.callback,callback); 02769 pUIMENU_FEATURE (pobj)->label.callbacklen = strlen(callback); 02770 02771 pUIMENU_FEATURE (pobj)->visible = TRUE; /* A changer */ 02772 02773 pUIMENU_FEATURE (pobj)->label.pStrings = newFullStringMatrix( &label, 1 , 1 ) ; 02774 02775 if ( pUIMENU_FEATURE (pobj)->label.pStrings == NULL) 02776 { 02777 sciprint("No more place to allocates label string, try a shorter string"); 02778 sciDelThisToItsParent (pobj, sciGetParent (pobj)); 02779 sciDelHandle (pobj); 02780 FREE(pUIMENU_FEATURE(pobj)); 02781 FREE(pobj); 02782 return (sciPointObj *) NULL; 02783 } 02784 02785 pUIMENU_FEATURE (pobj)->handle_visible=handle_visible; 02786 pUIMENU_FEATURE (pobj)->MenuPosition=0; 02787 pUIMENU_FEATURE (pobj)->CallbackType=0; 02788 pUIMENU_FEATURE (pobj)->Enable=TRUE; 02789 02790 return (sciPointObj *) pobj; 02791 } 02792 else 02793 { 02794 sciprint ("The parent has to be a FIGURE or a UIMENU\n"); 02795 return (sciPointObj *) NULL; 02796 } 02797 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int LinearScaling2Colormap | ( | sciPointObj * | pobj | ) |
Definition at line 16 of file ColorMapManagement.c.
References A, B, sciSurface::color, i, MALLOC, max, min, sciSurface::nc, nc, NULL, pSURFACE_FEATURE, sciGetNumColors(), sciprint(), SET_PROPERTY_ERROR, and sciSurface::zcol.
Referenced by ConstructSurface(), set_cdata_mapping_property(), set_color_flag_property(), and set_color_mode_property().
00017 { 00018 int i; 00019 int nbcol = sciGetNumColors (pobj); /* the number of the colors inside the current colormap */ 00020 sciSurface * psurf = pSURFACE_FEATURE (pobj); 00021 00022 double min,max; 00023 00024 double indexmin = 1.; 00025 double indexmax = (double) nbcol; 00026 00027 int nc = psurf->nc; /* the number of colors contained inside zcol matrix */ 00028 00029 00030 if(psurf->zcol == NULL){ 00031 sciprint("Color matrix is NULL ; can not build color scaled linearly into the current colormap"); 00032 return SET_PROPERTY_ERROR ; 00033 } 00034 00035 if (((psurf->color = MALLOC (nc * sizeof (double))) == NULL)){ 00036 sciprint("Allocation failed for color in LinearScaling2Colormap"); 00037 return SET_PROPERTY_ERROR ; 00038 } 00039 00040 /* get the min inside zcol */ 00041 min = psurf->zcol[0]; 00042 for(i=0;i<nc;i++) 00043 if(min > psurf->zcol[i]) min = psurf->zcol[i]; 00044 00045 /* get the max inside zcol */ 00046 max = psurf->zcol[0]; 00047 for(i=0;i<nc;i++) 00048 if(max < psurf->zcol[i]) max = psurf->zcol[i]; 00049 00050 if(min != max) 00051 { 00052 /* linear interpolation */ 00053 double A = (indexmin-indexmax)/(min-max); 00054 double B = (min*indexmax-indexmin*max)/(min-max); 00055 for(i=0;i<nc;i++) 00056 psurf->color[i] = A*psurf->zcol[i] + B + 0.1; 00057 } 00058 else 00059 { 00060 double C = (indexmin+indexmax)/2; 00061 for(i=0;i<nc;i++) 00062 psurf->color[i] = C; 00063 } 00064 00065 return SET_PROPERTY_SUCCEED ; 00066 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int sciAddLabelMenu | ( | sciPointObj * | pthis, | |
| char | plabel[], | |||
| int | n | |||
| ) |
sciAddLabelMenu This function add one label to this menu
| sciPointObj | * pthis: the pointer to the entity |
Definition at line 2651 of file BuildObjects.c.
References CALLOC, MALLOC, NULL, tagLabelMenu::plabel, pMENU_FEATURE, pMENUCONTEXT_FEATURE, tagLabelMenu::pnextlabelmenu, SCI_AGREG, SCI_MENU, SCI_MENUCONTEXT, sciGetEntityType(), and sciprint().
Referenced by ConstructMenu().
02652 { 02653 sciLabelMenu *pscilabelmenutmp; 02654 02655 switch (sciGetEntityType (pthis)) 02656 { 02657 case SCI_MENU: 02658 pscilabelmenutmp = (sciLabelMenu *) (pMENU_FEATURE (pthis)->plabelmenu); 02659 break; 02660 case SCI_MENUCONTEXT: 02661 pscilabelmenutmp = 02662 (sciLabelMenu *) (pMENUCONTEXT_FEATURE (pthis)->plabelmenu); 02663 break; 02664 case SCI_AGREG: 02665 default: 02666 return -1; 02667 break; 02668 } 02669 while (pscilabelmenutmp != (sciLabelMenu *) NULL) 02670 pscilabelmenutmp = (sciLabelMenu *) pscilabelmenutmp->pnextlabelmenu; 02671 if ((pscilabelmenutmp = MALLOC (sizeof (sciLabelMenu))) == NULL) 02672 return -1; 02673 if ((pscilabelmenutmp->plabel = CALLOC (n+1, sizeof (char))) == NULL) 02674 { 02675 sciprint("\nNo more place to allocates text string, try a shorter string\n"); 02676 return -1; 02677 } 02678 strncpy (pscilabelmenutmp->plabel, plabel, n); 02679 pscilabelmenutmp->pnextlabelmenu = (sciLabelMenu *) NULL; 02680 return 0; 02681 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int sciAttachPopMenu | ( | sciPointObj * | pthis, | |
| sciPointObj * | pPopMenu | |||
| ) |
Definition at line 2689 of file BuildObjects.c.
References 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, sciGetEntityType(), and sciprint().
02690 { 02691 /* HWND hwnd_window_pointed;*/ /* structure BCG periWIN ! winuser.h "Window */ 02692 02693 if (sciGetEntityType(pPopMenu) == SCI_MENUCONTEXT) /* verification of the validate type */ 02694 { 02695 /* On cherche le handle de la fenetre selectionnnee */ 02696 /* hwnd_window_pointed = WindowFromPoint(Point); */ 02697 switch(sciGetEntityType(pthis)) { 02698 case SCI_SUBWIN: 02699 pSUBWIN_FEATURE (pthis)->pPopMenu = pPopMenu; 02700 return 0; 02701 break; 02702 case SCI_MENUCONTEXT: 02703 case SCI_FIGURE: 02704 case SCI_TEXT: 02705 case SCI_TITLE: 02706 case SCI_LEGEND: 02707 case SCI_ARC: 02708 case SCI_SEGS: 02709 case SCI_FEC: 02710 case SCI_GRAYPLOT: 02711 case SCI_POLYLINE: 02712 case SCI_RECTANGLE: 02713 case SCI_SURFACE: 02714 case SCI_LIGHT: 02715 case SCI_AXES: 02716 case SCI_PANNER: 02717 case SCI_SBH: 02718 case SCI_SBV: 02719 case SCI_MENU: 02720 case SCI_STATUSB: 02721 case SCI_AGREG: 02722 case SCI_LABEL: /* F.Leray 28.05.04 */ 02723 default: 02724 return -1; 02725 break; 02726 } 02727 } 02728 sciprint("Your second entity is not a popup menu !\n"); 02729 return -1; 02730 }
Here is the call graph for this function:

| sciPointObj* sciConstructConsole | ( | sciPointObj * | pparent | ) |
Definition at line 2799 of file BuildObjects.c.
References FREE, MALLOC, NULL, sciPointObj::pfeatures, SCI_CONSOLE, sciprint(), sciSetEntityType(), and sciStandrardBuildOperations().
Referenced by sciCloneConsole().
02800 { 02801 sciPointObj * pObj = NULL ; 02802 02803 pObj = MALLOC(sizeof(sciPointObj)) ; 02804 if ( pObj == NULL ) 02805 { 02806 sciprint("Unable to allocate new object, memory full.\n") ; 02807 return NULL ; 02808 } 02809 02810 sciSetEntityType( pObj, SCI_CONSOLE ) ; 02811 02812 pObj->pfeatures = MALLOC(sizeof(sciConsole)) ; 02813 if ( pObj->pfeatures == NULL ) 02814 { 02815 sciprint("Unable to allocate new object, memory full.\n") ; 02816 FREE(pObj) ; 02817 return NULL ; 02818 02819 } 02820 02821 pObj = sciStandrardBuildOperations( pObj, pparent ) ; 02822 02823 return pObj ; 02824 02825 }
Here is the call graph for this function:

Here is the caller graph for this function:

| sciPointObj* sciConstructFrame | ( | sciPointObj * | pparent | ) |
Definition at line 2872 of file BuildObjects.c.
References FREE, MALLOC, NULL, sciPointObj::pfeatures, SCI_FRAME, sciprint(), sciSetEntityType(), and sciStandrardBuildOperations().
Referenced by sciCloneFrame().
02873 { 02874 sciPointObj * pObj = NULL ; 02875 02876 pObj = MALLOC(sizeof(sciPointObj)) ; 02877 if ( pObj == NULL ) 02878 { 02879 sciprint("Unable to allocate new object, memory full.\n") ; 02880 return NULL ; 02881 } 02882 02883 sciSetEntityType( pObj, SCI_FRAME ) ; 02884 02885 pObj->pfeatures = MALLOC(sizeof(sciFrame)) ; 02886 if ( pObj->pfeatures == NULL ) 02887 { 02888 sciprint("Unable to allocate new object, memory full.\n") ; 02889 FREE(pObj) ; 02890 return NULL ; 02891 02892 } 02893 02894 pObj = sciStandrardBuildOperations( pObj, pparent ) ; 02895 02896 return pObj ; 02897 02898 }
Here is the call graph for this function:

Here is the caller graph for this function:

| sciPointObj* sciConstructScreen | ( | sciPointObj * | pparent | ) |
Definition at line 2956 of file BuildObjects.c.
References FREE, MALLOC, NULL, sciPointObj::pfeatures, SCI_SCREEN, sciprint(), sciSetEntityType(), and sciStandrardBuildOperations().
Referenced by sciCloneScreen().
02957 { 02958 sciPointObj * pObj = NULL ; 02959 02960 pObj = MALLOC(sizeof(sciPointObj)) ; 02961 if ( pObj == NULL ) 02962 { 02963 sciprint("Unable to allocate new object, memory full.\n") ; 02964 return NULL ; 02965 } 02966 02967 sciSetEntityType( pObj, SCI_SCREEN ) ; 02968 02969 pObj->pfeatures = MALLOC(sizeof(sciScreen)) ; 02970 if ( pObj->pfeatures == NULL ) 02971 { 02972 sciprint("Unable to allocate new object, memory full.\n") ; 02973 FREE(pObj) ; 02974 return NULL ; 02975 02976 } 02977 02978 pObj = sciStandrardBuildOperations( pObj, pparent ) ; 02979 02980 return pObj ; 02981 02982 }
Here is the call graph for this function:

Here is the caller graph for this function:

| sciPointObj* sciConstructWindow | ( | sciPointObj * | pparent | ) |
Definition at line 2900 of file BuildObjects.c.
References FREE, MALLOC, NULL, sciPointObj::pfeatures, SCI_WINDOW, sciprint(), sciSetEntityType(), and sciStandrardBuildOperations().
Referenced by sciCloneWindow().
02901 { 02902 sciPointObj * pObj = NULL ; 02903 02904 pObj = MALLOC(sizeof(sciPointObj)) ; 02905 if ( pObj == NULL ) 02906 { 02907 sciprint("Unable to allocate new object, memory full.\n") ; 02908 return NULL ; 02909 } 02910 02911 sciSetEntityType( pObj, SCI_WINDOW ) ; 02912 02913 pObj->pfeatures = MALLOC(sizeof(sciWindow)) ; 02914 if ( pObj->pfeatures == NULL ) 02915 { 02916 sciprint("Unable to allocate new object, memory full.\n") ; 02917 FREE(pObj) ; 02918 return NULL ; 02919 02920 } 02921 02922 pObj = sciStandrardBuildOperations( pObj, pparent ) ; 02923 02924 return pObj ; 02925 02926 }
Here is the call graph for this function:

Here is the caller graph for this function:

| sciPointObj* sciConstructWindowFrame | ( | sciPointObj * | pparent | ) |
Definition at line 2928 of file BuildObjects.c.
References FREE, MALLOC, NULL, sciPointObj::pfeatures, SCI_WINDOWFRAME, sciprint(), sciSetEntityType(), and sciStandrardBuildOperations().
Referenced by sciCloneWindowFrame().
02929 { 02930 sciPointObj * pObj = NULL ; 02931 02932 pObj = MALLOC(sizeof(sciPointObj)) ; 02933 if ( pObj == NULL ) 02934 { 02935 sciprint("Unable to allocate new object, memory full.\n") ; 02936 return NULL ; 02937 } 02938 02939 sciSetEntityType( pObj, SCI_WINDOWFRAME ) ; 02940 02941 pObj->pfeatures = MALLOC(sizeof(sciWindowFrame)) ; 02942 if ( pObj->pfeatures == NULL ) 02943 { 02944 sciprint("Unable to allocate new object, memory full.\n") ; 02945 FREE(pObj) ; 02946 return NULL ; 02947 02948 } 02949 02950 pObj = sciStandrardBuildOperations( pObj, pparent ) ; 02951 02952 return pObj ; 02953 02954 }
Here is the call graph for this function:

Here is the caller graph for this function:

| sciPointObj* sciStandrardBuildOperations | ( | sciPointObj * | pObj, | |
| sciPointObj * | parent | |||
| ) |
contains the functions always called when creating an object pObj should have just been allocated.
Definition at line 2833 of file BuildObjects.c.
References FREE, NULL, sciPointObj::pfeatures, sciRelationShip::plastsons, sciRelationShip::pSelectedSon, sciRelationShip::psons, sciAddNewHandle(), sciAddThisToItsParent(), sciDelHandle(), sciGetPointerToUserData(), sciGetRelationship(), sciInitSelectedSons(), sciSetVisibility(), and TRUE.
Referenced by ConstructArc(), ConstructAxes(), ConstructCompound(), ConstructFec(), ConstructFigure(), ConstructGrayplot(), ConstructLegend(), ConstructMenu(), ConstructMenuContext(), ConstructMerge(), ConstructPolyline(), ConstructRectangle(), ConstructScrollH(), ConstructScrollV(), ConstructSegs(), ConstructStatusBar(), ConstructSubWin(), ConstructSurface(), ConstructTitle(), ConstructUimenu(), sciConstructConsole(), sciConstructFrame(), sciConstructScreen(), sciConstructWindow(), and sciConstructWindowFrame().
02834 { 02835 int ** userData = NULL ; 02836 int * udSize = NULL ; 02837 02838 /* add the handle in the handle list */ 02839 if ( sciAddNewHandle(pObj) == -1 ) 02840 { 02841 FREE( pObj->pfeatures ) ; 02842 FREE( pObj ) ; 02843 return NULL ; 02844 } 02845 02846 /* connect the object under its parent in the hierarchy */ 02847 if ( !sciAddThisToItsParent( pObj, parent) ) 02848 { 02849 sciDelHandle(pObj) ; 02850 FREE( pObj->pfeatures ) ; 02851 FREE( pObj ) ; 02852 return NULL ; 02853 } 02854 02855 /* no sons for now */ 02856 sciInitSelectedSons( pObj ) ; 02857 02858 sciGetRelationship(pObj)->psons = NULL ; 02859 sciGetRelationship(pObj)->plastsons = NULL ; 02860 sciGetRelationship(pObj)->pSelectedSon = NULL ; 02861 02862 sciSetVisibility( pObj, TRUE ) ; 02863 02864 sciGetPointerToUserData( pObj, &userData, &udSize ) ; 02865 *userData = NULL ; 02866 *udSize = 0 ; 02867 02868 return pObj ; 02869 02870 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int C2F() sciwin | ( | void | ) |
Create a new graphic window if any is selected.
Definition at line 103 of file BuildObjects.c.
00104 { 00105 integer verb = 0 ; 00106 integer win = 0 ; 00107 integer v = 1 ; 00108 integer na ; 00109 double dv ; 00110 C2F(dr)("xget","window",&verb,&win,&na,PI0,PI0,PI0,&dv,&dv,&dv,&dv,5L,7L); 00111 C2F(dr)("xset","window",&win,&v,PI0,PI0,PI0,PI0,&dv,&dv,&dv,&dv,5L,7L); 00112 return sciSwitchWindow(&win); 00113 }
| unsigned short defcolors[] |
1.5.1