source: MML/trunk/applications/orbit/lib/elementiconpatch.m @ 35

Last change on this file since 35 was 4, checked in by zhangj, 11 years ago

Initial import--MML version from SOLEIL@2013

File size: 695 bytes
Line 
1function handles=ElementIconPatch(axes_handle,elemind,element_callback)
2%create patches for element icons
3%start with first element of THERING
4%axes_handle contains handle of desired axes
5%elemind contains indices of elements to be used in THERING
6
7
8ElementIcons=getappdata(0,'ElementIcons');
9%initialize patches for icons
10num=15;
11nicon=2*num;
12for ii=1:nicon
13    jj=elemind(ii);
14    xpos=ii/(nicon+1);    %...SYS.ahpos has x limits 0 to 1
15    handles(ii)=patch('parent',axes_handle,...
16    'XData',xpos+ElementIcons{jj}.xpts,...
17    'YData',ElementIcons{jj}.ypts,...
18    'FaceColor',ElementIcons{jj}.color,...
19    'ButtonDownFcn',element_callback,...
20    'Userdata',jj);
21end
22
23handles=handles(:);
Note: See TracBrowser for help on using the repository browser.