added sizes property to Polyline object 02/16402/2
Juergen KOCH [Thu, 23 Apr 2015 14:48:36 +0000 (16:48 +0200)]
Change-Id: Ifc02273911832292e945e9357d81279b50c61988

21 files changed:
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/NgonGeneralData.cpp
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/graphicObject/GraphicObjectProperties.java
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/polyline/Polyline.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/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_sizes_property.c [new file with mode: 0644]
scilab/modules/graphics/src/c/getHandleProperty/setHandleProperty.h
scilab/modules/graphics/src/c/getHandleProperty/set_sizes_property.c [new file with mode: 0644]

index a037232..2a20fe2 100644 (file)
@@ -70,4 +70,7 @@
 #define DISPLAY_FUNCTION_DATA       40
 #define DISPLAY_FUNCTION_DATA_SIZE  41
 
+#define SIZES                       42
+#define NUM_SIZES                   43
+
 #endif
index eb6481b..f629d66 100644 (file)
@@ -61,8 +61,11 @@ private :
 
     /** The colors array */
     int* colors;
+       int numColors;
 
-    int numColors;
+    /** The sizes array */
+    int* sizes;
+       int numSizes;
 
 public :
     /**
@@ -218,13 +221,47 @@ public :
      */
     void copyShiftCoordinatesArray(double * newShift, double const* oldShift, int numElementsNew);
 
+    /**
+     * Sets the colors array
+     * @param[in] newColors a pointer to the array with the colors
+     * @param[in] numElements the colors array number of elements
+     * @return 1 if it succeeded, 0 if the allocation failed
+     */
     int setColors(int const* newColors, int numElements);
 
+    /**
+     * Gets the colors array
+     * @return pointer to the array with the colors
+     */
     int * getColors();
 
+    /**
+     * Gets the number of colors in the array
+     * @return number of colors in the array
+     */
     int getNumColors();
 
     /**
+     * Sets the sizes array
+     * @param[in] newSizes a pointer to the array with the sizes
+     * @param[in] numElements the sizes array number of elements
+     * @return 1 if it succeeded, 0 if the allocation failed
+     */
+    int setSizes(int const* newSizes, int numElements);
+
+    /**
+     * Gets the sizes array
+     * @return pointer to the array with the sizes
+     */
+    int * getSizes();
+
+    /**
+     * Gets the number of sizes in the array
+     * @return number of sizes in the array
+     */
+    int getNumSizes();
+
+    /**
      * Deletes the coordinates and shift arrays
      */
     void deleteCoordinatesArrays(void);
index 578ec0f..5ad07e8 100755 (executable)
 #define __GO_UI_FRAME_BORDER_TYPE__ 392
 #define __GO_UI_SCROLLABLE__ 393
 #define __GO_COLOR_SET__ 394
+#define __GO_SIZE_SET__ 395
+#define __GO_DATA_MODEL_SIZES__ 396
+#define __GO_DATA_MODEL_NUM_SIZES__ 397
 
 #endif /* !__GRAPHIC_OBJECT_PROPERTIES_H__ */
index 989d554..ee6b495 100644 (file)
@@ -41,6 +41,8 @@ NgonPolylineData::NgonPolylineData(void)
     display_function_data_size = 0;
 
     colors = NULL;
+
+       sizes = NULL;
 }
 
 NgonPolylineData::~NgonPolylineData(void)
@@ -69,6 +71,11 @@ NgonPolylineData::~NgonPolylineData(void)
     {
         delete [] colors;
     }
+       if (sizes)
+    {
+        delete [] sizes;
+    }
 }
 
 int NgonPolylineData::getPropertyFromName(int propertyName)
@@ -101,6 +108,10 @@ int NgonPolylineData::getPropertyFromName(int propertyName)
             return COLORS;
         case __GO_DATA_MODEL_NUM_COLORS__ :
             return NUM_COLORS;
+        case __GO_DATA_MODEL_SIZES__ :
+            return SIZES;
+        case __GO_DATA_MODEL_NUM_SIZES__ :
+            return NUM_SIZES;
         default :
             return NgonGeneralData::getPropertyFromName(propertyName);
     }
@@ -138,6 +149,9 @@ int NgonPolylineData::setDataProperty(int property, void const* value, int numEl
         case COLORS :
             setColors((int const*) value, numElements);
             break;
+        case SIZES :
+            setSizes((int const*) value, numElements);
+            break;
         default :
             return NgonGeneralData::setDataProperty(property, value, numElements);
     }
@@ -183,6 +197,12 @@ void NgonPolylineData::getDataProperty(int property, void **_pvData)
         case NUM_COLORS :
             ((int *) *_pvData)[0] = getNumColors();
             break;
+        case SIZES :
+            *_pvData = getSizes();
+            break;
+        case NUM_SIZES :
+            ((int *) *_pvData)[0] = getNumSizes();
+            break;
         default :
             NgonGeneralData::getDataProperty(property, _pvData);
     }
@@ -545,6 +565,54 @@ int NgonPolylineData::setColors(int const* newColors, int numElements)
     return 1;
 }
 
+int NgonPolylineData::getNumSizes(void)
+{
+    return numSizes;
+}
+
+int* NgonPolylineData::getSizes(void)
+{
+    return sizes;
+}
+
+int NgonPolylineData::setSizes(int const* newSizes, int numElements)
+{
+    int * _newSizes = 0;
+
+    if (numElements == 0)
+    {
+        if (sizes)
+        {
+            delete[] sizes;
+        }
+        sizes = NULL;
+        numSizes = 0;
+
+        return 1;
+    }
+
+    try
+    {
+        _newSizes = new int[numElements];
+    }
+    catch (const std::exception& e)
+    {
+        e.what();
+        return 0;
+    }
+
+    memcpy(_newSizes, newSizes, numElements * sizeof(int));
+    if (sizes)
+    {
+        delete[] sizes;
+    }
+
+    sizes = _newSizes;
+    numSizes = numElements;
+
+    return 1;
+}
+
 void NgonPolylineData::copyShiftCoordinatesArray(double * newShift, double const* oldShift, int numElementsNew)
 {
     int numElementsCopied = 0;
index da730e6..4927f7f 100644 (file)
@@ -89,6 +89,8 @@ void getGraphicObjectProperty(int iUID, int _iName, _ReturnType_ _returnType, vo
         case __GO_DATA_MODEL_MATPLOT_IMAGE_DATASIZE__ :
         case __GO_DATA_MODEL_DISPLAY_FUNCTION__ :
         case __GO_DATA_MODEL_DISPLAY_FUNCTION_SIZE__ :
+        case __GO_DATA_MODEL_SIZES__ :
+        case __GO_DATA_MODEL_NUM_SIZES__ :
         {
             DataController::getGraphicObjectProperty(iUID, _iName, _pvData);
             break;
index ea6fdbd..03a2edc 100644 (file)
@@ -106,6 +106,8 @@ BOOL setGraphicObjectPropertyAndWarn(int _iID, int _iName, void const* _pvValue,
         case __GO_DATA_MODEL_MATPLOT_IMAGE_TYPE__ :
         case __GO_DATA_MODEL_MATPLOT_IMAGE_DATA__ :
         case __GO_DATA_MODEL_DISPLAY_FUNCTION__ :
+        case __GO_DATA_MODEL_SIZES__ :
+        case __GO_DATA_MODEL_NUM_SIZES__ :
         {
             BOOL bFalse = FALSE;
             BOOL bTrue = TRUE;
index a865ff2..b916687 100755 (executable)
@@ -416,5 +416,6 @@ public class GraphicObjectProperties {
     public static final int __GO_UI_FRAME_BORDER_TYPE__ = 392;
     public static final int __GO_UI_SCROLLABLE__ = 393;
     public static final int __GO_COLOR_SET__ = 394;
+    public static final int __GO_SIZE_SET__ = 395;
 
 }
index 8af2f84..e03242f 100644 (file)
@@ -27,6 +27,7 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_Y_SHIFT__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_Z_SHIFT__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_COLOR_SET__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_SIZE_SET__;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -52,7 +53,7 @@ public class Polyline extends ClippableContouredObject {
     private enum PolylineProperty { CLOSED, ARROWSIZEFACTOR, POLYLINESTYLE,
                                     INTERPCOLORVECTOR, INTERPCOLORVECTORSET, INTERPCOLORMODE,
                                     XSHIFT, YSHIFT, ZSHIFT, BARWIDTH, DATATIPS, DATATIPSCOUNT,
-                                    TIP_DISPLAY_FNC, TIP_MARK, COLORSET
+                                    TIP_DISPLAY_FNC, TIP_MARK, COLORSET, SIZESET
                                   };
 
     /** Specifies whether the polyline is closed */
@@ -93,8 +94,12 @@ public class Polyline extends ClippableContouredObject {
 
     private Integer tipMark;
 
+    /** has color set */
     private boolean colorSet;
 
+    /** has size set */
+    private boolean sizeSet;
+
     /** Constructor */
     public Polyline() {
         super();
@@ -112,6 +117,7 @@ public class Polyline extends ClippableContouredObject {
         displayFnc = "";
         tipMark = 11;
         colorSet = false;
+        sizeSet = false;
     }
 
     @Override
@@ -156,6 +162,8 @@ public class Polyline extends ClippableContouredObject {
                 return PolylineProperty.TIP_MARK;
             case __GO_COLOR_SET__ :
                 return PolylineProperty.COLORSET;
+            case __GO_SIZE_SET__ :
+                return PolylineProperty.SIZESET;
             default :
                 return super.getPropertyFromName(propertyName);
         }
@@ -199,6 +207,8 @@ public class Polyline extends ClippableContouredObject {
                     return getTipMark();
                 case COLORSET:
                     return getColorSet();
+                case SIZESET:
+                    return getSizeSet();
             }
         }
         return super.getProperty(property);
@@ -253,6 +263,9 @@ public class Polyline extends ClippableContouredObject {
                     case COLORSET:
                         setColorSet((Boolean) value);
                         break;
+                    case SIZESET:
+                        setSizeSet((Boolean) value);
+                        break;
                 }
             }
             return super.setProperty(property, value);
@@ -497,6 +510,21 @@ public class Polyline extends ClippableContouredObject {
     }
 
     /**
+     * @return the sizeSet
+     */
+    public Boolean getSizeSet() {
+        return sizeSet;
+    }
+
+    /**
+     * @param sizeSet the sizeSet to set
+     */
+    public UpdateStatus setSizeSet(Boolean colorSet) {
+        this.colorSet = colorSet;
+        return UpdateStatus.Success;
+    }
+
+    /**
      * @return Type as String
      */
     public Integer getType() {
index d3df5e5..7087d12 100644 (file)
@@ -350,6 +350,8 @@ src/c/getHandleProperty/get_line_width_property.c \
 src/c/getHandleProperty/set_line_width_property.c \
 src/c/getHandleProperty/set_colors_property.c \
 src/c/getHandleProperty/get_colors_property.c \
+src/c/getHandleProperty/set_sizes_property.c \
+src/c/getHandleProperty/get_sizes_property.c \
 src/c/DefaultCommandArg.c \
 src/c/Axes.c \
 src/c/sciMatrix.c \
index 6fbd0c8..1ba99dd 100644 (file)
@@ -497,6 +497,8 @@ am__objects_1 = src/c/libscigraphics_algo_la-GetCommandArg.lo \
        src/c/getHandleProperty/libscigraphics_algo_la-set_line_width_property.lo \
        src/c/getHandleProperty/libscigraphics_algo_la-set_colors_property.lo \
        src/c/getHandleProperty/libscigraphics_algo_la-get_colors_property.lo \
+       src/c/getHandleProperty/libscigraphics_algo_la-set_sizes_property.lo \
+       src/c/getHandleProperty/libscigraphics_algo_la-get_sizes_property.lo \
        src/c/libscigraphics_algo_la-DefaultCommandArg.lo \
        src/c/libscigraphics_algo_la-Axes.lo \
        src/c/libscigraphics_algo_la-sciMatrix.lo \
@@ -1326,6 +1328,8 @@ src/c/getHandleProperty/get_line_width_property.c \
 src/c/getHandleProperty/set_line_width_property.c \
 src/c/getHandleProperty/set_colors_property.c \
 src/c/getHandleProperty/get_colors_property.c \
+src/c/getHandleProperty/set_sizes_property.c \
+src/c/getHandleProperty/get_sizes_property.c \
 src/c/DefaultCommandArg.c \
 src/c/Axes.c \
 src/c/sciMatrix.c \
@@ -2666,6 +2670,12 @@ src/c/getHandleProperty/libscigraphics_algo_la-set_colors_property.lo:  \
 src/c/getHandleProperty/libscigraphics_algo_la-get_colors_property.lo:  \
        src/c/getHandleProperty/$(am__dirstamp) \
        src/c/getHandleProperty/$(DEPDIR)/$(am__dirstamp)
+src/c/getHandleProperty/libscigraphics_algo_la-set_sizes_property.lo:  \
+       src/c/getHandleProperty/$(am__dirstamp) \
+       src/c/getHandleProperty/$(DEPDIR)/$(am__dirstamp)
+src/c/getHandleProperty/libscigraphics_algo_la-get_sizes_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) \
@@ -3252,6 +3262,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_screen_position_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_scrollable_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_segs_color_property.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_sizes_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_specular_color_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_sub_tics_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_surface_color_property.Plo@am__quote@
@@ -3419,6 +3430,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_screen_position_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_scrollable_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_segs_color_property.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_sizes_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_specular_color_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_sub_tics_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_surface_color_property.Plo@am__quote@
@@ -5763,6 +5775,20 @@ src/c/getHandleProperty/libscigraphics_algo_la-get_colors_property.lo: src/c/get
 @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_colors_property.lo `test -f 'src/c/getHandleProperty/get_colors_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/get_colors_property.c
 
+src/c/getHandleProperty/libscigraphics_algo_la-set_sizes_property.lo: src/c/getHandleProperty/set_sizes_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_sizes_property.lo -MD -MP -MF src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_sizes_property.Tpo -c -o src/c/getHandleProperty/libscigraphics_algo_la-set_sizes_property.lo `test -f 'src/c/getHandleProperty/set_sizes_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/set_sizes_property.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_sizes_property.Tpo src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_sizes_property.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/c/getHandleProperty/set_sizes_property.c' object='src/c/getHandleProperty/libscigraphics_algo_la-set_sizes_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_sizes_property.lo `test -f 'src/c/getHandleProperty/set_sizes_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/set_sizes_property.c
+
+src/c/getHandleProperty/libscigraphics_algo_la-get_sizes_property.lo: src/c/getHandleProperty/get_sizes_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_sizes_property.lo -MD -MP -MF src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_sizes_property.Tpo -c -o src/c/getHandleProperty/libscigraphics_algo_la-get_sizes_property.lo `test -f 'src/c/getHandleProperty/get_sizes_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/get_sizes_property.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_sizes_property.Tpo src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_sizes_property.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/c/getHandleProperty/get_sizes_property.c' object='src/c/getHandleProperty/libscigraphics_algo_la-get_sizes_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_sizes_property.lo `test -f 'src/c/getHandleProperty/get_sizes_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/get_sizes_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 7e67382..0641f33 100644 (file)
@@ -343,6 +343,7 @@ lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MA
     <ClCompile Include="src\c\getHandleProperty\get_screen_position_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_scrollable_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_segs_color_property.c" />
+    <ClCompile Include="src\c\getHandleProperty\get_sizes_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_specular_color_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_sub_tics_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_surface_color_property.c" />
@@ -593,6 +594,7 @@ lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MA
     <ClCompile Include="src\c\getHandleProperty\set_rotation_style_property.c" />
     <ClCompile Include="src\c\getHandleProperty\set_screen_position_property.c" />
     <ClCompile Include="src\c\getHandleProperty\set_segs_color_property.c" />
+    <ClCompile Include="src\c\getHandleProperty\set_sizes_property.c" />
     <ClCompile Include="src\c\getHandleProperty\set_sub_tics_property.c" />
     <ClCompile Include="src\c\getHandleProperty\set_surface_color_property.c" />
     <ClCompile Include="src\c\getHandleProperty\set_surface_mode_property.c" />
index b8e50ac..c6ba3c9 100644 (file)
     <ClCompile Include="src\c\getHandleProperty\get_segs_color_property.c">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="src\c\getHandleProperty\get_sizes_property.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
     <ClCompile Include="src\c\getHandleProperty\get_sub_tics_property.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="src\c\getHandleProperty\set_segs_color_property.c">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="src\c\getHandleProperty\set_sizes_property.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
     <ClCompile Include="src\c\getHandleProperty\set_sub_tics_property.c">
       <Filter>Source Files</Filter>
     </ClCompile>
index 906d152..5675218 100755 (executable)
@@ -76,6 +76,7 @@ function %h_p(h)
             "interp_color_vector = "+sci2exp(h.interp_color_vector)
             "interp_color_mode = "+sci2exp(h.interp_color_mode)
             "colors = "+sci2exp(h.colors)
+            "sizes = "+sci2exp(h.sizes)
             "mark_mode = "+sci2exp(h.mark_mode)
             "mark_style = "+sci2exp(h.mark_style)
             "mark_size_unit = "+sci2exp(h.mark_size_unit)
index 9d40fed..b3810c8 100755 (executable)
@@ -253,7 +253,8 @@ static getHashTableCouple propertyGetTable[] =
     {"marks_count", get_marks_count_property},
     {"ticks_format", get_ticks_format_property},
     {"ticks_st", get_ticks_st_property},
-    {"colors", get_colors_property}
+    {"colors", get_colors_property},
+    {"sizes", get_sizes_property}
 };
 
 /*--------------------------------------------------------------------------*/
index c95fc91..c4ee1a4 100755 (executable)
@@ -255,7 +255,8 @@ static setHashTableCouple propertySetTable[] =
     {"marks_count", set_marks_count_property},
     {"ticks_format", set_ticks_format_property},
     {"ticks_st", set_ticks_st_property},
-    {"colors", set_colors_property}
+    {"colors", set_colors_property},
+    {"sizes", set_sizes_property}
 };
 
 /*--------------------------------------------------------------------------*/
index 2678f14..4ebb533 100755 (executable)
@@ -200,5 +200,6 @@ int get_auto_margins_property(void* _pvCtx, int iObjUID);
 int get_ticks_format_property(void* _pvCtx, int iObjUID);
 int get_ticks_st_property(void* _pvCtx, int iObjUID);
 int get_colors_property(void* _pvCtx, char *pobjUID);
+int get_sizes_property(void* _pvCtx, char *pobjUID);
 
 #endif /* _GET_HANDLE_PROPERTY_H_ */
diff --git a/scilab/modules/graphics/src/c/getHandleProperty/get_sizes_property.c b/scilab/modules/graphics/src/c/getHandleProperty/get_sizes_property.c
new file mode 100644 (file)
index 0000000..3ec70fa
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2015 - Scilab Enterprises - Juergen KOCH
+ *
+ * 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-en.txt
+ *
+ */
+
+/*------------------------------------------------------------------------*/
+/* file: get_sizes_property.c                                             */
+/* desc : function to get in Scilab the polyline sizes                    */
+/*------------------------------------------------------------------------*/
+
+#include "SetPropertyStatus.h"
+#include "getHandleProperty.h"
+#include "GetProperty.h"
+#include "returnProperty.h"
+#include "Scierror.h"
+#include "localization.h"
+
+#include "getGraphicObjectProperty.h"
+#include "graphicObjectProperties.h"
+
+/*------------------------------------------------------------------------*/
+int get_sizes_property(void* _pvCtx, char* pobjUID)
+{
+    int * sizes = NULL;
+    int numSizes = 0;
+    int * piNumSizes = &numSizes;
+    int sizeSet = 0;
+    int *piSizeSet = &sizeSet;
+
+    getGraphicObjectProperty(pobjUID, __GO_SIZE_SET__, jni_bool, (void **)&piSizeSet);
+    if (piSizeSet == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "sizes");
+        return -1;
+    }
+
+    getGraphicObjectProperty(pobjUID, __GO_DATA_MODEL_SIZES__, jni_int_vector, (void **)&sizes);
+    getGraphicObjectProperty(pobjUID, __GO_DATA_MODEL_NUM_SIZES__, jni_int, &piNumSizes);
+
+    if (sizes == NULL || numSizes == 0)
+    {
+        sciReturnEmptyMatrix(_pvCtx);
+        return SET_PROPERTY_SUCCEED;
+    }
+
+    return sciReturnRowVectorFromInt(_pvCtx, sizes, numSizes);
+}
+/*------------------------------------------------------------------------*/
index f90539b..296f7ba 100755 (executable)
@@ -203,5 +203,6 @@ int set_auto_margins_property(void* _pvCtx, int iObj, void* _pvData, int valueTy
 int set_ticks_format_property(void* _pvCtx, int iObj, void* _pvData, int valueType, int nbRow, int nbCol);
 int set_ticks_st_property(void* _pvCtx, int iObj, void* _pvData, int valueType, int nbRow, int nbCol);
 int set_colors_property(void* _pvCtx, char* pobj, size_t stackPointer, int valueType, int nbRow, int nbCol);
+int set_sizes_property(void* _pvCtx, char* pobj, size_t stackPointer, int valueType, int nbRow, int nbCol);
 
 #endif /* _SET_HANDLE_PROPERTY_H_ */
diff --git a/scilab/modules/graphics/src/c/getHandleProperty/set_sizes_property.c b/scilab/modules/graphics/src/c/getHandleProperty/set_sizes_property.c
new file mode 100644 (file)
index 0000000..7d069c0
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Scilab Enterprises - Calixte DENIZET
+ *
+ * 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-en.txt
+ *
+ */
+
+/*------------------------------------------------------------------------*/
+/* file: set_sizes_property.c                                             */
+/* desc : function to modify in Scilab he polylines sizes                 */
+/*------------------------------------------------------------------------*/
+
+#include "MALLOC.h"
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "Scierror.h"
+#include "localization.h"
+#include "GetProperty.h"
+#include "SetPropertyStatus.h"
+
+#include "getGraphicObjectProperty.h"
+#include "setGraphicObjectProperty.h"
+#include "graphicObjectProperties.h"
+
+/*------------------------------------------------------------------------*/
+int set_sizes_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
+{
+    BOOL status = FALSE;
+    int iNumElements = 0;
+    int* piNumElements = &iNumElements;
+
+    if (valueType != sci_matrix)
+    {
+        Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "sizes");
+        return SET_PROPERTY_ERROR;
+    }
+
+    getGraphicObjectProperty(pobjUID, __GO_DATA_MODEL_NUM_ELEMENTS__, jni_int, (void **) &piNumElements);
+
+    /*
+     * A way to display a more explicit message would be to first get the
+     * interpolation vector set flag and test it for NULL.
+     */
+    if (piNumElements == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "sizes");
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (nbCol == 0)
+    {
+        int sizeSet = 0;
+        status = setGraphicObjectProperty(pobjUID, __GO_SIZE_SET__, &sizeSet, jni_bool, 1);
+        if (status == FALSE)
+        {
+            Scierror(999, _("'%s' property does not exist for this handle.\n"), "sizes");
+            return SET_PROPERTY_ERROR;
+        }
+        setGraphicObjectProperty(pobjUID, __GO_DATA_MODEL_SIZES__, NULL, jni_int_vector, 0);
+
+        return SET_PROPERTY_SUCCEED;
+    }
+
+    if (nbCol == iNumElements)
+    {
+        int * tmp = MALLOC(nbCol * sizeof(int));
+        stk(stackPointer);
+
+        copyDoubleVectorToIntFromStack(stackPointer, tmp, nbCol);
+
+        status = setGraphicObjectProperty(pobjUID, __GO_DATA_MODEL_SIZES__, tmp, jni_int_vector, nbCol);
+        if (status == TRUE)
+        {
+            int sizeSet = 1;
+            setGraphicObjectProperty(pobjUID, __GO_SIZE_SET__, &sizeSet, jni_bool, 1);
+            FREE(tmp);
+            return SET_PROPERTY_SUCCEED;
+        }
+        else
+        {
+            FREE(tmp);
+            Scierror(999, _("'%s' property does not exist for this handle.\n"), "sizes");
+            return SET_PROPERTY_ERROR;
+        }
+    }
+    else
+    {
+        Scierror(999, _("The number of column of the size vector must match the number of points defining the line.\n"));
+        return SET_PROPERTY_ERROR;
+    }
+}
+/*------------------------------------------------------------------------*/