File: _shading.sci

package info (click to toggle)
scilab-plotlib 0.41-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 3,196 kB
  • sloc: xml: 3,308; makefile: 15
file content (52 lines) | stat: -rw-r--r-- 1,205 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
function _shading(varargin)


i=1;
ax=get('current_axes');
while i<=length(varargin)
   if typeof(varargin(i))=='pltlibH'
     if varargin(i).handle.type=='Axes'
       ax=varargin(i).handle;
     else
      _error("axis : handle should be an axes handle")
     end
     i=i+1;
   elseif type(varargin(i))==10
     shadingType=varargin(i);
     out=parseShading("shading",shadingType,"shading","");
     i=i+1;
   else
     _error('shading : argument of unexpected type')
   end
end

win=get('current_figure');
IMD=win.immediate_drawing;
win.immediate_drawing="off";

h=get(ax,'children');

for i=1:size(h,1);
  if h(i).type=="Fac3d" 
    if shadingType=="interp"& size(h(i).data.x)==size(h(i).data.color)
      h(i).color_flag=3;
      h(i).color_mode=-1;
    elseif shadingType=="faceted"
     h(i).color_flag=4;
     h(i).color_mode=2;
    elseif shadingType=="flat"
     h(i).color_flag=4;
     h(i).color_mode=-1;    
    end
    for j=1:2:length(out);
      // h(i).user_data(out(j))=out(j+1); does no work with Scilabgtk 4.2
     user_data=h(i).user_data;
     user_data(out(j))=out(j+1);
     h(i).user_data=user_data;
    end
  end
end

win.immediate_drawing=IMD;

endfunction // end of _shading