add display_function_data property in polyline handle 01/13501/5
Antoine ELIAS [Wed, 22 Jan 2014 10:31:23 +0000 (11:31 +0100)]
Change-Id: Icdd587dc005a966815b040ad4107d79a2bd975f8

27 files changed:
scilab/modules/cacsd/macros/formatHallModuleTip.sci [new file with mode: 0644]
scilab/modules/cacsd/macros/formatHallPhaseTip.sci [new file with mode: 0644]
scilab/modules/cacsd/macros/formatNyquistTip.sci [new file with mode: 0644]
scilab/modules/cacsd/macros/hallchart.sci
scilab/modules/cacsd/macros/nyquist.sci
scilab/modules/graphic_objects/includes/DataProperties.hxx
scilab/modules/graphic_objects/includes/NgonPolylineData.hxx
scilab/modules/graphic_objects/includes/graphicObjectProperties.h
scilab/modules/graphic_objects/src/cpp/NgonPolylineData.cpp
scilab/modules/graphic_objects/src/cpp/getGraphicObjectProperty.cpp
scilab/modules/graphic_objects/src/cpp/setGraphicObjectProperty.cpp
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/datatip/Datatip.java
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/graphicObject/GraphicObjectProperties.java
scilab/modules/graphic_objects/src/scripts/propertiesMap.properties
scilab/modules/graphics/Makefile.am
scilab/modules/graphics/Makefile.in
scilab/modules/graphics/graphics.vcxproj
scilab/modules/graphics/graphics.vcxproj.filters
scilab/modules/graphics/macros/%h_p.sci
scilab/modules/graphics/sci_gateway/c/sci_set.c
scilab/modules/graphics/src/c/getHandleProperty/GetHashTable.c
scilab/modules/graphics/src/c/getHandleProperty/SetHashTable.c
scilab/modules/graphics/src/c/getHandleProperty/getHandleProperty.h
scilab/modules/graphics/src/c/getHandleProperty/get_display_function_data_property.c [new file with mode: 0644]
scilab/modules/graphics/src/c/getHandleProperty/setHandleProperty.h
scilab/modules/graphics/src/c/getHandleProperty/set_display_function_data_property.c [new file with mode: 0644]
scilab/modules/io/macros/%_save.sci

diff --git a/scilab/modules/cacsd/macros/formatHallModuleTip.sci b/scilab/modules/cacsd/macros/formatHallModuleTip.sci
new file mode 100644 (file)
index 0000000..85f1387
--- /dev/null
@@ -0,0 +1,13 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2010 - INRIA - Serge STEER
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+function str=formatHallModuleTip(datatipH)
+    //this function is called by the datatip mechanism to format the tip
+    //string for the Hall charts iso module curves
+    str=msprintf("%.2g"+_("dB"), datatipH.parent.display_function_data);
+endfunction
diff --git a/scilab/modules/cacsd/macros/formatHallPhaseTip.sci b/scilab/modules/cacsd/macros/formatHallPhaseTip.sci
new file mode 100644 (file)
index 0000000..30f0e5b
--- /dev/null
@@ -0,0 +1,14 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2010 - INRIA - Serge STEER
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+function str=formatHallPhaseTip(datatipH)
+    //This function is called by the datatip mechanism to format the tip
+    //string for the Hall charts iso phase curves
+    str=msprintf("%.2g°", datatipH.parent.display_function_data);
+endfunction
+
diff --git a/scilab/modules/cacsd/macros/formatNyquistTip.sci b/scilab/modules/cacsd/macros/formatNyquistTip.sci
new file mode 100644 (file)
index 0000000..28313eb
--- /dev/null
@@ -0,0 +1,17 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 1984-2011 - INRIA - Serge STEER
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+function str=formatNyquistTip(datatipHandle)
+    //This function is called by the datatip mechanism to format the tip
+    //string for the nyquist curves.
+    ud = datatipHandle.parent.display_function_data;
+    pt = datatipHandle.data(1:2);
+    [d,ptp,i,c]=orthProj(datatipHandle.parent.data, pt);
+    f=ud(i)+(ud(i+1)-ud(i))*c;
+    str=msprintf("%.4g%+.4gi\n%.4g"+_("Hz"), pt,f);
+endfunction
index b7f26dc..9469da2 100644 (file)
@@ -74,7 +74,8 @@ function hallchart(modules,args,colors)
         ec.foreground=colors(1);
         ec.line_style=7;
         ec.clip_state="clipgrf";
-        datatipInitStruct(ec,"formatfunction","formatHallModuleTip","module",modules(i))
+        ec.display_function = "formatHallModuleTip";
+        ec.display_function_data = modules(i);
         if 2*int(i/2)==i then
             xs=xc(i)+radius(i)*cos(%pi/6)
             ys=yc+radius(i)*sin(%pi/6)
@@ -107,7 +108,8 @@ function hallchart(modules,args,colors)
         ec.foreground=colors(2);
         ec.line_style=7;
         ec.clip_state="clipgrf";
-        datatipInitStruct(ec,"formatfunction","formatHallPhaseTip","phase",args(i))
+        ec.display_function = "formatHallPhaseTip";
+        ec.display_function_data = args(i);
         xstring(xc,yc(i)+radius(i),msprintf("%g°",args(i)));
         el=gce();
         el.font_foreground=colors(2);
@@ -122,18 +124,3 @@ function hallchart(modules,args,colors)
     end
     fig.immediate_drawing=immediate_drawing;
 endfunction
-
-function str=formatHallModuleTip(curve,pt,index)
-    //this function is called by the datatip mechanism to format the tip
-    //string for the Hall charts iso module curves
-    ud=datatipGetStruct(curve);
-    str=msprintf("%.2g"+_("dB"), ud.module);
-endfunction
-
-function str=formatHallPhaseTip(curve,pt,index)
-    //This function is called by the datatip mechanism to format the tip
-    //string for the Hall charts iso phase curves
-    ud=datatipGetStruct(curve);
-    str=msprintf("%.2g°", ud.phase);
-endfunction
-
index ebe6e6e..a7538f6 100644 (file)
@@ -165,7 +165,8 @@ function nyquist(varargin)
         for k=1:mn
             xpoly([R(k,:) R(k,$:-1:1)],[I(k,:) -I(k,$:-1:1)]);
             e=gce();e.foreground=k;
-            datatipInitStruct(e,"formatfunction","formatNyquistTip","freq",[F(kf,:) F(kf,$:-1:1)])
+            e.display_function = "formatNyquistTip";
+            e.display_function_data = [F(kf,:) F(kf,$:-1:1)];
             Curves=[Curves,e];
             kf=kf+ilf;
         end
@@ -173,7 +174,8 @@ function nyquist(varargin)
         for k=1:mn
             xpoly(R(k,:),I(k,:));
             e=gce();e.foreground=k;
-            datatipInitStruct(e,"formatfunction","formatNyquistTip","freq",F(kf,:))
+            e.display_function = "formatNyquistTip";
+            e.display_function_data = F(kf,:);
             Curves=[Curves,e];
             kf=kf+ilf;
         end
@@ -271,16 +273,3 @@ function nyquist(varargin)
     end
     fig.immediate_drawing=immediate_drawing;
 endfunction
-
-function str=formatNyquistTip(curve,pt,index)
-    //This function is called by the datatip mechanism to format the tip
-    //string for the nyquist curves.
-    ud=datatipGetStruct(curve);
-    if index<>[] then
-        f=ud.freq(index);
-    else //interpolated
-        [d,ptp,i,c]=orthProj(curve.data,pt);
-        f=ud.freq(i)+(ud.freq(i+1)-ud.freq(i))*c;
-    end
-    str=msprintf("%.4g%+.4gi\n%.4g"+_("Hz"), pt,f);
-endfunction
index 5d4c010..6fccfad 100644 (file)
  * To be modified.
  */
 
-#define UNKNOWN_DATA_PROPERTY   0
+#define UNKNOWN_DATA_PROPERTY       0
 
-#define NUM_GONS                1
-#define NUM_VERTICES_PER_GON    2
+#define NUM_GONS                    1
+#define NUM_VERTICES_PER_GON        2
 
-#define NUM_ELEMENTS            3
-#define NUM_ELEMENTS_ARRAY      4
-#define COORDINATES             5
-#define X_COORDINATES           6
-#define Y_COORDINATES           7
-#define Z_COORDINATES           8
+#define NUM_ELEMENTS                3
+#define NUM_ELEMENTS_ARRAY          4
+#define COORDINATES                 5
+#define X_COORDINATES               6
+#define Y_COORDINATES               7
+#define Z_COORDINATES               8
 
-#define X_COORDINATES_SHIFT     9
-#define Y_COORDINATES_SHIFT     10
-#define Z_COORDINATES_SHIFT     11
-#define X_COORDINATES_SHIFT_SET 12
-#define Y_COORDINATES_SHIFT_SET 13
-#define Z_COORDINATES_SHIFT_SET 14
-#define Z_COORDINATES_SET       15
+#define X_COORDINATES_SHIFT         9
+#define Y_COORDINATES_SHIFT         10
+#define Z_COORDINATES_SHIFT         11
+#define X_COORDINATES_SHIFT_SET     12
+#define Y_COORDINATES_SHIFT_SET     13
+#define Z_COORDINATES_SHIFT_SET     14
+#define Z_COORDINATES_SET           15
 
-#define NUM_VERTICES            16
-#define NUM_INDICES             17
-#define INDICES                 18
-#define VALUES                  19
+#define NUM_VERTICES                16
+#define NUM_INDICES                 17
+#define INDICES                     18
+#define VALUES                      19
 
-#define FEC_TRIANGLES           20
+#define FEC_TRIANGLES               20
 
-#define NUM_X                   21
-#define NUM_Y                   22
-#define NUM_Z                   23
-#define GRID_SIZE               24
-#define X_DIMENSIONS            25
-#define Y_DIMENSIONS            26
+#define NUM_X                       21
+#define NUM_Y                       22
+#define NUM_Z                       23
+#define GRID_SIZE                   24
+#define X_DIMENSIONS                25
+#define Y_DIMENSIONS                26
 
-#define COLORS                  27
-#define NUM_COLORS              28
+#define COLORS                      27
+#define NUM_COLORS                  28
 
-#define MATPLOT_BOUNDS          30
-#define MATPLOT_TYPE            31
-#define MATPLOT_VIDEO_MODE      32
-#define MATPLOT_GL_TYPE         33
-#define MATPLOT_DATA_INFOS      34
-#define MATPLOT_DATA_TYPE       35
-#define MATPLOT_DATA_ORDER      36
-#define MATPLOT_IMAGE_TYPE      37
-#define MATPLOT_IMAGE_DATA      38
-#define MATPLOT_IMAGE_DATASIZE  39
+#define MATPLOT_BOUNDS              30
+#define MATPLOT_TYPE                31
+#define MATPLOT_VIDEO_MODE          32
+#define MATPLOT_GL_TYPE             33
+#define MATPLOT_DATA_INFOS          34
+#define MATPLOT_DATA_TYPE           35
+#define MATPLOT_DATA_ORDER          36
+#define MATPLOT_IMAGE_TYPE          37
+#define MATPLOT_IMAGE_DATA          38
+#define MATPLOT_IMAGE_DATASIZE      39
+#define DISPLAY_FUNCTION_DATA       40
+#define DISPLAY_FUNCTION_DATA_SIZE  41
 
 #endif
index 5050374..b6e9df4 100644 (file)
@@ -55,6 +55,10 @@ private :
     /** The coordinates shift array */
     double* coordinatesShift;
 
+    /** data of datatip display function */
+    int* display_function_data;
+    int display_function_data_size;
+
 public :
     /**
      * Constructor
@@ -213,6 +217,15 @@ public :
      * Deletes the coordinates and shift arrays
      */
     void deleteCoordinatesArrays(void);
+
+    /**
+     * Sets data for display function
+     * @param data (numElements values)
+     * @param numElements the number of elements in the array
+     */
+    int setDisplayFunctionData(int const* data, int numElements);
+    int getDisplayFunctionDataSize();
+    int* getDisplayFunctionData();
 };
 
 #endif
index fb3d497..3ddc9da 100755 (executable)
 #define __GO_DATATIPS__ 319
 #define __GO_DATATIPS_COUNT__ 320
 #define __GO_DATATIP_INDEXES__ 321
+#define __GO_DATA_MODEL_DISPLAY_FUNCTION__ 322
+#define __GO_DATA_MODEL_DISPLAY_FUNCTION_SIZE__ 323
 
 #endif /* !__GRAPHIC_OBJECT_PROPERTIES_H__ */
index 3d3d99c..d28fd2d 100644 (file)
@@ -36,6 +36,10 @@ NgonPolylineData::NgonPolylineData(void)
     coordinatesShift = NULL;
 
     zCoordinatesSet = 0;
+
+    display_function_data = NULL;
+    display_function_data_size = 0;
+
 }
 
 NgonPolylineData::~NgonPolylineData(void)
@@ -54,6 +58,11 @@ NgonPolylineData::~NgonPolylineData(void)
     {
         delete [] zShift;
     }
+
+    if (display_function_data)
+    {
+        delete[] display_function_data;
+    }
 }
 
 int NgonPolylineData::getPropertyFromName(int propertyName)
@@ -78,6 +87,10 @@ int NgonPolylineData::getPropertyFromName(int propertyName)
             return Z_COORDINATES_SHIFT_SET;
         case __GO_DATA_MODEL_Z_COORDINATES_SET__ :
             return Z_COORDINATES_SET;
+        case __GO_DATA_MODEL_DISPLAY_FUNCTION__ :
+            return DISPLAY_FUNCTION_DATA;
+        case __GO_DATA_MODEL_DISPLAY_FUNCTION_SIZE__ :
+            return DISPLAY_FUNCTION_DATA_SIZE;
         default :
             return NgonGeneralData::getPropertyFromName(propertyName);
     }
@@ -109,6 +122,9 @@ int NgonPolylineData::setDataProperty(int property, void const* value, int numEl
         case Z_COORDINATES_SET :
             setZCoordinatesSet(*((int const*) value));
             break;
+        case DISPLAY_FUNCTION_DATA :
+            setDisplayFunctionData((int const*) value, numElements);
+            break;
         default :
             return NgonGeneralData::setDataProperty(property, value, numElements);
     }
@@ -144,6 +160,12 @@ void NgonPolylineData::getDataProperty(int property, void **_pvData)
         case Z_COORDINATES_SET :
             ((int *) *_pvData)[0] = getZCoordinatesSet();
             break;
+        case DISPLAY_FUNCTION_DATA :
+            *_pvData = getDisplayFunctionData();
+            break;
+        case DISPLAY_FUNCTION_DATA_SIZE :
+            ((int *) *_pvData)[0] = getDisplayFunctionDataSize();
+            break;
         default :
             NgonGeneralData::getDataProperty(property, _pvData);
     }
@@ -512,3 +534,35 @@ void NgonPolylineData::deleteCoordinatesArrays(void)
     }
 }
 
+int* NgonPolylineData::getDisplayFunctionData()
+{
+    return display_function_data;
+}
+
+int NgonPolylineData::getDisplayFunctionDataSize()
+{
+    return display_function_data_size;
+}
+
+int NgonPolylineData::setDisplayFunctionData(int const* data, int numElements)
+{
+    if (display_function_data != NULL)
+    {
+        delete[] display_function_data;
+        display_function_data = NULL;
+    }
+
+    try
+    {
+        display_function_data_size = numElements;
+        display_function_data = new int[numElements];
+    }
+    catch (const std::exception& e)
+    {
+        e.what();
+        return 0;
+    }
+
+    memcpy(display_function_data, data, display_function_data_size * sizeof(int));
+    return 1;
+}
\ No newline at end of file
index dff0415..4095c56 100644 (file)
@@ -72,6 +72,8 @@ void getGraphicObjectProperty(int iUID, int _iName, _ReturnType_ _returnType, vo
             || _iName == __GO_DATA_MODEL_MATPLOT_IMAGE_TYPE__
             || _iName == __GO_DATA_MODEL_MATPLOT_IMAGE_DATA__
             || _iName == __GO_DATA_MODEL_MATPLOT_IMAGE_DATASIZE__
+            || _iName == __GO_DATA_MODEL_DISPLAY_FUNCTION__
+            || _iName == __GO_DATA_MODEL_DISPLAY_FUNCTION_SIZE__
        )
     {
         DataController::getGraphicObjectProperty(iUID, _iName, _pvData);
index 8de0797..8014a16 100644 (file)
@@ -98,6 +98,7 @@ BOOL setGraphicObjectPropertyAndWarn(int _iID, int _iName, void const* _pvValue,
             || _iName == __GO_DATA_MODEL_MATPLOT_DATA_ORDER__
             || _iName == __GO_DATA_MODEL_MATPLOT_IMAGE_TYPE__
             || _iName == __GO_DATA_MODEL_MATPLOT_IMAGE_DATA__
+            || _iName == __GO_DATA_MODEL_DISPLAY_FUNCTION__
        )
     {
         BOOL ret = DataController::setGraphicObjectProperty(_iID, _iName, _pvValue, numElements);
index bda59d6..ff01719 100755 (executable)
@@ -335,6 +335,7 @@ public class Datatip extends Text {
                                "    clear(\"d\");" +
                                "catch;" +
                                "    d.display_function = \"\";" +
+                               "    d.parent.display_function = \"\";" +
                                "    clear(\"d\");" +
                                "    error(msprintf(" + errMsg + ", \"display_function\"));" +
                                "end;";
index b5b43b5..75effc3 100755 (executable)
@@ -342,5 +342,7 @@ public class GraphicObjectProperties {
     public static final int __GO_DATATIPS__ = 319;
     public static final int __GO_DATATIPS_COUNT__ = 320;
     public static final int __GO_DATATIP_INDEXES__ = 321;
+    public static final int __GO_DATA_MODEL_DISPLAY_FUNCTION__ = 322;
+    public static final int __GO_DATA_MODEL_DISPLAY_FUNCTION_SIZE__ = 323;
 
 }
index abaf3c1..6999dba 100755 (executable)
@@ -364,3 +364,6 @@ __GO_LIGHT_TYPE__
 __GO_DATATIPS__
 __GO_DATATIPS_COUNT__
 __GO_DATATIP_INDEXES__
+
+__GO_DATA_MODEL_DISPLAY_FUNCTION__
+__GO_DATA_MODEL_DISPLAY_FUNCTION_SIZE__
index a2003f4..ca03734 100644 (file)
@@ -305,6 +305,8 @@ src/c/getHandleProperty/get_figure_closerequestfcn_property.c \
 src/c/getHandleProperty/get_datatip_property.c \
 src/c/getHandleProperty/set_datatip_property.c \
 src/c/getHandleProperty/set_image_type_property.c \
+src/c/getHandleProperty/get_display_function_data_property.c \
+src/c/getHandleProperty/set_display_function_data_property.c \
 src/c/DefaultCommandArg.c \
 src/c/Axes.c \
 src/c/sciMatrix.c \
index 48fd2a1..1bfa421 100644 (file)
@@ -452,6 +452,8 @@ am__objects_1 = src/c/libscigraphics_algo_la-GetCommandArg.lo \
        src/c/getHandleProperty/libscigraphics_algo_la-get_datatip_property.lo \
        src/c/getHandleProperty/libscigraphics_algo_la-set_datatip_property.lo \
        src/c/getHandleProperty/libscigraphics_algo_la-set_image_type_property.lo \
+       src/c/getHandleProperty/libscigraphics_algo_la-get_display_function_data_property.lo \
+       src/c/getHandleProperty/libscigraphics_algo_la-set_display_function_data_property.lo \
        src/c/libscigraphics_algo_la-DefaultCommandArg.lo \
        src/c/libscigraphics_algo_la-Axes.lo \
        src/c/libscigraphics_algo_la-sciMatrix.lo \
@@ -1204,6 +1206,8 @@ src/c/getHandleProperty/get_figure_closerequestfcn_property.c \
 src/c/getHandleProperty/get_datatip_property.c \
 src/c/getHandleProperty/set_datatip_property.c \
 src/c/getHandleProperty/set_image_type_property.c \
+src/c/getHandleProperty/get_display_function_data_property.c \
+src/c/getHandleProperty/set_display_function_data_property.c \
 src/c/DefaultCommandArg.c \
 src/c/Axes.c \
 src/c/sciMatrix.c \
@@ -2403,6 +2407,12 @@ src/c/getHandleProperty/libscigraphics_algo_la-set_datatip_property.lo:  \
 src/c/getHandleProperty/libscigraphics_algo_la-set_image_type_property.lo:  \
        src/c/getHandleProperty/$(am__dirstamp) \
        src/c/getHandleProperty/$(DEPDIR)/$(am__dirstamp)
+src/c/getHandleProperty/libscigraphics_algo_la-get_display_function_data_property.lo:  \
+       src/c/getHandleProperty/$(am__dirstamp) \
+       src/c/getHandleProperty/$(DEPDIR)/$(am__dirstamp)
+src/c/getHandleProperty/libscigraphics_algo_la-set_display_function_data_property.lo:  \
+       src/c/getHandleProperty/$(am__dirstamp) \
+       src/c/getHandleProperty/$(DEPDIR)/$(am__dirstamp)
 src/c/libscigraphics_algo_la-DefaultCommandArg.lo:  \
        src/c/$(am__dirstamp) src/c/$(DEPDIR)/$(am__dirstamp)
 src/c/libscigraphics_algo_la-Axes.lo: src/c/$(am__dirstamp) \
@@ -2873,6 +2883,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_default_figure_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_diffuse_color_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_direction_property.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_display_function_data_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_event_handler_enable_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_event_handler_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_figure_closerequestfcn_property.Plo@am__quote@
@@ -3017,6 +3028,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_default_values_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_diffuse_color_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_direction_property.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_display_function_data_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_event_handler_enable_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_event_handler_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_figure_closerequestfcn_property.Plo@am__quote@
@@ -5099,6 +5111,20 @@ src/c/getHandleProperty/libscigraphics_algo_la-set_image_type_property.lo: src/c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/getHandleProperty/libscigraphics_algo_la-set_image_type_property.lo `test -f 'src/c/getHandleProperty/set_image_type_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/set_image_type_property.c
 
+src/c/getHandleProperty/libscigraphics_algo_la-get_display_function_data_property.lo: src/c/getHandleProperty/get_display_function_data_property.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/getHandleProperty/libscigraphics_algo_la-get_display_function_data_property.lo -MD -MP -MF src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_display_function_data_property.Tpo -c -o src/c/getHandleProperty/libscigraphics_algo_la-get_display_function_data_property.lo `test -f 'src/c/getHandleProperty/get_display_function_data_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/get_display_function_data_property.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_display_function_data_property.Tpo src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_display_function_data_property.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/c/getHandleProperty/get_display_function_data_property.c' object='src/c/getHandleProperty/libscigraphics_algo_la-get_display_function_data_property.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/getHandleProperty/libscigraphics_algo_la-get_display_function_data_property.lo `test -f 'src/c/getHandleProperty/get_display_function_data_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/get_display_function_data_property.c
+
+src/c/getHandleProperty/libscigraphics_algo_la-set_display_function_data_property.lo: src/c/getHandleProperty/set_display_function_data_property.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/getHandleProperty/libscigraphics_algo_la-set_display_function_data_property.lo -MD -MP -MF src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_display_function_data_property.Tpo -c -o src/c/getHandleProperty/libscigraphics_algo_la-set_display_function_data_property.lo `test -f 'src/c/getHandleProperty/set_display_function_data_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/set_display_function_data_property.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_display_function_data_property.Tpo src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_display_function_data_property.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/c/getHandleProperty/set_display_function_data_property.c' object='src/c/getHandleProperty/libscigraphics_algo_la-set_display_function_data_property.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/getHandleProperty/libscigraphics_algo_la-set_display_function_data_property.lo `test -f 'src/c/getHandleProperty/set_display_function_data_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/set_display_function_data_property.c
+
 src/c/libscigraphics_algo_la-DefaultCommandArg.lo: src/c/DefaultCommandArg.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscigraphics_algo_la-DefaultCommandArg.lo -MD -MP -MF src/c/$(DEPDIR)/libscigraphics_algo_la-DefaultCommandArg.Tpo -c -o src/c/libscigraphics_algo_la-DefaultCommandArg.lo `test -f 'src/c/DefaultCommandArg.c' || echo '$(srcdir)/'`src/c/DefaultCommandArg.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscigraphics_algo_la-DefaultCommandArg.Tpo src/c/$(DEPDIR)/libscigraphics_algo_la-DefaultCommandArg.Plo
index 326a54d..4f2638d 100644 (file)
@@ -259,6 +259,7 @@ lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MA
     <ClCompile Include="src\c\getHandleProperty\get_default_figure_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_diffuse_color_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_direction_property.c" />
+    <ClCompile Include="src\c\getHandleProperty\get_display_function_data_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_event_handler_enable_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_event_handler_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_figure_closerequestfcn_property.c" />
@@ -331,6 +332,7 @@ lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MA
     <ClCompile Include="src\c\getHandleProperty\set_ambient_color_property.c" />
     <ClCompile Include="src\c\getHandleProperty\set_diffuse_color_property.c" />
     <ClCompile Include="src\c\getHandleProperty\set_direction_property.c" />
+    <ClCompile Include="src\c\getHandleProperty\set_display_function_data_property.c" />
     <ClCompile Include="src\c\getHandleProperty\set_figure_closerequestfcn_property.c" />
     <ClCompile Include="src\c\getHandleProperty\set_figure_resizefcn_property.c" />
     <ClCompile Include="src\c\getHandleProperty\set_light_type_property.c" />
index 892a647..7c7e974 100644 (file)
     <ClCompile Include="src\c\getHandleProperty\set_direction_property.c">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="src\c\getHandleProperty\get_display_function_data_property.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="src\c\getHandleProperty\set_display_function_data_property.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="includes\Axes.h">
index f13d023..adf042b 100755 (executable)
@@ -64,6 +64,8 @@ function %h_p(h)
             "parent: "+h.parent.type
             "children: "+fmtchildren(h.children)
             "datatips: "+fmtchildren(h.datatips)
+            "display_function: "++sci2exp(h.display_function)
+            "display_function_data: "+fmtuser_data(h.display_function_data)
             "visible = "+sci2exp(h.visible)
             "data = "+d
             "closed = "+sci2exp(h.closed)
index 2e8f19a..7016cd2 100644 (file)
@@ -142,7 +142,8 @@ int sci_set(char *fname, unsigned long fname_len)
                     return 1;
                 }
 
-                if ((strcmp(pstProperty, "user_data") == 0) || (stricmp(pstProperty, "userdata") == 0))
+                if ((strcmp(pstProperty, "user_data") == 0) || (stricmp(pstProperty, "userdata") == 0) ||
+                        (strcmp(pstProperty, "display_function_data") == 0))
                 {
                     /* in this case set_user_data_property
                      * directly uses the  third position in the stack
index c6bedf9..6b9f85f 100755 (executable)
@@ -224,7 +224,8 @@ static getHashTableCouple propertyGetTable[] =
     {"light_type", get_light_type_property},
     {"direction", get_direction_property},
     {"image_type", get_image_type_property},
-    {"datatips", get_datatips_property}
+    {"datatips", get_datatips_property},
+    {"display_function_data", get_display_function_data_property}
 };
 
 /*--------------------------------------------------------------------------*/
index cf7f871..ef79e2f 100755 (executable)
@@ -225,7 +225,8 @@ static setHashTableCouple propertySetTable[] =
     {"light_type", set_light_type_property},
     {"direction", set_direction_property},
     {"image_type", set_image_type_property},
-    {"datatips", set_datatips_property}
+    {"datatips", set_datatips_property},
+    {"display_function_data", set_display_function_data_property}
 };
 
 /*--------------------------------------------------------------------------*/
index 60397a3..9b15472 100755 (executable)
@@ -197,5 +197,6 @@ int get_direction_property(void* _pvCtx, int iObjUID);
 int get_image_type_property(void* _pvCtx, int iObjUID);
 int get_video_mode_property(void* _pvCtx, int iObjUID);
 int get_datatips_property(void* _pvCtx, int iObjUID);
+int get_display_function_data_property(void* _pvCtx, int iObjUID);
 
 #endif /* _GET_HANDLE_PROPERTY_H_ */
diff --git a/scilab/modules/graphics/src/c/getHandleProperty/get_display_function_data_property.c b/scilab/modules/graphics/src/c/getHandleProperty/get_display_function_data_property.c
new file mode 100644 (file)
index 0000000..54f3c69
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2014 - Scilab Enterprises - Antoine ELIAS
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "getHandleProperty.h"
+#include "GetProperty.h"
+#include "returnProperty.h"
+#include "MALLOC.h"
+
+#include "getGraphicObjectProperty.h"
+#include "graphicObjectProperties.h"
+
+/*------------------------------------------------------------------------*/
+int get_display_function_data_property(void* _pvCtx, int iObjUID)
+{
+    int iDisplayDataSize = 0;
+    int *piDisplayDataSize = &iDisplayDataSize;
+    int *piDisplayData = NULL;
+
+    int status = 0;
+
+    getGraphicObjectProperty(iObjUID, __GO_DATA_MODEL_DISPLAY_FUNCTION_SIZE__, jni_int, (void **)&piDisplayDataSize);
+    getGraphicObjectProperty(iObjUID, __GO_DATA_MODEL_DISPLAY_FUNCTION__, jni_int_vector, (void **)&piDisplayData);
+
+    if ((piDisplayData == NULL) || (piDisplayDataSize == NULL))
+    {
+        status = sciReturnEmptyMatrix(_pvCtx);
+    }
+    else
+    {
+        status = sciReturnUserData(_pvCtx, piDisplayData, iDisplayDataSize);
+    }
+
+    return status;
+}
+
+/*------------------------------------------------------------------------*/
index 5fb0d52..7542b4c 100755 (executable)
@@ -198,5 +198,6 @@ int set_direction_property(void* _pvCtx, int iObj, void* _pvData, int valueType,
 int set_image_type_property(void* _pvCtx, int iObjUID, void* _pvData, int valueType, int nbRow, int nbCol);
 int set_video_mode_property(void* _pvCtx, int iObjUID, void* _pvData, int valueType, int nbRow, int nbCol);
 int set_datatips_property(void* _pvCtx, int iObj, void* _pvData, int valueType, int nbRow, int nbCol);
+int set_display_function_data_property(void* _pvCtx, int iObj, void* _pvData, int valueType, int nbRow, int nbCol);
 
 #endif /* _SET_HANDLE_PROPERTY_H_ */
diff --git a/scilab/modules/graphics/src/c/getHandleProperty/set_display_function_data_property.c b/scilab/modules/graphics/src/c/getHandleProperty/set_display_function_data_property.c
new file mode 100644 (file)
index 0000000..0804138
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2014 - Scilab Enterprises - Antoine ELIAS
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "setHandleProperty.h"
+#include "SetPropertyStatus.h"
+#include "Scierror.h"
+#include "localization.h"
+
+#include "setGraphicObjectProperty.h"
+#include "graphicObjectProperties.h"
+#include "api_scilab.h"
+/*------------------------------------------------------------------------*/
+int set_display_function_data_property(void* _pvCtx, int iObjUID, void* _pvData, int valueType, int nbRow, int nbCol)
+{
+    /*NOT COMPATIBLE WITH SCILAB 6*/
+    int iRhs = getRhsFromAddress(pvApiCtx, (int*)_pvData);
+    int iDisplayDataSize = GetDataSize(iRhs) * 2; /* GetDataSize returns the size of the variable in double words */
+    int *piDisplayData = (int*)GetData(iRhs);
+
+    BOOL status = FALSE;
+
+    if (setGraphicObjectProperty(iObjUID, __GO_DATA_MODEL_DISPLAY_FUNCTION__, piDisplayData, jni_int_vector, iDisplayDataSize) == FALSE)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "display_function_data");
+        return SET_PROPERTY_ERROR;
+    }
+
+    return SET_PROPERTY_SUCCEED;
+}
+
+/*------------------------------------------------------------------------*/
index bc61e3d..f86e6c4 100644 (file)
@@ -329,6 +329,8 @@ function [] = %_save(%__filename__, varargin)
         "type", ...
         "visible", ...
         "datatips", ...
+        "display_function", ...
+        "display_function_data", ...
         "data", ...
         "closed", ...
         "line_mode", ...