Bug 9890: Added Xarrows demo in Graphics Basic Functions 54/14354/4
Pierre-Aime Agnel [Mon, 7 Apr 2014 07:47:43 +0000 (09:47 +0200)]
Change-Id: I31e32f8d60af4ba0049fe69ceaa0e96c07e65930

scilab/CHANGES_5.5.X
scilab/modules/graphics/demos/basic_functions/basic_functions.dem.gateway.sce
scilab/modules/graphics/demos/basic_functions/basic_functions_xarrows.dem.sce [new file with mode: 0644]
scilab/modules/graphics/help/en_US/geometric_shapes/xarrows.xml

index 0594eb5..b15c54d 100644 (file)
@@ -50,6 +50,8 @@ Scilab Bug Fixes
 
 * Bug #8066 fixed - There was no OK button in x_choose window.
 
+* Bug #9890 fixed - xarrows demonstration added in Graphics/Basic functions category.
+
 * Bug #12788 fixed - All graphics were displayed in red on some platforms.
 
 * Bug #12842 fixed - Scilab could not be launched on some platforms (ATOMS internal library loading problem).
index fedd8f0..e833eac 100644 (file)
@@ -6,15 +6,16 @@
 demopath = get_absolute_file_path("basic_functions.dem.gateway.sce");
 
 subdemolist=[                                                                            ..
-"Rectangles, Arcs, Polylines, Segments and Numbers","basic_functions_1.dem.sce" ; ..
-"Rectangles, Arcs, Polylines and Strings"          ,"basic_functions_2.dem.sce" ; ..
-"Setting properties"                               ,"basic_functions_3.dem.sce" ; ..
-"Window properties"                                ,"basic_functions_4.dem.sce" ; ..
-"Set of rectangles"                                ,"basic_functions_5.dem.sce" ; ..
-"Colored matrix"                                   ,"basic_functions_6.dem.sce" ; ..
-"Colored histogram"                                ,"basic_functions_7.dem.sce" ; ..
-"Pie Chart"                                        ,"basic_functions_8.dem.sce" ; ..
-"Milk Drop"                                        ,"basic_functions_9.dem.sce" ]
+"Rectangles, Arcs, Polylines, Segments and Numbers", "basic_functions_1.dem.sce" ; ...
+"Rectangles, Arcs, Polylines and Strings"          , "basic_functions_2.dem.sce" ; ...
+"Setting properties"                               , "basic_functions_3.dem.sce" ; ...
+"Window properties"                                , "basic_functions_4.dem.sce" ; ...
+"Set of rectangles"                                , "basic_functions_5.dem.sce" ; ...
+"Colored matrix"                                   , "basic_functions_6.dem.sce" ; ...
+"Colored histogram"                                , "basic_functions_7.dem.sce" ; ...
+"Pie Chart"                                        , "basic_functions_8.dem.sce" ; ...
+"Milk Drop"                                        , "basic_functions_9.dem.sce" ; ...
+"Xarrows"                                          , "basic_functions_xarrows.dem.sce"; ];
 
-subdemolist(:,2) = demopath + subdemolist(:,2);
+subdemolist(:, 2) = demopath + subdemolist(:, 2);
 clear demopath;
diff --git a/scilab/modules/graphics/demos/basic_functions/basic_functions_xarrows.dem.sce b/scilab/modules/graphics/demos/basic_functions/basic_functions_xarrows.dem.sce
new file mode 100644 (file)
index 0000000..bf6c7b1
--- /dev/null
@@ -0,0 +1,40 @@
+//
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2014 Scilab Enterprises - Pierre-Aime Agnel
+//
+// This file is distributed under the same license as the Scilab package.
+
+// = =========================================================================== =
+// xarrows
+// = =========================================================================== =
+
+fp_old = funcprot();
+w_old  = warning("query");
+funcprot(0);
+warning("off");
+
+function demo_basic_function_xarrows()
+    f = figure("dockable", "off", "toolbar", "none", "visible", "off");
+    f.backgroundcolor = [1, 1, 1];
+    f.figure_name = "xarrows in 3D";
+
+    N = 100;
+    zi = linspace(-1, 2, N);
+    zf = zi;
+    theta = (zi - min(zi)) / (max(zi)-min(zi)) * 720;
+    xi = zeros(1, N);  xf = cosd(theta);
+    yi = zeros(1, N);  yf = sind(theta);
+
+    plot3d([-1 1 1 1], [-1 -1 -1 1], [-1 -1 2 2])
+    xarrows([xi; xf], [yi; yf], [zi; zf], 0.7, 32*rand(1, N))
+
+    demo_viewCode("basic_functions_xarrows.dem.sce")
+    f.visible = "on"
+endfunction
+
+demo_basic_function_xarrows();
+clear demo_basic_function_xarrows;
+
+funcprot(fp_old);
+warning(w_old);
+clear fp_old w_old;
index ea4bda9..92f6c99 100644 (file)
@@ -59,7 +59,7 @@
         <para>
             <function>xarrows</function> draws a set of arrows
             given by <varname>nx</varname>, <varname>ny</varname> and <varname>nz</varname>.
-           If <varname>nz</varname> is not given, then the arrows are drawn in 2D.
+            If <varname>nz</varname> is not given, then the arrows are drawn in 2D.
             If <varname>nx</varname>, <varname>ny</varname> and <varname>nz</varname> are vectors,
             the <literal>i</literal>-th arrow is defined by
             <literal>(nx(i),ny(i),nz(i))--&gt;(nx(i+1),ny(i+1),nz(i+1))</literal>.
@@ -110,14 +110,14 @@ clf, plot3d([-1 1 1 1],[-1 -1 -1 1],[-1 -1 2 2])
 xarrows([xi;xf],[yi;yf],[zi;zf],0.7, 32*rand(1,N))
  ]]></programlisting>
         <scilab:image>
-N = 100;
-zi = linspace(-1,2,N);
-zf = zi;
-theta = (zi - min(zi))/(max(zi)-min(zi))*720;
-xi = zeros(1,N);  xf = cosd(theta);
-yi = zeros(1,N);  yf = sind(theta);
-clf, plot3d([-1 1 1 1],[-1 -1 -1 1],[-1 -1 2 2])
-xarrows([xi;xf],[yi;yf],[zi;zf],0.7, 32*rand(1,N))
+            N = 100;
+            zi = linspace(-1,2,N);
+            zf = zi;
+            theta = (zi - min(zi))/(max(zi)-min(zi))*720;
+            xi = zeros(1,N);  xf = cosd(theta);
+            yi = zeros(1,N);  yf = sind(theta);
+            clf, plot3d([-1 1 1 1],[-1 -1 -1 1],[-1 -1 2 2])
+            xarrows([xi;xf],[yi;yf],[zi;zf],0.7, 32*rand(1,N))
         </scilab:image>
     </refsection>
     <refsection>