Update demos system
Pierre Marechal [Mon, 9 Jun 2008 13:01:12 +0000 (13:01 +0000)]
85 files changed:
scilab/modules/cacsd/Makefile.am
scilab/modules/cacsd/Makefile.in
scilab/modules/cacsd/demos/cacsd.dem.gateway.sce [new file with mode: 0644]
scilab/modules/cacsd/demos/control.dem [deleted file]
scilab/modules/cacsd/demos/flat/car.dem.sce [new file with mode: 0644]
scilab/modules/cacsd/demos/flat/car.sci [deleted file]
scilab/modules/cacsd/demos/flat/flat.dem [deleted file]
scilab/modules/cacsd/demos/flat/flat.dem.gateway.sce [new file with mode: 0644]
scilab/modules/cacsd/demos/flat/truck.dem.sce [new file with mode: 0644]
scilab/modules/cacsd/demos/flat/truck.sci [deleted file]
scilab/modules/cacsd/demos/pendulum/pendule.dem
scilab/modules/cacsd/demos/tracking/track.dem.sce [moved from scilab/modules/cacsd/demos/tracking/track.dem with 93% similarity]
scilab/modules/cacsd/etc/cacsd.start
scilab/modules/graphics/demos/2d_3d_plots/2d_3d_plots.dem.gateway.sce
scilab/modules/graphics/demos/2d_3d_plots/abaque.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/champ.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/contour.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/contour_3d_2.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/contour_3d_3.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/contour_3d_4.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/contourf.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/errbar.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/fac3d.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/fac3d1.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/fchamp.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/fcontour.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/fgrayplot.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/fplot2d.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/fplot3d.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/fplot3d1.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/grayplot.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/histplot.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/param3d_1.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/param3d_2.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/plot2d.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/plot2d1_1.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/plot2d1_2.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/plot2d3.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/plot3d.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/plot3d1.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/subplot.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/xgeom.dem.sce
scilab/modules/graphics/demos/2d_3d_plots/zgrid.dem.sce
scilab/modules/graphics/demos/anim/anim.dem.gateway.sce
scilab/modules/graphics/demos/anim/anim1/anim1.sce
scilab/modules/graphics/demos/anim/anim1/anim1_gateway.sce
scilab/modules/graphics/demos/anim/anim2/anim2.sce
scilab/modules/graphics/demos/anim/anim2/anim2_gateway.sce
scilab/modules/graphics/demos/anim/anim3/anim3.sce
scilab/modules/graphics/demos/anim/anim3/anim3_gateway.sce
scilab/modules/graphics/demos/anim/anim4/anim4.sce
scilab/modules/graphics/demos/anim/anim4/anim4_gateway.sce
scilab/modules/graphics/demos/anim/anim5/anim5.sce
scilab/modules/graphics/demos/anim/anim5/anim5_gateway.sce
scilab/modules/graphics/demos/anim/anim6/anim6.sce
scilab/modules/graphics/demos/anim/anim6/anim6_gateway.sce
scilab/modules/graphics/demos/anim/anim7/anim7.sce
scilab/modules/graphics/demos/anim/anim7/anim7_gateway.sce
scilab/modules/graphics/demos/basic_functions/basic_functions.dem.gateway.sce
scilab/modules/graphics/demos/basic_functions/basic_functions_1.dem.sce
scilab/modules/graphics/demos/basic_functions/basic_functions_2.dem.sce
scilab/modules/graphics/demos/basic_functions/basic_functions_3.dem.sce
scilab/modules/graphics/demos/basic_functions/basic_functions_4.dem.sce
scilab/modules/graphics/demos/basic_functions/basic_functions_5.dem.sce
scilab/modules/graphics/demos/basic_functions/basic_functions_6.dem.sce
scilab/modules/graphics/demos/basic_functions/basic_functions_7.dem.sce
scilab/modules/graphics/demos/basic_functions/basic_functions_8.dem.sce
scilab/modules/graphics/demos/bezier/bezier.dem.gateway.sce
scilab/modules/graphics/demos/fec/fec.dem.gateway.sce
scilab/modules/graphics/demos/fec/fec.ex2
scilab/modules/graphics/demos/fec/fec.ex3
scilab/modules/graphics/demos/fec/fec.ex4
scilab/modules/graphics/demos/graphics.dem.gateway.sce
scilab/modules/graphics/demos/surface/surfaces.dem.gateway.sce
scilab/modules/gui/Makefile.am
scilab/modules/gui/Makefile.in
scilab/modules/gui/demos/cb_uicontrol_plot3d.dem.sci [new file with mode: 0644]
scilab/modules/gui/demos/dialog.dem.sce [moved from scilab/modules/gui/demos/dialog.dem with 99% similarity]
scilab/modules/gui/demos/gui.dem.gateway.sce [new file with mode: 0644]
scilab/modules/gui/demos/uicontrol.dem.sce [moved from scilab/modules/tclsci/demos/tk/uicontrol.sci with 92% similarity]
scilab/modules/gui/demos/uicontrol_plot3d.dem.sce [new file with mode: 0644]
scilab/modules/gui/etc/gui.start
scilab/modules/tclsci/Makefile.am
scilab/modules/tclsci/Makefile.in
scilab/modules/tclsci/demos/tk/tcltk.dem.gateway.sce

index f05aa6d..397c288 100644 (file)
@@ -261,28 +261,31 @@ includes/gw_slicot.h
 
 ####�cacsd : demos files ####
 libscicacsd_la_demosdir=$(mydatadir)
-nobase_libscicacsd_la_demos_DATA = demos/tracking/track.dem \
-demos/lqg/lqg.dem \
-demos/lqg/scheme.dem \
-demos/lqg/lqg2.dem \
+nobase_libscicacsd_la_demos_DATA = demos/cacsd.dem.gateway.sce \
+demos/cacsd.dem.gateway.sce~ \
+demos/cont.dem \
+demos/flat/car.dem.sce \
 demos/flat/car.sci \
-demos/flat/truck.sci \
-demos/flat/flat.dem \
-demos/flat/fcts.sci \
-demos/flat/demo_truck_eng_htm \
-demos/flat/demo_truck_fr.htm \
 demos/flat/demo_car_eng.htm \
 demos/flat/demo_car_fr.htm \
+demos/flat/demo_truck_eng_htm \
+demos/flat/demo_truck_fr.htm \
+demos/flat/fcts.sci \
+demos/flat/flat.dem.gateway.sce \
+demos/flat/truck.dem.sce \
+demos/flat/truck.sci \
+demos/lqg/lqg.dem \
+demos/lqg/lqg2.dem \
+demos/lqg/scheme.dem \
+demos/mixed.dem \
+demos/pendulum/graphics.sci \
 demos/pendulum/pendule.dem \
 demos/pendulum/simulation.sci \
 demos/pendulum/yy \
-demos/pendulum/graphics.sci \
+demos/pid.dem \
 demos/robust/como.dem \
 demos/robust/mu.dem \
 demos/robust/rob.dem \
-demos/pid.dem \
-demos/control.dem \
-demos/cont.dem \
-demos/mixed.dem
+demos/tracking/track.dem.sce
 
 include $(top_srcdir)/Makefile.incl.am
index 4041525..11df586 100644 (file)
@@ -676,29 +676,32 @@ includes/gw_slicot.h
 
 ####�cacsd : demos files ####
 libscicacsd_la_demosdir = $(mydatadir)
-nobase_libscicacsd_la_demos_DATA = demos/tracking/track.dem \
-demos/lqg/lqg.dem \
-demos/lqg/scheme.dem \
-demos/lqg/lqg2.dem \
+nobase_libscicacsd_la_demos_DATA = demos/cacsd.dem.gateway.sce \
+demos/cacsd.dem.gateway.sce~ \
+demos/cont.dem \
+demos/flat/car.dem.sce \
 demos/flat/car.sci \
-demos/flat/truck.sci \
-demos/flat/flat.dem \
-demos/flat/fcts.sci \
-demos/flat/demo_truck_eng_htm \
-demos/flat/demo_truck_fr.htm \
 demos/flat/demo_car_eng.htm \
 demos/flat/demo_car_fr.htm \
+demos/flat/demo_truck_eng_htm \
+demos/flat/demo_truck_fr.htm \
+demos/flat/fcts.sci \
+demos/flat/flat.dem.gateway.sce \
+demos/flat/truck.dem.sce \
+demos/flat/truck.sci \
+demos/lqg/lqg.dem \
+demos/lqg/lqg2.dem \
+demos/lqg/scheme.dem \
+demos/mixed.dem \
+demos/pendulum/graphics.sci \
 demos/pendulum/pendule.dem \
 demos/pendulum/simulation.sci \
 demos/pendulum/yy \
-demos/pendulum/graphics.sci \
+demos/pid.dem \
 demos/robust/como.dem \
 demos/robust/mu.dem \
 demos/robust/rob.dem \
-demos/pid.dem \
-demos/control.dem \
-demos/cont.dem \
-demos/mixed.dem
+demos/tracking/track.dem.sce
 
 
 # Where all the Scilab stuff is installed (macros, help, ...)
diff --git a/scilab/modules/cacsd/demos/cacsd.dem.gateway.sce b/scilab/modules/cacsd/demos/cacsd.dem.gateway.sce
new file mode 100644 (file)
index 0000000..f6a324b
--- /dev/null
@@ -0,0 +1,19 @@
+//
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) ????-2008 - INRIA
+//
+// This file is distributed under the same license as the Scilab package.
+//
+
+
+demopath = get_absolute_file_path("cacsd.dem.gateway.sce");
+
+subdemolist = ["LQG"                , "lqg/lqg.dem"
+               "Mixed-sensitivity"  , "mixed.dem"
+               "PID"                , "pid.dem"
+               "Inverted pendulum"  , "pendulum/pendule.dem"
+               "Flat systems"       , "flat/flat.dem.gateway.sce"
+               "Tracking"           , "tracking/track.dem.sce"
+               "Robust control"     , "robust/rob.dem"]
+
+subdemolist(:,2) = demopath + subdemolist(:,2);
diff --git a/scilab/modules/cacsd/demos/control.dem b/scilab/modules/cacsd/demos/control.dem
deleted file mode 100644 (file)
index b9e1e37..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) ????-2008 - INRIA
-//
-// This file is distributed under the same license as the Scilab package.
-//
-
-mode(-1)
-path=get_absolute_file_path('control.dem');
-oldln=lines();lines(0)
-
-demolist=['LQG',               'lqg/lqg.dem'
-         'Mixed-sensitivity', 'mixed.dem'
-         'PID'                'pid.dem'
-         'Inverted pendulum', 'pendulum/pendule.dem'
-         'Flat systems',      'flat/flat.dem'
-         'Tracking',          'tracking/track.dem'
-         'Robust control',    'robust/rob.dem']
-
-deff('[]=demoex(num)','exec(path+demolist(num,2),-1)')
-
-while %t then
-  num=x_choose(demolist(:,1),'Choose a demo');
-  if num==0 then 
-     lines(oldln(1))
-     return
-  else
-     demoex(num)
-  end,
-end
-
-
diff --git a/scilab/modules/cacsd/demos/flat/car.dem.sce b/scilab/modules/cacsd/demos/flat/car.dem.sce
new file mode 100644 (file)
index 0000000..4fb9339
--- /dev/null
@@ -0,0 +1,11 @@
+exec(get_absolute_file_path("car.dem.sce") + "/car.sci",-1);
+
+initial               =[3;3;0;0];
+final                 =[0;0;0;0];
+my_handle             = scf(100001);
+clf(my_handle,"reset");
+my_handle.pixmap      = "off" ;
+toolbar(my_handle.figure_id,"off");
+display_truck_trajectory(state);
+state=car_solve(initial,final);
+display_car_trajectory(state);
diff --git a/scilab/modules/cacsd/demos/flat/car.sci b/scilab/modules/cacsd/demos/flat/car.sci
deleted file mode 100644 (file)
index a25fafb..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-function demo_car()
-  initial=[3;3;0;0]
-  final=[0;0;0;0]
-  f = gcf() ;
-  f.pixmap = 'on' ;
-  toolbar(0,'off');
-  state=car_solve(initial,final);
-  display_car_trajectory(state)
-endfunction
-
-function state=car_solve(initial,final)
-//
-//  CAR PACKING VIA FLATNESS AND FRENET FORMULAS
-//
-//    explicit computation and visualisation of the motions.
-//
-//    February 1993
-//
-// ............................................................
-// :         pierre ROUCHON  <rouchon@cas.ensmp.fr>           :
-// : Centre Automatique et Systemes, Ecole des Mines de Paris :
-// : 60, bd Saint Michel -- 75272 PARIS CEDEX 06, France      :
-// :    Telephone: (1) 40 51 91 15 --- Fax: (1) 43 54 18 93   :
-// :..........................................................:
-//
-// initial: initial position [x,y,theta,phi]
-// final  :   final position [x,y,theta,phi]
-//        theta  : the car angle
-//        phi    : the front wheel angle
-  
-  bigT = 1 ;//basic time interval for one  smooth motion (s)
-  bigL = 1 ;// car length (m) 
-
-  // computation of  intermediate configuration 
-  x0 = maxi(initial(1),final(2))   ....
-       + bigL*abs(tan(initial(3))) ...
-       + bigL*abs(tan(final(3))) ...
-       + bigL*(abs(initial(2)-final(2))/bigL)^(1/2) ;
-  y0 = (initial(2)+final(2))/2 ;
-  intermediate=[x0,y0,0,0]'
-
-  // first polynomial curve
-  state=[matrix(initial,1,-1);
-        car_polynomial_curve(initial,intermediate,"direct")]
-  //
-  // second polynomial curve
-  state = [ state; 
-           matrix(intermediate,1,-1) 
-           car_polynomial_curve(final,intermediate,"reverse")
-           matrix(final,1,-1)] 
-endfunction
-
-function state=car_polynomial_curve(initial,final,orient)
-
-  nbpt = 40 ; //  sampling of motion 
-  theta1 = initial(3) ; phi1 = initial(4) ;
-  da = initial(1)-final(1)
-  
-  M = [da^3     da^4     da^5 
-       3*da^2   4*da^3   5*da^4
-       6*da    12*da^2  20*da^3 ] ;
-  
-  q = [initial(2)-final(2)
-       tan(theta1) 
-       tan(phi1)/(bigL*(cos(theta1)^3))] ;
-  
-  p = inv(M)*q ;
-  tau=(0:nbpt)'/nbpt
-  phi=tau.*tau.*(3-2*tau) ;
-  if orient=='reverse' then
-    a = (1-phi)*final(1) + phi*initial(1) ;
-  else
-    a = (1-phi)*initial(1) + phi*final(1) ;
-  end
-  da=a-final(1)
-  
-  f=  final(2)+ p(1).*da^3 +    p(2).*da^4 +    p(3).*da^5 ;
-  df  =       3*p(1).*da^2 +  4*p(2).*da^3 +  5*p(3).*da^4 ;
-  ddf =       6*p(1).*da   + 12*p(2).*da^2 + 20*p(3).*da^3 ;
-  
-  k = ddf ./ ((1+df.*df)^(3/2)) ;
-  state=[ a   f  atan(df) atan(k*bigL)]
-endfunction
-
-function display_car_trajectory(state)
-  bigL=1
-  set figure_style new;xbasc();xselect()
-  a=gca()
-  drawlater()
-  a.isoview="on"
-  a.data_bounds=[mini(state(:,1))-0.5*bigL, mini(state(:,2))-1.5*bigL
-                maxi(state(:,1))+1.5*bigL, maxi(state(:,2))+1.5*bigL]
-  rect=matrix(a.data_bounds',-1,1)
-  xpoly(rect([1 3 3 1]),rect([2,2,4,4]),'lines',1)
-  C=build_car()
-  Cinit=[];Cend=[];Cinter=[];
-  for k=1:size(C,'*')
-    Cinit=[Cinit copy(C(k))];
-    Cinter=[Cinter,copy(C(k))];
-    Cend=[Cend,copy(C(k))]
-  end
-  // starting configuration
-  draw_car(Cinit,state(1,:))
-  // end configuration
-  draw_car(Cend,state($,:))
-  // intermediate configuration (inversion of velocity)
-  draw_car(Cinter,state(ceil(size(state,1)/2),:)) ;
-  // trajectory of the linearizing output
-  t1=polyline([state(1,1) state(1,2);state(1,1) state(1,2)]) ;
-  t1.line_style=2;
-  realtimeinit(0.1)
-  for i=1:size(state,1)
-    realtime(i) 
-    drawlater()
-    draw_car(C, state(i,:)) 
-    t1.data=[t1.data;state(i,1) state(i,2)];
-    drawnow()
-  end 
-  for i=(1:30)+size(state,1),realtime(i),end
-  xdel()
-endfunction
-
-
-function C=build_car()
-//build the graphic object for the car
-// 
-  //the car
-  hcar=polyline([-2,7,8,8,7,-2,-2;-2,-2,-1,1,2,2,-2]'/6)
-  hcar.foreground=2
-
-  // rear wheels
-  hwheel1=polyline([[-1 1]/8; [1 1]/6]')
-  hwheel1.thickness=2
-   
-  hwheel2=polyline([[-1 1]/8; -[1 1]/6]')
-  hwheel2.thickness=2
-  
-  // front wheels
-  hwheel3=polyline([[7 9]/8;[1 1]/6]')
-  hwheel3.thickness=2
-  hwheel4=polyline([[7 9]/8;-[1 1]/6]') 
-  hwheel4.thickness=2
-  //return vector of handle on the objects
-  C=[hcar,hwheel1,hwheel2,hwheel3,hwheel4]
-endfunction
-
-function draw_car(C,pos)
-  drawlater()
-  [x,y,theta,phi]=(pos(1),pos(2),pos(3),pos(4))
-  bigL=1
-  Rc=[cos(theta) sin(theta);-sin(theta) cos(theta)]
-  // the car
-  xy = [-2,-2;7,-2;8,-1;8,1;7,2;-2,2;-2,-2]/6
-  C(1).data=ones(xy)*diag([x;y])+bigL*xy*Rc
-  // rear wheels
-  xy=[[-1 1]/8; [1 1]/6]'
-  C(2).data=ones(xy)*diag([x;y])+bigL*xy*Rc
-  xy=[[-1 1]/8; -[1 1]/6]'
-  C(3).data=ones(xy)*diag([x;y])+bigL*xy*Rc
-  // front wheels
-  xy=[(1-cos(phi)/8) (1/6-sin(phi)/8)
-      (1+cos(phi)/8) (1/6+sin(phi)/8)]
-  C(4).data=ones(xy)*diag([x;y])+bigL*xy*Rc
-  xy=[(1-cos(phi)/8) (-1/6-sin(phi)/8)
-      (1+cos(phi)/8) (-1/6+sin(phi)/8)]
-  C(5).data=ones(xy)*diag([x;y])+bigL*xy*Rc
-  drawnow()
-  show_pixmap();
-endfunction
-
-function h=polyline(xy)
-  xpoly(xy(:,1),xy(:,2),'lines')
-  h=gce()
-endfunction
diff --git a/scilab/modules/cacsd/demos/flat/flat.dem b/scilab/modules/cacsd/demos/flat/flat.dem
deleted file mode 100644 (file)
index 4dd5873..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) ????-2008 - INRIA
-//
-// This file is distributed under the same license as the Scilab package.
-//
-
-mode(-1);
-
-path=pathconvert(get_absolute_file_path('flat.dem'),%t,%t)
-getf(path+'car.sci');
-getf(path+'truck.sci');
-
-global LANGUAGE
-
-demolist=['Car  ';
-          'Two trailers truck ';];
-
-
-while %t then
-  num=x_choose(demolist(:,1),'Choose a vehicle');
-  if num==0 then break,end
-  select num
-    case 1 then 
-    if LANGUAGE=='fr' then
-//      browsehelp(path+'demo_car_fr.htm',' ')
-    else
-//      browsehelp(path+'demo_car_eng.htm',' ')
-    end
-    demo_car()
-    
-    case 2 then 
-    if LANGUAGE=='fr' then
-//      browsehelp(path+'demo_truck_fr.htm',' ')
-    else
-//      browsehelp(path+'demo_truck_eng.htm',' ')
-    end
-    demo_truck()
-  end;
-end,
-
-
diff --git a/scilab/modules/cacsd/demos/flat/flat.dem.gateway.sce b/scilab/modules/cacsd/demos/flat/flat.dem.gateway.sce
new file mode 100644 (file)
index 0000000..36e7744
--- /dev/null
@@ -0,0 +1,13 @@
+//
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) ????-2008 - INRIA
+//
+// This file is distributed under the same license as the Scilab package.
+//
+
+demopath = get_absolute_file_path("flat.dem.gateway.sce");
+
+subdemolist = ["Car"                ,"car.dem.sce"   ; ..
+               "Two trailers truck" ,"truck.dem.sce" ]
+
+subdemolist(:,2) = demopath + subdemolist(:,2);
diff --git a/scilab/modules/cacsd/demos/flat/truck.dem.sce b/scilab/modules/cacsd/demos/flat/truck.dem.sce
new file mode 100644 (file)
index 0000000..d24329c
--- /dev/null
@@ -0,0 +1,10 @@
+exec(get_absolute_file_path("truck.dem.sce") + "/truck.sci",-1);
+
+initial   = [-2;3;0.5235988;0;0;1];
+final     = [0;0;0;0;0;0];
+state     = truck_solve(initial,final);
+my_handle = scf(100001);
+clf(my_handle,"reset");
+my_handle.pixmap = "off" ;
+toolbar(my_handle.figure_id,"off") ;
+display_truck_trajectory(state);
diff --git a/scilab/modules/cacsd/demos/flat/truck.sci b/scilab/modules/cacsd/demos/flat/truck.sci
deleted file mode 100644 (file)
index e2e4c79..0000000
+++ /dev/null
@@ -1,359 +0,0 @@
-function demo_truck()
-  initial = [-2;3;0.5235988;0;0;1]
-  final   = [0;0;0;0;0;0]
-  state = truck_solve(initial,final);
-  f = gcf() ;
-  f.pixmap = 'on' ;
-  toolbar(0,'off') ;
-  display_truck_trajectory(state)
-endfunction
-
-function state=truck_solve(initial,final)
-//
-//  CAR  WITH 2 TRAILERS PACKING VIA FLATNESS AND FRENET FORMULAS
-//
-//    explicit computation and visualisation of the motions.
-//
-//    February 1993
-//
-// ............................................................
-// :         pierre ROUCHON  <rouchon@cas.ensmp.fr>           :
-// : Centre Automatique et Systemes, Ecole des Mines de Paris :
-// : 60, bd Saint Michel -- 75272 PARIS CEDEX 06, France      :
-// :    Telephone: (1) 40 51 91 15 --- Fax: (1) 43 54 18 93   :
-// :..........................................................:
-//
-// initial: initial position [x,y,theta1,theta2,theta3,phi]
-// final  :   final position [x,y,theta1,theta2,theta3,phi]
-//        theta1,theta2,theta3  : the car and the trailers angles
-//        phi    : the front wheel angle
-  
-  bigT = 1 ;//basic time interval for one  smooth motion (s)
-  bigL = 1 ;// car length (m) 
-  d1 = 1.5 ; d2 = 1 ; //trailers length
-
-  // computation of  intermediate configuration 
-  LL=bigL+d1+d2
-  x0 = maxi(initial(1),final(2))   ....
-       + LL*abs(tan(initial(3))) ...
-       + LL*abs(tan(initial(4))) ...
-       + LL*abs(tan(initial(5))) ...
-       + LL*(abs(initial(2)-final(2))/(d1+d2+bigL))^(1/2) ;
-  y0 = (initial(2)+final(2))/2 ;
-  intermediate=[x0,y0,0,0,0,0]'
-
-  // first polynomial curve
-  state=truck_polynomial_curve(initial,intermediate,"direct")
-  //
-  // second polynomial curve
-  state = [ state;
-           truck_polynomial_curve(final,intermediate,"reverse")            ]
-          
-endfunction
-
-
-
-function state=truck_polynomial_curve(initial,final,orient)
-
-  nbpt = 40 ; //  sampling of motion 
-  phi = initial(6) ;
-
-  theta2 = initial(3) ; 
-  theta1 = initial(4)+theta2
-  theta0 = initial(5)+theta1
-  
-  x0=initial(1)+d2*cos(theta2)+d1*cos(theta1) ;
-  y0=initial(2)+d2*sin(theta2)+d1*sin(theta1) ;
-  if orient<>'reverse' then
-    state = [x0 y0 theta0 theta1 theta2 phi] ;
-  else
-    state=[]
-  end
-  a0=final(1);a1=initial(1);b0=final(2)
-  db = initial(2)-final(2)
-  p = cr2Tkf(db,initial(3),initial(4),initial(5),phi) ;
-
-  tau=(0:nbpt)'/nbpt
-  phi=tau.*tau.*(3-2*tau) ;
-  if orient=='reverse' then
-    aa = (1-phi)*final(1) + phi*initial(1) ;
-  else
-    aa = (1-phi)*initial(1) + phi*final(1) ;
-  end
-  for i=1:(nbpt+1)
-    [bb,df,d2f,d3f,d4f,d5f] = cr2Tfjt(aa(i)) ;
-    [k2,k1,k0,dk0]=cr2Tfk(df,d2f,d3f,d4f,d5f) ;
-    theta2 = atan(df);
-    theta1 = atan(k2*d2)+theta2;
-    theta0 = atan(k1*d1) + theta1 ;
-    phi = atan(k0*bigL) ;
-    x0=aa(i)+d2*cos(theta2)+d1*cos(theta1) ;
-    y0=bb+d2*sin(theta2)+d1*sin(theta1) ;
-    state= [ state; 
-            x0 y0 theta0 theta1 theta2 phi] ;
-  end
-endfunction
-
-function [ff,df,d2f,d3f,d4f,d5f]=cr2Tfjt(a)
-//
-//
-  da = a-a0
-  M= [  da^5      da^6      da^7      da^8       da^9 
-      5*da^4    6*da^5    7*da^6    8*da^7     9*da^8 
-     20*da^3   30*da^4   42*da^5   56*da^6    72*da^7 
-     60*da^2  120*da^3  210*da^4  336*da^5   504*da^6 
-    120*da^1  360*da^2  840*da^3 1680*da^4  3024*da^5 
-    120       720*da^1 2520*da^2 6720*da^3 15120*da^4]*p ;
-  ff  = M(1) + b0 ;
-  df  = M(2) ;
-  d2f = M(3) ;
-  d3f = M(4) ;
-  d4f = M(5) ;
-  d5f = M(6) ;
-endfunction
-
-function coef=cr2Tkf(b,theta2,theta12,theta01,phi)
-//
-//
-  da = a1-a0
-M = [1*da^5    1*da^6   1*da^7    1*da^8    1*da^9 
-     5*da^4    6*da^5   7*da^6    8*da^7    9*da^8 
-    20*da^3   30*da^4  42*da^5   56*da^6   72*da^7 
-    60*da^2  120*da^3 210*da^4  336*da^5  504*da^6 
-   120*da^1  360*da^2 840*da^3 1680*da^4 3024*da^5] ;
-//
-//
-df = tan(theta2) ;
-//
-// curvatures
-k2=tan(theta12)/d2;k1=tan(theta01)/d1;k0=tan(phi)/bigL;
-// 
-ddf = k2*((1+df*df)^(3/2)) ;
-//
-// derivative of k2
-dk2ds2 = ( (1+(d2*k2)^2)/d2 )*( (1+(d2*k2)^2)^(1/2)*k1 - k2 ) ;
-dk2 = (1+df*df)^(1/2) * dk2ds2 ;
-//
-dddf = dk2 * (1+df*df)^(3/2)  + 3*k2*df*ddf*(1+df*df)^(1/2) ;
-//
-// second derivative of k2
-dk1ds1 = ( (1+(d1*k1)^2)/d1 )*( (1+(d1*k1)^2)^(1/2)*k0 - k1 ) ;
-dk1ds2 = dk1ds1 *  (1+(d2*k2)^2)^(1/2) ;
-//
-ddk2ds2 =  ....
-  3*d2*k2*dk2ds2*(1+(d2*k2)^2)^(1/2)*k1 ....
-+ (1+(d2*k2)^2)^(3/2)*dk1ds2/d2 ...
-- (1/d2+3*d2*k2*k2)*dk2ds2 ;
-//
-ddk2 = .... 
-   df*ddf*((1+df*df)^(-1/2))*dk2ds2 ....
- + (1+df*df)*ddk2ds2 ; 
-//
-ddddf =  ....
-   ddk2 * (1+df*df)^(3/2) ....
- + 6*dk2*df*ddf*(1+df*df)^(1/2) ....
- + 3*k2*ddf*ddf*(1+df*df)^(1/2) ....
- + 3*k2*df*dddf*(1+df*df)^(1/2) ....
- + 3*k2*(df*ddf)^2*(1+df*df)^(-1/2) ;
-//
-//
-//
-//
-coef =inv(M)* [b;df;ddf;dddf;ddddf] ;
-endfunction
-
-function [k2,k1,k0,dk0]=cr2Tfk(df,d2f,d3f,d4f,d5f)
-//
-//
-// computation of curvatures from derivatives of b=f(a)
-//
-g = (1+df^2)^(-1/2);
-dg = - df*d2f*g^3 ;
-d2g = - g*g*(d2f^2*g+df*d3f*g+3*df*d2f*dg) ;
-d3g = ....
-- 2*g*dg*(d2f^2*g+df*d3f*g+3*df*d2f*dg) ....
-- g^2*(3*d2f*d3f*g+df*d4f*g ....
-       + 4*d2f^2*dg+4*df*d3f*dg+3*df*d2f*d2g) ;
-//
-k2  = d2f * g^3  ;
-dk2 = d3f*g^3 + 3*d2f*g^2*dg ;
-d2k2 = g^2*(d4f*g+6*d3f*dg+3*d2f*d2g) + 6*g*dg^2*d2f ;
-d3k2 = 2*g*dg*(d4f*g+6*d3f*dg+3*d2f*d2g) ....
- + g^2*(d5f*g+7*d4f*dg+9*d3f*d2g+3*d2f*d3g) ....
- +6*dg^3*d2f+12*g*dg*d2g*d2f+6*g*dg^2*d3f ;
-//
-g2 = (1+(d2*k2)^2)^(-1/2) ;
-dg2 = -d2^2*k2*dk2*g2^3 ;
-d2g2 = -d2^2*g2^2*(dk2^2*g2+k2*d2k2*g2+3*k2*dk2*dg2) ;
-//
-h2 = g2^3*g ;
-dh2 = g2^2*(3*dg2*g+g2*dg);
-d2h2 = 2*g2*dg2*(3*dg2*g+g2*dg) ....
-     + g2^2*(3*d2g2*g+4*dg2*dg+g2*d2g) ;
-//
-k1 = g2*k2 + d2*h2*dk2 ;
-dk1 = dg2*k2 + g2*dk2 + d2 * (dh2*dk2+h2*d2k2) ;
-d2k1 = d2g2*k2 + 2*dg2*dk2 + g2*d2k2 ....
-   + d2 * (d2h2*dk2+2*dh2*d2k2+h2*d3k2) ;
-//
-g1 = (1+(d1*k1)^2)^(-1/2) ;
-dg1 = - d1^2*k1*dk1*g1^3 ;
-//
-k0 = g1*k1 + d1*g1^3*g2*g*dk1 ;
-dk0 = dg1*k1 + g1*dk1 ....
- + d1*g1^2*(3*dg1*g2*g*dk1+g1*dg2*g*dk1 ....
-          +  g1*g2*dg*dk1+g1*g2*g*d2k1) ;
-
-endfunction
-
-function display_truck_trajectory(state)
-   bigL = 1 ; d1 = 1.5 ; d2 = 1;
-  set figure_style new;xbasc(),xselect()
-  a=gca()
-  drawlater()
-  a.isoview="on"
-  a.data_bounds=[mini(state(:,1))-1.5*(d1+d2), mini(state(:,2))-bigL
-                maxi(state(:,1))+1.5*bigL, maxi(state(:,2))+bigL]
-  rect=matrix(a.data_bounds',-1,1)
-  xpoly(rect([1 3 3 1]),rect([2,2,4,4]),'lines',1)
-  C=build_truck()
-  Cinit=[];Cend=[];Cinter=[];
-  for k=1:size(C,'*')
-    Cinit=[Cinit copy(C(k))];
-    Cinter=[Cinter,copy(C(k))];
-    Cend=[Cend,copy(C(k))]
-  end
-  // starting configuration
-  draw_truck(Cinit,state(1,:))
-  // end configuration
-  draw_truck(Cend,state($,:))
-  // intermediate configuration (inversion of velocity)
-  draw_truck(Cinter,state(ceil(size(state,1)/2),:)) ;
-  // trajectory of the linearizing output
-  x_lin = state(:,1)-d1*cos(state(:,4))-d2*cos(state(:,5)) ;
-  y_lin = state(:,2)-d1*sin(state(:,4))-d2*sin(state(:,5)) ;
-
-  t1=polyline([x_lin(1) y_lin(1);x_lin(1) y_lin(1)]) ;
-  t2=polyline([state(1,1) state(1,2);state(1,1) state(1,2)]) ;
-  
-  t1.line_style=2;
-  t2.line_style=2;t2.foreground=5
-  realtimeinit(0.2)
-  for i=1:size(state,1)
-    realtime(i) 
-    drawlater()
-    draw_truck(C, state(i,:)) 
-    t1.data=[t1.data;x_lin(i), y_lin(i)];
-    t2.data=[t2.data;state(i,1), state(i,2)];
-    drawnow()
-  end 
-  for i=(1:30)+size(state,1),realtime(i),end
-  xdel()
-endfunction
-
-
-function C=build_truck()
-//build the graphic object for the truck
-// 
-  //the car
-  hcar=polyline([-2,7,8,8,7,-2,-2;-2,-2,-1,1,2,2,-2]'/6)
-  hcar.foreground=2
-  // rear wheels
-  hwheel1=polyline([[-1 1]/8; [1 1]/6]')
-  hwheel1.thickness=2
-   
-  hwheel2=polyline([[-1 1]/8; -[1 1]/6]')
-  hwheel2.thickness=2
-  
-  // front wheels
-  hwheel3=polyline([[7 9]/8;[1 1]/6]')
-  hwheel3.thickness=2
-  hwheel4=polyline([[7 9]/8;-[1 1]/6]') 
-  hwheel4.thickness=2
-  
-  //Trailer 1
-
-  ht1=polyline([-1,1,1,-1,-1;-1,-1,1,1,-1]'*bigL/3)
-  ht1.foreground=2
-  hwheel5=polyline([[-1 1]/8;[1 1]/6]'*bigL)
-  hwheel5.thickness=2
-  hwheel6=polyline([[-1 1]/8;-[1 1]/6]'*bigL)
-  hwheel6.thickness=2
-  hhitch1=polyline([bigL/3  d1;0 0]')
-  hhitch1.foreground=2
-  //Trailer 2
-  ht2=polyline([-1,1,1,-1,-1;-1,-1,1,1,-1]'*bigL/3)
-  ht2.foreground=2
-  hwheel7=polyline([[-1 1]/8;[1 1]/6]'*bigL)
-  hwheel7.thickness=2
-  hwheel8=polyline([[-1 1]/8;-[1 1]/6]'*bigL)
-  hwheel8.thickness=2
-  hhitch2=polyline([bigL/3  d2;0 0]')
-  hhitch2.foreground=2
-
-
-
-  //return vector of handle on the objects
-  C=[hcar,hwheel1,hwheel2,hwheel3,hwheel4,..
-     ht1,hwheel5, hwheel6,hhitch1,..
-     ht2, hwheel7,hwheel8,hhitch2]
-endfunction
-
-function draw_truck(C,pos)
-  drawlater()
-  [x,y,theta1,theta2,theta3,phi]=(pos(1),pos(2),pos(3),pos(4),pos(5),pos(6))
-  bigL = 1 ; d1 = 1.5 ; d2 = 1;
-  Rc=[cos(theta1) sin(theta1);-sin(theta1) cos(theta1)]
-  // the car
-  xy = [-2,-2;7,-2;8,-1;8,1;7,2;-2,2;-2,-2]/6
-  C(1).data=ones(xy)*diag([x;y])+bigL*xy*Rc
-  // rear wheels
-  xy=[[-1 1]/8; [1 1]/6]'
-  C(2).data=ones(xy)*diag([x;y])+bigL*xy*Rc
-  xy=[[-1 1]/8; -[1 1]/6]'
-  C(3).data=ones(xy)*diag([x;y])+bigL*xy*Rc
-  // front wheels
-  xy=[(1-cos(phi)/8) (1/6-sin(phi)/8)
-      (1+cos(phi)/8) (1/6+sin(phi)/8)]
-  C(4).data=ones(xy)*diag([x;y])+bigL*xy*Rc
-  xy=[(1-cos(phi)/8) (-1/6-sin(phi)/8)
-      (1+cos(phi)/8) (-1/6+sin(phi)/8)]
-  C(5).data=ones(xy)*diag([x;y])+bigL*xy*Rc
-  
-  //Trailer 1
-  Rc=[cos(theta2) sin(theta2);-sin(theta2) cos(theta2)]
-  x = x - d1*cos(theta2) ;
-  y = y - d1*sin(theta2) ;
-  xy = [-1,1,1,-1,-1;-1,-1,1,1,-1]'*bigL/3;
-  C(6).data=ones(xy)*diag([x;y])+bigL*xy*Rc
-  //wheels
-  xy=[[-1 1]/8; [1 1]/6]'
-  C(7).data=ones(xy)*diag([x;y])+bigL*xy*Rc
-  xy=[[-1 1]/8; -[1 1]/6]'
-  C(8).data=ones(xy)*diag([x;y])+bigL*xy*Rc
-  //hitch
-  xy=[bigL/3  d1;0 0]'
-  C(9).data=ones(xy)*diag([x;y])+bigL*xy*Rc
-
-  //Trailer 2
-  Rc=[cos(theta3) sin(theta3);-sin(theta3) cos(theta3)]
-  x = x - d2*cos(theta3) ;
-  y = y - d2*sin(theta3) ;
-  xy = [-1,1,1,-1,-1;-1,-1,1,1,-1]'*bigL/3;
-  C(10).data=ones(xy)*diag([x;y])+bigL*xy*Rc
-  //wheels
-  xy=[[-1 1]/8; [1 1]/6]'
-  C(11).data=ones(xy)*diag([x;y])+bigL*xy*Rc
-  xy=[[-1 1]/8; -[1 1]/6]'
-  C(12).data=ones(xy)*diag([x;y])+bigL*xy*Rc
-  //hitch
-  xy=[bigL/3  d2;0 0]'
-  C(13).data=ones(xy)*diag([x;y])+bigL*xy*Rc
-  drawnow()
-  show_pixmap();
-endfunction
-
-function h=polyline(xy)
-  xpoly(xy(:,1),xy(:,2),'lines')
-  h=gce()
-endfunction
index eda1ed6..780c590 100644 (file)
@@ -7,11 +7,15 @@
 
 mode(-1)
 path=get_absolute_file_path('pendule.dem');
-//
+
 getf(path+'simulation.sci')
 getf(path+'graphics.sci')
-//
-xselect();wdim=xget('wdim')
+
+my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+xselect();
+wdim=xget('wdim')
 //mode(1)
 
  dpnd()
@@ -30,10 +30,15 @@ deff('[ut]=uu(t)','ut=[sin(3*t);cos(0.5*t)]');
 dt=0.05;tmax=60;
 instants=0:dt:tmax;
 totrack=flts(uu(instants),dscr(Model,dt));    //Signal
-xbasc();
+
+my_handle             = scf(100001);
+clf(my_handle,"reset");
 plot2d(instants',totrack');
-halt()
-xbasc()
+
+halt();
+
+clf(my_handle,"reset");
+
 //
 [L,M,T]=gfrancis(Plant,Model);
 
@@ -61,5 +66,3 @@ plot2d([instants',instants'],..
        [totrack(1,:)',z(1,:)'],[1 2],'161',..
        'Signal to track@Computed signal@');
 xtitle('tracking');
-
-
index 6e814dd..78a1a18 100644 (file)
@@ -17,7 +17,7 @@ add_module_help_chapter('cacsd');
 
 path = get_absolute_file_path('cacsd.start');
 path = getshortpathname(path);
-pathdemos = pathconvert(part(path,1:(length(path)-5))+'/demos/control.dem',%f,%f);
+pathdemos = pathconvert(part(path,1:(length(path)-5))+'/demos/cacsd.dem.gateway.sce',%f,%f);
 
 // add demos
 add_demo("CACSD",pathdemos);
index e6bd69e..ac5dbba 100644 (file)
@@ -7,7 +7,7 @@
 
 demopath = get_absolute_file_path("2d_3d_plots.dem.gateway.sce");
 
-demolist = [                                       ..
+subdemolist = [                                       ..
        "plot2d"         , "plot2d.dem.sce"          ; ..
        "plot2d1 (1)"    , "plot2d1_1.dem.sce"       ; ..
        "plot2d3"        , "plot2d3.dem.sce"         ; ..
@@ -38,23 +38,10 @@ demolist = [                                       ..
        "fac3d"          , "fac3d.dem.sce"           ; ..
        "fac3d1"         , "fac3d1.dem.sce"          ];
        
+subdemolist(:,2) = demopath + subdemolist(:,2);
+       
 function xdemo(info,str)
        x_message([info;str]);
        xbasc();
        execstr(str);
 endfunction
-
-// exec('SCI/modules/graphics/demos/dessin-1.dem');
-
-// nn=prod(size(str_l));
-// 
-// while %t then
-//     num=x_choose(info_l,'Choose a demo    ');
-//     if num==0 then
-//             lines(oldln(1));
-//             set figure_style new;
-//             return;
-//     else
-//             xdemo(" ",str_l(num));
-//     end
-// end
index f865b36..a03b8d7 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "chart";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "chart";
 my_handle.figure_name = my_plot_desc;
 
 chart();
index 065cee0..e9798e0 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "champ";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "champ";
 my_handle.figure_name = my_plot_desc;
 
 champ();
index 523a4d7..4c75c69 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "contour";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "contour";
 my_handle.figure_name = my_plot_desc;
 
 contour();
index e52a248..b192d48 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "plot3d and contour";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "plot3d and contour";
 my_handle.figure_name = my_plot_desc;
 
 t = %pi*(-10:10)/10;
index a355fda..7bea40d 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "plot3d and contour";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "plot3d and contour";
 my_handle.figure_name = my_plot_desc;
 
 t    = %pi*(-10:10)/10;
index 866c4df..0d345db 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "plot3d and contour";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "plot3d and contour";
 my_handle.figure_name = my_plot_desc;
 
 t    = %pi*(-10:10)/10;
index 55b1fa6..d07b3d1 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "contourf";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "contourf";
 my_handle.figure_name = my_plot_desc;
 
 contourf();
index 9af145a..883ab8f 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "errbar";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "errbar";
 my_handle.figure_name = my_plot_desc;
 
 errbar();
index 17f3ccd..9565dbf 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "fac3d";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "fac3d";
 my_handle.figure_name = my_plot_desc;
 
 fac3d();
index b450ea3..fab66eb 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "fac3d1";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "fac3d1";
 my_handle.figure_name = my_plot_desc;
 
 fac3d1();
index dabbd8b..f31ee91 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "fchamp";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "fchamp";
 my_handle.figure_name = my_plot_desc;
 
 fchamp();
index 14b8340..802c060 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "fcontour";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "fcontour";
 my_handle.figure_name = my_plot_desc;
 
 fcontour();
index 297d63e..ee8740d 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "fgrayplot";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "fgrayplot";
 my_handle.figure_name = my_plot_desc;
 
 fgrayplot();
index 5974598..02aef76 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "fplot2d : f given by external";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "fplot2d : f given by external";
 my_handle.figure_name = my_plot_desc;
 
 fplot2d();
index f8150ee..fb250c2 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "fplot3d : z=f(x,y), f external";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "fplot3d : z=f(x,y), f external";
 my_handle.figure_name = my_plot_desc;
 
 fplot3d();
index 35b3597..4ef063b 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "fplot3d1 : z=f(x,y), f external";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "fplot3d1 : z=f(x,y), f external";
 my_handle.figure_name = my_plot_desc;
 
 fplot3d1();
index c4545cd..136cccc 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "grayplot";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "grayplot";
 my_handle.figure_name = my_plot_desc;
 
 grayplot();
index b3586cc..52181dd 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "histplot";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "histplot";
 my_handle.figure_name = my_plot_desc;
 
 histplot();
index e583361..d646a80 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "param3d : parametric curves in R3";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "param3d : parametric curves in R3";
 my_handle.figure_name = my_plot_desc;
 
 param3d();
index 44ceaf4..4cb92e9 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "param3d: parametric curves in R3 (t.sin(t),t.cos(t),t.|t|/50.pi)";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "param3d: parametric curves in R3 (t.sin(t),t.cos(t),t.|t|/50.pi)";
 my_handle.figure_name = my_plot_desc;
 
 t = -50*%pi:0.1:50*%pi;
index cd7b656..14d36b2 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "plot2d and xgrid";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "plot2d and xgrid";
 my_handle.figure_name = my_plot_desc;
 
 scf(100001);
index 5de2860..e669a2e 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "plot2d1 log scale";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "plot2d1 log scale";
 my_handle.figure_name = my_plot_desc;
 
 plot2d1("enl",1,(1:10:10000)');
index 01bf43c..3e6d20c 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "plot2d1";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "plot2d1";
 my_handle.figure_name = my_plot_desc;
 
 rand("normal")
index 8653bf8..84599e7 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "plot2d3 (vbar plot)";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "plot2d3 (vbar plot)";
 my_handle.figure_name = my_plot_desc;
 
 n = 32-1;
index a5ff62f..43c8d06 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "plot3d : z=sin(x)*cos(y)";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "plot3d : z=sin(x)*cos(y)";
 my_handle.figure_name = my_plot_desc;
 
 plot3d();
index 1bfd063..7e78ba7 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "plot3d1 : z=sin(x)*cos(y)";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "plot3d1 : z=sin(x)*cos(y)";
 my_handle.figure_name = my_plot_desc;
 
 plot3d1();
index 8cfef3d..cc0f34b 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "subplot";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "subplot";
 my_handle.figure_name = my_plot_desc;
 
 subplot(2,2,1);
index 1a791fe..a343652 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "plot3d and use of xgeom";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "plot3d and use of xgeom";
 my_handle.figure_name = my_plot_desc;
 
 r = (%pi):-0.01:0;
index d7c7237..e1ff09d 100644 (file)
@@ -5,9 +5,10 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "zgrid";
-
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "zgrid";
 my_handle.figure_name = my_plot_desc;
 
 zgrid();
index 7c2e2a0..c46411c 100644 (file)
@@ -5,10 +5,16 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-demolist=["Rotation of a 3D Surface (plot3d1)","anim/anim1/anim1_gateway.sce";
-       "3D curve (param3d)","anim/anim2/anim2_gateway.sce";
-       "Lorentz curve (param3d) ","anim/anim3/anim3_gateway.sce";
-       "Rotation of a 3D contour","anim/anim4/anim4_gateway.sce";
-       "Evolution of a 3D surface (plot3d)","anim/anim5/anim5_gateway.sce";
-       "N link pendulum movement","anim/anim6/anim6_gateway.sce";
-       "Shell","anim/anim7/anim7_gateway.sce"];
+
+demopath = get_absolute_file_path("anim.dem.gateway.sce");
+
+subdemolist=[ ..
+       "Rotation of a 3D Surface (plot3d1)" ,"anim1/anim1_gateway.sce"; ..
+       "3D curve (param3d)"                 ,"anim2/anim2_gateway.sce"; ..
+       "Lorentz curve (param3d) "           ,"anim3/anim3_gateway.sce"; ..
+       "Rotation of a 3D contour"           ,"anim4/anim4_gateway.sce"; ..
+       "Evolution of a 3D surface (plot3d)" ,"anim5/anim5_gateway.sce"; ..
+       "N link pendulum movement"           ,"anim6/anim6_gateway.sce"; ..
+       "Shell"                              ,"anim7/anim7_gateway.sce"];
+       
+subdemolist(:,2) = demopath + subdemolist(:,2);
index 5e978c1..4e2fd80 100644 (file)
@@ -5,7 +5,8 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-curFig = gcf();clf();  // erase window
+curFig             = scf(100001);
+clf(curFig,"reset");
 xselect(); //raise the graphic window
 
 //turn off toolbar
index d6eba45..391bd9c 100644 (file)
@@ -5,7 +5,7 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-demo_begin();
-demo_message("SCI/modules/graphics/demos/anim/anim1/anim1.sce");
+// demo_begin();
+// demo_message("SCI/modules/graphics/demos/anim/anim1/anim1.sce");
 demo_run("SCI/modules/graphics/demos/anim/anim1/anim1.sce");
-demo_end();
+// demo_end();
index beab4b4..61db244 100644 (file)
@@ -9,11 +9,12 @@
 // Demonstrate animation based on the evolution of a 3d curve
 // =============================================================================
 
-curFig = gcf();clf();  // erase window
+curFig             = scf(100001);
+clf(curFig,"reset");
+
 xselect(); //raise the graphic window
 mode(0);
 
-
 //turn off toolbar
 //----------------
 id=curFig.figure_id;
index f085cd6..edac7cf 100644 (file)
@@ -9,7 +9,7 @@
 // Demonstrate animation based on the evolution of a 3d curve
 // =============================================================================
 
-demo_begin();
-demo_message("SCI/modules/graphics/demos/anim/anim2/anim2.sce");
+//demo_begin();
+//demo_message("SCI/modules/graphics/demos/anim/anim2/anim2.sce");
 demo_run("SCI/modules/graphics/demos/anim/anim2/anim2.sce");
-demo_end();
+//demo_end();
index 6237695..e0712d9 100644 (file)
@@ -11,7 +11,9 @@
 
 mode(0)
 
-curFig = gcf();clf();  // erase window
+curFig             = scf(100001);
+clf(curFig,"reset");
+
 xselect(); //raise the graphic window
 
 //turn off toolbar
index f3392f0..8f5a4f3 100644 (file)
@@ -9,7 +9,7 @@
 // Demonstrate animation based on the rotation of Lorentz curve
 // =============================================================================
 
-demo_begin();
-demo_message("SCI/modules/graphics/demos/anim/anim3/anim3.sce");
+//demo_begin();
+//demo_message("SCI/modules/graphics/demos/anim/anim3/anim3.sce");
 demo_run("SCI/modules/graphics/demos/anim/anim3/anim3.sce");
-demo_end();
+//demo_end();
index da2578a..639f728 100644 (file)
@@ -11,7 +11,9 @@
 
 mode(0);
 
-curFig = gcf();clf();  // erase window
+curFig             = scf(100001);
+clf(curFig,"reset");
+
 xselect(); //raise the graphic window
 
 //turn off toolbar
index 7b9f81c..2e44584 100644 (file)
@@ -9,7 +9,7 @@
 // Demonstrate animation based on the rotation of a 3D contour plot
 // =============================================================================
 
-demo_begin();
-demo_message("SCI/modules/graphics/demos/anim/anim4/anim4.sce");
+//demo_begin();
+//demo_message("SCI/modules/graphics/demos/anim/anim4/anim4.sce");
 demo_run("SCI/modules/graphics/demos/anim/anim4/anim4.sce");
-demo_end();
+//demo_end();
index ff6df54..3429933 100644 (file)
@@ -9,7 +9,9 @@
 // Demonstrate animation based on the evolution of a 3D surface
 // ============================================================================
 
-curFig = gcf();clf();  // erase window
+curFig             = scf(100001);
+clf(curFig,"reset");
+
 xselect(); //raise the graphic window
 
 //turn off toolbar
index 288d540..088c821 100644 (file)
@@ -9,7 +9,7 @@
 // Demonstrate animation based on the evolution of a 3D surface
 // =============================================================================
 
-demo_begin();
-demo_message("SCI/modules/graphics/demos/anim/anim5/anim5.sce");
+//demo_begin();
+//demo_message("SCI/modules/graphics/demos/anim/anim5/anim5.sce");
 demo_run("SCI/modules/graphics/demos/anim/anim5/anim5.sce");
-demo_end();
+//demo_end();
index 2aba48a..ba7b2a7 100644 (file)
@@ -13,7 +13,9 @@
 path=get_absolute_file_path('anim6.sce');
 yt=read(path+'yt.wrt',20,201);  //load data
 
-curFig = gcf();clf();  // erase window
+curFig             = scf(100001);
+clf(curFig,"reset");
+
 xselect(); //raise the graphic window
 
 //turn off toolbar
index 7853298..1f40f74 100644 (file)
@@ -9,7 +9,7 @@
 // Demonstrate animation based on the dynamic of a chain
 // =============================================================================
 
-demo_begin();
-demo_message("SCI/modules/graphics/demos/anim/anim6/anim6.sce");
+//demo_begin();
+//demo_message("SCI/modules/graphics/demos/anim/anim6/anim6.sce");
 demo_run("SCI/modules/graphics/demos/anim/anim6/anim6.sce");
-demo_end();
+//demo_end();
index b3cbfde..3e46389 100644 (file)
@@ -9,7 +9,9 @@
 // Demonstrate animation based on the dynamic of a chain
 // =============================================================================
 
-curFig = gcf();clf();  // erase window
+curFig             = scf(100001);
+clf(curFig,"reset");
+
 xselect(); //raise the graphic window
 
 //turn off toolbar
index 6df903c..bb3c9e0 100644 (file)
@@ -9,7 +9,7 @@
 // Demonstrate animation based on the dynamic of a chain
 // =============================================================================
 
-demo_begin();
-demo_message("SCI/modules/graphics/demos/anim/anim7/anim7.sce");
+//demo_begin();
+//demo_message("SCI/modules/graphics/demos/anim/anim7/anim7.sce");
 demo_run("SCI/modules/graphics/demos/anim/anim7/anim7.sce");
-demo_end();
+//demo_end();
index 8eb3bee..e16026f 100644 (file)
@@ -7,7 +7,7 @@
 
 demopath = get_absolute_file_path("basic_functions.dem.gateway.sce");
 
-demolist=[                                                           ..
+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" ; ..
@@ -16,3 +16,5 @@ demolist=[                                                           ..
     "Colored matrix"                                   ,"basic_functions_6.dem.sce" ; ..
     "Colored histogram"                                ,"basic_functions_7.dem.sce" ; ..
     "Pie Chart"                                        ,"basic_functions_8.dem.sce" ]
+
+subdemolist(:,2) = demopath + subdemolist(:,2);
index 99c74d2..f0aef5e 100644 (file)
 // This file is distributed under the same license as the Scilab package.
 //
 
-my_plot_desc          = "rectangles, arcs, polylines, segments and numbers";
+mode(-1);
 
 my_handle             = scf(100001);
+clf(my_handle,"reset");
+
+my_plot_desc          = "rectangles, arcs, polylines, segments and numbers";
 my_handle.figure_name = my_plot_desc;
 
 plot2d([-100,500],[-100,600],[-1,-1],"022");
 
-a           = gca();
-t           = a.title;
-t.text      = my_plot_desc;
-t.font_size = 3;
+a            = gca();
+t            = a.title;
+t.text       = my_plot_desc;
+t.font_size  = 3;
+
+// clipping
+a.clip_state = "clipgrf";
+
 
 deff('[v]=transl(x,t)','v=x+t*ones(x)');
-xclip('clipgrf');
 
 x_message(["[I] function to plot a set of objects "]);
 
 // Demo I.1
 expr=['x=0:40:240;';
-'boxes=[x;10*ones(x);30*ones(x);30*ones(x)];';
-'xrects(boxes)'];
+       'boxes=[x;10*ones(x);30*ones(x);30*ones(x)];';
+       'xrects(boxes)'];
 x_message(["[I.1] function xrects : plot rectangles";expr]);
 execstr(expr);
 
 // Demo I.2
 expr=['x=0:40:240;';
-'boxes=[x;45*ones(x);30*ones(x);30*ones(x)];';
-'pats=[0,4,8,12,15,xget(''white''),0];';
-'xrects(boxes,pats);'];
+       'boxes=[x;45*ones(x);30*ones(x);30*ones(x)];';
+       'pats=[0,4,8,12,15,xget(''white''),0];';
+       'xrects(boxes,pats);'];
 x_message(["[I.2] fonction xrects : filling rectangles";expr]);
 execstr(expr);
 
 // Demo I.3
 expr=['x=0:40:240;';
-'boxes=[x;90*ones(x);30*ones(x);30*ones(x)];';
-'arcs=[boxes; 0*ones(x);64*180*ones(x)];';
-'pats=[0,4,8,12,15,xget(''white''),0];';
-'xarcs(arcs,pats);'];
+       'boxes=[x;90*ones(x);30*ones(x);30*ones(x)];';
+       'arcs=[boxes; 0*ones(x);64*180*ones(x)];';
+       'pats=[0,4,8,12,15,xget(''white''),0];';
+       'xarcs(arcs,pats);'];
 x_message(["[I.3] xarcs(arcs,patterns)";expr]);
 execstr(expr);
 
 // Demo I.4
 expr=['x=0:40:240;';
-'boxes=[x;135*ones(x);30*ones(x);30*ones(x)];';
-'arcs=[boxes; 0*ones(x);64*360*ones(x)];';
-'xarcs(arcs);']
+       'boxes=[x;135*ones(x);30*ones(x);30*ones(x)];';
+       'arcs=[boxes; 0*ones(x);64*360*ones(x)];';
+       'xarcs(arcs);'];
 x_message(["[I.4] xarcs(arcs)";expr]);
 execstr(expr);
 
 // Demo I.5
 expr0=['x1=[0,10,20,30,20,10,0];';
-'y1=[15,30,30,15,0,0,15];y1=160*ones(y1)+y1;';
-'xpols=[x1;transl(x1,40);transl(x1,80);transl(x1,120)'...
-+ ';transl(x1,160);transl(x1,200);transl(x1,240)];';
-'ypols=[y1;y1;y1;y1;y1;y1;y1];';
-'xfpolys(xpols'',ypols'');'];
+       'y1=[15,30,30,15,0,0,15];y1=160*ones(y1)+y1;';
+       'xpols=[x1;transl(x1,40);transl(x1,80);transl(x1,120)'...
+       + ';transl(x1,160);transl(x1,200);transl(x1,240)];';
+       'ypols=[y1;y1;y1;y1;y1;y1;y1];';
+       'xfpolys(xpols'',ypols'');'];
 x_message(["[I.5] xfpolys(x,y)";expr0]);
 execstr(expr0);
 
 // Demo I.6
 expr=[ expr0;
-'ypols=transl(ypols,60);';
-'pats=[0,4,8,12,15,xget(''white''),0];';
-'xfpolys(xpols'',ypols'',pats);'];
+       'ypols=transl(ypols,60);';
+       'pats=[0,4,8,12,15,xget(''white''),0];';
+       'xfpolys(xpols'',ypols'',pats);'];
 x_message(["[I.6] xfpolys(x,y,pattern)";expr]);
 execstr(expr);
 
 // Demo I.7
 expr=[ expr0;
-'ypols=transl(ypols,120);';
-'xpolys(xpols'',ypols'',1:7);'];
+       'ypols=transl(ypols,120);';
+       'xpolys(xpols'',ypols'',1:7);'];
 x_message(["[I.7] xpolys(x,y,line-style)";expr]);
 execstr(expr);
 
 // Demo I.8
 expr=[ expr0;
-'ypols=transl(ypols,180);';
-'xpolys(xpols'',ypols'',-(1:7));'];
+       'ypols=transl(ypols,180);';
+       'xpolys(xpols'',ypols'',-(1:7));'];
 x_message(["[I.8] xpolys(x,y,line-style)";expr]);
 execstr(expr);
 
 // Demo I.9
 expr=['x=0:40:240;';
-'xsegs([x;x+30*ones(x)],[(360+40)*ones(x);(360+70)*ones(x)]);']
+       'xsegs([x;x+30*ones(x)],[(360+40)*ones(x);(360+70)*ones(x)]);'];
 x_message(["[I.9] xsegs(x,y)";expr]);
 execstr(expr);
 
 // Demo I.10
 expr=['x=0:40:240;';
-'xarrows([x;x+30*ones(x)],[(360+70)*ones(x);(360+100)*ones(x)]);'];
+       'xarrows([x;x+30*ones(x)],[(360+70)*ones(x);(360+100)*ones(x)]);'];
 x_message(["[I.10] xarrows(x,y)";expr]);
 execstr(expr);
 
 // Demo I.11
 expr=['x=0:100:200;';
-'xnumb(x,500*ones(x),[10,20,35],1);';
-'xnumb(x,550*ones(x),[10,20,35],0);';];
+       'xnumb(x,500*ones(x),[10,20,35],1);';
+       'xnumb(x,550*ones(x),[10,20,35],0);';];
 x_message(["[I.10] xnumb()";expr]);
 execstr(expr);
index 8ba604b..6ea8b2c 100644 (file)
@@ -4,40 +4,44 @@
 //
 // This file is distributed under the same license as the Scilab package.
 //
-       
-       my_plot_desc          = "rectangles, arcs, polylines and strings";
+       mode(-1);
        
        my_handle             = scf(100001);
+       clf(my_handle,"reset");
+       
+       my_plot_desc          = "rectangles, arcs, polylines and strings";
        my_handle.figure_name = my_plot_desc;
        
        plot2d([-100,500],[-100,600],[-1,-1],"022");
        a           = gca();
        t           = a.title;
-       t.text      = my_plot_desc
+       t.text      = my_plot_desc;
        t.font_size = 3;
        
-       xclip('clipgrf');
+       // clipping
+       a.clip_state = "clipgrf";
+       
        deff('[v]=transl(x,t)','v=x+t*ones(x)');
        
        x_message(["[II] Basic Functions of drivers :"]);
        
        // Demo II.1
-       expr="xrect(20,120,60,60);"
+       expr="xrect(20,120,60,60);";
        x_message(["[II.1] xrect : draw one rectangle with current line style";expr]);
        execstr(expr);
        
        // Demo II.2
-       expr="xfrect(100,120,60,60);"
+       expr="xfrect(100,120,60,60);";
        x_message(["[II.1] xfrect : fill one rectangle with current pattern";expr]);
        execstr(expr);
        
        // Demo II.3
-       expr="xarc(20,200,50,70,0,64*(225));"
+       expr="xarc(20,200,50,70,0,64*(225));";
        x_message(["[II.2] xarc : draw part of an elipsis";expr]);
        execstr(expr);
        
        // Demo II.4
-       expr="xfarc(100,200,50,70,0,64*225);"
+       expr="xfarc(100,200,50,70,0,64*225);";
        x_message(["[II.2] xfarc : fill part of an elipsis";expr]);
        execstr(expr);
        
index 7928aa8..41b8cf4 100644 (file)
@@ -5,9 +5,12 @@
 // This file is distributed under the same license as the Scilab package.
 //
        
-       my_plot_desc          = "Setting graphic context values";
+       mode(-1);
        
        my_handle             = scf(100001);
+       clf(my_handle,"reset");
+       
+       my_plot_desc          = "Setting graphic context values";
        my_handle.figure_name = my_plot_desc;
        
        plot2d([-100,500],[-100,600],[-1,-1],"022");
@@ -17,7 +20,8 @@
        t.text      = my_plot_desc;
        t.font_size = 3;
        
-       xclip('clipgrf');
+       // clipping
+       a.clip_state = "clipgrf";
        
        deff('[v]=transl(x,t)','v=x+t*ones(x)');
        
index 1675656..f0c3bd6 100644 (file)
@@ -4,10 +4,12 @@
 //
 // This file is distributed under the same license as the Scilab package.
 //
-       
-       my_plot_desc          = "General functions";
+       mode(-1);
        
        my_handle             = scf(100001);
+       clf(my_handle,"reset");
+       
+       my_plot_desc          = "General functions";
        my_handle.figure_name = my_plot_desc;
        
        plot2d([-100,500],[-100,600],[-1,-1],"022");
index 4f689c5..ae6ea90 100644 (file)
@@ -4,10 +4,12 @@
 //
 // This file is distributed under the same license as the Scilab package.
 //
-       
-       my_plot_desc          = "set of rectangles";
+       mode(-1);
        
        my_handle             = scf(100001);
+       clf(my_handle,"reset");
+       
+       my_plot_desc          = "set of rectangles";
        my_handle.figure_name = my_plot_desc;
        
        // Demo V
index f7e0dc6..4d09ebb 100644 (file)
@@ -4,10 +4,12 @@
 //
 // This file is distributed under the same license as the Scilab package.
 //
-       
-       my_plot_desc          = "colored matrix";
+       mode(-1);
        
        my_handle             = scf(100001);
+       clf(my_handle,"reset");
+       
+       my_plot_desc          = "colored matrix";
        my_handle.figure_name = my_plot_desc;
 
        expr=[
index b0a942b..2b45b2b 100644 (file)
@@ -4,10 +4,12 @@
 //
 // This file is distributed under the same license as the Scilab package.
 //
-       
-       my_plot_desc          = "colored histogram";
+       mode(-1);
        
        my_handle             = scf(100001);
+       clf(my_handle,"reset");
+       
+       my_plot_desc          = "colored histogram";
        my_handle.figure_name = my_plot_desc;
 
        expr=[
index a5e5b1d..eb830c2 100644 (file)
@@ -4,11 +4,14 @@
 //
 // This file is distributed under the same license as the Scilab package.
 //
-       
-       my_plot_desc          = "pie chart";
+       mode(-1);
        
        my_handle             = scf(100001);
+       clf(my_handle,"reset");
+       
+       my_plot_desc          = "pie chart";
        my_handle.figure_name = my_plot_desc;
+       
        expr=[
        "plot2d(0,0,[0],''032'',''leg'',[-1.5,-1.5 ,1.5,1.5]);"
        "a=gca(); t=a.title;"
index 6f4233d..c85ab4e 100644 (file)
@@ -6,10 +6,15 @@
 //
 
 demopath = get_absolute_file_path("bezier.dem.gateway.sce");
+
 exec(demopath+"/Macros.sci");
-demolist=[
+
+subdemolist=[
        "Gammatest"              , "gammatest.sce";
        "2D curve Bezier test"   , "beziertest.sce";
        "3D curve Bezier test"   , "bezier3dtest.sce";
        "Bezier surface test"    , "beziersurftest.sce"
        "Bezier surface test 2"  , "c1test.sce"];
+
+
+subdemolist(:,2) = demopath + subdemolist(:,2);
index 2b36ab1..e1fa6b9 100644 (file)
@@ -1,6 +1,8 @@
 
 demopath = get_absolute_file_path("fec.dem.gateway.sce");
 
-demolist=["Finite Element display with colorbar"  ,"fec.ex4.dem.gateway.sce";
+subdemolist=["Finite Element display with colorbar"  ,"fec.ex4.dem.gateway.sce";
           "Finite Element display with a mesh"    ,"fec.ex2.dem.gateway.sce";
           "Sfgrayplot "                           ,"fec.ex3.dem.gateway.sce"];
+
+subdemolist(:,2) = demopath + subdemolist(:,2);
index a58bfc7..f0768e7 100644 (file)
@@ -3,7 +3,7 @@
 // Copyright Enpc
 // last modified : 14th, December 2005
 //
-// A small example of MESH Creation 
+// A small example of MESH Creation
 // and visualisation of a linear on triangles function 
 // An more complex example from NSCK2E  (Inria)
 // With a Mesh of amdba type 
@@ -13,41 +13,41 @@ mode(0);
 
 path=get_absolute_file_path('fec.ex2');
 getf(path+'fec_demo.sci');
-xbasc();
+
+curFig             = scf(100001);
+clf(curFig,"reset");
+
 xselect();
-new_style = get("figure_style")=="new";
 
 xset("colormap",jetcolormap(128));
-if new_style then, drawlater(), end
+
+drawlater();
 amdbaR(path+'MESH');
 meshvisu();
 xtitle("a mesh");
 a=gca(); a.title.font_size=3;
-if new_style then, drawnow(), end
+drawnow();
+
 //xclick();
 x_message('click to continue');
 
-xbasc();
-xset("use color",1);
-if new_style then, drawlater(), end
+clf(curFig,"reset");
+drawlater();
 emc2C(1,6,path+'MESH.VAL');
 xtitle("display a fem solution");
 a=gca(); a.title.font_size=3;
-if new_style then, drawnow(), end
+drawnow();
 //xclick();
 x_message('click to continue');
 
 
 xbasc();
-xset("use color",1);
-if new_style then, drawlater(), end
+drawlater();
 emc2C(1,6,path+'MESH.VAL',[-2,-2,2,2]);
 emc2V(2,3,6,20,path+'MESH.VAL',[-2,-2,2,2]);
 xtitle("display a zoom of the solution together with the velocity field");
-a=gca(); a.title.font_size=3;
-if new_style then, drawnow(), end
+a=gca();
+a.title.font_size=3;
+drawnow();
 
 mode(-1)
-
-
-
index 83cbf37..eb7996e 100644 (file)
@@ -8,8 +8,11 @@
 
 mode(0);
 
-xbasc();
+curFig             = scf(100001);
+clf(curFig,"reset");
+
 Sfgrayplot();
-a=gca(); a.title.font_size=3;
+a=gca();
+a.title.font_size=3;
 
-mode(-1);
\ No newline at end of file
+mode(-1);
index 2e963ba..585fb17 100644 (file)
@@ -10,7 +10,9 @@ mode(0);
 
 path=get_absolute_file_path('fec.ex4');
 getf(path+'fec_demo.sci');
-xbasc();
+
+curFig             = scf(100001);
+clf(curFig,"reset");
 
 // compute the mesh
 N=20;n=1:N;
@@ -27,9 +29,7 @@ trianl=[trianl;N,N,1,N+1,0];
 
 xset("colormap",jetcolormap(128));
 
-new_style = get("figure_style")=="new";
-
-if new_style then, drawlater(), end
+drawlater();
 colorbar(1,N+1);
 rect=[-1.2,-1.2,1.2,1.2];
 fec(noeul(:,2),noeul(:,3),trianl,(1:N+1)',"030"," ",rect);
@@ -37,7 +37,6 @@ meshvisu(3,rect);
 a=gca();
 a.title.text="finite element display with colorbar";
 a.title.font_size=3;
-if new_style then, drawnow(), end
+drawnow();
 
 mode(0);
-
index 8c242f8..c2f1d17 100644 (file)
@@ -7,7 +7,7 @@
 
 demopath = get_absolute_file_path("graphics.dem.gateway.sce");
 
-demolist = ["2D and 3D plots"             ,"2d_3d_plots/2d_3d_plots.dem.gateway.sce"             ; ..
+subdemolist = ["2D and 3D plots"             ,"2d_3d_plots/2d_3d_plots.dem.gateway.sce"             ; ..
                        "Basic functions"             ,"basic_functions/basic_functions.dem.gateway.sce"     ; ..
                        "Animation"                   ,"anim/anim.dem.gateway.sce"                           ; ..
                        "Finite Elements"             ,"fec/fec.dem.gateway.sce"                             ; ..
@@ -16,3 +16,5 @@ demolist = ["2D and 3D plots"             ,"2d_3d_plots/2d_3d_plots.dem.gateway.
                        "Misc"                        ,"misc_new/misc.dem.gateway.sce"          ; ..
                        "Complex elementary functions","cmplxfunc/cmplxfunc.dem.gateway.sce"; ..
                        "bar histogram"               ,"bar/bar.dem"            ]
+                       
+subdemolist(:,2) = demopath + subdemolist(:,2);
index 2cb35bf..db33ef9 100644 (file)
@@ -10,7 +10,7 @@ mode(-1)
 demopath = get_absolute_file_path("surfaces.dem.gateway.sce");
 exec(demopath+"/Macros.sci");
 
-demolist=["Surface with holes 1"    ,"hole3d.sce";
+subdemolist=["Surface with holes 1"    ,"hole3d.sce";
           "Surface with holes 2"    ,"hole3d1.sce";
           "Sphere"                  ,"sphere.sce";
           "Shell"                   ,"shell.sce";
index 14f79a8..153acc0 100644 (file)
@@ -310,7 +310,11 @@ includes/Widget.h
 
 #### gui : demos files ####
 libscigui_la_demosdir=$(mydatadir)/demos/
-libscigui_la_demos_DATA = demos/dialog.dem
+libscigui_la_demos_DATA = demos/cb_uicontrol_plot3d.dem.sci \
+demos/dialog.dem.sce \
+demos/gui.dem.gateway.sce \
+demos/uicontrol.dem.sce \
+demos/uicontrol_plot3d.dem.sce
 
 
 #### graphics : icons files ####
index 70bb9c8..032c360 100644 (file)
@@ -879,7 +879,12 @@ includes/Widget.h
 
 #### gui : demos files ####
 libscigui_la_demosdir = $(mydatadir)/demos/
-libscigui_la_demos_DATA = demos/dialog.dem
+libscigui_la_demos_DATA = demos/cb_uicontrol_plot3d.dem.sci \
+demos/dialog.dem.sce \
+demos/gui.dem.gateway.sce \
+demos/uicontrol.dem.sce \
+demos/uicontrol_plot3d.dem.sce
+
 
 #### graphics : icons files ####
 libscigui_la_iconsdir = $(mydatadir)/
diff --git a/scilab/modules/gui/demos/cb_uicontrol_plot3d.dem.sci b/scilab/modules/gui/demos/cb_uicontrol_plot3d.dem.sci
new file mode 100644 (file)
index 0000000..05f0b38
--- /dev/null
@@ -0,0 +1,678 @@
+//
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - INRIA - Pierre MARECHAL
+//
+// 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
+//
+
+function uicontrol_plot3d()
+       
+       global margin_x;
+       global margin_y;
+       
+       global padding_x;
+       global padding_y;
+       
+       global frame_w;
+       global frame_h;
+       
+       global plot_w;
+       global plot_h;
+       
+       // Parameters
+       // =========================================================================
+       
+       frame_w      = 300;     // Frame width
+       frame_h      = 550;     // Frame height
+       
+       plot_w       = 600;     // Plot width
+       plot_h       = frame_h; // Plot height
+       
+       margin_x     = 15;      // Horizontal margin between each elements
+       margin_y     = 15;      // Vertical margin between each elements
+       
+       padding_x    = 10;      // Horizontal padding between each elements
+       padding_y    = 10;      // Vertical padding between each elements
+       
+       button_w     = 100;     // Button width
+       button_h     = 30;      // Button height
+       
+       defaultfont  = "arial"; // Default Font
+       
+       // Figure creation
+       // ========================================================================= 
+       
+       axes_w       = 3*margin_x + frame_w + plot_w; // axes width
+       axes_h       = 2*margin_y + frame_h;          // axes height (100 => toolbar height)
+       
+       fig_w        = axes_w + 50;       // 12    figure width
+       fig_h        = axes_h + 130;      // 100   figure height (100 => toolbar height)
+       
+       demo_plot3d = figure(100001);
+       
+       demo_plot3d.auto_resize     = "off";
+       demo_plot3d.background      = -2;
+       demo_plot3d.color_map       = jetcolormap(128);
+       demo_plot3d.figure_position = [0 0];
+       demo_plot3d.figure_size     = [fig_w  fig_h];
+       demo_plot3d.axes_size       = [axes_w axes_h];
+       demo_plot3d.figure_name     = gettext("Control Plot3d");
+       
+       // Remove Scilab graphics menus & toolbar
+       
+       delmenu(demo_plot3d.figure_id, gettext("&File"));
+       delmenu(demo_plot3d.figure_id, gettext("&Tools"));
+       delmenu(demo_plot3d.figure_id, gettext("&Edit"));
+       delmenu(demo_plot3d.figure_id, gettext("&?"));
+       toolbar(demo_plot3d.figure_id, "off");
+       
+       // New menu
+       
+       h = uimenu( "parent", demo_plot3d,       ..
+                               "label" , gettext("File"));
+       
+       uimenu( "parent"    , h,                 ..
+                       "label"     , gettext("Close"),  ..
+                       "callback"  , "demo_quit",       ..
+                       "tag"       , "close_menu");
+       
+       // Frames creation [Control Panel]
+       // =========================================================================
+       
+       my_frame = uicontrol( ...
+               "parent"              , demo_plot3d,...
+               "relief"              , "groove",...
+               "style"               , "frame",...
+               "units"               , "pixels",...
+               "position"            , [ margin_x margin_y frame_w frame_h],...
+               "fontname"            , "arial",...
+               "fontunits"           , "points",...
+               "fontsize"            , 13,...
+               "fontweight"          , "bold", ...
+               "horizontalalignment" , "center", ...
+               "background"          , [1 1 1], ...
+               "tag"                 , "frame_control" ...
+       );
+       
+       // Frame title
+       my_frame_title = uicontrol( ...
+               "parent"              , demo_plot3d,...
+               "style"               , "text",...
+               "string"              , "Control Panel",...
+               "units"               , "pixels",...
+               "position"            , [ 30+margin_x margin_y+frame_h-10 frame_w-60 20 ],...
+               "fontname"            , defaultfont,...
+               "fontunits"           , "points",...
+               "fontsize"            , 14,...
+               "horizontalalignment" , "center", ...
+               "background"          , [1 1 1], ...
+               "tag"                 , "title_frame_control" ...
+       );
+       
+       
+       // Rotation Angle
+       // =========================================================================
+       
+       my_slider_angle = 0;
+       
+       my_ra_frame_w     = frame_w-2*padding_x
+       my_ra_frame_h     = 50;
+       my_ra_frame_pos_x = padding_x+margin_x;
+       my_ra_frame_pos_y = (margin_y+frame_h) - 4*padding_y - my_ra_frame_h;
+       
+       my_slider_width      = my_ra_frame_w - 20;
+       my_slider_height     = 20;
+       my_slider_position_x = my_ra_frame_pos_x + 10;
+       my_slider_position_y = my_ra_frame_pos_y + 10;
+       
+       // frame
+       
+       my_ra_frame = uicontrol( ...
+               "parent"              , demo_plot3d,...
+               "relief"              , "groove",...
+               "style"               , "frame",...
+               "units"               , "pixels",...
+               "position"            , [ my_ra_frame_pos_x my_ra_frame_pos_y my_ra_frame_w my_ra_frame_h],...
+               "fontname"            , "arial",...
+               "fontunits"           , "points",...
+               "fontsize"            , 13,...
+               "fontweight"          , "bold", ...
+               "horizontalalignment" , "center", ...
+               "background"          , [1 1 1], ...
+               "tag"                 , "frame_control" ...
+       );
+       
+       // Frame title
+       
+       my_ra_frame_title = uicontrol( ...
+               "parent"              , demo_plot3d,...
+               "style"               , "text",...
+               "string"              , "Rotation angle",...
+               "units"               , "pixels",...
+               "position"            , [ 70+my_ra_frame_pos_x my_ra_frame_pos_y+my_ra_frame_h-9 my_ra_frame_w-140 18 ],...
+               "fontname"            , defaultfont,...
+               "fontunits"           , "points",...
+               "fontsize"            , 9,...
+               "horizontalalignment" , "center", ...
+               "background"          , [1 1 1], ...
+               "tag"                 , "title_frame_control" ...
+       );
+       
+       my_slider_angle = uicontrol( ...
+               "parent"              , demo_plot3d,...
+               "style"               , "slider",...
+               "Min"                 , 0,...
+               "Max"                 , 360,...
+               "Value"               , 70,...
+               "SliderStep"          , [2 30],...
+               "units"               , "pixels",...
+               "position"            , [ my_slider_position_x my_slider_position_y my_slider_width my_slider_height ],...
+               "tag"                 , "slider_angle", ...
+               "callback"            , "update_plot3d_angle()" ...
+       );
+       
+       // Colormap frame creation
+       // =========================================================================
+       
+       my_cmap_frame_w     = frame_w-2*padding_x
+       my_cmap_frame_h     = 100;
+       my_cmap_frame_pos_x = padding_x+margin_x;
+       my_cmap_frame_pos_y = my_ra_frame_pos_y - 2*padding_y - my_cmap_frame_h;
+       
+       // Colormap : frame
+       
+       my_cmap_frame = uicontrol( ...
+               "parent"              , demo_plot3d,...
+               "relief"              , "groove",...
+               "style"               , "frame",...
+               "units"               , "pixels",...
+               "position"            , [ my_cmap_frame_pos_x my_cmap_frame_pos_y my_cmap_frame_w my_cmap_frame_h],...
+               "fontname"            , "arial",...
+               "fontunits"           , "points",...
+               "fontsize"            , 13,...
+               "fontweight"          , "bold", ...
+               "horizontalalignment" , "center", ...
+               "background"          , [1 1 1], ...
+               "tag"                 , "frame_control" ...
+       );
+       
+       // Colormap : Frame title
+       
+       my_cmap_frame_title = uicontrol( ...
+               "parent"              , demo_plot3d,...
+               "style"               , "text",...
+               "string"              , "Colormap",...
+               "units"               , "pixels",...
+               "position"            , [ 100+my_cmap_frame_pos_x my_cmap_frame_pos_y+my_cmap_frame_h-9 my_cmap_frame_w-200 18 ],...
+               "fontname"            , defaultfont,...
+               "fontunits"           , "points",...
+               "fontsize"            , 9,...
+               "horizontalalignment" , "center", ...
+               "background"          , [1 1 1], ...
+               "tag"                 , "title_frame_control" ...
+       );
+       
+       // Colormap : Jetcolormap
+       
+       jetcolormap_radio = uicontrol( ...
+               "parent"             , demo_plot3d,...
+               "style"              , "radiobutton",...
+               "string"             , gettext("Jetcolormap"),...
+               "position"           , [ my_cmap_frame_pos_x+10 my_cmap_frame_pos_y+my_cmap_frame_h-50 my_cmap_frame_w-25 15],...
+               "horizontalalignment", "left",...
+               "fontname"           , defaultfont,...
+               "fontunits"          , "points",...
+               "fontsize"           , 10,...
+               "min"                , 0, ...
+               "max"                , 1, ...
+               "value"              , 1, ...
+               "background"          , [1 1 1], ...
+               "callback"           , "update_colormap",...
+               "tag"                , "jetcolormap_radio");
+       
+       // Colormap : Hotcolormap
+       
+       hotcolormap_radio = uicontrol( ...
+               "parent"             , demo_plot3d,...
+               "style"              , "radiobutton",...
+               "string"             , gettext("Hotcolormap"),...
+               "position"           , [ my_cmap_frame_pos_x+10 my_cmap_frame_pos_y+my_cmap_frame_h-70 my_cmap_frame_w-25 15],...
+               "horizontalalignment", "left",...
+               "fontname"           , defaultfont,...
+               "fontunits"          , "points",...
+               "fontsize"           , 10,...
+               "min"                , 0, ...
+               "max"                , 1, ...
+               "value"              , 0, ...
+               "background"          , [1 1 1], ...
+               "callback"           , "update_colormap",...
+               "tag"                , "hotcolormap_radio");
+       
+       // Colormap : Graycolormap
+       
+       graycolormap_radio = uicontrol( ...
+               "parent"             , demo_plot3d,...
+               "style"              , "radiobutton",...
+               "string"             , gettext("Graycolormap"),...
+               "position"           , [ my_cmap_frame_pos_x+10 my_cmap_frame_pos_y+my_cmap_frame_h-90 my_cmap_frame_w-25 20],...
+               "horizontalalignment", "left",...
+               "fontname"           , defaultfont,...
+               "fontunits"          , "points",...
+               "fontsize"           , 10,...
+               "min"                , 0, ...
+               "max"                , 1, ...
+               "value"              , 0, ...
+               "background"          , [1 1 1], ...
+               "callback"           , "update_colormap",...
+               "tag"                , "graycolormap_radio");
+       
+       
+       // Background axes color
+       // =========================================================================
+       
+       
+       my_bac_frame_w     = frame_w-2*padding_x
+       my_bac_frame_h     = 65;
+       my_bac_frame_pos_x = padding_x+margin_x;
+       my_bac_frame_pos_y = my_cmap_frame_pos_y - 2*padding_y - my_bac_frame_h;
+       
+       my_bac_pushbutton_w     = 100;
+       my_bac_pushbutton_h     = 30;
+       my_bac_pushbutton_pos_x = my_bac_frame_pos_x + floor( (my_bac_frame_w/2) - (my_bac_pushbutton_w/2) );
+       my_bac_pushbutton_pos_y = my_bac_frame_pos_y + floor( (my_bac_frame_h/2) - (my_bac_pushbutton_h/2) );
+       
+       // Background axes color : frame
+       
+       my_bac_frame = uicontrol( ...
+               "parent"              , demo_plot3d,...
+               "relief"              , "groove",...
+               "style"               , "frame",...
+               "units"               , "pixels",...
+               "position"            , [ my_bac_frame_pos_x my_bac_frame_pos_y my_bac_frame_w my_bac_frame_h],...
+               "fontname"            , "arial",...
+               "fontunits"           , "points",...
+               "fontsize"            , 13,...
+               "fontweight"          , "bold", ...
+               "horizontalalignment" , "center", ...
+               "background"          , [1 1 1], ...
+               "tag"                 , "frame_bac" ...
+       );
+       
+       // Background axes color : Frame title
+       
+       my_bac_frame_title = uicontrol( ...
+               "parent"              , demo_plot3d,...
+               "style"               , "text",...
+               "string"              , "Background Color",...
+               "units"               , "pixels",...
+               "position"            , [ 70+my_bac_frame_pos_x my_bac_frame_pos_y+my_bac_frame_h-9 my_bac_frame_w-140 18 ],...
+               "fontname"            , defaultfont,...
+               "fontunits"           , "points",...
+               "fontsize"            , 9,...
+               "horizontalalignment" , "center", ...
+               "background"          , [1 1 1], ...
+               "tag"                 , "title_frame_bac" ...
+       );
+       
+       // Background axes color : Pushbutton
+       
+       my_bac_frame_title = uicontrol( ...
+               "parent"              , demo_plot3d,...
+               "style"               , "pushbutton",...
+               "string"              , "",...
+               "units"               , "pixels",...
+               "position"            , [ my_bac_pushbutton_pos_x my_bac_pushbutton_pos_y my_bac_pushbutton_w my_bac_pushbutton_h],...
+               "background"          , [1 1 1], ...
+               "callback"            , "update_background_color",...
+               "tag"                 , "pushbutton_bac" ...
+       );
+       
+       
+       
+       
+       // show/hide frame creation
+       // =========================================================================
+       
+       my_sh_frame_w     = frame_w-2*padding_x
+       my_sh_frame_h     = 120;
+       my_sh_frame_pos_x = padding_x+margin_x;
+       my_sh_frame_pos_y = my_bac_frame_pos_y - 2*padding_y - my_sh_frame_h;
+       
+       // show/hide : frame
+       
+       my_sh_frame = uicontrol( ...
+               "parent"              , demo_plot3d,...
+               "relief"              , "groove",...
+               "style"               , "frame",...
+               "units"               , "pixels",...
+               "position"            , [ my_sh_frame_pos_x my_sh_frame_pos_y my_sh_frame_w my_sh_frame_h],...
+               "fontname"            , "arial",...
+               "fontunits"           , "points",...
+               "fontsize"            , 13,...
+               "fontweight"          , "bold", ...
+               "horizontalalignment" , "center", ...
+               "background"          , [1 1 1], ...
+               "tag"                 , "frame_show_hide" ...
+       );
+       
+       // show/hide : Frame title
+       
+       my_sh_frame_title = uicontrol( ...
+               "parent"              , demo_plot3d,...
+               "style"               , "text",...
+               "string"              , "Show/Hide",...
+               "units"               , "pixels",...
+               "position"            , [ 100+my_sh_frame_pos_x my_sh_frame_pos_y+my_sh_frame_h-9 my_sh_frame_w-200 18 ],...
+               "fontname"            , defaultfont,...
+               "fontunits"           , "points",...
+               "fontsize"            , 9,...
+               "horizontalalignment" , "center", ...
+               "background"          , [1 1 1], ...
+               "tag"                 , "title_frame_show_hide" ...
+       );
+       
+       // show/hide : tics
+       
+       tics_checkbox = uicontrol( ...
+               "parent"             , demo_plot3d,...
+               "style"              , "checkbox",...
+               "string"             , gettext("Tics"),...
+               "position"           , [ my_sh_frame_pos_x+10 my_sh_frame_pos_y+my_sh_frame_h-50 my_sh_frame_w-25 15],...
+               "horizontalalignment", "left",...
+               "fontname"           , defaultfont,...
+               "fontunits"          , "points",...
+               "fontsize"           , 10,...
+               "value"              , 1, ...
+               "background"          , [1 1 1], ...
+               "callback"           , "update_tics_visible",...
+               "tag"                , "tics_checkbox");
+       
+       // show/hide : title
+       
+       title_checkbox = uicontrol( ...
+               "parent"             , demo_plot3d,...
+               "style"              , "checkbox",...
+               "string"             , gettext("Title"),...
+               "position"           , [ my_sh_frame_pos_x+10 my_sh_frame_pos_y+my_sh_frame_h-70 my_sh_frame_w-25 20],...
+               "horizontalalignment", "left",...
+               "fontname"           , defaultfont,...
+               "fontunits"          , "points",...
+               "fontsize"           , 10,...
+               "value"              , 1, ...
+               "background"          , [1 1 1], ...
+               "callback"           , "update_title_visible",...
+               "tag"                , "title_checkbox");
+               
+       // show/hide : labels
+       
+       labels_checkbox = uicontrol( ...
+               "parent"             , demo_plot3d,...
+               "style"              , "checkbox",...
+               "string"             , gettext("Labels"),...
+               "position"           , [ my_sh_frame_pos_x+10 my_sh_frame_pos_y+my_sh_frame_h-90 my_sh_frame_w-25 20],...
+               "horizontalalignment", "left",...
+               "fontname"           , defaultfont,...
+               "fontunits"          , "points",...
+               "fontsize"           , 10,...
+               "value"              , 1, ...
+               "background"          , [1 1 1], ...
+               "callback"           , "update_labels_visible",...
+               "tag"                , "labels_checkbox");
+               
+       // show/hide : edges
+       
+       labels_checkbox = uicontrol( ...
+               "parent"             , demo_plot3d,...
+               "style"              , "checkbox",...
+               "string"             , gettext("Edges"),...
+               "position"           , [ my_sh_frame_pos_x+10 my_sh_frame_pos_y+my_sh_frame_h-110 my_sh_frame_w-25 20],...
+               "horizontalalignment", "left",...
+               "fontname"           , defaultfont,...
+               "fontunits"          , "points",...
+               "fontsize"           , 10,...
+               "value"              , 1, ...
+               "background"          , [1 1 1], ...
+               "callback"           , "update_edges_visible",...
+               "tag"                , "edges_checkbox");
+               
+       
+       
+       
+       // Edit title
+       // =========================================================================
+       
+       my_edittitle_frame_w     = frame_w-2*padding_x
+       my_edittitle_frame_h     = 75;
+       my_edittitle_frame_pos_x = padding_x+margin_x;
+       my_edittitle_frame_pos_y = my_sh_frame_pos_y - 2*padding_y - my_edittitle_frame_h;
+       
+       // Edit title : frame
+       
+       my_edittitle_frame = uicontrol( ...
+               "parent"              , demo_plot3d,...
+               "relief"              , "groove",...
+               "style"               , "frame",...
+               "units"               , "pixels",...
+               "position"            , [ my_edittitle_frame_pos_x my_edittitle_frame_pos_y my_edittitle_frame_w my_edittitle_frame_h],...
+               "fontname"            , "arial",...
+               "fontunits"           , "points",...
+               "fontsize"            , 13,...
+               "fontweight"          , "bold", ...
+               "horizontalalignment" , "center", ...
+               "background"          , [1 1 1], ...
+               "tag"                 , "frame_edittitle" ...
+       );
+       
+       // Edit title : Frame title
+       
+       my_edittitle_frame_title = uicontrol( ...
+               "parent"              , demo_plot3d,...
+               "style"               , "text",...
+               "string"              , "Title",...
+               "units"               , "pixels",...
+               "position"            , [ 100+my_edittitle_frame_pos_x my_edittitle_frame_pos_y+my_edittitle_frame_h-9 my_edittitle_frame_w-200 18 ],...
+               "fontname"            , defaultfont,...
+               "fontunits"           , "points",...
+               "fontsize"            , 9,...
+               "horizontalalignment" , "center", ...
+               "background"          , [1 1 1], ...
+               "tag"                 , "title_frame_edittitle" ...
+       );
+       
+       // Edit title : tics
+       
+       tics_checkbox = uicontrol( ...
+               "parent"             , demo_plot3d,...
+               "style"              , "edit",...
+               "position"           , [ my_edittitle_frame_pos_x+10 my_edittitle_frame_pos_y+my_edittitle_frame_h-50 my_edittitle_frame_w-25 25],...
+               "horizontalalignment", "left",...
+               "fontname"           , defaultfont,...
+               "fontunits"          , "points",...
+               "fontsize"           , 10,...
+               "string"             , "My Beautiful Plot", ...
+               "callback"           , "update_title_string",...
+               "tag"                , "edittitle");
+       
+       // Plot3d creation
+       // =========================================================================
+       
+       drawlater();
+       
+       newaxes();
+       my_plot_axes = gca();
+       
+       my_plot_axes.x_label.text       = "X";
+       my_plot_axes.y_label.text       = "Y";
+       my_plot_axes.z_label.text       = "Z";
+       my_plot_axes.title.text         = "My Beautiful Plot";
+       my_plot_axes.title.font_size    = 5;
+       my_plot_axes.rotation_angles(1) = 80;
+       my_plot_axes.axes_bounds        = [1/3,0,2/3,1];
+       
+       // define colormap
+       colormapSize = 128;
+       f = gcf();
+       f.color_map = jetcolormap(128);
+       
+       // generate facet coordinates
+       x = %pi * [-1:0.05:1]';z = sin(x)*cos(x)';
+       [x,y,z] = genfac3d(x,x,z);
+       
+       // generate colors
+       // colors depending on z, between 1 and colormap size
+       facetsColors = (z + 1) * (colormapSize - 1) / 2 + 1;
+       
+       // plot
+       plot3d(x,y,list(z, facetsColors));
+       
+       my_plot3d = gce();
+       my_plot3d.color_flag = 3;
+       
+       my_plot_axes.rotation_angles(1) = 80;
+       
+       drawnow();
+       
+endfunction
+
+
+
+
+
+function update_plot3d_angle()
+       
+       my_plot_axes = gca();
+       my_new_angle = get(gcbo,"Value");
+       
+       if( my_new_angle>0 & my_new_angle<360 ) then
+               my_plot_axes.rotation_angles(2) = my_new_angle;
+       end
+       
+endfunction
+
+function update_colormap()
+       
+       my_figure    = gcf();
+       my_plot_axes = gca();
+       
+       my_figure.immediate_drawing = "off";
+       
+       my_cur_color_map    = my_figure.color_map;
+       my_cur_bg_color_id  = my_plot_axes.background;
+       
+       if my_cur_bg_color_id > 32 then
+               my_cur_bg_color_r = my_cur_color_map(my_cur_bg_color_id,1);
+               my_cur_bg_color_g = my_cur_color_map(my_cur_bg_color_id,2);
+               my_cur_bg_color_b = my_cur_color_map(my_cur_bg_color_id,3);
+       end
+       
+       set(findobj("tag", "jetcolormap_radio") , "value", 0);
+       set(findobj("tag", "hotcolormap_radio") , "value", 0);
+       set(findobj("tag", "graycolormap_radio"), "value", 0);
+       
+       set(gcbo, "value", 1);
+       
+       my_wanted_colormap = get(gcbo,"tag");
+       
+       if get(gcbo, "tag") == "jetcolormap_radio" then
+               my_figure.color_map = jetcolormap(128);
+       elseif get(gcbo, "tag") == "hotcolormap_radio" then
+               my_figure.color_map = hotcolormap(128);
+       elseif get(gcbo, "tag") == "graycolormap_radio" then
+               my_figure.color_map = graycolormap(128);
+       end
+       
+       if my_cur_bg_color_id > 32 then
+       
+               color_id = color( ..
+                                               my_cur_bg_color_r*255, ..
+                                               my_cur_bg_color_g*255, ..
+                                               my_cur_bg_color_b*255  ..
+                                               );
+               
+               my_plot_axes.background = color_id;
+       end
+       
+       my_figure.immediate_drawing = "on";
+       
+endfunction
+
+function update_background_color()
+       
+       // Lancement du colorchooser
+       [my_red, my_green, my_blue] = uigetcolor();
+       
+       if( (my_red<>[]) & (my_green<>[]) & (my_blue<>[]) ) then
+               
+               set(gcbo,"BackgroundColor",[ my_red/255 my_green/255 my_blue/255 ]);
+               
+               my_plot_axes            = gca();
+               color_id                = color(my_red,my_green,my_blue);
+               my_plot_axes.background = color_id;
+               
+       end
+       
+endfunction
+
+function update_tics_visible()
+       
+       my_plot_axes = gca();
+       
+       if get(gcbo,"Value") == 0 then
+               my_plot_axes.axes_visible = ["off" "off" "off" ];
+       else
+               my_plot_axes.axes_visible = ["on" "on" "on" ];
+       end
+       
+endfunction
+
+function update_title_visible()
+
+       my_plot_axes = gca();
+       
+       if get(gcbo,"Value") == 0 then
+               my_plot_axes.title.visible = "off";
+       else
+               my_plot_axes.title.visible = "on";
+       end
+
+endfunction
+
+function update_labels_visible()
+
+       my_plot_axes = gca();
+       
+       if get(gcbo,"Value") == 0 then
+               my_plot_axes.x_label.visible = "off";
+               my_plot_axes.y_label.visible = "off";
+               my_plot_axes.z_label.visible = "off";
+       else
+               my_plot_axes.x_label.visible = "on";
+               my_plot_axes.y_label.visible = "on";
+               my_plot_axes.z_label.visible = "on";
+       end
+
+endfunction
+
+function update_edges_visible()
+
+       my_plot_axes = gca();
+       my_plot3d    = my_plot_axes.children;
+       
+       if get(gcbo,"Value") == 0 then
+               my_plot3d.color_mode = -1;
+       else
+               my_plot3d.color_mode = +1;
+       end
+
+endfunction
+
+function update_title_string
+       
+       my_plot_axes = gca();
+       my_plot_axes.title.text = get(gcbo,"String");
+       
+endfunction
similarity index 99%
rename from scilab/modules/gui/demos/dialog.dem
rename to scilab/modules/gui/demos/dialog.dem.sce
index 7b1a8e2..89f150b 100644 (file)
@@ -33,4 +33,4 @@ n=5;m=4;mat=rand(n,m);
 row='row';labelv=row(ones(1,n))+string(1:n);
 col='col';labelh=col(ones(1,m))+string(1:m);
 new=evstr(x_mdialog('Matrix to edit',labelv,labelh,string(mat)))
-end
\ No newline at end of file
+end
diff --git a/scilab/modules/gui/demos/gui.dem.gateway.sce b/scilab/modules/gui/demos/gui.dem.gateway.sce
new file mode 100644 (file)
index 0000000..8e201b0
--- /dev/null
@@ -0,0 +1,14 @@
+//
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) ????-2008 - INRIA
+//
+// This file is distributed under the same license as the Scilab package.
+//
+
+demopath = get_absolute_file_path("gui.dem.gateway.sce");
+
+subdemolist = ["Dialogs"   ,"dialog.dem.sce"       ; ..
+                       "Uicontrols 1" ,"uicontrol.dem.sce"     ; ..
+                       "Uicontrols 2" ,"uicontrol_plot3d.dem.sce"     ]
+                       
+subdemolist(:,2) = demopath + subdemolist(:,2);
similarity index 92%
rename from scilab/modules/tclsci/demos/tk/uicontrol.sci
rename to scilab/modules/gui/demos/uicontrol.dem.sce
index 05e5e8b..49e098f 100644 (file)
@@ -5,16 +5,6 @@
 // This file is distributed under the same license as the Scilab package.
 //
 
-function add_list_item()
-  if e1<>0&l1<>0 then
-  new = get(e1,'String')
-  list_item = [list_item  new];
-  set(l1,'String',strcat(list_item,'|'));
-  list_item=resume(list_item)
-  end
-endfunction
-
-function myuidialog()
   list_item = ["rouge"  "vert"  "tomate"  "chevre" "Truc"];
   e1=0;l1 =0
   initial=strcat(list_item,'|')
@@ -74,7 +64,7 @@ function myuidialog()
                 "BackgroundColor",[0 0.7 1],...
                 "callback"  , "fin=%t");
 
-  fr2= uicontrol(f, "Position"  , [137 128 29 19],...
+  fr2= uicontrol(f, "Position"  , [138 128 29 19],...
                 "Style"     , "frame",...
                 "BackgroundColor",[0.9 0.9 0.9]);
 
@@ -82,17 +72,17 @@ function myuidialog()
                 "Style"     , "text",...
                 "String"    , "50",...
                 "BackgroundColor",[1 1 1]);
-  
+  s1=0
   s1 = uicontrol(f, "Position"  , [10 130 120 15],..
                 "Style"     , "slider",...
                 "Min"       , 0,...
                 "Max"       , 100,...
                 "Value"     , 50,...
                 "SliderStep", [2 10],...
-                "callback"  , "set(t2,''String'',string(get(gcbo,''Value'')))");
+                "callback"  , "set(t2,''String'',string(get(s1,''Value'')))");
   // Note pour un slider la position de ref est ulp
 
-  p1 = uicontrol(f, "Position"  , [90 170 70 20],...
+  p1 = uicontrol(f, "Position"  , [100 170 50 20],...
                 "Style"     , "popupmenu",...
                 "String"    , "popup|item1|item2|item3|toto|truc|bidule");
 
@@ -105,5 +95,13 @@ function myuidialog()
   end
   close(f)
 
-  return
+
+
+function add_list_item()
+  if e1<>0&l1<>0 then
+  new = get(e1,'String')
+  list_item = [list_item  new];
+  set(l1,'String',strcat(list_item,'|'));
+  list_item=resume(list_item)
+  end
 endfunction
diff --git a/scilab/modules/gui/demos/uicontrol_plot3d.dem.sce b/scilab/modules/gui/demos/uicontrol_plot3d.dem.sce
new file mode 100644 (file)
index 0000000..58b7d48
--- /dev/null
@@ -0,0 +1,14 @@
+//
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - INRIA - Pierre MARECHAL
+//
+// 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
+//
+
+my_path = SCI+"/modules/gui/demos";
+exec(my_path+"/cb_uicontrol_plot3d.dem.sci");
+uicontrol_plot3d();
index 613a923..a7c9e22 100644 (file)
@@ -7,7 +7,7 @@ load('SCI/modules/gui/macros/lib');
 // ====================================================================
 path = get_absolute_file_path('gui.start');
 path = getshortpathname(path);
-pathdemos = pathconvert(part(path,1:(length(path)-5))+'/demos/dialog.dem',%f,%f);
+pathdemos = pathconvert(part(path,1:(length(path)-5))+"/demos/gui.dem.gateway.sce",%f,%f);
 
 //add help chapter
 add_module_help_chapter('gui');
index b70e16f..bf6474f 100644 (file)
@@ -271,13 +271,11 @@ demos/tk/demredraw.sci \
 demos/tk/rgb.txt \
 demos/tk/timer.sce \
 demos/tk/puzzle \
-demos/tk/uicontrol.sci \
 demos/tk/scale.dem.sce \
 demos/tk/cscroll \
 demos/tk/tcolor \
 demos/tk/puzzle.dem.sce \
 demos/tk/scroll.dem.sce \
-demos/tk/uicontrol1.sce \
 demos/tk/color.dem.sce \
 demos/tk/rolodex \
 demos/tk/vscale
index 5eb130c..380becb 100644 (file)
@@ -637,13 +637,11 @@ top_srcdir = @top_srcdir@
 @TCLTK_TRUE@demos/tk/rgb.txt \
 @TCLTK_TRUE@demos/tk/timer.sce \
 @TCLTK_TRUE@demos/tk/puzzle \
-@TCLTK_TRUE@demos/tk/uicontrol.sci \
 @TCLTK_TRUE@demos/tk/scale.dem.sce \
 @TCLTK_TRUE@demos/tk/cscroll \
 @TCLTK_TRUE@demos/tk/tcolor \
 @TCLTK_TRUE@demos/tk/puzzle.dem.sce \
 @TCLTK_TRUE@demos/tk/scroll.dem.sce \
-@TCLTK_TRUE@demos/tk/uicontrol1.sce \
 @TCLTK_TRUE@demos/tk/color.dem.sce \
 @TCLTK_TRUE@demos/tk/rolodex \
 @TCLTK_TRUE@demos/tk/vscale
index 15cb7a7..af9ca65 100644 (file)
@@ -7,9 +7,9 @@
 
 demopath = get_absolute_file_path("tcltk.dem.gateway.sce");
 
-demolist = ["Color"  ,"color.dem.sce"      ; ..
+subdemolist = ["Color"  ,"color.dem.sce"      ; ..
                        "Puzzle" ,"puzzle.dem.sce"     ; ..
                        "Scroll" ,"scroll.dem.sce"     ; ..
                        "Scale"  ,"scale.dem.sce"      ]
                        
-demolist(:,2) = demopath + demolist(:,2);
+subdemolist(:,2) = demopath + subdemolist(:,2);