-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy patheditgeomsetup.m
173 lines (147 loc) · 5.87 KB
/
editgeomsetup.m
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
function editgeomsetup
%
% Name: editgeom.m
%
% Usage: editgeom.m
%
% Description:
% Interactive Definition
% of Nodes, Tracelines, Bars, Shells, SEMBeams, and SEMquads
%
% Version SWD970707
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This matlab source code was originally %
% developed as part of "DIAMOND" at %
% Los Alamos National Laboratory. It may %
% be copied, modified, and distributed in %
% any form, provided: %
% a) This notice accompanies the files and %
% appears near the top of all source %
% code files. %
% b) No payment or commercial services are %
% received in exchange for the code. %
% %
% Original copyright is reserved by the %
% Regents of the University of California, %
% in addition to Scott W. Doebling, Phillip %
% J. Cornwell, Erik G. Straser, and Charles %
% R. Farrar. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
global HANDLES
HANDLES.heditgeom(1) = figure('Name','DIAMOND: EditGeom', ...
'units','normal',...
'NumberTitle','off', ...
'menubar','none',...
'visible','off',...
'Position',[0.1 0.1 0.8 0.8]);
%
% Define Frame Around Controls
%
HANDLES.heditgeom(2) = uicontrol('style','frame','pos',[0.00 0.74 1.0 0.26]);
%
% Define selection switch for geometry editor
%
HANDLES.heditgeom(3) = uicontrol('style','popup',...
'position',[0.05 0.90 0.2 0.05],...
'string','Nodes|Bars|SEMbeams|SEMquads|Shells|Tracelines',...
'callback',['EDITGEOM.nselsw = get(HANDLES.heditgeom(3),''value'');',...
'set(HANDLES.heditgeom(5),''value'',EDITGEOM.ilab(EDITGEOM.nselsw)),',...
'listgeom']);
%
% Define Listbox for current set
%
HANDLES.heditgeom(4) = uicontrol('style','listbox',...
'pos',[0.26 0.76 0.58 0.25],...
'String','uninitialized',...
'fontname','Courier');
%
% Define Label Switch
%
HANDLES.heditgeom(5) = uicontrol('style','checkbox',...
'position',[0.05 0.85 0.20 0.05],...
'string','Show Labels',...
'callback',...
['EDITGEOM.ilab(EDITGEOM.nselsw) = get(HANDLES.heditgeom(5),''value'');',...
'GEOM.inodelab = EDITGEOM.ilab(1);',...
'GEOM.ibarlab = EDITGEOM.ilab(2);',...
'GEOM.itracelab = EDITGEOM.ilab(6);']);
%
% Define Edit Button
%
HANDLES.heditgeom(6) = uicontrol('style','pushbutton',...
'position',[0.85 0.95 0.14 0.04],...
'string','Edit',...
'callback',...
['switch EDITGEOM.nselsw,',...
'case 1, titlestr = EDITGEOM.titlestr(1,1:end-1); bodystr = num2str(GEOM.Nodes);',...
'case 2, titlestr = EDITGEOM.titlestr(1,1:end-1); bodystr = num2str(GEOM.Bars);',...
'case 3, titlestr = EDITGEOM.titlestr(1,1:end-1); bodystr = ''''; for i = 1:length(GEOM.SEMbeams), bodystr = strvcat(bodystr,num2str(GEOM.SEMbeams{i})); end,',...
'case 4, titlestr = EDITGEOM.titlestr(1,1:end-1); bodystr = ''''; for i = 1:length(GEOM.SEMquads), bodystr = strvcat(bodystr,num2str(GEOM.SEMquads{i})); end,',...
'case 5, titlestr = EDITGEOM.titlestr(1,1:end-1); bodystr = num2str(GEOM.Shells);',...
'case 6, titlestr = EDITGEOM.titlestr(1,1:end-1); bodystr = num2str(GEOM.Tracelines);',...
'end,',...
'set(HANDLES.heditgeom(11),''string'',titlestr),',...
'set(HANDLES.heditgeom(12),''string'',bodystr),',...
'set(HANDLES.heditgeom(10),''visible'',''on''),',...
]);
% 'uiwait(HANDLES.heditgeom(10))']);
%
% Define Geometry Axes
%
HANDLES.heditgeom(7) = axes('position',[0.01 0.05 0.8 0.65],'dataaspectratio',[1 1 1]);
%%
%%
%% Define the Update-Geometry Button
%%
%%
HANDLES.heditgeom(8) = uicontrol('style','push',...
'units','normal',...
'pos',[.05 .80 .20 .05],...
'string','Update Geometry Display',...
'callback',['updtgeom(HANDLES.heditgeom(7),GEOM.Nodes),',...
'set(HANDLES.heditgeom(7),''dataaspectratio'',[1 1 1]),',...
'rotate3d on']);
%%
%%
%% Define the Exit Button
%%
%%
HANDLES.heditgeom(9) = uicontrol('style','push',...
'units','normal',...
'pos',[.775 .01 .2 .04],...
'string','Exit EditGeom',...
'callback','set(HANDLES.heditgeom(1),''visible'',''off'')');
%%
%% Set up EDIT STRING popup dialog
%%
HANDLES.heditgeom(10) = figure('Name','DIAMOND: EditString', ...
'units','normal',...
'NumberTitle','off', ...
'menubar','none',...
'visible','off',...
'Position',[0.25 0.4 0.5 0.25]);
HANDLES.heditgeom(11) = uicontrol('style','text',...
'position',[0.02 0.90 0.96 0.10],...
'horizontalalignment','left');
HANDLES.heditgeom(12) = uicontrol('style','edit',...
'position',[0.02 0.15 0.96 0.75],...
'horizontalalignment','left',...
'max',2);
HANDLES.heditgeom(13) = uicontrol('style','pushbutton',...
'position',[0.80 0.01 0.15 0.14],...
'string','Close',...
'callback',[...
'switch EDITGEOM.nselsw,',...
' case 1, GEOM.Nodes = str2num(get(HANDLES.heditgeom(12),''string'')); ',...
' case 2, GEOM.Bars = str2num(get(HANDLES.heditgeom(12),''string'')); ',...
' case 3, tempstr = get(HANDLES.heditgeom(12),''string''); GEOM.SEMbeams = {}; for i =1:size(tempstr,1), tempnum = str2num(tempstr(i,:)); if ~isempty(tempnum), GEOM.SEMbeams{i} = tempnum; end, end,',...
' case 4, tempstr = get(HANDLES.heditgeom(12),''string''); GEOM.SEMquads = {}; for i =1:size(tempstr,1), tempnum = str2num(tempstr(i,:)); if ~isempty(tempnum), GEOM.SEMquads{i} = tempnum; end, end,',...
' case 5, GEOM.Shells = str2num(get(HANDLES.heditgeom(12),''string'')); ',...
' case 6, GEOM.Tracelines = str2num(get(HANDLES.heditgeom(12),''string'')); ',...
'end,',...
'listgeom,',...
'set(HANDLES.heditgeom(10),''visible'',''off''),',...
'uiresume,']);
return