Bug 6930 fixed: Matplot handle had no rect property 05/13505/2
Calixte DENIZET [Wed, 22 Jan 2014 13:42:14 +0000 (14:42 +0100)]
Change-Id: Ic8e85dde812122d1cea4feb40b870b8391ec8fb9

18 files changed:
SEP/INDEX
SEP/SEP_121_Matplot_rect_property.odt [new file with mode: 0644]
scilab/CHANGES_5.5.X
scilab/modules/graphics/Makefile.am
scilab/modules/graphics/Makefile.in
scilab/modules/graphics/help/en_US/2d_plot/Matplot1.xml
scilab/modules/graphics/help/en_US/2d_plot/Matplot_properties.xml
scilab/modules/graphics/help/ja_JP/2d_plot/Matplot1.xml
scilab/modules/graphics/help/pt_BR/2d_plot/Matplot1.xml
scilab/modules/graphics/macros/%h_p.sci
scilab/modules/graphics/src/c/BuildObjects.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_rect_property.c [new file with mode: 0644]
scilab/modules/graphics/src/c/getHandleProperty/setHandleProperty.h
scilab/modules/graphics/src/c/getHandleProperty/set_rect_property.c [new file with mode: 0644]
scilab/modules/io/macros/%_save.sci

index 138a934..6a9a15c 100644 (file)
--- a/SEP/INDEX
+++ b/SEP/INDEX
@@ -116,3 +116,4 @@ SEP #117: New function ilib_build_jar
 SEP #118: New function ifftshift
 SEP #119: Management of encoding in xmlRead
 SEP #120: New function tbx_build_pal_loader
+SEP #121: New rect property for matplot handle
diff --git a/SEP/SEP_121_Matplot_rect_property.odt b/SEP/SEP_121_Matplot_rect_property.odt
new file mode 100644 (file)
index 0000000..f7ee69f
Binary files /dev/null and b/SEP/SEP_121_Matplot_rect_property.odt differ
index af2ef56..4740ef4 100644 (file)
@@ -77,6 +77,8 @@ Scilab Bug Fixes
 
 * Bug #6859 fixed - xlabel and xtitle could overlap.
 
+* Bug #6930 fixed - Matplot handle had no rect property.
+
 * Bug #7038 fixed - Toolbar button managing datatip mode did not toggle.
 
 * Bug #7047 fixed - milk_drop is now obsolete. It will be removed in Scilab 5.5.1, but will be kept as a demo.
index 9c10442..aa134df 100644 (file)
@@ -167,6 +167,7 @@ src/c/getHandleProperty/get_toolbar_property.c \
 src/c/getHandleProperty/get_menubar_property.c \
 src/c/getHandleProperty/get_infobar_property.c \
 src/c/getHandleProperty/get_dockable_property.c \
+src/c/getHandleProperty/get_rect_property.c \
 src/c/getHandleProperty/GetHashTable.c \
 src/c/graphicModuleLoad.c \
 src/c/getHandleProperty/set_old_style_property.c \
@@ -321,6 +322,7 @@ src/c/getHandleProperty/get_layout_property.c \
 src/c/getHandleProperty/set_layout_property.c \
 src/c/getHandleProperty/get_constraints_property.c \
 src/c/getHandleProperty/set_constraints_property.c \
+src/c/getHandleProperty/set_rect_property.c \
 src/c/DefaultCommandArg.c \
 src/c/Axes.c \
 src/c/sciMatrix.c \
index 67bf208..1ada6ac 100644 (file)
@@ -314,6 +314,7 @@ am__objects_1 = src/c/libscigraphics_algo_la-GetCommandArg.lo \
        src/c/getHandleProperty/libscigraphics_algo_la-get_menubar_property.lo \
        src/c/getHandleProperty/libscigraphics_algo_la-get_infobar_property.lo \
        src/c/getHandleProperty/libscigraphics_algo_la-get_dockable_property.lo \
+       src/c/getHandleProperty/libscigraphics_algo_la-get_rect_property.lo \
        src/c/getHandleProperty/libscigraphics_algo_la-GetHashTable.lo \
        src/c/libscigraphics_algo_la-graphicModuleLoad.lo \
        src/c/getHandleProperty/libscigraphics_algo_la-set_old_style_property.lo \
@@ -468,6 +469,7 @@ am__objects_1 = src/c/libscigraphics_algo_la-GetCommandArg.lo \
        src/c/getHandleProperty/libscigraphics_algo_la-set_layout_property.lo \
        src/c/getHandleProperty/libscigraphics_algo_la-get_constraints_property.lo \
        src/c/getHandleProperty/libscigraphics_algo_la-set_constraints_property.lo \
+       src/c/getHandleProperty/libscigraphics_algo_la-set_rect_property.lo \
        src/c/libscigraphics_algo_la-DefaultCommandArg.lo \
        src/c/libscigraphics_algo_la-Axes.lo \
        src/c/libscigraphics_algo_la-sciMatrix.lo \
@@ -1084,6 +1086,7 @@ src/c/getHandleProperty/get_toolbar_property.c \
 src/c/getHandleProperty/get_menubar_property.c \
 src/c/getHandleProperty/get_infobar_property.c \
 src/c/getHandleProperty/get_dockable_property.c \
+src/c/getHandleProperty/get_rect_property.c \
 src/c/getHandleProperty/GetHashTable.c \
 src/c/graphicModuleLoad.c \
 src/c/getHandleProperty/set_old_style_property.c \
@@ -1238,6 +1241,7 @@ src/c/getHandleProperty/get_layout_property.c \
 src/c/getHandleProperty/set_layout_property.c \
 src/c/getHandleProperty/get_constraints_property.c \
 src/c/getHandleProperty/set_constraints_property.c \
+src/c/getHandleProperty/set_rect_property.c \
 src/c/DefaultCommandArg.c \
 src/c/Axes.c \
 src/c/sciMatrix.c \
@@ -2024,6 +2028,9 @@ src/c/getHandleProperty/libscigraphics_algo_la-get_infobar_property.lo:  \
 src/c/getHandleProperty/libscigraphics_algo_la-get_dockable_property.lo:  \
        src/c/getHandleProperty/$(am__dirstamp) \
        src/c/getHandleProperty/$(DEPDIR)/$(am__dirstamp)
+src/c/getHandleProperty/libscigraphics_algo_la-get_rect_property.lo:  \
+       src/c/getHandleProperty/$(am__dirstamp) \
+       src/c/getHandleProperty/$(DEPDIR)/$(am__dirstamp)
 src/c/getHandleProperty/libscigraphics_algo_la-GetHashTable.lo:  \
        src/c/getHandleProperty/$(am__dirstamp) \
        src/c/getHandleProperty/$(DEPDIR)/$(am__dirstamp)
@@ -2485,6 +2492,9 @@ src/c/getHandleProperty/libscigraphics_algo_la-get_constraints_property.lo:  \
 src/c/getHandleProperty/libscigraphics_algo_la-set_constraints_property.lo:  \
        src/c/getHandleProperty/$(am__dirstamp) \
        src/c/getHandleProperty/$(DEPDIR)/$(am__dirstamp)
+src/c/getHandleProperty/libscigraphics_algo_la-set_rect_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) \
@@ -3016,6 +3026,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_pixmap_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_polyline_style_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_position_property.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_rect_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_resize_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_rotation_angles_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_rotation_style_property.Plo@am__quote@
@@ -3167,6 +3178,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_pixmap_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_polyline_style_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_position_property.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_rect_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_resize_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_rotation_angles_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_rotation_style_property.Plo@am__quote@
@@ -4231,6 +4243,13 @@ src/c/getHandleProperty/libscigraphics_algo_la-get_dockable_property.lo: src/c/g
 @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_dockable_property.lo `test -f 'src/c/getHandleProperty/get_dockable_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/get_dockable_property.c
 
+src/c/getHandleProperty/libscigraphics_algo_la-get_rect_property.lo: src/c/getHandleProperty/get_rect_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_rect_property.lo -MD -MP -MF src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_rect_property.Tpo -c -o src/c/getHandleProperty/libscigraphics_algo_la-get_rect_property.lo `test -f 'src/c/getHandleProperty/get_rect_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/get_rect_property.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_rect_property.Tpo src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_rect_property.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/c/getHandleProperty/get_rect_property.c' object='src/c/getHandleProperty/libscigraphics_algo_la-get_rect_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_rect_property.lo `test -f 'src/c/getHandleProperty/get_rect_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/get_rect_property.c
+
 src/c/getHandleProperty/libscigraphics_algo_la-GetHashTable.lo: src/c/getHandleProperty/GetHashTable.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-GetHashTable.lo -MD -MP -MF src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-GetHashTable.Tpo -c -o src/c/getHandleProperty/libscigraphics_algo_la-GetHashTable.lo `test -f 'src/c/getHandleProperty/GetHashTable.c' || echo '$(srcdir)/'`src/c/getHandleProperty/GetHashTable.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-GetHashTable.Tpo src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-GetHashTable.Plo
@@ -5309,6 +5328,13 @@ src/c/getHandleProperty/libscigraphics_algo_la-set_constraints_property.lo: src/
 @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_constraints_property.lo `test -f 'src/c/getHandleProperty/set_constraints_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/set_constraints_property.c
 
+src/c/getHandleProperty/libscigraphics_algo_la-set_rect_property.lo: src/c/getHandleProperty/set_rect_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_rect_property.lo -MD -MP -MF src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_rect_property.Tpo -c -o src/c/getHandleProperty/libscigraphics_algo_la-set_rect_property.lo `test -f 'src/c/getHandleProperty/set_rect_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/set_rect_property.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_rect_property.Tpo src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_rect_property.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/c/getHandleProperty/set_rect_property.c' object='src/c/getHandleProperty/libscigraphics_algo_la-set_rect_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_rect_property.lo `test -f 'src/c/getHandleProperty/set_rect_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/set_rect_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 05c2c26..892dab8 100644 (file)
@@ -89,21 +89,23 @@ Matplot1(a,[5,6,7,8])
 n=100;
 
 clf();
-f=gcf();//get current figure handle
-f.pixmap='on';//double buffer modea
-ax=gca();//get current axes handle
-ax.data_bounds=[0,0;10,10];//set the data_bounds
-ax.box='on'; //draw a box
-for k=-n:n,
-  a=ones(n,n);
-  a= 3*tril(a,k)+ 2*a;
-  a= a + a';
-  k1= 3*(k+100)/200;
-  if k>-n then delete(gce()),end
-  Matplot1(a,[k1,2,k1+7,9])
-  sleep(20); // Slow down the simulation
+f = gcf();//get current figure handle
+ax = gca();//get current axes handle
+ax.data_bounds = [0, 0 ; 10, 10];//set the data_bounds
+ax.box = 'on'; //draw a box
+o = ones(n, n);
+a = 3 * tril(o, -n) + 2*o;
+a = a + a';
+Matplot1(a, [0, 2, 7, 9])
+mp = gce();
+for k = (-n + 1):n,
+  a = 3 * tril(o, k) + 2 * o;
+  a = a + a';
+  k1 = 3 * (k + 100) / 200;
+  mp.data = a;
+  mp.rect = [k1, 2, k1 + 7, 9];
+  sleep(8); // Slow down the simulation
 end
-f.pixmap='off';
  ]]></programlisting>
     </refsection>
     <refsection role="see also">
index fba0d4d..4af7862 100644 (file)
                 </listitem>
             </varlistentry>
             <varlistentry>
+                <term>rect: </term>
+                <listitem>
+                    <para>
+                        this field contains a row-vector defined by <literal>[xmin, ymin, xmax, ymax]</literal>.
+                        It specifies a rectangle in the current scale and the matrix is drawn inside this rectangle.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
                 <term>image_type: </term>
                 <listitem>
                     <para>
@@ -237,4 +246,18 @@ e.data=e.data($:-1:1) // reverse order
             </member>
         </simplelist>
     </refsection>
+    <refsection>
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>5.5.0</revnumber>
+                <revremark>
+                    Property image_type introduced.
+                </revremark>
+                <revremark>
+                    Property rect introduced.
+                </revremark>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index 6ed7fca..68ff8a1 100644 (file)
@@ -83,18 +83,22 @@ Matplot1(a,[5,6,7,8])
 n=100;
 
 clf();
-f=gcf();//カレントの図のハンドルを取得
-ax=gca();//カレントの軸のハンドルを取得
-ax.data_bounds=[0,0;10,10];//data_boundsを設定
-ax.box='on'; //ボックスを描画 
-for k=-n:n,
-  a=ones(n,n);
-  a= 3*tril(a,k)+ 2*a;
-  a= a + a';
-  k1= 3*(k+100)/200;
-  if k>-n then delete(gce()),end
-  Matplot1(a,[k1,2,k1+7,9])
-  sleep(8);
+f = gcf();//カレントの図のハンドルを取得
+ax = gca();//カレントの軸のハンドルを取得
+ax.data_bounds = [0, 0 ; 10, 10];//data_boundsを設定
+ax.box = 'on'; //ボックスを描画 
+o = ones(n, n);
+a = 3 * tril(o, -n) + 2*o;
+a = a + a';
+Matplot1(a, [0, 2, 7, 9])
+mp = gce();
+for k = (-n + 1):n,
+  a = 3 * tril(o, k) + 2 * o;
+  a = a + a';
+  k1 = 3 * (k + 100) / 200;
+  mp.data = a;
+  mp.rect = [k1, 2, k1 + 7, 9];
+  sleep(8); // Slow down the simulation
 end
  ]]></programlisting>
     </refsection>
index 1b5d7bb..2f10715 100644 (file)
@@ -68,18 +68,22 @@ Matplot1(a,[5,6,7,8])
 n=100;
 
 clf();
-f=gcf();//obtendo o manipulador da figura corrente
-ax=gca();//obtendo o manipulador dos eixos corrente
-ax.data_bounds=[0,0;10,10];//ajustando the data_bounds
-ax.box='on'; //desenhando uma caixa
-for k=-n:n,
-  a=ones(n,n);
-  a= 3*tril(a,k)+ 2*a;
-  a= a + a';
-  k1= 3*(k+100)/200;
-  if k>-n then delete(gce()),end
-  Matplot1(a,[k1,2,k1+7,9])
-  sleep(8);
+f = gcf();//obtendo o manipulador da figura corrente
+ax = gca();//obtendo o manipulador dos eixos corrente
+ax.data_bounds = [0, 0 ; 10, 10];//ajustando the data_bounds
+ax.box = 'on'; //desenhando uma caixa
+o = ones(n, n);
+a = 3 * tril(o, -n) + 2*o;
+a = a + a';
+Matplot1(a, [0, 2, 7, 9])
+mp = gce();
+for k = (-n + 1):n,
+  a = 3 * tril(o, k) + 2 * o;
+  a = a + a';
+  k1 = 3 * (k + 100) / 200;
+  mp.data = a;
+  mp.rect = [k1, 2, k1 + 7, 9];
+  sleep(8); // Slow down the simulation
 end
  ]]></programlisting>
     </refsection>
index 5c81f75..4c5b997 100755 (executable)
@@ -388,6 +388,7 @@ function %h_p(h)
             "children: "+fmtchildren(h.children)
             "visible = "+sci2exp(h.visible)
             "data = "+d
+            "rect = " + sci2exp(h.rect, 0)
             "image_type = " + sci2exp(h.image_type)
             "clip_state = "+sci2exp(h.clip_state)
             "clip_box = "+sci2exp(h.clip_box,0)
index add7ca9..ade0f16 100644 (file)
@@ -575,6 +575,8 @@ int ConstructImplot(int iParentsubwinUID, double *pvecx, unsigned char *pvecz, i
         setGraphicObjectProperty(iObj, __GO_MATPLOT_SCALE__, pdblScale, jni_double_vector, 2);
     }
 
+    setGraphicObjectProperty(iObj, __GO_DATA_MODEL_MATPLOT_BOUNDS__, pvecx, jni_double_vector, 4);
+
     numElements = (n1 - 1) * (n2 - 1);
     if (plottype != -1)
     {
@@ -823,4 +825,4 @@ int ConstructLight(char* fname, int iSubwin, int type, BOOL visible, double * po
 
     iLight = createLight(iSubwin, type, visible, position, direction, ambient_color, diffuse_color, specular_color);
     return iLight;
-}
\ No newline at end of file
+}
index 7cc3603..eaf28e9 100755 (executable)
@@ -234,7 +234,8 @@ static getHashTableCouple propertyGetTable[] =
     {"infobar_visible", get_infobar_visible_property},
     {"dockable", get_dockable_property},
     {"layout", get_layout_property},
-    {"constraints", get_constraints_property}
+    {"constraints", get_constraints_property},
+    {"rect", get_rect_property}
 };
 
 /*--------------------------------------------------------------------------*/
index b1bc332..2118c95 100755 (executable)
@@ -235,7 +235,8 @@ static setHashTableCouple propertySetTable[] =
     {"infobar_visible", set_infobar_visible_property},
     {"dockable", set_dockable_property},
     {"layout", set_layout_property},
-    {"constraints", set_constraints_property}
+    {"constraints", set_constraints_property},
+    {"rect", set_rect_property}
 };
 
 /*--------------------------------------------------------------------------*/
index 1279490..0bc041c 100755 (executable)
@@ -207,5 +207,6 @@ int get_infobar_visible_property(void* _pvCtx, int iObjUID);
 int get_dockable_property(void* _pvCtx, int iObjUID);
 int get_layout_property(void* _pvCtx, int iObjUID);
 int get_constraints_property(void* _pvCtx, int iObjUID);
+int get_rect_property(void* _pvCtx, int iObjUID);
 
 #endif /* _GET_HANDLE_PROPERTY_H_ */
diff --git a/scilab/modules/graphics/src/c/getHandleProperty/get_rect_property.c b/scilab/modules/graphics/src/c/getHandleProperty/get_rect_property.c
new file mode 100644 (file)
index 0000000..add8146
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2014 - 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.1-en.txt
+ *
+ */
+
+/*------------------------------------------------------------------------*/
+/* file: get_rect_property.c                                         */
+/* desc : function to get in Scilab the rect field of             */
+/*        a matplot handle                                                        */
+/*------------------------------------------------------------------------*/
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "Scierror.h"
+#include "localization.h"
+#include "SetPropertyStatus.h"
+
+#include "getGraphicObjectProperty.h"
+#include "graphicObjectProperties.h"
+
+/*------------------------------------------------------------------------*/
+int get_rect_property(void* _pvCtx, int iObjUID)
+{
+    double * rect = NULL;
+    double _rect[4];
+    double x;
+
+    getGraphicObjectProperty(iObjUID, __GO_DATA_MODEL_MATPLOT_BOUNDS__, jni_double_vector, (void **)&rect);
+
+    if (rect == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "rect");
+        return -1;
+    }
+
+    _rect[0] = rect[0];
+    _rect[1] = rect[2];
+    _rect[2] = rect[1];
+    _rect[3] = rect[3];
+
+    return sciReturnRowVector(_pvCtx, _rect, 4);
+}
+/*------------------------------------------------------------------------*/
index 664d3b9..e772f44 100755 (executable)
@@ -208,5 +208,6 @@ int set_infobar_visible_property(void* _pvCtx, int iObj, void* _pvData, int valu
 int set_dockable_property(void* _pvCtx, int iObj, void* _pvData, int valueType, int nbRow, int nbCol);
 int set_layout_property(void* _pvCtx, int iObj, void* _pvData, int valueType, int nbRow, int nbCol);
 int set_constraints_property(void* _pvCtx, int iObj, void* _pvData, int valueType, int nbRow, int nbCol);
+int set_rect_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_rect_property.c b/scilab/modules/graphics/src/c/getHandleProperty/set_rect_property.c
new file mode 100644 (file)
index 0000000..789a3a3
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2013 - 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.1-en.txt
+ *
+ */
+
+/*------------------------------------------------------------------------*/
+/* file: set_rect_property.c                                         */
+/* desc : function to modify in Scilab the rect field of             */
+/*        a matplot handle                                                        */
+/*------------------------------------------------------------------------*/
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "Scierror.h"
+#include "localization.h"
+#include "SetPropertyStatus.h"
+
+#include "setGraphicObjectProperty.h"
+#include "graphicObjectProperties.h"
+
+/*------------------------------------------------------------------------*/
+int set_rect_property(void* _pvCtx, int iObjUID, void* _pvData, int valueType, int nbRow, int nbCol)
+{
+    BOOL status = FALSE;
+    double * rect = (double*)_pvData;
+    double pdblScale[2];
+    int numX;
+    int * piNumX = &numX;
+    int numY;
+    int * piNumY = &numY;
+
+    if (valueType != sci_matrix)
+    {
+        Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "rect");
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (nbRow * nbCol != 4)
+    {
+        Scierror(999, _("Wrong size for '%s' property: %d elements expected.\n"), "rect", 4);
+        return SET_PROPERTY_ERROR;
+    }
+
+    status = setGraphicObjectProperty(iObjUID, __GO_DATA_MODEL_MATPLOT_BOUNDS__, _pvData, jni_double_vector, 4);
+    if (status == TRUE)
+    {
+        getGraphicObjectProperty(iObjUID, __GO_DATA_MODEL_NUM_X__, jni_int, (void **)&piNumX);
+        getGraphicObjectProperty(iObjUID, __GO_DATA_MODEL_NUM_Y__, jni_int, (void **)&piNumY);
+        setGraphicObjectProperty(iObjUID, __GO_MATPLOT_TRANSLATE__, _pvData, jni_double_vector, 2);
+        pdblScale[0] = (rect[2] - rect[0]) / (numX - 1.0);
+        pdblScale[1] = (rect[3] - rect[1]) / (numY - 1.0);
+        setGraphicObjectProperty(iObjUID, __GO_MATPLOT_SCALE__, pdblScale, jni_double_vector, 2);
+
+        return SET_PROPERTY_SUCCEED;
+    }
+    else
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "margins");
+        return SET_PROPERTY_ERROR;
+    }
+}
+/*------------------------------------------------------------------------*/
index 0c329f0..5f6830a 100644 (file)
@@ -600,6 +600,7 @@ function [] = %_save(%__filename__, varargin)
         "type", ...
         "visible", ...
         "data", ...
+        "rect", ...
         "image_type", ...
         "clip_state", ...
         "clip_box", ...
@@ -877,13 +878,13 @@ function [] = %_save(%__filename__, varargin)
             end
         end
     endfunction
-       
+
     //
     // LIGHT
     //
     function returnedLight = extractLight(h)
         returnedLight = tlist([
-               "ScilabSingleHandle", ...
+        "ScilabSingleHandle", ...
         "type", ...
         "visible", ...
         "light_type", ...