>
</File>
<File
+ RelativePath=".\src\c\getHandleProperty\CheckTicksProperty.c"
+ >
+ </File>
+ <File
RelativePath=".\src\c\clipping.c"
>
</File>
>
</File>
<File
+ RelativePath=".\src\c\getHandleProperty\set_arrow_size_property.c"
+ >
+ </File>
+ <File
RelativePath=".\src\c\getHandleProperty\set_auto_clear_property.c"
>
</File>
>
</File>
<File
+ RelativePath=".\src\c\getHandleProperty\set_auto_ticks_property.c"
+ >
+ </File>
+ <File
+ RelativePath=".\src\c\getHandleProperty\set_axes_bounds_property.c"
+ >
+ </File>
+ <File
+ RelativePath=".\src\c\getHandleProperty\set_axes_reverse_property.c"
+ >
+ </File>
+ <File
RelativePath=".\src\c\getHandleProperty\set_axes_size_property.c"
>
</File>
<File
+ RelativePath=".\src\c\getHandleProperty\set_axes_visible_property.c"
+ >
+ </File>
+ <File
RelativePath=".\src\c\getHandleProperty\set_background_property.c"
>
</File>
>
</File>
<File
+ RelativePath=".\src\c\getHandleProperty\set_box_property.c"
+ >
+ </File>
+ <File
RelativePath=".\src\c\getHandleProperty\set_callback_property.c"
>
</File>
<File
+ RelativePath=".\src\c\getHandleProperty\set_callback_type_property.c"
+ >
+ </File>
+ <File
RelativePath=".\src\c\getHandleProperty\set_callbackmevent_property.c"
>
</File>
<File
+ RelativePath=".\src\c\getHandleProperty\set_cdata_mapping_property.c"
+ >
+ </File>
+ <File
RelativePath=".\src\c\getHandleProperty\set_clip_box_property.c"
>
</File>
>
</File>
<File
+ RelativePath=".\src\c\getHandleProperty\set_color_flag_property.c"
+ >
+ </File>
+ <File
RelativePath=".\src\c\getHandleProperty\set_color_map_property.c"
>
</File>
<File
+ RelativePath=".\src\c\getHandleProperty\set_color_mode_property.c"
+ >
+ </File>
+ <File
+ RelativePath=".\src\c\getHandleProperty\set_colored_property.c"
+ >
+ </File>
+ <File
+ RelativePath=".\src\c\getHandleProperty\set_cube_scaling_property.c"
+ >
+ </File>
+ <File
RelativePath=".\src\c\getHandleProperty\set_current_axes_property.c"
>
</File>
>
</File>
<File
+ RelativePath=".\src\c\getHandleProperty\set_data_bounds_property.c"
+ >
+ </File>
+ <File
+ RelativePath=".\src\c\getHandleProperty\set_data_mapping_property.c"
+ >
+ </File>
+ <File
RelativePath=".\src\c\getHandleProperty\set_data_property.c"
>
</File>
>
</File>
<File
+ RelativePath=".\src\c\getHandleProperty\set_format_n_property.c"
+ >
+ </File>
+ <File
+ RelativePath=".\src\c\getHandleProperty\set_grid_property.c"
+ >
+ </File>
+ <File
+ RelativePath=".\src\c\getHandleProperty\set_handle_visible_property.c"
+ >
+ </File>
+ <File
+ RelativePath=".\src\c\getHandleProperty\set_hidden_axis_color_property.c"
+ >
+ </File>
+ <File
+ RelativePath=".\src\c\getHandleProperty\set_hidden_color_property.c"
+ >
+ </File>
+ <File
RelativePath=".\src\c\getHandleProperty\set_immediate_drawing_property.c"
>
</File>
>
</File>
<File
+ RelativePath=".\src\c\getHandleProperty\set_isoview_property.c"
+ >
+ </File>
+ <File
+ RelativePath=".\src\c\getHandleProperty\set_label_font_style_property.c"
+ >
+ </File>
+ <File
+ RelativePath=".\src\c\getHandleProperty\set_labels_font_color_property.c"
+ >
+ </File>
+ <File
+ RelativePath=".\src\c\getHandleProperty\set_labels_font_size_property.c"
+ >
+ </File>
+ <File
RelativePath=".\src\c\getHandleProperty\set_line_mode_property.c"
>
</File>
>
</File>
<File
+ RelativePath=".\src\c\getHandleProperty\set_log_flags_property.c"
+ >
+ </File>
+ <File
+ RelativePath=".\src\c\getHandleProperty\set_margins_property.c"
+ >
+ </File>
+ <File
RelativePath=".\src\c\getHandleProperty\set_mark_background_property.c"
>
</File>
>
</File>
<File
+ RelativePath=".\src\c\getHandleProperty\set_menu_enable_property.c"
+ >
+ </File>
+ <File
RelativePath=".\src\c\getHandleProperty\set_old_style_property.c"
>
</File>
>
</File>
<File
+ RelativePath=".\src\c\getHandleProperty\set_position_property.c"
+ >
+ </File>
+ <File
+ RelativePath=".\src\c\getHandleProperty\set_rotation_angles_property.c"
+ >
+ </File>
+ <File
RelativePath=".\src\c\getHandleProperty\set_rotation_style_property.c"
>
</File>
<File
+ RelativePath=".\src\c\getHandleProperty\set_segs_color_property.c"
+ >
+ </File>
+ <File
+ RelativePath=".\src\c\getHandleProperty\set_sub_tics_property.c"
+ >
+ </File>
+ <File
+ RelativePath=".\src\c\getHandleProperty\set_surface_color_property.c"
+ >
+ </File>
+ <File
RelativePath=".\src\c\getHandleProperty\set_surface_mode_property.c"
>
</File>
>
</File>
<File
+ RelativePath=".\src\c\getHandleProperty\set_tics_color_property.c"
+ >
+ </File>
+ <File
RelativePath=".\src\c\getHandleProperty\set_tics_direction_property.c"
>
</File>
<File
+ RelativePath=".\src\c\getHandleProperty\set_tics_labels_property.c"
+ >
+ </File>
+ <File
+ RelativePath=".\src\c\getHandleProperty\set_tics_segment_property.c"
+ >
+ </File>
+ <File
+ RelativePath=".\src\c\getHandleProperty\set_tics_style_property.c"
+ >
+ </File>
+ <File
RelativePath=".\src\c\getHandleProperty\set_tight_limits_property.c"
>
</File>
>
</File>
<File
+ RelativePath=".\src\c\getHandleProperty\set_triangles_property.c"
+ >
+ </File>
+ <File
+ RelativePath=".\src\c\getHandleProperty\set_user_data_property.c"
+ >
+ </File>
+ <File
+ RelativePath=".\src\c\getHandleProperty\set_view_property.c"
+ >
+ </File>
+ <File
RelativePath=".\src\c\getHandleProperty\set_visible_property.c"
>
</File>
>
</File>
<File
+ RelativePath=".\src\c\getHandleProperty\set_x_ticks_property.c"
+ >
+ </File>
+ <File
+ RelativePath=".\src\c\getHandleProperty\set_xtics_coord_property.c"
+ >
+ </File>
+ <File
RelativePath=".\src\c\getHandleProperty\set_y_label_property.c"
>
</File>
>
</File>
<File
+ RelativePath=".\src\c\getHandleProperty\set_y_ticks_property.c"
+ >
+ </File>
+ <File
+ RelativePath=".\src\c\getHandleProperty\set_yticks_coord_property.c"
+ >
+ </File>
+ <File
+ RelativePath=".\src\c\getHandleProperty\set_z_bounds_property.c"
+ >
+ </File>
+ <File
RelativePath=".\src\c\getHandleProperty\set_z_label_property.c"
>
</File>
>
</File>
<File
+ RelativePath=".\src\c\getHandleProperty\set_z_ticks_property.c"
+ >
+ </File>
+ <File
RelativePath=".\src\c\getHandleProperty\set_zoom_box_property.c"
>
</File>
>
</File>
<File
+ RelativePath=".\src\c\getHandleProperty\CheckTicksProperty.h"
+ >
+ </File>
+ <File
RelativePath=".\includes\clipping.h"
>
</File>
* @param nbElement must be greater than 2.
*/
int checkMonotony( double vector[], int nbElement ) ;
-
+/*-----------------------------------------------------------------------------------*/
/**
* copy an array into an other
*/
void doubleArrayCopy( double dest[], const double src[], int nbElement ) ;
/**
+ * copy an int array into an other
+ */
+void intArrayCopy( int dest[], const int src[], int nbElement ) ;
+
+/**
+ * copy a char * array into an other
+ */
+void stringArrayCopy( char * dest[], const char * src[], int nbElement ) ;
+
+/**
* set each element of an array to a certain value
*/
void setDoubleArraySingleValue( double dest[], double value, int nbElement ) ;
*/
double * createNewArrayFromSource( int destSize, const double src[], int srcSize ) ;
+/**
+ * free an array of strings
+ */
+void destroyStringArray( char * src[], int nbStrings ) ;
+
+/**
+ * allocate a copy of a int array.
+ */
+int * createIntArrayCopy( const int src[], int nbElement ) ;
+
+/**
+ * allocate a copy of a string array
+ */
+char ** createStringArrayCopy( const char * src[], int nbElement ) ;
+/*-----------------------------------------------------------------------------------*/
+
#endif /* _BASIC_ALGOS_H_ */
double * ReBuildTicksLog2Lin(char logflag, int nbtics, double *grads) ;
+int ComputeXIntervals( sciPointObj * pobj, char xy_type, double ** vector, int * N, int checkdim ) ;
+
/**
* Create a new string which is the result the conversion of a double value
* using a certain format
*/
char ** copyFormatedArray( const double values[], int nbStrings, const char format[5], int bufferSize ) ;
-/**
- * free an array of strings
- */
-void destroyStringArray( char * src[], int nbStrings ) ;
-
#endif /* _FORMAT_H_ */
* This file contains all functions used in graphics handle management.
--------------------------------------------------------------------------*/
-#include "ObjectStructure.h"
-
#ifndef __SCI_HANDLE_MANAGEMENT__
#define __SCI_HANDLE_MANAGEMENT__
+#include "ObjectStructure.h"
+
/* Handle functions */
extern void sciSetHandle (sciPointObj * pobj, sciHandleTab * pvalue);
extern sciHandleTab * sciGetpendofhandletab(); /* HANDLE MANAGEMENT */
int getscale2d( double WRect[4], double FRect[4], char * logscale, double ARect[4] ) ;
+void set_scale( char flag[6] ,
+ double subwin[4] ,
+ double frame_values[4],
+ integer aaint[4] ,
+ char logflag[3] ,
+ double axis_values[4] ) ;
+
int zoom( void ) ;
int zoom_box( double * bbox, int * x_pixel, int * y_pixel ) ;
void C2F(getwins)( integer * Num, integer Ids[] , integer * flag) ;
+ void wininfo(char *fmt,...) ;
+
#endif /* __PERIWIN_H__ */
int CheckAndUpdate_z_shift( sciPointObj * pobj, int numrow );
/*-----------------------------------------------------------------------------------*/
-/** this function compute the final stauts of modifications when two consecutive call
- * to sciSet*** have been made. A bit tricky I agree. JB Silvy 03/2006
- */
-int sciSetFinalStatus( int status1, int status2 ) ;
/*-----------------------------------------------------------------------------------*/
#include "pixel_mode.h"
#include "getHandleProperty/setHandleProperty.h"
#include "ColorMapManagement.h"
+#include "getHandleProperty/SetPropertyStatus.h"
#include "MALLOC.h" /* MALLOC */
/*-----------------------------------------------------------------------------------*/
-extern int versionflag;
-/*-----------------------------------------------------------------------------------*/
-static char error_message[256];
-/*-----------------------------------------------------------------------------------*/
-int setticks(char * xyztick, sciPointObj* psubwin, int * ptrindex, int * numrow, int * numcol);
-int sciSet(sciPointObj *pobj, char *marker, int *value, int *numrow, int *numcol);
-char ** ReBuildUserTicks( char old_logflag, char new_logflag, double * u_xgrads, int *u_nxgrads, char ** u_xlabels);
-char ** CaseLogflagN2L(int * u_nxgrads, double *u_xgrads, char ** u_xlabels);
-/*-----------------------------------------------------------------------------------*/
-/*-----------------------------------------------------------
- * sciset(choice-name,x1,x2,x3,x4,x5)
- * or xset()
- *-----------------------------------------------------------*/
-int sci_set(fname,fname_len)
- char *fname;
- unsigned long fname_len;
-{
- integer m1,n1,l1,m2,n2,l2,numrow3,numcol3,l3,num,cur,na,verb=0;
- unsigned long hdl;
- int lw,t2;
- BOOL vis_save = FALSE ;
- sciPointObj *pobj;
-
- /* F.Leray Adding some tmp variable for SCI_SURFACE / data case*/
- integer m3tl, n3tl, l3tl;
- int numrow[4],i;
- int numcol[4], lxyzcol[4];
- int ptrindex[2];
- int flagc = -1;
- int setStatus = 0 ; /* after the call to sciSet get the status : 0 <=> OK, */
- /* -1 <=> Error, */
- /* 1 <=> nothing done */
-
- /* F.Leray Init. to 0*/
- for(i=0;i<4;i++){
- numrow[i] = 0;
- numcol[i] = 0;
- lxyzcol[i] = 0;
- }
- ptrindex[0] = 0;
- ptrindex[1] = 0;
-
-
- CheckRhs(2,3);
- CheckLhs(0,1);
- /* set or create a graphic window */
- switch(VarType(1))
- {
- case 1: /* tclsci handle */
- lw = 1 + Top - Rhs;
- C2F(overload)(&lw,"set",3);return 0;
- return 0;
- break;
- case 9: /* first is a scalar argument so it's a gset(hdl,"command",[param]) */
- /* F.Leray; INFO: case 9 is considered for a matrix of graphic handles*/
- CheckRhs(3,3);
- GetRhsVar(1,"h",&m1,&n1,&l1); /* Gets the Handle passed as argument */
- if ( *hstk(l1) != sciGetHandle(getFigureModel()) && *hstk(l1) != sciGetHandle(getAxesModel())
- && *hstk(l1) != sciGetHandle(pSUBWIN_FEATURE(getAxesModel())->mon_title)
- && *hstk(l1) != sciGetHandle(pSUBWIN_FEATURE(getAxesModel())->mon_x_label)
- && *hstk(l1) != sciGetHandle(pSUBWIN_FEATURE(getAxesModel())->mon_y_label) /* Addings here F.Leray 10.06.04 */
- && *hstk(l1) != sciGetHandle(pSUBWIN_FEATURE(getAxesModel())->mon_z_label))
- {
- if (m1!=1||n1!=1) {
- lw = 1 + Top - Rhs;
- C2F(overload)(&lw,"set",3);return 0;
- }
- if (version_flag() ==0)
- hdl = (unsigned long)*hstk(l1); /* Puts the value of the Handle to hdl */
- else
- hdl = (unsigned long)0;
- if (hdl == (unsigned long)0 )
- pobj = (sciPointObj *) NULL;
- else
- pobj = sciGetPointerFromHandle(hdl);
- }
- else
- {
- hdl = (unsigned long)*hstk(l1);
- pobj = sciGetPointerFromHandle(hdl);
- }
-
- GetRhsVar(2,"c",&m2,&n2,&l2); /* Gets the command name */
- if ( *hstk(l1) != sciGetHandle(getFigureModel()) && *hstk(l1) != sciGetHandle(getAxesModel())
- && *hstk(l1) != sciGetHandle(pSUBWIN_FEATURE(getAxesModel())->mon_title)
- && *hstk(l1) != sciGetHandle(pSUBWIN_FEATURE(getAxesModel())->mon_x_label)
- && *hstk(l1) != sciGetHandle(pSUBWIN_FEATURE(getAxesModel())->mon_y_label)
- && *hstk(l1) != sciGetHandle(pSUBWIN_FEATURE(getAxesModel())->mon_z_label))
- if ((strcmp(cstk(l2),"old_style") !=0)
- &&(strcmp(cstk(l2),"default_figure") !=0)
- && (strcmp(cstk(l2),"default_axes") !=0) ) SciWin();
- if (strcmp(cstk(l2),"user_data")==0) {
- /* set pobj->user_data*/
- int *size_ptr, data_size;
- int **user_data_ptr,*data_ptr;
- int delete_user_data=0;
-
- if (VarType(3) == 1) {
- GetRhsVar(3,"d",&numrow3,&numcol3,&l3);
- if (numrow3==0||numcol3==0) delete_user_data=1;
- }
- else if (VarType(3) == 0) delete_user_data=1;
-
- sciGetPointerToUserData (pobj,&user_data_ptr, &size_ptr);
-
- if (delete_user_data) {
- FREE(*user_data_ptr);
- *user_data_ptr=NULL;
- *size_ptr=0;
- }
- else {
- data_ptr=GetData(3);
- data_size=GetDataSize(3)*2;
-
- if (*user_data_ptr==NULL) {
- if ( (*user_data_ptr=(int *) MALLOC (data_size*sizeof (int))) == NULL) {
- strcpy(error_message,"No memory left for allocating user_data");return -1;}
- *size_ptr=data_size;
- memcpy(*user_data_ptr,data_ptr,data_size*sizeof (int));
- }
- else if (*size_ptr==data_size) {
- memcpy(*user_data_ptr,data_ptr,data_size*sizeof (int));
- }
- else {
- FREE(*user_data_ptr);
- if ( (*user_data_ptr=(int *) MALLOC (data_size * sizeof (int))) == NULL) {
- strcpy(error_message,"No memory left for allocating user_data");return -1;}
- *size_ptr=data_size;
- memcpy(*user_data_ptr,data_ptr,data_size*sizeof(int));
-
- }
- }
- return 0;
- }
- t2=sciType(cstk(l2),pobj);
- if (t2<0) {
- Scierror(999,"%s: unknown property name '%s' \r\n",fname,cstk(l2));
- return 0;}
- if (VarType(3) != t2)
- {
- Scierror(999,"%s: uncompatible values for property type '%s' \r\n",fname,cstk(l2));
- return 0;
- }
- if ( VarType(3) == 1 )
- {
- GetRhsVar(3,"d",&numrow3,&numcol3,&l3) ;
- }
- else if ( VarType(3) == 9 )
- {
- GetRhsVar(3,"h",&numrow3,&numcol3,&l3);
- }
- else if ( VarType(3) == 10 )
- {
- if ( strcmp( cstk(l2), "tics_labels" ) != 0
- && strcmp( cstk(l2), "auto_ticks" ) != 0
- && strcmp( cstk(l2), "axes_visible" ) != 0
- && strcmp( cstk(l2), "axes_reverse" ) != 0
- && strcmp( cstk(l2), "text" ) != 0 )
- {
- GetRhsVar(3,"c",&numrow3,&numcol3,&l3);
- }
- else
- {
- GetRhsVar(3,"S",&numrow3,&numcol3,&l3);
- }
- }
- break;
- case 10:/* first is a string argument so it's a gset("command",[param]) */
- CheckRhs(2,2);
- GetRhsVar(1,"c",&m2,&n2,&l2);
- if (strcmp(cstk(l2),"default_figure") !=0 && strcmp(cstk(l2),"default_axes") !=0 )
- {
- if ((strcmp(cstk(l2),"old_style") ==0) ||
- (strcmp(cstk(l2),"current_figure") ==0)) {
- hdl = (unsigned long)0;
- pobj = (sciPointObj *) NULL;
- }
- else
- {
- SciWin();
- if (version_flag() == 0 )
- if ((strcmp(cstk(l2),"zoom_") !=0) &&
- (strcmp(cstk(l2),"auto_") !=0) &&
- (strcmp(cstk(l2),"clip_box") !=0) )
- hdl = (unsigned long ) sciGetHandle(sciGetCurrentObj ()) ;
- else
- hdl = (unsigned long ) sciGetHandle(sciGetSelectedSubWin (sciGetCurrentFigure ()));
- else
- hdl = (unsigned long)0;
- if (hdl == (unsigned long)0 )
- pobj = (sciPointObj *) NULL;
- else
- pobj = sciGetPointerFromHandle(hdl);
- }
- }
- else
- {
- hdl = (unsigned long)0;
- pobj = (sciPointObj *) NULL;
- }
- t2=sciType(cstk(l2),pobj);
- if (t2<0) {
- Scierror(999,"%s: unknown property name '%s' \r\n",fname,cstk(l2));
- return 0;}
- if (VarType(2) != t2)
- if(strcmp(cstk(l2),"current_figure") != 0 && VarType(2) !=1 ){
- /* F.Leray : special unique case here set("current_figure", HANDLE);*/
- /* HANDLE type is 9 */
- Scierror(999,"%s: uncompatible values for property type '%s' \r\n",fname,cstk(l2));
- return 0;
- }
-
- if ( VarType(2) == 1 )
- {
- GetRhsVar(2,"d",&numrow3,&numcol3,&l3);
- }
- else if ( VarType(2) == 9 )
- {
- GetRhsVar(2,"h",&numrow3,&numcol3,&l3);
- }
- else if ( VarType(2) == 10 )
- {
- if ( strcmp( cstk(l2), "tics_labels" ) != 0
- && strcmp( cstk(l2), "auto_ticks" ) != 0
- && strcmp( cstk(l2), "axes_visible" ) != 0
- && strcmp( cstk(l2), "axes_reverse" ) != 0
- && strcmp( cstk(l2), "text" ) != 0 )
- {
- GetRhsVar(2,"c",&numrow3,&numcol3,&l3);
- }
- else
- {
- GetRhsVar(2,"S",&numrow3,&numcol3,&l3);
- }
- }
- break;
- default:
- lw = 1 + Top - Rhs;
- C2F(overload)(&lw,"set",3);return 0;
- break;
- }
-
- if ( (hdl != (unsigned long)0) ) { /* F.Leray 16.03.04*/
- pobj = sciGetPointerFromHandle(hdl);
- if (pobj == (sciPointObj *)NULL) {
- Scierror(999,"%s :the handle is not or no more valid\r\n",fname);
- return 0;
- }
- vis_save=sciGetVisibility(pobj); /*used not to redraw the figure is object remains invisible SS 20.04.04*/
- if(sciGetEntityType(pobj) == SCI_SUBWIN && (strcmp(cstk(l2),"x_ticks")==0 ||
- strcmp(cstk(l2),"y_ticks")==0 ||
- strcmp(cstk(l2),"z_ticks")==0))
- {
- char * sizeNotEqual = "Ticks location and label vectors must have the same size.\r\n" ;
-
- if(VarType(3) != 16)
- {
- Scierror(999,"%s: Incorrect argument, must be a Tlist!\r\n",fname);
- return -1;
- }
-
- GetRhsVar(3,"t",&m3tl,&n3tl,&l3tl);
- GetListRhsVar(3,2,"d",&numrow[0],&numcol[0],&ptrindex[0]);
-
- if ( numrow[0] == 0 && numcol[0] == 0 )
- {
- if ( ElementType( 3, 3 ) == 1 )
- {
- /* labels should be an empty vector */
- GetListRhsVar(3,3,"d",&numrow[1],&numcol[1],&ptrindex[1]);
- if ( numrow[1] != 0 || numcol[1] != 0 )
- {
- Scierror(999,sizeNotEqual) ;
- return -1 ;
- }
- }
- else
- {
- Scierror(999,sizeNotEqual) ;
- return -1 ;
- }
- }
- else
- {
- /* we should have the same number of ticks and locations */
- GetListRhsVar(3,3,"S",&numrow[1],&numcol[1],&ptrindex[1]);
- if ( numrow[1] != numrow[0] || numcol[1] != numcol[0] )
- {
- Scierror(999,sizeNotEqual) ;
- return -1 ;
- }
- }
-
- if(setticks(cstk(l2),pobj, ptrindex, numrow, numcol) != 0) return 0;
-
- }
- else /* F.Leray 02.05.05 : main case (using sciGetPoint routine inside GetProperty.c) */
- {
- if ( (setStatus = sciSet(pobj, cstk(l2), &l3, &numrow3, &numcol3)) < 0 ) {
- Scierror(999,"%s: %s\r\n",fname,error_message);
- return 0;
- }
- }
-
- if ( !( vis_save == 0 && sciGetVisibility(pobj)==0 ) && setStatus == 0 )
- {
- /* do not redraw figure if object remains invisible */
- if ((strcmp(cstk(l2),"figure_style") !=0) &&
- (strcmp(cstk(l2),"old_style") !=0 ) &&
- (strcmp(cstk(l2),"current_axes") !=0) &&
- (strcmp(cstk(l2),"default_figure") !=0) &&
- (strcmp(cstk(l2),"default_axes") !=0) &&
- (pobj != getFigureModel()) && (pobj != getAxesModel())
- && pobj != pSUBWIN_FEATURE(getAxesModel())->mon_title
- && pobj != pSUBWIN_FEATURE(getAxesModel())->mon_x_label
- && pobj != pSUBWIN_FEATURE(getAxesModel())->mon_y_label
- && pobj != pSUBWIN_FEATURE(getAxesModel())->mon_z_label )
- {
- /* Addings F.Leray 10.06.04 */
- num= sciGetNumFigure (pobj);
- C2F (dr) ("xget", "window",&verb,&cur,&na,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
- C2F (dr) ("xset", "window",&num,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
-
- sciDrawObj(sciGetParentFigure(pobj)); /* F.Leray we redraw here*/
- /* EraseAndOrRedraw(pobj); */ /* inhibit EraseAndOrRedraw for now F.Leray 20.12.04 */
-
-
- C2F (dr) ("xset", "window",&cur,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
- }
- }
- }
- else if ( ( setStatus = sciSet((sciPointObj *) NULL, cstk(l2), &l3, &numrow3, &numcol3) ) < 0 )
- {
- Scierror(999,"%s: %s\r\n",fname,error_message);
- return 0;
- }
-
- LhsVar(1)=0;
- return 0;
-}
-/*-----------------------------------------------------------------------------------*/
-int setticks(char * xyztick, sciPointObj* psubwin, int * ptrindex, int * numrow, int * numcol)
-{
- sciSubWindow * ppsubwin = pSUBWIN_FEATURE(psubwin);
-
- int i,row,col,prod,old_prod;
-
- row = *numrow;
- col = *numcol;
- prod = row * col;
-
- if(strcmp(xyztick,"x_ticks")==0)
- {
-
- old_prod = ppsubwin->axes.u_nxgrads; /* old size of the locations/labels vectors*/
-
- ppsubwin->axes.auto_ticks[0] = FALSE;
- ppsubwin->axes.u_nxgrads = prod;
-
- FREE(ppsubwin->axes.u_xgrads); ppsubwin->axes.u_xgrads = NULL;
- if ( prod > 0 )
- {
- ppsubwin->axes.u_xgrads = MALLOC( prod * sizeof(double) ) ;
- if( ppsubwin->axes.u_xgrads == NULL )
- {
- return -1 ;
- }
- }
-
-
- if(ppsubwin->logflags[0]=='l')
- {
- for(i=0;i< prod;i++)
- ppsubwin->axes.u_xgrads[i] = log10(stk(ptrindex[0])[i]);
- }
- else
- {
- for(i=0;i< prod;i++)
- ppsubwin->axes.u_xgrads[i] = stk(ptrindex[0])[i];
- ppsubwin->axes.nbsubtics[0] = ComputeNbSubTics(psubwin,ppsubwin->axes.u_nxgrads,'n',NULL,ppsubwin->axes.nbsubtics[0]); /* Nb of subtics computation and storage */ /* F.Leray 07.10.04 */
- }
-
- if(ppsubwin->axes.u_xlabels != NULL)
- for(i=0;i<old_prod;i++) { /* we free the old vector components (size == old_prod) */
- FREE(ppsubwin->axes.u_xlabels[i]);
- ppsubwin->axes.u_xlabels[i] = NULL;}
-
- FREE(ppsubwin->axes.u_xlabels); ppsubwin->axes.u_xlabels = NULL;
-
- if ( prod > 0 )
- {
- ppsubwin->axes.u_xlabels = *(char ***) &ptrindex[1];
- }
- }
- else if(strcmp(xyztick,"y_ticks")==0)
- {
-
- old_prod = ppsubwin->axes.u_nygrads; /* old size of the locations/labels vectors*/
-
- ppsubwin->axes.auto_ticks[1] = FALSE;
- ppsubwin->axes.u_nygrads = prod;
-
- FREE(ppsubwin->axes.u_ygrads); ppsubwin->axes.u_ygrads = NULL;
-
- if ( prod > 0 )
- {
- if((ppsubwin->axes.u_ygrads=(double *) MALLOC(prod*sizeof(double)))==NULL) return -1;
- }
-
-
- if(ppsubwin->logflags[1]=='l')
- {
- for(i=0;i< prod;i++)
- ppsubwin->axes.u_ygrads[i] = log10(stk(ptrindex[0])[i]);
- }
- else
- {
- for(i=0;i< prod;i++)
- ppsubwin->axes.u_ygrads[i] = stk(ptrindex[0])[i];
- ppsubwin->axes.nbsubtics[1] = ComputeNbSubTics(psubwin,ppsubwin->axes.u_nygrads,'n',NULL,ppsubwin->axes.nbsubtics[1]); /* Nb of subtics computation and storage */ /* F.Leray 07.10.04 */
- }
-
- if(ppsubwin->axes.u_ylabels != NULL)
- for(i=0;i<old_prod;i++) { /* we free the old vector components (size == old_prod) */
- FREE(ppsubwin->axes.u_ylabels[i]);
- ppsubwin->axes.u_ylabels[i] = NULL;}
-
- FREE(ppsubwin->axes.u_ylabels); ppsubwin->axes.u_ylabels = NULL;
-
- if ( prod > 0 )
- {
- ppsubwin->axes.u_ylabels = *(char ***) &ptrindex[1];
- }
- }
- else if(strcmp(xyztick,"z_ticks")==0)
- {
-
- old_prod = ppsubwin->axes.u_nzgrads; /* old size of the locations/labels vectors*/
-
- ppsubwin->axes.auto_ticks[2] = FALSE;
- ppsubwin->axes.u_nzgrads = prod;
-
- FREE(ppsubwin->axes.u_zgrads); ppsubwin->axes.u_zgrads = NULL;
-
- if ( prod > 0 )
- {
- if((ppsubwin->axes.u_zgrads=(double *) MALLOC(prod*sizeof(double)))==NULL) return -1;
- }
-
- if(ppsubwin->logflags[2]=='l')
- {
- for(i=0;i< prod;i++)
- ppsubwin->axes.u_zgrads[i] = log10(stk(ptrindex[0])[i]);
- }
- else
- {
- for(i=0;i< prod;i++)
- ppsubwin->axes.u_zgrads[i] = stk(ptrindex[0])[i];
- ppsubwin->axes.nbsubtics[2] = ComputeNbSubTics(psubwin,ppsubwin->axes.u_nzgrads,'n',NULL,ppsubwin->axes.nbsubtics[2]); /* Nb of subtics computation and storage */ /* F.Leray 07.10.04 */
- }
-
- if(ppsubwin->axes.u_zlabels != NULL)
- for(i=0;i<old_prod;i++) { /* we free the old vector components (size == old_prod) */
- FREE(ppsubwin->axes.u_zlabels[i]);
- ppsubwin->axes.u_zlabels[i] = NULL;}
-
- FREE(ppsubwin->axes.u_zlabels); ppsubwin->axes.u_zlabels = NULL;
-
- if ( prod > 0 )
- {
- ppsubwin->axes.u_zlabels = *(char ***) &ptrindex[1];
- }
- }
- return 0;
-}
-
/*-----------------------------------------------------------------------------------*/
/**@name int sciset(sciPointObj *pobj,char *marker, long *x, long *y, long *w, long *h)
- * Sets the value to the object
- */
-
-extern void set_cf_type(int val);
+* Sets the value to the object
+*/
-int sciSet(sciPointObj *pobj, char *marker, int *value, int *numrow, int *numcol)
+int sciSet(sciPointObj *pobj, char *marker, int *value, int valueType, int *numrow, int *numcol)
{
- int xtmp;
- int i,v=1,verb=0;
- double dv=0.0;
- char **ptr;
- sciPointObj *psubwin ;
-
- /* debug F.Leray 28.04.04 */
- /* sciSubWindow * ppsubwin = NULL;*/
-
- if ((strcmp(marker,"figure_model") !=0) && (strcmp(marker,"axes_model") !=0)
- && (pobj != getFigureModel()) && (pobj != getAxesModel())
- && pobj != pSUBWIN_FEATURE(getAxesModel())->mon_title
- && pobj != pSUBWIN_FEATURE(getAxesModel())->mon_x_label
- && pobj != pSUBWIN_FEATURE(getAxesModel())->mon_y_label
- && pobj != pSUBWIN_FEATURE(getAxesModel())->mon_z_label ) /* Addings F.Leray 10.06.04 */
- {
- if (pobj != (sciPointObj *)NULL)
- {
- psubwin = sciGetSelectedSubWin (sciGetCurrentFigure ());
- }
-
- if ((pobj == (sciPointObj *)NULL) &&
- (strcmp(marker,"old_style") !=0 ) &&
- (strcmp(marker,"figure_style") != 0) &&
- (strcmp(marker,"current_figure") != 0))
- {
- if (version_flag() == 0)
- strcpy(error_message,"handle not valid");
- else
- strcpy(error_message,"function not valid under old graphics style");
- return -1;
- }
- }
/***************** graphics mode *******************************/
if (strcmp(marker,"color_map") == 0)
{
- return set_color_map_property( pobj, *value, *numrow, *numcol ) ;
+ return set_color_map_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"old_style") == 0)
{
- return set_old_style_property( pobj, *value, *numrow, *numcol ) ;
+ return set_old_style_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"figure_style") == 0)
{
- return set_figure_style_property( pobj, *value, *numrow, *numcol ) ;
+ return set_figure_style_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"pixel_drawing_mode") == 0)
{
- return set_pixel_drawing_mode_property( pobj, *value, *numrow, *numcol ) ;
+ return set_pixel_drawing_mode_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if ( strcmp(marker,"default_values") == 0 )
{
- return set_default_values_property( pobj, *value, *numrow, *numcol ) ;
+ return set_default_values_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"visible") == 0)
{
- return set_visible_property( pobj, *value, *numrow, *numcol ) ;
+ return set_visible_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if ( strcmp(marker,"auto_resize") == 0 )
{
- return set_auto_resize_property( pobj, *value, *numrow, *numcol ) ;
+ return set_auto_resize_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
/*************************** Handles Properties ********/
else if ((strcmp(marker,"current_obj") == 0) || (strcmp(marker,"current_entity") == 0))
{
- return set_current_entity_property( pobj, *value, *numrow, *numcol ) ;
+ return set_current_entity_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"current_axes") == 0)
{
- return set_current_axes_property( pobj, *value, *numrow, *numcol ) ;
+ return set_current_axes_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"current_figure") == 0)
{
- return set_current_figure_property( pobj, *value, *numrow, *numcol ) ;
+ return set_current_figure_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
/************************ figure Properties *****************************/
else if (strcmp(marker,"figure_position") == 0)
{
- return set_figure_position_property( pobj, *value, *numrow, *numcol ) ;
+ return set_figure_position_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"axes_size") == 0)
{
- return set_axes_size_property( pobj, *value, *numrow, *numcol ) ;
+ return set_axes_size_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"figure_size") == 0)
{
- return set_figure_size_property( pobj, *value, *numrow, *numcol ) ;
+ return set_figure_size_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"figure_name") == 0)
{
- return set_figure_name_property( pobj, *value, *numrow, *numcol ) ;
+ return set_figure_name_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"figure_id") == 0)
{
- return set_figure_id_property( pobj, *value, *numrow, *numcol ) ;
+ return set_figure_id_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"rotation_style") == 0)
{
- return set_rotation_style_property( pobj, *value, *numrow, *numcol ) ;
+ return set_rotation_style_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"immediate_drawing") == 0)
{
- return set_immediate_drawing_property( pobj, *value, *numrow, *numcol ) ;
+ return set_immediate_drawing_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"pixmap") == 0)
{
- return set_pixmap_property( pobj, *value, *numrow, *numcol ) ;
+ return set_pixmap_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
/********************** context graphique ******************************/
else if (strcmp(marker,"background") == 0)
{
- return set_background_property( pobj, *value, *numrow, *numcol ) ;
+ return set_background_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"interp_color_vector") == 0)
{
- return set_interp_color_vector_property( pobj, *value, *numrow, *numcol ) ;
+ return set_interp_color_vector_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"interp_color_mode") == 0)
{
- return set_interp_color_mode_property( pobj, *value, *numrow, *numcol ) ;
+ return set_interp_color_mode_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"foreground") == 0)
{
- return set_foreground_property( pobj, *value, *numrow, *numcol ) ;
+ return set_foreground_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"fill_mode") == 0)
{
- return set_fill_mode_property( pobj, *value, *numrow, *numcol ) ;
+ return set_fill_mode_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"thickness") == 0)
{
- return set_thickness_property( pobj, *value, *numrow, *numcol ) ;
+ return set_thickness_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"arrow_size_factor") == 0)
{
- return set_arrow_size_factor_property( pobj, *value, *numrow, *numcol ) ;
+ return set_arrow_size_factor_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"line_style") == 0)
{
- return set_line_style_property( pobj, *value, *numrow, *numcol ) ;
+ return set_line_style_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"line_mode") == 0)
{
- return set_line_mode_property( pobj, *value, *numrow, *numcol ) ;
+ return set_line_mode_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"surface_mode") == 0)
{
- return set_surface_mode_property( pobj, *value, *numrow, *numcol ) ;
+ return set_surface_mode_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"mark_style") == 0)
{
- return set_mark_style_property( pobj, *value, *numrow, *numcol ) ;
+ return set_mark_style_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"mark_mode") == 0)
{
- return set_mark_mode_property( pobj, *value, *numrow, *numcol ) ;
+ return set_mark_mode_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"mark_size_unit") == 0)
{
- return set_mark_size_unit_property( pobj, *value, *numrow, *numcol ) ;
+ return set_mark_size_unit_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"mark_size") == 0)
{
- return set_mark_size_property( pobj, *value, *numrow, *numcol ) ;
+ return set_mark_size_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"mark_foreground") == 0)
{
- return set_mark_foreground_property( pobj, *value, *numrow, *numcol ) ;
+ return set_mark_foreground_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"mark_background") == 0)
{
- return set_mark_background_property( pobj, *value, *numrow, *numcol ) ;
+ return set_mark_background_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"bar_width") == 0)
{
- return set_bar_width_property( pobj, *value, *numrow, *numcol ) ;
+ return set_bar_width_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"bar_layout") == 0)
{
- return set_bar_layout_property( pobj, *value, *numrow, *numcol ) ;
+ return set_bar_layout_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"x_shift") == 0)
{
- return set_x_shift_property( pobj, *value, *numrow, *numcol ) ;
+ return set_x_shift_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"y_shift") == 0)
{
- return set_y_shift_property( pobj, *value, *numrow, *numcol ) ;
+ return set_y_shift_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"z_shift") == 0)
{
- return set_z_shift_property( pobj, *value, *numrow, *numcol ) ;
+ return set_z_shift_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"polyline_style") == 0)
{
- return set_polyline_style_property( pobj, *value, *numrow, *numcol ) ;
+ return set_polyline_style_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
/************* font properties *********/
else if (strcmp(marker,"font_size") == 0)
{
- return set_font_size_property( pobj, *value, *numrow, *numcol ) ;
+ return set_font_size_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"font_angle") == 0)
{
- return set_font_angle_property( pobj, *value, *numrow, *numcol ) ;
+ return set_font_angle_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"font_foreground") == 0)
{
- return set_font_foreground_property( pobj, *value, *numrow, *numcol ) ;
+ return set_font_foreground_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"font_color") == 0)
{
- return set_font_color_property( pobj, *value, *numrow, *numcol ) ;
+ return set_font_color_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"font_style") == 0)
{
- return set_font_style_property( pobj, *value, *numrow, *numcol ) ;
+ return set_font_style_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"font_name") == 0)
{
- return set_font_name_property( pobj, *value, *numrow, *numcol ) ;
+ return set_font_name_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"text_box_mode") == 0)
{
- return set_text_box_mode_property( pobj, *value, *numrow, *numcol ) ;
+ return set_text_box_mode_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if ( strcmp(marker,"auto_dimensionning") == 0 )
{
- return set_auto_dimensionning_property( pobj, *value, *numrow, *numcol ) ;
+ return set_auto_dimensionning_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if ( strcmp(marker,"alignment") == 0 )
{
- return set_alignment_property( pobj, *value, *numrow, *numcol ) ;
+ return set_alignment_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"text_box") == 0)
{
- return set_text_box_property( pobj, *value, *numrow, *numcol ) ;
+ return set_text_box_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"text") == 0)
{
- return set_text_property( pobj, *value, *numrow, *numcol ) ;
+ return set_text_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
/******************/
else if (strcmp(marker,"auto_clear") == 0)
{
- return set_auto_clear_property( pobj, *value, *numrow, *numcol ) ;
+ return set_auto_clear_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"auto_scale") == 0)
{
- return set_auto_scale_property( pobj, *value, *numrow, *numcol ) ;
+ return set_auto_scale_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if ( strcmp(marker,"zoom_box") == 0 )
{
- return set_zoom_box_property( pobj, *value, *numrow, *numcol ) ;
+ return set_zoom_box_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if ( strcmp(marker,"zoom_state") == 0 )
{
- return set_zoom_state_property( pobj, *value, *numrow, *numcol ) ;
+ return set_zoom_state_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
/***********************************************/
else if (strcmp(marker,"clip_box") == 0)
{
- return set_clip_box_property( pobj, *value, *numrow, *numcol ) ;
+ return set_clip_box_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"clip_state") == 0)
{
- return set_clip_state_property( pobj, *value, *numrow, *numcol ) ;
+ return set_clip_state_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"data") == 0)
{
- return set_data_property( pobj, *value, *numrow, *numcol ) ;
+ return set_data_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
/**************** callback *********************/
else if (strcmp(marker,"callbackmevent") == 0)
{
- return set_callbackmevent_property( pobj, *value, *numrow, *numcol ) ;
+ return set_callbackmevent_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"callback") == 0)
{
- return set_callback_property( pobj, *value, *numrow, *numcol ) ;
+ return set_callback_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
/******** AXES *******************************/
else if (strcmp(marker,"x_label") == 0)
{
- return set_x_label_property( pobj, *value, *numrow, *numcol ) ;
+ return set_x_label_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"y_label") == 0)
{
- return set_y_label_property( pobj, *value, *numrow, *numcol ) ;
+ return set_y_label_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"z_label") == 0)
{
- return set_z_label_property( pobj, *value, *numrow, *numcol ) ;
+ return set_z_label_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"title") == 0)
{
- return set_title_property( pobj, *value, *numrow, *numcol ) ;
+ return set_title_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"tics_direction") == 0)
{
- return set_tics_direction_property( pobj, *value, *numrow, *numcol ) ;
+ return set_tics_direction_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"x_location") == 0)
{
- return set_x_location_property( pobj, *value, *numrow, *numcol ) ;
+ return set_x_location_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"y_location") == 0)
{
- return set_y_location_property( pobj, *value, *numrow, *numcol ) ;
+ return set_y_location_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"tight_limits") == 0)
{
- return set_tight_limits_property( pobj, *value, *numrow, *numcol ) ;
+ return set_tight_limits_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"closed") == 0)
{
- return set_closed_property( pobj, *value, *numrow, *numcol ) ;
+ return set_closed_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"auto_position") == 0)
{
- return set_auto_position_property( pobj, *value, *numrow, *numcol ) ;
+ return set_auto_position_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"auto_rotation") == 0)
{
- return set_auto_rotation_property( pobj, *value, *numrow, *numcol ) ;
+ return set_auto_rotation_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"position") == 0)
- {
- if ( sciGetAutoPosition( pobj ) )
- {
- sciSetAutoPosition( pobj, FALSE ) ;
- }
- if (sciGetEntityType(pobj)== SCI_UIMENU)
- {
- pUIMENU_FEATURE(pobj)->MenuPosition = (int)stk(*value)[0];
- return 0 ;
- }
- else if(sciGetEntityType(pobj) == SCI_LABEL)
- {
- return sciSetPosition(pobj,stk(*value)[0],stk(*value)[1]);
- }
- else
- {
- strcpy(error_message,"position does not exist for this handle");
- return -1;
- }
- }
+ {
+ return set_position_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
/* F.Leray adding auto_ticks flags */
else if (strcmp(marker,"auto_ticks") == 0)
- {
- if(*numcol == 1){
-
- ptr= *(char ***)value;
-
- if ((strcmp(ptr[0],"off") == 0))
- {
- pSUBWIN_FEATURE (pobj)->axes.auto_ticks[0]=FALSE;
- pSUBWIN_FEATURE (pobj)->axes.auto_ticks[1]=FALSE;
- pSUBWIN_FEATURE (pobj)->axes.auto_ticks[2]=FALSE;
- }
- else if ((strcmp(ptr[0],"on") == 0))
- {
- pSUBWIN_FEATURE (pobj)->axes.auto_ticks[0]=TRUE;
- pSUBWIN_FEATURE (pobj)->axes.auto_ticks[1]=TRUE;
- pSUBWIN_FEATURE (pobj)->axes.auto_ticks[2]=TRUE;
- }
- else
- {strcpy(error_message,"Second argument must be 'on' or 'off'");return -1;}
- }
- else if (*numcol == 2 || *numcol == 3){
-
- ptr= *(char ***)value;
-
- for (i = 0; i < *numcol; i++ )
- {
- if ((strcmp(ptr[i],"off") == 0))
- pSUBWIN_FEATURE (pobj)->axes.auto_ticks[i]=FALSE;
- else if ((strcmp(ptr[i],"on") == 0))
- pSUBWIN_FEATURE (pobj)->axes.auto_ticks[i]=TRUE;
- else
- {strcpy(error_message,"Second argument must be 'on' or 'off'");return -1;}
- }
- }
- else
- {strcpy(error_message,"Number of the second argument must be taken between 1 to 3");return -1;}
- }
+ {
+ return set_auto_ticks_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
else if (strcmp(marker,"axes_reverse") == 0)
- {
- if(*numcol == 1){
-
- ptr= *(char ***)value;
-
- if ((strcmp(ptr[0],"off") == 0))
- {
- pSUBWIN_FEATURE (pobj)->axes.reverse[0]=FALSE;
- pSUBWIN_FEATURE (pobj)->axes.reverse[1]=FALSE;
- pSUBWIN_FEATURE (pobj)->axes.reverse[2]=FALSE;
- }
- else if ((strcmp(ptr[0],"on") == 0))
- {
- pSUBWIN_FEATURE (pobj)->axes.reverse[0]=TRUE;
- pSUBWIN_FEATURE (pobj)->axes.reverse[1]=TRUE;
- pSUBWIN_FEATURE (pobj)->axes.reverse[2]=TRUE;
- }
- else
- {strcpy(error_message,"Second argument must be 'on' or 'off'");return -1;}
- }
- else if (*numcol == 2 || *numcol == 3){
-
- ptr= *(char ***)value;
-
- for (i = 0; i < *numcol; i++ )
- {
- if ((strcmp(ptr[i],"off") == 0))
- pSUBWIN_FEATURE (pobj)->axes.reverse[i]=FALSE;
- else if ((strcmp(ptr[i],"on") == 0))
- pSUBWIN_FEATURE (pobj)->axes.reverse[i]=TRUE;
- else
- {strcpy(error_message,"Second argument must be 'on' or 'off'");return -1;}
- }
- }
- else
- {strcpy(error_message,"Number of the second argument must be taken between 1 to 3");return -1;}
- }
-
+ {
+ return set_axes_reverse_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
else if (strcmp(marker,"view") == 0)
- {
- /* DJ.A 2003 */
- if (sciGetEntityType (pobj) == SCI_SUBWIN) {
- if ( strcmp(cstk(*value),"2d") == 0 )
- {
- return sciSetIs3d( pobj, FALSE ) ;
- }
- else if ( strcmp(cstk(*value),"3d") == 0 )
- {
- return sciSetIs3d( pobj, TRUE ) ;
- }
- else
- {
- strcpy(error_message,"Second argument must be '2d' or '3d'");
- return -1;
- }
- }
- else
- {
- strcpy(error_message,"view property does not exist for this handle");
- return -1;
- }
-
+ {
+ return set_view_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
- else if (strcmp(marker,"axes_bounds") == 0) {
- if (sciGetEntityType (pobj) == SCI_SUBWIN) {
- if (*numrow * *numcol != 4)
- {strcpy(error_message,"Second argument must have 4 elements r");return -1;}
- for (i=0;i<4;i++) {
- pSUBWIN_FEATURE (pobj)->WRect[i]=stk(*value)[i];
-
- set_scale ("ttffff", pSUBWIN_FEATURE (pobj)->WRect,
- NULL, NULL,
- NULL, NULL);
- }
- }
- else
- {strcpy(error_message,"axes_bounds property does not exist for this handle");return -1;}
+ else if (strcmp(marker,"axes_bounds") == 0)
+ {
+ return set_axes_bounds_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
- else if (strcmp(marker,"data_bounds") == 0) {
- if (sciGetEntityType (pobj) == SCI_SUBWIN) {
-
- /* JB Silvy 09/11/05 */
- sciSubWindow * ppSubWin = pSUBWIN_FEATURE (pobj) ;
- double * bounds = stk(*value) ;
- double xMin ;
- double xMax ;
- double yMin ;
- double yMax ;
- double zMin = 1.0 ; /* initialize to avoid checking between 2D and 3D */
- double zMax = 2.0 ;
-
- /* get the bounds of the matrix */
- /* only allowed 2x2, 2x3, 1x4, 4x1, 1x6 and 6x1 matrices */
- char * errorMsg = "Second argument should be a 2x2, 2x3, 1x4, 4x1, 1x6 or 6x1 matrix." ;
- switch ( *numrow )
- {
- case 1 : /* row vector */
- if ( *numcol == 4 )
- {
- xMin = bounds[0] ;
- xMax = bounds[1] ;
- yMin = bounds[2] ;
- yMax = bounds[3] ;
- }
- else if( *numcol == 6 )
- {
- xMin = bounds[0] ;
- xMax = bounds[1] ;
- yMin = bounds[2] ;
- yMax = bounds[3] ;
- zMin = bounds[4] ;
- zMax = bounds[5] ;
- }
- else
- {
- strcpy( error_message, errorMsg ) ;
- return -1 ;
- }
- break ;
-
- case 2 : /* 2x2 or 2x3 matrix */
- if ( *numcol == 2 )
- {
- xMin = bounds[0] ;
- yMin = bounds[2] ;
- xMax = bounds[1] ;
- yMax = bounds[3] ;
- }
- else if ( *numcol == 3 )
- {
- xMin = bounds[0] ;
- yMin = bounds[2] ;
- zMin = bounds[4] ;
- xMax = bounds[1] ;
- yMax = bounds[3] ;
- zMax = bounds[5] ;
- }
- else
- {
- strcpy( error_message, errorMsg ) ;
- return -1 ;
- }
- break ;
-
- case 4 : /* column vector for 2D */
- if ( *numcol == 1 )
- {
- xMin = bounds[0] ;
- xMax = bounds[1] ;
- yMin = bounds[2] ;
- yMax = bounds[3] ;
- }
- else
- {
- strcpy( error_message, errorMsg ) ;
- return -1 ;
- }
- break ;
- case 6 : /* column vector for 3D */
- if ( *numcol == 1 )
- {
- xMin = bounds[0] ;
- xMax = bounds[1] ;
- yMin = bounds[2] ;
- yMax = bounds[3] ;
- zMin = bounds[4] ;
- zMax = bounds[5] ;
- }
- else
- {
- strcpy( error_message, errorMsg ) ;
- return -1 ;
- }
- break ;
- default:
- strcpy( error_message, errorMsg ) ;
- return -1 ;
- }
-
- /* check if the bounds are corrects */
- /* allows equality with bounds since it is working */
- if ( xMin > xMax || yMin > yMax || zMin > zMax )
- {
- strcpy(error_message,"Error : Min and Max values for one axis do not verify Min <= Max.");
- return -1 ;
- }
-
- /* check for logflags that values are greater than 0 */
- if ( ( ppSubWin->logflags[0] == 'l' && xMin <= 0.0 )
- || ( ppSubWin->logflags[1] == 'l' && yMin <= 0.0 )
- || ( ppSubWin->logflags[2] == 'l' && zMin <= 0.0 ) )
- {
- strcpy(error_message,"Error: bounds on axis must be strictly positive to use logarithmic mode\n") ;
- return -1 ;
- }
-
- /* copy the values in the axis */
- if ( *numrow * *numcol == 4 )
- {
- /* 2D */
- ppSubWin->SRect[0] = xMin ;
- ppSubWin->SRect[1] = xMax ;
- ppSubWin->SRect[2] = yMin ;
- ppSubWin->SRect[3] = yMax ;
- }
- else
- {
- /* 3D */
- ppSubWin->SRect[0] = xMin ;
- ppSubWin->SRect[1] = xMax ;
- ppSubWin->SRect[2] = yMin ;
- ppSubWin->SRect[3] = yMax ;
- ppSubWin->SRect[4] = zMin ;
- ppSubWin->SRect[5] = zMax ;
- }
-
- ppSubWin->FirstPlot = FALSE;
-
- }
- else if (sciGetEntityType (pobj) == SCI_SURFACE) {
- if (*numrow * *numcol != 6)
- {strcpy(error_message,"Second argument must have 6 elements ");return -1;}
- for (i=0;i<6;i++) {
- pSURFACE_FEATURE (pobj)->ebox[i]=stk(*value)[i];
- }
- }
- else
- {strcpy(error_message,"data_bounds property does not exist for this handle");return -1;}
- }
- else if (strcmp(marker,"margins") == 0) {
- if (sciGetEntityType (pobj) == SCI_SUBWIN) {
- /**DJ.Abdemouche 2003**/
- if (*numrow * *numcol != 4)
- {strcpy(error_message,"Second argument must have 4 elements ");return -1;}
- pSUBWIN_FEATURE (pobj)->ARect[0]=stk(*value)[0];
- pSUBWIN_FEATURE (pobj)->ARect[1]=stk(*value)[1];
- pSUBWIN_FEATURE (pobj)->ARect[2]=stk(*value)[2];
- pSUBWIN_FEATURE (pobj)->ARect[3]=stk(*value)[3];}
- else
- {strcpy(error_message,"margins property does not exist for this handle");return -1;}
- }
- else if (strcmp(marker,"tics_color") == 0) {
- if (sciGetEntityType (pobj) == SCI_AXES)
- pAXES_FEATURE (pobj)->ticscolor = (int)stk(*value)[0];
- else if (sciGetEntityType (pobj) == SCI_SUBWIN){
- sciprint("Warning: tics_color use is deprecated and no more taken into account, use foreground property to edit Axes color\n");
- pSUBWIN_FEATURE (pobj)->axes.ticscolor = (int)stk(*value)[0];
- }
- else
- {strcpy(error_message,"tics_color property does not exist for this handle");return -1;}
- }
- else if (strcmp(marker,"tics_style") == 0) {
- if((strcmp(cstk(*value),"v") != 0)&&
- (strcmp(cstk(*value),"r") != 0)&&
- (strcmp(cstk(*value),"i") != 0)) {
- strcpy(error_message,"tics must be 'v' or 'r' or 'i'");return -1;
- }
-
- if (sciGetEntityType (pobj) == SCI_AXES){
- double *vector = NULL;
- int N = 0;
- char xy_type = *cstk(*value);
-
- if(pAXES_FEATURE (pobj)->str != NULL){
- if(ComputeXIntervals(pobj,xy_type,&vector,&N,1) != 0){
- Scierror(999,"Error: Bad size in tics_coord ; you must first increase the size of the tics_coord\n");
- return 0;
- }
- if( pAXES_FEATURE (pobj)->nb_tics_labels < N){
- Scierror(999,"Warning: tics_labels has been set by user ; you must first increase the size of the tics_labels string vector before switching to '%c' tics_style mode\n",xy_type);
- return 0;
- }
- }
-
- pAXES_FEATURE (pobj)->tics = xy_type;
- }
- else {
- strcpy(error_message,"tics_style property does not exist for this handle");return -1;
- }
+ else if (strcmp(marker,"data_bounds") == 0)
+ {
+ return set_data_bounds_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
- /*Dj.A 17/12/2003*/
- /* modified jb Silvy 01/2006 */
- else if ((strcmp(marker,"sub_tics") == 0) || (strcmp(marker,"sub_ticks") == 0))
+ else if (strcmp(marker,"margins") == 0)
{
- if (sciGetEntityType (pobj) == SCI_AXES)
- {
- pAXES_FEATURE (pobj)->subint= (int) *stk(*value);
- }
- else if (sciGetEntityType (pobj) == SCI_SUBWIN)
- {
- sciSubWindow * ppSubWin = pSUBWIN_FEATURE (pobj) ;
- if ((*numcol != 3 )&& (*numcol != 2))
- {
- strcpy(error_message,"Value must have two elements (three if 3D universe) ");
- return -1;
- }
- ppSubWin->flagNax = TRUE;
- for ( i = 0; i < *numcol ; i++ )
- {
- char logflag = ppSubWin->logflags[i] ;
- int nbTicks ;
-
- if(logflag == 'l')
- {
- /* sciprint("Subtics number can not be set while using logarithmic scaling\n"); */
- continue;
- }
-
- nbTicks = (int) *stk(*value+i);
- if( nbTicks >= 0 )
- {
- ppSubWin->axes.nbsubtics[i] = nbTicks + 1 ;
- }
- else
- {
- ppSubWin->axes.nbsubtics[i] = 1 ;
- }
- }
- }
- else
- {
- strcpy(error_message,"sub_ticks property does not exist for this handle");
- return -1 ;
- }
-
+ return set_margins_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
+ else if (strcmp(marker,"tics_color") == 0)
+ {
+ return set_tics_color_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
+ else if (strcmp(marker,"tics_style") == 0)
+ {
+ return set_tics_style_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
+ /*Dj.A 17/12/2003*/
+ /* modified jb Silvy 01/2006 */
+ else if ((strcmp(marker,"sub_tics") == 0) || (strcmp(marker,"sub_ticks") == 0))
+ {
+ return set_sub_tics_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"format_n") == 0)
- {
- strncpy(pAXES_FEATURE (pobj)->format,cstk(*value),1);
- }
+ {
+ return set_format_n_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
else if (strcmp(marker,"tics_segment") == 0)
- {
- if (strcmp(cstk(*value),"on")==0 )
- pAXES_FEATURE (pobj)->seg=1;
- else if (strcmp(cstk(*value),"off")==0 )
- pAXES_FEATURE (pobj)->seg=0;
- else {strcpy(error_message,"Nothing to do (value must be 'on/off')");
- return -1;}
- }
-
- else if (strcmp(marker,"labels_font_size") == 0) {
- xtmp = (int) *stk(*value);
- if (sciGetEntityType (pobj) == SCI_AXES)
- pAXES_FEATURE (pobj)->fontsize = xtmp;
- else if (sciGetEntityType (pobj) == SCI_SUBWIN || sciGetEntityType (pobj) == SCI_FIGURE){
- /* pSUBWIN_FEATURE (pobj)->axes.fontsize = (int) *stk(*value);*/
- return sciSetFontDeciWidth(pobj,(int) (100*xtmp));} /* F.Leray 08.04.04 */
- else
- {strcpy(error_message,"labels_font_size property does not exist for this handle");return -1;}
- }
- else if (strcmp(marker,"labels_font_color") == 0) {
- if (sciGetEntityType (pobj) == SCI_AXES)
- pAXES_FEATURE (pobj)->textcolor=(int)*stk(*value);
- else if (sciGetEntityType (pobj) == SCI_SUBWIN || sciGetEntityType (pobj) == SCI_FIGURE){
- /* pSUBWIN_FEATURE (pobj)->axes.textcolor=(int)*stk(*value);*/
- return sciSetFontForeground(pobj,(int)*stk(*value));} /* F.Leray 08.04.04 */
- else
- {strcpy(error_message,"labels_font_color property does not exist for this handle");return -1;}
+ {
+ return set_tics_segment_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
+ else if (strcmp(marker,"labels_font_size") == 0)
+ {
+ return set_labels_font_size_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
+ else if (strcmp(marker,"labels_font_color") == 0)
+ {
+ return set_labels_font_color_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
- else if (strcmp(marker,"labels_font_style") == 0) { /* Adding F.Leray 09.04.04 : For the moment sciAxes have no style property*/
- if (sciGetEntityType (pobj) == SCI_SUBWIN || sciGetEntityType (pobj) == SCI_FIGURE)
- return sciSetFontStyle(pobj,(int)*stk(*value));
- else
- {strcpy(error_message,"labels_font_style property does not exist for this handle");return -1;}
+ else if (strcmp(marker,"labels_font_style") == 0)
+ { /* Adding F.Leray 09.04.04 : For the moment sciAxes have no style property*/
+ return set_labels_font_style_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"tics_labels") == 0)
- {
- if (*numrow != 1)
- {strcpy(error_message,"Second argument must be a vector"); return -1;}
- else
- {
- ptr= *(char ***)value; /**DJ.Abdemouche 2003**/
- if (pAXES_FEATURE(pobj)->nb_tics_labels > *numcol)
- {sprintf(error_message,"Value must have at least %d elements",pAXES_FEATURE(pobj)->nb_tics_labels);
- return -1;}
- else
- {
- if(pAXES_FEATURE(pobj)->str != NULL)
- for(i=0;i<pAXES_FEATURE(pobj)->nb_tics_labels;i++)
- { FREE(pAXES_FEATURE(pobj)->str[i]); pAXES_FEATURE(pobj)->str[i] = NULL;}
- FREE(pAXES_FEATURE(pobj)->str);
- pAXES_FEATURE(pobj)->str =ptr;
- pAXES_FEATURE(pobj)->nb_tics_labels = *numcol; /* could be increased to support xy_type switching (i.e. xy_type='v' -> xy_type='r') */
- }
- }
- }
+ {
+ return set_tics_labels_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
else if (strcmp(marker,"xtics_coord") == 0)
- {
- if (*numrow != 1)
- {strcpy(error_message,"Second argument must be a row vector");return -1;}
- else if (( pAXES_FEATURE(pobj)->nx == 1) &&(*numcol!=1))
- {strcpy(error_message,"Second argument must be a scalar");return -1;}
- else if (( pAXES_FEATURE(pobj)->nx != 1) &&(*numcol==1))
- {strcpy(error_message,"Second argument must be a vector");return -1;}
- else
- {
- int N = 0;
- double *vector = NULL;
- char c_format[5];
- char **foo = (char **) NULL;
-
- /* what follows remains here as it was */
-
- FREE(pAXES_FEATURE(pobj)->vx); pAXES_FEATURE(pobj)->vx = NULL;
-
- if ((pAXES_FEATURE(pobj)->vx = (double *) MALLOC (*numcol * sizeof (double))) == NULL){
- strcpy(error_message,"No memory left for allocating temporary tics_coord");return -1;}
-
- pAXES_FEATURE(pobj)->nx= *numcol;
- for (i = 0; i < *numcol;i++)
- pAXES_FEATURE(pobj)->vx[i]=*stk(*value+i);
-
- ComputeXIntervals(pobj,pAXES_FEATURE (pobj)->tics,&vector,&N,0);
- ComputeC_format(pobj,c_format);
-
- if(pAXES_FEATURE(pobj)->str != NULL)
- for(i=0;i<pAXES_FEATURE(pobj)->nb_tics_labels;i++)
- { FREE(pAXES_FEATURE(pobj)->str[i]); pAXES_FEATURE(pobj)->str[i] = NULL;}
-
- FREE(pAXES_FEATURE(pobj)->str); pAXES_FEATURE (pobj)->str = NULL;
-
-
- if((foo=MALLOC(N*(sizeof(char *))))==NULL){
- strcpy(error_message,"No memory left for allocating temporary tics_labels");return -1;}
- for(i=0;i<N;i++){
- if((foo[i]=MALLOC(256*(sizeof(char)+1)))==NULL){
- strcpy(error_message,"No memory left for allocating temporary tics_labels");return -1;}
- }
-
-
- for(i=0;i<N;i++){
- if(pAXES_FEATURE (pobj)->nx < (*numcol))
- sprintf(foo[i],c_format,vector[i]);
- else
- sprintf(foo[i],c_format,vector[i]);
- }
-
- FREE(vector); vector = (double *) NULL;
-
- /* I recompute the nb_tics_labels and save the new strings */
- pAXES_FEATURE (pobj)->nb_tics_labels = N;
- pAXES_FEATURE(pobj)->str=foo;
-
-
- }
- }
+ {
+ return set_xtics_coord_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
else if (strcmp(marker,"ytics_coord") == 0)
- {
- if (*numrow != 1)
- {strcpy(error_message,"Second argument must be a row vector");return -1;}
- else if (( pAXES_FEATURE(pobj)->ny ==1) &&( *numcol != 1))
- {strcpy(error_message,"Second argument must be a scalar");return -1;}
- else if (( pAXES_FEATURE(pobj)->ny !=1) && (*numcol == 1))
- {strcpy(error_message,"Second argument must be a vector");return -1;}
- else
- {
- int N = 0;
- double *vector = NULL;
- char c_format[5];
- char **foo = (char **) NULL;
-
- /* what follows remains here as it was */
-
- FREE(pAXES_FEATURE(pobj)->vy); pAXES_FEATURE(pobj)->vy = NULL;
-
- if ((pAXES_FEATURE(pobj)->vy = MALLOC (*numcol * sizeof (double))) == NULL)
- return 0;
- pAXES_FEATURE(pobj)->ny= *numcol;
- for (i = 0; i < *numcol;i++)
- pAXES_FEATURE(pobj)->vy[i]=*stk(*value+i);
-
- ComputeXIntervals(pobj,pAXES_FEATURE (pobj)->tics,&vector,&N,0);
- ComputeC_format(pobj,c_format);
-
- if(pAXES_FEATURE(pobj)->str != NULL)
- for(i=0;i<pAXES_FEATURE(pobj)->nb_tics_labels;i++)
- { FREE(pAXES_FEATURE(pobj)->str[i]); pAXES_FEATURE(pobj)->str[i] = NULL;}
-
- FREE(pAXES_FEATURE(pobj)->str); pAXES_FEATURE (pobj)->str = NULL;
-
- if((foo=MALLOC(N*(sizeof(char *))))==NULL){
- strcpy(error_message,"No memory left for allocating temporary tics_labels");return -1;}
- for(i=0;i<N;i++){
- if((foo[i]=MALLOC(256*(sizeof(char)+1)))==NULL){
- strcpy(error_message,"No memory left for allocating temporary tics_labels");return -1;}
- }
-
- for(i=0;i<N;i++){
- if(pAXES_FEATURE (pobj)->ny < (*numcol))
- sprintf(foo[i],c_format,vector[i]);
- else
- sprintf(foo[i],c_format,vector[i]);
- }
-
- FREE(vector); vector = (double *) NULL;
-
- /* I recompute the nb_tics_labels and save the new strings */
- pAXES_FEATURE (pobj)->nb_tics_labels = N;
- pAXES_FEATURE(pobj)->str=foo;
-
- }
- }
+ {
+ return set_ytics_coord_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
else if (strcmp(marker,"box") == 0)
- {
- if ( sciGetEntityType( pobj ) == SCI_SUBWIN )
- {
- if ( (strcmp(cstk(*value),"off") == 0) )
- {
- return sciSetBoxType( pobj, BT_OFF ) ;
- }
- else if ( (strcmp(cstk(*value),"on") == 0) )
- {
- return sciSetBoxType( pobj, BT_ON ) ;
- }
- else if ( (strcmp(cstk(*value),"hidden_axis") == 0) )
- {
- return sciSetBoxType( pobj, BT_HIDDEN_AXIS ) ;
- }
- else if ( (strcmp(cstk(*value),"back_half") == 0) )
- {
- return sciSetBoxType( pobj, BT_BACK_HALF ) ;
- }
- else
- {
- strcpy(error_message,"Second argument must be 'on', 'off', 'hidden_axis' or 'back_half'. ") ;
- return -1;
- }
- }
- else
- {
- if ((strcmp(cstk(*value),"on") == 0))
- return sciSetIsBoxed(pobj,TRUE);
- else if ((strcmp(cstk(*value),"off") == 0))
- return sciSetIsBoxed(pobj,FALSE);
- else
- {
- strcpy(error_message,"Second argument must be 'on' or 'off'") ;
- return -1;
- }
- }
- }
- else if (strcmp(marker,"grid") == 0) {/**DJ.Abdemouche 2003**/
- for (i = 0; i < *numcol; i++ )
- {
- if (stk(*value)[i] < -1)
- {strcpy(error_message,"Argument must be -1 (no grid) or number of color");return -1;}
- else
- {pSUBWIN_FEATURE (pobj)->grid[i]=(int) stk(*value)[i];}
- }
+ {
+ return set_box_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
+ else if (strcmp(marker,"grid") == 0)
+ {
+ return set_grid_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"axes_visible") == 0)
- {
- if(*numcol == 1){
-
- ptr= *(char ***)value;
-
- if ((strcmp(ptr[0],"off") == 0))
- {
- pSUBWIN_FEATURE (pobj)->axes.axes_visible[0]=FALSE;
- pSUBWIN_FEATURE (pobj)->axes.axes_visible[1]=FALSE;
- pSUBWIN_FEATURE (pobj)->axes.axes_visible[2]=FALSE;
- /* pSUBWIN_FEATURE (pobj)->isaxes= FALSE; */
- }
- else if ((strcmp(ptr[0],"on") == 0))
- {
- pSUBWIN_FEATURE (pobj)->axes.axes_visible[0]=TRUE;
- pSUBWIN_FEATURE (pobj)->axes.axes_visible[1]=TRUE;
- pSUBWIN_FEATURE (pobj)->axes.axes_visible[2]=TRUE;
- /* pSUBWIN_FEATURE (pobj)->isaxes= TRUE; */
- }
- else
- {strcpy(error_message,"Second argument must be 'on' or 'off'");return -1;}
- }
- else if (*numcol == 2 || *numcol == 3){
-
- ptr= *(char ***)value;
-
- for (i = 0; i < *numcol; i++ )
- {
- if ((strcmp(ptr[i],"off") == 0)) {
- pSUBWIN_FEATURE (pobj)->axes.axes_visible[i]=FALSE;
- /* pSUBWIN_FEATURE (pobj)->isaxes= FALSE; */ /* DO NOT PUT at all !*/
- }
- else if ((strcmp(ptr[i],"on") == 0)){
- pSUBWIN_FEATURE (pobj)->axes.axes_visible[i]=TRUE;
- /* pSUBWIN_FEATURE (pobj)->isaxes= TRUE; */
- }
- else
- {strcpy(error_message,"Second argument must be 'on' or 'off'");return -1;}
- }
- }
- else
- {strcpy(error_message,"Number of the second argument must be taken between 1 to 3");return -1;}
- }
+ {
+ return set_axes_visible_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
else if (strcmp(marker,"hiddencolor") == 0)
- {
- if (sciGetEntityType (pobj) == SCI_SUBWIN)
- pSUBWIN_FEATURE (pobj)->hiddencolor=(int) stk(*value)[0];
- else if (sciGetEntityType (pobj) == SCI_SURFACE)
- pSURFACE_FEATURE (pobj)->hiddencolor=(int) stk(*value)[0];
- else
- {strcpy(error_message,"hiddencolor property does not exist for this handle");return -1;}
-
- }
+ {
+ return set_hidden_color_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
/**DJ.Abdemouche 2003**/
else if (strcmp(marker,"isoview") == 0)
- { /* DJ.A 2003 */
- if (sciGetEntityType (pobj) == SCI_SUBWIN) {
- if ((strcmp(cstk(*value),"on") == 0))
- pSUBWIN_FEATURE (pobj)->isoview= TRUE;
- else if ((strcmp(cstk(*value),"off") == 0))
- pSUBWIN_FEATURE (pobj)->isoview= FALSE;
- else
- {strcpy(error_message,"Value must be 'on' or 'off'");return -1;}
- }
- else
- {strcpy(error_message,"isoview property does not exist for this handle");return -1;}
-
- } /**/
+ { /* DJ.A 2003 */
+ return set_isoview_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ } /**/
else if (strcmp(marker,"cube_scaling") == 0) /* F.Leray 22.04.04 */
- {
- if (sciGetEntityType (pobj) == SCI_SUBWIN) {
- if(pSUBWIN_FEATURE (pobj)->is3d == FALSE)
- sciprint("Warning: cube_scaling property is only used in 3D mode\n");
-
- if ((strcmp(cstk(*value),"on") == 0))
- pSUBWIN_FEATURE (pobj)->cube_scaling= TRUE;
- else if ((strcmp(cstk(*value),"off") == 0))
- pSUBWIN_FEATURE (pobj)->cube_scaling= FALSE;
- else
- {strcpy(error_message,"Value must be 'on' or 'off' / Only use for 3D mode");return -1;}
- }
- else
- {strcpy(error_message,"cube_scaling property does not exist for this handle");return -1;}
-
- } /**/
+ {
+ return set_cube_scaling_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ } /**/
else if (strcmp(marker,"log_flags") == 0)
- {
- char *flags;
- flags=cstk(*value);
- if (sciGetEntityType (pobj) == SCI_SUBWIN)
- {
- sciSubWindow * ppSubWin = pSUBWIN_FEATURE (pobj) ;
- if (((*numrow * *numcol == 2) || (*numrow * *numcol == 3)) &&
- (flags[0]=='n'||flags[0]=='l')&&
- (flags[1]=='n'||flags[1]=='l')) {
-
- /* Update the data_bounds values ?? NO we will see if data_bounds contains
- negative boundaries and send an error message to the user */
-
- if( ( ppSubWin->SRect[0] <= 0. || ppSubWin->SRect[1] <= 0.)
- && flags[0] == 'l')
- {
- strcpy(error_message,
- "Error: data_bounds on x axis must be strictly positive to switch to logarithmic mode");
- return -1;
- }
- else
- {
- ppSubWin->axes.u_xlabels = ReBuildUserTicks( ppSubWin->logflags[0], flags[0],
- ppSubWin->axes.u_xgrads,
- &ppSubWin->axes.u_nxgrads,
- ppSubWin->axes.u_xlabels);
-
- /* ReBuildUserTicks( pobj, pSUBWIN_FEATURE (pobj)->logflags[0], flags[0],'x'); */
- ppSubWin->logflags[0]=flags[0];
- }
-
- if((ppSubWin->SRect[2] <= 0. || ppSubWin->SRect[3] <= 0.)
- && flags[1] == 'l'){
- strcpy(error_message,
- "Error: data_bounds on y axis must be strictly positive to switch to logarithmic mode");
- return -1;
- }
- else
- {
- ppSubWin->axes.u_ylabels = ReBuildUserTicks( ppSubWin->logflags[1], flags[1],
- ppSubWin->axes.u_ygrads,
- &ppSubWin->axes.u_nygrads,
- ppSubWin->axes.u_ylabels);
-
- /* ReBuildUserTicks( pobj, pSUBWIN_FEATURE (pobj)->logflags[1], flags[1],'y'); */
- ppSubWin->logflags[1]=flags[1];
- }
-
- /* third new case (for z) F.Leray 03.11.04 */
- if((*numrow * *numcol == 3) &&
- (flags[2]=='n'||flags[2]=='l')){
- if( (ppSubWin->SRect[4] <= 0. || ppSubWin->SRect[5] <= 0.)
- && flags[2] == 'l')
- {strcpy(error_message,"Error: data_bounds on z axis must be strictly positive to switch to logarithmic mode");return -1;}
- else
- {
- ppSubWin->axes.u_zlabels = ReBuildUserTicks( ppSubWin->logflags[2], flags[2],
- ppSubWin->axes.u_zgrads,
- &ppSubWin->axes.u_nzgrads,
- ppSubWin->axes.u_zlabels);
-
- /* ReBuildUserTicks( pobj, pSUBWIN_FEATURE (pobj)->logflags[0], flags[0],'x'); */
- ppSubWin->logflags[2]=flags[2];
- }
-
- }
-
- }
- else
- {
- strcpy(error_message,"incorrect log_flags value");
- return -1;
- }
- }
- else
- {
- strcpy(error_message,"log_flags property does not exist for this handle");
- return -1;
- }
- }
- else if (strcmp(marker,"arrow_size") == 0) {
- if(sciGetEntityType (pobj) == SCI_SEGS)
- pSEGS_FEATURE (pobj)->arrowsize = *stk(*value);
- else
- {strcpy(error_message,"arrow_size property does not exist for this handle");return -1;}
+ {
+ return set_log_flags_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
+ else if (strcmp(marker,"arrow_size") == 0)
+ {
+ return set_arrow_size_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
- else if ((strcmp(marker,"segs_color") == 0) && (sciGetEntityType (pobj) == SCI_SEGS)){
- if (pSEGS_FEATURE (pobj)->ptype == 0){
- if ((*numrow)* (*numcol)==1) {
- pSEGS_FEATURE (pobj)->iflag=0;
- for (i = 0; i < (pSEGS_FEATURE (pobj)->Nbr1)/2 ;i++)
- pSEGS_FEATURE (pobj)->pstyle[i]=(int)*stk(*value);
- }
- else if (((*numrow)* (*numcol)== (pSEGS_FEATURE (pobj)->Nbr1)/2)) {
- pSEGS_FEATURE (pobj)->iflag=1;
- for (i = 0; i < (pSEGS_FEATURE (pobj)->Nbr1)/2 ;i++)
- pSEGS_FEATURE (pobj)->pstyle[i]=(integer) *stk(*value+i);
- }
- else
- {
- sprintf(error_message,"segs color has a wrong size (%d), expecting 1 or (%d )",((*numrow)* (*numcol)) ,(pSEGS_FEATURE (pobj)->Nbr1)/2 );
- return -1;
- }
- }
- else
- {strcpy(error_message,"segs_color property does not exist for this handle");return -1;}
- }
- else if ((strcmp(marker,"colored") == 0) && (sciGetEntityType (pobj) == SCI_SEGS)){
- if (pSEGS_FEATURE (pobj)->ptype != 0){
- if ((strcmp(cstk(*value),"on") == 0))
- pSEGS_FEATURE (pobj)->typeofchamp = 1;
- else if ((strcmp(cstk(*value),"off") == 0))
- pSEGS_FEATURE (pobj)->typeofchamp = 0;
- else
- {strcpy(error_message,"Value must be 'on' or 'off'");return -1;}
- }
- else
- {strcpy(error_message,"colored property does not exist for Segs");return -1;}
+ else if ( strcmp(marker,"segs_color") == 0 )
+ {
+ return set_segs_color_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
+ else if ((strcmp(marker,"colored") == 0) && (sciGetEntityType (pobj) == SCI_SEGS))
+ {
+ return set_colored_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
/**************** Matplot Grayplot *********************/
- else if (strcmp(marker,"data_mapping") == 0) {
- if (sciGetEntityType (pobj) == SCI_GRAYPLOT) {
- if ((strcmp(cstk(*value),"scaled") == 0)||(strcmp(cstk(*value),"direct") == 0))
- strcpy(pGRAYPLOT_FEATURE (pobj)->datamapping,cstk(*value));
- else
- {strcpy(error_message,"Value must be 'direct' or 'scaled'");return -1;}
- }
- else
- {strcpy(error_message,"data_mapping property does not exist for this handle");return -1;}
+ else if (strcmp(marker,"data_mapping") == 0)
+ {
+ return set_data_mapping_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
/**************** Surface *******************************/
- else if (strcmp(marker,"rotation_angles") == 0) {
- /* DJ.A 2003 */
- if (sciGetEntityType (pobj) == SCI_SUBWIN) {
- Obj_RedrawNewAngle(pobj,*stk(*value+1),*stk(*value));
- wininfo("alpha=%.1f,theta=%.1f",pSUBWIN_FEATURE (pobj)->alpha,pSUBWIN_FEATURE (pobj)->theta);
- }
- else
- {strcpy(error_message,"rotation_angles property does not exist for this handle");return -1;}
+ else if (strcmp(marker,"rotation_angles") == 0)
+ {
+ return set_rotation_angles_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
/*DJ.A merge*/
- else if (strcmp(marker,"color_mode") == 0) {
- if (sciGetEntityType (pobj) == SCI_SURFACE) {
- /* int m3n,n3n,nc,j; */
- int flagcolor;
- sciSurface * psurf = pSURFACE_FEATURE (pobj);
-
- flagcolor = psurf->flagcolor;
-
- psurf->flag[0]= (integer) stk(*value)[0];
-
- if(flagcolor != 0 && flagcolor !=1){
- if(psurf->m3n * psurf->n3n == 0) {/* There is no color matrix/vect. in input : update the fake color one */
- int j,nc;
-
- if(flagcolor == 2 || flagcolor == 4)
- nc = psurf->dimzy; /* rappel: dimzy always equal n3*/
- else if(flagcolor == 3)
- nc = psurf->dimzx * psurf->dimzy;
-
- FREE(psurf->zcol);
-
- if ((psurf->zcol = MALLOC ( nc * sizeof (double))) == NULL)
- return -1;
-
- for (j = 0;j < nc; j++) /* nc value is dimzy*/
- psurf->zcol[j]= psurf->flag[0];
-
-
- if(flagcolor != 0 && flagcolor !=1){
- /* We need to rebuild ...->color matrix */
- if(psurf->cdatamapping == 0){ /* scaled */
- FREE(psurf->color);
- LinearScaling2Colormap(pobj);
- }
- else{
- int nc = psurf->nc;
-
- FREE(psurf->color);
-
- if(nc>0){
- if ((psurf->color = MALLOC (nc * sizeof (double))) == NULL)
- return -1;
- }
-
- for(i=0;i<nc;i++)
- psurf->color[i] = psurf->zcol[i];
- /* copy zcol that has just been freed and re-alloc + filled in */
- }
- }
- }
- }
-
- if(psurf->typeof3d==SCI_FAC3D) /* we have to deal with colors... and may be update because we just changed psurf->flag[0]*/
- if(psurf->flagcolor == 0)
- {
- pSURFACE_FEATURE (pobj)->izcol = 0;
- }
- }
- else
- {strcpy(error_message,"color_mode property does not exist for this handle");return -1;}
- }
- else if (strcmp(marker,"color_flag") == 0) {
- if (sciGetEntityType (pobj) == SCI_SURFACE) {
- if (*numrow * *numcol != 1)
- {strcpy(error_message,"Second argument must have 1 elements ");return -1;}
- if (pSURFACE_FEATURE (pobj)->typeof3d==SCI_PLOT3D) {
- if ((*stk(*value)<0)||(*stk(*value)>1))
- {strcpy(error_message,"Second argument must be equal to 0 or 1");return -1;}
- pSURFACE_FEATURE (pobj)->flagcolor= (int)stk(*value)[0];
- }
- else if (pSURFACE_FEATURE (pobj)->typeof3d==SCI_FAC3D)
- {
- int m3n,n3n,nc,j,ii,flagcolor=(int)stk(*value)[0];
- /*int *zcol;*/
- /*F.Leray psurf for debug*/
- sciSurface * psurf = pSURFACE_FEATURE (pobj);
-
- if ((*stk(*value)<0)||(*stk(*value)>4))
- {strcpy(error_message,"Second argument must be 0 1 2 3 or 4");return -1;}
-
-
- /* F.Leray 18.03.04 Something goes wrong here: No need to re-build/re-alloc zcol normally!!*/
- /* YES in fact but use of another fixed array named inputCMoV (inputColorMatrixorVector)*/
-
-
-
- if (pSURFACE_FEATURE (pobj)->flagcolor == stk(*value)[0])
- return 0;
-
- if(flagcolor == 0)
- {
- pSURFACE_FEATURE (pobj)->izcol = 0;
- }
- else if(flagcolor == 1)
- {
- pSURFACE_FEATURE (pobj)->izcol = 0;
- }
- else if(flagcolor == 2) /* Warning: here we need a color vector (one color per facet). N = 1 x dimzy */
- {
- m3n = pSURFACE_FEATURE (pobj)->m3n;
- n3n = pSURFACE_FEATURE (pobj)->n3n;
- nc = psurf->dimzy; /* rappel: dimzy always equal n3*/
-
- psurf->nc = nc;
- FREE(psurf->zcol); psurf->zcol = NULL;
-
- if(nc>0){
- if ((psurf->zcol = MALLOC (nc * sizeof (double))) == NULL)
- return -1;
- }
-
- if(m3n * n3n != 0 ){ /* There is either a color matrix or vector*/
- if( m3n==1 || n3n ==1)
- {
- /* We have just enough information to fill the psurf->zcol array*/
- for (j = 0;j < nc; j++) /* nc value is dimzx*dimzy == m3n * n3n */
- psurf->zcol[j]= psurf->inputCMoV[j];
- }
- else if (!( m3n==1 || n3n ==1))
- {
- /* We have too much information and we take only the first dimzy colors to fill the psurf->zcol array*/
- /* NO !! Let's do better; F.Leray 08.05.04 : */
- /* 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) */
- /* in our example: m3n=4 and n3n=400 */
- for (j = 0;j < nc; j++) /* nc value is dimzy*/
- {
- double tmp = 0;
- for(ii=0;ii<m3n;ii++)
- tmp = tmp + psurf->inputCMoV[j*m3n + ii];
- tmp = tmp / m3n;
- psurf->zcol[j]= tmp;
- }
- }
- }
- else if (m3n * n3n == 0) {/* There is no color matrix/vect. in input */
- for (j = 0;j < psurf->dimzy; j++) /* nc value is dimzy*/
- psurf->zcol[j]= psurf->flag[0];
- }
-
- }
- else if (flagcolor == 3) /* interpolated (shading) case */
- {
- m3n = pSURFACE_FEATURE (pobj)->m3n;
- n3n = pSURFACE_FEATURE (pobj)->n3n;
- nc = psurf->dimzx * psurf->dimzy;
-
- psurf->nc = nc;
- FREE(psurf->zcol); psurf->zcol = NULL;
-
-
- if ((psurf->zcol = MALLOC ( nc * sizeof (double))) == NULL)
- return -1;
-
-
- if(m3n * n3n != 0 ){ /* There is either a color matrix or vector*/
- if( m3n==1 || n3n ==1) /* COLOR VECTOR */
- {
- /* We have insufficient info. to fill the entire zcol array of dimension nc = dimzx*dimzy*/
- /* We repeat the data:*/
- for(i = 0; i< psurf->dimzy; i++){
- for (j = 0;j < psurf->dimzx; j++) /* nc value is dimzx*dimzy == m3n * n3n */
- psurf->zcol[(psurf->dimzx)*i+j]= psurf->inputCMoV[i];
- }
- }
- else if (!( m3n==1 || n3n ==1)) /* COLOR MATRIX */
- {
- /* We have just enough information to fill the psurf->zcol array*/
- for (j = 0;j < (psurf->dimzx) * (psurf->dimzy); j++) /* nc value is dimzy*/
- psurf->zcol[j]= psurf->inputCMoV[j];
- }
- }
- else if (m3n * n3n == 0) {/* There is no color matrix/vect. in input */
-
- for(i = 0; i< psurf->dimzy; i++){
- for (j = 0;j < psurf->dimzx; j++) /* nc value is dimzx*dimzy == m3n * n3n */
- psurf->zcol[( psurf->dimzx)*i+j]= psurf->flag[0];
- }
- }
- }
- /* New : case == 4 introduced on the 10.03.05 (F.Leray) to support faceted (flat) Matlab case */
- else if(flagcolor == 4) /* Warning: here we need a color vector (one color per facet). N = 1 x dimzy */
- {
- m3n = pSURFACE_FEATURE (pobj)->m3n;
- n3n = pSURFACE_FEATURE (pobj)->n3n;
- nc = psurf->dimzy; /* rappel: dimzy always equal n3*/
-
- psurf->nc = nc;
- FREE(psurf->zcol); psurf->zcol = NULL;
-
- if(nc>0){
- if ((psurf->zcol = MALLOC (nc * sizeof (double))) == NULL)
- return -1;
- }
-
- if(m3n * n3n != 0 ){ /* There is either a color matrix or vector */
- if( m3n==1 || n3n ==1)
- {
- /* We have just enough information to fill the psurf->zcol array*/
- for (j = 0;j < nc; j++) /* nc value is dimzx*dimzy == m3n * n3n */
- psurf->zcol[j]= psurf->inputCMoV[j];
- }
- else if (!( m3n==1 || n3n ==1))
- {
- /* input : color matrix , we use 1 color per facet with Matlab selection mode (no average computed) */
- /* HERE is the difference with case 2 */
- for (j = 0;j < nc; j++) /* nc value is dimzy*/
- psurf->zcol[j] = psurf->inputCMoV[j*m3n];
- }
- }
- else if (m3n * n3n == 0) {/* There is no color matrix/vect. in input */
- for (j = 0;j < psurf->dimzy; j++) /* nc value is dimzy*/
- psurf->zcol[j]= psurf->flag[0];
- }
- }
-
- if(flagcolor != 0 && flagcolor !=1){
- /* We need to rebuild ...->color matrix */
- if(psurf->cdatamapping == 0){ /* scaled */
- FREE(psurf->color);
- LinearScaling2Colormap(pobj);
- }
- else{
- int nc = psurf->nc;
-
- FREE(psurf->color);
-
- if(nc>0){
- if ((psurf->color = MALLOC (nc * sizeof (double))) == NULL)
- return -1;
- }
-
- for(i=0;i<nc;i++)
- psurf->color[i] = psurf->zcol[i];
- /* copy zcol that has just been freed and re-alloc + filled in */
- }
- }
-
- /* Finally, update the flagcolor */
- pSURFACE_FEATURE (pobj)->flagcolor = flagcolor;
-
- }
- }
- }
- else if (strcmp(marker,"cdata_mapping") == 0) {
- if (sciGetEntityType (pobj) == SCI_SURFACE) {
-
- sciSurface * ppSurf = pSURFACE_FEATURE ( pobj ) ;
-
- if ( ppSurf->typeof3d == SCI_FAC3D )
- {
- if ( (strcmp( cstk(*value), "scaled" ) == 0 ) )
- {
- if( ppSurf->cdatamapping != 0 )
- { /* not already scaled */
- LinearScaling2Colormap(pobj);
- ppSurf->cdatamapping = 0;
- }
- }
- else if ((strcmp(cstk(*value),"direct") == 0))
- {
- if(pSURFACE_FEATURE (pobj)->cdatamapping != 1)
- {
- /* not already direct */
- int nc = ppSurf->nc;
-
- FREE( ppSurf->color ) ;
- ppSurf->color = NULL ;
-
- /* printf("pSURFACE_FEATURE (pobj)->color = %d\n",pSURFACE_FEATURE (pobj)->color); */
- /* printf("nc = %d\n",nc); */
- /* fflush(NULL); */
-
- if(nc>0)
- {
- if ((ppSurf->color = MALLOC (nc * sizeof (double))) == NULL)
- {
- return -1;
- }
- }
-
- for( i = 0 ; i < nc ; i++ )
- {
- ppSurf->color[i] = ppSurf->zcol[i] ;
- }
-
- ppSurf->cdatamapping = 1 ;
- }
- }
- else
- {strcpy(error_message,"cdata_mapping value must be 'scaled' or 'direct'");return -1;}
- }
- else
- {strcpy(error_message,"cdata_mapping property only exists for Fac3d surfaces");return -1;}
- }
- else
- {strcpy(error_message,"cdata_mapping property does not exist for this handle");return -1;}
- }
-
- else if (strcmp(marker,"surface_color") == 0) {
- if (sciGetEntityType (pobj) == SCI_SURFACE) {
- if (pSURFACE_FEATURE (pobj)->typeof3d == SCI_PARAM3D1) {
- if (pSURFACE_FEATURE (pobj)->dimzy != *numrow * *numcol)
- {sprintf(error_message,"Second argument must have %d elements ",
- pSURFACE_FEATURE (pobj)->dimzy);return -1;}
- for (i=0;i<pSURFACE_FEATURE (pobj)->dimzy;i++)
- pSURFACE_FEATURE (pobj)->zcol[i]= (integer)stk(*value)[i];
- }
- else if (pSURFACE_FEATURE (pobj)->typeof3d == SCI_PLOT3D) {
- strcpy(error_message,"surface_color cannot be set in this case");
- return -1;
- }
- else if (pSURFACE_FEATURE (pobj)->typeof3d == SCI_FAC3D) {
- if (pSURFACE_FEATURE (pobj)->flagcolor<2){
- strcpy(error_message,"surface_color cannot be set in this case");
- return -1;
- }
- else {
- int N;
- if (pSURFACE_FEATURE (pobj)->flagcolor==2)
- N=pSURFACE_FEATURE (pobj)->dimzy;
- else
- N=pSURFACE_FEATURE (pobj)->dimzy * pSURFACE_FEATURE (pobj)->dimzx;
- if (*numrow * *numcol != N)
- {sprintf(error_message,"Second argument must have %d elements ",N);return -1;}
- for (i=0;i<N;i++)
- pSURFACE_FEATURE (pobj)->zcol[i]= (integer)stk(*value)[i];
- }
- }
- }
- else {
- strcpy(error_message,"surface_color property does not exist for this handle");
- return -1;
- }
- }
- else if (strcmp(marker,"triangles") == 0) {
- if (sciGetEntityType (pobj) == SCI_FEC) {
- double *pnoeud;
- if (*numcol != 5)
- {strcpy(error_message,"Second argument must have 5 columns ");return -1;}
- if (*numrow !=pFEC_FEATURE (pobj)->Ntr) {
- pnoeud=pFEC_FEATURE(pobj)->pnoeud;
- if ((pFEC_FEATURE(pobj)->pnoeud = MALLOC (*numrow * 5* sizeof (int))) == NULL){
- strcpy(error_message,"Not enough memory");
- pFEC_FEATURE(pobj)->pnoeud=pnoeud;
- return -1;
- }
- }
- for (i=0;i<*numrow*5;i++)
- pFEC_FEATURE (pobj)->pnoeud[i]=stk(*value)[i];
- }
- else
- {strcpy(error_message,"triangles property does not exist for this handle");return -1;}
+ else if (strcmp(marker,"color_mode") == 0)
+ {
+ return set_color_mode_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
- else if (strcmp(marker,"z_bounds") == 0) {
- if (sciGetEntityType (pobj) == SCI_FEC) {
- if (*numcol * *numrow!= 2)
- {strcpy(error_message,"Second argument must have 2 elements ");return -1;}
-
- for (i=0;i<2;i++)
- pFEC_FEATURE (pobj)->zminmax[i]=stk(*value)[i];
- }
- else
- {strcpy(error_message,"z_bounds property does not exist for this handle");return -1;}
+ else if (strcmp(marker,"color_flag") == 0)
+ {
+ return set_color_flag_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
+ else if (strcmp(marker,"cdata_mapping") == 0)
+ {
+ return set_cdata_mapping_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
+ else if (strcmp(marker,"surface_color") == 0)
+ {
+ return set_surface_color_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
+ else if (strcmp(marker,"triangles") == 0)
+ {
+ return set_triangles_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
+ else if (strcmp(marker,"z_bounds") == 0)
+ {
+ return set_z_bounds_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"handle_visible") == 0)
{
- if (sciGetEntityType (pobj) == SCI_UIMENU)
- {
- if ((strcmp(cstk(*value),"on") == 0))
- pUIMENU_FEATURE(pobj)->handle_visible=TRUE;
- else if ((strcmp(cstk(*value),"off") == 0))
- pUIMENU_FEATURE(pobj)->handle_visible=FALSE;
- else
- {
- strcpy(error_message,"Value must be 'on' or 'off'");
- return -1;
- }
- }
- else
- {
- strcpy(error_message,"handle_visible property does not exist for this handle");
- return -1;
- }
+ return set_handle_visible_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"callback_type") == 0)
{
- if (sciGetEntityType (pobj) == SCI_UIMENU)
- {
- if ((strcmp(cstk(*value),"string") == 0))
- {
- pUIMENU_FEATURE(pobj)->CallbackType=0;
- }
- else
- if ((strcmp(cstk(*value),"C") == 0))
- {
- pUIMENU_FEATURE(pobj)->CallbackType=1;
- }
- else
- if ((strcmp(cstk(*value),"internal") == 0))
- {
- pUIMENU_FEATURE(pobj)->CallbackType=2;
- }
- else
- if ((strcmp(cstk(*value),"addmenu") == 0))
- {
- pUIMENU_FEATURE(pobj)->CallbackType=3;
- }
- else
- {
- strcpy(error_message,"Value must be 'string','C','internal','addmenu'");
- return -1;
- }
- }
- else
- {
- strcpy(error_message,"callback_type property does not exist for this handle");
- return -1;
- }
+ return set_callback_type_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if (strcmp(marker,"menu_enable") == 0)
{
- if (sciGetEntityType (pobj) == SCI_UIMENU)
- {
- if ((strcmp(cstk(*value),"on") == 0))
- {
- if (pUIMENU_FEATURE(pobj)->Enable != TRUE)
- {
- pUIMENU_FEATURE(pobj)->Enable=TRUE;
- }
-
- }
- else
- if ((strcmp(cstk(*value),"off") == 0))
- {
- if (pUIMENU_FEATURE(pobj)->Enable != FALSE)
- {
- pUIMENU_FEATURE(pobj)->Enable=FALSE;
- }
- }
- else
- {
- strcpy(error_message,"Value must be 'on' or 'off'");
- return -1;
- }
- }
- else
- {
- strcpy(error_message,"menu_enable property does not exist for this handle");
- return -1;
- }
+ return set_menu_enable_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else if( strcmp(marker,"hidden_axis_color") == 0 )
{
- if ( sciGetEntityType (pobj) == SCI_SUBWIN )
- {
- int haColor = (int) *stk(*value) ;
- int colormapSize = sciGetNumColors(pobj) ;
- if ( haColor >= -2 && haColor <= colormapSize + 1 )
- {
- pSUBWIN_FEATURE(pobj)->axes.hiddenAxisColor = haColor ;
- }
- }
- else
- {
- strcpy(error_message,"hidden_axis_color property does not exist for this handle");
- return -1;
- }
+ return set_hidden_axis_color_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
+ else if ( strcmp(marker,"user_data") == 0 )
+ {
+ return set_user_data_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
+ else if ( strcmp(marker,"x_ticks") == 0 )
+ {
+ return set_x_ticks_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
+ else if ( strcmp(marker,"y_ticks") == 0 )
+ {
+ return set_x_ticks_property( pobj, *value, valueType, *numrow, *numcol ) ;
+ }
+ else if ( strcmp(marker,"z_ticks") == 0 )
+ {
+ return set_x_ticks_property( pobj, *value, valueType, *numrow, *numcol ) ;
}
else
- {
- sprintf(error_message,"Unknown property %s",marker);
- return -1;
- }
- return 0;
+ {
+ sciprint( "Unknown property %s.\n", marker ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+ return SET_PROPERTY_ERROR ;
}
/*-----------------------------------------------------------------------------------*/
-/* Called by a.log_flags='nn','ln','nl', or 'll'*/
-/* For the moment, z has no logflag F.Leray 05.10.04 */
-char ** ReBuildUserTicks( char old_logflag, char new_logflag, double * u_xgrads, int *u_nxgrads, char ** u_xlabels)
-{
- if(old_logflag==new_logflag) return u_xlabels; /* nothing to do l->l or n->n */
+/*-----------------------------------------------------------
+ * sciset(choice-name,x1,x2,x3,x4,x5)
+ * or xset()
+ *-----------------------------------------------------------*/
+int sci_set(fname,fname_len)
+ char *fname;
+ unsigned long fname_len;
+{
+ integer m1,n1,l1,m2,n2,l2,numrow3,numcol3,l3,num,cur,na,verb=0;
+ unsigned long hdl;
+ int lw,t2;
+ BOOL vis_save = FALSE ;
+ sciPointObj *pobj;
- if(u_xgrads!=NULL)
- {
- if(old_logflag=='n' && new_logflag=='l') /* n->l */ /* 10-> 1, 100->2 ...*/
- {
+ int valueType = 0 ; /* type of the rhs */
- u_xlabels=CaseLogflagN2L(u_nxgrads,u_xgrads,u_xlabels);
+ int numrow[4],i;
+ int numcol[4], lxyzcol[4];
+ int ptrindex[2];
+ int flagc = -1;
+ int setStatus = 0 ; /* after the call to sciSet get the status : 0 <=> OK, */
+ /* -1 <=> Error, */
+ /* 1 <=> nothing done */
- }
- else if(old_logflag=='l' && new_logflag=='n')
- {
- int nbtics = *u_nxgrads;
- int i;
+ /* F.Leray Init. to 0*/
+ for(i=0;i<4;i++){
+ numrow[i] = 0;
+ numcol[i] = 0;
+ lxyzcol[i] = 0;
+ }
+ ptrindex[0] = 0;
+ ptrindex[1] = 0;
- for(i=0;i<nbtics;i++) u_xgrads[i] = exp10(u_xgrads[i]);
+ CheckRhs(2,3);
+ CheckLhs(0,1);
+ /* set or create a graphic window */
+ switch(VarType(1))
+ {
+ case 1: /* tclsci handle */
+ lw = 1 + Top - Rhs;
+ C2F(overload)(&lw,"set",3);return 0;
+ return 0;
+ break;
+ case 9: /* first is a scalar argument so it's a gset(hdl,"command",[param]) */
+ /* F.Leray; INFO: case 9 is considered for a matrix of graphic handles*/
+ CheckRhs(3,3);
+ GetRhsVar(1,"h",&m1,&n1,&l1); /* Gets the Handle passed as argument */
+ if ( *hstk(l1) != sciGetHandle(getFigureModel()) && *hstk(l1) != sciGetHandle(getAxesModel())
+ && *hstk(l1) != sciGetHandle(pSUBWIN_FEATURE(getAxesModel())->mon_title)
+ && *hstk(l1) != sciGetHandle(pSUBWIN_FEATURE(getAxesModel())->mon_x_label)
+ && *hstk(l1) != sciGetHandle(pSUBWIN_FEATURE(getAxesModel())->mon_y_label) /* Addings here F.Leray 10.06.04 */
+ && *hstk(l1) != sciGetHandle(pSUBWIN_FEATURE(getAxesModel())->mon_z_label))
+ {
+ if (m1!=1||n1!=1) {
+ lw = 1 + Top - Rhs;
+ C2F(overload)(&lw,"set",3);return 0;
+ }
+ if (version_flag() ==0)
+ hdl = (unsigned long)*hstk(l1); /* Puts the value of the Handle to hdl */
+ else
+ hdl = (unsigned long)0;
+ if (hdl == (unsigned long)0 )
+ pobj = (sciPointObj *) NULL;
+ else
+ pobj = sciGetPointerFromHandle(hdl);
+ }
+ else
+ {
+ hdl = (unsigned long)*hstk(l1);
+ pobj = sciGetPointerFromHandle(hdl);
}
- }
-
- return u_xlabels;
-}
-/*-----------------------------------------------------------------------------------*/
-/* Remove negative graduations when switching from N (linear) to L (logarithmic) scale */
-char ** CaseLogflagN2L(int * u_nxgrads, double *u_xgrads, char ** u_xlabels)
-{
- int nbtics = *u_nxgrads;
- int i;
- char ** ticklabel = (char **) NULL;
- int cmpteur = 0, cmpteur2 = 0, offset = 0;
+ GetRhsVar(2,"c",&m2,&n2,&l2); /* Gets the command name */
+ if ( *hstk(l1) != sciGetHandle(getFigureModel()) && *hstk(l1) != sciGetHandle(getAxesModel())
+ && *hstk(l1) != sciGetHandle(pSUBWIN_FEATURE(getAxesModel())->mon_title)
+ && *hstk(l1) != sciGetHandle(pSUBWIN_FEATURE(getAxesModel())->mon_x_label)
+ && *hstk(l1) != sciGetHandle(pSUBWIN_FEATURE(getAxesModel())->mon_y_label)
+ && *hstk(l1) != sciGetHandle(pSUBWIN_FEATURE(getAxesModel())->mon_z_label))
+ {
+ if ((strcmp(cstk(l2),"old_style") !=0)
+ &&(strcmp(cstk(l2),"default_figure") !=0)
+ && (strcmp(cstk(l2),"default_axes") !=0) ) { SciWin() ; }
+ }
- for(i=0;i<nbtics;i++)
- {
- if(u_xgrads[i]<=0){
- sciprint("Warning: graduation number %d is ignored : when switching to logarithmic scale, we must have strictly positive graduations!\n",i);
+ valueType = VarType(3) ;
+
+ if ( valueType == 1 )
+ {
+ GetRhsVar(3,"d",&numrow3,&numcol3,&l3) ;
+ }
+ else if ( valueType == 9 )
+ {
+ GetRhsVar(3,"h",&numrow3,&numcol3,&l3);
+ }
+ else if ( valueType == 10 )
+ {
+ if ( strcmp( cstk(l2), "tics_labels" ) != 0
+ && strcmp( cstk(l2), "auto_ticks" ) != 0
+ && strcmp( cstk(l2), "axes_visible" ) != 0
+ && strcmp( cstk(l2), "axes_reverse" ) != 0
+ && strcmp( cstk(l2), "text" ) != 0 )
+ {
+ GetRhsVar(3,"c",&numrow3,&numcol3,&l3);
+ }
+ else
+ {
+ GetRhsVar(3,"S",&numrow3,&numcol3,&l3);
+ }
}
+ break;
+ case 10:/* first is a string argument so it's a gset("command",[param]) */
+ CheckRhs(2,2);
+ GetRhsVar(1,"c",&m2,&n2,&l2);
+ if (strcmp(cstk(l2),"default_figure") !=0 && strcmp(cstk(l2),"default_axes") !=0 )
+ {
+ if ((strcmp(cstk(l2),"old_style") ==0) ||
+ (strcmp(cstk(l2),"current_figure") ==0)) {
+ hdl = (unsigned long)0;
+ pobj = (sciPointObj *) NULL;
+ }
+ else
+ {
+ SciWin();
+ if (version_flag() == 0 )
+ if ((strcmp(cstk(l2),"zoom_") !=0) &&
+ (strcmp(cstk(l2),"auto_") !=0) &&
+ (strcmp(cstk(l2),"clip_box") !=0) )
+ hdl = (unsigned long ) sciGetHandle(sciGetCurrentObj ()) ;
+ else
+ hdl = (unsigned long ) sciGetHandle(sciGetSelectedSubWin (sciGetCurrentFigure ()));
+ else
+ hdl = (unsigned long)0;
+ if (hdl == (unsigned long)0 )
+ pobj = (sciPointObj *) NULL;
+ else
+ pobj = sciGetPointerFromHandle(hdl);
+ }
+ }
else
{
- u_xgrads[cmpteur] = log10(u_xgrads[i]);
- cmpteur++;
+ hdl = (unsigned long)0;
+ pobj = (sciPointObj *) NULL;
+ }
+ valueType = VarType(2) ;
+ t2=sciType(cstk(l2),pobj);
+ if (t2<0) {
+ Scierror(999,"%s: unknown property name '%s' \r\n",fname,cstk(l2));
+ return 0;}
+ if ( valueType != t2 )
+ if(strcmp(cstk(l2),"current_figure") != 0 && VarType(2) !=1 ){
+ /* F.Leray : special unique case here set("current_figure", HANDLE);*/
+ /* HANDLE type is 9 */
+ Scierror(999,"%s: uncompatible values for property type '%s' \r\n",fname,cstk(l2));
+ return 0;
}
+
+ if (valueType == 1 )
+ {
+ GetRhsVar(2,"d",&numrow3,&numcol3,&l3);
+ }
+ else if ( valueType == 9 )
+ {
+ GetRhsVar(2,"h",&numrow3,&numcol3,&l3);
+ }
+ else if ( valueType == 10 )
+ {
+ if ( strcmp( cstk(l2), "tics_labels" ) != 0
+ && strcmp( cstk(l2), "auto_ticks" ) != 0
+ && strcmp( cstk(l2), "axes_visible" ) != 0
+ && strcmp( cstk(l2), "axes_reverse" ) != 0
+ && strcmp( cstk(l2), "text" ) != 0 )
+ {
+ GetRhsVar(2,"c",&numrow3,&numcol3,&l3);
+ }
+ else
+ {
+ GetRhsVar(2,"S",&numrow3,&numcol3,&l3);
+ }
+ }
+ break;
+ default:
+ lw = 1 + Top - Rhs;
+ C2F(overload)(&lw,"set",3);return 0;
+ break;
}
- if(cmpteur != nbtics)
+ if ( (hdl != (unsigned long)0) ) { /* F.Leray 16.03.04*/
+ pobj = sciGetPointerFromHandle(hdl);
+ if ( pobj == NULL )
{
- if((ticklabel=(char **)MALLOC(cmpteur*sizeof(char *)))==NULL){
- sciprint("No more place for allocating ticklabel");
- }
+ Scierror(999,"%s :the handle is not or no more valid\r\n",fname);
+ return 0;
+ }
+ vis_save = sciGetVisibility(pobj) ; /*used not to redraw the figure is object remains invisible SS 20.04.04*/
+ if ( (setStatus = sciSet(pobj, cstk(l2), &l3, valueType, &numrow3, &numcol3)) < 0 )
+ {
+ return 0 ;
+ }
- cmpteur2 = 0;
- offset = nbtics - cmpteur;
- for(i=0;i<cmpteur;i++){
- if((ticklabel[cmpteur2]=(char *)MALLOC((strlen(u_xlabels[i+offset])+1)*sizeof(char )))==NULL){
- sciprint("No more place for allocating ticklabel");
- }
- strcpy(ticklabel[cmpteur2],u_xlabels[i+offset]);
- cmpteur2++;
- }
+ if ( !( vis_save == 0 && sciGetVisibility(pobj)==0 ) && setStatus == 0 )
+ {
+ /* do not redraw figure if object remains invisible */
+ if ((strcmp(cstk(l2),"figure_style") !=0) &&
+ (strcmp(cstk(l2),"old_style") !=0 ) &&
+ (strcmp(cstk(l2),"current_axes") !=0) &&
+ (strcmp(cstk(l2),"default_figure") !=0) &&
+ (strcmp(cstk(l2),"default_axes") !=0) &&
+ (pobj != getFigureModel()) && (pobj != getAxesModel())
+ && pobj != pSUBWIN_FEATURE(getAxesModel())->mon_title
+ && pobj != pSUBWIN_FEATURE(getAxesModel())->mon_x_label
+ && pobj != pSUBWIN_FEATURE(getAxesModel())->mon_y_label
+ && pobj != pSUBWIN_FEATURE(getAxesModel())->mon_z_label )
+ {
+ /* Addings F.Leray 10.06.04 */
+ num= sciGetNumFigure (pobj);
+ C2F (dr) ("xget", "window",&verb,&cur,&na,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+ C2F (dr) ("xset", "window",&num,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
- for(i=0;i<nbtics;i++){ FREE(u_xlabels[i]); u_xlabels[i] = NULL;}
+ sciDrawObj(sciGetParentFigure(pobj)); /* F.Leray we redraw here*/
+ /* EraseAndOrRedraw(pobj); */ /* inhibit EraseAndOrRedraw for now F.Leray 20.12.04 */
- FREE(u_xlabels); u_xlabels = NULL;
- u_xlabels = ticklabel;
- }
- *u_nxgrads = cmpteur;
- cmpteur = 0;
- cmpteur2 = 0;
+ C2F (dr) ("xset", "window",&cur,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
+ }
+ }
+ }
+ else if ( ( setStatus = sciSet( NULL, cstk(l2), &l3, valueType, &numrow3, &numcol3) ) < 0 )
+ {
+ return 0;
+ }
- return u_xlabels;
+ LhsVar(1)=0;
+ return 0;
}
-/*-----------------------------------------------------------------------------------*/
memcpy( dest, src, nbElement * sizeof(double) ) ;
}
/*------------------------------------------------------------------------*/
+void intArrayCopy( int dest[], const int src[], int nbElement )
+{
+ memcpy( dest, src, nbElement * sizeof(int) ) ;
+}
+/*------------------------------------------------------------------------*/
+void stringArrayCopy( char * dest[], const char * src[], int nbElement )
+{
+ int i ;
+ for ( i = 0 ; i < nbElement ; i++ )
+ {
+ int elemSize = strlen( src[i] ) + 1 ;
+ FREE( dest[i] ) ;
+
+ dest[i] = MALLOC( elemSize * sizeof(char) ) ;
+
+ if ( dest[i] == NULL )
+ {
+ destroyStringArray( dest, nbElement ) ;
+ return ;
+ }
+
+ strcpy( dest[i], src[i] ) ;
+ }
+}
+/*------------------------------------------------------------------------*/
void setDoubleArraySingleValue( double dest[], double value, int nbElement )
{
int i ;
}
/*------------------------------------------------------------------------*/
+void destroyStringArray( char * src[], int nbStrings )
+{
+ int i ;
+ for ( i = 0 ; i < nbStrings ; i++ )
+ {
+ FREE( src[i] ) ;
+ src[i] = NULL ;
+ }
+ FREE( src ) ;
+}
+/*-----------------------------------------------------------------------------------*/
+int * createIntArrayCopy( const int src[], int nbElement )
+{
+ int * res = MALLOC( nbElement * sizeof(int) ) ;
+
+ if ( res == NULL )
+ {
+ return NULL ;
+ }
+
+ memcpy( res, src, nbElement * sizeof(int) ) ;
+
+ return res ;
+}
+/*-----------------------------------------------------------------------------------*/
+char ** createStringArrayCopy( const char * src[], int nbElement )
+{
+ int i ;
+ char ** res = MALLOC( nbElement * sizeof(char *) ) ;
+
+ if ( res == NULL )
+ {
+ return NULL ;
+ }
+
+ for ( i = 0 ; i < nbElement; i++ )
+ {
+ res[i] = NULL ;
+ }
+
+ stringArrayCopy( res, src, nbElement ) ;
+
+ return res ;
+
+}
+/*-----------------------------------------------------------------------------------*/
\ No newline at end of file
#include "Format.h"
#include "MALLOC.h"
#include "GetProperty.h"
+#include "BasicAlgos.h"
/* Add those lines for FD algo on Theticks */
#define ROUND(x) (x<0?ceil((x)-0.5):floor((x)+0.5))
}
/*-----------------------------------------------------------------------------------*/
-void destroyStringArray( char * src[], int nbStrings )
-{
- int i ;
- for ( i = 0 ; i < nbStrings ; i++ )
- {
- FREE( src[i] ) ;
- src[i] = NULL ;
- }
- FREE( src ) ;
-}
-/*-----------------------------------------------------------------------------------*/
#undef ROUND
#undef ABS
}
-
+/**
+ * Don't use this ugly function !!!! (Jb Silvy)
+ * 130 strcmp for to know the type of a parameter
+ */
int sciType (marker, pobj)
char *marker;
sciPointObj * pobj;
* when using log scales
*-------------------------------------------*/
-void set_scale(flag,subwin,frame_values,aaint,logflag,axis_values)
- char flag[6]; /* flag[i] = 't' or 'f' */
- double subwin[4]; /* subwindow specification */ /* <=> WRect*/
- double frame_values[4]; /* [xmin,ymin,xmax,ymax] */
- integer aaint[4]; /* [xint,x_subint,y_int,y_subint]*/
- char logflag[3]; /* [xlogflag,ylogflag,zlogflag (NOT USED HERE)] */
- double axis_values[4]; /* [mfact_xl, mfact_xr,mfact_yu,mfact_yd]; */
+void set_scale( char flag[6] ,
+ double subwin[4] ,
+ double frame_values[4],
+ integer aaint[4] ,
+ char logflag[3] ,
+ double axis_values[4] )
+ /* flag[i] = 't' or 'f' */
+ /* subwindow specification */ /* <=> WRect*/
+ /* [xmin,ymin,xmax,ymax] */
+ /* [xint,x_subint,y_int,y_subint]*/
+ /* [xlogflag,ylogflag,zlogflag (NOT USED HERE)] */
+ /* [mfact_xl, mfact_xr,mfact_yu,mfact_yd]; */
{
char c;
char wdim_changed= 'f',subwin_changed='f';
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: CheckTicksProperty.h */
+/* Copyright INRIA 2006 */
+/* Authors : Jean-Baptiste Silvy */
+/* desc : generic function to retrieve the assigned x_ticks, y_ticks or */
+/* z_ticks property */
+/*------------------------------------------------------------------------*/
+
+#include "CheckTicksProperty.h"
+
+/*----------------------------------------------------------------------------------*/
+AssignedList * createTlistForTicks( void )
+{
+ AssignedList * tlist = NULL ;
+ int nbRowLoc = 0 ;
+ int nbColLoc = 0 ;
+ int nbRowLab = 0 ;
+ int nbColLab = 0 ;
+
+ tlist = createAssignedList( 3, 2 ) ;
+
+ if( !isListCurrentElementDoubleMatrix( tlist ) )
+ {
+ sciprint("locations should be a vector of double.\n") ;
+ return NULL ;
+ }
+
+ getCurrentDoubleMatrixFromList( tlist, &nbRowLoc, &nbColLoc ) ;
+
+ if ( nbRowLoc * nbColLoc == 0 )
+ {
+ /* labels should also be an empty matrix */
+ if ( !isListCurrentElementEmptyMatrix( tlist ) )
+ {
+ sciprint( "Ticks location and label vectors must have the same size.\r\n" ) ;
+ return NULL ;
+ }
+ }
+ else
+ {
+ if ( !isListCurrentElementStringMatrix( tlist ) )
+ {
+ sciprint("labels should be a string vector.\n") ;
+ return NULL ;
+ }
+
+ getCurrentStringMatrixFromList( tlist, &nbRowLab, &nbColLab ) ;
+
+ if ( nbRowLoc != nbRowLab || nbColLoc != nbColLab )
+ {
+ sciprint( "Ticks location and label vectors must have the same size.\r\n" ) ;
+ return NULL ;
+ }
+ }
+
+ rewindAssingnedList( tlist ) ;
+
+ return tlist ;
+
+}
+/*----------------------------------------------------------------------------------*/
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: CheckTicksProperty.h */
+/* Copyright INRIA 2006 */
+/* Authors : Jean-Baptiste Silvy */
+/* desc : generic function to retrieve the assigned x_ticks, y_ticks or */
+/* z_ticks property */
+/*------------------------------------------------------------------------*/
+
+#ifndef _CHECK_TICKS_PROPERTY_C_
+#define _CHECK_TICKS_PROPERTY_C_
+
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "GetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "sciprint.h"
+
+/**
+ * create a new assigne dlist which allow to easily retrieve the ticks
+ * properties from the stack. Moreover the functgion checked if the list
+ * contains the right properties.
+ * @return the newly created list or NULL if an error occured.
+ */
+AssignedList * createTlistForTicks( void ) ;
+
+#endif /* _CHECK_TICKS_PROPERTY_C_ */
if ( accessor == NULL )
{
sciprint( "Unknown property.\n" ) ;
- return 1 ;
+ return -1 ;
}
return accessor( pObj ) ;
}
if ( status1 == SET_PROPERTY_ERROR || status2 == SET_PROPERTY_ERROR )
{
/* problem */
- return -1 ;
+ return SET_PROPERTY_ERROR ;
}
else if ( status1 == SET_PROPERTY_UNCHANGED && status2 == SET_PROPERTY_UNCHANGED )
{
/* nothing changed */
- return 1 ;
+ return SET_PROPERTY_UNCHANGED ;
}
else
{
/* everything should be ok */
- return 0 ;
+ return SET_PROPERTY_SUCCEED ;
}
}
#include "stack-c.h"
#include "sciprint.h"
#include "MALLOC.h"
+#include "BasicAlgos.h"
/*-----------------------------------------------------------------------------------*/
-BOOL isParameterHandle( int paramNum )
+BOOL isParameterHandle( int type )
{
- return ( VarType( paramNum ) == 9 ) ;
+ return ( type == 9 ) ;
}
/*-----------------------------------------------------------------------------------*/
-BOOL isParameterDoubleMatrix( int paramNum )
+BOOL isParameterDoubleMatrix( int type )
{
- return ( VarType( paramNum ) == 1 ) ;
+ return ( type == 1 ) ;
}
/*-----------------------------------------------------------------------------------*/
-BOOL isParameterTlist( int paramNum )
+BOOL isParameterTlist( int type )
{
- return ( VarType( paramNum ) == 16 ) ;
+ return ( type == 16 ) ;
+}
+/*-----------------------------------------------------------------------------------*/
+BOOL isParameterStringMatrix( int type )
+{
+ return ( type == 10 ) ;
}
/*-----------------------------------------------------------------------------------*/
double getDoubleFromStack( int stackPointer )
}
/*-----------------------------------------------------------------------------------*/
void copyDoubleVectorFromStack( int stackPointer, double dest[], int nbElement )
-{
+{
+ doubleArrayCopy( dest, getDoubleMatrixFromStack( stackPointer ), nbElement ) ;
+}
+/*-----------------------------------------------------------------------------------*/
+void copyDoubleVectorToIntFromStack( int stackPointer, int dest[], int nbElement )
+{
int i ;
- double * stackValue = getDoubleMatrixFromStack( stackPointer ) ;
-
+ double * values = getDoubleMatrixFromStack( stackPointer ) ;
for ( i = 0 ; i < nbElement ; i++ )
{
- dest[i] = stackValue[i] ;
+ dest[i] = (int) values[i] ;
}
}
/*-----------------------------------------------------------------------------------*/
+double * createCopyDoubleVectorFromStack( int stackPointer, int nbElement )
+{
+ double * res = MALLOC( nbElement * sizeof(double) ) ;
+ if ( res == NULL )
+ {
+ return NULL ;
+ }
+ copyDoubleVectorFromStack( stackPointer, res, nbElement ) ;
+ return res ;
+}
+/*-----------------------------------------------------------------------------------*/
char * getStringFromStack( int stackPointer )
{
return cstk( stackPointer ) ;
return (char **) stackPointer ;
}
/*-----------------------------------------------------------------------------------*/
+char ** createCopyStringMatrixFromStack( int stackPointer, int nbElement )
+{
+ int i ;
+ char ** res = MALLOC( nbElement * sizeof(char *) ) ;
+ char ** values = getStringMatrixFromStack( stackPointer ) ;
+
+ if ( res == NULL )
+ {
+ return NULL ;
+ }
+
+ for ( i = 0 ; i < nbElement ; i++ )
+ {
+ int size = strlen( values[i] ) + 1 ;
+ res[i] = MALLOC( size * sizeof(char) ) ;
+
+ if ( res[i] == NULL )
+ {
+ /* deallocate what have been allocated */
+ int j ;
+ for ( j = 0 ; j < i ; j++ )
+ {
+ FREE( res[j] ) ;
+ }
+ FREE( res ) ;
+ return NULL ;
+ }
+
+ strcpy( res[i], values[i] ) ;
+ }
+
+ return res ;
+
+}
+/*-----------------------------------------------------------------------------------*/
unsigned long getHandleFromStack( int stackPointer )
{
return (unsigned long) *(hstk( stackPointer )) ;
list->curElement = 2 ;
}
/*-----------------------------------------------------------------------------------*/
+BOOL isListCurrentElementDoubleMatrix( AssignedList * list )
+{
+ return ( ElementType( list->paramNumber, list->curElement ) == 1 ) ;
+}
+/*-----------------------------------------------------------------------------------*/
+BOOL isListCurrentElementStringMatrix( AssignedList * list )
+{
+ return ( ElementType( list->paramNumber, list->curElement ) == 10 ) ;
+}
+/*-----------------------------------------------------------------------------------*/
+BOOL isListCurrentElementEmptyMatrix( AssignedList * list )
+{
+ int nbRow = 0 ;
+ int nbCol = 0 ;
+
+ if ( !isListCurrentElementDoubleMatrix( list ) )
+ {
+ /* empty matrix is a double matrix */
+ return FALSE ;
+ }
+
+ getDoubleMatrixFromList( list, list->curElement, &nbRow, &nbCol ) ;
+
+ if ( nbRow * nbCol == 0 )
+ {
+ return TRUE ;
+ }
+
+ return FALSE ;
+
+}
+/*-----------------------------------------------------------------------------------*/
double * getDoubleMatrixFromList( AssignedList * list, int rank, int * nbRow, int * nbCol )
{
int valueStackPointer = 0 ;
return getDoubleMatrixFromStack( valueStackPointer ) ;
}
/*-----------------------------------------------------------------------------------*/
+char ** getStringMatrixFromList( AssignedList * list, int rank, int * nbRow, int * nbCol )
+{
+ int valueStackPointer = 0 ;
+ GetListRhsVar( list->paramNumber, rank, "S", nbRow, nbCol, &valueStackPointer ) ;
+
+ return getStringMatrixFromStack( valueStackPointer ) ;
+}
+/*-----------------------------------------------------------------------------------*/
double * getCurrentDoubleMatrixFromList( AssignedList * list, int * nbRow, int * nbCol )
{
double * res = NULL ;
return res ;
}
/*-----------------------------------------------------------------------------------*/
+char ** getCurrentStringMatrixFromList( AssignedList * list, int * nbRow, int * nbCol )
+{
+ char ** res = NULL ;
+ if ( list->curElement > list->nbElement )
+ {
+ *nbRow = 0 ;
+ *nbCol = 0 ;
+ return NULL ;
+ }
+
+ res = getStringMatrixFromList( list, list->curElement, nbRow, nbCol ) ;
+ list->curElement++ ;
+ return res ;
+
+}
+/*-----------------------------------------------------------------------------------*/
double * createCopyDoubleMatrixFromList( AssignedList * list, int * nbRow, int * nbCol )
{
- int i ;
/* get the matrix */
double * stackValues = getCurrentDoubleMatrixFromList( list, nbRow, nbCol ) ;
+ int nbElement = (*nbRow) * (*nbCol) ;
- /* copy */
- double * copyMatrix = MALLOC( (*nbRow) * (*nbCol) * sizeof( double ) ) ;
+ double * copyMatrix = NULL ;
- if ( copyMatrix == NULL )
+ if ( nbElement == 0 )
{
return NULL ;
}
- for ( i = 0 ; i < (*nbRow) * (*nbCol) ; i++ )
- {
- copyMatrix[i] = stackValues[i] ;
+ /* copy */
+
+ copyMatrix = MALLOC( (*nbRow) * (*nbCol) * sizeof( double ) ) ;
+
+ if ( copyMatrix == NULL )
+ {
+ *nbRow = -1 ;
+ *nbCol = -1 ;
+ return NULL ;
}
+ doubleArrayCopy( copyMatrix, stackValues, nbElement ) ;
+
return copyMatrix ;
}
-/*-----------------------------------------------------------------------------------*/
\ No newline at end of file
+/*-----------------------------------------------------------------------------------*/
+char ** createCopyStringMatrixFromList( AssignedList * list, int * nbRow, int * nbCol )
+{
+ /* get the matrix */
+ char ** stackValues = getCurrentStringMatrixFromList( list, nbRow, nbCol ) ;
+ int nbElement = (*nbRow) * (*nbCol) ;
+
+ if ( nbElement == 0 )
+ {
+ return NULL ;
+ }
+
+ return createStringArrayCopy( stackValues, nbElement ) ;
+}
+/*-----------------------------------------------------------------------------------*/
/* Basic type parameters */
/**
* return if a stack parameter is a Handle
- * @param paramNum Rank of the parameter in the called primitive
+ * @param type type of the parameter
*/
-BOOL isParameterHandle( int paramNum ) ;
+BOOL isParameterHandle( int type ) ;
/**
* return if a stack parameter is a Handle
- * @param paramNum Rank of the parameter in the called primitive
+ * @param type type of the parameter
*/
-BOOL isParameterDoubleMatrix( int paramNum ) ;
+BOOL isParameterDoubleMatrix( int type ) ;
/**
* return if a stack parameter is a tlist
- * @param paramNum Rank of the parameter in the called primitive
+ * @param type type of the parameter
**/
-BOOL isParameterTlist( int paramNum ) ;
+BOOL isParameterTlist( int type ) ;
+
+/**
+ * return if a stack parameter is a string matrix
+ * @param type type of the parameter
+ */
+BOOL isParameterStringMatrix( int type ) ;
/**
* retrieve a single double from the stack
void copyDoubleVectorFromStack( int stackPointer, double dest[], int nbElement ) ;
/**
+ * copy a double vector from the scilab stack to an int array
+ * with int cast for each parameter.
+ */
+void copyDoubleVectorToIntFromStack( int stackPointer, int dest[], int nbElement ) ;
+
+/**
+ * create a copy of a vector (or Matrix) of double stored in the stack
+ */
+double * createCopyDoubleVectorFromStack( int stackPointer, int nbElement ) ;
+
+/**
* retrieve a string on from the scilab stack
*/
char * getStringFromStack( int stackPointer ) ;
char ** getStringMatrixFromStack( int stackPointer ) ;
/**
+ * create a copy of a stringMatrix which is in the stack
+ */
+char ** createCopyStringMatrixFromStack( int stackPointer, int nbElement ) ;
+
+/**
* retireve a string on from the scilab stack
*/
unsigned long getHandleFromStack( int stackPointer ) ;
void rewindAssingnedList( AssignedList * list ) ;
/**
+ * Return whether the current element of the list is a double matrix or not.
+ */
+BOOL isListCurrentElementDoubleMatrix( AssignedList * list ) ;
+
+/**
+* Return whether the current element of the list is a string matrix or not.
+*/
+BOOL isListCurrentElementStringMatrix( AssignedList * list ) ;
+
+/**
+* Return whether the current element of the list is an empty matrix or not.
+*/
+BOOL isListCurrentElementEmptyMatrix( AssignedList * list ) ;
+
+/**
* retrieve a field of a tlist
* @param[in] list object used to retrieve elements
* @param rank position of the element in the list ( first, second, ...)
double * getDoubleMatrixFromList( AssignedList * list, int rank, int * nbRow, int * nbCol ) ;
/**
+* retrieve a field of a tlist
+* @param[in] list object used to retrieve elements
+* @param rank position of the element in the list ( first, second, ...)
+* Note that is it not possible to get the properties names with this function
+* @param[out] nbRow number of row of the returned matrix
+* @param[out] nbCol number of column of the returned matrix
+*/
+char ** getStringMatrixFromList( AssignedList * list, int rank, int * nbRow, int * nbCol ) ;
+
+
+/**
* retrieve the current property of a tlist and move to the next
* @param[in/out] list object used to retrieve elements
* @param[out] nbRow number of row of the returned matrix
double * getCurrentDoubleMatrixFromList( AssignedList * list, int * nbRow, int * nbCol ) ;
/**
+* retrieve the current property of a tlist and move to the next
+* @param[in/out] list object used to retrieve elements
+* @param[out] nbRow number of row of the returned matrix
+* @param[out] nbCol number of column of the returned matrix
+*/
+char ** getCurrentStringMatrixFromList( AssignedList * list, int * nbRow, int * nbCol ) ;
+
+/**
* create a copy of the current matrix in the tlist
* @param[in/out] list object used to retrieve elements
- * @param[out] nbRow number of row of the returned matrix
- * @param[out] nbCol number of column of the returned matrix
+ * @param[out] nbRow number of row of the returned matrix or -1 if an error occurred
+ * @param[out] nbCol number of column of the returned matrix or -1 if an error occurred
+ * @return the created array or NULL if the matrix is empty or an error occured
*/
double * createCopyDoubleMatrixFromList( AssignedList * list, int * nbRow, int * nbCol ) ;
+/**
+* create a copy of the current matrix in the tlist
+* @param[in/out] list object used to retrieve elements
+* @param[out] nbRow number of row of the returned matrix
+* @param[out] nbCol number of column of the returned matrix
+*/
+char ** createCopyStringMatrixFromList( AssignedList * list, int * nbRow, int * nbCol ) ;
+
/*---------------------------------------------------------------------------------------*/
#endif /* _GET_PROPERTY_ASSIGNEMENT_VALUE_H_ */
#include "Format.h"
#include "get_ticks_utils.h"
#include "MALLOC.h"
+#include "BasicAlgos.h"
/*------------------------------------------------------------------------*/
int get_x_ticks_property( sciPointObj * pobj )
if( ppSubWin->axes.auto_ticks[0] )
{
int nbtics = ppSubWin->axes.nxgrads ;
- char ** ticklabel = NULL ;
+ char ** tickslabel = NULL ;
double * ticksPosition = NULL ;
ticksPosition = ReBuildTicksLog2Lin( ppSubWin->logflags[0], nbtics, ppSubWin->axes.xgrads ) ;
/* convert double to strings */
- ticklabel = copyFormatedArray( ticksPosition, nbtics, c_format, 100 ) ;
+ tickslabel = copyFormatedArray( ticksPosition, nbtics, c_format, 100 ) ;
/* construction de la tlist */
- buildTListForTicks( ticksPosition, ticklabel, nbtics ) ;
+ buildTListForTicks( ticksPosition, tickslabel, nbtics ) ;
- /* free ticklabel */
- destroyStringArray( ticklabel, nbtics ) ;
+ /* free tickslabel */
+ destroyStringArray( tickslabel, nbtics ) ;
FREE( ticksPosition ) ;
return 0 ;
}
#include "get_ticks_utils.h"
#include "Format.h"
#include "MALLOC.h"
+#include "BasicAlgos.h"
/*------------------------------------------------------------------------*/
int get_y_ticks_property( sciPointObj * pobj )
#include "get_ticks_utils.h"
#include "Format.h"
#include "MALLOC.h"
+#include "BasicAlgos.h"
/*------------------------------------------------------------------------*/
int get_z_ticks_property( sciPointObj * pobj )
/*-----------------------------------------------------------------------------------*/
/**
* Create a new hashTable of get functions
- * Use singleton pattern. Only one hashTable is created
*/
GetPropertyHashTable * createGetHashTable( void ) ;
#include "ObjectStructure.h"
-int set_color_map_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_old_style_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_figure_style_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_pixel_drawing_mode_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_default_values_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_visible_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_auto_resize_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_current_entity_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_current_axes_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_current_figure_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_axes_size_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_figure_position_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_figure_name_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_figure_size_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_figure_id_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_rotation_style_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_immediate_drawing_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_pixmap_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_background_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_interp_color_vector_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_interp_color_mode_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_foreground_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_fill_mode_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_thickness_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_arrow_size_factor_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_line_style_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_line_mode_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_surface_mode_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_mark_style_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_mark_mode_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_mark_size_unit_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_mark_size_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_mark_foreground_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_mark_background_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_bar_width_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_bar_layout_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_x_shift_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_y_shift_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_z_shift_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_polyline_style_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_font_size_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_font_angle_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_font_foreground_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_font_color_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_font_style_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_font_name_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_text_box_mode_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_auto_dimensionning_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_alignment_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_text_box_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_text_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_auto_clear_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_auto_scale_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_zoom_box_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_zoom_state_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_clip_box_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_clip_state_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_data_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_x_label_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_y_label_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_z_label_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_callbackmevent_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_callback_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_title_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_tics_direction_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_x_location_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_y_location_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_tight_limits_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_closed_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_auto_position_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
-int set_auto_rotation_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol ) ;
+int set_color_map_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_old_style_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_figure_style_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_pixel_drawing_mode_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_default_values_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_visible_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_auto_resize_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_current_entity_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_current_axes_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_current_figure_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_axes_size_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_figure_position_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_figure_name_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_figure_size_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_figure_id_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_rotation_style_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_immediate_drawing_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_pixmap_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_background_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_interp_color_vector_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_interp_color_mode_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_foreground_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_fill_mode_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_thickness_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_arrow_size_factor_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_line_style_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_line_mode_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_surface_mode_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_mark_style_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_mark_mode_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_mark_size_unit_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_mark_size_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_mark_foreground_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_mark_background_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_bar_width_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_bar_layout_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_x_shift_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_y_shift_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_z_shift_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_polyline_style_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_font_size_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_font_angle_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_font_foreground_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_font_color_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_font_style_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_font_name_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_text_box_mode_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_auto_dimensionning_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_alignment_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_text_box_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_text_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_auto_clear_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_auto_scale_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_zoom_box_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_zoom_state_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_clip_box_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_clip_state_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_data_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_x_label_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_y_label_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_z_label_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_callbackmevent_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_callback_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_title_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_tics_direction_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_x_location_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_y_location_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_tight_limits_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_closed_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_auto_position_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_auto_rotation_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_position_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_auto_ticks_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_axes_reverse_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_view_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_axes_bounds_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_data_bounds_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_margins_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_tics_color_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_tics_style_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_sub_tics_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_format_n_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_tics_segment_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_labels_font_size_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_labels_font_color_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_labels_font_style_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_tics_labels_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_xtics_coord_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_ytics_coord_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_box_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_grid_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_axes_visible_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_hidden_color_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_isoview_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_cube_scaling_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_log_flags_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_arrow_size_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_segs_color_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_colored_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_data_mapping_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_rotation_angles_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_color_mode_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_color_flag_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_cdata_mapping_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_surface_color_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_triangles_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_z_bounds_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_handle_visible_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_callback_type_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_menu_enable_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_hidden_axis_color_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_user_data_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_x_ticks_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_y_ticks_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
+int set_z_ticks_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol ) ;
#endif /* _SET_HANDLE_PROPERTY_H_ */
#include "sciprint.h"
/*------------------------------------------------------------------------*/
-int set_alignment_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_alignment_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property alignment.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if ( sciGetEntityType( pobj ) != SCI_TEXT )
{
sciprint("alignment property does not exist for this handle.\n");
#include "getPropertyAssignedValue.h"
#include "GetProperty.h"
#include "sciprint.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_arrow_size_factor_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_arrow_size_factor_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property arrow_size_factor.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if ( sciGetEntityType(pobj) != SCI_POLYLINE )
{
sciprint( "arrow_size_factor property undefined for this handle.\n" ) ;
- return -1 ;
+ return SET_PROPERTY_ERROR ;
}
pPOLYLINE_FEATURE(pobj)->arsize_factor = getDoubleFromStack( stackPointer ) ;
- return 0 ;
+ return SET_PROPERTY_SUCCEED ;
}
/*------------------------------------------------------------------------*/
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: set_arrow_size_property.c */
+/* Copyright INRIA 2006 */
+/* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy */
+/* desc : function to modify in Scilab the arrow_size field of */
+/* a handle */
+/*------------------------------------------------------------------------*/
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "SetPropertyStatus.h"
+#include "GetProperty.h"
+#include "sciprint.h"
+
+/*------------------------------------------------------------------------*/
+int set_arrow_size_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
+{
+
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property arrow_size_factor.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if ( sciGetEntityType(pobj) != SCI_SEGS )
+ {
+ sciprint("arrow_size property does not exist for this handle.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ pSEGS_FEATURE (pobj)->arrowsize = getDoubleFromStack( stackPointer ) ;
+
+ return SET_PROPERTY_SUCCEED ;
+
+}
+/*------------------------------------------------------------------------*/
#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_auto_clear_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_auto_clear_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property auto_clear.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if ( isStringParamEqual( stackPointer, "on" ) )
{
return sciSetAddPlot( pobj, FALSE ) ;
#include "sciprint.h"
/*------------------------------------------------------------------------*/
-int set_auto_dimensionning_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_auto_dimensionning_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property auto_dimensionning.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if ( sciGetEntityType( pobj ) != SCI_TEXT )
{
sciprint( "auto_dimensionning property does not exist for this handle.\n" ) ;
#include "sciprint.h"
/*------------------------------------------------------------------------*/
-int set_auto_position_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_auto_position_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property auto_position.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if ( sciGetEntityType(pobj) != SCI_LABEL )
{
sciprint("auto_position does not exist for this handle.\n") ;
#include "SetProperty.h"
#include "getPropertyAssignedValue.h"
#include "sciprint.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_auto_resize_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_auto_resize_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property auto_resize.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if ( isStringParamEqual( stackPointer, "on" ) )
{
return sciSetResize( pobj, TRUE );
else
{
sciprint("Value must be 'on' or 'off'.\n");
- return -1;
+ return SET_PROPERTY_ERROR ;
}
- return -1 ;
+ return SET_PROPERTY_ERROR ;
}
/*------------------------------------------------------------------------*/
#include "sciprint.h"
/*------------------------------------------------------------------------*/
-int set_auto_rotation_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_auto_rotation_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property auto_resize.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if ( sciGetEntityType(pobj) != SCI_LABEL )
{
sciprint("auto_rotation does not exist for this handle.\n") ;
#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_auto_scale_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_auto_scale_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property aut_scale.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if ( isStringParamEqual( stackPointer, "on" ) )
{
return sciSetAutoScale( pobj, TRUE ) ;
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: set_auto_ticks_property.c */
+/* Copyright INRIA 2006 */
+/* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy */
+/* desc : function to modify in Scilab the auto_ticks field of */
+/* a handle */
+/*------------------------------------------------------------------------*/
+
+#include <string.h>
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "SetPropertyStatus.h"
+#include "GetProperty.h"
+#include "sciprint.h"
+
+/*------------------------------------------------------------------------*/
+int set_auto_ticks_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
+{
+ char ** values = getStringMatrixFromStack( stackPointer ) ;
+
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property auto_ticks.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if ( sciGetEntityType( pobj ) != SCI_SUBWIN )
+ {
+ sciprint( "auto_ticks property does not exist for this handle.\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if( nbCol == 1 )
+ {
+ /* only one parameter to set the value for every axes.*/
+ if ( strcmp( values[0], "off" ) == 0 )
+ {
+ pSUBWIN_FEATURE (pobj)->axes.auto_ticks[0] = FALSE ;
+ pSUBWIN_FEATURE (pobj)->axes.auto_ticks[1] = FALSE ;
+ pSUBWIN_FEATURE (pobj)->axes.auto_ticks[2] = FALSE ;
+ }
+ else if ( strcmp( values[0], "on" ) == 0 )
+ {
+ pSUBWIN_FEATURE (pobj)->axes.auto_ticks[0] = TRUE ;
+ pSUBWIN_FEATURE (pobj)->axes.auto_ticks[1] = TRUE ;
+ pSUBWIN_FEATURE (pobj)->axes.auto_ticks[2] = TRUE ;
+ }
+ else
+ {
+ sciprint("Second argument must be 'on' or 'off'") ;
+ return SET_PROPERTY_ERROR ; ;
+ }
+ return SET_PROPERTY_SUCCEED ;
+ }
+ else if ( nbCol == 2 || nbCol == 3)
+ {
+ int i ;
+ for ( i = 0; i < nbCol; i++ )
+ {
+ if ( strcmp(values[i],"off") == 0 )
+ {
+ pSUBWIN_FEATURE(pobj)->axes.auto_ticks[i] = FALSE ;
+ }
+ else if ( strcmp(values[i],"on") == 0 )
+ {
+ pSUBWIN_FEATURE(pobj)->axes.auto_ticks[i] = TRUE ;
+ }
+ else
+ {
+ sciprint("Second argument must be 'on' or 'off'.\n");
+ return SET_PROPERTY_ERROR ;
+ }
+ return SET_PROPERTY_SUCCEED ;
+ }
+ }
+ else
+ {
+ sciprint("Number of the second argument must be taken between 1 to 3.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+ return SET_PROPERTY_ERROR ;
+}
+/*------------------------------------------------------------------------*/
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: set_axes_bounds_property.c */
+/* Copyright INRIA 2006 */
+/* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy */
+/* desc : function to modify in Scilab the axes_bounds field of */
+/* a handle */
+/*------------------------------------------------------------------------*/
+
+#include <string.h>
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "SetPropertyStatus.h"
+#include "GetProperty.h"
+#include "sciprint.h"
+#include "PloEch.h"
+
+/*------------------------------------------------------------------------*/
+int set_axes_bounds_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
+{
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property axes_bounds.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if ( sciGetEntityType(pobj) != SCI_SUBWIN )
+ {
+ sciprint( "axes_bounds property does not exist for this handle.\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+ if ( nbRow * nbCol != 4 )
+ {
+ sciprint("Second argument must have 4 elements.\n");
+ return SET_PROPERTY_ERROR ;
+ }
+
+ copyDoubleVectorFromStack( stackPointer, pSUBWIN_FEATURE (pobj)->WRect, 4 ) ;
+
+ set_scale( "ttffff", pSUBWIN_FEATURE (pobj)->WRect, NULL, NULL, NULL, NULL ) ;
+ return SET_PROPERTY_SUCCEED ;
+}
+/*------------------------------------------------------------------------*/
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: set_axes_reverse_property.c */
+/* Copyright INRIA 2006 */
+/* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy */
+/* desc : function to modify in Scilab the axes_reverse field of */
+/* a handle */
+/*------------------------------------------------------------------------*/
+
+#include <string.h>
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "SetPropertyStatus.h"
+#include "GetProperty.h"
+#include "sciprint.h"
+
+/*------------------------------------------------------------------------*/
+int set_axes_reverse_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
+{
+ char ** values = getStringMatrixFromStack( stackPointer ) ;
+
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property axes_reverse.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if ( sciGetEntityType( pobj ) != SCI_SUBWIN )
+ {
+ sciprint( "axes_reverse property does not exist for this handle.\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if( nbCol == 1 )
+ {
+ /* only one parameter to set the value for every axes.*/
+ if ( strcmp( values[0], "off" ) == 0 )
+ {
+ pSUBWIN_FEATURE (pobj)->axes.reverse[0] = FALSE ;
+ pSUBWIN_FEATURE (pobj)->axes.reverse[1] = FALSE ;
+ pSUBWIN_FEATURE (pobj)->axes.reverse[2] = FALSE ;
+ }
+ else if ( strcmp( values[0], "on" ) == 0 )
+ {
+ pSUBWIN_FEATURE (pobj)->axes.reverse[0] = TRUE ;
+ pSUBWIN_FEATURE (pobj)->axes.reverse[1] = TRUE ;
+ pSUBWIN_FEATURE (pobj)->axes.reverse[2] = TRUE ;
+ }
+ else
+ {
+ sciprint("Second argument must be 'on' or 'off'") ;
+ return SET_PROPERTY_ERROR ; ;
+ }
+ return SET_PROPERTY_SUCCEED ;
+ }
+ else if ( nbCol == 2 || nbCol == 3)
+ {
+ int i ;
+ for ( i = 0; i < nbCol; i++ )
+ {
+ if ( strcmp(values[i],"off") == 0 )
+ {
+ pSUBWIN_FEATURE(pobj)->axes.reverse[i] = FALSE ;
+ }
+ else if ( strcmp(values[i],"on") == 0 )
+ {
+ pSUBWIN_FEATURE(pobj)->axes.reverse[i] = TRUE ;
+ }
+ else
+ {
+ sciprint("Second argument must be 'on' or 'off'.\n");
+ return SET_PROPERTY_ERROR ;
+ }
+ return SET_PROPERTY_SUCCEED ;
+ }
+ }
+ else
+ {
+ sciprint("Number of the second argument must be taken between 1 to 3.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+ return SET_PROPERTY_ERROR ;
+}
+/*------------------------------------------------------------------------*/
#include "sciprint.h"
#include "Xcall1.h"
#include "InitObjects.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_axes_size_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_axes_size_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
double * newWindowSize = getDoubleMatrixFromStack( stackPointer ) ;
+
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property axes_size.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if ( sciGetEntityType(pobj) != SCI_FIGURE )
{
sciprint("axes_size property undefined for this object") ;
- return -1;
+ return SET_PROPERTY_ERROR ;
}
+
pFIGURE_FEATURE(pobj)->windowdimwidth = (int) newWindowSize[0] ;
pFIGURE_FEATURE(pobj)->windowdimheight= (int) newWindowSize[1] ;
C2F(dr)("xset","window",&curFigNum,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
}
- return 0 ;
+ return SET_PROPERTY_SUCCEED ;
}
/*------------------------------------------------------------------------*/
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: set_axes_visible_property.c */
+/* Copyright INRIA 2006 */
+/* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy */
+/* desc : function to modify in Scilab the grid field of */
+/* a handle */
+/*------------------------------------------------------------------------*/
+
+#include <string.h>
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "SetPropertyStatus.h"
+#include "GetProperty.h"
+#include "sciprint.h"
+#include "BasicAlgos.h"
+
+/*------------------------------------------------------------------------*/
+int set_axes_visible_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
+{
+ char ** values = getStringMatrixFromStack( stackPointer ) ;
+
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property axes_visible.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if ( sciGetEntityType(pobj) != SCI_SUBWIN )
+ {
+ sciprint( "axes_visible property does not exist for this handle.\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if( nbCol == 1 )
+ {
+
+ if ( strcmp( values[0], "off") == 0 )
+ {
+ pSUBWIN_FEATURE (pobj)->axes.axes_visible[0] = FALSE ;
+ pSUBWIN_FEATURE (pobj)->axes.axes_visible[1] = FALSE ;
+ pSUBWIN_FEATURE (pobj)->axes.axes_visible[2] = FALSE ;
+ }
+ else if ( strcmp( values[0], "on") == 0 )
+ {
+ pSUBWIN_FEATURE(pobj)->axes.axes_visible[0] = TRUE ;
+ pSUBWIN_FEATURE(pobj)->axes.axes_visible[1] = TRUE ;
+ pSUBWIN_FEATURE(pobj)->axes.axes_visible[2] = TRUE ;
+ }
+ else
+ {
+ sciprint("Second argument must be 'on' or 'off'.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+ return SET_PROPERTY_SUCCEED ;
+ }
+ else if ( nbCol == 2 || nbCol == 3 )
+ {
+ int i ;
+ for ( i = 0; i < nbCol ; i++ )
+ {
+ if ( strcmp( values[i], "off" ) == 0)
+ {
+ pSUBWIN_FEATURE (pobj)->axes.axes_visible[i] = FALSE ;
+ }
+ else if ( strcmp( values[i], "on" ) == 0 )
+ {
+ pSUBWIN_FEATURE (pobj)->axes.axes_visible[i] = TRUE ;
+ }
+ else
+ {
+ sciprint("Second argument must be 'on' or 'off'.\n") ;
+ return -1 ;
+ }
+ return SET_PROPERTY_SUCCEED ;
+ }
+ }
+ else
+ {
+ sciprint("Number of the second argument must be taken between 1 to 3.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+ return SET_PROPERTY_ERROR ;
+}
+/*------------------------------------------------------------------------*/
#include "setHandleProperty.h"
#include "SetProperty.h"
#include "getPropertyAssignedValue.h"
+#include "sciprint.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_background_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_background_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property background.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
return sciSetBackground( pobj, (int)getDoubleFromStack(stackPointer) ) ;
}
/*------------------------------------------------------------------------*/
#include "getPropertyAssignedValue.h"
#include "sciprint.h"
#include "GetProperty.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_bar_layout_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_bar_layout_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property bar_layout.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if ( sciGetEntityType(pobj) != SCI_POLYLINE )
{
sciprint( "bar_layout property does not exist for this handle.\n" ) ;
- return -1 ;
+ return SET_PROPERTY_ERROR ;
}
if( isStringParamEqual( stackPointer, "grouped" ) )
else
{
sciprint( "bar_layout must be set to 'grouped' or 'stacked'.\n" ) ;
- return -1;
+ return SET_PROPERTY_ERROR ;
}
- return -1 ;
+ return SET_PROPERTY_SUCCEED ;
}
/*------------------------------------------------------------------------*/
#include "getPropertyAssignedValue.h"
#include "sciprint.h"
#include "GetProperty.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_bar_width_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_bar_width_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property bar_width.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if ( sciGetEntityType (pobj) != SCI_POLYLINE )
{
sciprint( "Object has no bar shift.\n" ) ;
- return -1 ;
+ return SET_PROPERTY_ERROR ;
}
pPOLYLINE_FEATURE (pobj)->bar_width = getDoubleFromStack( stackPointer ) ;
- return 0 ;
+ return SET_PROPERTY_SUCCEED ;
}
/*------------------------------------------------------------------------*/
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: set_box_property.c */
+/* Copyright INRIA 2006 */
+/* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy */
+/* desc : function to modify in Scilab the box field of */
+/* a handle */
+/*------------------------------------------------------------------------*/
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "SetPropertyStatus.h"
+#include "GetProperty.h"
+#include "sciprint.h"
+
+/*------------------------------------------------------------------------*/
+int set_box_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
+{
+
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property box.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if ( sciGetEntityType( pobj ) == SCI_SUBWIN )
+ {
+ if ( isStringParamEqual( stackPointer, "off" ) )
+ {
+ return sciSetBoxType( pobj, BT_OFF ) ;
+ }
+ else if ( isStringParamEqual( stackPointer, "on" ) )
+ {
+ return sciSetBoxType( pobj, BT_ON ) ;
+ }
+ else if ( isStringParamEqual( stackPointer, "hidden_axis" ) )
+ {
+ return sciSetBoxType( pobj, BT_HIDDEN_AXIS ) ;
+ }
+ else if ( isStringParamEqual( stackPointer, "back_half" ) )
+ {
+ return sciSetBoxType( pobj, BT_BACK_HALF ) ;
+ }
+ else
+ {
+ sciprint("Second argument must be 'on', 'off', 'hidden_axis' or 'back_half'.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+ }
+ else
+ {
+ if ( isStringParamEqual( stackPointer, "on" ) )
+ {
+ return sciSetIsBoxed( pobj, TRUE ) ;
+ }
+ else if ( isStringParamEqual( stackPointer, "off" ) )
+ {
+ return sciSetIsBoxed( pobj, FALSE ) ;
+ }
+ else
+ {
+ sciprint("Second argument must be 'on' or 'off'.\n") ;
+ return SET_PROPERTY_SUCCEED ;
+ }
+ }
+
+ return SET_PROPERTY_ERROR ;
+
+}
+/*------------------------------------------------------------------------*/
#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_callback_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_callback_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
- return sciAddCallback( pobj, getStringFromStack( stackPointer ), nbRow * nbCol, 1 ) ;
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property callback.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ return sciAddCallback( pobj, getStringFromStack( stackPointer ), nbRow * nbCol, 1 ) ;
}
/*------------------------------------------------------------------------*/
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: set_callback_type_property.c */
+/* Copyright INRIA 2006 */
+/* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy */
+/* desc : function to modify in Scilab the callback_type field of */
+/* a handle */
+/*------------------------------------------------------------------------*/
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "sciprint.h"
+#include "GetProperty.h"
+#include "SetPropertyStatus.h"
+
+/*------------------------------------------------------------------------*/
+int set_callback_type_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
+{
+
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property callback_type.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if (sciGetEntityType (pobj) != SCI_UIMENU)
+ {
+ sciprint("callback_type property does not exist for this handle.\n");
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if ( isStringParamEqual( stackPointer, "string" ) )
+ {
+ pUIMENU_FEATURE(pobj)->CallbackType = 0 ;
+ }
+ else if ( isStringParamEqual( stackPointer, "C" ) )
+ {
+ pUIMENU_FEATURE(pobj)->CallbackType = 1 ;
+ }
+ else if ( isStringParamEqual( stackPointer, "internal" ) )
+ {
+ pUIMENU_FEATURE(pobj)->CallbackType = 2 ;
+ }
+ else if ( isStringParamEqual( stackPointer, "addmenu" ) )
+ {
+ pUIMENU_FEATURE(pobj)->CallbackType = 3 ;
+ }
+ else
+ {
+ sciprint("Value must be 'string','C','internal','addmenu'.\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ return SET_PROPERTY_SUCCEED ;
+}
+/*------------------------------------------------------------------------*/
#include "Interaction.h"
#include "GetProperty.h"
#include "sciprint.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_callbackmevent_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_callbackmevent_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property callbackmevent.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
return sciSetCallbackMouseEvent( pobj, (int) getDoubleFromStack( stackPointer ) ) ;
}
/*------------------------------------------------------------------------*/
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: set_cdata_mapping_property.c */
+/* Copyright INRIA 2006 */
+/* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy */
+/* desc : function to modify in Scilab the cdata_mapping field of */
+/* a handle */
+/*------------------------------------------------------------------------*/
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "SetPropertyStatus.h"
+#include "GetProperty.h"
+#include "sciprint.h"
+#include "ColorMapManagement.h"
+#include "MALLOC.h"
+#include "BasicAlgos.h"
+
+/*------------------------------------------------------------------------*/
+int set_cdata_mapping_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
+{
+ sciSurface * ppSurf = NULL ;
+
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property cdata_mapping.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if (sciGetEntityType (pobj) != SCI_SURFACE || ppSurf->typeof3d != SCI_FAC3D )
+ {
+ sciprint("cdata_mapping property does not exist for this handle.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ ppSurf = pSURFACE_FEATURE ( pobj ) ;
+
+ if ( isStringParamEqual( stackPointer, "scaled" ) )
+ {
+ if( ppSurf->cdatamapping != 0 )
+ { /* not already scaled */
+ LinearScaling2Colormap(pobj);
+ ppSurf->cdatamapping = 0;
+ }
+ }
+ else if ( isStringParamEqual( stackPointer, "direct" ) )
+ {
+ if(pSURFACE_FEATURE (pobj)->cdatamapping != 1)
+ {
+ /* not already direct */
+ int nc = ppSurf->nc ;
+
+ FREE( ppSurf->color ) ;
+ ppSurf->color = NULL ;
+
+ if( nc > 0 )
+ {
+ if ((ppSurf->color = MALLOC (nc * sizeof (double))) == NULL)
+ {
+ sciprint( "Unable to allocate color vector, memory full.\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+ }
+
+ doubleArrayCopy( ppSurf->color, ppSurf->zcol, nc ) ;
+
+
+ ppSurf->cdatamapping = 1 ;
+ }
+ }
+ else
+ {
+ sciprint("cdata_mapping value must be 'scaled' or 'direct'.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ return SET_PROPERTY_SUCCEED ;
+
+
+}
+/*------------------------------------------------------------------------*/
#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_clip_box_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_clip_box_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
int status1 ;
int status2 ;
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property clip_box.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
/* On doit avoir avoir une matrice 4x1 */
if ( nbRow * nbCol != 4 )
{
#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_clip_state_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_clip_state_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property clip_state.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property axes_visible.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if ( isStringParamEqual( stackPointer, "clipgrf" ) )
{
return sciSetIsClipping( pobj, 0 ) ;
#include "sciprint.h"
/*------------------------------------------------------------------------*/
-int set_closed_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_closed_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property closed.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if(sciGetEntityType(pobj) != SCI_POLYLINE)
{
sciprint( "closed property does not exist for this handle.\n" ) ;
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: set_color_flag_property.c */
+/* Copyright INRIA 2006 */
+/* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy */
+/* desc : function to modify in Scilab the color_flag field of */
+/* a handle */
+/*------------------------------------------------------------------------*/
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "SetPropertyStatus.h"
+#include "GetProperty.h"
+#include "sciprint.h"
+#include "ColorMapManagement.h"
+#include "MALLOC.h"
+#include "BasicAlgos.h"
+
+/*------------------------------------------------------------------------*/
+int set_color_flag_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
+{
+ int flagcolor = (int) getDoubleFromStack( stackPointer ) ;
+
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property color_flag.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if ( sciGetEntityType(pobj) != SCI_SURFACE )
+ {
+ sciprint( "color_flag property does not exist for this handle.\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+ if ( nbRow * nbCol != 1 )
+ {
+ sciprint("Second argument must be a scalar.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if ( pSURFACE_FEATURE (pobj)->typeof3d == SCI_PLOT3D )
+ {
+ if ( flagcolor < 0 || flagcolor > 1 )
+ {
+ sciprint("Second argument must be equal to 0 or 1.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+ pSURFACE_FEATURE(pobj)->flagcolor = flagcolor ;
+ return SET_PROPERTY_SUCCEED ;
+ }
+ else if ( pSURFACE_FEATURE (pobj)->typeof3d == SCI_FAC3D )
+ {
+
+ sciSurface * psurf = pSURFACE_FEATURE (pobj);
+
+ if ( flagcolor < 0 || flagcolor > 4 )
+ {
+ sciprint( "Second argument must be 0 1 2 3 or 4.\n" ) ;
+ return -1 ;
+ }
+
+
+ /* F.Leray 18.03.04 Something goes wrong here: No need to re-build/re-alloc zcol normally!!*/
+ /* YES in fact but use of another fixed array named inputCMoV (inputColorMatrixorVector)*/
+
+ if ( pSURFACE_FEATURE(pobj)->flagcolor == flagcolor )
+ {
+ return SET_PROPERTY_UNCHANGED ;
+ }
+
+ if( flagcolor == 0 || flagcolor == 1 )
+ {
+ pSURFACE_FEATURE(pobj)->izcol = 0;
+ }
+ else if( flagcolor == 2 ) /* Warning: here we need a color vector (one color per facet). N = 1 x dimzy */
+ {
+ int m3n = pSURFACE_FEATURE (pobj)->m3n;
+ int n3n = pSURFACE_FEATURE (pobj)->n3n;
+ int nc = psurf->dimzy; /* rappel: dimzy always equal n3*/
+
+ psurf->nc = nc;
+ FREE(psurf->zcol); psurf->zcol = NULL;
+
+ if( nc > 0 )
+ {
+ if ((psurf->zcol = MALLOC (nc * sizeof (double))) == NULL)
+ {
+ sciprint( "Unable to create color vector, memory full.\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+ }
+
+ if( m3n * n3n != 0 )
+ { /* There is either a color matrix or vector*/
+ if( m3n==1 || n3n ==1)
+ {
+ /* nc value is dimzx*dimzy == m3n * n3n */
+ doubleArrayCopy( psurf->zcol, psurf->inputCMoV, nc ) ;
+ /* We have just enough information to fill the psurf->zcol array*/
+ }
+ else
+ {
+ /* We have too much information and we take only the first dimzy colors to fill the psurf->zcol array*/
+ /* NO !! Let's do better; F.Leray 08.05.04 : */
+ /* 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) */
+ /* in our example: m3n=4 and n3n=400 */
+ int i ;
+ int j ;
+ for ( j = 0 ; j < nc ; j++ ) /* nc value is dimzy*/
+ {
+ double tmp = 0 ;
+ for( i = 0 ; i < m3n ; i++)
+ {
+ tmp = tmp + psurf->inputCMoV[j*m3n + i ];
+ }
+ tmp = tmp / m3n;
+ psurf->zcol[j] = tmp;
+ }
+ }
+ }
+ else
+ {
+ int j ;
+ /* There is no color matrix/vect. in input */
+ for ( j = 0 ; j < psurf->dimzy ; j++ ) /* nc value is dimzy*/
+ {
+ psurf->zcol[j]= psurf->flag[0] ;
+ }
+ }
+
+ }
+ else if ( flagcolor == 3 ) /* interpolated (shading) case */
+ {
+ int m3n = pSURFACE_FEATURE (pobj)->m3n;
+ int n3n = pSURFACE_FEATURE (pobj)->n3n;
+ int nc = psurf->dimzx * psurf->dimzy;
+
+ psurf->nc = nc;
+ FREE(psurf->zcol); psurf->zcol = NULL;
+
+
+ if ((psurf->zcol = MALLOC ( nc * sizeof (double))) == NULL)
+ {
+ sciprint( "Unable to create color vector, memory full.\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+
+ if( m3n * n3n != 0 ) /* There is either a color matrix or vector*/
+ {
+ if( m3n == 1 || n3n == 1 ) /* COLOR VECTOR */
+ {
+ int i ;
+ int j ;
+ /* We have insufficient info. to fill the entire zcol array of dimension nc = dimzx*dimzy*/
+ /* We repeat the data:*/
+ for(i = 0; i< psurf->dimzy; i++)
+ {
+ for (j = 0;j < psurf->dimzx; j++)
+ {
+ /* nc value is dimzx*dimzy == m3n * n3n */
+ psurf->zcol[(psurf->dimzx)*i+j]= psurf->inputCMoV[i];
+ }
+ }
+ }
+ else /* COLOR MATRIX */
+ {
+ /* We have just enough information to fill the psurf->zcol array*/
+ doubleArrayCopy( psurf->zcol, psurf->inputCMoV, (psurf->dimzx) * (psurf->dimzy) ) ;
+ }
+ }
+ else
+ {
+ int i ;
+ int j ;
+ /* There is no color matrix/vect. in input */
+ for(i = 0; i< psurf->dimzy; i++)
+ {
+ for (j = 0;j < psurf->dimzx; j++) /* nc value is dimzx*dimzy == m3n * n3n */
+ {
+ psurf->zcol[( psurf->dimzx)*i+j]= psurf->flag[0];
+ }
+ }
+ }
+ }
+ /* New : case == 4 introduced on the 10.03.05 (F.Leray) to support faceted (flat) Matlab case */
+ else if ( flagcolor == 4 ) /* Warning: here we need a color vector (one color per facet). N = 1 x dimzy */
+ {
+ int m3n = pSURFACE_FEATURE (pobj)->m3n;
+ int n3n = pSURFACE_FEATURE (pobj)->n3n;
+ int nc = psurf->dimzy ; /* rappel: dimzy always equal n3*/
+
+ psurf->nc = nc;
+ FREE(psurf->zcol); psurf->zcol = NULL;
+
+ if( nc > 0 )
+ {
+ if ((psurf->zcol = MALLOC (nc * sizeof (double))) == NULL)
+ {
+ sciprint( "Unable to create color vector, memory full.\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+ }
+
+ if( m3n * n3n != 0 )
+ {
+ /* There is either a color matrix or vector */
+ if ( m3n == 1 || n3n == 1 )
+ {
+ /* We have just enough information to fill the psurf->zcol array*/
+ /* nc value is dimzx*dimzy == m3n * n3n */
+ doubleArrayCopy(psurf->zcol, psurf->inputCMoV, nc ) ;
+ }
+ else
+ {
+ int j ;
+ /* input : color matrix , we use 1 color per facet with Matlab selection mode (no average computed) */
+ /* HERE is the difference with case 2 */
+ for ( j = 0 ; j < nc ; j++ )
+ {
+ /* nc value is dimzy*/
+ psurf->zcol[j] = psurf->inputCMoV[j*m3n];
+ }
+ }
+ }
+ else if (m3n * n3n == 0)
+ {
+ int j ;
+ /* There is no color matrix/vect. in input */
+ for ( j = 0 ; j < psurf->dimzy ; j++ )
+ {
+ /* nc value is dimzy*/
+ psurf->zcol[j]= psurf->flag[0];
+ }
+ }
+ }
+
+ if( flagcolor != 0 && flagcolor != 1 )
+ {
+ /* We need to rebuild ...->color matrix */
+ if( psurf->cdatamapping == 0 )
+ { /* scaled */
+ FREE(psurf->color);
+ LinearScaling2Colormap(pobj);
+ }
+ else
+ {
+ int nc = psurf->nc;
+
+ FREE(psurf->color);
+
+ if( nc > 0 )
+ {
+ if ((psurf->color = MALLOC (nc * sizeof (double))) == NULL)
+ {
+ sciprint( "Unable to create color vector, memory full.\n" ) ;
+ return -1;
+ }
+ }
+
+ doubleArrayCopy( psurf->color, psurf->zcol, nc ) ;
+ /* copy zcol that has just been freed and re-alloc + filled in */
+ }
+ }
+
+ /* Finally, update the flagcolor */
+ pSURFACE_FEATURE (pobj)->flagcolor = flagcolor;
+ }
+
+ return SET_PROPERTY_SUCCEED ;
+
+}
+/*------------------------------------------------------------------------*/
#include "setHandleProperty.h"
#include "SetProperty.h"
#include "getPropertyAssignedValue.h"
+#include "sciprint.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_color_map_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_color_map_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property color_map.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
return sciSetColormap( pobj, getDoubleMatrixFromStack( stackPointer), nbRow, nbCol ) ;
}
/*------------------------------------------------------------------------*/
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: set_color_mode_property.c */
+/* Copyright INRIA 2006 */
+/* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy */
+/* desc : function to modify in Scilab the color_mode field of */
+/* a handle */
+/*------------------------------------------------------------------------*/
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "SetPropertyStatus.h"
+#include "GetProperty.h"
+#include "sciprint.h"
+#include "ColorMapManagement.h"
+#include "MALLOC.h"
+#include "BasicAlgos.h"
+
+/*------------------------------------------------------------------------*/
+int set_color_mode_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
+{
+ int flagcolor;
+ sciSurface * psurf = NULL ;
+
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property color_mode.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if ( sciGetEntityType(pobj) != SCI_SURFACE )
+ {
+ sciprint( "color_mode property does not exist for this handle.\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ psurf = pSURFACE_FEATURE (pobj) ;
+
+ flagcolor = psurf->flagcolor;
+
+ psurf->flag[0]= (integer) getDoubleFromStack( stackPointer ) ;
+
+ if( flagcolor != 0 && flagcolor != 1 )
+ {
+ if( psurf->m3n * psurf->n3n == 0 )
+ {
+ /* There is not any color matrix/vect. in input : update the fake color one */
+ int j,nc;
+
+ if( flagcolor == 2 || flagcolor == 4 )
+ {
+ nc = psurf->dimzy; /* remind: dimzy always equal n3*/
+ }
+ else if(flagcolor == 3)
+ {
+ nc = psurf->dimzx * psurf->dimzy;
+ }
+
+ FREE(psurf->zcol);
+
+
+ if ((psurf->zcol = MALLOC ( nc * sizeof (double))) == NULL)
+ {
+ sciprint("Can not performed requested action, memory full.\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ for (j = 0;j < nc; j++)
+ {
+ /* nc value is dimzy*/
+ psurf->zcol[j]= psurf->flag[0];
+ }
+
+
+ if ( flagcolor != 0 && flagcolor != 1 )
+ {
+ /* We need to rebuild ...->color matrix */
+ if ( psurf->cdatamapping == 0 )
+ {
+ /* scaled */
+ FREE(psurf->color);
+ LinearScaling2Colormap(pobj);
+ }
+ else
+ {
+ int nc = psurf->nc;
+
+ FREE(psurf->color);
+
+
+
+ if ( nc > 0 )
+ {
+ if ((psurf->color = MALLOC (nc * sizeof (double))) == NULL)
+ {
+ sciprint("Can not performed requested action, memory full.\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+ }
+
+ doubleArrayCopy( psurf->color, psurf->zcol, nc ) ;
+ /* copy zcol that has just been freed and re-alloc + filled in */
+ }
+ }
+ }
+ }
+
+ if ( psurf->typeof3d == SCI_FAC3D )
+ {
+ /* we have to deal with colors... and may be update because we just changed psurf->flag[0]*/
+ if( psurf->flagcolor == 0 )
+ {
+ pSURFACE_FEATURE (pobj)->izcol = 0;
+ }
+ }
+
+ return SET_PROPERTY_SUCCEED ;
+
+}
+/*------------------------------------------------------------------------*/
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: set_colored_property.c */
+/* Copyright INRIA 2006 */
+/* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy */
+/* desc : function to modify in Scilab the colored field of */
+/* a handle */
+/*------------------------------------------------------------------------*/
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "SetPropertyStatus.h"
+#include "GetProperty.h"
+#include "sciprint.h"
+
+/*------------------------------------------------------------------------*/
+int set_colored_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
+{
+
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property colored.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if ( sciGetEntityType( pobj ) != SCI_SEGS || pSEGS_FEATURE(pobj)->ptype == 0 )
+ {
+ sciprint( "colored property does not exist for this handle.\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if ( isStringParamEqual( stackPointer, "on") )
+ {
+ pSEGS_FEATURE(pobj)->typeofchamp = 1 ;
+ }
+ else if ( isStringParamEqual( stackPointer, "off") )
+ {
+ pSEGS_FEATURE(pobj)->typeofchamp = 0 ;
+ }
+ else
+ {
+ sciprint("Value must be 'on' or 'off'.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ return SET_PROPERTY_SUCCEED ;
+
+}
+/*------------------------------------------------------------------------*/
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: set_cube_scaling_property.c */
+/* Copyright INRIA 2006 */
+/* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy */
+/* desc : function to modify in Scilab the cube_scaling field of */
+/* a handle */
+/*------------------------------------------------------------------------*/
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "SetPropertyStatus.h"
+#include "GetProperty.h"
+#include "sciprint.h"
+
+/*------------------------------------------------------------------------*/
+int set_cube_scaling_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
+{
+
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property cube_scaling.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if ( sciGetEntityType(pobj) != SCI_SUBWIN )
+ {
+ sciprint("cube_scaling property does not exist for this handle.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if( !sciGetIs3d(pobj) )
+ {
+ sciprint("Warning: cube_scaling property is only used in 3D mode.\n");
+ }
+
+ if ( isStringParamEqual(stackPointer, "on" ) )
+ {
+ pSUBWIN_FEATURE (pobj)->cube_scaling = TRUE ;
+ }
+ else if ( isStringParamEqual( stackPointer, "off") )
+ {
+ pSUBWIN_FEATURE (pobj)->cube_scaling = FALSE ;
+ }
+ else
+ {
+ sciprint("Value must be 'on' or 'off' / Only use for 3D mode.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+ return SET_PROPERTY_SUCCEED ;
+
+}
+/*------------------------------------------------------------------------*/
#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_current_axes_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_current_axes_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
- sciPointObj * curAxes = sciGetPointerFromHandle( getHandleFromStack( stackPointer ) );
+ sciPointObj * curAxes = NULL ;
sciPointObj * parentFig = NULL ;
int num = -1 ;
int v = 1 ;
int status1 = 1 ;
int status2 = 1 ;
+ if ( !isParameterHandle( valueType ) )
+ {
+ sciprint("Incompatible type for property current_axes.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ curAxes = sciGetPointerFromHandle( getHandleFromStack( stackPointer ) ) ;
+
if ( curAxes == NULL)
{
sciprint("Object is not valid.\n") ;
#include "SetProperty.h"
#include "getPropertyAssignedValue.h"
#include "sciprint.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_current_entity_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_current_entity_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
- sciPointObj * curEntity = sciGetPointerFromHandle( getHandleFromStack( stackPointer ) ) ;
+ sciPointObj * curEntity = NULL ;
+ if ( !isParameterHandle( valueType ) )
+ {
+ sciprint("Incompatible type for property current_entity.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ curEntity = sciGetPointerFromHandle( getHandleFromStack( stackPointer ) ) ;
+
if ( curEntity == NULL )
{
sciprint( "Object is not valid.\n" ) ;
- return -1 ;
+ return SET_PROPERTY_ERROR ;
}
return sciSetCurrentObj( curEntity ) ;
#include "Xcall1.h"
/*------------------------------------------------------------------------*/
-int set_current_figure_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_current_figure_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
int figNum = -1 ;
- if ( isParameterHandle(2) )
+ if ( isParameterHandle( valueType ) )
{
sciPointObj * curFig = sciGetPointerFromHandle( getHandleFromStack( stackPointer ) ) ;
}
figNum = sciGetNum( curFig ) ;
}
- else if ( isParameterDoubleMatrix(2) )
+ else if ( isParameterDoubleMatrix( valueType ) )
{
figNum = (int) getDoubleFromStack( stackPointer ) ;
}
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: set_data_bounds_property.c */
+/* Copyright INRIA 2006 */
+/* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy */
+/* desc : function to modify in Scilab the data_bounds field of */
+/* a handle */
+/*------------------------------------------------------------------------*/
+
+#include <string.h>
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "SetPropertyStatus.h"
+#include "GetProperty.h"
+#include "sciprint.h"
+
+/*------------------------------------------------------------------------*/
+/**
+ * fill bounds (xMin, xMax, yMin,... ) from the assigned value in the stack
+ * beacause it might have several possible size.
+ */
+int getdDataBoundsFromStack( int stackPointer, int nbRow, int nbCol,
+ double * xMin, double * xMax,
+ double * yMin, double * yMax,
+ double * zMin, double * zMax )
+{
+ double * bounds = getDoubleMatrixFromStack( stackPointer ) ;
+
+ /* initialize zMin and zMax to avoid checking between 2D and 3D */
+ *zMin = 1.0 ;
+ *zMax = 2.0 ;
+
+ switch ( nbRow )
+ {
+ case 1 : /* row vector */
+ if ( nbCol == 4 )
+ {
+ *xMin = bounds[0] ;
+ *xMax = bounds[1] ;
+ *yMin = bounds[2] ;
+ *yMax = bounds[3] ;
+ }
+ else if( nbCol == 6 )
+ {
+ *xMin = bounds[0] ;
+ *xMax = bounds[1] ;
+ *yMin = bounds[2] ;
+ *yMax = bounds[3] ;
+ *zMin = bounds[4] ;
+ *zMax = bounds[5] ;
+ }
+ else
+ {
+ sciprint( "Second argument should be a 2x2, 2x3, 1x4, 4x1, 1x6 or 6x1 matrix." ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+ break ;
+
+ case 2 : /* 2x2 or 2x3 matrix */
+ if ( nbCol == 2 )
+ {
+ *xMin = bounds[0] ;
+ *yMin = bounds[2] ;
+ *xMax = bounds[1] ;
+ *yMax = bounds[3] ;
+ }
+ else if ( nbCol == 3 )
+ {
+ *xMin = bounds[0] ;
+ *yMin = bounds[2] ;
+ *zMin = bounds[4] ;
+ *xMax = bounds[1] ;
+ *yMax = bounds[3] ;
+ *zMax = bounds[5] ;
+ }
+ else
+ {
+ sciprint( "Second argument should be a 2x2, 2x3, 1x4, 4x1, 1x6 or 6x1 matrix." ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+ break ;
+
+ case 4 : /* column vector for 2D */
+ if ( nbCol == 1 )
+ {
+ *xMin = bounds[0] ;
+ *xMax = bounds[1] ;
+ *yMin = bounds[2] ;
+ *yMax = bounds[3] ;
+ }
+ else
+ {
+ sciprint( "Second argument should be a 2x2, 2x3, 1x4, 4x1, 1x6 or 6x1 matrix." ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+ break ;
+ case 6 : /* column vector for 3D */
+ if ( nbCol == 1 )
+ {
+ *xMin = bounds[0] ;
+ *xMax = bounds[1] ;
+ *yMin = bounds[2] ;
+ *yMax = bounds[3] ;
+ *zMin = bounds[4] ;
+ *zMax = bounds[5] ;
+ }
+ else
+ {
+ sciprint( "Second argument should be a 2x2, 2x3, 1x4, 4x1, 1x6 or 6x1 matrix." ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+ break ;
+ default:
+ sciprint( "Second argument should be a 2x2, 2x3, 1x4, 4x1, 1x6 or 6x1 matrix." ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+ return SET_PROPERTY_SUCCEED ;
+}
+
+/*------------------------------------------------------------------------*/
+int set_data_bounds_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
+{
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property data_bounds.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if (sciGetEntityType (pobj) == SCI_SUBWIN)
+ {
+
+ /* JB Silvy 09/11/05 */
+ sciSubWindow * ppSubWin = pSUBWIN_FEATURE (pobj) ;
+ double xMin ;
+ double xMax ;
+ double yMin ;
+ double yMax ;
+ double zMin ;
+ double zMax ;
+
+ /* get the bounds */
+ if ( getdDataBoundsFromStack( stackPointer, nbRow, nbCol, &xMin, &xMax, &yMin, &yMax, &zMin, &zMax ) == SET_PROPERTY_ERROR )
+ {
+ return SET_PROPERTY_ERROR ;
+ }
+
+ /* check if the bounds are corrects */
+ /* allows equality with bounds since it is working */
+ if ( xMin > xMax || yMin > yMax || zMin > zMax )
+ {
+ sciprint("Error : Min and Max values for one axis do not verify Min <= Max.\n");
+ return SET_PROPERTY_ERROR ;
+ }
+
+ /* check for logflags that values are greater than 0 */
+ if ( ( ppSubWin->logflags[0] == 'l' && xMin <= 0.0 )
+ || ( ppSubWin->logflags[1] == 'l' && yMin <= 0.0 )
+ || ( ppSubWin->logflags[2] == 'l' && zMin <= 0.0 ) )
+ {
+ sciprint("Error: bounds on axis must be strictly positive to use logarithmic mode\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ /* copy the values in the axis */
+ if ( nbRow * nbCol == 4 )
+ {
+ /* 2D */
+ ppSubWin->SRect[0] = xMin ;
+ ppSubWin->SRect[1] = xMax ;
+ ppSubWin->SRect[2] = yMin ;
+ ppSubWin->SRect[3] = yMax ;
+ }
+ else
+ {
+ /* 3D */
+ ppSubWin->SRect[0] = xMin ;
+ ppSubWin->SRect[1] = xMax ;
+ ppSubWin->SRect[2] = yMin ;
+ ppSubWin->SRect[3] = yMax ;
+ ppSubWin->SRect[4] = zMin ;
+ ppSubWin->SRect[5] = zMax ;
+ }
+
+ ppSubWin->FirstPlot = FALSE;
+
+ return SET_PROPERTY_SUCCEED ;
+ }
+ else if ( sciGetEntityType(pobj) == SCI_SURFACE )
+ {
+ if ( nbRow * nbCol != 6 )
+ {
+ sciprint( "Second argument must have 6 elements.\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ copyDoubleVectorFromStack( stackPointer, pSURFACE_FEATURE(pobj)->ebox, 6 ) ;
+
+ return SET_PROPERTY_SUCCEED ;
+ }
+ else
+ {
+ sciprint("data_bounds property does not exist for this handle.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ return SET_PROPERTY_ERROR ;
+}
+/*------------------------------------------------------------------------*/
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: set_data_mapping_property.c */
+/* Copyright INRIA 2006 */
+/* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy */
+/* desc : function to modify in Scilab the data_mapping field of */
+/* a handle */
+/*------------------------------------------------------------------------*/
+
+#include <string.h>
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "SetPropertyStatus.h"
+#include "GetProperty.h"
+#include "sciprint.h"
+
+/*------------------------------------------------------------------------*/
+int set_data_mapping_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
+{
+
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property data_mapping.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if ( sciGetEntityType(pobj) != SCI_GRAYPLOT )
+ {
+ sciprint( "data_mapping property does not exist for this handle.\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if ( isStringParamEqual( stackPointer, "scaled") || isStringParamEqual( stackPointer, "direct") )
+ {
+ strcpy( pGRAYPLOT_FEATURE (pobj)->datamapping, getStringFromStack(stackPointer) ) ;
+ return SET_PROPERTY_SUCCEED ;
+ }
+ else
+ {
+ sciprint("Value must be 'direct' or 'scaled'.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ return SET_PROPERTY_ERROR ;
+
+
+}
+/*------------------------------------------------------------------------*/
return SET_PROPERTY_SUCCEED ;
}
/*------------------------------------------------------------------------*/
-int set_data_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_data_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
if( sciGetEntityType(pobj) == SCI_SEGS && pSEGS_FEATURE(pobj)->ptype == 1 )
{
AssignedList * tlist = NULL ;
int status = -1 ;
- if( !isParameterTlist(3) )
+ if( !isParameterTlist( valueType ) )
{
sciprint( "Incorrect argument, must be a Tlist!\r\n" ) ;
return SET_PROPERTY_ERROR ;
AssignedList * tlist = NULL ;
int status = -1 ;
- if( !isParameterTlist(3) )
+ if( !isParameterTlist( valueType ) )
{
sciprint( "Incorrect argument, must be a Tlist!\r\n" ) ;
return SET_PROPERTY_ERROR ;
int status = -1 ;
int listSize = 0 ;
- if( !isParameterTlist(3) )
+ if( !isParameterTlist( valueType ) )
{
sciprint( "Incorrect argument, must be a Tlist!\r\n" ) ;
return SET_PROPERTY_ERROR ;
return status ;
}
- else if ( sciGetEntityType(pobj) == SCI_POLYLINE ) /* F.Leray 02.05.05 : "data" case for others (using sciGetPoint routine inside GetProperty.c) */
+ else /* F.Leray 02.05.05 : "data" case for others (using sciGetPoint routine inside GetProperty.c) */
{
- CheckAndUpdate_x_shift( pobj, nbRow ) ; /* used only on Polyline */
- CheckAndUpdate_y_shift( pobj, nbRow ) ; /* used only on Polyline */
- CheckAndUpdate_z_shift( pobj, nbRow ) ; /* used only on Polyline */
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property data.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if ( sciGetEntityType(pobj) == SCI_POLYLINE )
+ {
+ CheckAndUpdate_x_shift( pobj, nbRow ) ; /* used only on Polyline */
+ CheckAndUpdate_y_shift( pobj, nbRow ) ; /* used only on Polyline */
+ CheckAndUpdate_z_shift( pobj, nbRow ) ; /* used only on Polyline */
+ }
- return sciSetPoint( pobj, getDoubleMatrixFromStack( stackPointer ), &nbRow, &nbCol );
- }
- else
- {
return sciSetPoint( pobj, getDoubleMatrixFromStack( stackPointer ), &nbRow, &nbCol );
}
return SET_PROPERTY_ERROR ;
#include "getPropertyAssignedValue.h"
#include "sciprint.h"
#include "InitObjects.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_default_values_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_default_values_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property default_values.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if ( getDoubleFromStack( stackPointer ) != 1 )
{
sciprint( "Value must be 1 to set default values.\n" ) ;
- return -1;
+ return SET_PROPERTY_ERROR ;
}
if ( pobj == getFigureModel() )
{
return sciSetDefaultValues();
}
- return -1 ;
+ return SET_PROPERTY_ERROR ;
}
/*------------------------------------------------------------------------*/
#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_figure_id_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_figure_id_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
int id = (int) getDoubleFromStack( stackPointer ) ;
+
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property figure_id.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if ( sciGetEntityType(pobj) != SCI_FIGURE )
{
sciprint("figure_id property undefined for this object.\n") ;
#include "SetProperty.h"
#include "getPropertyAssignedValue.h"
#include "sciprint.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_figure_name_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_figure_name_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property figure_name.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
return sciSetName( pobj, getStringFromStack( stackPointer ), nbCol * nbRow ) ;
}
/*------------------------------------------------------------------------*/
#include "setHandleProperty.h"
#include "SetProperty.h"
#include "getPropertyAssignedValue.h"
-
+#include "sciprint.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_figure_position_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_figure_position_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
double * values = getDoubleMatrixFromStack( stackPointer ) ;
+
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property figure_position.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
return sciSetFigurePos( pobj, (int)values[0], (int)values[1]);
}
/*------------------------------------------------------------------------*/
#include "Xcall1.h"
#include "GetProperty.h"
#include "InitObjects.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_figure_size_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_figure_size_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
double * values = getDoubleMatrixFromStack( stackPointer ) ;
+
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property figure_size.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if ( sciGetEntityType(pobj) != SCI_FIGURE )
{
sciprint("figure_size property undefined for this object" ) ;
- return -1;
+ return SET_PROPERTY_ERROR ;
}
pFIGURE_FEATURE( pobj )->figuredimwidth = (int) values[0] ;
PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
C2F(dr)("xset","window",&curFigNum,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0,0L,0L);
}
- return 0 ;
+ return SET_PROPERTY_SUCCEED ;
}
/*------------------------------------------------------------------------*/
#include "DrawObjects.h"
#include "DestroyObjects.h"
#include "BuildObjects.h"
+#include "SetPropertyStatus.h"
/*-----------------------------------------------------------------------------------*/
/* removeNewStyleMenu */
}
/*------------------------------------------------------------------------*/
-int set_figure_style_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_figure_style_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
struct BCG * XGC = NULL ;
int verb = 0 ;
int num ;
int na ;
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property figure_style.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if ( pobj == getFigureModel() )
{
sciprint("Can not set the style of a model.\n");
- return -1;
+ return SET_PROPERTY_ERROR ;
}
if ( isStringParamEqual( stackPointer, "old" ) )
/* Add xclear to refresh toolbar for Windows */
C2F (dr) ( "xclear", "v", PI0, PI0, PI0, PI0, PI0, PI0, PD0, PD0, PD0, PD0, 0L, 0L ) ;
- return 0 ;
+ return SET_PROPERTY_SUCCEED ;
}
else
{
/* nothing to do */
- return 0 ;
+ return SET_PROPERTY_UNCHANGED ;
}
}
else if ( isStringParamEqual( stackPointer, "new" ) )
}
/* Refresh toolbar and Menus */
updateMenus( XGC ) ;
- return 0 ;
+ return SET_PROPERTY_SUCCEED ;
}
}
else
{
/* nothing to do */
- return 0 ;
+ return SET_PROPERTY_UNCHANGED ;
}
}
else
{
sciprint("Figure style must be 'old' or 'new'.\n") ;
- return -1;
+ return SET_PROPERTY_ERROR ;
}
- return -1 ;
+ return SET_PROPERTY_ERROR ;
}
/*------------------------------------------------------------------------*/
#include "SetProperty.h"
#include "getPropertyAssignedValue.h"
#include "sciprint.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_fill_mode_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_fill_mode_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property fill_mode.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if ( isStringParamEqual( stackPointer, "on" ) )
{
return sciSetIsFilled( pobj, TRUE ) ;
else
{
sciprint( "Nothing to do (value must be 'on/off').\n" ) ;
- return -1;
+ return SET_PROPERTY_ERROR ;
}
- return -1 ;
+ return SET_PROPERTY_ERROR ;
}
/*------------------------------------------------------------------------*/
#include "SetProperty.h"
#include "getPropertyAssignedValue.h"
#include "GetProperty.h"
+#include "sciprint.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_font_angle_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_font_angle_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property font_angle.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if ( sciGetAutoRotation( pobj ) )
{
sciSetAutoRotation( pobj, FALSE ) ;
#include "getPropertyAssignedValue.h"
#include "GetProperty.h"
#include "sciprint.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_font_color_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_font_color_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+
int value = (int) getDoubleFromStack( stackPointer ) ;
+
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property font_color.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if ( sciGetEntityType(pobj) != SCI_AXES )
{
pAXES_FEATURE (pobj)->textcolor = value ;
#include "SetProperty.h"
#include "getPropertyAssignedValue.h"
#include "GetProperty.h"
+#include "sciprint.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_font_foreground_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_font_foreground_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property font_foreground.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
return sciSetFontForeground( pobj, (int) getDoubleFromStack( stackPointer ) ) ;
}
/*------------------------------------------------------------------------*/
#include "setHandleProperty.h"
#include "SetProperty.h"
#include "getPropertyAssignedValue.h"
+#include "sciprint.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_font_name_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_font_name_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property font_name.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
return sciSetFontName( pobj, getStringFromStack(stackPointer), nbRow * nbCol );
}
/*------------------------------------------------------------------------*/
#include "setHandleProperty.h"
#include "SetProperty.h"
#include "getPropertyAssignedValue.h"
+#include "sciprint.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_font_size_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_font_size_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property font_size.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
return sciSetFontDeciWidth( pobj, ((int)getDoubleFromStack( stackPointer )) );
}
/*------------------------------------------------------------------------*/
#include "getPropertyAssignedValue.h"
#include "GetProperty.h"
#include "sciprint.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_font_style_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_font_style_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
int value = (int) getDoubleFromStack( stackPointer ) ;
+
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property font_style.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if ( value > 10 || value < 0 )
{
sciprint( "The value must be in [0 10].\n" ) ;
- return -1 ;
+ return SET_PROPERTY_ERROR ;
}
return sciSetFontStyle( pobj, value ) ;
#include "setHandleProperty.h"
#include "SetProperty.h"
#include "getPropertyAssignedValue.h"
+#include "sciprint.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_foreground_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_foreground_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property foreground.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
return sciSetForeground( pobj, (int) getDoubleFromStack( stackPointer ) ) ;
}
/*------------------------------------------------------------------------*/
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: set_format_n_property.c */
+/* Copyright INRIA 2006 */
+/* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy */
+/* desc : function to modify in Scilab the format_n field of */
+/* a handle */
+/*------------------------------------------------------------------------*/
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "SetPropertyStatus.h"
+#include "GetProperty.h"
+#include "sciprint.h"
+
+/*------------------------------------------------------------------------*/
+int set_format_n_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
+{
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property format_n.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if ( sciGetEntityType(pobj) != SCI_AXES )
+ {
+ sciprint( "format_n property does not exists for this handle" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+ pAXES_FEATURE(pobj)->format[0] = getStringFromStack(stackPointer)[0] ;
+ return SET_PROPERTY_SUCCEED ;
+}
+/*------------------------------------------------------------------------*/
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: set_grid_property.c */
+/* Copyright INRIA 2006 */
+/* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy */
+/* desc : function to modify in Scilab the grid field of */
+/* a handle */
+/*------------------------------------------------------------------------*/
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "SetPropertyStatus.h"
+#include "GetProperty.h"
+#include "sciprint.h"
+#include "BasicAlgos.h"
+
+/*------------------------------------------------------------------------*/
+int set_grid_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
+{
+ int i ;
+ double * values = getDoubleMatrixFromStack( stackPointer ) ;
+
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property grid.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if ( sciGetEntityType(pobj) != SCI_SUBWIN )
+ {
+ sciprint( "grid property does nor exist for this handle.\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if ( nbRow != 1 || nbCol > 3 )
+ {
+ sciprint( "grid must be a 1x2 or 1x3 vector.\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ for ( i = 0 ; i < nbCol ; i++ )
+ {
+ if ( values[i] < -1 )
+ {
+ sciprint("Argument must be -1 (no grid) or number of color.\n");
+ return SET_PROPERTY_ERROR ;
+ }
+ pSUBWIN_FEATURE(pobj)->grid[i] = (int) values[i] ;
+ }
+
+ return SET_PROPERTY_SUCCEED ;
+}
+/*------------------------------------------------------------------------*/
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: set_handle_visible_property.c */
+/* Copyright INRIA 2006 */
+/* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy */
+/* desc : function to modify in Scilab the handle_visible field of */
+/* a handle */
+/*------------------------------------------------------------------------*/
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "sciprint.h"
+#include "GetProperty.h"
+#include "SetPropertyStatus.h"
+
+/*------------------------------------------------------------------------*/
+int set_handle_visible_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
+{
+
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property handle_visible.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if (sciGetEntityType (pobj) != SCI_UIMENU)
+ {
+ sciprint( "handle_visible property does not exist for this handle" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if ( isStringParamEqual( stackPointer, "on" ) )
+ {
+ pUIMENU_FEATURE(pobj)->handle_visible = TRUE ;
+ }
+ else if ( isStringParamEqual( stackPointer, "off" ) )
+ {
+ pUIMENU_FEATURE(pobj)->handle_visible = FALSE ;
+ }
+ else
+ {
+ sciprint("Value must be 'on' or 'off'.\n");
+ return SET_PROPERTY_ERROR ;
+ }
+
+ return SET_PROPERTY_SUCCEED ;
+}
+/*------------------------------------------------------------------------*/
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: set_hidden_axis_color_property.c */
+/* Copyright INRIA 2006 */
+/* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy */
+/* desc : function to modify in Scilab the hidden_axis_color field of */
+/* a handle */
+/*------------------------------------------------------------------------*/
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "sciprint.h"
+#include "GetProperty.h"
+#include "SetPropertyStatus.h"
+
+/*------------------------------------------------------------------------*/
+int set_hidden_axis_color_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
+{
+
+ int haColor = (int) getDoubleFromStack( stackPointer ) ;
+ int colormapSize = sciGetNumColors( pobj ) ;
+
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property hidden_axis_color.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if ( sciGetEntityType (pobj) != SCI_SUBWIN )
+ {
+ sciprint( "hidden_axis_color property does not exist for this handle.\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if ( haColor >= -2 && haColor <= colormapSize + 1 )
+ {
+ pSUBWIN_FEATURE(pobj)->axes.hiddenAxisColor = haColor ;
+ return SET_PROPERTY_SUCCEED ;
+ }
+ else
+ {
+ sciprint( "Color outside of color map boundaries.\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ return SET_PROPERTY_ERROR ;
+}
+/*------------------------------------------------------------------------*/
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: set_hidden_color_property.c */
+/* Copyright INRIA 2006 */
+/* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy */
+/* desc : function to modify in Scilab the hidden_color field of */
+/* a handle */
+/*------------------------------------------------------------------------*/
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "SetPropertyStatus.h"
+#include "sciprint.h"
+
+/*------------------------------------------------------------------------*/
+int set_hidden_color_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
+{
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property hidden_color.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ return sciSetHiddenColor( pobj, (int) getDoubleFromStack( stackPointer ) ) ;
+}
+/*------------------------------------------------------------------------*/
#include "getPropertyAssignedValue.h"
#include "sciprint.h"
#include "GetProperty.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_immediate_drawing_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_immediate_drawing_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property immediate_drawing.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if ( sciGetEntityType (pobj) != SCI_FIGURE )
{
sciprint( "immediate_drawing property undefined for this object.\n" ) ;
- return -1;
+ return SET_PROPERTY_ERROR ;
}
if ( isStringParamEqual( stackPointer, "on" ) )
{
pFIGURE_FEATURE((sciPointObj *)pobj)->auto_redraw = TRUE ;
- return 0 ;
+ return SET_PROPERTY_SUCCEED ;
}
else if ( isStringParamEqual( stackPointer, "off" ) )
{
pFIGURE_FEATURE((sciPointObj *)pobj)->auto_redraw = FALSE ;
- return 0 ;
+ return SET_PROPERTY_SUCCEED ;
}
else
{
sciprint("Nothing to do (value must be 'on/off')") ;
- return -1 ;
+ return SET_PROPERTY_ERROR ;
}
- return -1 ;
+ return SET_PROPERTY_ERROR ;
}
/*------------------------------------------------------------------------*/
#include "getPropertyAssignedValue.h"
#include "sciprint.h"
#include "GetProperty.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_interp_color_mode_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_interp_color_mode_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property interp_color_mode.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if( sciGetEntityType(pobj) != SCI_POLYLINE )
{
sciprint("interp_color_mode can only be set on Polyline objects.\n") ;
- return -1 ;
+ return SET_PROPERTY_ERROR ;
}
if( isStringParamEqual( stackPointer, "on" ) )
if ( sciGetInterpVector(pobj) == NULL )
{
sciprint("You must first specify an interp_color_vector for this object.\n") ;
- return -1 ;
+ return SET_PROPERTY_ERROR ;
}
else
{
else
{
sciprint("Property must be set to 'on' or 'off'.\n") ;
- return -1 ;
+ return SET_PROPERTY_ERROR ;
}
- return 0 ;
+ return SET_PROPERTY_SUCCEED ;
}
/*------------------------------------------------------------------------*/
#include "getPropertyAssignedValue.h"
#include "sciprint.h"
#include "GetProperty.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_interp_color_vector_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_interp_color_vector_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property interp_color_vector.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if( sciGetEntityType(pobj) != SCI_POLYLINE )
{
sciprint("interp_color_vector can only be set on Polyline objects.\n");
- return -1 ;
+ return SET_PROPERTY_ERROR ;
}
if( ( nbCol == 3 && pPOLYLINE_FEATURE(pobj)->dim_icv == 3 ) ||
( nbCol == 4 && pPOLYLINE_FEATURE(pobj)->dim_icv == 4 ) )
{
int tmp[4] ;
- int i ;
double * values = getDoubleMatrixFromStack( stackPointer ) ;
- /* convert to int */
- for( i = 0 ; i < nbCol ; i++ )
- {
- tmp[i] = (int) values[i] ;
- }
+ copyDoubleVectorToIntFromStack( stackPointer, tmp, nbCol ) ;
return sciSetInterpVector( pobj, nbCol, tmp ) ;
}
else
{
sciprint("Under interpolated color moden the column dimension of the color vector must match the number of points defining the line (which must be 3 or 4).\n") ;
- return -1 ;
+ return SET_PROPERTY_ERROR ;
}
- return -1 ;
+ return SET_PROPERTY_ERROR ;
}
/*------------------------------------------------------------------------*/
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: set_isoview_property.c */
+/* Copyright INRIA 2006 */
+/* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy */
+/* desc : function to modify in Scilab the isoview field of */
+/* a handle */
+/*------------------------------------------------------------------------*/
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "SetPropertyStatus.h"
+#include "GetProperty.h"
+#include "sciprint.h"
+
+/*------------------------------------------------------------------------*/
+int set_isoview_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
+{
+
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property isoview.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if ( sciGetEntityType(pobj) != SCI_SUBWIN )
+ {
+ sciprint( "iso_view property does not exist for this handle.\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+ if ( isStringParamEqual( stackPointer, "on" ) )
+ {
+ pSUBWIN_FEATURE (pobj)->isoview = TRUE ;
+ }
+ else if ( isStringParamEqual( stackPointer, "off" ) )
+ {
+ pSUBWIN_FEATURE (pobj)->isoview = FALSE ;
+ }
+ else
+ {
+ sciprint("Value must be 'on' or 'off'.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ return SET_PROPERTY_SUCCEED ;
+
+}
+/*------------------------------------------------------------------------*/
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: set_labels_font_style_property.c */
+/* Copyright INRIA 2006 */
+/* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy */
+/* desc : function to modify in Scilab the labels_font_style field of */
+/* a handle */
+/*------------------------------------------------------------------------*/
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "SetPropertyStatus.h"
+#include "GetProperty.h"
+#include "sciprint.h"
+
+/*------------------------------------------------------------------------*/
+int set_labels_font_style_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
+{
+
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property labels_font_style.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if (sciGetEntityType (pobj) == SCI_SUBWIN || sciGetEntityType (pobj) == SCI_FIGURE)
+ {
+ return sciSetFontStyle( pobj, (int) getDoubleFromStack(stackPointer) ) ;
+ }
+ else
+ {
+ sciprint( "labels_font_style property does not exist for this handle.\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+ return SET_PROPERTY_ERROR ;
+}
+/*------------------------------------------------------------------------*/
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: set_labels_font_color_property.c */
+/* Copyright INRIA 2006 */
+/* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy */
+/* desc : function to modify in Scilab the labels_font_color field of */
+/* a handle */
+/*------------------------------------------------------------------------*/
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "SetPropertyStatus.h"
+#include "GetProperty.h"
+#include "sciprint.h"
+
+/*------------------------------------------------------------------------*/
+int set_labels_font_color_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
+{
+
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property labels_font_color.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if (sciGetEntityType (pobj) == SCI_AXES)
+ {
+ pAXES_FEATURE(pobj)->textcolor = (int) getDoubleFromStack( stackPointer ) ;
+ }
+ else if ( sciGetEntityType (pobj) == SCI_SUBWIN || sciGetEntityType (pobj) == SCI_FIGURE )
+ {
+ return sciSetFontForeground( pobj, (int) getDoubleFromStack( stackPointer ) ) ;
+ } /* F.Leray 08.04.04 */
+ else
+ {
+ sciprint( "labels_font_color property does not exist for this handle.\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+ return SET_PROPERTY_SUCCEED ;
+}
+/*------------------------------------------------------------------------*/
--- /dev/null
+/*------------------------------------------------------------------------*/
+/* file: set_labels_font_size_property.c */
+/* Copyright INRIA 2006 */
+/* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy */
+/* desc : function to modify in Scilab the tics_segment field of */
+/* a handle */
+/*------------------------------------------------------------------------*/
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "SetPropertyStatus.h"
+#include "GetProperty.h"
+#include "sciprint.h"
+
+/*------------------------------------------------------------------------*/
+int set_labels_font_size_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
+{
+ if ( !isParameterDoubleMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property labels_font_size.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
+ if (sciGetEntityType (pobj) == SCI_AXES)
+ {
+ pAXES_FEATURE (pobj)->fontsize = (int) getDoubleFromStack( stackPointer ) ;
+ }
+ else if (sciGetEntityType (pobj) == SCI_SUBWIN || sciGetEntityType (pobj) == SCI_FIGURE)
+ {
+ return sciSetFontDeciWidth( pobj, (int) ( 100 * getDoubleFromStack(stackPointer) ) ) ; /* F.Leray 08.04.04 */
+ }
+ else
+ {
+ sciprint( "labels_font_size property does not exist for this handle.\n" ) ;
+ return SET_PROPERTY_ERROR ;
+ }
+ return SET_PROPERTY_SUCCEED ;
+}
+/*------------------------------------------------------------------------*/
#include "SetProperty.h"
#include "getPropertyAssignedValue.h"
#include "sciprint.h"
+#include "SetPropertyStatus.h"
/*------------------------------------------------------------------------*/
-int set_line_mode_property( sciPointObj * pobj, int stackPointer, int nbRow, int nbCol )
+int set_line_mode_property( sciPointObj * pobj, int stackPointer, int valueType, int nbRow, int nbCol )
{
+ if ( !isParameterStringMatrix( valueType ) )
+ {
+ sciprint("Incompatible type for property line_mode.\n") ;
+ return SET_PROPERTY_ERROR ;
+ }
+
if ( isStringParamEqual( stackPointer, "on" ) )
{
return sciSetIsLine( pobj, TRUE ) ;
else
{
sciprint("Value must be 'on/off'.\n");
- return -1;
+ return SET_PROPERTY_ERROR ;<