1 #include <mydefs.hpp>
2 DLL_HEADER const char * ngscript[] = {""
3 ,"catch {lappend auto_path $env(NETGENDIR) }\n"
4 ,"catch {lappend auto_path $env(NETGENDIR)/../lib }\n"
5 ,"if {[catch {Ng_GetCommandLineParameter batchmode} result ]} {\n"
6 ,"load libgui[info sharedlibextension] gui\n"
7 ,"}\n"
8 ,"set batchmode [Ng_GetCommandLineParameter batchmode]\n"
9 ,"if {$batchmode==\"undefined\"} {\n"
10 ,"if {[catch {package require tkdnd } result ]} {\n"
11 ,"}\n"
12 ,"}\n"
13 ,"set userlevel 3\n"
14 ,"if { [Ng_GetCommandLineParameter expert]==\"defined\" } {\n"
15 ,"set userlevel 3\n"
16 ,"}\n"
17 ,"set progname \"NETGEN\"\n"
18 ,"set ngdir \"\"\n"
19 ,"if { [lsearch [array names env] NETGENDIR] != -1 } {\n"
20 ,"set ngdir $env(NETGENDIR)\n"
21 ,"}\n"
22 ,"if { [string length $ngdir] == 0 } {\n"
23 ,"set ngdir \".\"\n"
24 ,"}\n"
25 ,"set nguserdir \"\"\n"
26 ,"if { [lsearch [array names env] NETGEN_USER_DIR] != -1 } {\n"
27 ,"set nguserdir $env(NETGEN_USER_DIR)\n"
28 ,"}\n"
29 ,"if { [string length $nguserdir] == 0 } {\n"
30 ,"set nguserdir \".\"\n"
31 ,"}\n"
32 ,"set batchmode [Ng_GetCommandLineParameter batchmode]\n"
33 ,"set solvemode 0\n"
34 ,"if { [Ng_GetCommandLineParameter solve] != \"undefined\" || \\\n"
35 ,"[Ng_GetCommandLineParameter recent] == \"defined\" } {\n"
36 ,"set solvemode defined\n"
37 ,"}\n"
38 ,"set shellmode [Ng_GetCommandLineParameter shellmode]\n"
39 ,"if { $shellmode == \"defined\" } {\n"
40 ,"set batchmode \"defined\"\n"
41 ,"}\n"
42 ,"if { $batchmode != \"defined\" } {\n"
43 ,"catch {\n"
44 ,"wm withdraw .\n"
45 ,"wm title . $progname\n"
46 ,"wm geometry . =850x600\n"
47 ,"wm minsize . 400 300\n"
48 ,"}\n"
49 ,"}\n"
50 ,"set drawmode rotate\n"
51 ,"set selectvisual geometry\n"
52 ,"set dirname .\n"
53 ,"set loadgeomtypevar \"All Geometry types\"\n"
54 ,"set basefilename filename\n"
55 ,"set meshoptions.fineness 3\n"
56 ,"set meshoptions.firststep ag\n"
57 ,"set meshoptions.laststep ov\n"
58 ,"set options.memory 0\n"
59 ,"set options.localh 1\n"
60 ,"set options.delaunay 1\n"
61 ,"set options.checkoverlap 1\n"
62 ,"set options.checkoverlappingboundary 0\n"
63 ,"set options.checkchartboundary 1\n"
64 ,"set options.startinsurface 0\n"
65 ,"set options.blockfill 1\n"
66 ,"set options.debugmode 0\n"
67 ,"set options.dooptimize 1\n"
68 ,"set options.parthread 1\n"
69 ,"set options.elsizeweight 0.2\n"
70 ,"set options.secondorder 0\n"
71 ,"set options.elementorder 1\n"
72 ,"set options.quad 0\n"
73 ,"set options.try_hexes 0\n"
74 ,"set options.inverttets 0\n"
75 ,"set options.inverttrigs 0\n"
76 ,"set options.autozrefine 0\n"
77 ,"set options.meshsize 1000\n"
78 ,"set options.minmeshsize 0\n"
79 ,"set options.curvaturesafety 2\n"
80 ,"set options.segmentsperedge 2\n"
81 ,"set options.meshsizefilename \"\"\n"
82 ,"set options.badellimit 175\n"
83 ,"set options.optsteps2d 3\n"
84 ,"set options.optsteps3d 5\n"
85 ,"set options.opterrpow 2\n"
86 ,"set options.grading 0.5\n"
87 ,"set options.printmsg 2\n"
88 ,"set options.parallel_meshing 1\n"
89 ,"set options.nthreads 4\n"
90 ,"set debug.slowchecks 0\n"
91 ,"set debug.debugoutput 0\n"
92 ,"set debug.haltexistingline 0\n"
93 ,"set debug.haltoverlap 0\n"
94 ,"set debug.haltsuccess 0\n"
95 ,"set debug.haltnosuccess 0\n"
96 ,"set debug.haltlargequalclass 0\n"
97 ,"set debug.haltsegment 0\n"
98 ,"set debug.haltnode 0\n"
99 ,"set debug.haltface 0\n"
100 ,"set debug.haltfacenr 0\n"
101 ,"set debug.haltsegmentp1 0\n"
102 ,"set debug.haltsegmentp2 0\n"
103 ,"set geooptions.drawcsg 1\n"
104 ,"set geooptions.detail 0.001\n"
105 ,"set geooptions.accuracy 1e-6\n"
106 ,"set geooptions.facets 20\n"
107 ,"set geooptions.minx -1000\n"
108 ,"set geooptions.miny -1000\n"
109 ,"set geooptions.minz -1000\n"
110 ,"set geooptions.maxx 1000\n"
111 ,"set geooptions.maxy 1000\n"
112 ,"set geooptions.maxz 1000\n"
113 ,"set viewqualityplot 0\n"
114 ,"set memuseplot 0\n"
115 ,"set viewrotatebutton 0\n"
116 ,"set showsensitivehelp 0\n"
117 ,"set showhelpline 0\n"
118 ,"set viewoptions.specpointvlen 0.3\n"
119 ,"set viewoptions.light.amb 0.3\n"
120 ,"set viewoptions.light.diff 0.7\n"
121 ,"set viewoptions.light.spec 1\n"
122 ,"set viewoptions.light.locviewer 0\n"
123 ,"set viewoptions.mat.shininess 50\n"
124 ,"set viewoptions.mat.transp 0.3\n"
125 ,"set viewoptions.colormeshsize 0\n"
126 ,"set viewoptions.whitebackground 1\n"
127 ,"set viewoptions.drawcoordinatecross 1\n"
128 ,"set viewoptions.drawcolorbar 1\n"
129 ,"set viewoptions.drawnetgenlogo 1\n"
130 ,"set viewoptions.stereo 0\n"
131 ,"set viewoptions.shrink 1\n"
132 ,"set viewoptions.drawfilledtrigs 1\n"
133 ,"set viewoptions.drawedges 0\n"
134 ,"set viewoptions.drawbadels 0\n"
135 ,"set viewoptions.centerpoint 0\n"
136 ,"set viewoptions.drawelement 0\n"
137 ,"set viewoptions.drawoutline 1\n"
138 ,"set viewoptions.drawtets 0\n"
139 ,"set viewoptions.drawtetsdomain 0\n"
140 ,"set viewoptions.drawprisms 0\n"
141 ,"set viewoptions.drawpyramids 0\n"
142 ,"set viewoptions.drawhexes 0\n"
143 ,"set viewoptions.drawidentified 0\n"
144 ,"set viewoptions.drawpointnumbers 0\n"
145 ,"set viewoptions.drawedgenumbers 0\n"
146 ,"set viewoptions.drawfacenumbers 0\n"
147 ,"set viewoptions.drawelementnumbers 0\n"
148 ,"set viewoptions.drawdomainsurf 0\n"
149 ,"set viewoptions.drawededges 1\n"
150 ,"set viewoptions.drawedpoints 1\n"
151 ,"set viewoptions.drawedpointnrs 0\n"
152 ,"set viewoptions.drawedtangents 0\n"
153 ,"set viewoptions.drawededgenrs 0\n"
154 ,"set viewoptions.drawmetispartition 0\n"
155 ,"set viewoptions.drawcurveproj 0\n"
156 ,"set viewoptions.drawcurveprojedge 1\n"
157 ,"set viewoptions.clipping.nx 0\n"
158 ,"set viewoptions.clipping.ny 1\n"
159 ,"set viewoptions.clipping.nz 0\n"
160 ,"set viewoptions.clipping.dist 0\n"
161 ,"set viewoptions.clipping.dist2 0\n"
162 ,"set viewoptions.clipping.enable 0\n"
163 ,"set viewoptions.clipping.onlydomain 0\n"
164 ,"set viewoptions.clipping.notdomain 0\n"
165 ,"set viewoptions.usecentercoords 0\n"
166 ,"set viewoptions.centerx 0\n"
167 ,"set viewoptions.centery 0\n"
168 ,"set viewoptions.centerz 0\n"
169 ,"set viewoptions.drawspecpoint 0\n"
170 ,"set viewoptions.specpointx 0\n"
171 ,"set viewoptions.specpointy 0\n"
172 ,"set viewoptions.specpointz 0\n"
173 ,"set stloptions.showtrias 0\n"
174 ,"set stloptions.showfilledtrias 1\n"
175 ,"set stloptions.showedges 1\n"
176 ,"set stloptions.showmarktrias 0\n"
177 ,"set stloptions.showactivechart 0\n"
178 ,"set stloptions.yangle 30\n"
179 ,"set stloptions.contyangle 20\n"
180 ,"set stloptions.edgecornerangle 60\n"
181 ,"set stloptions.chartangle 15\n"
182 ,"set stloptions.outerchartangle 70\n"
183 ,"set stloptions.usesearchtree 0\n"
184 ,"set stloptions.chartnumber 1\n"
185 ,"set stloptions.charttrignumber 1\n"
186 ,"set stloptions.chartnumberoffset 0\n"
187 ,"set stloptions.atlasminh 0.1\n"
188 ,"set stloptions.resthsurfcurvfac 2\n"
189 ,"set stloptions.resthsurfcurvenable 0\n"
190 ,"set stloptions.resthatlasfac 2\n"
191 ,"set stloptions.resthatlasenable 1\n"
192 ,"set stloptions.resthchartdistfac 1.2\n"
193 ,"set stloptions.resthchartdistenable 1\n"
194 ,"set stloptions.resthlinelengthfac 0.5\n"
195 ,"set stloptions.resthlinelengthenable 1\n"
196 ,"set stloptions.resthcloseedgefac 1\n"
197 ,"set stloptions.resthcloseedgeenable 1\n"
198 ,"set stloptions.resthminedgelen 0.01\n"
199 ,"set stloptions.resthminedgelenenable 1\n"
200 ,"set stloptions.resthedgeanglefac 1\n"
201 ,"set stloptions.resthedgeangleenable 0\n"
202 ,"set stloptions.resthsurfmeshcurvfac 1\n"
203 ,"set stloptions.resthsurfmeshcurvenable 0\n"
204 ,"set stloptions.recalchopt 1\n"
205 ,"set stldoctor.drawmeshededges 1\n"
206 ,"set stldoctor.geom_tol_fact 0.000001\n"
207 ,"set stldoctor.useexternaledges 0\n"
208 ,"set stldoctor.showfaces 0\n"
209 ,"set stldoctor.conecheck 1\n"
210 ,"set stldoctor.spiralcheck 1\n"
211 ,"set stldoctor.selecttrig 0\n"
212 ,"set stldoctor.selectmode 1\n"
213 ,"set stldoctor.longlinefact 0\n"
214 ,"set stldoctor.showexcluded 1\n"
215 ,"set stldoctor.edgeselectmode 0\n"
216 ,"set stldoctor.nodeofseltrig 1\n"
217 ,"set stldoctor.showtouchedtrigchart 0\n"
218 ,"set stldoctor.showedgecornerpoints 0\n"
219 ,"set stldoctor.showmarkedtrigs 1\n"
220 ,"set stldoctor.dirtytrigfact 0.01\n"
221 ,"set stldoctor.smoothangle 90\n"
222 ,"set stldoctor.selectwithmouse 1\n"
223 ,"set stldoctor.showvicinity 0\n"
224 ,"set stldoctor.vicinity 50\n"
225 ,"set stldoctor.smoothnormalsweight 0.2\n"
226 ,"set occoptions.showvolumenr 0\n"
227 ,"set occoptions.showsurfaces 1\n"
228 ,"set occoptions.showedges 1\n"
229 ,"set occoptions.showsolidnr 0\n"
230 ,"set occoptions.showsolidnr2 0\n"
231 ,"set occoptions.visproblemfaces 0\n"
232 ,"set occoptions.zoomtohighlightedentity 0\n"
233 ,"set occoptions.deflection 1\n"
234 ,"set occoptions.tolerance 1e-3\n"
235 ,"set occoptions.fixsmalledges 1\n"
236 ,"set occoptions.fixspotstripfaces 1\n"
237 ,"set occoptions.sewfaces 1\n"
238 ,"set occoptions.makesolids 1\n"
239 ,"set occoptions.splitpartitions 0\n"
240 ,"set meshdoctor.active 0\n"
241 ,"set meshdoctor.markedgedist 1\n"
242 ,"set status_np 0\n"
243 ,"set status_ne 0\n"
244 ,"set status_nse 0\n"
245 ,"set status_working \" \"\n"
246 ,"set status_task \" \"\n"
247 ,"set status_percent 0\n"
248 ,"set status_filename 0\n"
249 ,"set status_tetqualclasses \"10 20 30 40 10 20 30 40 10 20 30 40 10 20 30 40 10 20 30 40\"\n"
250 ,"set exportfiletype \"Neutral Format\"\n"
251 ,"set preproc.facenr 0\n"
252 ,"set preproc.selectmode query\n"
253 ,"set preproc.numtrig 0\n"
254 ,"set mem_moveable 0\n"
255 ,"set multithread_pause 0\n"
256 ,"set multithread_testmode 0\n"
257 ,"set multithread_redraw 0\n"
258 ,"set multithread_drawing 0\n"
259 ,"set multithread_terminate 0\n"
260 ,"set multithread_running 0\n"
261 ,"set level 0\n"
262 ,"set tablesforoutput {}\n"
263 ,"set optlist {\n"
264 ,"options.localh\n"
265 ,"options.delaunay\n"
266 ,"options.checkoverlap\n"
267 ,"options.startinsurface\n"
268 ,"options.blockfill\n"
269 ,"options.dooptimize\n"
270 ,"options.elsizeweight\n"
271 ,"options.meshsize\n"
272 ,"options.minmeshsize\n"
273 ,"options.curvaturesafety\n"
274 ,"options.optsteps2d\n"
275 ,"options.optsteps3d\n"
276 ,"options.secondorder\n"
277 ,"}\n"
278 ,"set visoptions.usetexture 1\n"
279 ,"set visoptions.invcolor 0\n"
280 ,"set visoptions.imaginary 0\n"
281 ,"set visoptions.lineartexture 0\n"
282 ,"set visoptions.numtexturecols 16\n"
283 ,"set visoptions.showclipsolution 1\n"
284 ,"set visoptions.showsurfacesolution 0\n"
285 ,"set visoptions.drawfieldlines 0\n"
286 ,"set visoptions.drawpointcurves 1\n"
287 ,"set visoptions.numfieldlines 100\n"
288 ,"set visoptions.fieldlinesrandomstart 0\n"
289 ,"set visoptions.fieldlinesstartarea box\n"
290 ,"set visoptions.fieldlinesstartareap1x 1\n"
291 ,"set visoptions.fieldlinesstartareap1y 1\n"
292 ,"set visoptions.fieldlinesstartareap1z 1\n"
293 ,"set visoptions.fieldlinesstartareap2x 0\n"
294 ,"set visoptions.fieldlinesstartareap2y 0\n"
295 ,"set visoptions.fieldlinesstartareap2z 0\n"
296 ,"set visoptions.fieldlinesstartface -1\n"
297 ,"set visoptions.fieldlinesfilename none\n"
298 ,"set visoptions.fieldlinestolerance 0.0005\n"
299 ,"set visoptions.fieldlinesrktype crungekutta\n"
300 ,"set visoptions.fieldlineslength 0.5\n"
301 ,"set visoptions.fieldlinesmaxpoints 500\n"
302 ,"set visoptions.fieldlinesthickness 0.0015\n"
303 ,"set visoptions.fieldlinesvecfunction none\n"
304 ,"set visoptions.fieldlinesphase 0\n"
305 ,"set visoptions.fieldlinesonlyonephase 1\n"
306 ,"set visoptions.lineplotfile empty\n"
307 ,"set visoptions.lineplotsource file\n"
308 ,"set visoptions.lineplotusingx 0\n"
309 ,"set visoptions.lineplotusingy 1\n"
310 ,"set visoptions.lineplotautoscale 1\n"
311 ,"set visoptions.lineplotxmin 0\n"
312 ,"set visoptions.lineplotxmax 1\n"
313 ,"set visoptions.lineplotymin 0\n"
314 ,"set visoptions.lineplotymax 1\n"
315 ,"set visoptions.lineplotcurrentnum -1\n"
316 ,"set visoptions.lineplotinfos \"\"\n"
317 ,"set visoptions.lineplotselected none\n"
318 ,"set visoptions.lineplotselector \"\"\n"
319 ,"set visoptions.lineplotcolor red\n"
320 ,"set visoptions.lineplotsizex 500\n"
321 ,"set visoptions.lineplotsizey 400\n"
322 ,"set visoptions.lineplotselectedeval 0\n"
323 ,"set visoptions.lineplotdatadescr \"column1 column2 column3\"\n"
324 ,"set visoptions.lineplotxcoordselector \"\"\n"
325 ,"set visoptions.lineplotycoordselector \"\"\n"
326 ,"set visoptions.evaluatefilenames none\n"
327 ,"set visoptions.evaluatefiledescriptions none\n"
328 ,"set visoptions.clipsolution none\n"
329 ,"set visoptions.scalfunction none\n"
330 ,"set visoptions.vecfunction none\n"
331 ,"set visoptions.evaluate abs\n"
332 ,"set visoptions.gridsize 20\n"
333 ,"set visoptions.xoffset 0\n"
334 ,"set visoptions.yoffset 0\n"
335 ,"set visoptions.autoscale 1\n"
336 ,"set visoptions.redrawperiodic 0\n"
337 ,"set visoptions.logscale 0\n"
338 ,"set visoptions.mminval 0\n"
339 ,"set visoptions.mmaxval 1\n"
340 ,"set visoptions.isolines 0\n"
341 ,"set visoptions.isosurf 0\n"
342 ,"set visoptions.subdivisions 1\n"
343 ,"set visoptions.numiso 10\n"
344 ,"set visoptions.autoredraw 0\n"
345 ,"set visoptions.autoredrawtime 2\n"
346 ,"set visoptions.simulationtime 0\n"
347 ,"set visoptions.multidimcomponent 0\n"
348 ,"set visoptions.deformation 0\n"
349 ,"set visoptions.scaledeform1 1\n"
350 ,"set visoptions.scaledeform2 1\n"
351 ,"set parallel_netgen 0\n"
352 ,"set optfilename [file join $nguserdir ng.opt]\n"
353 ,"set inifilename [file join $nguserdir ng.ini]\n"
354 ,"set meshinifilename [file join $nguserdir ngmesh.ini]\n"
355 ,"global env\n"
356 ,"if { [llength [array names env NG_OPT]] == 1 } {\n"
357 ,"if { [string length $env(NG_OPT)] > 0 } {\n"
358 ,"set optfilename $env(NG_OPT)\n"
359 ,"}\n"
360 ,"}\n"
361 ,"if { [file exists $optfilename] == 1 } {\n"
362 ,"set datei [open $optfilename r]\n"
363 ,"while { [gets $datei line] >= 0 } {\n"
364 ,"set [lindex $line 0] [lindex $line 1]\n"
365 ,"}\n"
366 ,"close $datei\n"
367 ,"} {\n"
368 ,"puts \"optfile $optfilename does not exist - using default values\"\n"
369 ,"}\n"
370 ,"proc saveoptions { } {\n"
371 ,"uplevel 1  {\n"
372 ,"set file $optfilename\n"
373 ,"if {$file != \"\"} {\n"
374 ,"set datei [open $file w]\n"
375 ,"puts $datei \"dirname  ${dirname}\"\n"
376 ,"puts $datei \"loadgeomtypevar  \\\"${loadgeomtypevar}\\\"\"\n"
377 ,"puts $datei \"exportfiletype  \\\"${exportfiletype}\\\"\"\n"
378 ,"puts $datei \"meshoptions.fineness  ${meshoptions.fineness}\"\n"
379 ,"puts $datei \"meshoptions.firststep ${meshoptions.firststep}\"\n"
380 ,"puts $datei \"meshoptions.laststep  ${meshoptions.laststep}\"\n"
381 ,"puts $datei \"options.localh  ${options.localh}\"\n"
382 ,"puts $datei \"options.delaunay  ${options.delaunay}\"\n"
383 ,"puts $datei \"options.checkoverlap  ${options.checkoverlap}\"\n"
384 ,"puts $datei \"options.checkchartboundary  ${options.checkchartboundary}\"\n"
385 ,"puts $datei \"options.startinsurface  ${options.startinsurface}\"\n"
386 ,"puts $datei \"options.blockfill  ${options.blockfill}\"\n"
387 ,"puts $datei \"options.debugmode  ${options.debugmode}\"\n"
388 ,"puts $datei \"options.dooptimize ${options.dooptimize}\"\n"
389 ,"puts $datei \"options.parthread  ${options.parthread}\"\n"
390 ,"puts $datei \"options.elsizeweight  ${options.elsizeweight}\"\n"
391 ,"puts $datei \"options.secondorder  ${options.secondorder}\"\n"
392 ,"puts $datei \"options.elementorder  ${options.elementorder}\"\n"
393 ,"puts $datei \"options.quad  ${options.quad}\"\n"
394 ,"puts $datei \"options.try_hexes  ${options.try_hexes}\"\n"
395 ,"puts $datei \"options.inverttets  ${options.inverttets}\"\n"
396 ,"puts $datei \"options.inverttrigs  ${options.inverttrigs}\"\n"
397 ,"puts $datei \"options.autozrefine ${options.autozrefine}\"\n"
398 ,"puts $datei \"options.meshsize  ${options.meshsize}\"\n"
399 ,"puts $datei \"options.minmeshsize  ${options.minmeshsize}\"\n"
400 ,"puts $datei \"options.curvaturesafety  ${options.curvaturesafety}\"\n"
401 ,"puts $datei \"options.segmentsperedge  ${options.segmentsperedge}\"\n"
402 ,"puts $datei \"options.meshsizefilename  ${options.meshsizefilename}\"\n"
403 ,"puts $datei \"options.badellimit  ${options.badellimit}\"\n"
404 ,"puts $datei \"options.optsteps2d  ${options.optsteps2d}\"\n"
405 ,"puts $datei \"options.optsteps3d  ${options.optsteps3d}\"\n"
406 ,"puts $datei \"options.opterrpow  ${options.opterrpow}\"\n"
407 ,"puts $datei \"options.grading  ${options.grading}\"\n"
408 ,"puts $datei \"options.printmsg  ${options.printmsg}\"\n"
409 ,"puts $datei \"options.parallel_meshing  ${options.parallel_meshing}\"\n"
410 ,"puts $datei \"options.nthreads  ${options.nthreads}\"\n"
411 ,"puts $datei \"geooptions.drawcsg  ${geooptions.drawcsg}\"\n"
412 ,"puts $datei \"geooptions.detail  ${geooptions.detail}\"\n"
413 ,"puts $datei \"geooptions.accuracy  ${geooptions.accuracy}\"\n"
414 ,"puts $datei \"geooptions.facets  ${geooptions.facets}\"\n"
415 ,"puts $datei \"geooptions.minx  ${geooptions.minx}\"\n"
416 ,"puts $datei \"geooptions.miny  ${geooptions.miny}\"\n"
417 ,"puts $datei \"geooptions.minz  ${geooptions.minz}\"\n"
418 ,"puts $datei \"geooptions.maxx  ${geooptions.maxx}\"\n"
419 ,"puts $datei \"geooptions.maxy  ${geooptions.maxy}\"\n"
420 ,"puts $datei \"geooptions.maxz  ${geooptions.maxz}\"\n"
421 ,"puts $datei \"viewoptions.specpointvlen  ${viewoptions.specpointvlen}\"\n"
422 ,"puts $datei \"viewoptions.light.amb  ${viewoptions.light.amb}\"\n"
423 ,"puts $datei \"viewoptions.light.diff ${viewoptions.light.diff}\"\n"
424 ,"puts $datei \"viewoptions.light.spec ${viewoptions.light.spec}\"\n"
425 ,"puts $datei \"viewoptions.light.locviewer ${viewoptions.light.locviewer}\"\n"
426 ,"puts $datei \"viewoptions.mat.shininess  ${viewoptions.mat.shininess}\"\n"
427 ,"puts $datei \"viewoptions.mat.transp  ${viewoptions.mat.transp}\"\n"
428 ,"puts $datei \"viewoptions.colormeshsize ${viewoptions.colormeshsize}\"\n"
429 ,"puts $datei \"viewoptions.whitebackground  ${viewoptions.whitebackground}\"\n"
430 ,"puts $datei \"viewoptions.drawcolorbar  ${viewoptions.drawcolorbar}\"\n"
431 ,"puts $datei \"viewoptions.drawcoordinatecross  ${viewoptions.drawcoordinatecross}\"\n"
432 ,"puts $datei \"viewoptions.drawnetgenlogo  ${viewoptions.drawnetgenlogo}\"\n"
433 ,"puts $datei \"viewoptions.stereo  ${viewoptions.stereo}\"\n"
434 ,"puts $datei \"viewoptions.drawfilledtrigs  ${viewoptions.drawfilledtrigs}\"\n"
435 ,"puts $datei \"viewoptions.drawedges  ${viewoptions.drawedges}\"\n"
436 ,"puts $datei \"viewoptions.drawbadels  ${viewoptions.drawbadels}\"\n"
437 ,"puts $datei \"viewoptions.centerpoint  ${viewoptions.centerpoint}\"\n"
438 ,"puts $datei \"viewoptions.drawelement  ${viewoptions.drawelement}\"\n"
439 ,"puts $datei \"viewoptions.drawoutline  ${viewoptions.drawoutline}\"\n"
440 ,"puts $datei \"viewoptions.drawtets  ${viewoptions.drawtets}\"\n"
441 ,"puts $datei \"viewoptions.drawprisms  ${viewoptions.drawprisms}\"\n"
442 ,"puts $datei \"viewoptions.drawpyramids  ${viewoptions.drawpyramids}\"\n"
443 ,"puts $datei \"viewoptions.drawhexes  ${viewoptions.drawhexes}\"\n"
444 ,"puts $datei \"viewoptions.drawidentified  ${viewoptions.drawidentified}\"\n"
445 ,"puts $datei \"viewoptions.drawpointnumbers  ${viewoptions.drawpointnumbers}\"\n"
446 ,"puts $datei \"viewoptions.drawededges  ${viewoptions.drawededges}\"\n"
447 ,"puts $datei \"viewoptions.drawedpoints  ${viewoptions.drawedpoints}\"\n"
448 ,"puts $datei \"viewoptions.drawedpointnrs  ${viewoptions.drawedpointnrs}\"\n"
449 ,"puts $datei \"viewoptions.drawedtangents  ${viewoptions.drawedtangents}\"\n"
450 ,"puts $datei \"viewoptions.shrink  ${viewoptions.shrink}\"\n"
451 ,"puts $datei \"stloptions.showtrias  ${stloptions.showtrias}\"\n"
452 ,"puts $datei \"stloptions.showfilledtrias  ${stloptions.showfilledtrias}\"\n"
453 ,"puts $datei \"stloptions.showedges  ${stloptions.showedges}\"\n"
454 ,"puts $datei \"stloptions.showmarktrias  ${stloptions.showmarktrias}\"\n"
455 ,"puts $datei \"stloptions.showactivechart  ${stloptions.showactivechart}\"\n"
456 ,"puts $datei \"stloptions.yangle  ${stloptions.yangle}\"\n"
457 ,"puts $datei \"stloptions.contyangle  ${stloptions.contyangle}\"\n"
458 ,"puts $datei \"stloptions.edgecornerangle  ${stloptions.edgecornerangle}\"\n"
459 ,"puts $datei \"stloptions.chartangle  ${stloptions.chartangle}\"\n"
460 ,"puts $datei \"stloptions.outerchartangle  ${stloptions.outerchartangle}\"\n"
461 ,"puts $datei \"stloptions.usesearchtree  ${stloptions.usesearchtree}\"\n"
462 ,"puts $datei \"stloptions.chartnumber  ${stloptions.chartnumber}\"\n"
463 ,"puts $datei \"stloptions.charttrignumber  ${stloptions.charttrignumber}\"\n"
464 ,"puts $datei \"stloptions.chartnumberoffset  ${stloptions.chartnumberoffset}\"\n"
465 ,"puts $datei \"stloptions.atlasminh  ${stloptions.atlasminh}\"\n"
466 ,"puts $datei \"stloptions.resthsurfcurvfac  ${stloptions.resthsurfcurvfac}\"\n"
467 ,"puts $datei \"stloptions.resthsurfcurvenable  ${stloptions.resthsurfcurvenable}\"\n"
468 ,"puts $datei \"stloptions.resthatlasfac  ${stloptions.resthatlasfac}\"\n"
469 ,"puts $datei \"stloptions.resthatlasenable  ${stloptions.resthatlasenable}\"\n"
470 ,"puts $datei \"stloptions.resthchartdistfac  ${stloptions.resthchartdistfac}\"\n"
471 ,"puts $datei \"stloptions.resthchartdistenable  ${stloptions.resthchartdistenable}\"\n"
472 ,"puts $datei \"stloptions.resthlinelengthfac  ${stloptions.resthlinelengthfac}\"\n"
473 ,"puts $datei \"stloptions.resthlinelengthenable  ${stloptions.resthlinelengthenable}\"\n"
474 ,"puts $datei \"stloptions.resthminedgelen ${stloptions.resthminedgelen}\"\n"
475 ,"puts $datei \"stloptions.resthminedgelenenable ${stloptions.resthminedgelenenable}\"\n"
476 ,"puts $datei \"stloptions.resthcloseedgefac  ${stloptions.resthcloseedgefac}\"\n"
477 ,"puts $datei \"stloptions.resthcloseedgeenable  ${stloptions.resthcloseedgeenable}\"\n"
478 ,"puts $datei \"stloptions.resthedgeanglefac  ${stloptions.resthedgeanglefac}\"\n"
479 ,"puts $datei \"stloptions.resthedgeangleenable  ${stloptions.resthedgeangleenable}\"\n"
480 ,"puts $datei \"stloptions.resthsurfmeshcurvfac  ${stloptions.resthsurfmeshcurvfac}\"\n"
481 ,"puts $datei \"stloptions.resthsurfmeshcurvenable  ${stloptions.resthsurfmeshcurvenable}\"\n"
482 ,"puts $datei \"stloptions.recalchopt  ${stloptions.recalchopt}\"\n"
483 ,"puts $datei \"visoptions.subdivisions ${visoptions.subdivisions}\"\n"
484 ,"puts $datei \"visoptions.autoredraw ${visoptions.autoredraw}\"\n"
485 ,"puts $datei \"visoptions.autoredrawtime ${visoptions.autoredrawtime}\"\n"
486 ,"if { [info exists trafooptions.solver] == 1 } {\n"
487 ,"puts $datei \"trafooptions.solver ${trafooptions.solver}\"\n"
488 ,"puts $datei \"trafooptions.levels ${trafooptions.levels}\"\n"
489 ,"puts $datei \"trafooptions.linits ${trafooptions.linits}\"\n"
490 ,"puts $datei \"trafooptions.nonlinits ${trafooptions.nonlinits}\"\n"
491 ,"puts $datei \"trafooptions.stabcurrent ${trafooptions.stabcurrent}\"\n"
492 ,"puts $datei \"trafooptions.checkcond ${trafooptions.checkcond}\"\n"
493 ,"puts $datei \"trafooptions.maxdirect ${trafooptions.maxdirect}\"\n"
494 ,"puts $datei \"trafooptions.secondorder ${trafooptions.secondorder}\"\n"
495 ,"puts $datei \"trafooptions.homogenizedcore ${trafooptions.homogenizedcore}\"\n"
496 ,"puts $datei \"trafooptions.ordercore ${trafooptions.ordercore}\"\n"
497 ,"puts $datei \"trafooptions.simplecurrents ${trafooptions.simplecurrents}\"\n"
498 ,"puts $datei \"trafooptions.assemblecomplexmatrix ${trafooptions.assemblecomplexmatrix}\"\n"
499 ,"puts $datei \"trafooptions.meshcasing  ${trafooptions.meshcasing}\"\n"
500 ,"puts $datei \"trafooptions.meshcore    ${trafooptions.meshcore}\"\n"
501 ,"puts $datei \"trafooptions.meshclumps  ${trafooptions.meshclumps}\"\n"
502 ,"puts $datei \"trafooptions.meshshields ${trafooptions.meshshields}\"\n"
503 ,"puts $datei \"trafooptions.meshcoils   ${trafooptions.meshcoils}\"\n"
504 ,"puts $datei \"trafooptions.bcmdirectory  ${trafooptions.bcmdirectory}\"\n"
505 ,"puts $datei \"trafooptions.lossdensityfile  ${trafooptions.lossdensityfile}\"\n"
506 ,"}\n"
507 ,"if { [info exists smalltrafomodell.tankheight] == 1 } {\n"
508 ,"puts $datei \"smalltrafomodell.tankheight ${smalltrafomodell.tankheight}\"\n"
509 ,"puts $datei \"smalltrafomodell.tankwidth ${smalltrafomodell.tankwidth}\"\n"
510 ,"puts $datei \"smalltrafomodell.tanklength ${smalltrafomodell.tanklength}\"\n"
511 ,"puts $datei \"smalltrafomodell.corewidth ${smalltrafomodell.corewidth}\"\n"
512 ,"puts $datei \"smalltrafomodell.windowheight ${smalltrafomodell.windowheight}\"\n"
513 ,"puts $datei \"smalltrafomodell.limbdistance ${smalltrafomodell.limbdistance}\"\n"
514 ,"puts $datei \"smalltrafomodell.xposcore ${smalltrafomodell.xposcore}\"\n"
515 ,"puts $datei \"smalltrafomodell.yposcore ${smalltrafomodell.yposcore}\"\n"
516 ,"puts $datei \"smalltrafomodell.zposcore ${smalltrafomodell.zposcore}\"\n"
517 ,"puts $datei \"smalltrafomodell.leakagefluxguidethickness ${smalltrafomodell.leakagefluxguidethickness}\"\n"
518 ,"puts $datei \"smalltrafomodell.leakagefluxguidewidth ${smalltrafomodell.leakagefluxguidewidth}\"\n"
519 ,"puts $datei \"smalltrafomodell.leakagefluxguidezposition ${smalltrafomodell.leakagefluxguidezposition}\"\n"
520 ,"puts $datei \"smalltrafomodell.limbcoil.1 ${smalltrafomodell.limbcoil.1}\"\n"
521 ,"puts $datei \"smalltrafomodell.ricoil.1 ${smalltrafomodell.ricoil.1}\"\n"
522 ,"puts $datei \"smalltrafomodell.rocoil.1 ${smalltrafomodell.rocoil.1}\"\n"
523 ,"puts $datei \"smalltrafomodell.zposcoil.1 ${smalltrafomodell.zposcoil.1}\"\n"
524 ,"puts $datei \"smalltrafomodell.heightcoil.1 ${smalltrafomodell.heightcoil.1}\"\n"
525 ,"puts $datei \"smalltrafomodell.currentcoil.1 ${smalltrafomodell.currentcoil.1}\"\n"
526 ,"puts $datei \"smalltrafomodell.nturnscoil.1 ${smalltrafomodell.nturnscoil.1}\"\n"
527 ,"puts $datei \"smalltrafomodell.limbcoil.2 ${smalltrafomodell.limbcoil.2}\"\n"
528 ,"puts $datei \"smalltrafomodell.ricoil.2 ${smalltrafomodell.ricoil.2}\"\n"
529 ,"puts $datei \"smalltrafomodell.rocoil.2 ${smalltrafomodell.rocoil.2}\"\n"
530 ,"puts $datei \"smalltrafomodell.zposcoil.2 ${smalltrafomodell.zposcoil.2}\"\n"
531 ,"puts $datei \"smalltrafomodell.heightcoil.2 ${smalltrafomodell.heightcoil.2}\"\n"
532 ,"puts $datei \"smalltrafomodell.currentcoil.2 ${smalltrafomodell.currentcoil.2}\"\n"
533 ,"puts $datei \"smalltrafomodell.nturnscoil.2 ${smalltrafomodell.nturnscoil.2}\"\n"
534 ,"puts $datei \"smalltrafomodell.limbcoil.3 ${smalltrafomodell.limbcoil.3}\"\n"
535 ,"puts $datei \"smalltrafomodell.ricoil.3 ${smalltrafomodell.ricoil.3}\"\n"
536 ,"puts $datei \"smalltrafomodell.rocoil.3 ${smalltrafomodell.rocoil.3}\"\n"
537 ,"puts $datei \"smalltrafomodell.zposcoil.3 ${smalltrafomodell.zposcoil.3}\"\n"
538 ,"puts $datei \"smalltrafomodell.heightcoil.3 ${smalltrafomodell.heightcoil.3}\"\n"
539 ,"puts $datei \"smalltrafomodell.currentcoil.3 ${smalltrafomodell.currentcoil.3}\"\n"
540 ,"puts $datei \"smalltrafomodell.nturnscoil.3 ${smalltrafomodell.nturnscoil.3}\"\n"
541 ,"puts $datei \"smalltrafomodell.limbcoil.4 ${smalltrafomodell.limbcoil.4}\"\n"
542 ,"puts $datei \"smalltrafomodell.ricoil.4 ${smalltrafomodell.ricoil.4}\"\n"
543 ,"puts $datei \"smalltrafomodell.rocoil.4 ${smalltrafomodell.rocoil.4}\"\n"
544 ,"puts $datei \"smalltrafomodell.zposcoil.4 ${smalltrafomodell.zposcoil.4}\"\n"
545 ,"puts $datei \"smalltrafomodell.heightcoil.4 ${smalltrafomodell.heightcoil.4}\"\n"
546 ,"puts $datei \"smalltrafomodell.currentcoil.4 ${smalltrafomodell.currentcoil.4}\"\n"
547 ,"puts $datei \"smalltrafomodell.nturnscoil.4 ${smalltrafomodell.nturnscoil.4}\"\n"
548 ,"puts $datei \"smalltrafomodell.limbcoil.5 ${smalltrafomodell.limbcoil.5}\"\n"
549 ,"puts $datei \"smalltrafomodell.ricoil.5 ${smalltrafomodell.ricoil.5}\"\n"
550 ,"puts $datei \"smalltrafomodell.rocoil.5 ${smalltrafomodell.rocoil.5}\"\n"
551 ,"puts $datei \"smalltrafomodell.zposcoil.5 ${smalltrafomodell.zposcoil.5}\"\n"
552 ,"puts $datei \"smalltrafomodell.heightcoil.5 ${smalltrafomodell.heightcoil.5}\"\n"
553 ,"puts $datei \"smalltrafomodell.currentcoil.5 ${smalltrafomodell.currentcoil.5}\"\n"
554 ,"puts $datei \"smalltrafomodell.nturnscoil.5 ${smalltrafomodell.nturnscoil.5}\"\n"
555 ,"puts $datei \"smalltrafomodell.limbcoil.6 ${smalltrafomodell.limbcoil.6}\"\n"
556 ,"puts $datei \"smalltrafomodell.ricoil.6 ${smalltrafomodell.ricoil.6}\"\n"
557 ,"puts $datei \"smalltrafomodell.rocoil.6 ${smalltrafomodell.rocoil.6}\"\n"
558 ,"puts $datei \"smalltrafomodell.zposcoil.6 ${smalltrafomodell.zposcoil.6}\"\n"
559 ,"puts $datei \"smalltrafomodell.heightcoil.6 ${smalltrafomodell.heightcoil.6}\"\n"
560 ,"puts $datei \"smalltrafomodell.currentcoil.6 ${smalltrafomodell.currentcoil.6}\"\n"
561 ,"puts $datei \"smalltrafomodell.nturnscoil.6 ${smalltrafomodell.nturnscoil.6}\"\n"
562 ,"puts $datei \"smalltrafomodell.limbtest.1 ${smalltrafomodell.limbtest.1}\"\n"
563 ,"puts $datei \"smalltrafomodell.heighttest.1 ${smalltrafomodell.heighttest.1}\"\n"
564 ,"puts $datei \"smalltrafomodell.widthtest.1 ${smalltrafomodell.widthtest.1}\"\n"
565 ,"puts $datei \"smalltrafomodell.rtest.1 ${smalltrafomodell.rtest.1}\"\n"
566 ,"puts $datei \"smalltrafomodell.zpostest.1 ${smalltrafomodell.zpostest.1}\"\n"
567 ,"puts $datei \"smalltrafomodell.edgeradiustest.1 ${smalltrafomodell.edgeradiustest.1}\"\n"
568 ,"puts $datei \"smalltrafomodell.finetest.1 ${smalltrafomodell.finetest.1}\"\n"
569 ,"puts $datei \"smalltrafomodell.conductivetest.1 ${smalltrafomodell.conductivetest.1}\"\n"
570 ,"puts $datei \"smalltrafomodell.limbtest.2 ${smalltrafomodell.limbtest.2}\"\n"
571 ,"puts $datei \"smalltrafomodell.heighttest.2 ${smalltrafomodell.heighttest.2}\"\n"
572 ,"puts $datei \"smalltrafomodell.widthtest.2 ${smalltrafomodell.widthtest.2}\"\n"
573 ,"puts $datei \"smalltrafomodell.rtest.2 ${smalltrafomodell.rtest.2}\"\n"
574 ,"puts $datei \"smalltrafomodell.zpostest.2 ${smalltrafomodell.zpostest.2}\"\n"
575 ,"puts $datei \"smalltrafomodell.edgeradiustest.2 ${smalltrafomodell.edgeradiustest.2}\"\n"
576 ,"puts $datei \"smalltrafomodell.finetest.2 ${smalltrafomodell.finetest.2}\"\n"
577 ,"puts $datei \"smalltrafomodell.conductivetest.2 ${smalltrafomodell.conductivetest.2}\"\n"
578 ,"puts $datei \"smalltrafomodell.limbtest.3 ${smalltrafomodell.limbtest.3}\"\n"
579 ,"puts $datei \"smalltrafomodell.heighttest.3 ${smalltrafomodell.heighttest.3}\"\n"
580 ,"puts $datei \"smalltrafomodell.widthtest.3 ${smalltrafomodell.widthtest.3}\"\n"
581 ,"puts $datei \"smalltrafomodell.rtest.3 ${smalltrafomodell.rtest.3}\"\n"
582 ,"puts $datei \"smalltrafomodell.zpostest.3 ${smalltrafomodell.zpostest.3}\"\n"
583 ,"puts $datei \"smalltrafomodell.edgeradiustest.3 ${smalltrafomodell.edgeradiustest.3}\"\n"
584 ,"puts $datei \"smalltrafomodell.finetest.3 ${smalltrafomodell.finetest.3}\"\n"
585 ,"puts $datei \"smalltrafomodell.conductivetest.3 ${smalltrafomodell.conductivetest.3}\"\n"
586 ,"puts $datei \"smalltrafomodell.limbtest.4 ${smalltrafomodell.limbtest.4}\"\n"
587 ,"puts $datei \"smalltrafomodell.heighttest.4 ${smalltrafomodell.heighttest.4}\"\n"
588 ,"puts $datei \"smalltrafomodell.widthtest.4 ${smalltrafomodell.widthtest.4}\"\n"
589 ,"puts $datei \"smalltrafomodell.rtest.4 ${smalltrafomodell.rtest.4}\"\n"
590 ,"puts $datei \"smalltrafomodell.zpostest.4 ${smalltrafomodell.zpostest.4}\"\n"
591 ,"puts $datei \"smalltrafomodell.edgeradiustest.4 ${smalltrafomodell.edgeradiustest.4}\"\n"
592 ,"puts $datei \"smalltrafomodell.finetest.4 ${smalltrafomodell.finetest.4}\"\n"
593 ,"puts $datei \"smalltrafomodell.conductivetest.4 ${smalltrafomodell.conductivetest.4}\"\n"
594 ,"puts $datei \"smalltrafomodell.nperitest ${smalltrafomodell.nperitest}\"\n"
595 ,"puts $datei \"smalltrafomodell.filename ${smalltrafomodell.filename}\"\n"
596 ,"puts $datei \"smalltrafomodell.murlfguide ${smalltrafomodell.murlfguide}\"\n"
597 ,"puts $datei \"smalltrafomodell.murtestwire ${smalltrafomodell.murtestwire}\"\n"
598 ,"puts $datei \"smalltrafomodell.murcore ${smalltrafomodell.murcore}\"\n"
599 ,"puts $datei \"smalltrafomodell.kappalfguide ${smalltrafomodell.kappalfguide}\"\n"
600 ,"puts $datei \"smalltrafomodell.kappatestwire ${smalltrafomodell.kappatestwire}\"\n"
601 ,"puts $datei \"smalltrafomodell.kappacore ${smalltrafomodell.kappacore}\"\n"
602 ,"}\n"
603 ,"close $datei\n"
604 ,"}\n"
605 ,"}\n"
606 ,"}\n"
607 ,"proc saveinifile { } {\n"
608 ,"global inifilename\n"
609 ,"if {[catch { set datei [open $inifilename w] } result ]} {\n"
610 ,"puts \"cannot write file $inifilename\"\n"
611 ,"} {\n"
612 ,"for { set i [.ngmenu.file.recent index last] } { $i >= 0 } { incr i -1 } {\n"
613 ,"puts $datei \"recentfile \\\"[.ngmenu.file.recent entrycget $i -label]\\\"\"\n"
614 ,"}\n"
615 ,"close $datei\n"
616 ,"}\n"
617 ,"}\n"
618 ,"proc savemeshinifile { } {\n"
619 ,"global meshinifilename\n"
620 ,"if {[catch { set datei [open $meshinifilename w] } result ]} {\n"
621 ,"puts \"cannot write file $meshinifilename\"\n"
622 ,"} {\n"
623 ,"for { set i [.ngmenu.file.recentmesh index last] } { $i >= 1 } { incr i -1 } {\n"
624 ,"puts $datei \"recentfile \\\"[.ngmenu.file.recentmesh entrycget $i -label]\\\"\"\n"
625 ,"}\n"
626 ,"close $datei\n"
627 ,"}\n"
628 ,"}\n"
629 ,"proc loadinifile { } {\n"
630 ,"global inifilename\n"
631 ,"if { [file exists $inifilename] == 1 } {\n"
632 ,"set datei [open $inifilename r]\n"
633 ,"while { [gets $datei line] >= 0 } {\n"
634 ,"if {[lindex $line 0] == \"recentfile\"} {\n"
635 ,"set filename [lindex $line 1]\n"
636 ,"if { [file exists $filename] == 1 } {\n"
637 ,"AddRecentFile $filename\n"
638 ,"}\n"
639 ,"}\n"
640 ,"}\n"
641 ,"close $datei\n"
642 ,"}\n"
643 ,"}\n"
644 ,"proc loadmeshinifile { } {\n"
645 ,"global meshinifilename\n"
646 ,"if { [file exists $meshinifilename] == 1 } {\n"
647 ,"set datei [open $meshinifilename r]\n"
648 ,"while { [gets $datei line] >= 0 } {\n"
649 ,"if {[lindex $line 0] == \"recentfile\"} {\n"
650 ,"set filename [lindex $line 1]\n"
651 ,"if { [file exists $filename] == 1 } {\n"
652 ,"AddRecentMeshFile $filename\n"
653 ,"}\n"
654 ,"}\n"
655 ,"}\n"
656 ,"close $datei\n"
657 ,"}\n"
658 ,"}\n"
659 ,"set cmdindex {}\n"
660 ,"set hlpindex {}\n"
661 ,"set secindex {}\n"
662 ,"proc setgranularity { gran } {\n"
663 ,"if {$gran == 6} { return }\n"
664 ,"set gran [expr $gran - 1]\n"
665 ,"global options.curvaturesafety\n"
666 ,"set surfcurvlist { 1 1.5 2 3 5 }\n"
667 ,"set options.curvaturesafety [lindex $surfcurvlist $gran]\n"
668 ,"global options.segmentsperedge\n"
669 ,"set spelist { 0.3 0.5 1 2 3 }\n"
670 ,"set options.segmentsperedge [lindex $spelist $gran]\n"
671 ,"global stloptions.resthsurfcurvfac\n"
672 ,"set surfcurvfaclist { 0.25 0.5 1 1.5 3 }\n"
673 ,"set stloptions.resthsurfcurvfac [lindex $surfcurvfaclist $gran]\n"
674 ,"global stloptions.resthchartdistfac\n"
675 ,"set chartdistfaclist { 0.8 1 1.5 2 5 }\n"
676 ,"set stloptions.resthchartdistfac [lindex $chartdistfaclist $gran]\n"
677 ,"global stloptions.resthlinelengthfac\n"
678 ,"set linelengthfaclist { 0.2 0.35 0.5 1.5 3 }\n"
679 ,"set stloptions.resthlinelengthfac [lindex $linelengthfaclist $gran]\n"
680 ,"global stloptions.resthcloseedgefac\n"
681 ,"set closeedgefaclist { 0.5 1 2 3.5 5 }\n"
682 ,"set stloptions.resthcloseedgefac [lindex $closeedgefaclist $gran]\n"
683 ,"global stloptions.resthminedgelen\n"
684 ,"set minedgelenlist { 0.002 0.02 0.2 1.0 2.0 5.0 10.0 }\n"
685 ,"set stloptions.resthminedgelen [lindex $minedgelenlist $gran]\n"
686 ,"global stloptions.resthedgeanglefac\n"
687 ,"set edgeanglefaclist { 0.25 0.5 1 1.5 3 }\n"
688 ,"set stloptions.resthedgeanglefac [lindex $edgeanglefaclist $gran]\n"
689 ,"global stloptions.resthsurfmeshcurvfac\n"
690 ,"set surfmeshcurvlist { 1 1.5 2 3 5 }\n"
691 ,"set stloptions.resthsurfmeshcurvfac [lindex $surfmeshcurvlist $gran]\n"
692 ,"global options.grading\n"
693 ,"set gradinglist { 0.7 0.5 0.3 0.2 0.1 }\n"
694 ,"set options.grading [lindex $gradinglist $gran]\n"
695 ,"}\n"
696 ,"if { $batchmode != \"defined\" } {\n"
697 ,"catch {\n"
698 ,"if { $tcl_platform(os) eq \"Linux\" && [tk scaling] > 1.5 } {\n"
699 ,"font create ngFont -family Helvetica\n"
700 ,"option add *font ngFont\n"
701 ,"ttk::style configure \".\" -font ngFont\n"
702 ,"}\n"
703 ,"menu .ngmenu -tearoff 0  -relief raised -bd 2\n"
704 ,". configure -menu .ngmenu\n"
705 ,".ngmenu add cascade -label \"File\" -menu .ngmenu.file -underline 0\n"
706 ,".ngmenu add cascade -label \"Geometry\" -menu .ngmenu.geometry -underline 0\n"
707 ,".ngmenu add cascade -label \"Mesh\" -menu .ngmenu.mesh -underline 0\n"
708 ,".ngmenu add cascade -label \"View\" -menu .ngmenu.view -underline 0\n"
709 ,".ngmenu add cascade -label \"Refinement\" -menu .ngmenu.meshsize -underline 5\n"
710 ,"if { $userlevel == 3} {\n"
711 ,".ngmenu add cascade -label \"Special\" -menu .ngmenu.special -underline 3\n"
712 ,"}\n"
713 ,".ngmenu add cascade -label \"Help\" -menu .ngmenu.help -underline 0\n"
714 ,"menu .ngmenu.file\n"
715 ,".ngmenu.file add command -label \"Load Geometry...\" -accelerator \"<l><g>\" \\\n"
716 ,"-command {\n"
717 ,"set types {\n"
718 ,"{\"All Geometry types\"   { .stl .stlb .step .stp .geo .in2d .igs .iges .brep .sat} }\n"
719 ,"{\"IGES Geometry\"	{.igs .iges} }\n"
720 ,"{\"BREP OpenCascade Geometry\"    {.brep} }\n"
721 ,"{\"STL Geometry\"        {.stl} }\n"
722 ,"{\"Binary STL Geometry\"    {.stlb} }\n"
723 ,"{\"STEP Geometry\"    {.step .stp} }\n"
724 ,"{\"Geometry file\"       {.geo} }\n"
725 ,"{\"2D Geometry\"   {.in2d } }\n"
726 ,"}\n"
727 ,"set ACISavailable [Ng_ACISCommand isACISavailable]\n"
728 ,"if {$ACISavailable == \"yes\" } {\n"
729 ,"lappend types {\"ACIS Geometry\" {.sat} }\n"
730 ,"}\n"
731 ,"if {[catch {\n"
732 ,"set file [tk_getOpenFile -filetypes $types -initialdir $dirname -typevariable loadgeomtypevar]\n"
733 ,"}]} {\n"
734 ,"set file [tk_getOpenFile -filetypes $types -initialdir $dirname]\n"
735 ,"}\n"
736 ,"if {$file != \"\"} {\n"
737 ,"AddRecentFile $file\n"
738 ,"Ng_LoadGeometry $file\n"
739 ,"Ng_ParseGeometry\n"
740 ,"set selectvisual geometry\n"
741 ,"Ng_SetVisParameters\n"
742 ,"redraw\n"
743 ,"wm title . [concat \"$progname - \" $file]\n"
744 ,"set dirname [file dirname $file]\n"
745 ,"set basefilename [file tail [file rootname $file]]\n"
746 ,"if { $hasocc == \"yes\" } {\n"
747 ,"rebuildoccdialog\n"
748 ,"}\n"
749 ,"}\n"
750 ,"}\n"
751 ,".ngmenu.file add command -label \"Save Geometry...\" \\\n"
752 ,"-command {\n"
753 ,"set occgeometryloaded [Ng_OCCCommand isoccgeometryloaded]\n"
754 ,"puts $occgeometryloaded\n"
755 ,"if {$occgeometryloaded == 1 } {\n"
756 ,"set types {\n"
757 ,"{\"IGES Geometry file\"   {.igs} }\n"
758 ,"{\"STEP Geometry file\"   {.stp} }\n"
759 ,"{\"STL Geometry file\"   {.stl} }\n"
760 ,"{\"STL BIN Geometry file\"   {.stlb} }\n"
761 ,"}\n"
762 ,"} {\n"
763 ,"set types {\n"
764 ,"{\"STL Geometry file\"   {.stl} }\n"
765 ,"{\"STL BIN Geometry file\"   {.stlb} }\n"
766 ,"}\n"
767 ,"}\n"
768 ,"set ACISavailable [Ng_ACISCommand isACISavailable]\n"
769 ,"puts $ACISavailable\n"
770 ,"if {$ACISavailable == \"yes\" } {\n"
771 ,"lappend types {\"ACIS Geometry\" {.sat} }\n"
772 ,"}\n"
773 ,"set file [tk_getSaveFile -filetypes $types -initialdir $dirname -initialfile $basefilename ]\n"
774 ,"if {$file != \"\"} {\n"
775 ,"Ng_SaveGeometry $file\n"
776 ,"}\n"
777 ,"}\n"
778 ,".ngmenu.file add cascade -label \"Recent Files\" -menu .ngmenu.file.recent\n"
779 ,"menu .ngmenu.file.recent -tearoff 0\n"
780 ,"proc AddRecentFile { filename } {\n"
781 ,"global progname\n"
782 ,"global dirname\n"
783 ,"catch { [.ngmenu.file.recent delete $filename] }\n"
784 ,".ngmenu.file.recent insert 0 command -label $filename \\\n"
785 ,"-command \"AddRecentFile {$filename};\n"
786 ,"Ng_LoadGeometry {$filename};\n"
787 ,"Ng_ParseGeometry;\n"
788 ,"set selectvisual geometry;\n"
789 ,"Ng_SetVisParameters;\n"
790 ,"redraw;\n"
791 ,"wm title . [concat \\\" $progname - $filename \\\"];\n"
792 ,"set dirname {[file dirname $filename]};\n"
793 ,"set basefilename {[file tail [file rootname $filename]]};\n"
794 ,"rebuildoccdialog;\"\n"
795 ,"if { [.ngmenu.file.recent index last] >= 6 } {\n"
796 ,".ngmenu.file.recent delete last }\n"
797 ,"saveinifile;\n"
798 ,"}\n"
799 ,"loadinifile;\n"
800 ,".ngmenu.file add separator\n"
801 ,".ngmenu.file add command -label \"Load Mesh...\" -accelerator \"<l><m>\" \\\n"
802 ,"-command {\n"
803 ,"set types {\n"
804 ,"{\"Mesh file\"   {.vol .vol.gz}	} }\n"
805 ,"set file [tk_getOpenFile -filetypes $types -defaultextension \".vol\"]\n"
806 ,"if {$file != \"\"} {\n"
807 ,"AddRecentMeshFile $file;\n"
808 ,"Ng_LoadMesh $file;\n"
809 ,"set selectvisual mesh\n"
810 ,"Ng_SetVisParameters\n"
811 ,"redraw\n"
812 ,"Ng_ReadStatus;\n"
813 ,"wm title . [concat \"$progname - \" $file]\n"
814 ,"set dirname [file dirname $file]\n"
815 ,"set basefilename [file tail [file rootname $file]]\n"
816 ,"}\n"
817 ,"}\n"
818 ,".ngmenu.file add cascade -label \"Recent Meshes\" -menu .ngmenu.file.recentmesh\n"
819 ,"menu .ngmenu.file.recentmesh\n"
820 ,"proc AddRecentMeshFile { filename } {\n"
821 ,"global progname\n"
822 ,"global dirname\n"
823 ,"catch { [.ngmenu.file.recentmesh delete $filename] }\n"
824 ,".ngmenu.file.recentmesh insert 0 command -label $filename \\\n"
825 ,"-command \"AddRecentMeshFile {$filename};\n"
826 ,"Ng_LoadMesh {$filename};\n"
827 ,"set selectvisual mesh;\n"
828 ,"Ng_SetVisParameters;\n"
829 ,"redraw;\n"
830 ,"wm title . [concat \\\" $progname - $filename \\\"];\n"
831 ,"set dirname {[file dirname $filename]};\n"
832 ,"set basefilename {[file tail [file rootname $filename]]};\n"
833 ,"rebuildoccdialog;\"\n"
834 ,"if { [.ngmenu.file.recentmesh index last] >= 6 } {\n"
835 ,".ngmenu.file.recentmesh delete last }\n"
836 ,"savemeshinifile;\n"
837 ,"}\n"
838 ,"loadmeshinifile;\n"
839 ,".ngmenu.file add command -label \"Save Mesh...\" -accelerator \"<s><m>\" \\\n"
840 ,"-command {\n"
841 ,"set types {\n"
842 ,"{\"Mesh file\"   {.vol .vol.gz}	} }\n"
843 ,"set file [tk_getSaveFile -filetypes $types -defaultextension \".vol.gz\" -initialfile $basefilename -initialdir $dirname ]\n"
844 ,"if {$file != \"\"} {\n"
845 ,"Ng_SaveMesh $file }\n"
846 ,"AddRecentMeshFile $file;\n"
847 ,"}\n"
848 ,".ngmenu.file add command -label \"Merge Mesh...\" \\\n"
849 ,"-command {\n"
850 ,"set types {\n"
851 ,"{\"Mesh file\"   {.vol}	} }\n"
852 ,"set file [tk_getOpenFile -filetypes $types -defaultextension \".vol\"]\n"
853 ,"if {$file != \"\"} {\n"
854 ,"Ng_MergeMesh $file;\n"
855 ,"set selectvisual mesh\n"
856 ,"Ng_SetVisParameters\n"
857 ,"redraw\n"
858 ,"Ng_ReadStatus;\n"
859 ,"}\n"
860 ,"}\n"
861 ,".ngmenu.file add command -label \"Import Mesh...\" \\\n"
862 ,"-command {\n"
863 ,"set types {\n"
864 ,"{\"Neutral format\"  {.mesh .emt} }\n"
865 ,"{\"Surface mesh format\"  {.surf} }\n"
866 ,"{\"Universal format\"  {.unv} }\n"
867 ,"{\"Olaf format\"  {.emt} }\n"
868 ,"{\"TET format\" {.tet} }\n"
869 ,"{\"STL format\" {.stl .stlb} }\n"
870 ,"{\"Pro/ENGINEER neutral format\" {.fnf} }\n"
871 ,"{\"CFD General Notation System\" {.cgns} }\n"
872 ,"}\n"
873 ,"set file [tk_getOpenFile -filetypes $types ]\n"
874 ,"if {$file != \"\"} {\n"
875 ,"Ng_ImportMesh $file\n"
876 ,"set selectvisual mesh\n"
877 ,"Ng_SetVisParameters\n"
878 ,"redraw\n"
879 ,"Ng_ReadStatus;\n"
880 ,"}\n"
881 ,"}\n"
882 ,"set meshexportformats [Ng_GetExportFormats]\n"
883 ,".ngmenu.file add command -label \"Export Mesh...\" \\\n"
884 ,"-command {\n"
885 ,"foreach exportformat $meshexportformats {\n"
886 ,"if { [lindex $exportformat 0] == $exportfiletype } {\n"
887 ,"set extension [lindex $exportformat 1]\n"
888 ,"}\n"
889 ,"}\n"
890 ,"if { $exportfiletype == \"Elmer Format\"} {\n"
891 ,"set file [file nativename [tk_chooseDirectory -title \"Elmer Mesh Export - Select Directory\"]]\n"
892 ,"} elseif { $exportfiletype == \"OpenFOAM 1.5+ Format\"} {\n"
893 ,"set file [file nativename [tk_chooseDirectory -title \"OpenFOAM 1.5+ Mesh Export - Select Case Directory\"]]\n"
894 ,"} elseif { $exportfiletype == \"OpenFOAM 1.5+ Compressed\"} {\n"
895 ,"set file [file nativename [tk_chooseDirectory -title \"OpenFOAM 1.5+ Mesh Export - Select Case Directory\"]]\n"
896 ,"} else {\n"
897 ,"set file [tk_getSaveFile  -filetypes $meshexportformats -typevariable exportfiletype]\n"
898 ,"puts \"type = $exportfiletype\"\n"
899 ,"puts \"filename = $file\"\n"
900 ,"}\n"
901 ,"if {$file != \"\"} {\n"
902 ,"Ng_ExportMesh $file $exportfiletype\n"
903 ,"}\n"
904 ,"}\n"
905 ,".ngmenu.file add cascade -label \"Export Filetype\" -menu .ngmenu.file.filetype\n"
906 ,"menu .ngmenu.file.filetype\n"
907 ,"foreach exportformat $meshexportformats {\n"
908 ,".ngmenu.file.filetype add radio -label [lindex $exportformat 0] -variable exportfiletype -command { .ngmenu.file invoke \"Export Mesh...\" }\n"
909 ,"}\n"
910 ,".ngmenu.file add separator\n"
911 ,".ngmenu.file add command -label \"Save Solution...\" \\\n"
912 ,"-command {\n"
913 ,"set types {\n"
914 ,"{\"Solution File\"  {.sol} }\n"
915 ,"{\"VTK File\"  {.vtk} }\n"
916 ,"}\n"
917 ,"set file [tk_getSaveFile -filetypes $types ]\n"
918 ,"if {$file != \"\"} {\n"
919 ,"Ng_SaveSolution $file\n"
920 ,"}\n"
921 ,"}\n"
922 ,".ngmenu.file add command -label \"Import Solution...\" \\\n"
923 ,"-command {\n"
924 ,"set types { {\"Solution File\"  {.sol} } }\n"
925 ,"set file [tk_getOpenFile -filetypes $types -defaultextension \".sol\"  ]\n"
926 ,"if {$file != \"\"} {\n"
927 ,"Ng_ImportSolution $file\n"
928 ,"set selectvisual solution\n"
929 ,"Ng_SetVisParameters\n"
930 ,"redraw\n"
931 ,"}\n"
932 ,"}\n"
933 ,"set demostarttime [clock clicks -millisecond]\n"
934 ,"set stopdemo 0\n"
935 ,"proc demoredraw { } {\n"
936 ,"global demostarttime\n"
937 ,"global stopdemo\n"
938 ,"set curtime [clock clicks -millisecond]\n"
939 ,"set result [ Ng_DemoSetTime [expr $curtime - $demostarttime] ]\n"
940 ,"redraw\n"
941 ,"global videoactive\n"
942 ,"if { $videoactive == 1 } {\n"
943 ,"puts \"addframe\"\n"
944 ,"Ng_VideoClip .ndraw addframe\n"
945 ,"}\n"
946 ,"if { $result == 0 && $stopdemo == 0 } {\n"
947 ,"after 1 { demoredraw }\n"
948 ,"}\n"
949 ,"}\n"
950 ,".ngmenu.file add command -label \"Show Demo...\" \\\n"
951 ,"-command {\n"
952 ,"set types { {\"Demo File\"  {.dem} } }\n"
953 ,"set file [tk_getOpenFile -filetypes $types -defaultextension \".dem\"  ]\n"
954 ,"if {$file != \"\"} {\n"
955 ,"Ng_ShowDemo $file\n"
956 ,"set demostarttime [clock clicks -millisecond]\n"
957 ,"set stopdemo 0\n"
958 ,"demoredraw\n"
959 ,"}\n"
960 ,"}\n"
961 ,".ngmenu.file add separator\n"
962 ,".ngmenu.file add command -label \"Snapshot...\" \\\n"
963 ,"-command {\n"
964 ,"set types {\n"
965 ,"{\"JPG file\" {.jpg} }\n"
966 ,"{\"GIF file\" {.gif} }\n"
967 ,"{\"PPM file\" {.ppm} }\n"
968 ,"}\n"
969 ,"set file [tk_getSaveFile -filetypes $types]\n"
970 ,"if {$file != \"\"} {\n"
971 ,"Ng_SnapShot .ndraw $file }\n"
972 ,"}\n"
973 ,".ngmenu.file add cascade -label \"Video clip\" -menu .ngmenu.file.video\n"
974 ,"menu .ngmenu.file.video\n"
975 ,"set videoactive 0\n"
976 ,".ngmenu.file.video add command -label \"start...\" \\\n"
977 ,"-command {\n"
978 ,"set types {\n"
979 ,"{\"MPG file\" {.mpg} }\n"
980 ,"}\n"
981 ,"set file [tk_getSaveFile -filetypes $types]\n"
982 ,"if {$file != \"\"} {\n"
983 ,"Ng_VideoClip .ndraw init $file\n"
984 ,"global videoactive\n"
985 ,"set videoactive 1\n"
986 ,"}\n"
987 ,"}\n"
988 ,".ngmenu.file.video add command -label \"add frame...\" \\\n"
989 ,"-command {Ng_VideoClip .ndraw addframe }\n"
990 ,".ngmenu.file.video add command -label \"one cycle\" \\\n"
991 ,"-command {\n"
992 ,"set visoptions.redrawperiodic 1\n"
993 ,"for { set j 0 } { $j < 100 } { incr j } {\n"
994 ,"puts \"j =  $j\"\n"
995 ,"Ng_Vis_Set time [expr (1000 * $j / 100)]\n"
996 ,"redraw\n"
997 ,"Ng_VideoClip .ndraw addframe\n"
998 ,"after 200\n"
999 ,"}\n"
1000 ,"}\n"
1001 ,".ngmenu.file.video add command -label \"finalize...\" \\\n"
1002 ,"-command {\n"
1003 ,"Ng_VideoClip .ndraw finalize\n"
1004 ,"global videoactive\n"
1005 ,"set videoactive 0\n"
1006 ,"}\n"
1007 ,".ngmenu.file add command -label \"Save Options\" \\\n"
1008 ,"-command { saveoptions }\n"
1009 ,".ngmenu.file add separator\n"
1010 ,".ngmenu.file add command -label \"Quit\" -accelerator \"<q>\" \\\n"
1011 ,"-command {\n"
1012 ,"puts \"Thank you for using $progname\";\n"
1013 ,"if { [catch { unload libngsolve[info sharedlibextension] ngsolve } result ] } {\n"
1014 ,"}\n"
1015 ,"after cancel { timer2 }\n"
1016 ,"Ng_Exit;\n"
1017 ,"destroy .\n"
1018 ,"}\n"
1019 ,"menu .ngmenu.mesh\n"
1020 ,".ngmenu.mesh add command -label \"Generate Mesh\" -accelerator \"<g><m>\" \\\n"
1021 ,"-command {\n"
1022 ,"set selectvisual mesh\n"
1023 ,"Ng_SetVisParameters\n"
1024 ,"Ng_GenerateMesh ${meshoptions.firststep} ${meshoptions.laststep}\n"
1025 ,"Ng_ReadStatus\n"
1026 ,"redraw\n"
1027 ,"}\n"
1028 ,".ngmenu.mesh add command -label \"Stop Meshing\" \\\n"
1029 ,"-command { Ng_StopMeshing }\n"
1030 ,".ngmenu.mesh add command -label \"Meshing Options...\" \\\n"
1031 ,"-command meshingoptionsdialog\n"
1032 ,".ngmenu.mesh add separator\n"
1033 ,".ngmenu.mesh add command -label \"Delete Mesh\" \\\n"
1034 ,"-command { Ng_New mesh; Ng_ReadStatus; redraw }\n"
1035 ,".ngmenu.mesh add command -label \"Delete Vol Mesh\" \\\n"
1036 ,"-command { Ng_DeleteVolMesh; Ng_ReadStatus; redraw }\n"
1037 ,".ngmenu.mesh add command -label \"Mesh Info\" \\\n"
1038 ,"-command {\n"
1039 ,"set dim [Ng_MeshInfo dim]\n"
1040 ,"set np [Ng_MeshInfo np]\n"
1041 ,"set ne [Ng_MeshInfo ne]\n"
1042 ,"set nse [Ng_MeshInfo nse]\n"
1043 ,"set nseg [Ng_MeshInfo nseg]\n"
1044 ,"set bbox [Ng_MeshInfo bbox]\n"
1045 ,"tk_messageBox -message  \"Dimension: $dim\\nPoints: $np\\nElements: $ne\\nSurface Els: $nse\\nSegments: $nseg\\nxmin [lindex $bbox 0] xmax [lindex $bbox 1]\\nymin [lindex $bbox 2] ymax [lindex $bbox 3]\\nzmin [lindex $bbox 4] zmax [lindex $bbox 5]\"\n"
1046 ,"}\n"
1047 ,".ngmenu.mesh add command -label \"Mesh Quality\" \\\n"
1048 ,"-command {\n"
1049 ,"set inplanemin 0\n"
1050 ,"set inplanemax 0\n"
1051 ,"set betplanemin 0\n"
1052 ,"set betplanemax 0\n"
1053 ,"Ng_MeshQuality inplanemin inplanemax betplanemin betplanemax\n"
1054 ,"puts \"Triangle angles : $inplanemin - $inplanemax\"\n"
1055 ,"puts \"Tet angles      : $betplanemin - $betplanemax\"\n"
1056 ,"tk_messageBox -message  \"Triangle angles : $inplanemin - $inplanemax \\n Tet angles      : $betplanemin - $betplanemax\"\n"
1057 ,"}\n"
1058 ,".ngmenu.mesh add command -label \"Check Surface Mesh\" \\\n"
1059 ,"-command { Ng_CheckSurfaceMesh }\n"
1060 ,".ngmenu.mesh add command -label \"Check Volume Mesh\" \\\n"
1061 ,"-command { Ng_CheckVolumeMesh }\n"
1062 ,".ngmenu.mesh add command -label \"Edit Boundary Conditions...\" \\\n"
1063 ,"-command { bcpropdialog }\n"
1064 ,"if { $userlevel == 3 } {\n"
1065 ,".ngmenu.mesh add command -label \"Mesh Doctor...\" \\\n"
1066 ,"-command { meshdoctordialog }\n"
1067 ,"}\n"
1068 ,".ngmenu.mesh add command -label \"METIS Mesh Partitioning...\" \\\n"
1069 ,"-command { METISdialog }\n"
1070 ,".ngmenu.mesh add separator\n"
1071 ,".ngmenu.mesh add command -label \"Analyze Geometry\" \\\n"
1072 ,"-command { Ng_GenerateMesh ag ag; Ng_ReadStatus; redraw }\n"
1073 ,".ngmenu.mesh add command -label \"Mesh Edges\" \\\n"
1074 ,"-command { Ng_GenerateMesh me me; Ng_ReadStatus; redraw }\n"
1075 ,".ngmenu.mesh add command -label \"Mesh Surface\" \\\n"
1076 ,"-command { set selectvisual mesh; Ng_SetVisParameters; \\\n"
1077 ,"Ng_GenerateMesh ms ms; Ng_ReadStatus; redraw }\n"
1078 ,".ngmenu.mesh add command -label \"Optimize Surface\" \\\n"
1079 ,"-command { Ng_GenerateMesh os os cmsmSm; redraw }\n"
1080 ,".ngmenu.mesh add cascade -label \"Surface Optim. Step\" -menu .ngmenu.mesh.surfoptstep\n"
1081 ,"menu .ngmenu.mesh.surfoptstep\n"
1082 ,".ngmenu.mesh.surfoptstep add command -label \"Mesh Smoothing\" \\\n"
1083 ,"-command { Ng_GenerateMesh os os m; redraw}\n"
1084 ,".ngmenu.mesh.surfoptstep add command -label \"Edge swapping (topologic)\" \\\n"
1085 ,"-command { Ng_GenerateMesh os os s; redraw}\n"
1086 ,".ngmenu.mesh.surfoptstep add command -label \"Edge swapping (metric)\" \\\n"
1087 ,"-command { Ng_GenerateMesh os os S; redraw}\n"
1088 ,".ngmenu.mesh.surfoptstep add command -label \"Combine points\" \\\n"
1089 ,"-command { Ng_GenerateMesh os os c; redraw}\n"
1090 ,".ngmenu.mesh add separator\n"
1091 ,".ngmenu.mesh add command -label \"Mesh Volume\" \\\n"
1092 ,"-command { Ng_GenerateMesh mv mv; Ng_ReadStatus }\n"
1093 ,".ngmenu.mesh add command -label \"Optimize Volume\" \\\n"
1094 ,"-command { Ng_GenerateMesh ov ov; Ng_ReadStatus }\n"
1095 ,".ngmenu.mesh add command -label \"Smooth Opt Volume\" \\\n"
1096 ,"-command { Ng_GenerateMesh ov ov m; Ng_ReadStatus }\n"
1097 ,".ngmenu.mesh add command -label \"Smooth Opt Volume Jacobian\" \\\n"
1098 ,"-command { Ng_GenerateMesh ov ov j; Ng_ReadStatus }\n"
1099 ,"menu .ngmenu.geometry\n"
1100 ,"menu .ngmenu.view\n"
1101 ,".ngmenu.view add command -label \"Zoom all\" \\\n"
1102 ,"-command { Ng_ZoomAll; redraw }\n"
1103 ,".ngmenu.view add command -label \"Center\" \\\n"
1104 ,"-command { Ng_Center; redraw }\n"
1105 ,".ngmenu.view add command -label \"x-y plane\" \\\n"
1106 ,"-command { Ng_StandardRotation xy; redraw }\n"
1107 ,".ngmenu.view add command -label \"y-x plane\" \\\n"
1108 ,"-command { Ng_StandardRotation yx; redraw }\n"
1109 ,".ngmenu.view add command -label \"x-z plane\" \\\n"
1110 ,"-command { Ng_StandardRotation xz; redraw }\n"
1111 ,".ngmenu.view add command -label \"z-x plane\" \\\n"
1112 ,"-command { Ng_StandardRotation zx; redraw }\n"
1113 ,".ngmenu.view add command -label \"y-z plane\" \\\n"
1114 ,"-command { Ng_StandardRotation yz; redraw }\n"
1115 ,".ngmenu.view add command -label \"z-y plane\" \\\n"
1116 ,"-command { Ng_StandardRotation zy; redraw }\n"
1117 ,".ngmenu.view add command -label \"Viewing Options...\" \\\n"
1118 ,"-command { viewingoptionsdialog; redraw }\n"
1119 ,".ngmenu.view add command -label \"Clipping Plane...\" \\\n"
1120 ,"-command { clippingdialog; redraw }\n"
1121 ,".ngmenu.view add command -label \"Solution Data...\" \\\n"
1122 ,"-command { visual_dialog; redraw }\n"
1123 ,".ngmenu.view add checkbutton -variable viewqualityplot \\\n"
1124 ,"-label \"Quality Plot\" \\\n"
1125 ,"-command { qualityviewdialog $viewqualityplot }\n"
1126 ,".ngmenu.view add checkbutton -variable memuseplot \\\n"
1127 ,"-label \"Memory Usage\" \\\n"
1128 ,"-command { memusedialog $memuseplot }\n"
1129 ,"menu .ngmenu.meshsize\n"
1130 ,".ngmenu.meshsize add command -label \"Refine uniform\" \\\n"
1131 ,"-command { Ng_Refine; Ng_HighOrder ${options.elementorder}; Ng_ReadStatus; redraw }\n"
1132 ,".ngmenu.meshsize add command -label \"Second Order\" \\\n"
1133 ,"-command { Ng_SecondOrder; Ng_ReadStatus; redraw }\n"
1134 ,".ngmenu.meshsize add command -label \"Validate Second Order\" \\\n"
1135 ,"-command { Ng_ValidateSecondOrder; Ng_ReadStatus; redraw }\n"
1136 ,".ngmenu.meshsize add command -label \"High Order\" \\\n"
1137 ,"-command { Ng_HighOrder ${options.elementorder}; Ng_ReadStatus; redraw }\n"
1138 ,".ngmenu.meshsize add separator\n"
1139 ,".ngmenu.meshsize add command -label \"Refinement Dialog...\" \\\n"
1140 ,"-command { refinementdialog }\n"
1141 ,".ngmenu.meshsize add command -label \"Load Meshsize...\" \\\n"
1142 ,"-command {\n"
1143 ,"set types {\n"
1144 ,"{\"Meshsize file\"   {.msz}	} }\n"
1145 ,"set file [tk_getOpenFile -filetypes $types]\n"
1146 ,"if {$file != \"\"} {\n"
1147 ,"Ng_LoadMeshSize $file;\n"
1148 ,"}\n"
1149 ,"}\n"
1150 ,".ngmenu.meshsize add command -label \"MS from Surf Mesh\" \\\n"
1151 ,"-command { Ng_MeshSizeFromSurfaceMesh }\n"
1152 ,"if { $userlevel == 3 } {\n"
1153 ,".ngmenu.meshsize add command -label \"Singular point ms\" \\\n"
1154 ,"-command { Ng_SingularPointMS; }\n"
1155 ,".ngmenu.meshsize add command -label \"Singular edge ms\" \\\n"
1156 ,"-command { Ng_SingularEdgeMS; }\n"
1157 ,".ngmenu.meshsize add separator\n"
1158 ,"set bisectfilename \"\";\n"
1159 ,".ngmenu.meshsize add command -label \"Bisection\" \\\n"
1160 ,"-command { Ng_ReadStatus; set oldnp 0; set newnp $status_np;\n"
1161 ,"Ng_ReadStatus;\n"
1162 ,"while { $oldnp < $newnp } {\n"
1163 ,"set level [expr $level+1]\n"
1164 ,"if { $bisectfilename == \"\"} {\n"
1165 ,"Ng_Bisect;\n"
1166 ,"} else {\n"
1167 ,"Ng_Bisect $bisectfilename;\n"
1168 ,"}\n"
1169 ,"Ng_ReadStatus;\n"
1170 ,"redraw;\n"
1171 ,"if { $bisectfilename == \"\"} {\n"
1172 ,"set oldnp $newnp;\n"
1173 ,"set newnp $status_np;\n"
1174 ,"puts \"oldnp $oldnp newnp $newnp\";\n"
1175 ,"} else {\n"
1176 ,"set oldnp $newnp;\n"
1177 ,"}\n"
1178 ,"}\n"
1179 ,"}\n"
1180 ,"}\n"
1181 ,".ngmenu.meshsize add command -label \"Load Refinement Info...\" \\\n"
1182 ,"-command {\n"
1183 ,"set types {\n"
1184 ,"{\"Refinement info\" {.refine} }}\n"
1185 ,"set bisectfilename [tk_getOpenFile -filetypes $types]\n"
1186 ,"}\n"
1187 ,".ngmenu.meshsize add command -label \"Z-Refinement\" \\\n"
1188 ,"-command { Ng_ZRefinement 2; Ng_ReadStatus; redraw }\n"
1189 ,".ngmenu.meshsize add cascade -label \"hp-Refinement\" -menu .ngmenu.meshsize.hpref\n"
1190 ,"menu .ngmenu.meshsize.hpref\n"
1191 ,".ngmenu.meshsize.hpref add command -label \"1 Level\" \\\n"
1192 ,"-command { Ng_HPRefinement 1; Ng_ReadStatus; redraw }\n"
1193 ,".ngmenu.meshsize.hpref add command -label \"2 Levels\" \\\n"
1194 ,"-command { Ng_HPRefinement 2; Ng_ReadStatus; redraw }\n"
1195 ,".ngmenu.meshsize.hpref add command -label \"3 Levels\" \\\n"
1196 ,"-command { Ng_HPRefinement 3; Ng_ReadStatus; redraw }\n"
1197 ,".ngmenu.meshsize.hpref add command -label \"4 Levels\" \\\n"
1198 ,"-command { Ng_HPRefinement 4; Ng_ReadStatus; redraw }\n"
1199 ,".ngmenu.meshsize.hpref add command -label \"5 Levels\" \\\n"
1200 ,"-command { Ng_HPRefinement 5; Ng_ReadStatus; redraw }\n"
1201 ,".ngmenu.meshsize.hpref add command -label \"6 Levels\" \\\n"
1202 ,"-command { Ng_HPRefinement 6; Ng_ReadStatus; redraw }\n"
1203 ,".ngmenu.meshsize.hpref add command -label \"7 Levels\" \\\n"
1204 ,"-command { Ng_HPRefinement 7; Ng_ReadStatus; redraw }\n"
1205 ,".ngmenu.meshsize.hpref add command -label \"8 Levels\" \\\n"
1206 ,"-command { Ng_HPRefinement 8; Ng_ReadStatus; redraw }\n"
1207 ,".ngmenu.meshsize.hpref add command -label \"9 Levels\" \\\n"
1208 ,"-command { Ng_HPRefinement 9; Ng_ReadStatus; redraw }\n"
1209 ,".ngmenu.meshsize.hpref add command -label \"10 Levels\" \\\n"
1210 ,"-command { Ng_HPRefinement 10; Ng_ReadStatus; redraw }\n"
1211 ,".ngmenu.meshsize add command -label \"Split to Tets\" \\\n"
1212 ,"-command { Ng_Split2Tets; Ng_ReadStatus; redraw }\n"
1213 ,"menu .ngmenu.special\n"
1214 ,".ngmenu.special add command -label \"Prismatic Boundary Layer\" \\\n"
1215 ,"-command { Ng_GenerateBoundaryLayer; redraw }\n"
1216 ,".ngmenu.special add command -label \"Insert virtual boundary layer\" \\\n"
1217 ,"-command { Ng_InsertVirtualBL; redraw }\n"
1218 ,".ngmenu.special add command -label \"Cut off and combine with other\" \\\n"
1219 ,"-command {\n"
1220 ,"set types { {\"Mesh file\"   {.vol}	} }\n"
1221 ,"set file [tk_getOpenFile -filetypes $types]\n"
1222 ,"if {$file != \"\"} {\n"
1223 ,"Ng_CutOffAndCombine $file;  }\n"
1224 ,"redraw\n"
1225 ,"}\n"
1226 ,".ngmenu.special add command -label \"Helmholtz Mesh grading\" \\\n"
1227 ,"-command { Ng_HelmholtzMesh; }\n"
1228 ,".ngmenu.special add cascade -label \"Colour-based boundary conditions\" -menu .ngmenu.special.colbndcond\n"
1229 ,"menu .ngmenu.special.colbndcond\n"
1230 ,".ngmenu.special.colbndcond add command -label \"Inspect Colours in mesh\" \\\n"
1231 ,"-command { currmeshcoloursdialog }\n"
1232 ,".ngmenu.special.colbndcond add separator\n"
1233 ,".ngmenu.special.colbndcond add command -label \"Automatic Assignment\" \\\n"
1234 ,"-command { Ng_AutoColourBcProps auto; redraw }\n"
1235 ,".ngmenu.special.colbndcond add separator\n"
1236 ,"set ocffile [file join ${ngdir} netgen.ocf];\n"
1237 ,".ngmenu.special.colbndcond add command -label \"Select Colour Profile file\" \\\n"
1238 ,"-command {\n"
1239 ,"set types { {\"Colour Profile file\"   {.ocf}   } }\n"
1240 ,"set ocffile [tk_getOpenFile -filetypes $types]\n"
1241 ,"if {$ocffile == \"\"} {\n"
1242 ,"set ocffile [file join ${ngdir} netgen.ocf]; }\n"
1243 ,"}\n"
1244 ,".ngmenu.special.colbndcond add command -label \"Profile based Assignment\" \\\n"
1245 ,"-command { Ng_AutoColourBcProps profile ${ocffile}; redraw }\n"
1246 ,"menu .ngmenu.help\n"
1247 ,".ngmenu.view add checkbutton -label \"Help Line\" -variable showhelpline \\\n"
1248 ,"-command {\n"
1249 ,"if { $showhelpline == 1} {\n"
1250 ,"pack .helpline -before .statbar -side bottom -fill x -padx 3p\n"
1251 ,"} {\n"
1252 ,"pack forget .helpline\n"
1253 ,"}\n"
1254 ,"}\n"
1255 ,".ngmenu.help add command -label \"About...\" \\\n"
1256 ,"-command {\n"
1257 ,"tk_messageBox -message \"This is NETGEN \\nmainly written by \\nJoachim Schoeberl \\nthanks to \\nRobert Gaisbauer, Johannes Gerstmayr, Philippose Rajan\"\n"
1258 ,"}\n"
1259 ,"ttk::frame .bubar\n"
1260 ,"pack .bubar -side top -fill x\n"
1261 ,"ttk::button .bubar.testb -text \"Test\" -command { Ng_SaveGeometry }\n"
1262 ,"ttk::button .bubar.surfm -text \"Generate Mesh\" -command \\\n"
1263 ,"{\n"
1264 ,".ngmenu.mesh invoke \"Generate Mesh\";\n"
1265 ,"}\n"
1266 ,"ttk::button .bubar.stopm -text \"Stop\" -command \\\n"
1267 ,"{\n"
1268 ,"set multithread_terminate 1;\n"
1269 ,"set stopdemo 1;\n"
1270 ,"}\n"
1271 ,"ttk::button .bubar.exitb -text \"Quit\" \\\n"
1272 ,"-command {\n"
1273 ,"set ans [tk_messageBox -title \"Quit Netgen?\" -message \"Do you really want to quit Netgen?\" -type yesno -default \"no\" -icon question]\n"
1274 ,"if { $ans == \"yes\" } {\n"
1275 ,".ngmenu.file invoke \"Quit\";\n"
1276 ,"}\n"
1277 ,"}\n"
1278 ,"pack  .bubar.exitb .bubar.surfm .bubar.stopm -side left\n"
1279 ,"ttk::button .bubar.zoomall -text \"Zoom All\" \\\n"
1280 ,"-command { Ng_ZoomAll; redraw }\n"
1281 ,"ttk::button .bubar.center -text \"Center\" \\\n"
1282 ,"-command { Ng_Center; redraw }\n"
1283 ,"ttk::menubutton .bubar.modesel -menu .bubar.modesel.menu -text \"\" -width 6\n"
1284 ,"menu .bubar.modesel.menu  -tearoff 0\n"
1285 ,".bubar.modesel.menu add command -label \"Rotate\" -command \"set drawmode \\\"rotate\\\" ;.bubar.modesel configure -text \\\"Rotate\\\"\"\n"
1286 ,".bubar.modesel.menu add command -label \"Move\" -command \"set drawmode \\\"move\\\" ;.bubar.modesel configure -text \\\"Move\\\"\"\n"
1287 ,".bubar.modesel.menu add command -label \"Zoom\" -command \"set drawmode \\\"zoom\\\" ;.bubar.modesel configure -text \\\"Zoom\\\"\"\n"
1288 ,".bubar.modesel.menu invoke \"Rotate\"\n"
1289 ,"set viewvals { geometry specpoints mesh solution}\n"
1290 ,"if { $userlevel == 3} {\n"
1291 ,"set viewvals { geometry mesh specpoints surfmeshing modelview solution}\n"
1292 ,"}\n"
1293 ,"set viewvallabs(cross)     \"Cross\"\n"
1294 ,"set viewvallabs(geometry)  \"Geometry\"\n"
1295 ,"set viewvallabs(mesh)      \"Mesh\"\n"
1296 ,"set viewvallabs(specpoints) \"Edges\"\n"
1297 ,"set viewvallabs(surfmeshing) \"Mesh Gen\"\n"
1298 ,"set viewvallabs(modelview)     \"Modeller\"\n"
1299 ,"set viewvallabs(solution)     \"Solution\"\n"
1300 ,"pack .bubar.center .bubar.zoomall -side right\n"
1301 ,".ngmenu.view add checkbutton -variable viewrotatebutton \\\n"
1302 ,"-label \"Enable LeftButton Selection\" \\\n"
1303 ,"-command {\n"
1304 ,"if { $viewrotatebutton } {\n"
1305 ,"pack .bubar.modesel -side right\n"
1306 ,"} {\n"
1307 ,"pack forget .bubar.modesel\n"
1308 ,"}\n"
1309 ,"}\n"
1310 ,"menu .bubar.selviewmenu\n"
1311 ,"ttk::menubutton .bubar.selview1 -menu .bubar.selviewmenu -text \"Geometry\"\n"
1312 ,"foreach viewv $viewvals {\n"
1313 ,".bubar.selviewmenu add command -label $viewvallabs($viewv) -command \\\n"
1314 ,"\".bubar.selview1 configure -text \\\"$viewvallabs($viewv)\\\" ; set selectvisual $viewv ; Ng_SetVisParameters; redraw\"\n"
1315 ,"}\n"
1316 ,"pack .bubar.selview1 -side right\n"
1317 ,"trace add variable selectvisual write selvis_monitor\n"
1318 ,"proc selvis_monitor { name args } {\n"
1319 ,"global selectvisual viewvallabs\n"
1320 ,".bubar.selviewmenu invoke $viewvallabs($selectvisual)\n"
1321 ,"}\n"
1322 ,"ttk::label .helpline -text \"None\"\n"
1323 ,"pack forget .helpline -side bottom -fill x\n"
1324 ,"ttk::frame .statbar -relief flat\n"
1325 ,"pack .statbar -side bottom -fill x\n"
1326 ,"ttk::label .statbar.ptslabel -text \"   Points: \"\n"
1327 ,"ttk::label .statbar.ptsval -textvariable status_np\n"
1328 ,"ttk::label .statbar.elslabel -text \"   Elements: \"\n"
1329 ,"ttk::label .statbar.elsval -textvariable status_ne\n"
1330 ,"ttk::label .statbar.selslabel -text \"   Surf Elements: \"\n"
1331 ,"ttk::label .statbar.selsval -textvariable status_nse\n"
1332 ,"ttk::label .statbar.task -textvariable status_task\n"
1333 ,"pack .statbar.ptslabel .statbar.ptsval -side left -ipady 3p\n"
1334 ,"pack .statbar.elslabel .statbar.elsval -side left -ipady 3p\n"
1335 ,"pack .statbar.selslabel .statbar.selsval -side left -ipady 3p\n"
1336 ,"ttk::progressbar .statbar.per -value 0 -maximum 1\n"
1337 ,"pack .statbar.per -side right\n"
1338 ,"pack .statbar.task -side right -ipady 4\n"
1339 ,"set qualbaraxis(0) 0\n"
1340 ,"set qualbar(0) 0\n"
1341 ,"set qualbarnull(0) 0\n"
1342 ,"proc timer2 { } {\n"
1343 ,"global status_np\n"
1344 ,"global status_ne\n"
1345 ,"global status_nse\n"
1346 ,"global multithread_running\n"
1347 ,"global multithread_redraw\n"
1348 ,"global status_working\n"
1349 ,"global status_task\n"
1350 ,"global status_percent\n"
1351 ,"global status_tetqualclasses\n"
1352 ,"Ng_ReadStatus\n"
1353 ,"if { $multithread_redraw == 1 } {\n"
1354 ,"set multithread_redraw 0;\n"
1355 ,"redraw;\n"
1356 ,"global videoactive\n"
1357 ,"if { $videoactive == 1 } {\n"
1358 ,"puts \"addframe\"\n"
1359 ,"Ng_VideoClip .ndraw addframe\n"
1360 ,"}\n"
1361 ,"}\n"
1362 ,"if { $multithread_redraw == 2 } {\n"
1363 ,"redraw;\n"
1364 ,"set multithread_redraw 0;\n"
1365 ,"global videoactive\n"
1366 ,"if { $videoactive == 1 } {\n"
1367 ,"puts \"addframe\"\n"
1368 ,"Ng_VideoClip .ndraw addframe\n"
1369 ,"}\n"
1370 ,"after 1 { timer2 }\n"
1371 ,"return\n"
1372 ,"}\n"
1373 ,".statbar.per configure -value [expr $status_percent/100]\n"
1374 ,"if { $multithread_running } {\n"
1375 ,"pack .statbar.per -side right -before .statbar.task -padx 6\n"
1376 ,"} {\n"
1377 ,"pack forget .statbar.per\n"
1378 ,"}\n"
1379 ,"if {[winfo exists .qualityview_dlg] == 1} {\n"
1380 ,"global qualbar\n"
1381 ,"global qualbarnull\n"
1382 ,"global qualbaraxis\n"
1383 ,"set maxval 0\n"
1384 ,"for {set i 0} {$i < 20} {incr i} {\n"
1385 ,"if {[lindex $status_tetqualclasses $i] > $maxval} {\n"
1386 ,"set maxval [lindex $status_tetqualclasses $i]\n"
1387 ,"}\n"
1388 ,"}\n"
1389 ,"set ubound 1\n"
1390 ,"while { $ubound < $maxval } {\n"
1391 ,"set ubound [expr {10 * $ubound}]\n"
1392 ,"}\n"
1393 ,"if { $ubound/5 > $maxval } {\n"
1394 ,"set ubound [expr $ubound/5]\n"
1395 ,"}\n"
1396 ,"if { $ubound/2 > $maxval } {\n"
1397 ,"set ubound [expr $ubound/2]\n"
1398 ,"}\n"
1399 ,"for {set i 1} {$i <= 5} {incr i} {\n"
1400 ,"set value [expr { $i * $ubound / 5 }]\n"
1401 ,".qualityview_dlg.c dchars $qualbaraxis($i) 0 end\n"
1402 ,".qualityview_dlg.c insert $qualbaraxis($i) end $value\n"
1403 ,"}\n"
1404 ,"for {set i 0} {$i < 20} {incr i} {\n"
1405 ,"set x1 [expr {100 + ($i*15) + 2}]\n"
1406 ,"set x2 [expr {$x1+10}]\n"
1407 ,"set nbrs [lindex $status_tetqualclasses $i]\n"
1408 ,"set y [expr (249 - (200 * $nbrs / $ubound ) )]\n"
1409 ,".qualityview_dlg.c coords $qualbar($i) $x1 250 $x2 $y\n"
1410 ,"if { $nbrs == 0 } {\n"
1411 ,".qualityview_dlg.c itemconfigure $qualbarnull($i) -text 0\n"
1412 ,"} {\n"
1413 ,".qualityview_dlg.c itemconfigure $qualbarnull($i) -text \"\"\n"
1414 ,"}\n"
1415 ,"}\n"
1416 ,"}\n"
1417 ,"if {[winfo exists .memuse_dlg] == 1} {\n"
1418 ,"global memmark\n"
1419 ,"set usemb [Ng_MemInfo usedmb]\n"
1420 ,"for {set i 0} {$i < [string length $usemb] } {incr i} {\n"
1421 ,"if { [string index $usemb $i] == 0 } {\n"
1422 ,".memuse_dlg.c coords $memmark($i)  [expr 50+$i] 68 [expr 50+$i] 70\n"
1423 ,"} {\n"
1424 ,".memuse_dlg.c coords $memmark($i)  [expr 50+$i] 50 [expr 50+$i] 70\n"
1425 ,"}\n"
1426 ,"}\n"
1427 ,"}\n"
1428 ,"after 40 { timer2 }\n"
1429 ,"}\n"
1430 ,"timer2\n"
1431 ,"proc bgerror { error } {\n"
1432 ,"global errorInfo userlevel\n"
1433 ,"if { $userlevel == 3} {\n"
1434 ,"puts \"ERROR: $error\"\n"
1435 ,"puts \"errinfo: $errorInfo\"\n"
1436 ,"}\n"
1437 ,"tk_messageBox -title \"Error Message\" -message $error -type ok\n"
1438 ,"}\n"
1439 ,"proc smh2 { menuitem } {\n"
1440 ,"if {[catch {$menuitem entrycget active -label} name]} {\n"
1441 ,"set name \"    \"\n"
1442 ,"}\n"
1443 ,"show_menu_help $name\n"
1444 ,"update idletasks\n"
1445 ,"}\n"
1446 ,"bind .ngmenu <<MenuSelect>> { smh2 %W }\n"
1447 ,"bind .ngmenu.file <<MenuSelect>> { smh2 %W }\n"
1448 ,"bind .ngmenu.geometry <<MenuSelect>> { smh2 %W }\n"
1449 ,"bind .ngmenu.mesh <<MenuSelect>> { smh2 %W }\n"
1450 ,"bind .ngmenu.view <<MenuSelect>> { smh2 %W }\n"
1451 ,"bind .ngmenu.meshsize <<MenuSelect>> { smh2 %W }\n"
1452 ,"bind .ngmenu.special <<MenuSelect>> { smh2 %W }\n"
1453 ,"bind .ngmenu.help <<MenuSelect>> { smh2 %W }\n"
1454 ,"bind . <q> { .ngmenu.file invoke \"Quit\" }\n"
1455 ,"bind . <l><g> { .ngmenu.file invoke \"Load Geometry...\" }  ;\n"
1456 ,"bind . <l><m> { .ngmenu.file invoke \"Load Mesh...\" }  ;\n"
1457 ,"bind . <s><m> { .ngmenu.file invoke \"Save Mesh...\" }  ;\n"
1458 ,"bind . <r><f> { .ngmenu.file activate \"Recent Files\" }  ;\n"
1459 ,"bind . <n><p> { newprimitivedialog }      ; \n"
1460 ,"bind . <e><p> { editprimitivedialog }\n"
1461 ,"bind . <e><s> { newsoliddialog }\n"
1462 ,"bind . <g><m> { .ngmenu.mesh invoke \"Generate Mesh\" }  ;\n"
1463 ,"}\n"
1464 ,"}\n"
1465 ,"catch {\n"
1466 ,"proc meshingoptionsdialog { } {\n"
1467 ,"set w .options_dlg\n"
1468 ,"if {[winfo exists .options_dlg] == 1} {\n"
1469 ,"wm withdraw $w\n"
1470 ,"wm deiconify $w\n"
1471 ,"focus $w\n"
1472 ,"} {\n"
1473 ,"toplevel $w\n"
1474 ,"pack [ttk::notebook $w.nb]  -fill both -side top\n"
1475 ,"$w.nb add [ttk::frame $w.nb.general] -text \"General\" -underline 0\n"
1476 ,"$w.nb add [ttk::frame $w.nb.meshsize] -text \"Mesh Size\" -underline 0\n"
1477 ,"$w.nb add [ttk::frame $w.nb.chartopt] -text \"STL Charts\" -underline 0\n"
1478 ,"$w.nb add [ttk::frame $w.nb.optimizer] -text \"Optimizer\" -underline 0\n"
1479 ,"$w.nb add [ttk::frame $w.nb.debug] -text \"Debug\" -underline 0\n"
1480 ,"set f $w.nb.general\n"
1481 ,"ttk::frame $f.background\n"
1482 ,"pack $f.background -fill both\n"
1483 ,"set f $f.background\n"
1484 ,"ttk::labelframe $f.f2 -relief groove -borderwidth 3 -text \"General meshing options\"\n"
1485 ,"pack $f.f2  -pady 15 -fill x\n"
1486 ,"set f $f.f2\n"
1487 ,"set finevals { 1 2 3 4 5 6 }\n"
1488 ,"set finelabs(1) \"very coarse\"\n"
1489 ,"set finelabs(2) \"coarse\"\n"
1490 ,"set finelabs(3) \"moderate\"\n"
1491 ,"set finelabs(4) \"fine\"\n"
1492 ,"set finelabs(5) \"very fine\"\n"
1493 ,"set finelabs(6) \"user defined\"\n"
1494 ,"global meshoptions.fineness\n"
1495 ,"ttk::label  $f.fine2l -text \"Mesh granularity: \"\n"
1496 ,"ttk::menubutton $f.fine2c -menu $f.fine2m -text \"coarse\" -width 16\n"
1497 ,"menu $f.fine2m  -tearoff 0\n"
1498 ,"foreach finev { 1 2 3 4 5 6 } {\n"
1499 ,"$f.fine2m add command -label $finelabs($finev) \\\n"
1500 ,"-command \"set meshoptions.fineness $finev ; setgranularity $finev; $f.fine2c configure -text \\\"$finelabs($finev)\\\"\"\n"
1501 ,"}\n"
1502 ,"$f.fine2m invoke $finelabs(${meshoptions.fineness})\n"
1503 ,"grid $f.fine2l $f.fine2c -sticky nw\n"
1504 ,"set mgsteps { ag me ms os mv ov }\n"
1505 ,"set mgsteplabel(ag) \"Analyze Geometry\"\n"
1506 ,"set mgsteplabel(me) \"Mesh Edges\"\n"
1507 ,"set mgsteplabel(ms) \"Mesh Surface\"\n"
1508 ,"set mgsteplabel(os) \"Optimize Surface\"\n"
1509 ,"set mgsteplabel(mv) \"Mesh Volume\"\n"
1510 ,"set mgsteplabel(ov) \"Optimize Volume\"\n"
1511 ,"global meshoptions.firststep\n"
1512 ,"ttk::label  $f.first2l -text \"First Step: \"\n"
1513 ,"ttk::menubutton $f.first2c -menu $f.first2m  -width 16\n"
1514 ,"menu $f.first2m  -tearoff 0\n"
1515 ,"foreach i $mgsteps {\n"
1516 ,"$f.first2m add command -label $mgsteplabel($i) -command \"set meshoptions.firststep $i ; $f.first2c configure -text \\\"$mgsteplabel($i)\\\"\"\n"
1517 ,"}\n"
1518 ,"$f.first2m invoke $mgsteplabel(${meshoptions.firststep})\n"
1519 ,"grid $f.first2l $f.first2c -sticky nw\n"
1520 ,"global meshoptions.laststep\n"
1521 ,"ttk::label  $f.last2l -text \"Last Step: \"\n"
1522 ,"ttk::menubutton $f.last2c -menu $f.last2m -width 16\n"
1523 ,"menu $f.last2m  -tearoff 0\n"
1524 ,"foreach i $mgsteps {\n"
1525 ,"$f.last2m add command -label $mgsteplabel($i) -command \"set meshoptions.laststep $i ; $f.last2c configure -text \\\"$mgsteplabel($i)\\\"\"\n"
1526 ,"}\n"
1527 ,"$f.last2m invoke $mgsteplabel(${meshoptions.laststep})\n"
1528 ,"grid $f.last2l $f.last2c -sticky nw\n"
1529 ,"grid anchor $f center\n"
1530 ,"set msg(0) \"None\"\n"
1531 ,"set msg(1) \"Least\"\n"
1532 ,"set msg(2) \"Little\"\n"
1533 ,"set msg(3) \"Moderate\"\n"
1534 ,"set msg(4) \"Much\"\n"
1535 ,"set msg(5) \"Most\"\n"
1536 ,"global options.printmsg\n"
1537 ,"ttk::label  $f.msg2l -text \"Print Messages: \"\n"
1538 ,"menu $f.msg2m  -tearoff 0\n"
1539 ,"ttk::menubutton $f.msg2c -menu $f.msg2m  -width 16\n"
1540 ,"foreach step {0 1 2 3 4 5 } {\n"
1541 ,"$f.msg2m add command -label $msg($step) -command \"set options.printmsg $step ; $f.msg2c configure -text $msg($step)\"\n"
1542 ,"}\n"
1543 ,"$f.msg2m invoke ${options.printmsg}\n"
1544 ,"grid $f.msg2l $f.msg2c -sticky nw\n"
1545 ,"set f $w.nb.general\n"
1546 ,"ttk::labelframe $f.bts -borderwidth 3 -relief groove -text \"Additional meshing options\"\n"
1547 ,"pack $f.bts -fill x -pady 15\n"
1548 ,"ttk::frame $f.bts.btnframe\n"
1549 ,"ttk::checkbutton $f.bts.btnframe.parthread -text \"Separate meshing thread\" \\\n"
1550 ,"-variable options.parthread\n"
1551 ,"ttk::checkbutton $f.bts.btnframe.second -text \"Second order elements\" \\\n"
1552 ,"-variable options.secondorder\n"
1553 ,"ttk::checkbutton $f.bts.btnframe.quad -text \"Quad dominated\" \\\n"
1554 ,"-variable options.quad -command {\n"
1555 ,"if { ${options.quad} } {\n"
1556 ,"set meshoptions.laststep os\n"
1557 ,"}\n"
1558 ,"}\n"
1559 ,"ttk::checkbutton $f.bts.btnframe.invtets -text \"Invert volume elements\" \\\n"
1560 ,"-variable options.inverttets\n"
1561 ,"ttk::checkbutton $f.bts.btnframe.invtrigs -text \"Invert surface elements\" \\\n"
1562 ,"-variable options.inverttrigs\n"
1563 ,"ttk::checkbutton $f.bts.btnframe.azref -text \"Automatic Z-refinement\" \\\n"
1564 ,"-variable options.autozrefine\n"
1565 ,"pack $f.bts.btnframe -anchor center\n"
1566 ,"pack $f.bts.btnframe.parthread $f.bts.btnframe.second $f.bts.btnframe.quad $f.bts.btnframe.invtets $f.bts.btnframe.invtrigs $f.bts.btnframe.azref -anchor w\n"
1567 ,"ttk::frame $f.bts.btnframe.elorder\n"
1568 ,"ttk::label $f.bts.btnframe.elorder.l -text \"Element order\"\n"
1569 ,"ttk::spinbox $f.bts.btnframe.elorder.elementorder2 -from 1 -to 20 -textvariable options.elementorder -width 2\n"
1570 ,"pack $f.bts.btnframe.elorder -fill x\n"
1571 ,"pack $f.bts.btnframe.elorder.elementorder2 $f.bts.btnframe.elorder.l  -anchor w -side left\n"
1572 ,"ttk::frame $f.bts.btnframe.pm\n"
1573 ,"ttk::checkbutton $f.bts.btnframe.pm.parallel_meshing -text \"Parallel meshing\" \\\n"
1574 ,"-variable options.parallel_meshing\n"
1575 ,"pack $f.bts.btnframe.pm -fill x -pady 5\n"
1576 ,"pack $f.bts.btnframe.pm.parallel_meshing  -anchor w\n"
1577 ,"ttk::label $f.bts.btnframe.pm.lnthreads -text \"Number of meshing threads\"\n"
1578 ,"ttk::spinbox $f.bts.btnframe.pm.nthreads -from 1 -to 128 -textvariable options.nthreads -width 2\n"
1579 ,"pack $f.bts.btnframe.pm.nthreads $f.bts.btnframe.pm.lnthreads  -anchor w -side left\n"
1580 ,"set f $w.nb.meshsize\n"
1581 ,"ttk::frame $f.f2\n"
1582 ,"pack $f.f2 -pady 10\n"
1583 ,"set f $f.f2\n"
1584 ,"ttk::frame $f.meshsize\n"
1585 ,"ttk::label $f.meshsize.l -text \"max mesh-size\"\n"
1586 ,"ttk::spinbox $f.meshsize.s -from 1e-9 -to 1e9 -textvariable options.meshsize -width 5 -validate focus -validatecommand \"my_validatespinbox %W %P 10\" \\\n"
1587 ,"-invalidcommand \"my_invalidspinbox %W\"\n"
1588 ,"pack $f.meshsize -fill x\n"
1589 ,"pack $f.meshsize.s $f.meshsize.l -side right\n"
1590 ,"ttk::frame $f.minmeshsize\n"
1591 ,"ttk::label $f.minmeshsize.l -text \"min mesh-size\"\n"
1592 ,"ttk::spinbox $f.minmeshsize.s -from 0 -to 1e9 -textvariable options.minmeshsize -width 5 -validate focus -validatecommand \"my_validatespinbox %W %P 10\" \\\n"
1593 ,"-invalidcommand \"my_invalidspinbox %W\"\n"
1594 ,"pack $f.minmeshsize -fill x\n"
1595 ,"pack $f.minmeshsize.s $f.minmeshsize.l -side right\n"
1596 ,"ttk::frame $f.grading\n"
1597 ,"ttk::label $f.grading.l -text \"mesh-size grading\"\n"
1598 ,"ttk::spinbox $f.grading.s -from 0.1 -to 1.0 -textvariable options.grading -width 5 -increment 0.1 -validate focus -validatecommand \"my_validatespinbox %W %P 3\" \\\n"
1599 ,"-invalidcommand \"my_invalidspinbox %W\"\n"
1600 ,"pack $f.grading -fill x\n"
1601 ,"pack $f.grading.s $f.grading.l -side right\n"
1602 ,"set f $w.nb.meshsize\n"
1603 ,"ttk::labelframe $f.msf -text \"mesh-size file:\" -relief groove -borderwidth 3\n"
1604 ,"pack $f.msf\n"
1605 ,"ttk::entry $f.msf.ent -textvariable options.meshsizefilename -width 30\n"
1606 ,"ttk::button $f.msf.btn -text \"Browse\" -command {\n"
1607 ,"global options.meshsizefilename\n"
1608 ,"set types {\n"
1609 ,"{\"Meshsize file\"   {.msz}	} }\n"
1610 ,"set options.meshsizefilename [tk_getOpenFile -filetypes $types -initialfile ${options.meshsizefilename}]\n"
1611 ,"}\n"
1612 ,"pack $f.msf.ent -side left -expand yes -fill x -anchor s -padx 4 -pady 4\n"
1613 ,"pack $f.msf.btn -side left -anchor s -padx 4 -pady 4\n"
1614 ,"ttk::label $f.lab -text \"Additional mesh size restrictions:\"\n"
1615 ,"ttk::labelframe $f.csg -relief groove -borderwidth 3 -text \"CSG mesh-size\"\n"
1616 ,"pack $f.csg -fill x\n"
1617 ,"proc test {a} {puts $a}\n"
1618 ,"ttk::scale $f.csg.curvsc -orient horizontal -length 150 -from 0.2 -to 5 \\\n"
1619 ,"-variable options.curvaturesafety -takefocus 0 -command \"roundscale $f.csg.curvsc 1\"\n"
1620 ,"ttk::entry $f.csg.curve -textvariable options.curvaturesafety -width 3 \\\n"
1621 ,"-validatecommand \"my_validate %W [$f.csg.curvsc cget -from] [$f.csg.curvsc cget -to] %P 1\" \\\n"
1622 ,"-invalidcommand \"my_invalid %W\" -validate focus\n"
1623 ,"ttk::label $f.csg.curvla -text \"Elements per curvature radius\"\n"
1624 ,"grid $f.csg.curvsc $f.csg.curve $f.csg.curvla -sticky nw -padx 4\n"
1625 ,"ttk::scale $f.csg.elensc -orient horizontal -length 150 -from 0.2 -to 5 \\\n"
1626 ,"-variable options.segmentsperedge -takefocus 0 -command \"roundscale $f.csg.elensc 1\"\n"
1627 ,"ttk::entry $f.csg.elene -textvariable options.segmentsperedge -width 3 \\\n"
1628 ,"-validatecommand \"my_validate %W [$f.csg.elensc cget -from] [$f.csg.elensc cget -to] %P 1\" \\\n"
1629 ,"-invalidcommand \"my_invalid %W\" -validate focus\n"
1630 ,"ttk::label $f.csg.elenla -text \"Elements per edge\"\n"
1631 ,"grid $f.csg.elensc $f.csg.elene $f.csg.elenla -sticky nw -padx 4\n"
1632 ,"grid anchor $f.csg center\n"
1633 ,"ttk::labelframe $f.stl -relief groove -borderwidth 3 -text \"STL mesh-size\"\n"
1634 ,"pack $f.stl -fill x\n"
1635 ,"ttk::scale $f.stl.r2sc -orient horizontal -length 150 -from 0.2 -to 5 \\\n"
1636 ,"-variable stloptions.resthchartdistfac -takefocus 0 -command \"roundscale $f.stl.r2sc 1\"\n"
1637 ,"ttk::entry $f.stl.r2e -textvariable stloptions.resthchartdistfac -width 3 \\\n"
1638 ,"-validatecommand \"my_validate %W [$f.stl.r2sc cget -from] [$f.stl.r2sc cget -to] %P 1\" \\\n"
1639 ,"-invalidcommand \"my_invalid %W\" -validate focus\n"
1640 ,"ttk::checkbutton $f.stl.r2bu -text \"STL - chart distance\" \\\n"
1641 ,"-variable stloptions.resthchartdistenable\n"
1642 ,"grid $f.stl.r2sc $f.stl.r2e $f.stl.r2bu -sticky nw -padx 4\n"
1643 ,"ttk::scale $f.stl.r6sc -orient horizontal -length 150 -from 0.2 -to 5 \\\n"
1644 ,"-variable stloptions.resthlinelengthfac -takefocus 0 -command \"roundscale $f.stl.r6sc 1\"\n"
1645 ,"ttk::entry $f.stl.r6e -textvariable stloptions.resthlinelengthfac -width 3 \\\n"
1646 ,"-validatecommand \"my_validate %W [$f.stl.r6sc cget -from] [$f.stl.r6sc cget -to] %P 1\" \\\n"
1647 ,"-invalidcommand \"my_invalid %W\" -validate focus\n"
1648 ,"ttk::checkbutton $f.stl.r6bu -text \"STL - line length\" \\\n"
1649 ,"-variable stloptions.resthlinelengthenable\n"
1650 ,"grid $f.stl.r6sc $f.stl.r6e $f.stl.r6bu -sticky nw -padx 4\n"
1651 ,"ttk::scale $f.stl.r3sc -orient horizontal -length 150 -from 0.2 -to 8 \\\n"
1652 ,"-variable stloptions.resthcloseedgefac -takefocus 0 -command \"roundscale $f.stl.r3sc 1\"\n"
1653 ,"ttk::entry $f.stl.r3e -textvariable stloptions.resthcloseedgefac -width 3 \\\n"
1654 ,"-validatecommand \"my_validate %W [$f.stl.r3sc cget -from] [$f.stl.r3sc cget -to] %P 1\" \\\n"
1655 ,"-invalidcommand \"my_invalid %W\" -validate focus\n"
1656 ,"ttk::checkbutton $f.stl.r3bu -text \"STL/IGES/STEP - close edges\" \\\n"
1657 ,"-variable stloptions.resthcloseedgeenable\n"
1658 ,"grid $f.stl.r3sc $f.stl.r3e $f.stl.r3bu -sticky nw -padx 4\n"
1659 ,"ttk::scale $f.stl.r1sc -orient horizontal -length 150 -from 0.2 -to 5 \\\n"
1660 ,"-variable stloptions.resthsurfcurvfac -takefocus 0 -command \"roundscale $f.stl.r1sc 1\"\n"
1661 ,"ttk::entry $f.stl.r1e -textvariable stloptions.resthsurfcurvfac -width 3 \\\n"
1662 ,"-validatecommand \"my_validate %W [$f.stl.r1sc cget -from] [$f.stl.r1sc cget -to] %P 1\" \\\n"
1663 ,"-invalidcommand \"my_invalid %W\" -validate focus\n"
1664 ,"ttk::checkbutton $f.stl.r1bu -text \"STL - surface curvature\" \\\n"
1665 ,"-variable stloptions.resthsurfcurvenable\n"
1666 ,"grid $f.stl.r1sc $f.stl.r1e $f.stl.r1bu -sticky nw -padx 4\n"
1667 ,"ttk::scale $f.stl.r3bsc -orient horizontal -length 150 -from 0.2 -to 5 \\\n"
1668 ,"-variable stloptions.resthedgeanglefac -takefocus 0 -command \"roundscale $f.stl.r3bsc 1\"\n"
1669 ,"ttk::entry $f.stl.r3be -textvariable stloptions.resthedgeanglefac -width 3 \\\n"
1670 ,"-validatecommand \"my_validate %W [$f.stl.r3bsc cget -from] [$f.stl.r3bsc cget -to] %P 1\" \\\n"
1671 ,"-invalidcommand \"my_invalid %W\" -validate focus\n"
1672 ,"ttk::checkbutton $f.stl.r3bbu -text \"STL - edge angle\" \\\n"
1673 ,"-variable stloptions.resthedgeangleenable\n"
1674 ,"grid $f.stl.r3bsc  $f.stl.r3be $f.stl.r3bbu -sticky nw -padx 4\n"
1675 ,"ttk::scale $f.stl.r5sc -orient horizontal -length 150 -from 0.2 -to 5 \\\n"
1676 ,"-variable stloptions.resthsurfmeshcurvfac -takefocus 0 -command \"roundscale $f.stl.r5sc 1\"\n"
1677 ,"ttk::entry $f.stl.r5e -textvariable stloptions.resthsurfmeshcurvfac -width 3 \\\n"
1678 ,"-validatecommand \"my_validate %W [$f.stl.r5sc cget -from] [$f.stl.r5sc cget -to] %P 1\" \\\n"
1679 ,"-invalidcommand \"my_invalid %W\" -validate focus\n"
1680 ,"ttk::checkbutton $f.stl.r5bu -text \"STL - surface mesh curv\" \\\n"
1681 ,"-variable stloptions.resthsurfmeshcurvenable\n"
1682 ,"grid $f.stl.r5sc  $f.stl.r5e  $f.stl.r5bu -sticky nw -padx 4\n"
1683 ,"ttk::checkbutton $f.stl.recalch -text \"STL - Recalc mesh size for surface optimization\" \\\n"
1684 ,"-variable stloptions.recalchopt\n"
1685 ,"grid $f.stl.recalch -sticky n -columnspan 3 -column 0\n"
1686 ,"ttk::button $f.stl.calch -text \"Calc New H\" -command { redraw; Ng_STLCalcLocalH }\n"
1687 ,"grid $f.stl.calch -columnspan 3 -column 0\n"
1688 ,"grid anchor $f.stl center\n"
1689 ,"proc roundscale {w n_digits args} {\n"
1690 ,"set val [$w get]\n"
1691 ,"global [$w cget -variable]\n"
1692 ,"if {$n_digits == 0 } {\n"
1693 ,"set [$w cget -variable] [tcl::mathfunc::round $val]\n"
1694 ,"} else {\n"
1695 ,"set [$w cget -variable] [format \"%.[append n_digits \"f\"]\" $val]\n"
1696 ,"}\n"
1697 ,"}\n"
1698 ,"global last_accepted_sc\n"
1699 ,"proc my_validate {w mini maxi val n_digits} {\n"
1700 ,"global last_accepted_sc [$w cget -textvariable]\n"
1701 ,"if {[string length $val] == 0} {return 0}\n"
1702 ,"if {[string is double $val] == 1} {\n"
1703 ,"if { $n_digits == 0 } {\n"
1704 ,"set val [tcl::mathfunc::max $mini [tcl::mathfunc::min $maxi [tcl::mathfunc::round $val]]]\n"
1705 ,"} else {\n"
1706 ,"if { $n_digits < 9 } {\n"
1707 ,"set val [tcl::mathfunc::max $mini [tcl::mathfunc::min $maxi [format \"%.[append n_digits \"f\"]\" $val]]]\n"
1708 ,"}\n"
1709 ,"}\n"
1710 ,"set last_accepted_sc $val\n"
1711 ,"set [$w cget -textvariable] $val\n"
1712 ,"return 1\n"
1713 ,"} else {\n"
1714 ,"return 0\n"
1715 ,"}\n"
1716 ,"}\n"
1717 ,"proc my_invalid {w} {\n"
1718 ,"global last_accepted_sc [$w cget -textvariable]\n"
1719 ,"set [$w cget -textvariable] $last_accepted_sc\n"
1720 ,"}\n"
1721 ,"set f $w.nb.chartopt\n"
1722 ,"ttk::labelframe $f.mainframe -text \"STL angles\" -relief groove -borderwidth 3\n"
1723 ,"pack $f.mainframe -fill x -pady 15\n"
1724 ,"set f $f.mainframe\n"
1725 ,"ttk::label $f.labYangles -text \"Yellow Edges Angle ()\"\n"
1726 ,"ttk::scale $f.scale1 -orient horizontal -length 150 -from 0 -to 90 -variable stloptions.yangle -takefocus 0 -command \"roundscale $f.scale1 1\"\n"
1727 ,"ttk::entry $f.entry1 -textvariable stloptions.yangle -width 5 -validate focus -takefocus 0 -validatecommand \"my_validate %W [$f.scale1 cget -from] [$f.scale1 cget -to] %P 1\" \\\n"
1728 ,"-invalidcommand \"my_invalid %W\"\n"
1729 ,"grid $f.scale1 $f.entry1 $f.labYangles -sticky nw -padx 4 -pady 6\n"
1730 ,"ttk::label $f.labEangles -text \"Edge Corner Angle ()\"\n"
1731 ,"ttk::scale $f.scale2 -orient horizontal -length 150 -from 0 -to 180 -variable stloptions.edgecornerangle -takefocus 0 -command \"roundscale $f.scale2 1\"\n"
1732 ,"ttk::entry $f.entry2 -textvariable stloptions.edgecornerangle -width 5 -validate focus -takefocus 0 -validatecommand \"my_validate %W [$f.scale2 cget -from] [$f.scale2 cget -to] %P 1\" \\\n"
1733 ,"-invalidcommand \"my_invalid %W\"\n"
1734 ,"grid $f.scale2 $f.entry2 $f.labEangles -sticky nw -padx 4 -pady 6\n"
1735 ,"ttk::label $f.lab31 -text \"Chart Angle ()\"\n"
1736 ,"ttk::scale $f.scale3 -orient horizontal -length 150 -from 0 -to 180 -variable stloptions.chartangle -takefocus 0 -command \"roundscale $f.scale3 1\"\n"
1737 ,"ttk::entry $f.entry3 -textvariable stloptions.chartangle -width 5 -validate focus -takefocus 0 -validatecommand \"my_validate %W [$f.scale3 cget -from] [$f.scale3 cget -to] %P 1\" \\\n"
1738 ,"-invalidcommand \"my_invalid %W\"\n"
1739 ,"grid $f.scale3 $f.entry3 $f.lab31 -sticky nw -padx 4 -pady 6\n"
1740 ,"ttk::label $f.lab41 -text \"Outer Chart Angle ()\"\n"
1741 ,"ttk::scale $f.scale4 -orient horizontal -length 150 -from 0 -to 180 -variable stloptions.outerchartangle -takefocus 0 -command \"roundscale $f.scale4 1\"\n"
1742 ,"ttk::entry $f.entry4 -textvariable stloptions.outerchartangle -width 5 -validate focus -takefocus 0 -validatecommand \"my_validate %W [$f.scale4 cget -from] [$f.scale4 cget -to] %P 1\" \\\n"
1743 ,"-invalidcommand \"my_invalid %W\"\n"
1744 ,"grid $f.scale4 $f.entry4 $f.lab41 -sticky nw -padx 4 -pady 6\n"
1745 ,"grid anchor $f center\n"
1746 ,"global last_accepted_sp\n"
1747 ,"proc my_validatespinbox {w val n_digits} {\n"
1748 ,"global last_accepted_sp\n"
1749 ,"if {[string length $val] == 0} {return 0}\n"
1750 ,"if {[string is double $val] == 1} {\n"
1751 ,"if { $n_digits == 0 } {\n"
1752 ,"if { $n_digits < 9 } {\n"
1753 ,"set val [tcl::mathfunc::round $val] } else { set val [format \"%.[append n_digits \"f\"]\" $val]\n"
1754 ,"}\n"
1755 ,"}\n"
1756 ,"$w set [tcl::mathfunc::max [$w cget -from] [tcl::mathfunc::min [$w cget -to] $val]]\n"
1757 ,"set last_accepted_sp $val\n"
1758 ,"return 1\n"
1759 ,"} else {\n"
1760 ,"return 0\n"
1761 ,"}\n"
1762 ,"}\n"
1763 ,"proc my_invalidspinbox {w} {\n"
1764 ,"global last_accepted_sp\n"
1765 ,"$w set $last_accepted_sp\n"
1766 ,"}\n"
1767 ,"set f $w.nb.optimizer\n"
1768 ,"ttk::labelframe $f.optframe -text \"Optimization settings\" -relief groove -borderwidth 3\n"
1769 ,"pack $f.optframe -fill x -pady 15\n"
1770 ,"ttk::label $f.optframe.sosl -text \"Surface opt steps\"\n"
1771 ,"ttk::spinbox $f.optframe.soss -from 0 -to 99 -textvariable options.optsteps2d -width 5 -increment 1 -validate focus -validatecommand \"my_validatespinbox %W %P 0\" \\\n"
1772 ,"-invalidcommand \"my_invalidspinbox %W\"\n"
1773 ,"grid $f.optframe.sosl $f.optframe.soss -sticky nw;\n"
1774 ,"ttk::label $f.optframe.vosl -text \"Volume opt steps\"\n"
1775 ,"ttk::spinbox $f.optframe.voss -from 0 -to 99 -textvariable options.optsteps3d -width 5 -increment 1 -validate focus -validatecommand \"my_validatespinbox %W %P 0\" \\\n"
1776 ,"-invalidcommand \"my_invalidspinbox %W\"\n"
1777 ,"grid $f.optframe.vosl $f.optframe.voss -sticky nw;\n"
1778 ,"ttk::label $f.optframe.eswl -text \"Element size weight\"\n"
1779 ,"ttk::spinbox $f.optframe.esws -from 0 -to 1 -textvariable options.elsizeweight -width 5 -increment 0.1 -validate focus -validatecommand \"my_validatespinbox %W %P 1\" \\\n"
1780 ,"-invalidcommand \"my_invalidspinbox %W\"\n"
1781 ,"grid $f.optframe.eswl $f.optframe.esws -sticky nw;\n"
1782 ,"ttk::label $f.optframe.weml -text \"Worst element measure\"\n"
1783 ,"ttk::spinbox $f.optframe.wems -from 1 -to 10 -textvariable options.opterrpow -width 5 -increment 1 -validate focus -validatecommand \"my_validatespinbox %W %P 0\" \\\n"
1784 ,"-invalidcommand \"my_invalidspinbox %W\"\n"
1785 ,"grid $f.optframe.weml $f.optframe.wems -sticky nw;\n"
1786 ,"grid anchor $f.optframe center\n"
1787 ,"proc roundscale_helper_osx {w val} {\n"
1788 ,"global [$w cget -variable] options.badellimit\n"
1789 ,"set [$w cget -variable] [tcl::mathfunc::round $val]\n"
1790 ,"set options.badellimit [expr [tcl::mathfunc::round $val]+160]\n"
1791 ,"}\n"
1792 ,"proc my_validate_helper_osx {w val} {\n"
1793 ,"if {[string length $val] == 0} {return 0}\n"
1794 ,"if {[string is double $val] == 1} {\n"
1795 ,"set scale_loc [lindex [winfo children [winfo parent $w]] [lsearch [winfo children [winfo parent $w]] *scale]]\n"
1796 ,"global [$scale_loc cget -variable] options.badellimit\n"
1797 ,"set [$scale_loc cget -variable] [tcl::mathfunc::max [$scale_loc cget -from] [tcl::mathfunc::min [$scale_loc cget -to] [expr [tcl::mathfunc::round $val]-160]]]\n"
1798 ,"set options.badellimit [tcl::mathfunc::max [expr [$scale_loc cget -from]+160] [tcl::mathfunc::min [expr [$scale_loc cget -to]+160] [tcl::mathfunc::round $val]]]\n"
1799 ,"return 1\n"
1800 ,"} else {\n"
1801 ,"return 0\n"
1802 ,"}\n"
1803 ,"}\n"
1804 ,"proc my_invalid_helper_osx {w} {\n"
1805 ,"global options.badellimit\n"
1806 ,"set scale_loc [lindex [winfo children [winfo parent $w]] [lsearch [winfo children [winfo parent $w]] *scale]]\n"
1807 ,"global [$scale_loc cget -variable]\n"
1808 ,"set [$scale_loc cget -variable] [tcl::mathfunc::round [$scale_loc get]]\n"
1809 ,"set options.badellimit [expr [tcl::mathfunc::round [$scale_loc get]]+160]\n"
1810 ,"}\n"
1811 ,"global dummy_badellimit\n"
1812 ,"set dummy_badellimit 15\n"
1813 ,"ttk::labelframe $f.optframe2 -text \"Bad elements\" -relief groove -borderwidth 3\n"
1814 ,"pack $f.optframe2 -fill x -pady 15 -ipady 5\n"
1815 ,"ttk::frame $f.optframe2.badellimit\n"
1816 ,"ttk::label $f.optframe2.lab -text \"bad element criterion\";\n"
1817 ,"ttk::scale $f.optframe2.scale -orient horizontal -length 100 -from 00 -to 20 -variable dummy_badellimit -takefocus 0 -command \"roundscale_helper_osx $f.optframe2.scale\"\n"
1818 ,"ttk::entry $f.optframe2.entry -textvariable options.badellimit -width 3 -validate focusout -takefocus 0 -validatecommand \"my_validate_helper_osx %W %P\" \\\n"
1819 ,"-invalidcommand \"my_invalid_helper_osx %W\"\n"
1820 ,"grid $f.optframe2.scale $f.optframe2.entry $f.optframe2.lab -padx 4 -sticky nw\n"
1821 ,"grid anchor $f.optframe2 center\n"
1822 ,"set f $w.nb.debug\n"
1823 ,"ttk::labelframe $f.f2 -text \"Advanced options\" -borderwidth 3 -relief groove\n"
1824 ,"pack $f.f2 -fill x -pady 15\n"
1825 ,"set f $f.f2\n"
1826 ,"ttk::checkbutton $f.localh -text \"Use Local Meshsize\" \\\n"
1827 ,"-variable options.localh\n"
1828 ,"ttk::checkbutton $f.delauney -text \"Use Delaunay\" \\\n"
1829 ,"-variable options.delaunay\n"
1830 ,"ttk::checkbutton $f.checkoverlap -text \"Check Overlapping\" \\\n"
1831 ,"-variable options.checkoverlap\n"
1832 ,"ttk::checkbutton $f.checkcb -text \"Check Chart Boundary\" \\\n"
1833 ,"-variable options.checkchartboundary\n"
1834 ,"ttk::checkbutton $f.blockfill -text \"Do Blockfilling\" \\\n"
1835 ,"-variable options.blockfill\n"
1836 ,"grid $f.localh  $f.delauney -sticky nw\n"
1837 ,"grid $f.checkoverlap $f.blockfill -sticky nw\n"
1838 ,"grid $f.checkcb -sticky nw\n"
1839 ,"grid anchor $f center\n"
1840 ,"set f $w.nb.debug\n"
1841 ,"proc enable_cb {w1 w2 w3} {\n"
1842 ,"Ng_SetDebugParameters\n"
1843 ,"if {[string match *selected* [$w1 state]] == 1 } {\n"
1844 ,"$w2 configure -state normal\n"
1845 ,"$w3 configure -state normal\n"
1846 ,"} else {\n"
1847 ,"$w2 configure -state disabled\n"
1848 ,"$w3 configure -state disabled\n"
1849 ,"}\n"
1850 ,"}\n"
1851 ,"ttk::labelframe $f.cb1 -text \"Debugging options\" -borderwidth 3 -relief groove\n"
1852 ,"pack $f.cb1 -fill x -pady 15\n"
1853 ,"ttk::checkbutton $f.cb1.slowchecks -text \"Slow checks\" \\\n"
1854 ,"-variable debug.slowchecks -command { Ng_SetDebugParameters }\n"
1855 ,"ttk::checkbutton $f.cb1.debugoutput -text \"Debugging outout\" \\\n"
1856 ,"-variable debug.debugoutput -command { Ng_SetDebugParameters }\n"
1857 ,"ttk::checkbutton $f.cb1.haltexline -text \"Halt on existing line\" \\\n"
1858 ,"-variable debug.haltexistingline  -command { Ng_SetDebugParameters }\n"
1859 ,"ttk::checkbutton $f.cb1.haltoverlap -text \"Halt on Overlap\" \\\n"
1860 ,"-variable debug.haltoverlap  -command { Ng_SetDebugParameters }\n"
1861 ,"ttk::checkbutton $f.cb1.haltsuc -text \"Halt on success\" \\\n"
1862 ,"-variable debug.haltsuccess  -command { Ng_SetDebugParameters }\n"
1863 ,"ttk::checkbutton $f.cb1.haltnosuc -text \"Halt on no success\" \\\n"
1864 ,"-variable debug.haltnosuccess  -command { Ng_SetDebugParameters }\n"
1865 ,"ttk::checkbutton $f.cb1.haltlargequal -text \"Halt on large quality class\" \\\n"
1866 ,"-variable debug.haltlargequalclass  -command { Ng_SetDebugParameters }\n"
1867 ,"ttk::checkbutton $f.cb1.haltseg -text \"Halt on Segment:\" \\\n"
1868 ,"-variable debug.haltsegment  -command { Ng_SetDebugParameters }\n"
1869 ,"ttk::checkbutton $f.cb1.haltnode -text \"Halt on Node:\" \\\n"
1870 ,"-variable debug.haltnode  -command { Ng_SetDebugParameters }\n"
1871 ,"ttk::frame $f.cb1.fr\n"
1872 ,"ttk::checkbutton $f.cb1.fr.cb -text \"Halt on Face:\" \\\n"
1873 ,"-variable debug.haltface -command { Ng_SetDebugParameters }\n"
1874 ,"ttk::entry $f.cb1.fr.ent -textvariable debug.haltfacenr -width 3\n"
1875 ,"pack $f.cb1.fr.cb $f.cb1.fr.ent -side left\n"
1876 ,"ttk::frame $f.cb1.segs\n"
1877 ,"ttk::label $f.cb1.segs.lab1 -text \"P1:\"\n"
1878 ,"ttk::entry $f.cb1.segs.ent1 -width 6 \\\n"
1879 ,"-textvariable debug.haltsegmentp1\n"
1880 ,"ttk::label $f.cb1.segs.lab2 -text \"P2:\"\n"
1881 ,"ttk::entry $f.cb1.segs.ent2 -width 6 \\\n"
1882 ,"-textvariable debug.haltsegmentp2\n"
1883 ,"pack $f.cb1.segs.lab1 $f.cb1.segs.ent1 $f.cb1.segs.lab2 $f.cb1.segs.ent2 -side left\n"
1884 ,"grid $f.cb1.slowchecks $f.cb1.debugoutput -sticky nw\n"
1885 ,"grid $f.cb1.haltexline $f.cb1.haltoverlap -sticky nw\n"
1886 ,"grid $f.cb1.haltsuc $f.cb1.haltnosuc  -sticky nw\n"
1887 ,"grid $f.cb1.haltlargequal  $f.cb1.fr -sticky nw\n"
1888 ,"grid $f.cb1.haltnode -sticky nw\n"
1889 ,"grid $f.cb1.haltseg  -stick nw\n"
1890 ,"grid $f.cb1.segs -stick w -row 4 -rowspan 2 -column 1\n"
1891 ,"grid rowconfigure $f.cb1 3 -pad 8\n"
1892 ,"grid anchor $f.cb1 center\n"
1893 ,"ttk::checkbutton $f.cb1.showactivechart -text \"Show Active Meshing-Chart\" -variable stloptions.showactivechart -command { Ng_SetVisParameters; redraw }\n"
1894 ,"grid $f.cb1.showactivechart\n"
1895 ,"grid rowconfigure $f.cb1 3 -pad 8\n"
1896 ,"grid rowconfigure $f.cb1 5 -pad 8\n"
1897 ,"set f $w.nb.debug\n"
1898 ,"ttk::labelframe $f.cont -relief groove -borderwidth 3 -text \"Debugging visualization\"\n"
1899 ,"pack $f.cont -fill x -pady 15\n"
1900 ,"ttk::checkbutton $f.cont.multidrawing -text \"Draw Meshing\" -variable multithread_drawing\n"
1901 ,"ttk::checkbutton $f.cont.multitestmode -text \"Meshing Testmode\" -variable multithread_testmode\n"
1902 ,"ttk::button $f.cont.goon -text \"Go On\" -command { set multithread_pause 0 }\n"
1903 ,"grid $f.cont.multidrawing -sticky nw\n"
1904 ,"grid $f.cont.multitestmode -sticky nw\n"
1905 ,"grid $f.cont.goon -row 0 -rowspan 2 -column 1 -sticky w\n"
1906 ,"grid columnconfigure $f.cont 0 -pad 30\n"
1907 ,"grid columnconfigure $f.cont 1 -pad 20\n"
1908 ,"grid anchor $f.cont center\n"
1909 ,"global userlevel\n"
1910 ,"if { $userlevel < 3} {\n"
1911 ,"$w.nb delete insider\n"
1912 ,"$w.nb delete debug\n"
1913 ,"}\n"
1914 ,"ttk::frame $w.bu\n"
1915 ,"pack $w.bu -fill x -ipady 3\n"
1916 ,"ttk::button $w.bu.apl -text \"Apply\" -command {\n"
1917 ,"Ng_SetMeshingParameters\n"
1918 ,"Ng_SetDebugParameters\n"
1919 ,"}\n"
1920 ,"ttk::button $w.bu.ok -text \"Done\" -command {\n"
1921 ,"Ng_SetMeshingParameters\n"
1922 ,"Ng_SetDebugParameters\n"
1923 ,"wm withdraw .options_dlg\n"
1924 ,"}\n"
1925 ,"pack  $w.bu.apl $w.bu.ok -side left -expand yes\n"
1926 ,"wm withdraw $w\n"
1927 ,"wm geom $w +100+100\n"
1928 ,"wm deiconify $w\n"
1929 ,"wm title $w \"Meshing Options\"\n"
1930 ,"focus .options_dlg\n"
1931 ,"}\n"
1932 ,"}\n"
1933 ,"meshingoptionsdialog\n"
1934 ,"wm withdraw .options_dlg\n"
1935 ,"proc viewingoptionsdialog { } {\n"
1936 ,"global userlevel\n"
1937 ,"set w .viewopts_dlg\n"
1938 ,"if {[winfo exists .viewopts_dlg] == 1} {\n"
1939 ,"wm withdraw $w\n"
1940 ,"wm deiconify $w\n"
1941 ,"focus $w\n"
1942 ,"} {\n"
1943 ,"toplevel $w\n"
1944 ,"pack [ttk::notebook $w.nb]  -fill both -fill both -side top\n"
1945 ,"$w.nb add [ttk::frame $w.nb.general] -text \"General\" -underline 0\n"
1946 ,"$w.nb add [ttk::frame $w.nb.stl] -text \"STL\" -underline 0\n"
1947 ,"$w.nb add [ttk::frame $w.nb.occ] -text \"IGES/STEP\" -underline 0\n"
1948 ,"$w.nb add [ttk::frame $w.nb.mesh] -text \"Mesh\" -underline 0\n"
1949 ,"$w.nb add [ttk::frame $w.nb.light] -text \"Light\" -underline 0\n"
1950 ,"$w.nb add [ttk::frame $w.nb.edges] -text \"Edges\" -underline 0\n"
1951 ,"$w.nb add [ttk::frame $w.nb.misc] -text \"Misc.\" -underline 3\n"
1952 ,"set f $w.nb.general\n"
1953 ,"ttk::labelframe $f.gvop -text \"General viewing options\" -relief groove -borderwidth 3\n"
1954 ,"pack $f.gvop -fill x -pady 15\n"
1955 ,"set f $f.gvop\n"
1956 ,"ttk::checkbutton $f.backcol -text \"White Background\" \\\n"
1957 ,"-variable viewoptions.whitebackground \\\n"
1958 ,"-command { Ng_SetVisParameters; redraw }\n"
1959 ,"ttk::checkbutton $f.cross -text \"Draw Coordinate Cross\" \\\n"
1960 ,"-variable viewoptions.drawcoordinatecross \\\n"
1961 ,"-command { Ng_SetVisParameters; redraw }\n"
1962 ,"ttk::checkbutton $f.color -text \"Draw Color-bar\" \\\n"
1963 ,"-variable viewoptions.drawcolorbar \\\n"
1964 ,"-command { Ng_SetVisParameters; redraw }\n"
1965 ,"ttk::checkbutton $f.netgen -text \"Draw Netgen-logo\" \\\n"
1966 ,"-variable viewoptions.drawnetgenlogo \\\n"
1967 ,"-command { Ng_SetVisParameters; redraw }\n"
1968 ,"grid $f.backcol -sticky nw\n"
1969 ,"grid $f.cross -stick nw\n"
1970 ,"grid $f.color  -sticky nw\n"
1971 ,"grid $f.netgen -sticky nw\n"
1972 ,"menu $f.stylemenu\n"
1973 ,"ttk::menubutton $f.style -menu $f.stylemenu -width 10 -text [ttk::style theme use]\n"
1974 ,"grid $f.style -sticky nw\n"
1975 ,"grid anchor $f center\n"
1976 ,"foreach theme [ttk::themes] {\n"
1977 ,"$f.stylemenu add command -label  $theme \\\n"
1978 ,"-command \" $f.style configure -text $theme; puts $theme ; ttk::setTheme $theme\"\n"
1979 ,"}\n"
1980 ,"set f $w.nb.stl\n"
1981 ,"ttk::labelframe $f.show -relief groove -borderwidth 3 -text \"STL viewing options\"\n"
1982 ,"pack $f.show -fill x -pady 15\n"
1983 ,"ttk::checkbutton $f.show.showtrias -text \"Show STL-Triangles\" \\\n"
1984 ,"-variable stloptions.showtrias -command { Ng_SetVisParameters; redraw }\n"
1985 ,"ttk::checkbutton $f.show.showfilledtrias -text \"Show Filled Triangles\" \\\n"
1986 ,"-variable stloptions.showfilledtrias -command { Ng_SetVisParameters; redraw }\n"
1987 ,"grid $f.show.showtrias $f.show.showfilledtrias -sticky nw\n"
1988 ,"ttk::checkbutton $f.show.showactivechart -text \"Show Active Meshing-Chart\" \\\n"
1989 ,"-variable stloptions.showactivechart -command { Ng_SetVisParameters; redraw }\n"
1990 ,"ttk::checkbutton $f.show.showedges -text \"Show Edges\" \\\n"
1991 ,"-variable stloptions.showedges -command { Ng_SetVisParameters; redraw }\n"
1992 ,"grid $f.show.showactivechart $f.show.showedges -sticky nw\n"
1993 ,"grid anchor $f.show center\n"
1994 ,"ttk::checkbutton $f.show.showmarktrias -text \"Show Chart Triangles\" \\\n"
1995 ,"-variable stloptions.showmarktrias \\\n"
1996 ,"-command {set stldoctor.showfaces 0; Ng_STLDoctor; Ng_SetVisParameters; redraw }\n"
1997 ,"ttk::checkbutton $f.show.showfaces -text \"Show Faces\" \\\n"
1998 ,"-variable stldoctor.showfaces \\\n"
1999 ,"-command {set stloptions.showmarktrias 0; Ng_STLDoctor; Ng_SetVisParameters; redraw}\n"
2000 ,"grid $f.show.showmarktrias $f.show.showfaces -sticky nw\n"
2001 ,"ttk::labelframe $f.fn -relief groove -borderwidth 3 -text \"Chart/Face number\"\n"
2002 ,"pack $f.fn -fill x\n"
2003 ,"ttk::label $f.fn.lab3 -text \"Chart/Face number\"\n"
2004 ,"ttk::scale $f.fn.scale3 -orient horizontal -length 150 -from 0 -to 200 \\\n"
2005 ,"-variable stloptions.chartnumber -command \"Ng_SetVisParameters; redraw;roundscale $f.fn.scale3 0\"\n"
2006 ,"ttk::entry $f.fn.ent3 -textvariable stloptions.chartnumber -width 3 -validate focus -takefocus 0 \\\n"
2007 ,"-validatecommand \"Ng_SetVisParameters; redraw;my_validate %W [$f.fn.scale3 cget -from] [$f.fn.scale3 cget -to] %P 0\" \\\n"
2008 ,"-invalidcommand \"my_invalid %W;Ng_SetVisParameters; redraw;\"\n"
2009 ,"grid $f.fn.scale3 $f.fn.ent3 $f.fn.lab3 -sticky nw -padx 4\n"
2010 ,"tk::label $f.fn.lab -text \"Chart/Face Offset:\";\n"
2011 ,"ttk::entry $f.fn.ent -width 3 \\\n"
2012 ,"-textvariable stloptions.chartnumberoffset -validate focus -takefocus 0 \\\n"
2013 ,"-validatecommand \"my_validate %W 0 1e9 %P 0\" \\\n"
2014 ,"-invalidcommand \"my_invalid %W\"\n"
2015 ,"ttk::button $f.fn.btn_write_chart -text \"Write selected chart to chart.stlb\" -command {\n"
2016 ,"Ng_STLDoctor writechart\n"
2017 ,"}\n"
2018 ,"grid $f.fn.lab -sticky ne -padx 4\n"
2019 ,"grid $f.fn.ent -sticky nw -padx 4 -row 1 -column 1\n"
2020 ,"grid $f.fn.btn_write_chart -padx 4 -row 2 -column 1\n"
2021 ,"grid anchor $f.fn center\n"
2022 ,"ttk::labelframe $f.advstl -text \"Advanced STL options\" -relief groove -borderwidth 3\n"
2023 ,"pack $f.advstl -fill x -pady 15\n"
2024 ,"ttk::checkbutton $f.advstl.bu1 -text \"Show Marked (Dirty) Triangles\" \\\n"
2025 ,"-variable stldoctor.showmarkedtrigs \\\n"
2026 ,"-command {Ng_STLDoctor; redraw}\n"
2027 ,"ttk::checkbutton $f.advstl.bu2 -text \"show edge corner points\" \\\n"
2028 ,"-variable stldoctor.showedgecornerpoints \\\n"
2029 ,"-command {Ng_STLDoctor; redraw}\n"
2030 ,"ttk::checkbutton $f.advstl.bu3 -text \"show touched triangle chart\" \\\n"
2031 ,"-variable stldoctor.showtouchedtrigchart \\\n"
2032 ,"-command {set stldoctor.showfaces 0; set stloptions.showmarktrias 1; \\\n"
2033 ,"Ng_STLDoctor; Ng_SetVisParameters; redraw}\n"
2034 ,"ttk::checkbutton $f.advstl.bu4 -text \"draw meshed edges\" \\\n"
2035 ,"-variable stldoctor.drawmeshededges \\\n"
2036 ,"-command {Ng_STLDoctor;}\n"
2037 ,"ttk::checkbutton $f.advstl.bu5 -text \"select with mouse\" \\\n"
2038 ,"-variable stldoctor.selectwithmouse\n"
2039 ,"grid $f.advstl.bu1 -stick nw\n"
2040 ,"grid $f.advstl.bu2 -sticky nw\n"
2041 ,"grid $f.advstl.bu3 -stick nw\n"
2042 ,"grid $f.advstl.bu4 -stick nw\n"
2043 ,"grid $f.advstl.bu5 -stick nw\n"
2044 ,"grid anchor $f.advstl center\n"
2045 ,"ttk::frame $f.advstl.tbn\n"
2046 ,"ttk::label $f.advstl.tbn.lab -text \"Select triangle by number\";\n"
2047 ,"ttk::entry $f.advstl.tbn.ent -width 5 \\\n"
2048 ,"-textvariable stldoctor.selecttrig\n"
2049 ,"pack $f.advstl.tbn.lab $f.advstl.tbn.ent -padx 4 -side left\n"
2050 ,"grid $f.advstl.tbn -sticky nw\n"
2051 ,"grid anchor $f.advstl center\n"
2052 ,"grid rowconfigure $f.advstl 4 -pad 8\n"
2053 ,"ttk::labelframe $f.vc -relief groove -borderwidth 3 -text \"Vicinity options\"\n"
2054 ,"pack $f.vc -fill x -pady 15\n"
2055 ,"ttk::checkbutton $f.vc.bu -text \"show vicinity\" \\\n"
2056 ,"-variable stldoctor.showvicinity \\\n"
2057 ,"-command {Ng_STLDoctor vicinity; redraw}\n"
2058 ,"ttk::label $f.vc.lab -text \"vicinity size\";\n"
2059 ,"ttk::scale $f.vc.scale -orient horizontal -length 150 -from 0 -to 200 \\\n"
2060 ,"-variable stldoctor.vicinity \\\n"
2061 ,"-takefocus 0 \\\n"
2062 ,"-command \"roundscale $f.vc.scale 0; Ng_STLDoctor vicinity; redraw\"\n"
2063 ,"ttk::entry $f.vc.ent -width 4 -textvariable stldoctor.vicinity -validate focus \\\n"
2064 ,"-takefocus 0 -validatecommand \"Ng_STLDoctor vicinity; redraw;my_validate %W [$f.vc.scale cget -from] [$f.vc.scale cget -to] %P 0\" \\\n"
2065 ,"-invalidcommand \"my_invalid %W;Ng_STLDoctor vicinity; redraw\"\n"
2066 ,"grid $f.vc.bu -stick nw -columnspan 3 -column 0\n"
2067 ,"grid $f.vc.scale $f.vc.ent $f.vc.lab -sticky nw -padx 4\n"
2068 ,"grid anchor $f.vc center\n"
2069 ,"set f $w.nb.occ\n"
2070 ,"ttk::labelframe $f.occframe -text \"IGES/STEP options\" -relief groove -borderwidth 3\n"
2071 ,"pack $f.occframe -fill x -pady 15 -ipady 8\n"
2072 ,"ttk::checkbutton $f.occframe.occshowsurfaces -text \"Show surfaces \" \\\n"
2073 ,"-variable occoptions.showsurfaces \\\n"
2074 ,"-command { Ng_SetOCCVisParameters; redraw }\n"
2075 ,"ttk::checkbutton $f.occframe.occshowedges -text \"Show edges \" \\\n"
2076 ,"-variable occoptions.showedges \\\n"
2077 ,"-command { Ng_SetOCCVisParameters; redraw }\n"
2078 ,"grid $f.occframe.occshowsurfaces $f.occframe.occshowedges -sticky nw -padx 4\n"
2079 ,"grid anchor $f.occframe center\n"
2080 ,"ttk::button $f.occframe.btn -text \"Rebuild visualization data\" \\\n"
2081 ,"-command {\n"
2082 ,"Ng_SetOCCVisParameters\n"
2083 ,"Ng_OCCCommand buildvisualizationmesh\n"
2084 ,"redraw\n"
2085 ,"}\n"
2086 ,"ttk::frame $f.occframe.vssm\n"
2087 ,"ttk::label $f.occframe.vssm.lab -text \"Visulization smoothness\"\n"
2088 ,"ttk::spinbox $f.occframe.vssm.sp -textvariable occoptions.deflection \\\n"
2089 ,"-from 0.1 -to 3 -increment 0.1 -width 4 -command { catch Ng_SetOCCVisParameters } \\\n"
2090 ,"-validate focus -validatecommand \"my_validatespinbox %W %P 0\" \\\n"
2091 ,"-invalidcommand \"my_invalidspinbox %W\"\n"
2092 ,"pack $f.occframe.vssm.lab $f.occframe.vssm.sp -side left -padx 4\n"
2093 ,"grid $f.occframe.vssm -sticky nw -columnspan 2 -column 0 -pady 8\n"
2094 ,"grid $f.occframe.btn -columnspan 2 -column 0 -sticky n\n"
2095 ,"ttk::labelframe $f.occframe1 -relief groove -borderwidth 3 -text \"ACIS visulization / construction\"\n"
2096 ,"pack $f.occframe1 -fill x -pady 15 -ipady 8\n"
2097 ,"ttk::label $f.occframe1.lab1 -text \"Show solid (0 for all)\"\n"
2098 ,"ttk::spinbox $f.occframe1.sp1 -textvariable occoptions.showsolidnr \\\n"
2099 ,"-from 0 -to 999 -increment 1 -width 4 -command { catch Ng_SetOCCVisParameters;redraw } \\\n"
2100 ,"-validate focus -validatecommand \"my_validatespinbox %W %P 0\" \\\n"
2101 ,"-invalidcommand \"my_invalidspinbox %W\"\n"
2102 ,"ttk::label $f.occframe1.lab2 -text \"Show solid 2\"\n"
2103 ,"ttk::spinbox $f.occframe1.sp2 -textvariable occoptions.showsolidnr2 \\\n"
2104 ,"-from 0 -to 999 -increment 1 -width 4 -command { catch Ng_SetOCCVisParameters;redraw } \\\n"
2105 ,"-validate focus -validatecommand \"my_validatespinbox %W %P 0\" \\\n"
2106 ,"-invalidcommand \"my_invalidspinbox %W\"\n"
2107 ,"ttk::button $f.occframe1.subtract -text \"Subtract (2 minus 1)\" \\\n"
2108 ,"-command {\n"
2109 ,"Ng_ACISCommand subtract ${occoptions.showsolidnr} ${occoptions.showsolidnr2}\n"
2110 ,"redraw\n"
2111 ,"}\n"
2112 ,"ttk::button $f.occframe1.combine -text \"Combine all\" \\\n"
2113 ,"-command {\n"
2114 ,"Ng_ACISCommand combineall\n"
2115 ,"redraw\n"
2116 ,"}\n"
2117 ,"grid $f.occframe1.lab1 -row 0 -column 0 -sticky ne\n"
2118 ,"grid $f.occframe1.sp1 -row 0 -column 1 -sticky nw\n"
2119 ,"grid $f.occframe1.lab2 -row 1 -column 0 -sticky ne\n"
2120 ,"grid $f.occframe1.sp2 -row 1 -column 1 -sticky nw\n"
2121 ,"grid $f.occframe1.combine -columnspan 2 -column 0 -sticky n\n"
2122 ,"grid anchor $f.occframe1 center\n"
2123 ,"set f $w.nb.mesh\n"
2124 ,"ttk::labelframe $f.center -relief groove -borderwidth 3 -text \"how shall i name you?\"\n"
2125 ,"pack $f.center -fill x -pady 15\n"
2126 ,"ttk::button $f.center.lab1 -text \"Set Center Point\" \\\n"
2127 ,"-command { Ng_SetVisParameters; Ng_Center; redraw }\n"
2128 ,"ttk::entry $f.center.ent1 -width 5 \\\n"
2129 ,"-textvariable viewoptions.centerpoint -validate focus \\\n"
2130 ,"-validatecommand \"my_validate %W 0 1e9 %P 0\" \\\n"
2131 ,"-invalidcommand \"my_invalid %W\"\n"
2132 ,"grid $f.center.ent1 $f.center.lab1 -padx 4 -pady 4 -sticky nw\n"
2133 ,"ttk::button $f.center.lab2 -text \"Draw Element\" \\\n"
2134 ,"-command { Ng_SetVisParameters; Ng_ZoomAll; redraw }\n"
2135 ,"ttk::entry $f.center.ent2 -width 5 \\\n"
2136 ,"-textvariable viewoptions.drawelement -validate focus \\\n"
2137 ,"-validatecommand \"my_validate %W 0 1e9 %P 0\" \\\n"
2138 ,"-invalidcommand \"my_invalid %W\"\n"
2139 ,"grid $f.center.ent2 $f.center.lab2 -padx 4 -pady 4 -sticky nw\n"
2140 ,"grid anchor $f.center center\n"
2141 ,"ttk::labelframe $f.meshframe -text \"Mesh visualization options\" -relief groove -borderwidth 3\n"
2142 ,"pack $f.meshframe -fill x -pady 15\n"
2143 ,"set f $f.meshframe\n"
2144 ,"ttk::checkbutton $f.showcolor -text \"Meshsize Visualization\" \\\n"
2145 ,"-variable viewoptions.colormeshsize \\\n"
2146 ,"-command { Ng_SetVisParameters;redraw; }\n"
2147 ,"ttk::checkbutton $f.showfilledtrigs -text \"Show filled triangles\" \\\n"
2148 ,"-variable viewoptions.drawfilledtrigs \\\n"
2149 ,"-command { Ng_SetVisParameters; redraw }\n"
2150 ,"ttk::checkbutton $f.showedges -text \"Show edges\" \\\n"
2151 ,"-variable viewoptions.drawedges \\\n"
2152 ,"-command { Ng_SetVisParameters; redraw }\n"
2153 ,"ttk::checkbutton $f.showoutline -text \"Show Triangle Outline\" \\\n"
2154 ,"-variable viewoptions.drawoutline \\\n"
2155 ,"-command { Ng_SetVisParameters; redraw }\n"
2156 ,"ttk::checkbutton $f.showbadels -text \"Show bad elements\" \\\n"
2157 ,"-variable viewoptions.drawbadels \\\n"
2158 ,"-command { Ng_SetVisParameters; redraw }\n"
2159 ,"ttk::checkbutton $f.showprisms -text \"Show prisms\" \\\n"
2160 ,"-variable viewoptions.drawprisms \\\n"
2161 ,"-command { Ng_SetVisParameters; redraw }\n"
2162 ,"ttk::checkbutton $f.showpyramids -text \"Show pyramids\" \\\n"
2163 ,"-variable viewoptions.drawpyramids \\\n"
2164 ,"-command { Ng_SetVisParameters; redraw }\n"
2165 ,"ttk::checkbutton $f.showhexes -text \"Show hexes\" \\\n"
2166 ,"-variable viewoptions.drawhexes \\\n"
2167 ,"-command { Ng_SetVisParameters; redraw }\n"
2168 ,"ttk::checkbutton $f.showidentified -text \"Show identified points\" \\\n"
2169 ,"-variable viewoptions.drawidentified \\\n"
2170 ,"-command { Ng_SetVisParameters; redraw }\n"
2171 ,"ttk::checkbutton $f.showmetispartition -text \"Show METIS Partition\" \\\n"
2172 ,"-variable viewoptions.drawmetispartition \\\n"
2173 ,"-command { Ng_SetVisParameters; redraw }\n"
2174 ,"ttk::checkbutton $f.showpointnumbers -text \"Show Point-numbers\" \\\n"
2175 ,"-variable viewoptions.drawpointnumbers \\\n"
2176 ,"-command { Ng_SetVisParameters; redraw }\n"
2177 ,"ttk::checkbutton $f.showedgenumbers -text \"Show Edge-numbers\" \\\n"
2178 ,"-variable viewoptions.drawedgenumbers \\\n"
2179 ,"-command { Ng_SetVisParameters; redraw }\n"
2180 ,"ttk::checkbutton $f.showfacenumbers -text \"Show Face-numbers\" \\\n"
2181 ,"-variable viewoptions.drawfacenumbers \\\n"
2182 ,"-command { Ng_SetVisParameters; redraw }\n"
2183 ,"ttk::checkbutton $f.showelementnumbers -text \"Show Element-numbers\" \\\n"
2184 ,"-variable viewoptions.drawelementnumbers \\\n"
2185 ,"-command { Ng_SetVisParameters; redraw }\n"
2186 ,"ttk::frame $f.frametets\n"
2187 ,"ttk::checkbutton $f.frametets.showtets -text \"\" \\\n"
2188 ,"-variable viewoptions.drawtets \\\n"
2189 ,"-command { Ng_SetVisParameters; redraw }\n"
2190 ,"ttk::label $f.frametets.label -text \"\\Show Tets\\rin domain\"\n"
2191 ,"ttk::spinbox $f.frametets.showtetsdomain -from 0 -to 500 -increment 1 -width 3 \\\n"
2192 ,"-textvariable viewoptions.drawtetsdomain -validate focus \\\n"
2193 ,"-command \"Ng_SetVisParameters; redraw;\" \\\n"
2194 ,"-validatecommand \"my_validatespinbox %W %P 0\" \\\n"
2195 ,"-invalidcommand \"my_invalidspinbox %W\"\n"
2196 ,"ttk::label $f.frametets.label1 -text \"Subdivision\"\n"
2197 ,"ttk::spinbox $f.frametets.subdiv -from 0 -to 8 -increment 1 -width 3 \\\n"
2198 ,"-textvariable visoptions.subdivisions -validate focus \\\n"
2199 ,"-command { Ng_SetVisParameters; Ng_Vis_Set parameters; Ng_SetNextTimeStamp; redraw } \\\n"
2200 ,"-validatecommand \"my_validatespinbox %W %P 0\" \\\n"
2201 ,"-invalidcommand \"my_invalidspinbox %W\"\n"
2202 ,"ttk::label $f.frametets.label2 -text \"Show surface\\rof domain\"\n"
2203 ,"ttk::spinbox $f.frametets.showdomain -from 0 -to 50 -increment 1 -width 3 \\\n"
2204 ,"-textvariable viewoptions.drawdomainsurf -validate focus \\\n"
2205 ,"-command { Ng_SetVisParameters; Ng_Vis_Set parameters; redraw } \\\n"
2206 ,"-validatecommand \"my_validatespinbox %W %P 0\" \\\n"
2207 ,"-invalidcommand \"my_invalidspinbox %W\"\n"
2208 ,"grid $f.frametets.showtets $f.frametets.label $f.frametets.showtetsdomain -sticky w\n"
2209 ,"grid x $f.frametets.label2 $f.frametets.showdomain -stick w\n"
2210 ,"grid x $f.frametets.label1 $f.frametets.subdiv -sticky w\n"
2211 ,"grid $f.showfilledtrigs $f.showoutline -sticky nw\n"
2212 ,"grid $f.showedges $f.showbadels -sticky nw\n"
2213 ,"grid $f.showpointnumbers $f.showedgenumbers -sticky nw\n"
2214 ,"grid $f.showfacenumbers $f.showelementnumbers -sticky nw\n"
2215 ,"grid $f.showmetispartition $f.showidentified -sticky nw\n"
2216 ,"grid $f.showcolor $f.showpyramids -sticky nw\n"
2217 ,"grid $f.showprisms $f.showhexes -sticky nw\n"
2218 ,"grid  $f.frametets -sticky n -columnspan 2 -column 0 -pady 8\n"
2219 ,"grid anchor $f center\n"
2220 ,"set f $w.nb.mesh\n"
2221 ,"ttk::labelframe $f.fshrink -text \"Element visualization\" -relief groove -borderwidth 3\n"
2222 ,"ttk::label $f.fshrink.lab -text \"Shrink elements\"\n"
2223 ,"ttk::scale $f.fshrink.scale -orient horizontal -length 200 -from 0 -to 1.0001 \\\n"
2224 ,"-command \"roundscale $f.fshrink.scale 2;Ng_SetVisParameters; after idle redraw\" \\\n"
2225 ,"-variable  viewoptions.shrink\n"
2226 ,"ttk::entry $f.fshrink.entry -textvariable viewoptions.shrink -width 4 -validate focus \\\n"
2227 ,"-takefocus 0 -validatecommand \"Ng_SetVisParameters; after idle redraw;my_validate %W [$f.fshrink.scale cget -from] [$f.fshrink.scale cget -to] %P 2\" \\\n"
2228 ,"-invalidcommand \"my_invalid %W;Ng_SetVisParameters; after idle redraw;\"\n"
2229 ,"pack $f.fshrink -fill x -ipady 8\n"
2230 ,"grid $f.fshrink.scale $f.fshrink.entry $f.fshrink.lab -padx 4\n"
2231 ,"grid anchor $f.fshrink center\n"
2232 ,"set f $w.nb.light\n"
2233 ,"ttk::labelframe $f.main -text \"Lighting options\" -relief groove -borderwidth 3\n"
2234 ,"pack $f.main -fill x -pady 15\n"
2235 ,"set f $f.main\n"
2236 ,"ttk::label $f.lab1 -text \"Ambient Light\"\n"
2237 ,"ttk::scale $f.scale1 -orient horizontal -length 200 -from 0 -to 1 \\\n"
2238 ,"-command \"roundscale $f.scale1 2; Ng_SetVisParameters; redraw\" \\\n"
2239 ,"-variable viewoptions.light.amb\n"
2240 ,"ttk::entry $f.ent1 -textvariable viewoptions.light.amb -validate focus -width 4 \\\n"
2241 ,"-validatecommand \" Ng_SetVisParameters; redraw;my_validate %W [$f.scale1 cget -from] [$f.scale1 cget -to] %P 2\" \\\n"
2242 ,"-invalidcommand \"my_invalid %W;Ng_SetVisParameters; redraw;\"\n"
2243 ,"ttk::label $f.lab2 -text \"Diffuse Light\"\n"
2244 ,"ttk::scale $f.scale2 -orient horizontal -length 200 -from 0 -to 1 \\\n"
2245 ,"-command \"roundscale $f.scale2 2; Ng_SetVisParameters; redraw \" \\\n"
2246 ,"-variable  viewoptions.light.diff\n"
2247 ,"ttk::entry $f.ent2 -textvariable viewoptions.light.diff -validate focus -width 4 \\\n"
2248 ,"-validatecommand \" Ng_SetVisParameters; redraw;my_validate %W [$f.scale2 cget -from] [$f.scale2 cget -to] %P 2\" \\\n"
2249 ,"-invalidcommand \"my_invalid %W;Ng_SetVisParameters; redraw;\"\n"
2250 ,"ttk::label $f.lab3 -text \"Specular Light\"\n"
2251 ,"ttk::scale $f.scale3 -orient horizontal -length 200 -from 0 -to 1 \\\n"
2252 ,"-command \"roundscale $f.scale3 2; Ng_SetVisParameters; redraw \" \\\n"
2253 ,"-variable  viewoptions.light.spec\n"
2254 ,"ttk::entry $f.ent3 -textvariable viewoptions.light.spec -validate focus -width 4 \\\n"
2255 ,"-validatecommand \" Ng_SetVisParameters; redraw;my_validate %W [$f.scale3 cget -from] [$f.scale3 cget -to] %P 2\" \\\n"
2256 ,"-invalidcommand \"my_invalid %W;Ng_SetVisParameters; redraw;\"\n"
2257 ,"grid $f.scale1 $f.ent1 $f.lab1 -sticky nw -padx 4 -pady 8\n"
2258 ,"grid $f.scale2 $f.ent2 $f.lab2 -sticky nw -padx 4 -pady 8\n"
2259 ,"grid $f.scale3 $f.ent3 $f.lab3 -sticky nw -padx 4 -pady 8\n"
2260 ,"grid anchor $f center\n"
2261 ,"set f $w.nb.light\n"
2262 ,"ttk::labelframe $f.main1 -text \"Material options\" -relief groove -borderwidth 3\n"
2263 ,"pack $f.main1 -fill x -pady 15\n"
2264 ,"set f $f.main1\n"
2265 ,"ttk::label $f.lab4 -text \"Material Shininess\"\n"
2266 ,"ttk::scale $f.scale4 -orient horizontal -length 200 -from 0 -to 128 \\\n"
2267 ,"-command \"roundscale $f.scale4 0; Ng_SetVisParameters; redraw \" \\\n"
2268 ,"-variable  viewoptions.mat.shininess\n"
2269 ,"ttk::entry $f.ent4 -textvariable viewoptions.mat.shininess -validate focus -width 4 \\\n"
2270 ,"-validatecommand \" Ng_SetVisParameters; redraw;my_validate %W [$f.scale4 cget -from] [$f.scale4 cget -to] %P 0\" \\\n"
2271 ,"-invalidcommand \"my_invalid %W;Ng_SetVisParameters; redraw;\"\n"
2272 ,"ttk::label $f.lab5 -text \"Material Transparency\"\n"
2273 ,"ttk::scale $f.scale5 -orient horizontal -length 200 -from 0 -to 1 \\\n"
2274 ,"-command \"roundscale $f.scale5 2; Ng_SetVisParameters; redraw \" \\\n"
2275 ,"-variable  viewoptions.mat.transp\n"
2276 ,"ttk::entry $f.ent5 -textvariable viewoptions.mat.transp -validate focus -width 4 \\\n"
2277 ,"-validatecommand \" Ng_SetVisParameters; redraw;my_validate %W [$f.scale5 cget -from] [$f.scale5 cget -to] %P 2\" \\\n"
2278 ,"-invalidcommand \"my_invalid %W;Ng_SetVisParameters; redraw;\"\n"
2279 ,"grid $f.scale4 $f.ent4 $f.lab4 -sticky nw -padx 4 -pady 8\n"
2280 ,"grid $f.scale5 $f.ent5 $f.lab5 -sticky nw -padx 4 -pady 8\n"
2281 ,"grid anchor $f center\n"
2282 ,"set f $w.nb.edges\n"
2283 ,"ttk::labelframe $f.main -text \"Edge viewing options\" -relief groove -borderwidth 3\n"
2284 ,"pack $f.main -fill x -pady 15\n"
2285 ,"set f $f.main\n"
2286 ,"ttk::frame $f.helper\n"
2287 ,"pack $f.helper -anchor center\n"
2288 ,"set f $f.helper\n"
2289 ,"ttk::checkbutton $f.showedges -text \"Show Edges\" \\\n"
2290 ,"-variable viewoptions.drawededges \\\n"
2291 ,"-command { Ng_SetVisParameters; redraw }\n"
2292 ,"ttk::checkbutton $f.showpoints -text \"Show Points\" \\\n"
2293 ,"-variable viewoptions.drawedpoints \\\n"
2294 ,"-command { Ng_SetVisParameters; redraw }\n"
2295 ,"ttk::checkbutton $f.showpointnrs -text \"Show Points Nrs\" \\\n"
2296 ,"-variable viewoptions.drawedpointnrs \\\n"
2297 ,"-command { Ng_SetVisParameters; redraw }\n"
2298 ,"ttk::checkbutton $f.showtang -text \"Show CP Tangents\" \\\n"
2299 ,"-variable viewoptions.drawedtangents \\\n"
2300 ,"-command { Ng_SetVisParameters; redraw }\n"
2301 ,"ttk::checkbutton $f.drawedgenrs -text \"Show Edge Nrs\" \\\n"
2302 ,"-variable viewoptions.drawededgenrs \\\n"
2303 ,"-command { Ng_SetVisParameters; redraw }\n"
2304 ,"pack $f.showedges $f.showpoints $f.showpointnrs $f.showtang $f.drawedgenrs -anchor w\n"
2305 ,"set f $w.nb.edges\n"
2306 ,"ttk::labelframe $f.main1 -text \"Center point\" -relief groove -borderwidth 3\n"
2307 ,"pack $f.main1 -fill x -pady 15\n"
2308 ,"set f $f.main1\n"
2309 ,"ttk::frame $f.center\n"
2310 ,"pack $f.center -anchor center\n"
2311 ,"ttk::button $f.center.btn -text \"Set Center Point\" \\\n"
2312 ,"-command { Ng_SetVisParameters; Ng_Center; redraw }\n"
2313 ,"ttk::entry $f.center.ent -width 5 -textvariable viewoptions.centerpoint -validate focus \\\n"
2314 ,"-validatecommand \"my_validate %W 0 1e9 %P 0\" \\\n"
2315 ,"-invalidcommand \"my_invalid %W\"\n"
2316 ,"grid $f.center.ent $f.center.btn -sticky nw -padx 4\n"
2317 ,"ttk::label $f.center.lab1 -text \"SpecPoint Veclen\"\n"
2318 ,"ttk::entry $f.center.ent1 -width 5 -textvariable viewoptions.specpointvlen -validate focus \\\n"
2319 ,"-validatecommand \"my_validate %W 0 1e9 %P 4\" \\\n"
2320 ,"-invalidcommand \"my_invalid %W\"\n"
2321 ,"grid $f.center.ent1 $f.center.lab1 -sticky nw -padx 4\n"
2322 ,"set f $w.nb.misc\n"
2323 ,"ttk::labelframe $f.point -relief groove -borderwidth 3 -text \"Special point\"\n"
2324 ,"ttk::frame $f.point.dp\n"
2325 ,"ttk::checkbutton $f.point.dp.drawpoint -text \"Draw Point\" \\\n"
2326 ,"-variable viewoptions.drawspecpoint \\\n"
2327 ,"-command { Ng_SetVisParameters; redraw }\n"
2328 ,"ttk::entry $f.point.dp.px -width 8 -textvariable viewoptions.specpointx -validate focus \\\n"
2329 ,"-validatecommand \"my_validate %W -1e9 1e9 %P 10\" \\\n"
2330 ,"-invalidcommand \"my_invalid %W\"\n"
2331 ,"ttk::entry $f.point.dp.py -width 8 -textvariable viewoptions.specpointy -validate focus \\\n"
2332 ,"-validatecommand \"my_validate %W -1e9 1e9 %P 10\" \\\n"
2333 ,"-invalidcommand \"my_invalid %W\"\n"
2334 ,"ttk::entry $f.point.dp.pz -width 8 -textvariable viewoptions.specpointz -validate focus \\\n"
2335 ,"-validatecommand \"my_validate %W -1e9 1e9 %P 10\" \\\n"
2336 ,"-invalidcommand \"my_invalid %W\"\n"
2337 ,"grid $f.point.dp.drawpoint $f.point.dp.px $f.point.dp.py $f.point.dp.pz -sticky nw -padx 4;\n"
2338 ,"ttk::checkbutton $f.point.dp.center -text \"Use as Center\" \\\n"
2339 ,"-variable viewoptions.usecentercoords \\\n"
2340 ,"-command {\n"
2341 ,"if { ${viewoptions.usecentercoords} } {\n"
2342 ,"set viewoptions.centerx ${viewoptions.specpointx}\n"
2343 ,"set viewoptions.centery ${viewoptions.specpointy}\n"
2344 ,"set viewoptions.centerz ${viewoptions.specpointz}\n"
2345 ,"Ng_SetVisParameters; Ng_Center\n"
2346 ,"redraw\n"
2347 ,"} {\n"
2348 ,"Ng_SetVisParameters\n"
2349 ,"}\n"
2350 ,"}\n"
2351 ,"grid $f.point.dp.center -sticky nw -padx 4\n"
2352 ,"pack $f.point.dp\n"
2353 ,"pack $f.point -fill x -ipady 3 -pady 15\n"
2354 ,"ttk::frame $w.bu\n"
2355 ,"pack $w.bu -fill x -ipady 3\n"
2356 ,"ttk::button $w.bu.done -text \"Done\" -command {\n"
2357 ,"Ng_SetVisParameters;\n"
2358 ,"redraw\n"
2359 ,"destroy .viewopts_dlg\n"
2360 ,"}\n"
2361 ,"ttk::button $w.bu.apply -text \"Apply\" -command {\n"
2362 ,"Ng_SetVisParameters;\n"
2363 ,"redraw\n"
2364 ,"}\n"
2365 ,"pack $w.bu.apply $w.bu.done -expand yes -side left\n"
2366 ,"wm withdraw $w\n"
2367 ,"wm geom $w +100+100\n"
2368 ,"wm deiconify $w\n"
2369 ,"wm title $w \"Viewing options\"\n"
2370 ,"focus $w\n"
2371 ,"}\n"
2372 ,"}\n"
2373 ,"proc clipplanecommand { { optionalvar 0 } } {\n"
2374 ,"Ng_SetVisParameters\n"
2375 ,"after idle redraw\n"
2376 ,"}\n"
2377 ,"set clippingdialog_pop1 0\n"
2378 ,"set clippingdialog_pop2 0\n"
2379 ,"set clippingdialog_pop3 0\n"
2380 ,"set clippingdialog_pop4 0\n"
2381 ,"proc clippingdialog { } {\n"
2382 ,"global clippingdialog_pop1\n"
2383 ,"global clippingdialog_pop2\n"
2384 ,"global clippingdialog_pop3\n"
2385 ,"global clippingdialog_pop4\n"
2386 ,"set clippingdialog_pop1 1\n"
2387 ,"set clippingdialog_pop2 1\n"
2388 ,"set clippingdialog_pop3 1\n"
2389 ,"set clippingdialog_pop4 1\n"
2390 ,"set w .clipping_dlg\n"
2391 ,"if {[winfo exists .clipping_dlg] == 1} {\n"
2392 ,"wm withdraw $w\n"
2393 ,"wm deiconify $w\n"
2394 ,"focus $w\n"
2395 ,"} {\n"
2396 ,"toplevel $w\n"
2397 ,"ttk::frame $w.background\n"
2398 ,"pack $w.background -fill x -fill y\n"
2399 ,"set w $w.background\n"
2400 ,"ttk::labelframe $w.main -text \"Visual clipping\" -relief groove -borderwidth 3\n"
2401 ,"pack $w.main -fill x -pady 15\n"
2402 ,"set w $w.main\n"
2403 ,"ttk::label $w.lab1 -text \"Normal x\"\n"
2404 ,"ttk::scale $w.scale1 -orient horizontal -length 300 -from -1 -to 1 \\\n"
2405 ,"-variable  viewoptions.clipping.nx \\\n"
2406 ,"-command \"roundscale $w.scale1 2; clipplanecommand \"\n"
2407 ,"ttk::entry $w.entry1 -width 5 -textvariable  viewoptions.clipping.nx \\\n"
2408 ,"-validate focus -validatecommand \" clipplanecommand;my_validate %W [$w.scale1 cget -from] [$w.scale1 cget -to] %P 2\" \\\n"
2409 ,"-invalidcommand \"my_invalid %W; clipplanecommand\"\n"
2410 ,"ttk::label $w.lab2 -text \"Normal y\"\n"
2411 ,"ttk::scale $w.scale2 -orient horizontal -length 300 -from -1 -to 1 \\\n"
2412 ,"-variable  viewoptions.clipping.ny \\\n"
2413 ,"-command \"roundscale $w.scale2 2; clipplanecommand \"\n"
2414 ,"ttk::entry $w.entry2 -width 5 -textvariable  viewoptions.clipping.ny \\\n"
2415 ,"-validate focus -validatecommand \" clipplanecommand;my_validate %W [$w.scale2 cget -from] [$w.scale2 cget -to] %P 2\" \\\n"
2416 ,"-invalidcommand \"my_invalid $w.entry2;clipplanecommand\"\n"
2417 ,"ttk::label $w.lab3 -text \"Normal z\"\n"
2418 ,"ttk::scale $w.scale3 -orient horizontal -length 300 -from -1 -to 1 \\\n"
2419 ,"-variable  viewoptions.clipping.nz \\\n"
2420 ,"-command \"roundscale $w.scale3 2; clipplanecommand \"\n"
2421 ,"ttk::entry $w.entry3 -width 5 -textvariable  viewoptions.clipping.nz \\\n"
2422 ,"-validate focus -validatecommand \" clipplanecommand;my_validate %W [$w.scale3 cget -from] [$w.scale3 cget -to] %P 2\" \\\n"
2423 ,"-invalidcommand \"my_invalid %W;clipplanecommand\"\n"
2424 ,"ttk::label $w.lab4 -text \"Distance\"\n"
2425 ,"ttk::scale $w.scale4 -orient horizontal -length 300 -from -1 -to 1.001 \\\n"
2426 ,"-variable  viewoptions.clipping.dist \\\n"
2427 ,"-command \"roundscale $w.scale4 3; clipplanecommand \"\n"
2428 ,"ttk::entry $w.entry4 -width 5 -textvariable  viewoptions.clipping.dist \\\n"
2429 ,"-validate focus -validatecommand \" clipplanecommand;my_validate %W [$w.scale4 cget -from] [$w.scale4 cget -to] %P 3\" \\\n"
2430 ,"-invalidcommand \"my_invalid %W;clipplanecommand\"\n"
2431 ,"proc my_Press {w x y} {\n"
2432 ,"set inc [expr {([$w get $x $y] <= [$w get]) ? -1 : 1}]\n"
2433 ,"ttk::Repeatedly ttk::scale::Increment $w [expr 0.001*$inc]\n"
2434 ,"}\n"
2435 ,"bind $w.scale4 <ButtonPress-1> { if { [string match *slider [%W identify %x %y]] == 0 } { my_Press %W %x %y;break } }\n"
2436 ,"bind $w.scale4 <ButtonRelease-1> {ttk::scale::Release %W %x %y}\n"
2437 ,"ttk::label $w.lab5 -text \"Additional\\rDistance\"\n"
2438 ,"ttk::scale $w.scale5 -orient horizontal -length 300 -from -1 -to 1.001 \\\n"
2439 ,"-variable  viewoptions.clipping.dist2 \\\n"
2440 ,"-command \"roundscale $w.scale5 3; clipplanecommand \"\n"
2441 ,"ttk::entry $w.entry5 -width 5 -textvariable  viewoptions.clipping.dist2 \\\n"
2442 ,"-validate focus -validatecommand \" clipplanecommand;my_validate %W [$w.scale5 cget -from] [$w.scale5 cget -to] %P 3\" \\\n"
2443 ,"-invalidcommand \"my_invalid %W;clipplanecommand\"\n"
2444 ,"bind $w.scale5 <ButtonPress-1> { if { [string match *slider [%W identify %x %y]] == 0 } { my_Press %W %x %y;break } }\n"
2445 ,"bind $w.scale5 <ButtonRelease-1> {ttk::scale::Release %W %x %y}\n"
2446 ,"ttk::label $w.clipdomainlabel -text \"Clip only domain\"\n"
2447 ,"ttk::spinbox $w.clipdomainspinb -from 0 -to 500 -increment 1 -width 3 \\\n"
2448 ,"-textvariable viewoptions.clipping.onlydomain -validate focus \\\n"
2449 ,"-command {clipplanecommand;} \\\n"
2450 ,"-validatecommand \"my_validatespinbox %W %P 0\" \\\n"
2451 ,"-invalidcommand \"my_invalidspinbox %W\"\n"
2452 ,"ttk::label $w.donotclipdomainlabel -text \"Do not clip domain\"\n"
2453 ,"ttk::spinbox $w.donotclipdomainspinb -from 0 -to 500 -increment 1 -width 3 \\\n"
2454 ,"-textvariable viewoptions.clipping.notdomain -validate focus \\\n"
2455 ,"-command \"clipplanecommand\" \\\n"
2456 ,"-validatecommand \"my_validatespinbox %W %P 0\" \\\n"
2457 ,"-invalidcommand \"my_invalidspinbox %W\"\n"
2458 ,"grid $w.scale1 $w.entry1 $w.lab1 -sticky nw -padx 4 -pady 14\n"
2459 ,"grid $w.scale2 $w.entry2 $w.lab2 -sticky nw -padx 4 -pady 14\n"
2460 ,"grid $w.scale3 $w.entry3 $w.lab3 -sticky nw -padx 4 -pady 14\n"
2461 ,"grid $w.scale4 $w.entry4 $w.lab4 -sticky nw -padx 4 -pady 14\n"
2462 ,"grid $w.scale5 $w.entry5 $w.lab5 -sticky w -padx 4 -pady 14\n"
2463 ,"grid $w.clipdomainlabel -sticky ne -padx 4 -pady 14\n"
2464 ,"grid $w.clipdomainspinb -sticky nw -padx 4 -pady 14 -column 1 -row 5\n"
2465 ,"grid $w.donotclipdomainlabel -sticky ne -padx 4 -pady 14\n"
2466 ,"grid $w.donotclipdomainspinb -sticky nw -padx 4 -pady 14 -column 1 -row 6\n"
2467 ,"grid anchor $w center\n"
2468 ,"set w .clipping_dlg.background.main\n"
2469 ,"ttk::checkbutton $w.cb1 -text \"Enable clipping\" \\\n"
2470 ,"-variable viewoptions.clipping.enable \\\n"
2471 ,"-command { Ng_SetVisParameters; redraw }\n"
2472 ,"grid  $w.cb1 -columnspan 2 -sticky ne\n"
2473 ,"ttk::frame $w.bu\n"
2474 ,"grid $w.bu;\n"
2475 ,"ttk::button $w.cancle -text \"Done\" -command \"destroy .clipping_dlg\"\n"
2476 ,"grid $w.cancle -columnspan 3 -pady 16\n"
2477 ,"set w .clipping_dlg\n"
2478 ,"wm withdraw $w\n"
2479 ,"wm geom $w +100+100\n"
2480 ,"wm deiconify $w\n"
2481 ,"wm title $w \"Clipping Plane\"\n"
2482 ,"focus $w\n"
2483 ,"clipplanecommand\n"
2484 ,"}\n"
2485 ,"}\n"
2486 ,"proc refinementdialog { } {\n"
2487 ,"set w .refinement_dlg\n"
2488 ,"if {[winfo exists .refinement_dlg] == 1} {\n"
2489 ,"wm withdraw $w\n"
2490 ,"wm deiconify $w\n"
2491 ,"focus $w\n"
2492 ,"} {\n"
2493 ,"toplevel $w\n"
2494 ,"global localh\n"
2495 ,"set localh 1\n"
2496 ,"ttk::frame $w.meshsize\n"
2497 ,"ttk::label $w.meshsize.l1 -text \"max mesh-size: \"\n"
2498 ,"ttk::spinbox $w.meshsize.sp1 -from 1e-6 -to 1e6 -textvariable options.meshsize -validate focus -validatecommand \"my_validatespinbox %W %P 4\" \\\n"
2499 ,"-invalidcommand \"my_invalidspinbox %W\" -width 6 -increment 0.1\n"
2500 ,"ttk::frame $w.meshsizeloc\n"
2501 ,"ttk::label $w.meshsizeloc.l1 -text \"local mesh-size: \"\n"
2502 ,"ttk::spinbox $w.meshsizeloc.sp1 -from 1e-6 -to 1e6 -textvariable localh -validate focus -validatecommand \"my_validatespinbox %W %P 4\" \\\n"
2503 ,"-invalidcommand \"my_invalidspinbox %W\" -width 6 -increment 0.1\n"
2504 ,"pack $w.meshsize\n"
2505 ,"pack $w.meshsizeloc\n"
2506 ,"grid $w.meshsize.l1 $w.meshsize.sp1\n"
2507 ,"grid $w.meshsizeloc.l1 $w.meshsizeloc.sp1\n"
2508 ,"ttk::button $w.restface -text \"Restrict H at face\"  \\\n"
2509 ,"-command {\n"
2510 ,".refinement_dlg.meshsize invoke\n"
2511 ,".refinement_dlg.loch invoke\n"
2512 ,"Ng_RestrictH face $localh\n"
2513 ,"}\n"
2514 ,"ttk::button $w.restedge -text \"Restrict H at edge\"  \\\n"
2515 ,"-command {\n"
2516 ,".refinement_dlg.meshsize invoke\n"
2517 ,".refinement_dlg.loch invoke\n"
2518 ,"Ng_RestrictH edge $localh\n"
2519 ,"}\n"
2520 ,"ttk::button $w.restelement -text \"Restrict H at element\"  \\\n"
2521 ,"-command {\n"
2522 ,".refinement_dlg.meshsize invoke\n"
2523 ,".refinement_dlg.loch invoke\n"
2524 ,"Ng_RestrictH element $localh\n"
2525 ,"}\n"
2526 ,"ttk::button $w.restpoint -text \"Restrict H at point\"  \\\n"
2527 ,"-command {\n"
2528 ,".refinement_dlg.meshsize invoke\n"
2529 ,".refinement_dlg.loch invoke\n"
2530 ,"Ng_RestrictH point $localh\n"
2531 ,"}\n"
2532 ,"pack $w.restface $w.restedge $w.restelement $w.restpoint\n"
2533 ,"ttk::button $w.anisoedge -text \"Declare Anisotropic edge\"  \\\n"
2534 ,"-command {\n"
2535 ,"Ng_Anisotropy edge\n"
2536 ,"}\n"
2537 ,"pack $w.anisoedge\n"
2538 ,"frame $w.bu\n"
2539 ,"pack $w.bu -fill x -ipady 3\n"
2540 ,"ttk::button $w.bu.cancle -text \"Done\" -command \"destroy .refinement_dlg\"\n"
2541 ,"ttk::button $w.bu.refine -text \"Refine\"  \\\n"
2542 ,"-command {\n"
2543 ,"set oldnp 0; set newnp $status_np;\n"
2544 ,"while { $oldnp < $newnp } {\n"
2545 ,"set level [expr $level+1]\n"
2546 ,"Ng_Bisect;\n"
2547 ,"Ng_HighOrder ${options.elementorder}\n"
2548 ,"Ng_ReadStatus;\n"
2549 ,"redraw;\n"
2550 ,"set oldnp $newnp\n"
2551 ,"set newnp $status_np\n"
2552 ,"puts \"oldnp $oldnp newnp $newnp\"\n"
2553 ,"}\n"
2554 ,"}\n"
2555 ,"ttk::button $w.bu.zrefine -text \"Z-Refine\"  \\\n"
2556 ,"-command { Ng_ZRefinement; Ng_ReadStatus; redraw; }\n"
2557 ,"pack $w.bu.zrefine $w.bu.refine $w.bu.cancle  -expand yes -side left\n"
2558 ,"wm withdraw $w\n"
2559 ,"wm geom $w +100+100\n"
2560 ,"wm deiconify $w\n"
2561 ,"wm title $w \"Select Refinement\"\n"
2562 ,"focus $w\n"
2563 ,"}\n"
2564 ,"}\n"
2565 ,"proc bcpropdialog { } {\n"
2566 ,"set w .bcprop_dlg\n"
2567 ,"if {[winfo exists .bcprop_dlg] == 1} {\n"
2568 ,"wm withdraw $w\n"
2569 ,"wm deiconify $w\n"
2570 ,"} {\n"
2571 ,"toplevel $w\n"
2572 ,"ttk::frame $w.face  -borderwidth 3\n"
2573 ,"pack $w.face -fill x\n"
2574 ,"ttk::label $w.face.lab -text \"face index:\"\n"
2575 ,"ttk::label $w.face.ent -text 1\n"
2576 ,"ttk::button $w.face.next -text \"next\" -command {\n"
2577 ,"set w .bcprop_dlg;\n"
2578 ,"set facenr [$w.face.ent cget -text]\n"
2579 ,"if {$facenr == [Ng_BCProp getnfd]} {\n"
2580 ,"set facenr 1\n"
2581 ,"} {\n"
2582 ,"set facenr [expr $facenr + 1]\n"
2583 ,"}\n"
2584 ,"$w.face.ent configure -text $facenr\n"
2585 ,"Ng_BCProp setactive $facenr\n"
2586 ,"set bcnr [Ng_BCProp getbc $facenr]\n"
2587 ,"$w.bc.ent delete 0 end\n"
2588 ,"$w.bc.ent insert 0 $bcnr\n"
2589 ,"redraw\n"
2590 ,"}\n"
2591 ,"ttk::button $w.face.prev -text \"prev\" -command {\n"
2592 ,"set w .bcprop_dlg;\n"
2593 ,"set facenr [$w.face.ent cget -text]\n"
2594 ,"if {$facenr == 1} {\n"
2595 ,"set facenr [Ng_BCProp getnfd]\n"
2596 ,"} {\n"
2597 ,"set facenr [expr $facenr - 1]\n"
2598 ,"}\n"
2599 ,"$w.face.ent configure -text $facenr\n"
2600 ,"Ng_BCProp setactive $facenr\n"
2601 ,"set bcnr [Ng_BCProp getbc $facenr]\n"
2602 ,"$w.bc.ent delete 0 end\n"
2603 ,"$w.bc.ent insert 0 $bcnr\n"
2604 ,"redraw\n"
2605 ,"}\n"
2606 ,"pack $w.face.lab $w.face.ent $w.face.prev $w.face.next  -side left\n"
2607 ,"ttk::frame $w.bc  -borderwidth 3\n"
2608 ,"pack $w.bc -fill x\n"
2609 ,"ttk::label $w.bc.lab -text \"bc property:\"\n"
2610 ,"entry $w.bc.ent -width 5 -relief sunken\n"
2611 ,"ttk::button $w.bc.but -text \"change\" -command {\n"
2612 ,"set w .bcprop_dlg;\n"
2613 ,"Ng_BCProp setbc [$w.face.ent cget -text] [$w.bc.ent get];\n"
2614 ,"}\n"
2615 ,"ttk::button $w.bc.but2 -text \"all\" -command {\n"
2616 ,"set w .bcprop_dlg;\n"
2617 ,"Ng_BCProp setall [$w.bc.ent get];\n"
2618 ,"}\n"
2619 ,"pack $w.bc.lab $w.bc.ent $w.bc.but $w.bc.but2 -side left  -expand yes\n"
2620 ,"ttk::frame $w.bcname  -borderwidth 3\n"
2621 ,"pack $w.bcname -fill x\n"
2622 ,"ttk::label $w.bcname.lab -text \"bc name:\"\n"
2623 ,"ttk::label $w.bcname.ent -text \"-\"\n"
2624 ,"pack $w.bcname.lab $w.bcname.ent -side left  -expand yes\n"
2625 ,"ttk::frame $w.bu\n"
2626 ,"pack $w.bu -fill x -ipady 3\n"
2627 ,"ttk::button $w.bu.close -text \"Close\" -command { destroy .bcprop_dlg }\n"
2628 ,"pack $w.bu.close  -expand yes -side left\n"
2629 ,"wm withdraw $w\n"
2630 ,"wm geom $w +100+100\n"
2631 ,"wm deiconify $w\n"
2632 ,"wm title $w \"Boundary Conditions\"\n"
2633 ,"}\n"
2634 ,"focus $w\n"
2635 ,"set facenr [Ng_BCProp getactive]\n"
2636 ,"$w.face.ent configure -text $facenr\n"
2637 ,"set bcnr [Ng_BCProp getbc $facenr]\n"
2638 ,"$w.bc.ent delete 0 end\n"
2639 ,"$w.bc.ent insert 0 $bcnr\n"
2640 ,"set bcname [Ng_BCProp getbcname $facenr]\n"
2641 ,"$w.bcname.ent configure -text $bcname\n"
2642 ,"}\n"
2643 ,"proc currmeshcoloursdialog { } {\n"
2644 ,"set w .currmeshcolours_dlg\n"
2645 ,"if {[winfo exists .currmeshcolours_dlg] == 1} {\n"
2646 ,"wm withdraw $w\n"
2647 ,"wm deiconify $w\n"
2648 ,"focus $w\n"
2649 ,"} {\n"
2650 ,"toplevel $w\n"
2651 ,"global facecolslist\n"
2652 ,"frame $w.facecols -borderwidth 3\n"
2653 ,"listbox $w.facecols.list -yscroll \"$w.facecols.scroll set\" -selectmode single -setgrid 1 -width 32 -height 12\n"
2654 ,"scrollbar $w.facecols.scroll -command \"$w.facecols.list yview\"\n"
2655 ,"pack $w.facecols.scroll -side right -fill y\n"
2656 ,"pack $w.facecols.list -side left -expand yes -fill both\n"
2657 ,"Ng_CurrentFaceColours getcolours facecolslist\n"
2658 ,"set i 1\n"
2659 ,"foreach el $facecolslist {\n"
2660 ,"set hel [format \"%d: (%.4f %.4f %.4f)\" $i [ lindex $el 0 ] [ lindex $el 1 ] [ lindex $el 2 ]]\n"
2661 ,"incr i\n"
2662 ,"$w.facecols.list insert end $hel }\n"
2663 ,"frame $w.bu1 -borderwidth 3\n"
2664 ,"ttk::button $w.bu1.showonly -text \"show only\" -command {\n"
2665 ,"Ng_CurrentFaceColours showonly [.currmeshcolours_dlg.facecols.list curselection]\n"
2666 ,"redraw\n"
2667 ,"}\n"
2668 ,"ttk::button $w.bu1.hideonly -text \"hide only\" -command {\n"
2669 ,"Ng_CurrentFaceColours hideonly [.currmeshcolours_dlg.facecols.list curselection]\n"
2670 ,"redraw\n"
2671 ,"}\n"
2672 ,"ttk::button $w.bu1.showalso -text \"show\" -command {\n"
2673 ,"Ng_CurrentFaceColours showalso [.currmeshcolours_dlg.facecols.list curselection]\n"
2674 ,"redraw\n"
2675 ,"}\n"
2676 ,"ttk::button $w.bu1.hidealso -text \"hide\" -command {\n"
2677 ,"Ng_CurrentFaceColours hidealso [.currmeshcolours_dlg.facecols.list curselection]\n"
2678 ,"redraw\n"
2679 ,"}\n"
2680 ,"pack $w.bu1.showonly $w.bu1.hideonly $w.bu1.showalso $w.bu1.hidealso -expand yes -fill x -padx 2 -pady 2 -side left\n"
2681 ,"frame $w.bu2\n"
2682 ,"ttk::button $w.bu2.showall -text \"show all\" -command {\n"
2683 ,"Ng_CurrentFaceColours showall\n"
2684 ,"redraw\n"
2685 ,"}\n"
2686 ,"ttk::button $w.bu2.hideall -text \"hide all\" -command {\n"
2687 ,"Ng_CurrentFaceColours hideall\n"
2688 ,"redraw\n"
2689 ,"}\n"
2690 ,"pack $w.bu2.showall $w.bu2.hideall -expand yes -fill x -padx 2 -pady 2 -side left\n"
2691 ,"frame $w.bu3\n"
2692 ,"ttk::button $w.bu3.close -text \"close\" -command {\n"
2693 ,"destroy .currmeshcolours_dlg\n"
2694 ,"}\n"
2695 ,"pack $w.bu3.close -expand yes -fill x -pady 3 -side right\n"
2696 ,"pack $w.facecols -side top -expand yes -fill x -fill y\n"
2697 ,"pack $w.bu3 -side bottom\n"
2698 ,"pack $w.bu2 -side bottom\n"
2699 ,"pack $w.bu1 -expand yes -fill x -side left\n"
2700 ,"wm withdraw $w\n"
2701 ,"wm geom $w +100+100\n"
2702 ,"wm deiconify $w\n"
2703 ,"wm title $w \"Inspect Mesh Colours\"\n"
2704 ,"focus $w\n"
2705 ,"}\n"
2706 ,"}\n"
2707 ,"proc surfacemeshsizedialog { } {\n"
2708 ,"set w .surfacemeshsize_dlg\n"
2709 ,"if {[winfo exists .surfacemeshsize_dlg] == 1} {\n"
2710 ,"wm withdraw $w\n"
2711 ,"wm deiconify $w\n"
2712 ,"} {\n"
2713 ,"toplevel $w\n"
2714 ,"frame $w.face  -borderwidth 3\n"
2715 ,"pack $w.face -fill x -padx 5\n"
2716 ,"ttk::label $w.face.lab -text \"face index:\"\n"
2717 ,"ttk::label $w.face.ent -text 1\n"
2718 ,"ttk::button $w.face.next -text \"next\" -command {\n"
2719 ,"set w .surfacemeshsize_dlg;\n"
2720 ,"set facenr [$w.face.ent cget -text]\n"
2721 ,"if {$facenr == [Ng_SurfaceMeshSize getnfd]} {\n"
2722 ,"set facenr 1\n"
2723 ,"} {\n"
2724 ,"set facenr [expr $facenr + 1]\n"
2725 ,"}\n"
2726 ,"$w.face.ent configure -text $facenr\n"
2727 ,"Ng_SurfaceMeshSize setactive $facenr\n"
2728 ,"set surfms [Ng_SurfaceMeshSize getsurfms $facenr]\n"
2729 ,"$w.sms.ent delete 0 end\n"
2730 ,"$w.sms.ent insert 0 $surfms\n"
2731 ,"redraw\n"
2732 ,"}\n"
2733 ,"ttk::button $w.face.prev -text \"prev\" -command {\n"
2734 ,"set w .surfacemeshsize_dlg;\n"
2735 ,"set facenr [$w.face.ent cget -text]\n"
2736 ,"if {$facenr == 1} {\n"
2737 ,"set facenr [Ng_SurfaceMeshSize getnfd]\n"
2738 ,"} {\n"
2739 ,"set facenr [expr $facenr - 1]\n"
2740 ,"}\n"
2741 ,"$w.face.ent configure -text $facenr\n"
2742 ,"Ng_SurfaceMeshSize setactive $facenr\n"
2743 ,"set surfms [Ng_SurfaceMeshSize getsurfms $facenr]\n"
2744 ,"$w.sms.ent delete 0 end\n"
2745 ,"$w.sms.ent insert 0 $surfms\n"
2746 ,"redraw\n"
2747 ,"}\n"
2748 ,"pack $w.face.lab $w.face.ent $w.face.prev $w.face.next  -side left\n"
2749 ,"frame $w.sms  -borderwidth 3\n"
2750 ,"pack $w.sms -fill x\n"
2751 ,"ttk::label $w.sms.lab -text \"max mesh size:\"\n"
2752 ,"entry $w.sms.ent -width 8 -relief sunken\n"
2753 ,"ttk::button $w.sms.but -text \"change\" -command {\n"
2754 ,"set w .surfacemeshsize_dlg;\n"
2755 ,"Ng_SurfaceMeshSize setsurfms [$w.face.ent cget -text] [$w.sms.ent get];\n"
2756 ,"}\n"
2757 ,"ttk::button $w.sms.but2 -text \"all\" -command {\n"
2758 ,"set w .surfacemeshsize_dlg;\n"
2759 ,"Ng_SurfaceMeshSize setall [$w.sms.ent get];\n"
2760 ,"}\n"
2761 ,"pack $w.sms.lab $w.sms.ent $w.sms.but $w.sms.but2 -side left -padx 5 -expand yes\n"
2762 ,"frame $w.bu\n"
2763 ,"pack $w.bu -fill x -ipady 3\n"
2764 ,"ttk::button $w.bu.close -text \"Close\" -command { destroy .surfacemeshsize_dlg }\n"
2765 ,"pack $w.bu.close  -expand yes -side left\n"
2766 ,"wm withdraw $w\n"
2767 ,"wm geom $w +100+100\n"
2768 ,"wm deiconify $w\n"
2769 ,"wm title $w \"Edit Surface Mesh Size\"\n"
2770 ,"}\n"
2771 ,"focus $w\n"
2772 ,"set facenr [Ng_SurfaceMeshSize getactive]\n"
2773 ,"$w.face.ent configure -text $facenr\n"
2774 ,"set surfms [Ng_SurfaceMeshSize getsurfms $facenr]\n"
2775 ,"$w.sms.ent delete 0 end\n"
2776 ,"$w.sms.ent insert 0 $surfms\n"
2777 ,"}\n"
2778 ,"proc METISdialog { } {\n"
2779 ,"set w .metis_dlg\n"
2780 ,"set w.parts 64\n"
2781 ,"if {[winfo exists .metis_dlg] == 1} {\n"
2782 ,"wm withdraw $w\n"
2783 ,"wm deiconify $w\n"
2784 ,"} {\n"
2785 ,"toplevel $w\n"
2786 ,"frame $w.a -borderwidth 0\n"
2787 ,"frame $w.b -borderwidth 0\n"
2788 ,"pack $w.a $w.b\n"
2789 ,"ttk::label $w.a.lab -text \"Number of partitions:\"\n"
2790 ,"entry $w.a.ent -textvariable w.parts -width 4 -relief sunken\n"
2791 ,"ttk::button $w.b.start -text \"Start METIS\" -command {\n"
2792 ,"Ng_Metis ${w.parts}\n"
2793 ,"redraw\n"
2794 ,"}\n"
2795 ,"ttk::button $w.b.cancel -text \"Cancel\" -command { destroy .metis_dlg }\n"
2796 ,"pack $w.a.lab $w.a.ent -side left  -expand yes\n"
2797 ,"pack $w.b.start $w.b.cancel -side left\n"
2798 ,"wm withdraw $w\n"
2799 ,"wm geom $w +100+100\n"
2800 ,"wm deiconify $w\n"
2801 ,"wm title $w \"METIS Partitioning\"\n"
2802 ,"focus $w\n"
2803 ,"}\n"
2804 ,"}\n"
2805 ,"proc stloptionsdialog { } {\n"
2806 ,"set w .stlopts_dlg\n"
2807 ,"if {[winfo exists .stlopts_dlg] == 1} {\n"
2808 ,"wm withdraw $w\n"
2809 ,"wm deiconify $w\n"
2810 ,"focus $w\n"
2811 ,"} {\n"
2812 ,"toplevel $w\n"
2813 ,"pack [ttk::notebook $w.nb]  -fill both -fill both -side top\n"
2814 ,"frame $w.bu\n"
2815 ,"pack $w.bu -fill x -ipady 3\n"
2816 ,"ttk::button $w.bu.apply -text \"Apply\" -command { redraw; Ng_GenerateMesh 1 2}\n"
2817 ,"ttk::button $w.bu.cancle -text \"Done\" -command { destroy .stlopts_dlg }\n"
2818 ,"pack $w.bu.cancle  $w.bu.apply  -side left -expand yes\n"
2819 ,"wm withdraw $w\n"
2820 ,"wm geom $w +100+100\n"
2821 ,"wm deiconify $w\n"
2822 ,"wm title $w \"STL Options\"\n"
2823 ,"focus $w\n"
2824 ,"}\n"
2825 ,"}\n"
2826 ,"proc stldoctordialog { } {\n"
2827 ,"Ng_STLDoctor\n"
2828 ,"set wd .stldoctor_dlg\n"
2829 ,"if {[winfo exists .stldoctor_dlg] == 1} {\n"
2830 ,"wm withdraw $wd\n"
2831 ,"wm deiconify $wd\n"
2832 ,"focus $wd\n"
2833 ,"} {\n"
2834 ,"toplevel $wd\n"
2835 ,"pack [ttk::notebook $wd.nb] -fill both -fill both -side top\n"
2836 ,"$wd.nb add [ttk::frame $wd.nb.general] -text \"General\" -underline 0\n"
2837 ,"$wd.nb add [ttk::frame $wd.nb.topology] -text \"Edit Topology\" -underline 5\n"
2838 ,"$wd.nb add [ttk::frame $wd.nb.edges] -text \"Edit Edges\" -underline 5\n"
2839 ,"$wd.nb add [ttk::frame $wd.nb.normals] -text \"Edit Normals\" -underline 5\n"
2840 ,"$wd.nb add [ttk::frame $wd.nb.advanced] -text \"Advanced\" -underline 0\n"
2841 ,"set f $wd.nb.general\n"
2842 ,"ttk::frame $f.selectframe -borderwidth 0\n"
2843 ,"ttk::checkbutton $f.selectframe.showtrias -text \"Show STL-Triangles\" \\\n"
2844 ,"-variable stloptions.showtrias -command { Ng_SetVisParameters; redraw }\n"
2845 ,"ttk::checkbutton $f.selectframe.showfilledtrias -text \"Show Filled Triangles\" \\\n"
2846 ,"-variable stloptions.showfilledtrias -command { Ng_SetVisParameters; redraw }\n"
2847 ,"set selmodevals { 0 1 2 3 4 }\n"
2848 ,"set selmodelabs(0) \"triangle\"\n"
2849 ,"set selmodelabs(1) \"edge\"\n"
2850 ,"set selmodelabs(2) \"point\"\n"
2851 ,"set selmodelabs(3) \"line\"\n"
2852 ,"set selmodelabs(4) \"line cluster\"\n"
2853 ,"global stldoctor.selectmode\n"
2854 ,"ttk::label  $f.selectframe.dblcsellab -text \"Double Click selects : \"\n"
2855 ,"ttk::menubutton $f.selectframe.dblcselbut -menu $f.selectframe.dblcselmen -text \"triangle\" -width 16\n"
2856 ,"menu $f.selectframe.dblcselmen  -tearoff 0\n"
2857 ,"foreach selmode { 0 1 2 3 4 } {\n"
2858 ,"$f.selectframe.dblcselmen add command -label $selmodelabs($selmode) \\\n"
2859 ,"-command \"set stldoctor.selectmode $selmode ; Ng_STLDoctor ; $f.selectframe.dblcselbut configure -text \\\"$selmodelabs($selmode)\\\"\"\n"
2860 ,"}\n"
2861 ,"$f.selectframe.dblcselmen invoke $selmodelabs(${stldoctor.selectmode})\n"
2862 ,"pack $f.selectframe\n"
2863 ,"grid $f.selectframe.showtrias -sticky nw\n"
2864 ,"grid $f.selectframe.showfilledtrias -sticky nw\n"
2865 ,"grid $f.selectframe.dblcsellab $f.selectframe.dblcselbut -sticky nw\n"
2866 ,"ttk::frame $f.sm\n"
2867 ,"pack $f.sm -fill x\n"
2868 ,"ttk::checkbutton $f.sm.bu -text \"select with mouse\" \\\n"
2869 ,"-variable stldoctor.selectwithmouse\n"
2870 ,"pack $f.sm.bu\n"
2871 ,"ttk::frame $f.st -relief groove -borderwidth 3\n"
2872 ,"pack $f.st -fill x\n"
2873 ,"ttk::label $f.st.lab -text \"Select triangle by number\";\n"
2874 ,"ttk::entry $f.st.ent -width 5 \\\n"
2875 ,"-textvariable stldoctor.selecttrig\n"
2876 ,"pack $f.st.ent $f.st.lab -side left -expand yes\n"
2877 ,"ttk::frame $f.vc -relief groove -borderwidth 3\n"
2878 ,"pack $f.vc -fill x\n"
2879 ,"ttk::checkbutton $f.vc.bu -text \"show vicinity\" \\\n"
2880 ,"-variable stldoctor.showvicinity \\\n"
2881 ,"-command {Ng_STLDoctor vicinity; redraw}\n"
2882 ,"ttk::label $f.vc.lab -text \"vicinity size\";\n"
2883 ,"ttk::frame $f.vc.sc\n"
2884 ,"ttk::scale $f.vc.sc.scale -orient horizontal -length 200 -from 0 -to 200 \\\n"
2885 ,"-variable stldoctor.vicinity -takefocus 0 -command \"Ng_STLDoctor vicinity; redraw; roundscale $f.vc.sc.scale 0\"\n"
2886 ,"ttk::entry $f.vc.sc.entry -textvariable stldoctor.vicinity -width 3 \\\n"
2887 ,"-validatecommand \"Ng_STLDoctor vicinity; redraw; my_validate %W [$f.vc.sc.scale cget -from] [$f.vc.sc.scale cget -to] %P 0\" \\\n"
2888 ,"-invalidcommand \"my_invalid %W;Ng_STLDoctor vicinity; redraw;\" -validate focus\n"
2889 ,"ttk::label $f.vc.sc.lab -text \"vicinity size\"\n"
2890 ,"grid $f.vc.sc.scale $f.vc.sc.entry $f.vc.sc.lab -sticky nw -padx 4\n"
2891 ,"pack $f.vc.bu $f.vc.lab $f.vc.sc -expand yes\n"
2892 ,"ttk::frame $f.ge -relief groove -borderwidth 0\n"
2893 ,"pack $f.ge -expand yes\n"
2894 ,"ttk::button $f.ge.neighbourangles -text \"calc neighbourangles\" -command {Ng_STLDoctor neighbourangles}\n"
2895 ,"ttk::button $f.ge.showcoords -text \"show coords of touched triangle\" -command {Ng_STLDoctor showcoords}\n"
2896 ,"ttk::button $f.ge.moveptm -text \"move point to middle of trianglepoints\" -command {Ng_STLDoctor movepointtomiddle; redraw}\n"
2897 ,"ttk::button $f.ge.destroy0trigs -text \"destroy 0-volume triangles\" -command {Ng_STLDoctor destroy0trigs}\n"
2898 ,"grid $f.ge.neighbourangles -sticky nw -padx 4 -pady 4\n"
2899 ,"grid $f.ge.showcoords -sticky nw -padx 4 -pady 4\n"
2900 ,"grid $f.ge.moveptm -sticky nw -padx 4 -pady 4\n"
2901 ,"grid $f.ge.destroy0trigs -sticky nw -padx 4 -pady 4\n"
2902 ,"ttk::button $f.ge.cancle -text \"Done\" -command {destroy .stldoctor_dlg }\n"
2903 ,"grid $f.ge.cancle  -sticky nw\n"
2904 ,"set f $wd.nb.topology\n"
2905 ,"ttk::frame $f.oc -relief groove -borderwidth 3\n"
2906 ,"pack $f.oc -pady 3 -ipady 3 -fill y -fill x\n"
2907 ,"ttk::frame $f.oc.oc1 -borderwidth 0\n"
2908 ,"pack $f.oc.oc1\n"
2909 ,"ttk::button $f.oc.oc1.bu -text \"invert orientation \\n of selected trig\" -command {Ng_STLDoctor invertselectedtrig; redraw }\n"
2910 ,"ttk::button $f.oc.oc1.bu2 -text \"orient after \\n selected trig\" -command {Ng_STLDoctor orientafterselectedtrig; redraw }\n"
2911 ,"ttk::button $f.oc.oc1.toperr -text \"mark inconsistent triangles\" -command {Ng_STLDoctor marktoperrortrigs; redraw }\n"
2912 ,"ttk::button $f.oc.oc1.deltrig -text \"delete selected triangle\" -command {Ng_STLDoctor deleteselectedtrig; redraw }\n"
2913 ,"ttk::button $f.oc.oc1.geosmooth -text \"geometric smoothing\" -command {Ng_STLDoctor smoothgeometry; redraw }\n"
2914 ,"grid $f.oc.oc1.bu x $f.oc.oc1.bu2 -sticky nw -padx 4 -pady 4\n"
2915 ,"grid $f.oc.oc1.toperr - x -sticky nw -padx 4 -pady 4\n"
2916 ,"grid $f.oc.oc1.deltrig - x -sticky nw -padx 4 -pady 4\n"
2917 ,"grid $f.oc.oc1.geosmooth - x -sticky nw -padx 4 -pady 4\n"
2918 ,"set f $wd.nb.edges\n"
2919 ,"ttk::frame $f.be -relief groove -borderwidth 3\n"
2920 ,"pack $f.be -fill x\n"
2921 ,"ttk::frame $f.be.frame\n"
2922 ,"pack $f.be.frame -ipady 4 -pady 4\n"
2923 ,"ttk::label $f.be.frame.lab -text \"build edges with yellow angle:\";\n"
2924 ,"ttk::scale $f.be.frame.scale -orient horizontal -length 200 -from 0 -to 200 \\\n"
2925 ,"-variable stloptions.yangle -takefocus 0 -command \"roundscale $f.be.frame.scale 1; Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw\"\n"
2926 ,"ttk::entry $f.be.frame.entry -textvariable stloptions.yangle -width 5 \\\n"
2927 ,"-validatecommand \"Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw;my_validate %W [$f.be.frame.scale cget -from] [$f.be.frame.scale cget -to] %P 1\" \\\n"
2928 ,"-invalidcommand \"my_invalid %W;Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw\" -validate focus\n"
2929 ,"grid $f.be.frame.lab - -sticky nw -padx 4\n"
2930 ,"grid $f.be.frame.scale $f.be.frame.entry -sticky nw -padx 4\n"
2931 ,"ttk::label $f.be.frame.lab2 -text \"continue edges with yellow angle:\";\n"
2932 ,"ttk::scale $f.be.frame.scale2 -orient horizontal -length 200 -from 0 -to 100 \\\n"
2933 ,"-variable stloptions.contyangle -takefocus 0 -command \"roundscale $f.be.frame.scale2 1; Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw\"\n"
2934 ,"ttk::entry $f.be.frame.entry2 -textvariable stloptions.contyangle -width 5 \\\n"
2935 ,"-validatecommand \"Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw;my_validate %W [$f.be.frame.scale2 cget -from] [$f.be.frame.scale2 cget -to] %P 1\" \\\n"
2936 ,"-invalidcommand \"my_invalid %W;Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw\" -validate focus\n"
2937 ,"grid $f.be.frame.lab2 - -sticky nw -padx 4\n"
2938 ,"grid $f.be.frame.scale2 $f.be.frame.entry2 -sticky nw -padx 4\n"
2939 ,"ttk::button $f.be.frame.buildedges -text \"Build Edges\" -command {Ng_STLDoctor buildedges; redraw}\n"
2940 ,"grid $f.be.frame.buildedges - -sticky n -padx 4 -pady 4\n"
2941 ,"ttk::frame $f.se -relief groove -borderwidth 3\n"
2942 ,"pack $f.se -fill x\n"
2943 ,"ttk::checkbutton $f.se.bu -text \"show excluded\" \\\n"
2944 ,"-variable stldoctor.showexcluded \\\n"
2945 ,"-command {Ng_STLDoctor; redraw}\n"
2946 ,"pack $f.se.bu\n"
2947 ,"set edgeselmodevals { 0 1 2 3 4 }\n"
2948 ,"set edgeselmodelabs(0) \"no change\"\n"
2949 ,"set edgeselmodelabs(1) \"undefined\"\n"
2950 ,"set edgeselmodelabs(2) \"confirmed\"\n"
2951 ,"set edgeselmodelabs(3) \"candidate\"\n"
2952 ,"set edgeselmodelabs(4) \"excluded\"\n"
2953 ,"global stldoctor.edgeselectmode\n"
2954 ,"ttk::frame $f.scaleframe -relief groove -borderwidth 0\n"
2955 ,"pack $f.scaleframe -ipadx 4 -pady 4 -expand yes\n"
2956 ,"ttk::label  $f.scaleframe.dblcedgelab -text \"Double Click sets edge :\"\n"
2957 ,"ttk::menubutton $f.scaleframe.dblcledgebut -menu $f.scaleframe.dblcledgem -text \"coarse\" -width 16\n"
2958 ,"menu $f.scaleframe.dblcledgem  -tearoff 0\n"
2959 ,"foreach selectmode { 0 1 2 3 4 } {\n"
2960 ,"$f.scaleframe.dblcledgem add command -label $edgeselmodelabs($selectmode) \\\n"
2961 ,"-command \"set stldoctor.edgeselectmode $selectmode ; $f.scaleframe.dblcledgebut configure -text \\\"$edgeselmodelabs($selectmode)\\\"\"\n"
2962 ,"}\n"
2963 ,"$f.scaleframe.dblcledgem invoke $edgeselmodelabs(${stldoctor.edgeselectmode})\n"
2964 ,"grid $f.scaleframe.dblcedgelab $f.scaleframe.dblcledgebut -sticky n -ipadx 4\n"
2965 ,"ttk::frame $f.edg -relief groove -borderwidth 3\n"
2966 ,"pack $f.edg -fill x -ipadx 4 -ipady 4\n"
2967 ,"ttk::frame $f.edg.f0\n"
2968 ,"pack $f.edg.f0\n"
2969 ,"ttk::button $f.edg.f0.confirmedge -text \"confirm\" -command {Ng_STLDoctor confirmedge; redraw}\n"
2970 ,"ttk::button $f.edg.f0.candidateedge -text \"candidate\" -command {Ng_STLDoctor candidateedge; redraw}\n"
2971 ,"ttk::button $f.edg.f0.excludeedge -text \"exclude\" -command {Ng_STLDoctor excludeedge; redraw}\n"
2972 ,"ttk::button $f.edg.f0.undefinededge -text \"undefined\" -command {Ng_STLDoctor undefinededge; redraw}\n"
2973 ,"pack $f.edg.f0.confirmedge $f.edg.f0.candidateedge $f.edg.f0.excludeedge $f.edg.f0.undefinededge  -side left\n"
2974 ,"ttk::frame $f.edg.fa\n"
2975 ,"pack $f.edg.fa\n"
2976 ,"ttk::button $f.edg.fa.setallundefined -text \"all undefined\" -command {Ng_STLDoctor setallundefinededges; redraw}\n"
2977 ,"ttk::button $f.edg.fa.erasecandidates -text \"candidates to undefined\" -command {Ng_STLDoctor erasecandidateedges; redraw}\n"
2978 ,"pack $f.edg.fa.setallundefined $f.edg.fa.erasecandidates -side left\n"
2979 ,"ttk::frame $f.edg.fb\n"
2980 ,"pack $f.edg.fb\n"
2981 ,"ttk::button $f.edg.fb.confirmcandidates -text \"candidates to confirmed\" -command {Ng_STLDoctor confirmcandidateedges; redraw}\n"
2982 ,"ttk::button $f.edg.fb.confirmedtocandidates -text \"confirmed to candidates\" -command {Ng_STLDoctor confirmedtocandidateedges; redraw}\n"
2983 ,"pack $f.edg.fb.confirmcandidates $f.edg.fb.confirmedtocandidates -side left\n"
2984 ,"ttk::frame $f.edg.f1\n"
2985 ,"ttk::frame $f.edg.f2\n"
2986 ,"ttk::frame $f.edg.f3\n"
2987 ,"ttk::frame $f.edg.f4\n"
2988 ,"pack $f.edg.f1 $f.edg.f2 $f.edg.f3 $f.edg.f4\n"
2989 ,"ttk::button $f.edg.f1.exportedges -text \"export edges\" -command {Ng_STLDoctor exportedges}\n"
2990 ,"ttk::button $f.edg.f1.importedges -text \"import edges\" -command {Ng_STLDoctor importedges; redraw}\n"
2991 ,"ttk::button $f.edg.f1.saveedgedata -text \"save edgedata\" \\\n"
2992 ,"-command {\n"
2993 ,"set types {\n"
2994 ,"{\"Netgen Edgedata\"   {.ned} }\n"
2995 ,"}\n"
2996 ,"set file [tk_getSaveFile -filetypes $types -defaultextension \".ned\"]\n"
2997 ,"if {$file != \"\"} {\n"
2998 ,"Ng_STLDoctor saveedgedata $file\n"
2999 ,"}\n"
3000 ,"}\n"
3001 ,"ttk::button $f.edg.f1.loadedgedata -text \"load edgedata\" \\\n"
3002 ,"-command {\n"
3003 ,"set types {\n"
3004 ,"{\"Netgen Edgedata\"  {.ned} }\n"
3005 ,"}\n"
3006 ,"set file [tk_getOpenFile -filetypes $types -defaultextension \".ned\"]\n"
3007 ,"if {$file != \"\"} {\n"
3008 ,"Ng_STLDoctor loadedgedata $file\n"
3009 ,"puts \"loading done\"\n"
3010 ,"redraw\n"
3011 ,"}\n"
3012 ,"}\n"
3013 ,"ttk::button $f.edg.f1.importAVLedges -text \"import AVL edges\" \\\n"
3014 ,"-command {\n"
3015 ,"set types {{\"Edge file\"  {.edg }}}\n"
3016 ,"set file [tk_getOpenFile -filetypes $types -defaultextension \".edg\"]\n"
3017 ,"if {$file != \"\"} {\n"
3018 ,"Ng_STLDoctor importexternaledges $file;\n"
3019 ,"}\n"
3020 ,"}\n"
3021 ,"pack $f.edg.f1.importAVLedges $f.edg.f1.loadedgedata $f.edg.f1.saveedgedata -side left\n"
3022 ,"ttk::frame $f.edg2 -relief groove -borderwidth 3\n"
3023 ,"pack $f.edg2 -fill x\n"
3024 ,"ttk::label $f.edg2.lab -text \"length (%):\"\n"
3025 ,"scale $f.edg2.sc -orient horizontal -length 200 -from 0 -to 100 \\\n"
3026 ,"-resolution 0.5 \\\n"
3027 ,"-variable stldoctor.longlinefact\n"
3028 ,"ttk::button $f.edg2.undoedge -text \"undo last edge change\" -command {Ng_STLDoctor undoedgechange; redraw}\n"
3029 ,"pack $f.edg2.undoedge -expand yes\n"
3030 ,"set f $wd.nb.normals\n"
3031 ,"ttk::frame $f.dt -relief groove -borderwidth 3\n"
3032 ,"pack $f.dt -fill x\n"
3033 ,"ttk::label $f.dt.lab -text \"dirty triangle factor\";\n"
3034 ,"ttk::entry $f.dt.ent -width 5 \\\n"
3035 ,"-textvariable stldoctor.dirtytrigfact -validatecommand \"Ng_SetSTLParameters;my_validate %W -1e9 1e9 %P 3\" \\\n"
3036 ,"-invalidcommand \"my_invalid %W;Ng_SetSTLParameters\" -validate focus\n"
3037 ,"pack $f.dt.ent $f.dt.lab -side left -expand yes -pady 8\n"
3038 ,"ttk::frame $f.srt -relief groove -borderwidth 3\n"
3039 ,"pack $f.srt -fill x\n"
3040 ,"ttk::button $f.srt.bu -text \"smooth reverted triangles geometric\" -command {Ng_STLDoctor smoothrevertedtrigs; redraw }\n"
3041 ,"ttk::entry $f.srt.ent -width 5 \\\n"
3042 ,"-textvariable stldoctor.smoothangle -validatecommand \"Ng_SetSTLParameters;my_validate %W -1e9 1e9 %P 2\" \\\n"
3043 ,"-invalidcommand \"my_invalid %W;Ng_SetSTLParameters\" -validate focus\n"
3044 ,"pack $f.srt.ent $f.srt.bu -side left  -expand yes -pady 8\n"
3045 ,"ttk::frame $f.bdt -relief groove -borderwidth 3\n"
3046 ,"pack $f.bdt -fill x\n"
3047 ,"ttk::button $f.bdt.bu -text \"mark dirty triangles\" -command {Ng_STLDoctor markdirtytrigs; redraw }\n"
3048 ,"ttk::button $f.bdt.bu2 -text \"smooth dirty triangles normal\" -command {Ng_STLDoctor smoothdirtytrigs; redraw }\n"
3049 ,"pack $f.bdt.bu $f.bdt.bu2 -side left  -expand yes -pady 8\n"
3050 ,"ttk::frame $f.sno -relief groove -borderwidth 3\n"
3051 ,"pack $f.sno -fill x\n"
3052 ,"ttk::frame $f.sno.snoframe -borderwidth 0\n"
3053 ,"ttk::button $f.sno.smoothnormals -text \"smooth normals\" -command { Ng_STLDoctor smoothnormals; redraw}\n"
3054 ,"ttk::scale $f.sno.snoframe.scale -orient horizontal -length 100 -from 0.0 -to 0.8 \\\n"
3055 ,"-variable stldoctor.smoothnormalsweight -takefocus 0 -command \"roundscale $f.sno.snoframe.scale 2;Ng_SetSTLParameters\"\n"
3056 ,"ttk::entry $f.sno.snoframe.entry -textvariable stldoctor.smoothnormalsweight -width 4 \\\n"
3057 ,"-validatecommand \"Ng_SetSTLParameters;my_validate %W [$f.sno.snoframe.scale cget -from] [$f.sno.snoframe.scale cget -to] %P 2\" \\\n"
3058 ,"-invalidcommand \"my_invalid %W;Ng_SetSTLParameters\" -validate focus\n"
3059 ,"ttk::label $f.sno.snoframe.labrough -text \"rough\"\n"
3060 ,"ttk::label $f.sno.snoframe.labsmooth -text \"smooth\"\n"
3061 ,"grid $f.sno.snoframe.labrough $f.sno.snoframe.scale $f.sno.snoframe.labsmooth $f.sno.snoframe.entry -sticky nw -padx 4\n"
3062 ,"pack $f.sno.snoframe $f.sno.smoothnormals -side left -padx 5 -pady 8\n"
3063 ,"ttk::frame $f.no -relief groove -borderwidth 3\n"
3064 ,"pack $f.no -fill x\n"
3065 ,"ttk::button $f.no.marknonsmoothnormals -text \"mark non-smooth triangles\" -command {Ng_STLDoctor marknonsmoothnormals; redraw}\n"
3066 ,"ttk::button $f.no.calcnormals -text \"calculate normals from geometry\" -command {Ng_STLDoctor calcnormals; redraw}\n"
3067 ,"pack $f.no.marknonsmoothnormals $f.no.calcnormals -expand yes -pady 8\n"
3068 ,"set f $wd.nb.advanced\n"
3069 ,"ttk::frame $f.sc\n"
3070 ,"pack $f.sc -fill x\n"
3071 ,"ttk::checkbutton $f.sc.bu -text \"spiral check\" \\\n"
3072 ,"-variable stldoctor.spiralcheck \\\n"
3073 ,"-command {Ng_STLDoctor;}\n"
3074 ,"ttk::checkbutton $f.sc.bu2 -text \"cone check\" \\\n"
3075 ,"-variable stldoctor.conecheck \\\n"
3076 ,"-command {Ng_STLDoctor;}\n"
3077 ,"pack $f.sc.bu $f.sc.bu2\n"
3078 ,"ttk::label $f.gtol_lbl -text \"LoadSTL tolerance factor\"\n"
3079 ,"ttk::spinbox $f.gtol -from 1e-15 -to 0.001 -textvariable stldoctor.geom_tol_fact -width 8\n"
3080 ,"pack $f.gtol_lbl $f.gtol\n"
3081 ,"ttk::button $f.adap -text \"Apply\" -command {\n"
3082 ,"Ng_STLDoctor;\n"
3083 ,"}\n"
3084 ,"pack $f.adap -expand yes\n"
3085 ,"wm withdraw $wd\n"
3086 ,"wm geom $wd +100+100\n"
3087 ,"wm deiconify $wd\n"
3088 ,"wm title $wd \"STL Doctor\"\n"
3089 ,"focus $wd\n"
3090 ,"}\n"
3091 ,"}\n"
3092 ,"proc meshdoctordialog { } {\n"
3093 ,"set w .meshdoc_dlg\n"
3094 ,"global meshdoctor.active\n"
3095 ,"if {[winfo exists .meshdoc_dlg] == 1} {\n"
3096 ,"wm withdraw $w\n"
3097 ,"wm deiconify $w\n"
3098 ,"focus $w\n"
3099 ,"} {\n"
3100 ,"toplevel $w\n"
3101 ,"set meshdoctor.active 1\n"
3102 ,"Ng_MeshDoctor;\n"
3103 ,"ttk::frame $w.vis -relief groove -borderwidth 3\n"
3104 ,"pack $w.vis\n"
3105 ,"ttk::checkbutton $w.vis.showfilledtrigs -text \"Show filled triangles\" \\\n"
3106 ,"-variable viewoptions.drawfilledtrigs \\\n"
3107 ,"-command { Ng_SetVisParameters; redraw }\n"
3108 ,"ttk::checkbutton $w.vis.showedges -text \"Show edges\" \\\n"
3109 ,"-variable viewoptions.drawedges \\\n"
3110 ,"-command { Ng_SetVisParameters; redraw }\n"
3111 ,"ttk::checkbutton $w.vis.showoutline -text \"Show Triangle Outline\" \\\n"
3112 ,"-variable viewoptions.drawoutline \\\n"
3113 ,"-command { Ng_SetVisParameters; redraw }\n"
3114 ,"pack $w.vis.showfilledtrigs  $w.vis.showoutline $w.vis.showedges\n"
3115 ,"ttk::frame $w.markedgedist\n"
3116 ,"ttk::label $w.markedgedist.l -text \"Mark edge dist: \"\n"
3117 ,"ttk::spinbox $w.markedgedist.s -from 0 -to 999 -width 5 -increment 1 -validate focus -validatecommand \"my_validatespinbox %W %P 0\" \\\n"
3118 ,"-invalidcommand \"my_invalidspinbox %W\" -command {Ng_MeshDoctor markedgedist ${meshdoc.markedgedist};redraw} -textvariable meshdoc.markedgedist\n"
3119 ,"pack $w.markedgedist.l $w.markedgedist.s -side left\n"
3120 ,"pack $w.markedgedist\n"
3121 ,"ttk::button $w.deledge -text \"Delete marked segments\" -command {\n"
3122 ,"Ng_MeshDoctor deletemarkedsegments\n"
3123 ,"redraw\n"
3124 ,"}\n"
3125 ,"pack $w.deledge\n"
3126 ,"ttk::button $w.close -text \"Close\" -command {\n"
3127 ,"set meshdoctor.active 0;\n"
3128 ,"Ng_MeshDoctor;\n"
3129 ,"destroy .meshdoc_dlg\n"
3130 ,"}\n"
3131 ,"pack $w.close -expand yes\n"
3132 ,"wm withdraw $w\n"
3133 ,"wm geom $w +100+100\n"
3134 ,"wm deiconify $w\n"
3135 ,"wm title $w \"Mesh Doctor\"\n"
3136 ,"}\n"
3137 ,"}\n"
3138 ,"proc qualityviewdialog { show } {\n"
3139 ,"set w .qualityview_dlg\n"
3140 ,"if {[winfo exists .qualityview_dlg] == 1} {\n"
3141 ,"if { $show == 1 } {\n"
3142 ,"wm withdraw .qualityview_dlg\n"
3143 ,"wm deiconify $w\n"
3144 ,"focus $w\n"
3145 ,"} {\n"
3146 ,"wm withdraw $w\n"
3147 ,"}\n"
3148 ,"} {\n"
3149 ,"toplevel $w\n"
3150 ,"set c $w.c\n"
3151 ,"canvas $c -relief raised -width 450 -height 300\n"
3152 ,"pack $w.c -side top -fill x\n"
3153 ,"set plotFont {Helvetica 12}\n"
3154 ,"set smallFont {Helvetica 12}\n"
3155 ,"$c create line 100 250 400 250 -width 2\n"
3156 ,"$c create line 100 250 100 50 -width 2\n"
3157 ,"for {set i 0} {$i <= 10} {incr i} {\n"
3158 ,"set x [expr {100 + ($i*30)}]\n"
3159 ,"$c create line $x 250 $x 245 -width 2\n"
3160 ,"if { [expr {$i % 2}] == 0 } {\n"
3161 ,"$c create text $x 254 -text [format %1.1f [expr 0.1*$i]] -anchor n -font $plotFont\n"
3162 ,"}\n"
3163 ,"}\n"
3164 ,"global qualbar\n"
3165 ,"global qualbarnull\n"
3166 ,"global qualbaraxis\n"
3167 ,"for {set i 0} {$i <= 5} {incr i} {\n"
3168 ,"set y [expr {250 - ($i*40)}]\n"
3169 ,"$c create line 100 $y 105 $y -width 2\n"
3170 ,"set qualbaraxis($i) \\\n"
3171 ,"[$c create text 96 $y -text [expr $i*50].0 -anchor e -font $plotFont]\n"
3172 ,"}\n"
3173 ,"for {set i 0} {$i < 20} {incr i} {\n"
3174 ,"set x1 [expr {100 + ($i*15) + 2}]\n"
3175 ,"set x2 [expr {$x1+10}]\n"
3176 ,"set y [expr {250 - 10 * $i}]\n"
3177 ,"set qualbar($i) [$c create rectangle $x1 250 $x2 245 -fill blue]\n"
3178 ,"set qualbarnull($i) [$c create text [expr {($x1+$x2)/2}] 245 -text 0 -anchor s -font $smallFont -fill blue]\n"
3179 ,"}\n"
3180 ,"frame $w.bu\n"
3181 ,"pack $w.bu\n"
3182 ,"ttk::button $w.close -text \"Close\" \\\n"
3183 ,"-command {\n"
3184 ,"wm withdraw .qualityview_dlg\n"
3185 ,"set viewqualityplot 0\n"
3186 ,"}\n"
3187 ,"pack $w.close\n"
3188 ,"if { $show == 1 } {\n"
3189 ,"wm withdraw $w\n"
3190 ,"wm geom $w +100+100\n"
3191 ,"wm deiconify $w\n"
3192 ,"wm title $w \"Mesh Quality\"\n"
3193 ,"focus $w\n"
3194 ,"}\n"
3195 ,"}\n"
3196 ,"}\n"
3197 ,"proc memusedialog { show } {\n"
3198 ,"set w .memuse_dlg\n"
3199 ,"if {[winfo exists .memuse_dlg] == 1} {\n"
3200 ,"if { $show == 1 } {\n"
3201 ,"wm withdraw .memuse_dlg\n"
3202 ,"wm deiconify $w\n"
3203 ,"focus $w\n"
3204 ,"} {\n"
3205 ,"wm withdraw $w\n"
3206 ,"}\n"
3207 ,"} {\n"
3208 ,"toplevel $w\n"
3209 ,"set c $w.c\n"
3210 ,"canvas $c -relief raised -width 600 -height 300\n"
3211 ,"pack $w.c -side top -fill x\n"
3212 ,"set plotFont {Helvetica 18}\n"
3213 ,"set smallFont {Helvetica 12}\n"
3214 ,"global memmark\n"
3215 ,"for {set i 0} {$i < 512} { incr i } {\n"
3216 ,"set memmark($i) [$c create line [expr 50+$i] 50 [expr 50+$i] 70 -fill blue]\n"
3217 ,"}\n"
3218 ,"set plotFont {Helvetica 18}\n"
3219 ,"set smallFont {Helvetica 12}\n"
3220 ,"$c create text 50 90 -text \"0 GB\" -anchor n -font $plotFont\n"
3221 ,"$c create text 178 90 -text \"1 GB\" -anchor n -font $plotFont\n"
3222 ,"$c create text 306 90 -text \"2 GB\" -anchor n -font $plotFont\n"
3223 ,"$c create text 434 90 -text \"3 GB\" -anchor n -font $plotFont\n"
3224 ,"$c create text 562 90 -text \"4 GB\" -anchor n -font $plotFont\n"
3225 ,"ttk::frame $w.bu\n"
3226 ,"pack $w.bu\n"
3227 ,"ttk::button $w.close -text \"Close\" \\\n"
3228 ,"-command {\n"
3229 ,"wm withdraw .memuse_dlg\n"
3230 ,"set memuseplot 0\n"
3231 ,"}\n"
3232 ,"pack $w.close\n"
3233 ,"if { $show == 1 } {\n"
3234 ,"wm withdraw $w\n"
3235 ,"wm geom $w +100+100\n"
3236 ,"wm deiconify $w\n"
3237 ,"wm title $w \"Memory Usage\"\n"
3238 ,"focus $w\n"
3239 ,"}\n"
3240 ,"}\n"
3241 ,"}\n"
3242 ,"proc STLinfodialog { show } {\n"
3243 ,"set w .STLinfo_dlg\n"
3244 ,"if {[winfo exists .STLinfo_dlg] == 1} {\n"
3245 ,"if { $show == 1 } {\n"
3246 ,"wm withdraw .STLinfo_dlg\n"
3247 ,"wm deiconify $w\n"
3248 ,"focus $w\n"
3249 ,"} {\n"
3250 ,"wm withdraw $w\n"
3251 ,"}\n"
3252 ,"} {\n"
3253 ,"toplevel $w\n"
3254 ,"set c $w.c\n"
3255 ,"canvas $c -relief raised -width 450 -height 300\n"
3256 ,"pack $w.c -side top -fill x\n"
3257 ,"set plotFont {Helvetica 18}\n"
3258 ,"set smallFont {Helvetica 12}\n"
3259 ,"$c create line 100 250 400 250 -width 2\n"
3260 ,"$c create line 100 250 100 50 -width 2\n"
3261 ,"ttk::frame $w.bu\n"
3262 ,"pack $w.bu\n"
3263 ,"ttk::button $w.close -text \"Close\" \\\n"
3264 ,"-command {\n"
3265 ,"wm withdraw .STLinfo_dlg\n"
3266 ,"}\n"
3267 ,"pack $w.close\n"
3268 ,"if { $show == 1 } {\n"
3269 ,"wm withdraw $w\n"
3270 ,"wm geom $w +100+100\n"
3271 ,"wm deiconify $w\n"
3272 ,"wm title $w \"STL Geometry Info\"\n"
3273 ,"focus $w\n"
3274 ,"}\n"
3275 ,"}\n"
3276 ,"}\n"
3277 ,"proc logwindow { } {\n"
3278 ,"set w .logwindow\n"
3279 ,"if {[winfo exists .logwindow] == 1} {\n"
3280 ,"wm withdraw $w\n"
3281 ,"wm deiconify $w\n"
3282 ,"focus $w\n"
3283 ,"} {\n"
3284 ,"toplevel $w\n"
3285 ,"text $w.edit -yscroll \"$w.scrolly set\" -setgrid 1 -height 12\n"
3286 ,"scrollbar $w.scrolly -command \"$w.edit yview\"\n"
3287 ,"pack $w.edit -side left -fill both -expand 1\n"
3288 ,"pack $w.scrolly -side left -fill both -expand 0\n"
3289 ,".logwindow.edit insert end \"Netgen Log Window\\n\"\n"
3290 ,"wm withdraw $w\n"
3291 ,"wm geom $w +100+100\n"
3292 ,"wm deiconify $w\n"
3293 ,"wm title $w \"Netgen Log\"\n"
3294 ,"focus $w\n"
3295 ,"}\n"
3296 ,"}\n"
3297 ,"proc printtable { tablevar } {\n"
3298 ,"set w newtcltable\n"
3299 ,"while {[winfo exists .$w] == 1} {set w 1$w}\n"
3300 ,"set w .$w\n"
3301 ,"toplevel $w\n"
3302 ,"for {set i 0} {$i < [lindex $tablevar 2]} { incr i } {\n"
3303 ,"frame $w.col$i\n"
3304 ,"for {set j 0} {$j < [lindex $tablevar 1]} { incr j } {\n"
3305 ,"frame $w.col$i.row$j\n"
3306 ,"message $w.col$i.row$j.txt -aspect 10000000 -text [lindex $tablevar [expr 3+[lindex $tablevar 2]*$j+$i]]\n"
3307 ,"pack $w.col$i.row$j.txt\n"
3308 ,"pack $w.col$i.row$j -side top\n"
3309 ,"}\n"
3310 ,"pack $w.col$i -side left\n"
3311 ,"}\n"
3312 ,"wm withdraw $w\n"
3313 ,"wm geom $w +200+100; wm deiconify $w\n"
3314 ,"wm title $w [lindex $tablevar 0]\n"
3315 ,"focus $w\n"
3316 ,"}\n"
3317 ,"set latestwarning 0\n"
3318 ,"proc printwarning { textvar } {\n"
3319 ,"global latestwarning\n"
3320 ,"set latestwarning $textvar\n"
3321 ,"set w warning\n"
3322 ,"while {[winfo exists .$w] == 1} {set w 1$w}\n"
3323 ,"set w .$w\n"
3324 ,"toplevel $w\n"
3325 ,"message $w.mes -aspect 2000 -text \"WARNING:\\n$textvar\"\n"
3326 ,"ttk::button $w.done -text \"Done\" -command \"destroy $w\"\n"
3327 ,"pack $w.mes\n"
3328 ,"pack $w.done\n"
3329 ,"wm withdraw $w\n"
3330 ,"wm deiconify $w\n"
3331 ,"wm title $w \"Warning\"\n"
3332 ,"focus $w\n"
3333 ,"}\n"
3334 ,"proc printlatestwarning { } {\n"
3335 ,"global latestwarning\n"
3336 ,"if {$latestwarning != 0} {printwarning $latestwarning}\n"
3337 ,"}\n"
3338 ,"}\n"
3339 ,"catch {\n"
3340 ,"set oldmousex 0\n"
3341 ,"set oldmousey 0\n"
3342 ,"set toglversion [Ng_GetToglVersion]\n"
3343 ,"puts \"togl-version : $toglversion\"\n"
3344 ,"set toglok 0\n"
3345 ,"if { [Ng_GetToglVersion] == 2 } {\n"
3346 ,"if {[catch {togl .ndraw -width 400 -height 300  -rgba true -double true -depth true -privatecmap false -stereo false -indirect false  -create init  -display draw -reshape reshape }] } {\n"
3347 ,"puts \"no OpenGL\"\n"
3348 ,"} {\n"
3349 ,"set toglok 1\n"
3350 ,"}\n"
3351 ,"} {\n"
3352 ,"if {[catch {togl .ndraw -width 400 -height 300  -rgba true -double true -depth true -privatecmap false -stereo false -indirect false  }] } {\n"
3353 ,"puts \"no OpenGL\"\n"
3354 ,"} {\n"
3355 ,"set toglok 1\n"
3356 ,"}\n"
3357 ,"}\n"
3358 ,"if { $toglok == 1} {\n"
3359 ,"pack .ndraw -expand true -fill both -padx 0 -pady 0\n"
3360 ,"catch { tkdnd::drop_target register .ndraw DND_Files }\n"
3361 ,"bind .ndraw <Button-1> {\n"
3362 ,"set oldmousex %x; set oldmousey %y;\n"
3363 ,"}\n"
3364 ,"bind .ndraw <Button-2> {\n"
3365 ,"set oldmousex %x; set oldmousey %y;\n"
3366 ,"}\n"
3367 ,"bind .ndraw <Button-3> {\n"
3368 ,"set oldmousex %x; set oldmousey %y;\n"
3369 ,"}\n"
3370 ,"bind .ndraw <B1-Motion> {\n"
3371 ,"Ng_MouseMove $oldmousex $oldmousey %x %y $drawmode\n"
3372 ,".ndraw render\n"
3373 ,"set oldmousex %x; set oldmousey %y;\n"
3374 ,"}\n"
3375 ,"bind .ndraw <Double-1> {\n"
3376 ,"Ng_MouseDblClick %x %y\n"
3377 ,".ndraw render\n"
3378 ,"if { [winfo exists .bcprop_dlg] } { bcpropdialog }\n"
3379 ,"if { [winfo exists .surfacemeshsize_dlg] } { surfacemeshsizedialog }\n"
3380 ,"if { [winfo exists .fieldlines_dlg] } { fieldlinesdialog }\n"
3381 ,"}\n"
3382 ,"bind .ndraw <B2-Motion> {\n"
3383 ,"Ng_MouseMove $oldmousex $oldmousey %x %y move\n"
3384 ,".ndraw render\n"
3385 ,"set oldmousex %x; set oldmousey %y;\n"
3386 ,"}\n"
3387 ,"bind .ndraw <B3-Motion> {\n"
3388 ,"if { $tcl_platform(os) == \"Darwin\" } {\n"
3389 ,"Ng_MouseMove $oldmousex $oldmousey %x %y move\n"
3390 ,"} {\n"
3391 ,"Ng_MouseMove $oldmousex $oldmousey %x %y zoom\n"
3392 ,"}\n"
3393 ,".ndraw render\n"
3394 ,"set oldmousex %x; set oldmousey %y;\n"
3395 ,"}\n"
3396 ,"bind .ndraw <Alt-B2-Motion> {\n"
3397 ,"Ng_MouseMove $oldmousex $oldmousey %x %y Move2d\n"
3398 ,".ndraw render\n"
3399 ,"set oldmousex %x; set oldmousey %y;\n"
3400 ,"}\n"
3401 ,"bind .ndraw <Alt-B3-Motion> {\n"
3402 ,"Ng_MouseMove $oldmousex $oldmousey %x %y Zoom2d\n"
3403 ,".ndraw render\n"
3404 ,"set oldmousex %x; set oldmousey %y;\n"
3405 ,"}\n"
3406 ,"}\n"
3407 ,"proc popupcheckredraw { vari { x 0 } } {\n"
3408 ,"upvar $vari varname\n"
3409 ,"if { $varname == 1 } {\n"
3410 ,"set varname 0\n"
3411 ,"} {\n"
3412 ,"Ng_Vis_Set parameters\n"
3413 ,"redraw\n"
3414 ,"}\n"
3415 ,"}\n"
3416 ,"proc popupcheckredraw2 { vari boolvar { x 0 } } {\n"
3417 ,"upvar $vari varname\n"
3418 ,"if { $varname == 1 } {\n"
3419 ,"set varname 0\n"
3420 ,"} {\n"
3421 ,"Ng_SetVisParameters\n"
3422 ,"Ng_Vis_Set parameters\n"
3423 ,"if { $boolvar == 1 } { redraw }\n"
3424 ,"Ng_SetVisParameters\n"
3425 ,"}\n"
3426 ,"}\n"
3427 ,"proc popupcheckredraw3 { vari { x 0 } } {\n"
3428 ,"upvar $vari varname\n"
3429 ,"if { $varname == 1 } {\n"
3430 ,"set varname 0\n"
3431 ,"} {\n"
3432 ,"Ng_Vis_Set parameters\n"
3433 ,"}\n"
3434 ,"}\n"
3435 ,"proc redraw { {x 0} } {\n"
3436 ,"if {[winfo exists .ndraw]} { .ndraw render }\n"
3437 ,"}\n"
3438 ,"bind . <Left> { Ng_MouseMove 0 0 -10 0 rotate; redraw }\n"
3439 ,"bind . <Right> { Ng_MouseMove 0 0 10 0 rotate; redraw }\n"
3440 ,"bind . <Up> { Ng_MouseMove 0 0 0 -10 rotate; redraw }\n"
3441 ,"bind . <Down> { Ng_MouseMove 0 0 0 10 rotate; redraw }\n"
3442 ,"bind . <Shift-Left> { Ng_MouseMove 0 0 -10 0 move; redraw }\n"
3443 ,"bind . <Shift-Right> { Ng_MouseMove 0 0 10 0 move; redraw }\n"
3444 ,"bind . <Shift-Up> { Ng_MouseMove 0 0 0 -10 move; redraw }\n"
3445 ,"bind . <Shift-Down> { Ng_MouseMove 0 0 0 10 move; redraw }\n"
3446 ,"bind . <Control-Up> { Ng_MouseMove 0 0 0 -10 zoom; redraw }\n"
3447 ,"bind . <Control-Down> { Ng_MouseMove 0 0 0 10 zoom; redraw }\n"
3448 ,"bind . <Button-4> \\\n"
3449 ,"{event generate [focus -displayof %W] <MouseWheel> -delta  120}\n"
3450 ,"bind . <Button-5> \\\n"
3451 ,"{event generate [focus -displayof %W] <MouseWheel> -delta -120}\n"
3452 ,"bind . <MouseWheel> { Ng_MouseMove 0 0 0 [expr {%D/-5}] zoom; redraw }\n"
3453 ,"bind .ndraw <<Drop:DND_Files>> {\n"
3454 ,"set filename [join %D \" \"]\n"
3455 ,"set index [string last . $filename]\n"
3456 ,"set type [string range $filename $index+1 end]\n"
3457 ,"set ispde [string match -nocase $type \"pde\"]\n"
3458 ,"set isgeo [expr max([string match -nocase $type \"geo\"],[string match -nocase $type \"in2d\"])]\n"
3459 ,"set ismesh [expr max([string match -nocase $type \"vol\"],[string match -nocase $type \"vol.gz\"])]\n"
3460 ,"set ispy [string match -nocase $type \"py\"]\n"
3461 ,"if {$ispde == 1} {\n"
3462 ,"AddRecentNGSFile $filename;\n"
3463 ,"NGS_LoadPDE  $filename;\n"
3464 ,"SetNumProcHelpMenu\n"
3465 ,"set selectvisual mesh;\n"
3466 ,"Ng_SetVisParameters\n"
3467 ,"}\n"
3468 ,"if {$ispy == 1} {\n"
3469 ,"AddRecentPYNGSFile $filename;\n"
3470 ,"NGS_LoadPy  $filename;\n"
3471 ,"}\n"
3472 ,"if {$isgeo == 1} {\n"
3473 ,"AddRecentFile $filename;\n"
3474 ,"Ng_LoadGeometry $filename;\n"
3475 ,"Ng_ParseGeometry\n"
3476 ,"set selectvisual geometry\n"
3477 ,"Ng_SetVisParameters\n"
3478 ,"redraw\n"
3479 ,"wm title . [concat \"$progname - \" $filename]\n"
3480 ,"set dirname [file dirname $filename]\n"
3481 ,"set basefilename [file tail [file rootname $filename]]\n"
3482 ,"}\n"
3483 ,"if {$ismesh == 1} {\n"
3484 ,"AddRecentMeshFile $filename;\n"
3485 ,"Ng_LoadMesh $filename;\n"
3486 ,"set selectvisual mesh\n"
3487 ,"Ng_SetVisParameters\n"
3488 ,"redraw\n"
3489 ,"Ng_ReadStatus;\n"
3490 ,"wm title . [concat \"$progname - \" %D]\n"
3491 ,"set dirname [file dirname %D]\n"
3492 ,"set basefilename [file tail [file rootname %D]]\n"
3493 ,"}\n"
3494 ,"return %A\n"
3495 ,"}\n"
3496 ,"}\n"
3497 ,"catch { .ngmenu.geometry add command -label \"Scan CSG Geometry\" -command { Ng_ParseGeometry }\n"
3498 ,".ngmenu.geometry add command -label \"CSG Options...\" -command geometryoptionsdialog\n"
3499 ,".ngmenu.geometry add command -label \"CSG Properties...\" \\\n"
3500 ,"-command topleveldialog2\n"
3501 ,"proc geometryoptionsdialog { } {\n"
3502 ,"set w .geometry_dlg\n"
3503 ,"if {[winfo exists .geometry_dlg] == 1} {\n"
3504 ,"wm withdraw $w\n"
3505 ,"wm deiconify $w\n"
3506 ,"focus $w\n"
3507 ,"} {\n"
3508 ,"toplevel $w\n"
3509 ,"global geooptions\n"
3510 ,"Ng_GeometryOptions get\n"
3511 ,"checkbutton $w.drawcsg -text \"Draw Geometry\" \\\n"
3512 ,"-variable geooptions.drawcsg\n"
3513 ,"pack $w.drawcsg\n"
3514 ,"frame $w.fac\n"
3515 ,"pack $w.fac -pady 5\n"
3516 ,"ttk::label $w.fac.lab -text \"Facets:\";\n"
3517 ,"entry $w.fac.ent -width 8 -relief sunken \\\n"
3518 ,"-textvariable geooptions.facets\n"
3519 ,"pack $w.fac.lab $w.fac.ent  -side left\n"
3520 ,"frame $w.det\n"
3521 ,"pack $w.det -pady 5\n"
3522 ,"ttk::label $w.det.lab -text \"Detail:\";\n"
3523 ,"entry $w.det.ent -width 8 -relief sunken \\\n"
3524 ,"-textvariable geooptions.detail\n"
3525 ,"pack $w.det.lab $w.det.ent  -side left\n"
3526 ,"frame $w.cox\n"
3527 ,"pack $w.cox -pady 5\n"
3528 ,"ttk::label $w.cox.lab -text \"min/max x:\";\n"
3529 ,"entry $w.cox.ent1 -width 8 -relief sunken \\\n"
3530 ,"-textvariable geooptions.minx\n"
3531 ,"entry $w.cox.ent2 -width 8 -relief sunken \\\n"
3532 ,"-textvariable geooptions.maxx\n"
3533 ,"pack $w.cox.lab $w.cox.ent1 \\\n"
3534 ,"$w.cox.ent2  -side left\n"
3535 ,"frame $w.coy\n"
3536 ,"pack $w.coy -pady 5\n"
3537 ,"ttk::label $w.coy.lab -text \"min/max y:\";\n"
3538 ,"entry $w.coy.ent1 -width 8 -relief sunken \\\n"
3539 ,"-textvariable geooptions.miny\n"
3540 ,"entry $w.coy.ent2 -width 8 -relief sunken \\\n"
3541 ,"-textvariable geooptions.maxy\n"
3542 ,"pack $w.coy.lab $w.coy.ent1 \\\n"
3543 ,"$w.coy.ent2  -side left\n"
3544 ,"frame $w.coz\n"
3545 ,"pack $w.coz -pady 5\n"
3546 ,"ttk::label $w.coz.lab -text \"min/max z:\";\n"
3547 ,"entry $w.coz.ent1 -width 8 -relief sunken \\\n"
3548 ,"-textvariable geooptions.minz\n"
3549 ,"entry $w.coz.ent2 -width 8 -relief sunken \\\n"
3550 ,"-textvariable geooptions.maxz\n"
3551 ,"pack $w.coz.lab $w.coz.ent1 \\\n"
3552 ,"$w.coz.ent2  -side left\n"
3553 ,"frame $w.bu\n"
3554 ,"pack $w.bu -fill x -ipady 3\n"
3555 ,"ttk::button $w.bu.app -text \"Apply\" -command {\n"
3556 ,"Ng_GeometryOptions set\n"
3557 ,"}\n"
3558 ,"ttk::button $w.bu.ok -text \"Done\" -command {\n"
3559 ,"Ng_GeometryOptions set\n"
3560 ,"destroy .geometry_dlg\n"
3561 ,"}\n"
3562 ,"pack  $w.bu.app $w.bu.ok -side left -expand yes\n"
3563 ,"wm withdraw $w\n"
3564 ,"wm geom $w +100+100\n"
3565 ,"wm deiconify $w\n"
3566 ,"wm title $w \"Geometry options\"\n"
3567 ,"focus $w\n"
3568 ,"}\n"
3569 ,"}\n"
3570 ,"proc editprimitivedialog2 { name } {\n"
3571 ,"global w classname\n"
3572 ,"set w .ep_dlg\n"
3573 ,"toplevel .$w\n"
3574 ,"Ng_GetPrimitiveData $name classname valuelist\n"
3575 ,"ttk::label $w.lab1 -text \"Primitive Name:  $name\";\n"
3576 ,"ttk::label $w.lab2 -text \"Primitive Class: $classname\";\n"
3577 ,"pack $w.lab1 $w.lab2 -fill x -pady 1m -padx 5m\n"
3578 ,"frame $w.specific -relief groove\n"
3579 ,"global spec\n"
3580 ,"set spec(sphere) { cx cy cz rad }\n"
3581 ,"set spec(cylinder) { ax ay az bx by bz rad }\n"
3582 ,"set spec(plane) { px py pz nx ny nz }\n"
3583 ,"set spec(cone) { ax ay az bx by bz ra rb }\n"
3584 ,"set spec(brick) { p1x p1y p1z p2x p2y p2z p3x p3y p3z p4x p4y p4z }\n"
3585 ,"set cnt 0\n"
3586 ,"foreach field $spec($classname) {\n"
3587 ,"frame $w.specific.f$cnt\n"
3588 ,"pack $w.specific.f$cnt -side top -anchor ne\n"
3589 ,"ttk::label $w.specific.f$cnt.lab -text \"$field\"\n"
3590 ,"entry $w.specific.f$cnt.ent -textvariable dataval($cnt) \\\n"
3591 ,"-width 6 -relief sunken\n"
3592 ,"pack $w.specific.f$cnt.ent $w.specific.f$cnt.lab -side right\n"
3593 ,"$w.specific.f$cnt.ent delete 0 end\n"
3594 ,"$w.specific.f$cnt.ent insert 0 [lindex $valuelist $cnt]\n"
3595 ,"set cnt [expr $cnt + 1]\n"
3596 ,"}\n"
3597 ,"pack $w.specific\n"
3598 ,"ttk::button $w.cancel -text \"cancel\" -command {\n"
3599 ,"destroy $w\n"
3600 ,"}\n"
3601 ,"ttk::button $w.ok -text \"ok\" -command {\n"
3602 ,"set valuelist \"\"\n"
3603 ,"set cnt 0\n"
3604 ,"foreach field $spec($classname) {\n"
3605 ,"lappend valuelist $dataval($cnt)\n"
3606 ,"set cnt [expr $cnt + 1]\n"
3607 ,"}\n"
3608 ,"Ng_SetPrimitiveData $name $valuelist\n"
3609 ,"destroy $w\n"
3610 ,"}\n"
3611 ,"pack  $w.cancel $w.ok -side left -expand yes\n"
3612 ,"bind $w <Return> { $w.ok  invoke}\n"
3613 ,"bind $w <Escape> { $w.cancel  invoke}\n"
3614 ,"wm withdraw $w\n"
3615 ,"wm geom $w +100+100\n"
3616 ,"wm deiconify $w\n"
3617 ,"focus $w.specific.f0.ent\n"
3618 ,"}\n"
3619 ,"proc editprimitivedialog { } {\n"
3620 ,"global w\n"
3621 ,"set w .ep_dlg\n"
3622 ,"toplevel $w\n"
3623 ,"frame $w.frame -borderwidth 5m\n"
3624 ,"pack $w.frame -side top -expand yes -fill y\n"
3625 ,"listbox $w.frame.list -yscroll \"$w.frame.scroll set\" -setgrid 1 -height 12\n"
3626 ,"scrollbar $w.frame.scroll -command \"$w.frame.list yview\"\n"
3627 ,"pack $w.frame.scroll -side right -fill y\n"
3628 ,"pack $w.frame.list -side left -expand 1 -fill both\n"
3629 ,"Ng_GetPrimitiveList primlist\n"
3630 ,"foreach el $primlist {\n"
3631 ,"$w.frame.list insert end $el }\n"
3632 ,"ttk::button $w.cancel -text \"cancel\" -command { destroy $w }\n"
3633 ,"ttk::button $w.ok -text \"ok\" -command {\n"
3634 ,"set name [.ep_dlg.frame.list get active]\n"
3635 ,"puts \"name=($name)\"\n"
3636 ,"destroy $w\n"
3637 ,"if { $name != \"\" } { editprimitivedialog2 $name }\n"
3638 ,"}\n"
3639 ,"bind $w <Escape> { $w.cancel invoke }\n"
3640 ,"bind $w <Return> { $w.ok invoke }\n"
3641 ,"pack  $w.cancel $w.ok -side left -expand yes\n"
3642 ,"wm withdraw $w\n"
3643 ,"wm geom $w +100+100\n"
3644 ,"wm deiconify $w\n"
3645 ,"focus $w.frame.list\n"
3646 ,"}\n"
3647 ,"proc newprimitivedialog { } {\n"
3648 ,"global w name\n"
3649 ,"set w .ap_dlg\n"
3650 ,"toplevel $w\n"
3651 ,"set name \"\"\n"
3652 ,"frame $w.f1\n"
3653 ,"pack $w.f1 -pady 2m\n"
3654 ,"ttk::label $w.f1.lab -text \"Primitive Name: \";\n"
3655 ,"entry $w.f1.ent -width 5 -relief sunken \\\n"
3656 ,"-textvariable name\n"
3657 ,"pack $w.f1.lab $w.f1.ent -side left\n"
3658 ,"frame $w.frame -borderwidth .5c\n"
3659 ,"pack $w.frame -side top -expand yes -fill y\n"
3660 ,"listbox $w.frame.list -yscroll \"$w.frame.scroll set\" -setgrid 1 -height 8\n"
3661 ,"scrollbar $w.frame.scroll -command \"$w.frame.list yview\"\n"
3662 ,"pack $w.frame.scroll -side right -fill y\n"
3663 ,"pack $w.frame.list -side left -expand 1 -fill both\n"
3664 ,"$w.frame.list insert 0 sphere cylinder plane cone brick\n"
3665 ,"$w.frame.list activate 0\n"
3666 ,"ttk::button $w.ok -text \"ok\" -command {\n"
3667 ,"Ng_CreatePrimitive [$w.frame.list get active]  $name\n"
3668 ,"destroy $w\n"
3669 ,"editprimitivedialog2 $name\n"
3670 ,"}\n"
3671 ,"ttk::button $w.cancel -text \"cancel\" -command {\n"
3672 ,"destroy $w\n"
3673 ,"}\n"
3674 ,"pack  $w.cancel $w.ok -side left -expand yes -pady 2m\n"
3675 ,"bind $w <Escape> { $w.cancel invoke }\n"
3676 ,"bind $w <Return> { $w.ok invoke }\n"
3677 ,"wm withdraw $w\n"
3678 ,"wm geom $w +100+100\n"
3679 ,"wm deiconify $w\n"
3680 ,"focus $w.f1.ent\n"
3681 ,"}\n"
3682 ,"proc newsoliddialog { } {\n"
3683 ,"global w name val sollist\n"
3684 ,"set w .ns_dlg\n"
3685 ,"toplevel $w\n"
3686 ,"set name \"\"\n"
3687 ,"frame $w.f1\n"
3688 ,"ttk::label $w.f1.lab -text \"Solid Name: \";\n"
3689 ,"entry $w.f1.ent -width 5 -relief sunken \\\n"
3690 ,"-textvariable name\n"
3691 ,"$w.f1.ent delete 0 end\n"
3692 ,"ttk::button $w.f1.getsel -text \"Get Selected\" -command {\n"
3693 ,"$w.f1.ent delete 0 end\n"
3694 ,"$w.f1.ent insert 0 [$w.f3.list get active]\n"
3695 ,"$w.bu.get invoke\n"
3696 ,"}\n"
3697 ,"pack $w.f1.getsel -side bottom\n"
3698 ,"pack $w.f1.ent $w.f1.lab -side right\n"
3699 ,"frame $w.f3 -borderwidth .5c\n"
3700 ,"listbox $w.f3.list -yscroll \"$w.f3.scroll set\" -setgrid 1 -height 12\n"
3701 ,"scrollbar $w.f3.scroll -command \"$w.f3.list yview\"\n"
3702 ,"pack $w.f3.scroll -side right -fill y\n"
3703 ,"pack $w.f3.list -side left -expand 1 -fill both\n"
3704 ,"Ng_GetSolidList sollist\n"
3705 ,"foreach el $sollist {\n"
3706 ,"$w.f3.list insert end $el }\n"
3707 ,"frame $w.f2\n"
3708 ,"ttk::label $w.f2.lab -text \"Solid Description: \";\n"
3709 ,"pack $w.f2.lab\n"
3710 ,"entry $w.f2.ent -width 100 -relief sunken \\\n"
3711 ,"-textvariable val  -xscrollcommand \"$w.f2.scr set\"\n"
3712 ,"scrollbar $w.f2.scr -relief sunken -orient horiz -command \\\n"
3713 ,"\"$w.f2.ent xview\"\n"
3714 ,"$w.f2.ent delete 0 end\n"
3715 ,"pack $w.f2.ent $w.f2.scr -fill x\n"
3716 ,"frame $w.bu\n"
3717 ,"ttk::button $w.bu.close -text \"close\" -command {\n"
3718 ,"destroy $w\n"
3719 ,"}\n"
3720 ,"ttk::button $w.bu.get -text \"get data\" -command {\n"
3721 ,"Ng_GetSolidData $name val\n"
3722 ,"}\n"
3723 ,"ttk::button $w.bu.set -text \"set data\" -command {\n"
3724 ,"Ng_SetSolidData $name $val\n"
3725 ,"}\n"
3726 ,"pack $w.bu.get $w.bu.set $w.bu.close -side left\n"
3727 ,"pack $w.bu -pady 5 -side bottom                     ;\n"
3728 ,"pack $w.f2 -pady 5 -side bottom                     ;\n"
3729 ,"pack $w.f1 -pady 5 -side left                       ;\n"
3730 ,"pack $w.f3 -side left -expand yes -fill y           ;\n"
3731 ,"bind $w <Escape> { $w.bu.close invoke }\n"
3732 ,"wm withdraw $w\n"
3733 ,"wm geom $w +100+100\n"
3734 ,"wm deiconify $w\n"
3735 ,"focus $w\n"
3736 ,"}\n"
3737 ,"proc toplevelproperties { w solname surfname } {\n"
3738 ,"global properties\n"
3739 ,"Ng_TopLevel getprop $solname $surfname properties\n"
3740 ,"set w .tlprop_dlg\n"
3741 ,"if {[winfo exists $w] == 1} {\n"
3742 ,"wm withdraw $w\n"
3743 ,"wm deiconify $w\n"
3744 ,"focus $w\n"
3745 ,"} {\n"
3746 ,"toplevel $w\n"
3747 ,"ttk::label $w.lab1 -text \"Red\"\n"
3748 ,"scale $w.scale1 -orient horizontal -length 300 -from 0 -to 1 \\\n"
3749 ,"-resolution 0.01  -tickinterval 0.2 \\\n"
3750 ,"-command { Ng_TopLevel setprop $solname $surfname properties; redraw } -variable  properties(red)\n"
3751 ,"ttk::label $w.lab2 -text \"Green\"\n"
3752 ,"scale $w.scale2 -orient horizontal -length 300 -from 0 -to 1 \\\n"
3753 ,"-resolution 0.01  -tickinterval 0.2 \\\n"
3754 ,"-command { Ng_TopLevel setprop $solname $surfname properties; redraw } -variable  properties(green)\n"
3755 ,"ttk::label $w.lab3 -text \"Blue\"\n"
3756 ,"scale $w.scale3 -orient horizontal -length 300 -from 0 -to 1 \\\n"
3757 ,"-resolution 0.01  -tickinterval 0.2 \\\n"
3758 ,"-command { Ng_TopLevel setprop $solname $surfname properties; redraw } -variable  properties(blue)\n"
3759 ,"pack $w.lab1 $w.scale1 $w.lab2 $w.scale2 $w.lab3 $w.scale3\n"
3760 ,"checkbutton $w.cb4 -text \"Visible\" \\\n"
3761 ,"-command { Ng_TopLevel setprop $solname $surfname properties; redraw } \\\n"
3762 ,"-variable properties(visible)\n"
3763 ,"checkbutton $w.cb5 -text \"Transparent\" \\\n"
3764 ,"-command { Ng_TopLevel setprop $solname $surfname properties; redraw } \\\n"
3765 ,"-variable properties(transp)\n"
3766 ,"pack  $w.cb4 $w.cb5\n"
3767 ,"frame $w.bu\n"
3768 ,"pack $w.bu -fill x\n"
3769 ,"ttk::button $w.bu.ok -text \"Ok\" -command \"destroy .tlprop_dlg\"\n"
3770 ,"pack $w.bu.ok  -expand yes\n"
3771 ,"wm withdraw $w\n"
3772 ,"wm geom $w +100+100\n"
3773 ,"wm deiconify $w\n"
3774 ,"focus $w\n"
3775 ,"}\n"
3776 ,"wm title $w \"Properties $solname $surfname\"\n"
3777 ,"}\n"
3778 ,"proc topleveldialog { } {\n"
3779 ,"global w name val sollist\n"
3780 ,"set w .tl_dlg\n"
3781 ,"toplevel $w\n"
3782 ,"frame $w.sol -borderwidth .5c\n"
3783 ,"listbox $w.sol.list -yscroll \"$w.sol.scroll set\" -setgrid 1 -height 12\n"
3784 ,"scrollbar $w.sol.scroll -command \"$w.sol.list yview\"\n"
3785 ,"pack $w.sol.scroll -side right -fill y\n"
3786 ,"pack $w.sol.list -side left -expand 1 -fill both\n"
3787 ,"Ng_GetSolidList sollist\n"
3788 ,"foreach el $sollist {\n"
3789 ,"$w.sol.list insert end $el }\n"
3790 ,"Ng_GetPrimitiveList sollist\n"
3791 ,"foreach el $sollist {\n"
3792 ,"$w.sol.list insert end $el }\n"
3793 ,"frame $w.sul -borderwidth .5c\n"
3794 ,"listbox $w.sul.list -yscroll \"$w.sul.scroll set\" -setgrid 1 -height 12\n"
3795 ,"scrollbar $w.sul.scroll -command \"$w.sul.list yview\"\n"
3796 ,"pack $w.sul.scroll -side right -fill y\n"
3797 ,"pack $w.sul.list -side left -expand 1 -fill both\n"
3798 ,"Ng_GetSurfaceList sollist\n"
3799 ,"foreach el $sollist {\n"
3800 ,"$w.sul.list insert end $el }\n"
3801 ,"frame $w.topl -borderwidth .5c\n"
3802 ,"listbox $w.topl.list -yscroll \"$w.topl.scroll set\" -setgrid 1 -height 12 \\\n"
3803 ,"-command { puts hi }\n"
3804 ,"scrollbar $w.topl.scroll -command \"$w.topl.list yview\"\n"
3805 ,"pack $w.topl.scroll -side right -fill y\n"
3806 ,"pack $w.topl.list -side left -expand 1 -fill both\n"
3807 ,"Ng_TopLevel getlist sollist\n"
3808 ,"puts $sollist\n"
3809 ,"foreach el $sollist {\n"
3810 ,"set hel \"[ lindex $el 0 ]\"\n"
3811 ,"if { [ llength $el ] == 2 } {\n"
3812 ,"set hel \"[ lindex $el 1 ] on [ lindex $el 0 ]\"\n"
3813 ,"}\n"
3814 ,"$w.topl.list insert end $hel\n"
3815 ,"}\n"
3816 ,"frame $w.bu\n"
3817 ,"ttk::button $w.bu.close -text \"close\" -command {\n"
3818 ,"destroy $w\n"
3819 ,"}\n"
3820 ,"ttk::button $w.bu.addsol -text \"Add Solid\" -command {\n"
3821 ,"set solname [$w.sol.list get active]\n"
3822 ,"Ng_TopLevel set $solname \"\"\n"
3823 ,"Ng_ParseGeometry\n"
3824 ,"$w.topl.list insert end $solname\n"
3825 ,"}\n"
3826 ,"ttk::button $w.bu.addsurf -text \"Add Surface\" -command {\n"
3827 ,"set solname [$w.sol.list get active]\n"
3828 ,"set surfname [$w.sul.list get active]\n"
3829 ,"Ng_TopLevel set $solname $surfname\n"
3830 ,"Ng_ParseGeometry\n"
3831 ,"puts \"$solname on $surfname\"\n"
3832 ,"$w.topl.list insert end \"$surfname on $solname\"\n"
3833 ,"}\n"
3834 ,"ttk::button $w.bu.remsol -text \"Remove\" -command {\n"
3835 ,"set solname [$w.topl.list get active]\n"
3836 ,"set surfname \"\"\n"
3837 ,"if { [llength $solname] == 3 } {\n"
3838 ,"set surfname [lindex $solname 0]\n"
3839 ,"set solname [lindex $solname 2]\n"
3840 ,"}\n"
3841 ,"Ng_TopLevel remove $solname $surfname\n"
3842 ,"Ng_ParseGeometry\n"
3843 ,"$w.topl.list delete active\n"
3844 ,"}\n"
3845 ,"ttk::button $w.bu.prop -text \"Properties\" -command {\n"
3846 ,"set solname [$w.topl.list get active]\n"
3847 ,"set surfname \"\"\n"
3848 ,"if { [llength $solname] == 3 } {\n"
3849 ,"set surfname [lindex $solname 0]\n"
3850 ,"set solname [lindex $solname 2]\n"
3851 ,"}\n"
3852 ,"toplevelproperties tlp $solname $surfname\n"
3853 ,"}\n"
3854 ,"pack  $w.bu.close $w.bu.addsol $w.bu.addsurf $w.bu.remsol $w.bu.prop  -side left\n"
3855 ,"pack $w.bu -side bottom\n"
3856 ,"pack $w.sol -side left -expand yes -fill y           ;\n"
3857 ,"pack $w.sul -side left -expand yes -fill y           ;\n"
3858 ,"pack $w.topl -side left -expand yes -fill y           ;\n"
3859 ,"bind $w <Escape> { $w.bu.close invoke }\n"
3860 ,"wm withdraw $w\n"
3861 ,"wm geom $w +100+100\n"
3862 ,"wm deiconify $w\n"
3863 ,"focus $w\n"
3864 ,"}\n"
3865 ,"proc topleveldialog2 { } {\n"
3866 ,"set w .tl2_dlg\n"
3867 ,"if {[winfo exists .tl2_dlg] == 1} {\n"
3868 ,"wm withdraw $w\n"
3869 ,"wm deiconify $w\n"
3870 ,"focus $w\n"
3871 ,"} {\n"
3872 ,"toplevel $w\n"
3873 ,"global name val sollist\n"
3874 ,"frame $w.topl -borderwidth .5c\n"
3875 ,"listbox $w.topl.list -yscroll \"$w.topl.scroll set\" -setgrid 1 -height 12\n"
3876 ,"scrollbar $w.topl.scroll -command \"$w.topl.list yview\"\n"
3877 ,"pack $w.topl.scroll -side right -fill y\n"
3878 ,"pack $w.topl.list -side left -expand 1 -fill both\n"
3879 ,"Ng_TopLevel getlist sollist\n"
3880 ,"puts $sollist\n"
3881 ,"set i 1\n"
3882 ,"foreach el $sollist {\n"
3883 ,"set hel \"$i: [ lindex $el 0 ]\"\n"
3884 ,"if { [ llength $el ] == 2 } {\n"
3885 ,"set hel \"$i: [ lindex $el 1 ] on [ lindex $el 0 ]\"\n"
3886 ,"}\n"
3887 ,"incr i\n"
3888 ,"$w.topl.list insert end $hel }\n"
3889 ,"frame $w.bu\n"
3890 ,"ttk::button $w.bu.close -text \"close\" -command {\n"
3891 ,"destroy .tl2_dlg\n"
3892 ,"}\n"
3893 ,"ttk::button $w.bu.prop -text \"Properties\" -command {\n"
3894 ,"set solname [.tl2_dlg.topl.list get active]\n"
3895 ,"set surfname \"\"\n"
3896 ,"if { [llength $solname] == 2 } {\n"
3897 ,"set solname [lindex $solname 1]\n"
3898 ,"}\n"
3899 ,"if { [llength $solname] == 4 } {\n"
3900 ,"set surfname [lindex $solname 1]\n"
3901 ,"set solname [lindex $solname 3]\n"
3902 ,"}\n"
3903 ,"toplevelproperties tlp $solname $surfname\n"
3904 ,"}\n"
3905 ,"pack $w.bu.close $w.bu.prop  -side left\n"
3906 ,"pack $w.bu -side bottom\n"
3907 ,"pack $w.topl -side left -expand yes -fill y           ;\n"
3908 ,"bind .tl2_dlg.topl.list <Double-1> {\n"
3909 ,"set solname [.tl2_dlg.topl.list get  @%x,%y]\n"
3910 ,"set surfname \"\"\n"
3911 ,"if { [llength $solname] == 2 } {\n"
3912 ,"set solname [lindex $solname 1]\n"
3913 ,"}\n"
3914 ,"if { [llength $solname] == 4 } {\n"
3915 ,"set surfname [lindex $solname 1]\n"
3916 ,"set solname [lindex $solname 3]\n"
3917 ,"}\n"
3918 ,"toplevelproperties tlp $solname $surfname\n"
3919 ,"}\n"
3920 ,"bind .tl2_dlg <Escape> { .tl2_dlg.bu.close invoke }\n"
3921 ,"wm withdraw $w\n"
3922 ,"wm geom $w +100+100\n"
3923 ,"wm deiconify $w\n"
3924 ,"wm title $w \"Top-Level Options\"\n"
3925 ,"focus $w\n"
3926 ,"}\n"
3927 ,"}\n"
3928 ,"}\n"
3929 ,"catch { \n"
3930 ,".ngmenu.geometry add separator\n"
3931 ,".ngmenu.geometry add command -label \"STL Doctor...\" \\\n"
3932 ,"-command { stldoctordialog; }\n"
3933 ,".ngmenu.geometry add command -label \"STL Info\" \\\n"
3934 ,"-command {\n"
3935 ,"set notriangles 0\n"
3936 ,"set minx 0\n"
3937 ,"set maxx 0\n"
3938 ,"set miny 0\n"
3939 ,"set maxy 0\n"
3940 ,"set minz 0\n"
3941 ,"set maxz 0\n"
3942 ,"set trigscons 0\n"
3943 ,"Ng_STLInfo notriangles minx maxx miny maxy minz maxz trigscons\n"
3944 ,"set msgtext \"NO STL-Triangles : $notriangles\\nGeometry:\\nX = $minx - $maxx\\nY = $miny - $maxy\\nZ = $minz - $maxz\\nConsistency Check = $trigscons\\n\"\n"
3945 ,"set msgtext \"$msgtext Status: [Ng_STLInfo status]\"\n"
3946 ,"tk_messageBox -title \"STL Info\" -message  $msgtext -type ok\n"
3947 ,"}\n"
3948 ,"}\n"
3949 ,"set hasocc no\n"
3950 ,"catch { if { [catch { load liboccvis[info sharedlibextension] Ng_OCC } result ] } {\n"
3951 ,"}\n"
3952 ,"if { [catch { Ng_OCCCommand isoccgeometryloaded }] } {\n"
3953 ,"proc rebuildoccdialog { } { }\n"
3954 ,"} {\n"
3955 ,"puts \"OCC module loaded\"\n"
3956 ,"set hasocc yes\n"
3957 ,".ngmenu.geometry add separator\n"
3958 ,".ngmenu.geometry add command -label \"IGES/STEP Topology Explorer/Doctor...\" \\\n"
3959 ,"-command { occdialog; }\n"
3960 ,".ngmenu.geometry add command -label \"Edit Face Mesh Size...\" \\\n"
3961 ,"-command { surfacemeshsizedialog }\n"
3962 ,"set entities [ ]\n"
3963 ,"proc occdialogbuildtree {} {\n"
3964 ,"global entities\n"
3965 ,"set w .occ_dlg\n"
3966 ,"set entities [Ng_GetOCCData getentities]\n"
3967 ,"set nrentities [expr [llength $entities]]\n"
3968 ,"if {$nrentities != 0} {\n"
3969 ,"$w.tree insert {Topology} end -id \"CompSolids\" -text \"Composite Solids\"\n"
3970 ,"$w.tree insert {Topology} end -id \"FreeSolids\" -text \"Free Solids\"\n"
3971 ,"$w.tree insert {Topology} end -id \"FreeShells\" -text \"Free Shells\"\n"
3972 ,"$w.tree insert {Topology} end -id \"FreeFaces\" -text \"Free Faces\"\n"
3973 ,"$w.tree insert {Topology} end -id \"FreeWires\" -text \"Free Wires\"\n"
3974 ,"$w.tree insert {Topology} end -id \"FreeEdges\" -text \"Free Edges\"\n"
3975 ,"$w.tree insert {Topology} end -id \"FreeVertices\" -text \"Free Vertices\"\n"
3976 ,"$w.tree item \"Topology\" -open true\n"
3977 ,"set i [expr 0]\n"
3978 ,"while {$i < $nrentities} {\n"
3979 ,"set entity [lindex $entities [expr $i]]\n"
3980 ,"incr i 1\n"
3981 ,"set entityname [lindex $entities [expr $i]]\n"
3982 ,"set myroot [string range $entity 0 [string last / $entity]-1]\n"
3983 ,"$w.tree insert $myroot end -id $entity -text $entityname -value 1\n"
3984 ,"incr i 1\n"
3985 ,"}\n"
3986 ,"set i [expr 0]\n"
3987 ,"while {$i < $nrentities} {\n"
3988 ,"set entity [lindex $entities [expr $i]]\n"
3989 ,"$w.tree item $entity -open false\n"
3990 ,"incr i 2\n"
3991 ,"}\n"
3992 ,"set faces [Ng_OCCCommand getunmeshedfaceinfo]\n"
3993 ,"set nrfaces [expr [llength $faces]]\n"
3994 ,"if {$nrfaces >= 2} {\n"
3995 ,"$w.tree insert {} -id ErrorFaces -text \"Faces with surface meshing error\"\n"
3996 ,"$w.tree item ErrorFaces -open true\n"
3997 ,"set i [expr 0]\n"
3998 ,"while {$i < $nrfaces} {\n"
3999 ,"set entity [lindex $faces [expr $i]]\n"
4000 ,"set myroot [string range $entity 0 [string last / $entity]-1]\n"
4001 ,"if { [string length $myroot] == 0 } {\n"
4002 ,"set myroot ErrorFaces\n"
4003 ,"}\n"
4004 ,"incr i 1\n"
4005 ,"set entityname [lindex $faces [expr $i]]\n"
4006 ,"$w.tree insert {myroot} end -id $entity -text $entityname -value 0\n"
4007 ,"incr i 1\n"
4008 ,"}\n"
4009 ,"}\n"
4010 ,"set faces [Ng_OCCCommand getnotdrawablefaces]\n"
4011 ,"set nrfaces [expr [llength $faces]]\n"
4012 ,"if {$nrfaces >= 2} {\n"
4013 ,"$w.tree insert {} -id NotDrawableFaces -text \"Faces impossible to visualize\"\n"
4014 ,"$w.tree item NotDrawableFaces -open true\n"
4015 ,"set i [expr 0]\n"
4016 ,"while {$i < $nrfaces} {\n"
4017 ,"set entity [lindex $faces [expr $i]]\n"
4018 ,"set myroot [string range $entity 0 [string last / $entity]-1]\n"
4019 ,"if { [string length $myroot ] == 0 } {\n"
4020 ,"set myroot NotDrawableFaces\n"
4021 ,"}\n"
4022 ,"incr i 1\n"
4023 ,"set entityname [lindex $faces [expr $i]]\n"
4024 ,"$w.tree insert $myroot end -id $entity -text $entityname -value 0\n"
4025 ,"incr i 1\n"
4026 ,"}\n"
4027 ,"}\n"
4028 ,"puts \"done\"\n"
4029 ,"}\n"
4030 ,"}\n"
4031 ,"proc rebuildoccdialog {} {\n"
4032 ,"if {[winfo exists .occ_dlg] == 1} {\n"
4033 ,".occ_dlg.tree delete [.occ_dlg.tree children Topology]\n"
4034 ,"occdialogbuildtree\n"
4035 ,"}\n"
4036 ,"}\n"
4037 ,"proc checkoccloaded { } {\n"
4038 ,"set isoccgeometryloaded [Ng_OCCCommand isoccgeometryloaded]\n"
4039 ,"if {$isoccgeometryloaded == 0} {\n"
4040 ,"puts \"no IGES/STEP geometry loaded\"\n"
4041 ,"destroy .occ_dlg\n"
4042 ,"}\n"
4043 ,"}\n"
4044 ,"proc selectentity { entityname } {\n"
4045 ,"global entities\n"
4046 ,"set nrentities [expr [llength $entities]]\n"
4047 ,"set i [expr 0]\n"
4048 ,"while {$i < $nrentities} {\n"
4049 ,"set entitylength []\n"
4050 ,"set entity2 [lindex $entities [expr $i]]\n"
4051 ,"incr i 1\n"
4052 ,"set entityname2 [lindex $entities [expr $i]]\n"
4053 ,"incr i 1\n"
4054 ,"set entityname2 [string range $entityname2 0 [expr [string length $entityname]-1]]\n"
4055 ,"if {$entityname == $entityname2} {\n"
4056 ,".occ_dlg.tree see $entity2\n"
4057 ,".occ_dlg.tree selection set $entity2\n"
4058 ,"}\n"
4059 ,"}\n"
4060 ,"}\n"
4061 ,"proc occdialog { } {\n"
4062 ,"uplevel 1 {\n"
4063 ,"global entities\n"
4064 ,"set selectvisual geometry\n"
4065 ,"Ng_SetVisParameters\n"
4066 ,"redraw\n"
4067 ,"set w .occ_dlg\n"
4068 ,"if {[winfo exists .occ_dlg] == 1} {\n"
4069 ,"wm withdraw $w\n"
4070 ,"wm deiconify $w\n"
4071 ,"focus $w\n"
4072 ,"} {\n"
4073 ,"toplevel $w\n"
4074 ,"ttk::treeview $w.tree\n"
4075 ,"$w.tree insert {} end -id \"Topology\" -text \"Topology\"\n"
4076 ,"pack $w.tree -fill both -expand yes\n"
4077 ,"occdialogbuildtree\n"
4078 ,"bind $w.tree <Double-1> {\n"
4079 ,"set entityname [.occ_dlg.tree item [.occ_dlg.tree selection] -text ]\n"
4080 ,"set rootname \"\"\n"
4081 ,"if {[.occ_dlg.tree item [.occ_dlg.tree selection] -value] == 1 } {\n"
4082 ,"set rootname \"Topology\"\n"
4083 ,"}\n"
4084 ,"set spacepos [string first \" \" $entityname]\n"
4085 ,"set entitytype [string range $entityname 0 [expr $spacepos-1]]\n"
4086 ,"set helpstring [string range $entityname [expr $spacepos+1] [expr [string length $entityname]-1]]\n"
4087 ,"set spacepos2 [string first \" \" $helpstring]\n"
4088 ,"set entitynumber [string range $helpstring 0 [expr $spacepos2-1]]\n"
4089 ,"if {$rootname == \"Topology\"} {\n"
4090 ,"Ng_OCCCommand highlightentity $entitytype $entitynumber\n"
4091 ,"set selectvisual geometry\n"
4092 ,"redraw\n"
4093 ,"} {\n"
4094 ,"set brackpos [string first \" (\" $entityname]\n"
4095 ,"if {$brackpos != -1} {\n"
4096 ,"set entityname [string range $entityname 0 $brackpos]\n"
4097 ,"}\n"
4098 ,"selectentity $entityname\n"
4099 ,"}\n"
4100 ,"}\n"
4101 ,"ttk::button $w.cl -text \"Close\" -command {\n"
4102 ,"destroy .occ_dlg\n"
4103 ,"}\n"
4104 ,"ttk::button $w.show -text \"Show\" -command {\n"
4105 ,"set entityname [.occ_dlg.tree item [.occ_dlg.tree selection] -text ]\n"
4106 ,"set spacepos [string first \" \" $entityname]\n"
4107 ,"set entitytype [string range $entityname 0 [expr $spacepos-1]]\n"
4108 ,"set helpstring [string range $entityname [expr $spacepos+1] [expr [string length $entityname]-1]]\n"
4109 ,"set spacepos2 [string first \" \" $helpstring]\n"
4110 ,"set entitynumber [string range $helpstring 0 [expr $spacepos2-1]]\n"
4111 ,"Ng_OCCCommand show $entitytype $entitynumber\n"
4112 ,"set selectvisual geometry\n"
4113 ,"redraw\n"
4114 ,"}\n"
4115 ,"ttk::button $w.hide -text \"Hide\" -command {\n"
4116 ,"set entityname [.occ_dlg.tree item [.occ_dlg.tree selection] -text ]\n"
4117 ,"set spacepos [string first \" \" $entityname]\n"
4118 ,"set entitytype [string range $entityname 0 [expr $spacepos-1]]\n"
4119 ,"set helpstring [string range $entityname [expr $spacepos+1] [expr [string length $entityname]-1]]\n"
4120 ,"set spacepos2 [string first \" \" $helpstring]\n"
4121 ,"set entitynumber [string range $helpstring 0 [expr $spacepos2-1]]\n"
4122 ,"Ng_OCCCommand hide $entitytype $entitynumber\n"
4123 ,"set selectvisual geometry\n"
4124 ,"redraw\n"
4125 ,"}\n"
4126 ,"ttk::button $w.swaporientation -text \"Swap orientation\" -command {\n"
4127 ,"set entityname [.occ_dlg.tree item [.occ_dlg.tree selection] -text ]\n"
4128 ,"set spacepos [string first \" \" $entityname]\n"
4129 ,"set entitytype [string range $entityname 0 [expr $spacepos-1]]\n"
4130 ,"set helpstring [string range $entityname [expr $spacepos+1] [expr [string length $entityname]-1]]\n"
4131 ,"set spacepos2 [string first \" \" $helpstring]\n"
4132 ,"set entitynumber [string range $helpstring 0 [expr $spacepos2-1]]\n"
4133 ,"Ng_OCCCommand swaporientation $entitytype $entitynumber\n"
4134 ,"set selectvisual geometry\n"
4135 ,"redraw\n"
4136 ,".occ_dlg.tree delete [.occ_dlg.tree children Topology]\n"
4137 ,"occdialogbuildtree\n"
4138 ,"}\n"
4139 ,"ttk::button $w.marksingular -text \"Mark/Unmark as singular\" -command {\n"
4140 ,"set entityname [.occ_dlg.tree item [.occ_dlg.tree selection] -text ]\n"
4141 ,"set spacepos [string first \" \" $entityname]\n"
4142 ,"if { $spacepos != 0 } {\n"
4143 ,"set entitytype [string range $entityname 0 [expr $spacepos-1]]\n"
4144 ,"set helpstring [string range $entityname [expr $spacepos+1] [expr [string length $entityname]-1]]\n"
4145 ,"set spacepos2 [string first \" \" $helpstring]\n"
4146 ,"if { $spacepos2 != 0 } {\n"
4147 ,"set entitynumber [string range $helpstring 0 [expr $spacepos2-1]]\n"
4148 ,"puts $entitytype\n"
4149 ,"puts $entitynumber\n"
4150 ,"global ismarkedsingular\n"
4151 ,"Ng_OCCCommand marksingular $entitytype $entitynumber\n"
4152 ,"if { $ismarkedsingular == 0 } {\n"
4153 ,".occ_dlg.tree tag remove \"Color\" [.occ_dlg.tree selection]\n"
4154 ,"} {\n"
4155 ,".occ_dlg.tree tag add \"Color\" [.occ_dlg.tree selection]\n"
4156 ,".occ_dlg.tree tag configure \"Color\" -foreground \"red\"\n"
4157 ,".occ_dlg.tree tag configure \"Color\" -background \"blue\"\n"
4158 ,"}\n"
4159 ,"}\n"
4160 ,"}\n"
4161 ,"}\n"
4162 ,"ttk::checkbutton $w.zoomtohighlightedentity -text \"Zoom to highlighted entity\" \\\n"
4163 ,"-variable occoptions.zoomtohighlightedentity \\\n"
4164 ,"-command {\n"
4165 ,"Ng_SetOCCVisParameters\n"
4166 ,"if { ${occoptions.zoomtohighlightedentity} == 1} {\n"
4167 ,"set selectvisual geometry\n"
4168 ,"Ng_OCCCommand redrawstatus 1\n"
4169 ,"redraw\n"
4170 ,"} {\n"
4171 ,"Ng_OCCCommand redrawstatus 0\n"
4172 ,"}\n"
4173 ,"}\n"
4174 ,"ttk::frame $w.healing -relief groove -borderwidth 3\n"
4175 ,"ttk::button $w.healing.checkentities -text \"Analyze geometry\" -command {\n"
4176 ,"set irregent [Ng_OCCCommand findsmallentities]\n"
4177 ,"set w .occ_dlg\n"
4178 ,"set nritems [expr [llength $irregent]]\n"
4179 ,"set i [expr 0]\n"
4180 ,"if {$nritems > 0 } {\n"
4181 ,"if { [.occ_dlg.tree exists ProblematicEntities] == 1 } {\n"
4182 ,"$w.tree delete ProblematicEntities\n"
4183 ,"}\n"
4184 ,"$w.tree insert {} end -id ProblematicEntities -text \"Problematic Entities\"\n"
4185 ,"}\n"
4186 ,"while {$i < $nritems} {\n"
4187 ,"set entity [lindex $irregent [expr $i]]\n"
4188 ,"incr i 1\n"
4189 ,"set entityname [lindex $irregent [expr $i]]\n"
4190 ,"set myroot [string range $entity 0 [string last / $entity]-1]\n"
4191 ,"if { [string length $myroot] == 0 } {\n"
4192 ,"set myroot ProblematicEntities\n"
4193 ,"}\n"
4194 ,"$w.tree insert $myroot end -id $entity -text $entityname\n"
4195 ,"incr i 1\n"
4196 ,"}\n"
4197 ,"$w.tree item ProblematicEntities -open true\n"
4198 ,"}\n"
4199 ,"ttk::frame $w.healing.tolerance\n"
4200 ,"ttk::label $w.healing.tolerance.label -text \"Healing tolerance: \"\n"
4201 ,"ttk::spinbox $w.healing.tolerance.sp -textvariable occoptions.tolerance -width 6 -increment 0.01 -validate focus -validatecommand \"my_validatespinbox %W %P 12\" \\\n"
4202 ,"-invalidcommand \"my_invalidspinbox %W\" -from -1e-9 -to 1e6\n"
4203 ,"grid $w.healing.tolerance.label $w.healing.tolerance.sp\n"
4204 ,"ttk::checkbutton $w.healing.fixsmalledges -text \"Fix small edges\" \\\n"
4205 ,"-variable occoptions.fixsmalledges\n"
4206 ,"ttk::checkbutton $w.healing.fixspotstripfaces -text \"Fix spot/strip faces\" \\\n"
4207 ,"-variable occoptions.fixspotstripfaces\n"
4208 ,"ttk::checkbutton $w.healing.sewfaces -text \"Sew faces\" \\\n"
4209 ,"-variable occoptions.sewfaces\n"
4210 ,"ttk::checkbutton $w.healing.makesolids -text \"Make solids\" \\\n"
4211 ,"-variable occoptions.makesolids\n"
4212 ,"ttk::checkbutton $w.healing.splitpartitions -text \"Split partitions\" \\\n"
4213 ,"-variable occoptions.splitpartitions\n"
4214 ,"ttk::button $w.healing.heal -text \"Heal geometry\" -command {\n"
4215 ,"Ng_OCCCommand shapehealing\n"
4216 ,"redraw\n"
4217 ,".occ_dlg.tree delete [.occ_dlg.tree children Topology]\n"
4218 ,"occdialogbuildtree\n"
4219 ,"}\n"
4220 ,"pack $w.healing.checkentities\n"
4221 ,"pack $w.healing.tolerance $w.healing.fixsmalledges \\\n"
4222 ,"$w.healing.fixspotstripfaces $w.healing.sewfaces \\\n"
4223 ,"$w.healing.makesolids $w.healing.splitpartitions -anchor w\n"
4224 ,"pack $w.healing.heal\n"
4225 ,"pack $w.show $w.hide\n"
4226 ,"pack $w.zoomtohighlightedentity -anchor w\n"
4227 ,"pack $w.swaporientation\n"
4228 ,"pack $w.marksingular\n"
4229 ,"pack $w.healing -fill x\n"
4230 ,"pack $w.cl\n"
4231 ,"wm withdraw $w\n"
4232 ,"wm geom $w +100+100\n"
4233 ,"wm deiconify $w\n"
4234 ,"wm title $w \"IGES/STEP Topology Explorer/Doctor\"\n"
4235 ,"focus .occ_dlg\n"
4236 ,"}\n"
4237 ,"}\n"
4238 ,"}\n"
4239 ,"} }\n"
4240 ,"if { [Ng_ACISCommand isACISavailable] == \"yes\" } {\n"
4241 ,".ngmenu.geometry add command -label \"ACIS Topology Explorer...\" \\\n"
4242 ,"-command { acisdialog; }\n"
4243 ,".ngmenu.geometry add command -label \"ACIS combine all\" \\\n"
4244 ,"-command { Ng_ACISCommand combineall }\n"
4245 ,".ngmenu.geometry add command -label \"ACIS Create CT\" \\\n"
4246 ,"-command { Ng_ACISCommand createct }\n"
4247 ,"}\n"
4248 ,"catch { proc print_commandline_help { } {\n"
4249 ,"puts \"Usage: ng { options }\"\n"
4250 ,"puts \"-geofile=filename      Input geometry file (alternative:  ng filename)\"\n"
4251 ,"puts \"-meshfile=filename     Output mesh file\"\n"
4252 ,"puts \"-verycoarse, -coarse, -moderate, -fine, -veryfine\"\n"
4253 ,"puts \"                       Automatic mesh-size selection\"\n"
4254 ,"puts \"-meshsizefile=filename Load mesh-size file with local mesh sizes\"\n"
4255 ,"puts \"-meshfiletype={\\\"Neutral Format\\\", ...}\"\n"
4256 ,"puts \"                       Filetype of output file, default is netgen file\"\n"
4257 ,"puts \"-batchmode             Run Netgen in batchmode\"\n"
4258 ,"puts \"-inputmeshfile=filename\"\n"
4259 ,"puts \"                       Input mesh file (batchmode only)\"\n"
4260 ,"puts \"-mergefile=filename    Merge with mesh file (batchmode only)\"\n"
4261 ,"puts \"-refinementfile=filename\"\n"
4262 ,"puts \"                       Use refinementinfo from file (batchmode only)\"\n"
4263 ,"puts \"-serversocket=\\\n"
4264 ,"puts \"-V                     Print additional information\"\n"
4265 ,"puts \"-testout=filename      file for test output\"\n"
4266 ,"if { [catch { NGS_GetData } ] == 0 } {\n"
4267 ,"puts \"\\nNGSolve parameters:\"\n"
4268 ,"puts \"-pdefile=filename      Load pde input file\"\n"
4269 ,"puts \"-solve                 Solve pde once\"\n"
4270 ,"puts \"-solve=n               Solve pde by n adaptive refinement steps\"\n"
4271 ,"puts \"-recent                Load and solve most recently loaded pde\"\n"
4272 ,"}\n"
4273 ,"}\n"
4274 ,"proc set_menu_help { entry helpmsg } {\n"
4275 ,"global menuhelps\n"
4276 ,"set menuhelps($entry) $helpmsg\n"
4277 ,"}\n"
4278 ,"proc show_menu_help { entry } {\n"
4279 ,"global menuhelps\n"
4280 ,"if {[catch {set helptext $menuhelps($entry)}]} {\n"
4281 ,"set helptext \"no help available   \"\n"
4282 ,"}\n"
4283 ,".helpline configure -text $helptext\n"
4284 ,"if {[winfo exists .senshelp_dlg]==1} {\n"
4285 ,".senshelp_dlg.text delete 1.0 end\n"
4286 ,".senshelp_dlg.text insert end \"Menu item: $entry\\n\\n\"\n"
4287 ,".senshelp_dlg.text insert end $helptext\n"
4288 ,"}\n"
4289 ,"}\n"
4290 ,"proc set_control_help { control helpmsg } {\n"
4291 ,"bind $control <Enter> \"show_control_help {$helpmsg}\"\n"
4292 ,"bind $control <Leave> \"show_control_help {None}\"\n"
4293 ,".balloon bind  $control -balloonmsg $helpmsg -statusmsg $helpmsg\n"
4294 ,"}\n"
4295 ,"proc show_control_help { helpmsg } {\n"
4296 ,".helpline configure -text $helpmsg\n"
4297 ,"if {[winfo exists .senshelp_dlg]==1} {\n"
4298 ,".senshelp_dlg.text delete 1.0 end\n"
4299 ,".senshelp_dlg.text insert end $helpmsg\n"
4300 ,"}\n"
4301 ,"}\n"
4302 ,"proc sensitivehelpdialog { show } {\n"
4303 ,"set w .senshelp_dlg\n"
4304 ,"if {[winfo exists .senshelp_dlg] == 1} {\n"
4305 ,"if { $show == 1 } {\n"
4306 ,"wm withdraw .senshelp_dlg\n"
4307 ,"wm deiconify $w\n"
4308 ,"focus $w\n"
4309 ,"} {\n"
4310 ,"wm withdraw $w\n"
4311 ,"}\n"
4312 ,"} {\n"
4313 ,"toplevel $w\n"
4314 ,"global senshelptext\n"
4315 ,"text $w.text -yscrollcommand \"$w.scroll set\" -setgrid true \\\n"
4316 ,"-width 40 -height 10  -wrap word\n"
4317 ,"scrollbar $w.scroll -command \"$w.text yview\"\n"
4318 ,"pack $w.scroll -side right -fill y\n"
4319 ,"pack $w.text -expand yes -fill both\n"
4320 ,"ttk::frame $w.bu\n"
4321 ,"pack $w.bu\n"
4322 ,"ttk::button $w.close -text \"Close\" \\\n"
4323 ,"-command {\n"
4324 ,"wm withdraw .senshelp_dlg\n"
4325 ,"set showsensitivehelp 0\n"
4326 ,"}\n"
4327 ,"pack $w.close\n"
4328 ,"if { $show == 1 } {\n"
4329 ,"wm withdraw $w\n"
4330 ,"wm geom $w +100+100\n"
4331 ,"wm deiconify $w\n"
4332 ,"wm title $w \"Help\"\n"
4333 ,"focus $w\n"
4334 ,"}\n"
4335 ,"}\n"
4336 ,"}\n"
4337 ,"set_menu_help \"File\"  \"In File menu you can load and store geometries, meshes etc.\"\n"
4338 ,"set_menu_help \"New Geometry\"  \"Deletes current geometry\"\n"
4339 ,"set_menu_help \"Load Geometry\"  \"Loads Geometry file in one of the formats STL (ASCII or binary), Constructive Solid Geometry (.geo) or 2D geometry. Please have a look into Netgen User's manuel for more details.\"\n"
4340 ,"set_menu_help \"Save Geometry\" \"Saves STL Geometry in in either ASCII or binary STL format.\"\n"
4341 ,"set_menu_help \"Load Mesh\" \"Loads surface and volume mesh in Netgen internal format.\"\n"
4342 ,"set_menu_help \"Save Mesh\" \"Saves surface and volume mesh in Netgen internal format.\"\n"
4343 ,"set_menu_help \"Write EPS File\" \"Dumps OpenGL rendering to EPS File.\"\n"
4344 ,"set_menu_help \"Save Options\" \"Saves current options in file \\\"ng.opt\\\". These options will be loaded again when starting ng in the same directory.\"\n"
4345 ,"set_menu_help \"Export Mesh\" \"Exports mesh in format defined by Export Filetype.\"\n"
4346 ,"set_menu_help \"Export Filetype\" \"Selects file format for exporting mesh. Please have a look into the Netgen User's manual for more information.\"\n"
4347 ,"set_menu_help \"Import Mesh\" \"Imports surface or volume mesh in exchange format.\"\n"
4348 ,"set_menu_help \"Quit\" \"Quits Netgen\"\n"
4349 ,"set_menu_help \"Geometry\" \"Preparing geometries, visualiztion of geometries.\"\n"
4350 ,"set_menu_help \"Scan CSG Geometry\" \"Generates surface triangulation for rendering\"\n"
4351 ,"set_menu_help \"CSG Options\" \"Sets Options for CSG visualization (bounding box, detail size, number of facets).\"\n"
4352 ,"set_menu_help \"CSG Properties\" \"Defines appearance of current CSG geometry (color, visibility, transparency)\"\n"
4353 ,"set_menu_help \"STL Doctor\" \"Calls STL Doctor for preprocessing STL geometry files.\"\n"
4354 ,"set_menu_help \"STL Info\" \"Retrieves information about current STL geometry.\"\n"
4355 ,"set_menu_help \"Mesh\" \"Menu for mesh generation\"\n"
4356 ,"set_menu_help \"Generate Mesh\" \"Generates mesh from geometry, same as Button \\\"Generate Mesh\\\"\"\n"
4357 ,"set_menu_help \"Stop Meshing\" \"Terminates meshgeneration. It may take a while until meshing terminates, please be patient.\"\n"
4358 ,"set_menu_help \"Meshing Options\" \"Set options for mesh generation.\"\n"
4359 ,"set_menu_help \"Delete Mesh\" \"Deletes mesh. Not necessary before generation of new mesh.\"\n"
4360 ,"set_menu_help \"Delete Vol Mesh\" \"Deletes only volume mesh.\"\n"
4361 ,"set_menu_help \"Mesh Quality\" \"Computs element shape measures. Triangle angles are inner angles of all triangles (faces of tetrahedra). Tet angles are angles between faces of tetrahedra.\"\n"
4362 ,"set_menu_help \"Check Surface Mesh\" \"Checks consistency and overlap of surface mesh. Marks overlapping elements as bad elements, please enable visualization of bad elements in View->Mesh.\"\n"
4363 ,"set_menu_help \"Check Volume Mesh\" \"Checks conformity of volume mesh.\"\n"
4364 ,"set_menu_help \"Edit Boundary Conditions\" \"Open dialog for setting boundary condition numbers for individual faces.\"\n"
4365 ,"set_menu_help \"Analyze Geometry\" \"Perform only first step in mesh generation. Action depends on geometry type, e.g. generates charts for STL mesh, find vertices in CSG geometries.\"\n"
4366 ,"set_menu_help \"Mesh Edges\" \"Meshes edges\"\n"
4367 ,"set_menu_help \"Mesh Surface\" \"Generates surface mesh. Includes already surface optimization for some geometry types.\"\n"
4368 ,"set_menu_help \"Optimize Surface\" \"Optimizes surface mesh.\"\n"
4369 ,"set_menu_help \"Surface Optim. Step\" \"Performs a specific surface optimiztion step. Mesh smoothing moves nodes. edge swapping swaps the diagonal of a quadrilateral built by two triangles, criterion either by number of nodes, or anlges. Combine points eliminates triangles by combining points (in the center of gravity).\"\n"
4370 ,"set_menu_help \"Mesh Volume\" \"Performs volume meshing. Algorithm is a combination of Delaunay and Rule-based Advancing Front\"\n"
4371 ,"set_menu_help \"Optimize Volume\" \"Performs additional volume optimization steps\"\n"
4372 ,"set_menu_help \"Smooth Opt Volume\" \"Performs optimization steps by smoothing iterations\"\n"
4373 ,"set_menu_help \"Smooth Opt Volume Jacobian\" \"Volume optimization by smoothing iterations. Criterion is optimization of Jacobi determinants. This optimization step is also available for 10-node tetrahedra.\"\n"
4374 ,"set_menu_help \"View\" \"Sets viewing options\"\n"
4375 ,"set_menu_help \"Zoom all\" \"Zooms scene to show whole object\"\n"
4376 ,"set_menu_help \"Center\" \"Defines center of rotation\"\n"
4377 ,"set_menu_help \"Viewing Options\" \"Sets viewing options for geometry, mesh, lighting\"\n"
4378 ,"set_menu_help \"Clipping Plane\" \"Introduces clipping plane. The clipping plane is defined by the normal vector, and a scaled offset. Clipping of performed by OpenGl rendering\"\n"
4379 ,"set_menu_help \"Quality Plot\" \"Shows the element quality distribution histogram. Measure is volume scaled by edge-length to the third. Optimal elements have measure 1.\"\n"
4380 ,"set_menu_help \"Sensitive Help\" \"Shows this help window\"\n"
4381 ,"set_menu_help \"Mesh-size\" \"Manipulations of existing mesh\"\n"
4382 ,"set_menu_help \"Refine uniform\" \"Refines mesh by splitting elements into eight childs (algorithm of J. Bey)\"\n"
4383 ,"set_menu_help \"Second Order\" \"Converts 4 node elements to 10 node elements. Edge-midpoitns are projected to the geometry.\"\n"
4384 ,"set_menu_help \"Refinement Dialog\" \"Controls local mesh refinement\"\n"
4385 ,"set_menu_help \"Load Meshsize\" \"Loads mesh-size file for local mesh refinement.\"\n"
4386 ,"set_menu_help \"MS from Surf Mesh\" \"Defines mesh-size by the surface mesh.\"\n"
4387 ,"set f .options_dlg.nb.nbframe.general\n"
4388 ,"set_control_help $f.fine \"Controls relative mesh size.\\nThis control affects other mesh-size controls in common\"\n"
4389 ,"set_control_help $f.first \"First step in mesh generation. Usually, meshing starts from \\\"analyze geometry\\\". If the surface mesh is already available \\\"First step\\\" should be set to \\\"mesh volume\\\"\"\n"
4390 ,"set_control_help $f.last \"Last step in mesh generation. If only the surface mesh is required, please set \\\"Last Step\\\" to \\\"Optimize Surface\\\"\"\n"
4391 ,"set_control_help .bubar.surfm \"Start mesh generation\"\n"
4392 ,"set_control_help .bubar.stopm \"Stop mesh generation\"\n"
4393 ,"proc help_item { helptext } {p\n"
4394 ,"puts $helptext\n"
4395 ,"}\n"
4396 ,"proc show_help { } {\n"
4397 ,"set w .help\n"
4398 ,"if {[winfo exists .help] == 1} {\n"
4399 ,"wm withdraw $w\n"
4400 ,"wm deiconif $w\n"
4401 ,"focus $w\n"
4402 ,"} {\n"
4403 ,"toplevel $w\n"
4404 ,"frame $w.buttons\n"
4405 ,"pack $w.buttons -side bottom -fill x -pady 2m\n"
4406 ,"button $w.buttons.done -text Done -command \"destroy $w\"\n"
4407 ,"pack $w.buttons.done  -side left -expand 1\n"
4408 ,"text $w.text -yscrollcommand \"$w.scroll set\" -setgrid true \\\n"
4409 ,"-width 60 -height 24 -wrap word\n"
4410 ,"scrollbar $w.scroll -command \"$w.text yview\"\n"
4411 ,"pack $w.scroll -side right -fill y\n"
4412 ,"pack $w.text -expand yes -fill both\n"
4413 ,"}\n"
4414 ,"$w.text configure -state normal\n"
4415 ,"$w.text delete 1.0 end\n"
4416 ,"}\n"
4417 ,"set bold \"-background \n"
4418 ,"set normal \"-background {} -relief flat\"\n"
4419 ,"proc help_main { } {\n"
4420 ,"show_help;\n"
4421 ,"set w .help\n"
4422 ,"global bold\n"
4423 ,"global normal\n"
4424 ,"$w.text insert 0.0 \\\n"
4425 ,"{NETGEN Help}\n"
4426 ,"$w.text insert end \\n\\n\n"
4427 ,"$w.text insert end \\\n"
4428 ,"{1. General} d1\n"
4429 ,"$w.text insert end \\n\\n\n"
4430 ,"$w.text insert end \\\n"
4431 ,"{2. Menu items } d2\n"
4432 ,"$w.text insert end \\n\\n\n"
4433 ,"foreach tag {d1 d2} {\n"
4434 ,"$w.text tag bind $tag <Any-Enter> \"$w.text tag configure $tag $bold\"\n"
4435 ,"$w.text tag bind $tag <Any-Leave> \"$w.text tag configure $tag $normal\"\n"
4436 ,"}\n"
4437 ,"$w.text tag bind d1 <1> { puts \"general\"; help_general }\n"
4438 ,"$w.text tag bind d2 <1> { help_menus }\n"
4439 ,"$w.text configure -state disabled\n"
4440 ,"}\n"
4441 ,"proc help_general { } {\n"
4442 ,"show_help;\n"
4443 ,"set w .help\n"
4444 ,"global bold\n"
4445 ,"global normal\n"
4446 ,"puts \"general called\"\n"
4447 ,"$w.text insert 0.0 \\\n"
4448 ,"{NETGEN is an automatic three dimensional tetrahedral mesh generation system. It accepts input from constructive solid geometry (CSG) or boundary representation (BRep) from STEP or STL file format. NETGEN contains modules for mesh optimization and hierarchical mesh refinement.}\n"
4449 ,"$w.text configure -state disabled\n"
4450 ,"}\n"
4451 ,"proc help_menus { } {\n"
4452 ,"show_help;\n"
4453 ,"set w .help\n"
4454 ,"global bold\n"
4455 ,"global normal\n"
4456 ,"$w.text insert 0.0 \\\n"
4457 ,"{The NETGEN Menu items are}\n"
4458 ,"$w.text insert end \\n\\n\n"
4459 ,"$w.text insert end \\\n"
4460 ,"{1. File} d1\n"
4461 ,"$w.text insert end \\n\\n\n"
4462 ,"$w.text insert end \\\n"
4463 ,"{2. Geometry } d2\n"
4464 ,"$w.text insert end \\n\\n\n"
4465 ,"$w.text insert end \\\n"
4466 ,"{3. Mesh } d3\n"
4467 ,"$w.text insert end \\n\\n\n"
4468 ,"$w.text insert end \\\n"
4469 ,"{4. View } d4\n"
4470 ,"$w.text insert end \\n\\n\n"
4471 ,"$w.text insert end \\\n"
4472 ,"{5. Mesh-size } d5\n"
4473 ,"$w.text insert end \\n\\n\n"
4474 ,"$w.text insert end \\\n"
4475 ,"{6. STL } d6\n"
4476 ,"foreach tag {d1 d2 d3 d4 d5 d6} {\n"
4477 ,"$w.text tag bind $tag <Any-Enter> \"$w.text tag configure $tag $bold\"\n"
4478 ,"$w.text tag bind $tag <Any-Leave> \"$w.text tag configure $tag $normal\"\n"
4479 ,"}\n"
4480 ,"$w.text tag bind d1 <1> {puts \"File menu\"}\n"
4481 ,"$w.text tag bind d2 <1> {puts \"Geometry menu\"}\n"
4482 ,"$w.text tag bind d3 <1> {puts \"Mesh menu\"}\n"
4483 ,"$w.text tag bind d4 <1> {puts \"View menu\"}\n"
4484 ,"$w.text tag bind d5 <1> {puts \"Mesh-size menu\"}\n"
4485 ,"$w.text tag bind d6 <1> {puts \"STL menu\"}\n"
4486 ,"$w.text configure -state disabled\n"
4487 ,"}\n"
4488 ,"}\n"
4489 ,"catch { Ng_Vis_Set parameters\n"
4490 ,"set viscnt 0\n"
4491 ,"proc snapshottimer { } {\n"
4492 ,"after 2000 { snapshottimer }\n"
4493 ,"global viscnt\n"
4494 ,"set viscnt [expr $viscnt+1]\n"
4495 ,"set s1 0000$viscnt\n"
4496 ,"set cnt [string range $s1 [expr [string length $s1]-4] end]\n"
4497 ,"set filename \"p$cnt.jpg\"\n"
4498 ,"}\n"
4499 ,"snapshottimer\n"
4500 ,"proc redrawtimer { } {\n"
4501 ,"global visoptions.autoredraw\n"
4502 ,"global visoptions.autoredrawtime\n"
4503 ,"set delay [expr int(${visoptions.autoredrawtime}*1000)]\n"
4504 ,"if { ${visoptions.autoredraw} == 1 } { redraw; }\n"
4505 ,"after $delay { redrawtimer }\n"
4506 ,"}\n"
4507 ,"redrawtimer\n"
4508 ,"set perstarttime [clock clicks -millisecond]\n"
4509 ,"proc redrawperiodic { } {\n"
4510 ,"global visoptions.redrawperiodic\n"
4511 ,"global perstarttime\n"
4512 ,"set curtime [clock clicks -millisecond]\n"
4513 ,"Ng_Vis_Set time [expr ($curtime - $perstarttime) / 5]\n"
4514 ,"redraw\n"
4515 ,"if { ${visoptions.redrawperiodic} == 1 } { after 30 { redrawperiodic } };\n"
4516 ,"}\n"
4517 ,"proc addplotline { identifier datax datay plotinfo {color black}} {\n"
4518 ,"set c $identifier.c\n"
4519 ,"set xstart [lindex $plotinfo 0]\n"
4520 ,"set ystart [lindex $plotinfo 1]\n"
4521 ,"set xmin [lindex $plotinfo 2]\n"
4522 ,"set ymin [lindex $plotinfo 3]\n"
4523 ,"set unitx [lindex $plotinfo 4]\n"
4524 ,"set unity [lindex $plotinfo 5]\n"
4525 ,"set latestx [expr ([lindex $datax 0]-$xmin)*$unitx + $xstart]\n"
4526 ,"set latesty [expr ([lindex $datay 0]-$ymin)*$unity + $ystart]\n"
4527 ,"for {set i 1} {$i < [llength $datax]} {incr i} {\n"
4528 ,"set xpos [expr ([lindex $datax $i]-$xmin)*$unitx + $xstart]\n"
4529 ,"set ypos [expr ([lindex $datay $i]-$ymin)*$unity + $ystart]\n"
4530 ,"$c create line $latestx $latesty $xpos $ypos -width 1 -fill $color\n"
4531 ,"set latestx $xpos\n"
4532 ,"set latesty $ypos\n"
4533 ,"}\n"
4534 ,"}\n"
4535 ,"proc createlineplot { width height identifier title xmin xmax ymin ymax plotinfo} {\n"
4536 ,"set thiswidth $width\n"
4537 ,"set thisheight $height\n"
4538 ,"if { $thiswidth < 275 } { set thiswidth 275 }\n"
4539 ,"if { $thisheight < 225 } { seth thisheight 225 }\n"
4540 ,"set w $identifier\n"
4541 ,"if {[winfo exists $w] == 1} {\n"
4542 ,"wm withdraw $w\n"
4543 ,"wm deiconify $w\n"
4544 ,"focus $w\n"
4545 ,"} {\n"
4546 ,"toplevel $w\n"
4547 ,"set c $w.c\n"
4548 ,"canvas $c -relief raised -width $thiswidth -height $thisheight\n"
4549 ,"pack $w.c -side top -fill x\n"
4550 ,"set titleFont {Helvetica 18}\n"
4551 ,"set smallFont {Helvetica 12}\n"
4552 ,"set xstart 100\n"
4553 ,"set xend [expr $thiswidth-75]\n"
4554 ,"set ystart [expr $thisheight-75]\n"
4555 ,"set yend 75\n"
4556 ,"$c create line $xstart $ystart $xstart $yend -width 2\n"
4557 ,"$c create line $xstart $ystart $xend $ystart -width 2\n"
4558 ,"set unitx [expr double($xend-$xstart)/($xmax-$xmin)]\n"
4559 ,"set unity [expr double($yend-$ystart)/($ymax-$ymin)]\n"
4560 ,"for {set i 0} {$i <= 1} {set i [expr $i+0.2]} {\n"
4561 ,"$c create line [expr $xstart+$i*($xend-$xstart)] [expr $ystart] [expr $xstart+$i*($xend-$xstart)] [expr $ystart+5] -width 2\n"
4562 ,"$c create text [expr $xstart+$i*($xend-$xstart)] [expr $ystart+7] -anchor n -font $smallFont \\\n"
4563 ,"-text [format \"%.3g\" [expr $xmin+$i*($xmax-$xmin)]]\n"
4564 ,"$c create line [expr $xstart] [expr $ystart+$i*($yend-$ystart)] [expr $xstart-7] [expr $ystart+$i*($yend-$ystart)] -width 2\n"
4565 ,"$c create text [expr $xstart-9] [expr $ystart+$i*($yend-$ystart)] -anchor e -font $smallFont \\\n"
4566 ,"-text [format \"%.3g\" [expr $ymin+$i*($ymax-$ymin)]]\n"
4567 ,"}\n"
4568 ,"upvar $plotinfo ploti\n"
4569 ,"set ploti \"$xstart $ystart $xmin $ymin $unitx $unity\"\n"
4570 ,"button $w.close -text \"Close\" -command \"destroy $w\"\n"
4571 ,"pack $w.close\n"
4572 ,"wm withdraw $w\n"
4573 ,"wm geom $w +100+100\n"
4574 ,"wm deiconify $w\n"
4575 ,"wm title $w $title\n"
4576 ,"focus $w\n"
4577 ,"}\n"
4578 ,"}\n"
4579 ,"proc getlineplotdata { datax datay xmini xmaxi ymini ymaxi} {\n"
4580 ,"upvar $datax datx\n"
4581 ,"upvar $datay daty\n"
4582 ,"upvar $xmini xmin\n"
4583 ,"upvar $xmaxi xmax\n"
4584 ,"upvar $ymini ymin\n"
4585 ,"upvar $ymaxi ymax\n"
4586 ,"global visoptions.lineplotusingx\n"
4587 ,"global visoptions.lineplotusingy\n"
4588 ,"global visoptions.lineplotsource\n"
4589 ,"global visoptions.lineplotfile\n"
4590 ,"set datx \"\"\n"
4591 ,"set daty \"\"\n"
4592 ,"set xmin 1e20\n"
4593 ,"set xmax -1e20\n"
4594 ,"set ymin 1e20\n"
4595 ,"set ymax -1e20\n"
4596 ,"if {${visoptions.lineplotsource} == \"file\"} {\n"
4597 ,"set fileId [open ${visoptions.lineplotfile} r]\n"
4598 ,"set line \"\"\n"
4599 ,"while {[gets $fileId line] >= 0} {\n"
4600 ,"if { [string index [lindex $line 0] 0] != \"\\\n"
4601 ,"if { ${visoptions.lineplotusingx} < [llength $line] } {\n"
4602 ,"lappend datx [lindex $line ${visoptions.lineplotusingx}]\n"
4603 ,"if { [lindex $datx end] < $xmin } {set xmin [lindex $datx end]}\n"
4604 ,"if { [lindex $datx end] > $xmax } {set xmax [lindex $datx end]}\n"
4605 ,"} {\n"
4606 ,"lappend datx 0\n"
4607 ,"}\n"
4608 ,"if { ${visoptions.lineplotusingy} < [llength $line] } {\n"
4609 ,"lappend daty [lindex $line ${visoptions.lineplotusingy}]\n"
4610 ,"if { [lindex $daty end] < $ymin } {set ymin [lindex $daty end]}\n"
4611 ,"if { [lindex $daty end] > $ymax } {set ymax [lindex $daty end]}\n"
4612 ,"} {\n"
4613 ,"lappend daty 0\n"
4614 ,"}\n"
4615 ,"}\n"
4616 ,"}\n"
4617 ,"close $fileId\n"
4618 ,"}\n"
4619 ,"}\n"
4620 ,"proc lineplotdialog { } {\n"
4621 ,"set w .lineplot_dlg\n"
4622 ,"if {[winfo exists .lineplot_dlg] == 1} {\n"
4623 ,"wm withdraw $w\n"
4624 ,"wm deiconify $w\n"
4625 ,"focus $w\n"
4626 ,"} {\n"
4627 ,"toplevel $w\n"
4628 ,"ttk::frame $w.filesettings -relief  groove -borderwidth 3\n"
4629 ,"ttk::frame $w.filesettings.title\n"
4630 ,"ttk::radiobutton $w.filesettings.title.choose -variable visoptions.lineplotsource \\\n"
4631 ,"-value file -text \"Data from File\"\n"
4632 ,"pack $w.filesettings.title.choose -side left\n"
4633 ,"pack $w.filesettings.title\n"
4634 ,"global visoptions.lineplotselectedeval\n"
4635 ,"global visoptions.lineplotfile\n"
4636 ,"global visoptions.evaluatefilenames\n"
4637 ,"global visoptions.evaluatefiledescriptions\n"
4638 ,"set evdata [NGS_GetData evaluatefiles]\n"
4639 ,"set visoptions.evaluatefilenames none\n"
4640 ,"set visoptions.evaluatefiledescriptions none\n"
4641 ,"for {set i 0} {[expr $i+1] < [llength $evdata]} {incr i 2} {\n"
4642 ,"lappend visoptions.evaluatefilenames [lindex $evdata $i]\n"
4643 ,"lappend visoptions.evaluatefiledescriptions [lindex $evdata [expr $i+1]]\n"
4644 ,"}\n"
4645 ,"ttk::frame $w.filesettings.latestevals\n"
4646 ,"ttk::label  $w.filesettings.latestevals.lab -text \"Use Evaluate Results: \"\n"
4647 ,"ttk::menubutton $w.filesettings.latestevals.but -menu $w.filesettings.latestevals.menu -text \"coarse\" -width 40\n"
4648 ,"menu $w.filesettings.latestevals.menu -tearoff 0\n"
4649 ,"for {set i 0} {$i < [llength ${visoptions.evaluatefilenames}]} {incr i} {\n"
4650 ,"$w.filesettings.latestevals.menu add command -label $i\\\n"
4651 ,"-command \"set visoptions.lineplotselectedeval $i ; $w.filesettings.latestevals.but configure -text \\\"[lindex ${visoptions.evaluatefiledescriptions} $i] ([lindex ${visoptions.evaluatefilenames} $i])\\\"\"\n"
4652 ,"}\n"
4653 ,"$w.filesettings.latestevals.menu invoke ${visoptions.lineplotselectedeval}\n"
4654 ,"grid $w.filesettings.latestevals.lab $w.filesettings.latestevals.but -sticky nw\n"
4655 ,"pack $w.filesettings.latestevals\n"
4656 ,"ttk::frame $w.filesettings.sfn\n"
4657 ,"ttk::button $w.filesettings.sfn.bb -text \"Browse\" \\\n"
4658 ,"-command { set visoptions.lineplotfile [tk_getOpenFile] }\n"
4659 ,"ttk::entry $w.filesettings.sfn.fn -width 50 \\\n"
4660 ,"-textvariable visoptions.lineplotfile\n"
4661 ,"pack $w.filesettings.sfn.bb $w.filesettings.sfn.fn -side left\n"
4662 ,"pack $w.filesettings.sfn\n"
4663 ,"ttk::button $w.filesettings.refresh -text \"Refresh\" -command {\n"
4664 ,"if { ${visoptions.lineplotselectedeval} != 0} {\n"
4665 ,"set visoptions.lineplotfile [lindex ${visoptions.evaluatefilenames} ${visoptions.lineplotselectedeval}]\n"
4666 ,"}\n"
4667 ,"set saveusingx ${visoptions.lineplotusingx}\n"
4668 ,"set saveusingy ${visoptions.lineplotusingy}\n"
4669 ,"for { set i 0 } { $i < [llength ${visoptions.lineplotdatadescr}] } { incr i } {\n"
4670 ,"${visoptions.lineplotxcoordselector} delete $i\n"
4671 ,"}\n"
4672 ,"for { set i 0 } { $i < [llength ${visoptions.lineplotdatadescr}] } { incr i } {\n"
4673 ,"${visoptions.lineplotycoordselector} delete $i\n"
4674 ,"}\n"
4675 ,"set fileId [open ${visoptions.lineplotfile} r]\n"
4676 ,"set line \"\"\n"
4677 ,"gets $fileId line\n"
4678 ,"close $fileId\n"
4679 ,"if { [lindex $line 0] == \"\\\n"
4680 ,"set visoptions.lineplotdatadescr [lrange $line 1 end]\n"
4681 ,"} {\n"
4682 ,"set visoptions.lineplotdatadescr \"\"\n"
4683 ,"for { set i 0 } { $i < [llength $line] } { incr i } {\n"
4684 ,"lappend visoptions.lineplotdatadescr \"data[expr $i+1]\"\n"
4685 ,"}\n"
4686 ,"}\n"
4687 ,"for { set i 0 } { $i < [llength ${visoptions.lineplotdatadescr}] } { incr i } {\n"
4688 ,"${visoptions.lineplotxcoordselector} add command $i -label [lindex ${visoptions.lineplotdatadescr} $i]\n"
4689 ,"}\n"
4690 ,"for { set i 0 } { $i < [llength ${visoptions.lineplotdatadescr}] } { incr i } {\n"
4691 ,"${visoptions.lineplotycoordselector} add command $i -label [lindex ${visoptions.lineplotdatadescr} $i]\n"
4692 ,"}\n"
4693 ,"if { $saveusingx < [llength ${visoptions.lineplotdatadescr}] } {\n"
4694 ,"set visoptions.lineplotusingx $saveusingx\n"
4695 ,"} {\n"
4696 ,"set visoptions.lineplotusingx 0\n"
4697 ,"}\n"
4698 ,"if { $saveusingy < [llength ${visoptions.lineplotdatadescr}] } {\n"
4699 ,"set visoptions.lineplotusingy $saveusingy\n"
4700 ,"} {\n"
4701 ,"set visoptions.lineplotusingy 1\n"
4702 ,"}\n"
4703 ,"}\n"
4704 ,"pack $w.filesettings.refresh\n"
4705 ,"ttk::frame $w.filesettings.using\n"
4706 ,"global visoptions.lineplotdatadescr\n"
4707 ,"ttk::frame $w.filesettings.using.xco\n"
4708 ,"ttk::label  $w.filesettings.using.xco.lab -text \"X-Coord:\"\n"
4709 ,"ttk::menubutton $w.filesettings.using.xco.but -menu $w.filesettings.using.xco.menu -text \"\" -width 15\n"
4710 ,"menu $w.filesettings.using.xco.menu -tearoff 0\n"
4711 ,"for {set i 0} {$i < [llength ${visoptions.lineplotdatadescr}]} {incr i} {\n"
4712 ,"$w.filesettings.using.xco.menu add command -label [lindex ${visoptions.lineplotdatadescr} $i]\\\n"
4713 ,"-command \"set visoptions.lineplotusingx $i ; $w.filesettings.using.xco.but configure -text \\\"[lindex ${visoptions.lineplotdatadescr} $i]\\\"\"\n"
4714 ,"}\n"
4715 ,"$w.filesettings.using.xco.menu invoke [lindex ${visoptions.lineplotdatadescr} 0]\n"
4716 ,"grid $w.filesettings.using.xco.lab $w.filesettings.using.xco.but -sticky nw\n"
4717 ,"ttk::frame $w.filesettings.using.yco\n"
4718 ,"ttk::label  $w.filesettings.using.yco.lab -text \"Y-Coord:\"\n"
4719 ,"ttk::menubutton $w.filesettings.using.yco.but -menu $w.filesettings.using.yco.menu -text \"\" -width 15\n"
4720 ,"menu $w.filesettings.using.yco.menu -tearoff 0\n"
4721 ,"for {set i 0} {$i < [llength ${visoptions.lineplotdatadescr}]} {incr i} {\n"
4722 ,"$w.filesettings.using.yco.menu add command -label [lindex ${visoptions.lineplotdatadescr} $i]\\\n"
4723 ,"-command \"set visoptions.lineplotusingy $i ; $w.filesettings.using.yco.but configure -text \\\"[lindex ${visoptions.lineplotdatadescr} $i]\\\"\"\n"
4724 ,"}\n"
4725 ,"$w.filesettings.using.yco.menu invoke [lindex ${visoptions.lineplotdatadescr} 0]\n"
4726 ,"grid $w.filesettings.using.yco.lab $w.filesettings.using.yco.but -sticky nw\n"
4727 ,"global visoptions.lineplotxcoordselector\n"
4728 ,"global visoptions.lineplotycoordselector\n"
4729 ,"set visoptions.lineplotxcoordselector $w.filesettings.using.xco\n"
4730 ,"set visoptions.lineplotycoordselector $w.filesettings.using.yco\n"
4731 ,"pack $w.filesettings.using.xco $w.filesettings.using.yco -side left\n"
4732 ,"pack $w.filesettings.using\n"
4733 ,"pack $w.filesettings -fill x -ipady 3\n"
4734 ,"ttk::frame $w.settings -relief  groove -borderwidth 3\n"
4735 ,"ttk::label $w.settings.title -text \"\\nSettings\\n\"\n"
4736 ,"pack $w.settings.title\n"
4737 ,"ttk::frame $w.settings.minmax\n"
4738 ,"ttk::checkbutton $w.settings.minmax.autoscale -text \"Autoscale\" -variable visoptions.lineplotautoscale\n"
4739 ,"ttk::frame $w.settings.minmax.xmin\n"
4740 ,"ttk::label $w.settings.minmax.xmin.label -text \"Min. x: \"\n"
4741 ,"ttk::spinbox $w.settings.minmax.xmin.sp -textvariable visoptions.lineplotxmin -width 6 -increment 0.1 -validate focus -validatecommand \"my_validatespinbox %W %P 3\" \\\n"
4742 ,"-invalidcommand \"my_invalidspinbox %W\" -from -1e9 -to 1e9\n"
4743 ,"ttk::frame $w.settings.minmax.xmax\n"
4744 ,"ttk::label $w.settings.minmax.xmax.label -text \"Max. x: \"\n"
4745 ,"ttk::spinbox $w.settings.minmax.xmax.sp -textvariable visoptions.lineplotxmax -width 6 -increment 0.1 -validate focus -validatecommand \"my_validatespinbox %W %P 3\" \\\n"
4746 ,"-invalidcommand \"my_invalidspinbox %W\" -from -1e9 -to 1e9\n"
4747 ,"ttk::frame $w.settings.minmax.ymin\n"
4748 ,"ttk::label $w.settings.minmax.ymin.label -text \"Min. y: \"\n"
4749 ,"ttk::spinbox $w.settings.minmax.ymin.sp -textvariable visoptions.lineplotymin -width 6 -increment 0.1 -validate focus -validatecommand \"my_validatespinbox %W %P 3\" \\\n"
4750 ,"-invalidcommand \"my_invalidspinbox %W\" -from -1e9 -to 1e9\n"
4751 ,"ttk::frame $w.settings.minmax.ymax\n"
4752 ,"ttk::label $w.settings.minmax.ymax.label -text \"Max. y: \"\n"
4753 ,"ttk::spinbox $w.settings.minmax.ymax.sp -textvariable visoptions.lineplotymax -width 6 -increment 0.1 -validate focus -validatecommand \"my_validatespinbox %W %P 3\" \\\n"
4754 ,"-invalidcommand \"my_invalidspinbox %W\" -from -1e9 -to 1e9\n"
4755 ,"pack $w.settings.minmax.xmin.label $w.settings.minmax.xmin.sp\n"
4756 ,"pack $w.settings.minmax.xmax.label $w.settings.minmax.xmax.sp\n"
4757 ,"pack $w.settings.minmax.ymin.label $w.settings.minmax.ymin.sp\n"
4758 ,"pack $w.settings.minmax.ymax.label $w.settings.minmax.ymax.sp\n"
4759 ,"pack $w.settings.minmax.autoscale $w.settings.minmax.xmin $w.settings.minmax.xmax \\\n"
4760 ,"$w.settings.minmax.ymin $w.settings.minmax.ymax -side left\n"
4761 ,"pack $w.settings.minmax\n"
4762 ,"ttk::label $w.settings.empty1 -text \"\"\n"
4763 ,"pack $w.settings.empty1\n"
4764 ,"ttk::frame $w.settings.plotsize\n"
4765 ,"ttk::frame $w.settings.plotsize.xsize\n"
4766 ,"ttk::label $w.settings.plotsize.xsize.label -text \"Plotsize  x: \"\n"
4767 ,"ttk::spinbox $w.settings.plotsize.xsize.sp -textvariable visoptions.lineplotsizex -width 6 -increment 1 -validate focus -validatecommand \"my_validatespinbox %W %P 0\" \\\n"
4768 ,"-invalidcommand \"my_invalidspinbox %W\" -from -1e9 -to 1e9\n"
4769 ,"pack $w.settings.plotsize.xsize.label $w.settings.plotsize.xsize.sp\n"
4770 ,"ttk::frame $w.settings.plotsize.ysize\n"
4771 ,"ttk::label $w.settings.plotsize.ysize.label -text \"Plotsize  y: \"\n"
4772 ,"ttk::spinbox $w.settings.plotsize.ysize.sp -textvariable visoptions.lineplotsizey -width 6 -increment 1 -validate focus -validatecommand \"my_validatespinbox %W %P 0\" \\\n"
4773 ,"-invalidcommand \"my_invalidspinbox %W\" -from -1e9 -to 1e9\n"
4774 ,"pack $w.settings.plotsize.ysize.label $w.settings.plotsize.ysize.sp\n"
4775 ,"pack $w.settings.plotsize.xsize $w.settings.plotsize.ysize -side left\n"
4776 ,"pack $w.settings.plotsize\n"
4777 ,"ttk::label $w.settings.empty2 -text \"\"\n"
4778 ,"pack $w.settings.empty2\n"
4779 ,"ttk::frame $w.settings.color\n"
4780 ,"ttk::label  $w.settings.color.lab -text \"Linecolor: \"\n"
4781 ,"ttk::menubutton $w.settings.color.but -menu $w.settings.color.menu -text \"\" -width 15\n"
4782 ,"menu $w.settings.color.menu -tearoff 0\n"
4783 ,"foreach step { red black blue green yellow } {\n"
4784 ,"$w.settings.color.menu add command -label $step -command \"set visoptions.lineplotcolor $step; $w.settings.color.but configure -text \\\"$step\\\"\"\n"
4785 ,"}\n"
4786 ,"$w.settings.color.menu invoke \"red\"\n"
4787 ,"grid $w.settings.color.lab $w.settings.color.but -sticky nw\n"
4788 ,"pack $w.settings.color\n"
4789 ,"pack $w.settings -fill x\n"
4790 ,"set datax \"\"\n"
4791 ,"set datay \"\"\n"
4792 ,"set xmin 0\n"
4793 ,"set xmax 0\n"
4794 ,"set ymin 0\n"
4795 ,"set ymax 0\n"
4796 ,"ttk::frame $w.plots -relief  groove -borderwidth 3\n"
4797 ,"ttk::frame $w.plots.selplot\n"
4798 ,"ttk::label  $w.plots.selplot.lab -text \"Linecolor: \"\n"
4799 ,"ttk::menubutton $w.plots.selplot.but -menu $w.plots.selplot.menu -text \"\" -width 15\n"
4800 ,"menu $w.plots.selplot.menu -tearoff 0\n"
4801 ,"$w.plots.selplot.menu add command -label \"None\" -command \"set visoptions.lineplotselected \\\"None\\\"; $w.plots.selplot.but configure -text \\\"None\\\"\"\n"
4802 ,"grid $w.plots.selplot.lab $w.plots.selplot.but -sticky nw\n"
4803 ,"$w.plots.selplot.menu invoke \"None\"\n"
4804 ,"global visoptions.lineplotselector\n"
4805 ,"set visoptions.lineplotselector $w.plots.selplot.menu\n"
4806 ,"ttk::button $w.plots.new -text \"Generate New Plot\" -command {\n"
4807 ,"if { ${visoptions.lineplotselectedeval} != 0} {\n"
4808 ,"set visoptions.lineplotfile [lindex ${visoptions.evaluatefilenames} ${visoptions.lineplotselectedeval}]\n"
4809 ,"}\n"
4810 ,"getlineplotdata datax datay xmin xmax ymin ymax\n"
4811 ,"puts stdout \"xmin $xmin xmax $xmax ymin $ymin ymax $ymax\"\n"
4812 ,"global visoptions.lineplotautoscale\n"
4813 ,"if {! ${visoptions.lineplotautoscale}} {\n"
4814 ,"puts \"using set min/max values\"\n"
4815 ,"set xmin ${visoptions.lineplotxmin}\n"
4816 ,"set xmax ${visoptions.lineplotxmax}\n"
4817 ,"set ymin ${visoptions.lineplotymin}\n"
4818 ,"set ymax ${visoptions.lineplotymax}\n"
4819 ,"}\n"
4820 ,"incr visoptions.lineplotcurrentnum\n"
4821 ,"set ident .newplot${visoptions.lineplotcurrentnum}\n"
4822 ,"set plotinfo \"\"\n"
4823 ,"createlineplot ${visoptions.lineplotsizex} ${visoptions.lineplotsizey} \\\n"
4824 ,"$ident \"Lineplot ${visoptions.lineplotcurrentnum}\" \\\n"
4825 ,"$xmin $xmax $ymin $ymax plotinfo\n"
4826 ,"lappend visoptions.lineplotinfos $plotinfo\n"
4827 ,"${visoptions.lineplotselector} add command ${visoptions.lineplotcurrentnum} -label \"Lineplot ${visoptions.lineplotcurrentnum}\"\n"
4828 ,"addplotline $ident $datax $datay $plotinfo ${visoptions.lineplotcolor}\n"
4829 ,"}\n"
4830 ,"ttk::button $w.plots.addto -text \"Add to Selected Plot\" -command {\n"
4831 ,"if { ${visoptions.lineplotselectedeval} != 0} {\n"
4832 ,"set visoptions.lineplotfile [lindex ${visoptions.evaluatefilenames} ${visoptions.lineplotselectedeval}]\n"
4833 ,"}\n"
4834 ,"if { ${visoptions.lineplotselected} != \"none\" } {\n"
4835 ,"getlineplotdata datax datay xmin xmax ymin ymax\n"
4836 ,"set ident .newplot${visoptions.lineplotselected}\n"
4837 ,"set plotinfo [lindex ${visoptions.lineplotinfos} ${visoptions.lineplotselected}]\n"
4838 ,"addplotline $ident $datax $datay $plotinfo ${visoptions.lineplotcolor}\n"
4839 ,"}\n"
4840 ,"}\n"
4841 ,"pack $w.plots.new $w.plots.addto $w.plots.selplot\n"
4842 ,"pack $w.plots -fill x -ipady 3\n"
4843 ,"ttk::button $w.close -text \"Close\" -command \"destroy $w\"\n"
4844 ,"pack $w.close\n"
4845 ,"wm withdraw $w\n"
4846 ,"wm geom $w +200+100\n"
4847 ,"wm deiconify $w\n"
4848 ,"wm title $w \"2D Lineplots\"\n"
4849 ,"focus $w\n"
4850 ,"}\n"
4851 ,"}\n"
4852 ,"set fieldlinesdialog_pop1 0\n"
4853 ,"proc fieldlinesdialog { } {\n"
4854 ,"set w .fieldlines_dlg\n"
4855 ,"global fieldlinesdialog_pop1\n"
4856 ,"set fieldlinesdialog_pop1 1\n"
4857 ,"if {[winfo exists .fieldlines_dlg] == 1} {\n"
4858 ,"wm withdraw $w\n"
4859 ,"wm deiconify $w\n"
4860 ,"focus $w\n"
4861 ,"} {\n"
4862 ,"toplevel $w\n"
4863 ,"pack [ttk::notebook $w.nb]  -fill both -side top -ipadx 6 -ipady 6\n"
4864 ,"$w.nb add [ttk::frame $w.nb.draw] -text \"Draw\" -underline 0\n"
4865 ,"$w.nb add [ttk::frame $w.nb.settings] -text \"Settings\" -underline 0\n"
4866 ,"set f $w.nb.draw\n"
4867 ,"ttk::labelframe $f.general -text \"General settings\" -relief groove -borderwidth 3\n"
4868 ,"ttk::checkbutton $f.general.enable -text \"Enable Fieldlines\" \\\n"
4869 ,"-variable visoptions.drawfieldlines \\\n"
4870 ,"-command {\n"
4871 ,"Ng_Vis_Set parameters;\n"
4872 ,"redraw\n"
4873 ,"}\n"
4874 ,"ttk::label $f.general.numl -text \"num:\"\n"
4875 ,"ttk::spinbox $f.general.num -from 0 -to 100 -increment 1 \\\n"
4876 ,"-textvariable visoptions.numfieldlines -width 4\n"
4877 ,"grid $f.general.enable -sticky nw -padx 4 -pady 2\n"
4878 ,"grid x $f.general.numl $f.general.num -rowspan 3 -sticky w -padx 4 -row 0 -pady 2\n"
4879 ,"grid anchor $f.general center\n"
4880 ,"pack $f.general -pady 15 -fill x -ipady 3\n"
4881 ,"ttk::label $f.labe0 -text \" \"\n"
4882 ,"pack $f.labe0\n"
4883 ,"ttk::checkbutton $f.general.randomstart -text \"Field dependent density    \" \\\n"
4884 ,"-variable visoptions.fieldlinesrandomstart \\\n"
4885 ,"-command { Ng_Vis_Set parameters; redraw}\n"
4886 ,"ttk::checkbutton $f.general.redrawperiodic -text \"Animate periodic\" \\\n"
4887 ,"-variable visoptions.redrawperiodic \\\n"
4888 ,"-command {\n"
4889 ,"redrawperiodic\n"
4890 ,"Ng_Vis_Set parameters;\n"
4891 ,"redraw\n"
4892 ,"}\n"
4893 ,"grid $f.general.randomstart -sticky nw -padx 4 -row 1\n"
4894 ,"grid $f.general.redrawperiodic -sticky nw -padx 4 -row 2\n"
4895 ,"ttk::label $f.lab0 -text \" \"\n"
4896 ,"pack $f.lab0\n"
4897 ,"ttk::frame $f.vecfun\n"
4898 ,"ttk::label  $f.vecfun.lab -text \"Vector Function: \"\n"
4899 ,"ttk::menubutton $f.vecfun.but -menu $f.vecfun.menu -text \"\" -width 12\n"
4900 ,"menu $f.vecfun.menu -tearoff 0\n"
4901 ,"for { set i 1 } { $i <= [Ng_Vis_Field getnfieldnames] } { incr i } {\n"
4902 ,"set fname [Ng_Vis_Field getfieldname $i]\n"
4903 ,"set fcomp [Ng_Vis_Field getfieldcomponents $i]\n"
4904 ,"set iscomplex [Ng_Vis_Field iscomplex $i]\n"
4905 ,"set sdim [Ng_Vis_Field getdimension]\n"
4906 ,"if { $iscomplex == 1 } { set fcomp [expr $fcomp / 2] }\n"
4907 ,"if { ($fcomp == $sdim) || ($fcomp == 3) } {\n"
4908 ,"$f.vecfun.menu add command -label $fname -command \"set visoptions.fieldlinesvecfunction $fname;Ng_Vis_Set parameters; redraw;$f.vecfun.but configure -text \\\"$fname\\\" \" 	    }\n"
4909 ,"}\n"
4910 ,"grid $f.vecfun.lab $f.vecfun.but -sticky nw\n"
4911 ,"pack $f.vecfun\n"
4912 ,"ttk::label $f.lab00 -text \" \"\n"
4913 ,"pack $f.lab00\n"
4914 ,"ttk::frame $f.phasesettings\n"
4915 ,"ttk::checkbutton $f.phasesettings.onephase -text \"Fix Phase\" -variable visoptions.fieldlinesonlyonephase\n"
4916 ,"ttk::frame $f.phasesettings.phase\n"
4917 ,"ttk::label $f.phasesettings.phase.lab -text \"phi\"\n"
4918 ,"ttk::scale $f.phasesettings.phase.sc -orient horizontal -length 100 -from 0 -to 360 -variable visoptions.fieldlinesphase \\\n"
4919 ,"-command \"roundscale $f.phasesettings.phase.sc 0; popupcheckredraw3 fieldlinesdialog_pop1\"\n"
4920 ,"ttk::entry $f.phasesettings.phase.ent -width 4 -textvariable visoptions.fieldlinesphase -validate focus -takefocus 0 \\\n"
4921 ,"-validatecommand \"popupcheckredraw3 fieldlinesdialog_pop1;my_validate %W 0 1 %P 0\" \\\n"
4922 ,"-invalidcommand \"my_invalid %W;popupcheckredraw3 fieldlinesdialog_pop1\"\n"
4923 ,"grid $f.phasesettings.phase.lab $f.phasesettings.phase.sc $f.phasesettings.phase.ent -sticky nw -ipadx 4\n"
4924 ,"pack $f.phasesettings.onephase $f.phasesettings.phase -side left\n"
4925 ,"pack $f.phasesettings\n"
4926 ,"ttk::label $f.lab1 -text \" \"\n"
4927 ,"pack $f.lab1\n"
4928 ,"ttk::frame $f.boxsettings -relief groove -borderwidth 3\n"
4929 ,"ttk::frame $f.boxsettings.title\n"
4930 ,"ttk::radiobutton $f.boxsettings.title.choose -variable visoptions.fieldlinesstartarea \\\n"
4931 ,"-value box -text \"Startpoints in Box\"\n"
4932 ,"pack $f.boxsettings.title.choose -side left\n"
4933 ,"pack $f.boxsettings.title\n"
4934 ,"ttk::frame $f.boxsettings.points\n"
4935 ,"ttk::label $f.boxsettings.points.lab2 -text \"Pmin\";\n"
4936 ,"ttk::entry $f.boxsettings.points.ent1x -width 8 \\\n"
4937 ,"-textvariable visoptions.fieldlinesstartareap1x\n"
4938 ,"ttk::entry $f.boxsettings.points.ent1y -width 8 \\\n"
4939 ,"-textvariable visoptions.fieldlinesstartareap1y\n"
4940 ,"ttk::entry $f.boxsettings.points.ent1z -width 8 \\\n"
4941 ,"-textvariable visoptions.fieldlinesstartareap1z\n"
4942 ,"ttk::label $f.boxsettings.points.lab3 -text \"   Pmax\";\n"
4943 ,"ttk::entry $f.boxsettings.points.ent2x -width 8 \\\n"
4944 ,"-textvariable visoptions.fieldlinesstartareap2x\n"
4945 ,"ttk::entry $f.boxsettings.points.ent2y -width 8 \\\n"
4946 ,"-textvariable visoptions.fieldlinesstartareap2y\n"
4947 ,"ttk::entry $f.boxsettings.points.ent2z -width 8 \\\n"
4948 ,"-textvariable visoptions.fieldlinesstartareap2z\n"
4949 ,"pack $f.boxsettings.points\n"
4950 ,"pack $f.boxsettings.points.lab2 $f.boxsettings.points.ent1x $f.boxsettings.points.ent1y $f.boxsettings.points.ent1z -side left\n"
4951 ,"pack $f.boxsettings.points.lab3 $f.boxsettings.points.ent2x $f.boxsettings.points.ent2y $f.boxsettings.points.ent2z -side left\n"
4952 ,"ttk::button $f.boxsettings.settobb -text \"Bounding Box\" -command {\n"
4953 ,"set bbox [Ng_MeshInfo bbox]\n"
4954 ,"set visoptions.fieldlinesstartareap1x [lindex $bbox 0]\n"
4955 ,"set visoptions.fieldlinesstartareap2x [lindex $bbox 1]\n"
4956 ,"set visoptions.fieldlinesstartareap1y [lindex $bbox 2]\n"
4957 ,"set visoptions.fieldlinesstartareap2y [lindex $bbox 3]\n"
4958 ,"set visoptions.fieldlinesstartareap1z [lindex $bbox 4]\n"
4959 ,"set visoptions.fieldlinesstartareap2z [lindex $bbox 5]\n"
4960 ,"}\n"
4961 ,"pack $f.boxsettings.settobb\n"
4962 ,"pack $f.boxsettings -fill x -ipady 3\n"
4963 ,"ttk::frame $f.facesettings -relief groove -borderwidth 3\n"
4964 ,"ttk::frame $f.facesettings.title\n"
4965 ,"ttk::radiobutton $f.facesettings.title.choose -variable visoptions.fieldlinesstartarea \\\n"
4966 ,"-value face -text \"Startpoints on Face\"\n"
4967 ,"pack $f.facesettings.title.choose -side left\n"
4968 ,"pack $f.facesettings.title\n"
4969 ,"ttk::frame $f.facesettings.index\n"
4970 ,"ttk::label $f.facesettings.index.lab -text \"face index:\"\n"
4971 ,"ttk::label $f.facesettings.index.ent -text 1;\n"
4972 ,"pack $f.facesettings.index.lab $f.facesettings.index.ent -side left\n"
4973 ,"pack $f.facesettings.index\n"
4974 ,"pack $f.facesettings -fill x -ipady 3\n"
4975 ,"global visoptions.fieldlinesfilename\n"
4976 ,"ttk::frame $f.filesettings -relief  groove -borderwidth 3\n"
4977 ,"ttk::frame $f.filesettings.title\n"
4978 ,"ttk::radiobutton $f.filesettings.title.choose -variable visoptions.fieldlinesstartarea \\\n"
4979 ,"-value file -text \"Startpoints from File\"\n"
4980 ,"pack $f.filesettings.title.choose -side left\n"
4981 ,"pack $f.filesettings.title\n"
4982 ,"ttk::frame $f.filesettings.sfn\n"
4983 ,"ttk::button $f.filesettings.sfn.bb -text \"Browse\" \\\n"
4984 ,"-command {\n"
4985 ,"set types {\n"
4986 ,"{ \"Netgen Fieldlines\" {.nef} }\n"
4987 ,"}\n"
4988 ,"set visoptions.fieldlinesfilename [tk_getOpenFile -filetypes $types -defaultextension \".nef\"]\n"
4989 ,"}\n"
4990 ,"ttk::entry $f.filesettings.sfn.fn -width 50 \\\n"
4991 ,"-textvariable visoptions.fieldlinesfilename\n"
4992 ,"pack $f.filesettings.sfn.bb $f.filesettings.sfn.fn -side left\n"
4993 ,"pack $f.filesettings.sfn\n"
4994 ,"pack $f.filesettings -fill x -ipady 3\n"
4995 ,"set g $w.nb.settings\n"
4996 ,"ttk::frame $g.linesettings -relief groove -borderwidth 3\n"
4997 ,"ttk::label $g.linesettings.title -text \"\\nLine Settings\\n\"\n"
4998 ,"ttk::frame $g.linesettings.length\n"
4999 ,"ttk::label $g.linesettings.length.lab -text \"rel. Length: \"\n"
5000 ,"ttk::spinbox $g.linesettings.length.sp -textvariable visoptions.fieldlineslength -width 6 -increment 0.1 -validate focus -validatecommand \"my_validatespinbox %W %P 5\" \\\n"
5001 ,"-invalidcommand \"my_invalidspinbox %W\" -from 0.00001 -to 10000\n"
5002 ,"grid $g.linesettings.length.lab $g.linesettings.length.sp -sticky nw\n"
5003 ,"ttk::frame $g.linesettings.maxpoints\n"
5004 ,"ttk::label $g.linesettings.maxpoints.lab -text \"max. Points: \"\n"
5005 ,"ttk::spinbox $g.linesettings.maxpoints.sp -textvariable visoptions.fieldlinesmaxpoints -width 6 -increment 1 -validate focus -validatecommand \"my_validatespinbox %W %P 0\" \\\n"
5006 ,"-invalidcommand \"my_invalidspinbox %W\" -from 0 -to 10000\n"
5007 ,"grid $g.linesettings.maxpoints.lab $g.linesettings.maxpoints.sp -sticky nw\n"
5008 ,"ttk::frame $g.linesettings.thick\n"
5009 ,"ttk::label $g.linesettings.thick.lab -text \"rel. Thickness: \"\n"
5010 ,"ttk::spinbox $g.linesettings.thick.sp -textvariable visoptions.fieldlinesthickness -width 6 -increment 0.001 -validate focus -validatecommand \"my_validatespinbox %W %P 6\" \\\n"
5011 ,"-invalidcommand \"my_invalidspinbox %W\" -from 1e-10 -to 0.5\n"
5012 ,"grid $g.linesettings.thick.lab $g.linesettings.thick.sp -stick nw\n"
5013 ,"pack $g.linesettings.title $g.linesettings.length $g.linesettings.maxpoints $g.linesettings.thick\n"
5014 ,"pack $g.linesettings -fill x -ipady 3\n"
5015 ,"global visoptions.fieldlinestolerance\n"
5016 ,"ttk::frame $g.odesettings -relief groove -borderwidth 3\n"
5017 ,"ttk::label $g.odesettings.title -text \"\\nODE Settings\\n\"\n"
5018 ,"ttk::frame $g.odesettings.tol\n"
5019 ,"ttk::label $g.odesettings.tol.lab -text \"rel. Thickness: \"\n"
5020 ,"ttk::spinbox $g.odesettings.tol.sp -textvariable visoptions.fieldlinestolerance -width 6 -increment 0.01 -validate focus -validatecommand \"my_validatespinbox %W %P 5\" \\\n"
5021 ,"-invalidcommand \"my_invalidspinbox %W\" -from 0.00001 -to 1\n"
5022 ,"grid $g.odesettings.tol.lab $g.odesettings.tol.sp -stick nw\n"
5023 ,"ttk::frame $g.odesettings.rktype\n"
5024 ,"ttk::label  $g.odesettings.rktype.lab -text \"RK-Type \"\n"
5025 ,"ttk::menubutton $g.odesettings.rktype.but -menu $g.odesettings.rktype.menu -text \"\" -width 25\n"
5026 ,"menu $g.odesettings.rktype.menu -tearoff 0\n"
5027 ,"$g.odesettings.rktype.menu add command -label \"Euler, order 1\" -command \"set visoptions.fieldlinesrktype \\\"euler\\\" ;Ng_Vis_Set parameters; redraw;$g.odesettings.rktype.but configure -text \\\"Euler,order 1\\\" \"\n"
5028 ,"$g.odesettings.rktype.menu add command -label \"Euler-Cauchy, order 2\" -command \"set visoptions.fieldlinesrktype \\\"eulercauchy\\\" ;Ng_Vis_Set parameters; redraw;$g.odesettings.rktype.but configure -text \\\"Euler-Cauchy,order 2\\\" \"\n"
5029 ,"$g.odesettings.rktype.menu add command -label \"Simpson, order 3\" -command \"set visoptions.fieldlinesrktype \\\"simpson\\\" ;Ng_Vis_Set parameters; redraw;$g.odesettings.rktype.but configure -text \\\"Simpson,order 3\\\"\"\n"
5030 ,"$g.odesettings.rktype.menu add command -label \"classical Runge-Kutta, order 4\" -command \"set visoptions.fieldlinesrktype \\\"crungekutta\\\" ;Ng_Vis_Set parameters; redraw; $g.odesettings.rktype.but configure -text \\\"classical Runge-Kutta,order 4\\\"\"\n"
5031 ,"$g.odesettings.rktype.menu invoke \"classical Runge-Kutta, order 4\"\n"
5032 ,"grid $g.odesettings.rktype.lab $g.odesettings.rktype.but -sticky nw\n"
5033 ,"pack $g.odesettings.title $g.odesettings.tol $g.odesettings.rktype\n"
5034 ,"pack $g.odesettings -fill x -ipady 3\n"
5035 ,"ttk::frame $w.bu\n"
5036 ,"pack $w.bu -fill x -ipady 3\n"
5037 ,"ttk::button $w.bu.calc -text \"Build Fieldlines\" -command {\n"
5038 ,"if { ${visoptions.fieldlinesvecfunction} == \"none\" } {\n"
5039 ,"bgerror \"Please select the vector function first!\"\n"
5040 ,"} {\n"
5041 ,"set visoptions.drawfieldlines 1\n"
5042 ,"Ng_Vis_Set parameters\n"
5043 ,"Ng_BuildFieldLines\n"
5044 ,"redraw\n"
5045 ,"}\n"
5046 ,"}\n"
5047 ,"ttk::button $w.bu.help -text \"Help\" -command {\n"
5048 ,"if {[winfo exists .fieldlines_help] == 1} {\n"
5049 ,"wm withdraw .fieldlines_help\n"
5050 ,"wm deiconify .fieldlines_help\n"
5051 ,"focus .fieldlines_help\n"
5052 ,"} {\n"
5053 ,"toplevel .fieldlines_help\n"
5054 ,"set f [frame .fieldlines_help.ht]\n"
5055 ,"ttk::scrollbar $f.vsb -orient vertical -command [list $f.t yview]\n"
5056 ,"text $f.t -yscrollcommand [list $f.vsb set]\n"
5057 ,"grid $f.t -row 0 -column 0 -sticky nsew\n"
5058 ,"grid $f.vsb -row 0 -column 1 -sticky nsew\n"
5059 ,"grid columnconfigure $f 0 -weight 1\n"
5060 ,"grid rowconfigure $f 0 -weight 1\n"
5061 ,"set text $f.t\n"
5062 ,"$text configure -setgrid true -wrap word\n"
5063 ,"$text tag configure bold -font *-*-bold-*-*-*-*\n"
5064 ,"$text insert end \\\n"
5065 ,"\"Draw menu\\n \\n\" bold\n"
5066 ,"$text insert end \\\n"
5067 ,"\"Enable Fieldlines\\n    To turn on and off the calculated fieldlines. (Has to be turned on to start the calculation)\\n\"\n"
5068 ,"$text insert end \\\n"
5069 ,"\"Num\\n    Number of fieldlines to calculate. (May not be used exactly.)\"\n"
5070 ,"$text insert end \\\n"
5071 ,"\"Field dependent density\\n    There will be more fieldline startpoints where the field is stronger\\n\\n\"\n"
5072 ,"$text insert end \\\n"
5073 ,"\"Animate periodic\\n    (for quasistationary fields) The fieldlines of the different phase angles are animated.\\n    ATTENTION: \\\"Fix Phase\\\" has to be turned off\\n\\n\"\n"
5074 ,"$text insert end \\\n"
5075 ,"\"Vector Function\\n    The function fixing the direction of the lines\\n\\n\"\n"
5076 ,"$text insert end \\\n"
5077 ,"\"Fix Phase\\n    (for quasistationary fields) Only calculate and draw fieldlines for one special phase angle.\\n\\n\"\n"
5078 ,"$text insert end \\\n"
5079 ,"\"Startpoints in Box\\n    Set the startpoints inside the box \\[Pmin1,Pmax1\\] x \\[Pmin2,Pmax2\\] x \\[Pmin3,Pmax3\\]\\n\"\n"
5080 ,"$text insert end \\\n"
5081 ,"\"    With the button \\\"Bounding Box\\\" the whole bounding box of the geometry is selected.\\n\\n\"\n"
5082 ,"$text insert end \\\n"
5083 ,"\"Startpoints on Face\\n    All startpoints will be set on one face. This face is selected by double-clicking with the mouse.\\n\\n\"\n"
5084 ,"$text insert end \\\n"
5085 ,"\"Startpoints from File\\n    The startpoint information will be read from the selected file.\\n    The entries in the file can be as follows:\\n\"\n"
5086 ,"$text insert end \\\n"
5087 ,"\"        point <x> <y> <z>\\n            set a (potential) startpoint\\n\"\n"
5088 ,"$text insert end \\\n"
5089 ,"\"        line <x1> <y1> <z1> <x2> <y2> <z2> <n>\\n            set n (potential) startpoints on the line from (x1,y1,z1) to (x2,y2,z2)\\n\"\n"
5090 ,"$text insert end \\\n"
5091 ,"\"        box <x1> <y1> <z1> <x2> <y2> <z2> <n>\\n            set n (potential) startpoints inside the box \\[x1,x2\\] x \\[y1,y2\\] x \\[z1,z2\\]\\n\"\n"
5092 ,"$text insert end \\\n"
5093 ,"\"    ATTENTION: These are potential startpoints.\\n               The total number of startpoints will be bounded by the \\\"Num\\\"-parameter.\\n \\n \\n \\n\"\n"
5094 ,"$text insert end \\\n"
5095 ,"\"Settings Menu\\n \\n\" bold\n"
5096 ,"$text insert end \\\n"
5097 ,"\"rel. Length\\n    The maximal length of a fieldline relative to the diameter of the geometry.\\n\\n\"\n"
5098 ,"$text insert end \\\n"
5099 ,"\"max. Points\\n    The maximum number of Runge-Kutta steps.\\n\\n\"\n"
5100 ,"$text insert end \\\n"
5101 ,"\"rel. Thickness\\n    The thickness of the fieldlines relative to the diameter of the geometry.\\n\\n\"\n"
5102 ,"$text insert end \\\n"
5103 ,"\"rel. Tolerance\\n    The tolerance for the step-length control of the Runge-Kutta method.\\n\\n\"\n"
5104 ,"$text insert end \\\n"
5105 ,"\"RK-Type\\n    Which Runge-Kutta scheme to use\\n \\n \\n \\n\"\n"
5106 ,"$text insert end \\\n"
5107 ,"\"Button \\\"Build Fieldlines\\\"\\n\" bold\n"
5108 ,"$text insert end \\\n"
5109 ,"\"    Build the fieldlines.\"\n"
5110 ,"$text configure -state disabled\n"
5111 ,"pack .fieldlines_help.ht -expand yes -fill both\n"
5112 ,"wm withdraw .fieldlines_help\n"
5113 ,"wm geom .fieldlines_help +300+200\n"
5114 ,"wm deiconify .fieldlines_help\n"
5115 ,"wm title .fieldlines_help \"Fieldlines Help\"\n"
5116 ,"focus .fieldlines_help\n"
5117 ,"}\n"
5118 ,"}\n"
5119 ,"ttk::button $w.bu.cancel -text \"Done\" -command \"destroy $w\"\n"
5120 ,"grid $w.bu.calc $w.bu.help $w.bu.cancel -sticky nw -padx 4\n"
5121 ,"grid anchor $w.bu center\n"
5122 ,"wm withdraw $w\n"
5123 ,"wm geom $w +200+100\n"
5124 ,"wm deiconify $w\n"
5125 ,"wm title $w \"Fieldlines\"\n"
5126 ,"focus $w\n"
5127 ,"}\n"
5128 ,"global visoptions.fieldlinesstartface\n"
5129 ,"set f $w.nb.draw\n"
5130 ,"set visoptions.fieldlinesstartface [Ng_BCProp getactive]\n"
5131 ,"$f.facesettings.index.ent configure -text ${visoptions.fieldlinesstartface}\n"
5132 ,"}\n"
5133 ,"set visual_dialog_pop1 0\n"
5134 ,"set visual_dialog_pop2 0\n"
5135 ,"set visual_dialog_pop3 0\n"
5136 ,"set visual_dialog_pop4 0\n"
5137 ,"set visual_dialog_pop5 0\n"
5138 ,"set visual_dialog_pop6 0\n"
5139 ,"set visual_dialog_pop7 0\n"
5140 ,"proc visual_dialog { } {\n"
5141 ,"set w .visoptions_dlg\n"
5142 ,"global visual_dialog_pop1\n"
5143 ,"global visual_dialog_pop2\n"
5144 ,"global visual_dialog_pop3\n"
5145 ,"global visual_dialog_pop4\n"
5146 ,"global visual_dialog_pop5\n"
5147 ,"global visual_dialog_pop6\n"
5148 ,"global visual_dialog_pop7\n"
5149 ,"set visual_dialog_pop1 1\n"
5150 ,"set visual_dialog_pop2 1\n"
5151 ,"set visual_dialog_pop3 1\n"
5152 ,"set visual_dialog_pop4 1\n"
5153 ,"set visual_dialog_pop5 1\n"
5154 ,"set visual_dialog_pop6 1\n"
5155 ,"set visual_dialog_pop7 1\n"
5156 ,"if {[winfo exists .visoptions_dlg] == 1} {\n"
5157 ,"wm withdraw $w\n"
5158 ,"wm deiconify $w\n"
5159 ,"focus $w\n"
5160 ,"} {\n"
5161 ,"toplevel $w\n"
5162 ,"ttk::frame $w.main\n"
5163 ,"pack $w.main -fill x\n"
5164 ,"set w $w.main\n"
5165 ,"ttk::frame $w.upperfr ;\n"
5166 ,"pack $w.upperfr -fill x;\n"
5167 ,"ttk::labelframe $w.upperfr.size -text \"Grid\" -relief groove -borderwidth 3\n"
5168 ,"ttk::entry $w.upperfr.size.ent -width 3 -textvariable visoptions.gridsize -validate focus -takefocus 0 -validatecommand \"popupcheckredraw visual_dialog_pop2;my_validate %W 0 200 %P 0\" \\\n"
5169 ,"-invalidcommand \"my_invalid %W;popupcheckredraw visual_dialog_pop2\"\n"
5170 ,"ttk::scale $w.upperfr.size.sc -orient horizontal -length 100 -from 1 -to 200 -variable visoptions.gridsize\\\n"
5171 ,"-command \"roundscale $w.upperfr.size.sc 0;popupcheckredraw visual_dialog_pop2\"\n"
5172 ,"ttk::labelframe $w.upperfr.offsets -text \"x / y offsets\" -relief groove -borderwidth 3\n"
5173 ,"ttk::label $w.upperfr.offsets.xlab -text \"x\"\n"
5174 ,"ttk::label $w.upperfr.offsets.ylab -text \"y\"\n"
5175 ,"ttk::scale $w.upperfr.offsets.xoffset -orient horizontal -length 100 -from 0 -to 1 -variable visoptions.xoffset \\\n"
5176 ,"-command \"roundscale $w.upperfr.offsets.xoffset 2; popupcheckredraw visual_dialog_pop3\"\n"
5177 ,"ttk::scale $w.upperfr.offsets.yoffset -orient horizontal -length 100 -from 0 -to 1 -variable visoptions.yoffset \\\n"
5178 ,"-command \"roundscale $w.upperfr.offsets.yoffset 2; popupcheckredraw visual_dialog_pop4\"\n"
5179 ,"ttk::entry $w.upperfr.offsets.entx -width 4 -textvariable visoptions.xoffset -validate focus -takefocus 0 \\\n"
5180 ,"-validatecommand \"popupcheckredraw visual_dialog_pop3;my_validate %W 0 1 %P 2\" \\\n"
5181 ,"-invalidcommand \"my_invalid %W;popupcheckredraw visual_dialog_pop3\"\n"
5182 ,"ttk::entry $w.upperfr.offsets.enty -width 4 -textvariable visoptions.yoffset -validate focus -takefocus 0 \\\n"
5183 ,"-validatecommand \"popupcheckredraw visual_dialog_pop4;my_validate %W 0 1 %P 2\" \\\n"
5184 ,"-invalidcommand \"my_invalid %W;popupcheckredraw visual_dialog_pop4\"\n"
5185 ,"pack $w.upperfr.size.sc $w.upperfr.size.ent -padx 4  -pady 12 -side left\n"
5186 ,"grid $w.upperfr.offsets.xoffset $w.upperfr.offsets.entx $w.upperfr.offsets.xlab -sticky nw -padx 4\n"
5187 ,"grid $w.upperfr.offsets.yoffset $w.upperfr.offsets.enty $w.upperfr.offsets.ylab -sticky nw -padx 4\n"
5188 ,"grid $w.upperfr.size $w.upperfr.offsets -sticky nw -pady 7 -padx 10\n"
5189 ,"grid anchor $w.upperfr center\n"
5190 ,"ttk::labelframe $w.deform -relief groove -borderwidth 3 -text \"Deformation settings\"\n"
5191 ,"ttk::checkbutton $w.deform.cb -text \"Deformation\" \\\n"
5192 ,"-variable visoptions.deformation \\\n"
5193 ,"-command { Ng_Vis_Set parameters; redraw }\n"
5194 ,"ttk::label $w.deform.l -text \"Scale: \"\n"
5195 ,"ttk::spinbox $w.deform.sc1 -from 0 -to 1e99 -textvariable visoptions.scaledeform1 -width 5 \\\n"
5196 ,"-command { Ng_Vis_Set parameters; redraw } \\\n"
5197 ,"-validate focusout -validatecommand { Ng_Vis_Set parameters; redraw; string is double %P } \\\n"
5198 ,"-invalidcommand { puts \"invalid value, %P %s\"; set visoptions.scaledeform1 1; }\n"
5199 ,"ttk::scale $w.deform.sc2 -orient horizontal -length 100 -from 0 -to 1 \\\n"
5200 ,"-variable  visoptions.scaledeform2 \\\n"
5201 ,"-command { popupcheckredraw visual_dialog_pop5 }\n"
5202 ,"pack $w.deform -fill x -ipady 2 -pady 4 -ipady 3\n"
5203 ,"grid $w.deform.cb $w.deform.l $w.deform.sc1 $w.deform.sc2 -sticky nw -padx 4;\n"
5204 ,"grid anchor $w.deform center\n"
5205 ,"grid columnconfigure $w.deform 0 -pad 20\n"
5206 ,"grid columnconfigure $w.deform 2 -pad 20\n"
5207 ,"ttk::labelframe $w.as -relief groove -borderwidth 3 -text \"Scaling options\"\n"
5208 ,"ttk::checkbutton $w.as.autoscale -text \"Autoscale\" \\\n"
5209 ,"-variable visoptions.autoscale \\\n"
5210 ,"-command { Ng_Vis_Set parameters; redraw }\n"
5211 ,"ttk::label $w.as.lmin -text \"Min-value\"\n"
5212 ,"ttk::spinbox $w.as.smin -textvariable visoptions.mminval -width 5 -validate focus \\\n"
5213 ,"-validatecommand \"my_validatespinbox %W %P 10\" \\\n"
5214 ,"-command \"Ng_Vis_Set parameters; redraw;\" \\\n"
5215 ,"-invalidcommand \"my_invalidspinbox %W\" -from -1e10 -to 1e10 -increment 0.001\n"
5216 ,"ttk::label $w.as.lmax -text \"Max-value\"\n"
5217 ,"ttk::spinbox $w.as.smax -textvariable visoptions.mmaxval -width 5 -validate focus \\\n"
5218 ,"-validatecommand \"Ng_Vis_Set parameters; redraw;my_validatespinbox %W %P 10\" \\\n"
5219 ,"-command \"Ng_Vis_Set parameters; redraw;\" \\\n"
5220 ,"-invalidcommand \"my_invalidspinbox %W;Ng_Vis_Set parameters; redraw\" -from -1e10 -to 1e10 -increment 0.001\n"
5221 ,"pack $w.as -fill x -pady 5 -ipady 3\n"
5222 ,"grid $w.as.autoscale $w.as.lmin $w.as.smin $w.as.lmax $w.as.smax -sticky nw -padx 4\n"
5223 ,"grid columnconfigure $w.as 0 -pad 20\n"
5224 ,"grid columnconfigure $w.as 2 -pad 20\n"
5225 ,"grid anchor $w.as center\n"
5226 ,"ttk::frame $w.iso; \n"
5227 ,"pack $w.iso -anchor center;\n"
5228 ,"ttk::labelframe $w.iso.cb -relief groove -borderwidth 3 -text \"Iso lines / surfaces\"\n"
5229 ,"pack $w.iso.cb -side left -pady 7 -fill y\n"
5230 ,"ttk::checkbutton $w.iso.cb.isolines -text \"Iso-lines\" \\\n"
5231 ,"-variable visoptions.isolines \\\n"
5232 ,"-command { Ng_Vis_Set parameters; redraw }\n"
5233 ,"ttk::checkbutton $w.iso.cb.isosurf -text \"Iso-Surface\" \\\n"
5234 ,"-variable visoptions.isosurf \\\n"
5235 ,"-command { Ng_Vis_Set parameters; redraw }\n"
5236 ,"ttk::label $w.iso.cb.numisol -text \"amount\"\n"
5237 ,"ttk::scale $w.iso.cb.numiso -orient horizontal -length 100 -from 2 -to 50 \\\n"
5238 ,"-variable  visoptions.numiso \\\n"
5239 ,"-command \"roundscale $w.iso.cb.numiso 0;popupcheckredraw visual_dialog_pop6\"\n"
5240 ,"ttk::entry $w.iso.cb.entry -textvariable visoptions.numiso -width 3 \\\n"
5241 ,"-validate focus -validatecommand \"popupcheckredraw visual_dialog_pop6;\\\n"
5242 ,"my_validate %W [$w.iso.cb.numiso cget -from] [$w.iso.cb.numiso cget -to] %P 0\" \\\n"
5243 ,"-invalidcommand \"my_invalid %W;popupcheckredraw visual_dialog_pop6\"\n"
5244 ,"grid $w.iso.cb.isolines $w.iso.cb.numisol $w.iso.cb.entry -sticky nw -padx 4\n"
5245 ,"grid $w.iso.cb.isosurf  -sticky nw -padx 4\n"
5246 ,"grid $w.iso.cb.numiso  -sticky nw -padx 4 -columnspan 2 -column 1 -row 1\n"
5247 ,"ttk::labelframe $w.iso.subdiv -text \"Subdivision\" -relief groove -borderwidth 3\n"
5248 ,"ttk::radiobutton $w.iso.subdiv.zero -text \"0\" -variable visoptions.subdivisions -value 0 \\\n"
5249 ,"-command {\n"
5250 ,"Ng_Vis_Set parameters; redraw;\n"
5251 ,"}\n"
5252 ,"ttk::radiobutton $w.iso.subdiv.one -text \"1\" -variable visoptions.subdivisions -value 1 \\\n"
5253 ,"-command {\n"
5254 ,"Ng_Vis_Set parameters; redraw;\n"
5255 ,"}\n"
5256 ,"ttk::radiobutton $w.iso.subdiv.two -text \"2\" -variable visoptions.subdivisions -value 2 \\\n"
5257 ,"-command {\n"
5258 ,"Ng_Vis_Set parameters; redraw;\n"
5259 ,"}\n"
5260 ,"ttk::radiobutton $w.iso.subdiv.three -text \"3\" -variable visoptions.subdivisions -value 3 \\\n"
5261 ,"-command {\n"
5262 ,"Ng_Vis_Set parameters; redraw;\n"
5263 ,"}\n"
5264 ,"ttk::radiobutton $w.iso.subdiv.four -text \"4\" -variable visoptions.subdivisions -value 4 \\\n"
5265 ,"-command {\n"
5266 ,"Ng_Vis_Set parameters; redraw;\n"
5267 ,"}\n"
5268 ,"ttk::radiobutton $w.iso.subdiv.five -text \"5\" -variable visoptions.subdivisions -value 5 \\\n"
5269 ,"-command {\n"
5270 ,"Ng_Vis_Set parameters; redraw;\n"
5271 ,"}\n"
5272 ,"ttk::label $w.iso.subdiv.text  -text \"subdivision\"\n"
5273 ,"pack $w.iso.subdiv -side right -fill y -padx 4 -pady 7\n"
5274 ,"grid $w.iso.subdiv.zero $w.iso.subdiv.one $w.iso.subdiv.two $w.iso.subdiv.three $w.iso.subdiv.four $w.iso.subdiv.five\n"
5275 ,"grid anchor $w.iso.subdiv center\n"
5276 ,"ttk::labelframe $w.redraw -relief groove -borderwidth 3 -text \"Auto-redraw\"\n"
5277 ,"ttk::checkbutton $w.redraw.auto -text \"Auto-redraw after (sec)\" \\\n"
5278 ,"-variable visoptions.autoredraw\n"
5279 ,"ttk::spinbox $w.redraw.val -textvariable visoptions.autoredrawtime -from 0 -to 100 -width 3\n"
5280 ,"pack $w.redraw -fill x -ipady 3 -pady 7\n"
5281 ,"grid $w.redraw.auto  $w.redraw.val -sticky nw\n"
5282 ,"grid anchor $w.redraw center\n"
5283 ,"ttk::labelframe $w.lowerframe -text \"Additional viewing options\" -relief groove -borderwidth 3\n"
5284 ,"pack $w.lowerframe -fill x\n"
5285 ,"set w $w.lowerframe\n"
5286 ,"ttk::frame $w.f1\n"
5287 ,"set f [ttk::frame $w.f1.clipsol]\n"
5288 ,"pack $f -anchor e\n"
5289 ,"menu $f.m\n"
5290 ,"ttk::menubutton $f.b -menu $f.m -width 12\n"
5291 ,"ttk::label $f.l -text \"Clipping Plane Sol: \"\n"
5292 ,"global visoptions.clipsolution\n"
5293 ,"set clipsollabs(none) \"None\"\n"
5294 ,"set clipsollabs(scal) \"Scalar Function\"\n"
5295 ,"set clipsollabs(vec) \"Vector Function\"\n"
5296 ,"foreach i { none scal vec } {\n"
5297 ,"set textval $clipsollabs($i)\n"
5298 ,"$f.m add command -label \"$textval\" -command \\\n"
5299 ,"\"$f.b configure -text \\\"$textval\\\" ; set visoptions.clipsolution $i ; Ng_Vis_Set parameters ; redraw \"\n"
5300 ,"}\n"
5301 ,"pack $f.b $f.l -side right\n"
5302 ,"$f.m invoke $clipsollabs(${visoptions.clipsolution})\n"
5303 ,"set f [ttk::frame $w.f1.scalfun]\n"
5304 ,"pack $f -anchor e\n"
5305 ,"menu $f.m\n"
5306 ,"ttk::menubutton $f.b -menu $f.m -width 12\n"
5307 ,"ttk::label $f.l -text \"Scalar Function: \"\n"
5308 ,"set scalentries [list none None]\n"
5309 ,"for { set i 1 } { $i <= [Ng_Vis_Field getnfieldnames] } { incr i } {\n"
5310 ,"set fname [Ng_Vis_Field getfieldname $i]\n"
5311 ,"set fcomp [Ng_Vis_Field getfieldcomponents $i]\n"
5312 ,"if { $fcomp == 1 } {\n"
5313 ,"lappend scalentries $fname:1 $fname\n"
5314 ,"} {\n"
5315 ,"for { set j 1 } { $j <= $fcomp } { incr j } {\n"
5316 ,"lappend scalentries $fname:$j \"$fname ($j)\"\n"
5317 ,"}\n"
5318 ,"lappend scalentries $fname:0 \"func ($fname)\"\n"
5319 ,"}\n"
5320 ,"}\n"
5321 ,"global visoptions.scalfunction\n"
5322 ,"foreach { name textval } $scalentries {\n"
5323 ,"$f.m add command -label \"$textval\" -command \\\n"
5324 ,"\"$f.b configure -text \\\"$textval\\\" ; set visoptions.scalfunction $name ; Ng_Vis_Set parameters ; redraw ; \"\n"
5325 ,"}\n"
5326 ,"pack $f.b $f.l -side right\n"
5327 ,"foreach { name textval } $scalentries {\n"
5328 ,"if { ${visoptions.scalfunction} == $name } {\n"
5329 ,"$f.m invoke $textval\n"
5330 ,"}\n"
5331 ,"}\n"
5332 ,"set f [ttk::frame $w.f1.vecfun]\n"
5333 ,"pack $f -anchor e\n"
5334 ,"menu $f.m\n"
5335 ,"ttk::menubutton $f.b -menu $f.m -width 12\n"
5336 ,"ttk::label $f.l -text \"Vector Function: \"\n"
5337 ,"set vecentries [list none None]\n"
5338 ,"for { set i 1 } { $i <= [Ng_Vis_Field getnfieldnames] } { incr i } {\n"
5339 ,"set fname [Ng_Vis_Field getfieldname $i]\n"
5340 ,"set fcomp [Ng_Vis_Field getfieldcomponents $i]\n"
5341 ,"set iscomplex [Ng_Vis_Field iscomplex $i]\n"
5342 ,"set sdim [Ng_Vis_Field getdimension]\n"
5343 ,"if { $iscomplex == 1 } { set fcomp [expr $fcomp / 2] }\n"
5344 ,"if { ($fcomp == $sdim) || ($fcomp == 3) } {\n"
5345 ,"lappend vecentries $fname $fname\n"
5346 ,"}\n"
5347 ,"}\n"
5348 ,"global visoptions.vecfunction\n"
5349 ,"foreach { name textval } $vecentries {\n"
5350 ,"$f.m add command -label \"$textval\" -command \\\n"
5351 ,"\"$f.b configure -text \\\"$textval\\\" ; set visoptions.vecfunction $name ; Ng_Vis_Set parameters ; redraw ; \"\n"
5352 ,"}\n"
5353 ,"pack $f.b $f.l -side right\n"
5354 ,"foreach { name textval } $vecentries {\n"
5355 ,"if { ${visoptions.vecfunction} == $name } {\n"
5356 ,"$f.m invoke $textval\n"
5357 ,"}\n"
5358 ,"}\n"
5359 ,"set f [ttk::frame $w.f1.evaluate]\n"
5360 ,"pack $f -anchor e\n"
5361 ,"menu $f.m\n"
5362 ,"ttk::menubutton $f.b -menu $f.m -width 12\n"
5363 ,"ttk::label $f.l -text \"Evaluate: \"\n"
5364 ,"global visoptions.evaluate\n"
5365 ,"set evallabs(abs) \"| |\"\n"
5366 ,"set evallabs(abstens) \"|tensor|\"\n"
5367 ,"set evallabs(mises) \"Mises\"\n"
5368 ,"set evallabs(main) \"Main\"\n"
5369 ,"foreach i { abs abstens mises main } {\n"
5370 ,"set textval $evallabs($i)\n"
5371 ,"$f.m add command -label \"$textval\" -command \\\n"
5372 ,"\"$f.b configure -text \\\"$textval\\\" ; set visoptions.evaluate $i ; \"\n"
5373 ,"}\n"
5374 ,"pack $f.b $f.l -side right\n"
5375 ,"$f.m invoke $evallabs(${visoptions.evaluate})\n"
5376 ,"pack [ttk::frame $w.f1.multidim] -fill x\n"
5377 ,"set f [ttk::frame $w.f1.multidim.f]\n"
5378 ,"pack $f -anchor e\n"
5379 ,"ttk::label $f.l1 -text \"multidim-component: \"\n"
5380 ,"ttk::spinbox $f.sb1 -from 0 -to 1e99 -textvariable visoptions.multidimcomponent -width 3 \\\n"
5381 ,"-command { Ng_Vis_Set parameters; redraw }\n"
5382 ,"pack $f.l1 $f.sb1 -side left\n"
5383 ,"ttk::frame $w.fcb\n"
5384 ,"grid $w.f1 $w.fcb -sticky nw -padx 7 -ipady 3\n"
5385 ,"grid anchor $w center\n"
5386 ,"ttk::frame $w.fcb.cb\n"
5387 ,"pack $w.fcb.cb\n"
5388 ,"ttk::checkbutton $w.fcb.cb.showsurfsolution -text \"Draw Surface Vectors\" \\\n"
5389 ,"-variable visoptions.showsurfacesolution \\\n"
5390 ,"-command { Ng_Vis_Set parameters; redraw }\n"
5391 ,"ttk::checkbutton $w.fcb.cb.showcurves -text \"Show Curves\" \\\n"
5392 ,"-variable visoptions.drawpointcurves \\\n"
5393 ,"-command { Ng_Vis_Set parameters; redraw }\n"
5394 ,"ttk::checkbutton $w.fcb.cb.imaginary -text \"Imaginary Part\" \\\n"
5395 ,"-variable visoptions.imaginary \\\n"
5396 ,"-command { Ng_Vis_Set parameters; redraw }\n"
5397 ,"ttk::checkbutton $w.fcb.cb.logscale -text \"Log Scale\" \\\n"
5398 ,"-variable visoptions.logscale \\\n"
5399 ,"-command { Ng_Vis_Set parameters; redraw }\n"
5400 ,"ttk::checkbutton $w.fcb.cb.invcolor -text \"Inverse Color\" \\\n"
5401 ,"-variable visoptions.invcolor \\\n"
5402 ,"-command { Ng_Vis_Set parametersrange; redraw }\n"
5403 ,"ttk::frame $w.fcb.cb.texframe\n"
5404 ,"ttk::checkbutton $w.fcb.cb.texframe.usetexture -text \"Use Textures (\" \\\n"
5405 ,"-variable visoptions.usetexture \\\n"
5406 ,"-command { Ng_Vis_Set parameters; redraw }\n"
5407 ,"ttk::checkbutton $w.fcb.cb.texframe.lintexture -text \"Linear )\" \\\n"
5408 ,"-variable visoptions.lineartexture \\\n"
5409 ,"-command { Ng_Vis_Set parametersrange; redraw }\n"
5410 ,"ttk::checkbutton $w.fcb.cb.lineartexture -text \"Use Linear Texture\" \\\n"
5411 ,"-variable visoptions.lineartexture \\\n"
5412 ,"-command { Ng_Vis_Set parameters; redraw }\n"
5413 ,"scale $w.numcols -orient horizontal -length 100 -from 0 -to 50 \\\n"
5414 ,"-resolution 1   \\\n"
5415 ,"-variable  visoptions.numtexturecols \\\n"
5416 ,"-command { popupcheckredraw visual_dialog_pop1 }\n"
5417 ,"ttk::checkbutton $w.fcb.cb.showclipsolution -text \"Draw Clipping Plane Solution\" \\\n"
5418 ,"-variable visoptions.showclipsolution \\\n"
5419 ,"-command { Ng_Vis_Set parameters; redraw }\n"
5420 ,"ttk::checkbutton $w.fcb.cb.redrawperiodic -text \"Animate periodic\" \\\n"
5421 ,"-variable visoptions.redrawperiodic \\\n"
5422 ,"-command {\n"
5423 ,"redrawperiodic\n"
5424 ,"Ng_Vis_Set parameters;\n"
5425 ,"redraw\n"
5426 ,"}\n"
5427 ,"grid $w.fcb.cb.showsurfsolution -sticky nw\n"
5428 ,"grid $w.fcb.cb.showcurves -sticky nw\n"
5429 ,"grid $w.fcb.cb.imaginary -sticky nw\n"
5430 ,"grid $w.fcb.cb.logscale -sticky nw\n"
5431 ,"grid $w.fcb.cb.texframe -sticky nw\n"
5432 ,"grid $w.fcb.cb.invcolor -sticky nw\n"
5433 ,"grid $w.fcb.cb.redrawperiodic -sticky nw\n"
5434 ,"pack $w.fcb.cb.texframe.usetexture $w.fcb.cb.texframe.lintexture -side left -expand yes\n"
5435 ,"set w .visoptions_dlg.main\n"
5436 ,"ttk::frame $w.bu;\n"
5437 ,"pack $w.bu  -pady 5 -padx 4\n"
5438 ,"ttk::button $w.bu.showsol -text \"Show Solution\" -command {\n"
5439 ,"set selectvisual solution\n"
5440 ,"Ng_SetVisParameters\n"
5441 ,"redraw\n"
5442 ,"}\n"
5443 ,"ttk::button $w.bu.clipping -text \"Clipping\" -command {\n"
5444 ,"clippingdialog;\n"
5445 ,"}\n"
5446 ,"ttk::button $w.bu.fieldlines -text \"Fieldlines\" -command {\n"
5447 ,"fieldlinesdialog;\n"
5448 ,"}\n"
5449 ,"ttk::button $w.bu.lineplot -text \"2D Lineplot\" -command {\n"
5450 ,"lineplotdialog;\n"
5451 ,"}\n"
5452 ,"ttk::button $w.bu.done -text \"Close\" -command {\n"
5453 ,"destroy .visoptions_dlg\n"
5454 ,"}\n"
5455 ,"pack $w.bu.showsol $w.bu.clipping $w.bu.fieldlines $w.bu.lineplot $w.bu.done -side left -expand yes\n"
5456 ,"set w .visoptions_dlg\n"
5457 ,"wm withdraw $w\n"
5458 ,"wm geom $w +100+100\n"
5459 ,"wm deiconify $w\n"
5460 ,"wm title $w \"Visualization\"\n"
5461 ,"}\n"
5462 ,"}\n"
5463 ,"}\n"
5464 ,"catch { set sockets.serverport 0\n"
5465 ,"set sockets.serverhost \"localhost\"\n"
5466 ,"set sockets.serverlistbox 0\n"
5467 ,"set sockets.queuelistbox 0\n"
5468 ,"set sockets.currentjoblistbox 0\n"
5469 ,"set sockets.answerlistbox 0\n"
5470 ,"set sockets.myidlabel -1\n"
5471 ,"proc updateserverlist { } {\n"
5472 ,"global sockets.serverlistbox\n"
5473 ,"set retval [Ng_Socket getserverlist]\n"
5474 ,"${sockets.serverlistbox} delete 0 end\n"
5475 ,"for {set i 0} {$i < [llength $retval]} {incr i 3} {\n"
5476 ,"${sockets.serverlistbox} insert end \\\n"
5477 ,"[format \"%-16s   %6i   %6i\" [lindex $retval $i] [lindex $retval [expr $i+1]] [lindex $retval [expr $i+2]]]\n"
5478 ,"}\n"
5479 ,"}\n"
5480 ,"proc clientsocketdialog { } {\n"
5481 ,"set w .clientsock_dlg\n"
5482 ,"if {[winfo exists .clientsock_dlg] == 1} {\n"
5483 ,"wm withdraw $w\n"
5484 ,"wm deiconify $w\n"
5485 ,"focus $w\n"
5486 ,"} {\n"
5487 ,"toplevel $w\n"
5488 ,"global sockets.serverhost\n"
5489 ,"global sockets.serverport\n"
5490 ,"ttk::frame $w.general\n"
5491 ,"ttk::frame $w.host\n"
5492 ,"ttk::label $w.host.lab -text \"Serverhost: \"\n"
5493 ,"ttk::entry $w.host.name -width 30 -textvariable sockets.serverhost\n"
5494 ,"pack $w.host.lab $w.host.name -side left\n"
5495 ,"pack $w.host\n"
5496 ,"ttk::frame $w.ports\n"
5497 ,"ttk::label $w.ports.lab1 -text \"Serverport: \"\n"
5498 ,"ttk::entry $w.ports.statport -width 6 -textvariable sockets.serverport\n"
5499 ,"pack $w.ports.lab1 $w.ports.statport -side left\n"
5500 ,"pack $w.ports\n"
5501 ,"ttk::frame $w.listboxes\n"
5502 ,"ttk::frame $w.listboxes.choosesocketframe\n"
5503 ,"tixScrolledListBox $w.listboxes.choosesocketframe.choosesocket -scrollbar auto\n"
5504 ,"global sockets.serverlistbox\n"
5505 ,"set sockets.serverlistbox [$w.listboxes.choosesocketframe.choosesocket subwidget listbox]\n"
5506 ,"${sockets.serverlistbox} configure -width 35\n"
5507 ,"${sockets.serverlistbox} configure -selectmode browse\n"
5508 ,"${sockets.serverlistbox} configure -exportselection false\n"
5509 ,"ttk::button $w.addserver -text \"Add ServerSocket\" -command {\n"
5510 ,"Ng_Socket addserver ${sockets.serverport} ${sockets.serverhost}\n"
5511 ,"updateserverlist\n"
5512 ,"}\n"
5513 ,"pack $w.addserver\n"
5514 ,"ttk::label $w.linefeed -text \"\\n\"\n"
5515 ,"pack $w.linefeed\n"
5516 ,"ttk::frame $w.clientidframe\n"
5517 ,"ttk::label $w.clientidframe.lab -text \"Client ID: \";\n"
5518 ,"global sockets.myidlabel\n"
5519 ,"ttk::entry $w.clientidframe.val -width 5 -textvariable sockets.myidlabel\n"
5520 ,"ttk::button $w.clientidframe.but -text \"Set\" -command {\n"
5521 ,"set opsel [${sockets.serverlistbox} curselection]\n"
5522 ,"if {[llength $opsel] > 0} {\n"
5523 ,"set opserver [lindex $opsel 0]\n"
5524 ,"Ng_Socket setid $opserver ${sockets.myidlabel}\n"
5525 ,"updateserverlist\n"
5526 ,"}\n"
5527 ,"}\n"
5528 ,"pack $w.clientidframe.lab $w.clientidframe.val $w.clientidframe.but -side left\n"
5529 ,"pack $w.clientidframe\n"
5530 ,"ttk::label $w.listboxes.choosesocketframe.chooselab -text [format \"\\n\\n%-16s    %6s  %6s                       \" Host Socket MyID ]\n"
5531 ,"pack $w.listboxes.choosesocketframe.chooselab\n"
5532 ,"pack $w.listboxes.choosesocketframe.choosesocket\n"
5533 ,"ttk::frame $w.listboxes.choosesocketframe.serverbuttons\n"
5534 ,"ttk::button $w.listboxes.choosesocketframe.serverbuttons.save -text \"Save\" -command {\n"
5535 ,"Ng_Socket saveserverlist\n"
5536 ,"}\n"
5537 ,"global sockets.serverlist\n"
5538 ,"Ng_Socket loadserverlist\n"
5539 ,"updateserverlist\n"
5540 ,"ttk::button $w.listboxes.choosesocketframe.serverbuttons.delete -text \"Delete\" -command {\n"
5541 ,"set opsel [${sockets.serverlistbox} curselection]\n"
5542 ,"if {[llength $opsel] > 0} {\n"
5543 ,"Ng_Socket deletesocket [lindex $opsel 0]\n"
5544 ,"updateserverlist\n"
5545 ,"}\n"
5546 ,"}\n"
5547 ,"pack $w.listboxes.choosesocketframe.serverbuttons.save $w.listboxes.choosesocketframe.serverbuttons.delete -side left\n"
5548 ,"pack $w.listboxes.choosesocketframe.serverbuttons\n"
5549 ,"ttk::frame $w.listboxes.statusframe\n"
5550 ,"ttk::label $w.listboxes.statusframe.statuslabel1 -text \"\\n\\njobqueue\"\n"
5551 ,"tixScrolledListBox $w.listboxes.statusframe.queuestatus -scrollbar auto\n"
5552 ,"ttk::label $w.listboxes.statusframe.statuslabel2 -text \"\\ncurrent job\"\n"
5553 ,"tixScrolledListBox $w.listboxes.statusframe.currentjobstatus -scrollbar auto\n"
5554 ,"ttk::label $w.listboxes.statusframe.statuslabel3 -text \"\\nanswers\"\n"
5555 ,"tixScrolledListBox $w.listboxes.statusframe.answers -scrollbar auto\n"
5556 ,"global sockets.queuelistbox\n"
5557 ,"global sockets.currentjoblistbox\n"
5558 ,"global sockets.answerlistbox\n"
5559 ,"set sockets.queuelistbox [$w.listboxes.statusframe.queuestatus subwidget listbox]\n"
5560 ,"set sockets.currentjoblistbox [$w.listboxes.statusframe.currentjobstatus subwidget listbox]\n"
5561 ,"set sockets.answerlistbox [$w.listboxes.statusframe.answers subwidget listbox]\n"
5562 ,"${sockets.queuelistbox} configure -width 50\n"
5563 ,"${sockets.queuelistbox} configure -height 5\n"
5564 ,"${sockets.queuelistbox} configure -selectmode browse\n"
5565 ,"${sockets.queuelistbox} configure -exportselection false\n"
5566 ,"${sockets.currentjoblistbox} configure -width 50\n"
5567 ,"${sockets.currentjoblistbox} configure -height 1\n"
5568 ,"${sockets.currentjoblistbox} configure -selectmode browse\n"
5569 ,"${sockets.currentjoblistbox} configure -exportselection false\n"
5570 ,"${sockets.answerlistbox} configure -width 50\n"
5571 ,"${sockets.answerlistbox} configure -height 5\n"
5572 ,"${sockets.answerlistbox} configure -selectmode browse\n"
5573 ,"${sockets.answerlistbox} configure -exportselection false\n"
5574 ,"ttk::button $w.listboxes.statusframe.updatebutton -text \"Update\" -command {\n"
5575 ,"set opsel [${sockets.serverlistbox} curselection]\n"
5576 ,"if {[llength $opsel] > 0} {\n"
5577 ,"set opserver [lindex $opsel 0]\n"
5578 ,"set retval [Ng_Socket sendqueuestatus $opserver]\n"
5579 ,"${sockets.queuelistbox} delete 0 end\n"
5580 ,"if {[lindex $retval 0] > 0} {\n"
5581 ,"${sockets.queuelistbox} insert end [format \"Blocked for user %i\" [lindex $retval 0]]\n"
5582 ,"} {\n"
5583 ,"${sockets.queuelistbox} insert end \"Not blocked\"\n"
5584 ,"}\n"
5585 ,"for {set i 2} {$i < [expr 2*[lindex $retval 1]+2]} {incr i 2} {\n"
5586 ,"${sockets.queuelistbox} insert end [format \"client %i, command %s\" [lindex $retval $i] [lindex $retval [expr $i+1]]]\n"
5587 ,"}\n"
5588 ,"${sockets.answerlistbox} delete 0 end\n"
5589 ,"for {set i [expr 2*[lindex $retval 1]+3]} {$i < [llength $retval]} {incr i 2} {\n"
5590 ,"${sockets.answerlistbox} insert end [format \"client %i, command %s\" [lindex $retval $i] [lindex $retval [expr $i+1]]]\n"
5591 ,"}\n"
5592 ,"${sockets.currentjoblistbox} delete 0 end\n"
5593 ,"set retval [Ng_Socket sendjobstatus $opserver]\n"
5594 ,"if {[lindex $retval 0] != 0} {\n"
5595 ,"${sockets.currentjoblistbox} insert end [format \"client %i, command %s: %s\" [lindex $retval 0] [lindex $retval 1] [lrange $retval 2 end]]\n"
5596 ,"}\n"
5597 ,"}\n"
5598 ,"}\n"
5599 ,"pack $w.listboxes.statusframe.statuslabel1 $w.listboxes.statusframe.queuestatus \\\n"
5600 ,"$w.listboxes.statusframe.statuslabel2 $w.listboxes.statusframe.currentjobstatus \\\n"
5601 ,"$w.listboxes.statusframe.statuslabel3 $w.listboxes.statusframe.answers \\\n"
5602 ,"$w.listboxes.statusframe.updatebutton\n"
5603 ,"pack $w.listboxes.choosesocketframe $w.listboxes.statusframe -side left\n"
5604 ,"pack $w.listboxes\n"
5605 ,"ttk::label $w.lab1 -text \"\\n\"\n"
5606 ,"pack $w.lab1\n"
5607 ,"ttk::frame $w.buttons1\n"
5608 ,"ttk::frame $w.buttons2\n"
5609 ,"ttk::button $w.buttons1.getid -text \"Get ID\" -command {\n"
5610 ,"set opsel [${sockets.serverlistbox} curselection]\n"
5611 ,"if {[llength $opsel] > 0} {\n"
5612 ,"set opserver [lindex $opsel 0]\n"
5613 ,"set retval [Ng_Socket getid $opserver]\n"
5614 ,"updateserverlist\n"
5615 ,"set sockets.myidlabel $retval\n"
5616 ,"}\n"
5617 ,"}\n"
5618 ,"ttk::button $w.buttons1.killjob -text \"Kill Cur. Job\" -command {\n"
5619 ,"set opsel [${sockets.serverlistbox} curselection]\n"
5620 ,"if {[llength $opsel] > 0} {\n"
5621 ,"set opserver [lindex $opsel 0]\n"
5622 ,"Ng_Socket killcurrentjob $opserver\n"
5623 ,"}\n"
5624 ,"}\n"
5625 ,"ttk::button $w.buttons2.sendmesh -text \"Send Mesh\" -command {\n"
5626 ,"set opsel [${sockets.serverlistbox} curselection]\n"
5627 ,"if {[llength $opsel] > 0} {\n"
5628 ,"set opserver [lindex $opsel 0]\n"
5629 ,"set retval [Ng_Socket sendmesh $opserver]\n"
5630 ,"set sockets.meshsent 1\n"
5631 ,"}\n"
5632 ,"}\n"
5633 ,"ttk::button $w.buttons2.sendpde -text \"Send PDE\" -command {\n"
5634 ,"set opsel [${sockets.serverlistbox} curselection]\n"
5635 ,"if {[llength $opsel] > 0} {\n"
5636 ,"set opserver [lindex $opsel 0]\n"
5637 ,"set retval [NGS_Socket sendpdefile $opserver]\n"
5638 ,"}\n"
5639 ,"}\n"
5640 ,"ttk::button $w.buttons2.solvepde -text \"Solve PDE\" -command {\n"
5641 ,"set opsel [${sockets.serverlistbox} curselection]\n"
5642 ,"if {[llength $opsel] > 0} {\n"
5643 ,"set opserver [lindex $opsel 0]\n"
5644 ,"set retval [NGS_Socket solvepde $opserver]\n"
5645 ,"}\n"
5646 ,"}\n"
5647 ,"ttk::button $w.buttons2.writesol -text \"Write Solution\" -command {\n"
5648 ,"set opsel [${sockets.serverlistbox} curselection]\n"
5649 ,"if {[llength $opsel] > 0} {\n"
5650 ,"set opserver [lindex $opsel 0]\n"
5651 ,"set retval [NGS_Socket writesolution $opserver]\n"
5652 ,"}\n"
5653 ,"}\n"
5654 ,"ttk::button $w.buttons2.sendsol -text \"Receive Solution\" -command {\n"
5655 ,"set opsel [${sockets.serverlistbox} curselection]\n"
5656 ,"if {[llength $opsel] > 0} {\n"
5657 ,"set opserver [lindex $opsel 0]\n"
5658 ,"set retval [NGS_Socket sendsolution $opserver]\n"
5659 ,"}\n"
5660 ,"}\n"
5661 ,"ttk::button $w.buttons1.blockserver -text \"Block Server\" -command {\n"
5662 ,"set opsel [${sockets.serverlistbox} curselection]\n"
5663 ,"if {[llength $opsel] > 0} {\n"
5664 ,"set opserver [lindex $opsel 0]\n"
5665 ,"set retval [Ng_Socket blockserver $opserver]\n"
5666 ,"}\n"
5667 ,"}\n"
5668 ,"ttk::button $w.buttons1.unblockserver -text \"UnBlock Server\" -command {\n"
5669 ,"set opsel [${sockets.serverlistbox} curselection]\n"
5670 ,"if {[llength $opsel] > 0} {\n"
5671 ,"set opserver [lindex $opsel 0]\n"
5672 ,"set retval [Ng_Socket unblockserver $opserver]\n"
5673 ,"}\n"
5674 ,"}\n"
5675 ,"pack $w.buttons1.getid $w.buttons1.blockserver $w.buttons1.unblockserver $w.buttons1.killjob -side left\n"
5676 ,"pack $w.buttons2.sendmesh $w.buttons2.sendpde $w.buttons2.solvepde $w.buttons2.writesol $w.buttons2.sendsol -side left\n"
5677 ,"pack $w.buttons1 $w.buttons2\n"
5678 ,"wm withdraw $w\n"
5679 ,"wm geom $w +200+200\n"
5680 ,"wm deiconify $w\n"
5681 ,"wm title $w \"Client Socket\"\n"
5682 ,"focus .options_dlg\n"
5683 ,"}\n"
5684 ,"}\n"
5685 ,"}\n"
5686 ,"catch { source ${ngdir}/acis.tcl }\n"
5687 ,"set zugstange 0\n"
5688 ,"catch { source ${ngdir}/trafo/menu.tcl }\n"
5689 ,"setgranularity ${meshoptions.fineness}\n"
5690 ,"Ng_SetMeshingParameters\n"
5691 ,"Ng_SetVisParameters\n"
5692 ,"Ng_SetDebugParameters\n"
5693 ,"Ng_STLDoctor\n"
5694 ,"Ng_GeometryOptions set\n"
5695 ,"if { $hasocc == \"yes\" } {\n"
5696 ,"Ng_SetOCCVisParameters\n"
5697 ,"}\n"
5698 ,"if { $batchmode != \"defined\" } {\n"
5699 ,"catch {\n"
5700 ,"wm protocol . WM_DELETE_WINDOW { .ngmenu.file invoke \"Quit\" }\n"
5701 ,"wm deiconify .\n"
5702 ,"}\n"
5703 ,"}\n"
5704 ,"set trafoapp 0\n"
5705 ,"catch { source ${ngdir}/trafoapp/trafoapp.tcl }\n"
5706 ,"set geofilename [Ng_GetCommandLineParameter geofile]\n"
5707 ,"if { $geofilename != \"undefined\" &&\n"
5708 ,"[info exists trafo] == 0 && $zugstange == 0} {\n"
5709 ,"if { [ catch { Ng_LoadGeometry $geofilename } errstring] == 0 } {\n"
5710 ,"if { $batchmode != \"defined\" } {\n"
5711 ,"AddRecentFile $geofilename\n"
5712 ,"}\n"
5713 ,"Ng_ParseGeometry\n"
5714 ,"if { $batchmode != \"defined\" } {\n"
5715 ,"set selectvisual geometry\n"
5716 ,"Ng_SetVisParameters\n"
5717 ,"redraw\n"
5718 ,"wm title . [concat \"$progname - \" $geofilename]\n"
5719 ,"}\n"
5720 ,"set dirname [file dirname $geofilename]\n"
5721 ,"set basefilename [file tail [file rootname $geofilename]]\n"
5722 ,"} {\n"
5723 ,"puts \"Problem with input file:\"\n"
5724 ,"puts \"$errstring\"\n"
5725 ,"}\n"
5726 ,"}\n"
5727 ,"set cnt 0\n"
5728 ,"foreach { gran } { verycoarse coarse moderate fine veryfine } {\n"
5729 ,"set cnt [expr $cnt + 1]\n"
5730 ,"if { [Ng_GetCommandLineParameter $gran] == \"defined\" } {\n"
5731 ,"set meshoptions.fineness $cnt\n"
5732 ,"setgranularity ${meshoptions.fineness}\n"
5733 ,"}\n"
5734 ,"}\n"
5735 ,"set meshfilename [Ng_GetCommandLineParameter meshfile]\n"
5736 ,"if { $meshfilename == \"undefined\" } {\n"
5737 ,"set meshfilename out.mesh\n"
5738 ,"}\n"
5739 ,"set meshfiletype [Ng_GetCommandLineParameter meshfiletype]\n"
5740 ,"if { $meshfiletype == \"undefined\" } {\n"
5741 ,"set meshfiletype netgen\n"
5742 ,"}\n"
5743 ,"set inputmeshfilename [Ng_GetCommandLineParameter inputmeshfile]\n"
5744 ,"set mergemeshfilename [Ng_GetCommandLineParameter mergefile]\n"
5745 ,"set meshsizefilename [Ng_GetCommandLineParameter meshsizefile]\n"
5746 ,"if { $meshsizefilename != \"undefined\" } {\n"
5747 ,"set options.meshsizefilename $meshsizefilename\n"
5748 ,"}\n"
5749 ,"set refinementfilename [Ng_GetCommandLineParameter refinementfile]\n"
5750 ,"if { $batchmode == \"defined\" && $solvemode != \"defined\"} {\n"
5751 ,"set options.parthread 0\n"
5752 ,"if { $shellmode == \"undefined\" } {\n"
5753 ,"set selectvisual mesh\n"
5754 ,"Ng_SetVisParameters\n"
5755 ,"set meshsize [Ng_GetCommandLineParameter meshsize]\n"
5756 ,"if {$meshsize != \"undefined\"} { set options.meshsize $meshsize }\n"
5757 ,"if { $inputmeshfilename == \"undefined\" } {\n"
5758 ,"Ng_GenerateMesh ${meshoptions.firststep} ${meshoptions.laststep}\n"
5759 ,"} else {\n"
5760 ,"Ng_LoadMesh $inputmeshfilename\n"
5761 ,"if { $mergemeshfilename != \"undefined\" } {\n"
5762 ,"Ng_MergeMesh $mergemeshfilename\n"
5763 ,"}\n"
5764 ,"}\n"
5765 ,"if { $refinementfilename != \"undefined\" } {\n"
5766 ,"Ng_Bisect $refinementfilename\n"
5767 ,"}\n"
5768 ,"if { $meshfiletype == \"netgen\" } {\n"
5769 ,"Ng_SaveMesh $meshfilename\n"
5770 ,"} else {\n"
5771 ,"if { [catch { Ng_ExportMesh $meshfilename $meshfiletype } ] == 1 } {\n"
5772 ,"puts \"Unknown file format $meshfiletype\"\n"
5773 ,"}\n"
5774 ,"}\n"
5775 ,"Ng_Exit;\n"
5776 ,"exit\n"
5777 ,"} else {\n"
5778 ,"set code [catch { \n"
5779 ,"proc dotest {} {\n"
5780 ,"source ngtest.tcl\n"
5781 ,"}\n"
5782 ,"proc Ng_RunShell {} {\n"
5783 ,"puts \"Wellcome to NG Shell mode\"\n"
5784 ,"set line 1\n"
5785 ,"while { 1 } {\n"
5786 ,"puts -nonewline \"$line: \"\n"
5787 ,"flush stdout\n"
5788 ,"set cmdline [gets stdin]\n"
5789 ,"if { [catch $cmdline errcode] } {\n"
5790 ,"puts \"$errcode\"\n"
5791 ,"}\n"
5792 ,"incr line 1\n"
5793 ,"}\n"
5794 ,"}\n"
5795 ,"proc Ng_PrintCmdIndex { } {\n"
5796 ,"global cmdindex\n"
5797 ,"foreach { lst } $cmdindex {\n"
5798 ,"puts $lst\n"
5799 ,"}\n"
5800 ,"}\n"
5801 ,"proc Ng_PrintHlpIndex { } {\n"
5802 ,"global hlpindex\n"
5803 ,"global secindex\n"
5804 ,"foreach {sec} $secindex {\n"
5805 ,"puts \"\\n  * $sec:\"\n"
5806 ,"foreach {lst} $hlpindex {\n"
5807 ,"if {$sec == [lindex $lst 1]} {\n"
5808 ,"puts \"    * [lindex $lst 2]: [lindex $lst 3]\"\n"
5809 ,"}\n"
5810 ,"}\n"
5811 ,"}\n"
5812 ,"}\n"
5813 ,"proc Ng_RegisterCmd { cmd section syntax {help \"\"} } {\n"
5814 ,"global hlpindex\n"
5815 ,"global cmdindex\n"
5816 ,"global secindex\n"
5817 ,"puts \"register command $cmd\"\n"
5818 ,"if { [lsearch $cmdindex cmd] != -1 } {\n"
5819 ,"puts \"command '$cmd' already defined\"\n"
5820 ,"} else {\n"
5821 ,"lappend cmdindex $cmd\n"
5822 ,"lappend hlpindex [list $cmd $section $syntax $help]\n"
5823 ,"if {[lsearch $secindex $section]==-1} {\n"
5824 ,"lappend secindex $section\n"
5825 ,"}\n"
5826 ,"}\n"
5827 ,"}\n"
5828 ,"Ng_RegisterCmd \"exit\" \"general\" \"exit\" \"exit Netgen shell mode\"\n"
5829 ,"proc nghelp { {sec \"\"} } {\n"
5830 ,"global secindex\n"
5831 ,"global hlpindex\n"
5832 ,"global cmdindex\n"
5833 ,"if { $sec == \"\" } {\n"
5834 ,"Ng_PrintHlpIndex\n"
5835 ,"puts \"\\n  type help 'section'\\n\"\n"
5836 ,"return\n"
5837 ,"}\n"
5838 ,"if { [lsearch $secindex $sec] != -1} {\n"
5839 ,"foreach {lst} $hlpindex {\n"
5840 ,"if {[lindex $lst 1] == $sec } {\n"
5841 ,"puts \"  * [lindex $lst 2]: [lindex $lst 3]\"\n"
5842 ,"}\n"
5843 ,"}\n"
5844 ,"return\n"
5845 ,"}\n"
5846 ,"set ind [lsearch $cmdindex $sec]\n"
5847 ,"if {$ind != -1} {\n"
5848 ,"set lst [lindex $hlpindex $ind]\n"
5849 ,"puts \"  * [lindex $lst 2]: [lindex $lst 3]\"\n"
5850 ,"return\n"
5851 ,"}\n"
5852 ,"puts \"  unknown section or command $sec\"\n"
5853 ,"}\n"
5854 ,"set ngtimer 0\n"
5855 ,"proc nggettimer {} {\n"
5856 ,"return [clock clicks -milliseconds]\n"
5857 ,"}\n"
5858 ,"proc ngtic {} {\n"
5859 ,"set ::ngtimer [nggettimer]\n"
5860 ,"}\n"
5861 ,"proc ngtoc { {logfile stdout} } {\n"
5862 ,"set end [nggettimer]\n"
5863 ,"set tim [expr ($end - $::ngtimer)/1000.0]\n"
5864 ,"puts $logfile \"$tim s\"\n"
5865 ,"}\n"
5866 ,"proc ngloadgeometry { fname } {\n"
5867 ,"if { ![file exists $fname] } {\n"
5868 ,"puts \"error: file $fname does not exist\"\n"
5869 ,"} else {\n"
5870 ,"set err [catch {Ng_LoadGeometry $fname}]\n"
5871 ,"if {$err != 0} {\n"
5872 ,"puts \"error: loading geometry failed\"\n"
5873 ,"}\n"
5874 ,"}\n"
5875 ,"}\n"
5876 ,"Ng_RegisterCmd \"ngloadgeometry\" \"netgen\" \"ngloadgeometry <file>\" \"load geometry file\"\n"
5877 ,"proc ngparsegeometry {} {\n"
5878 ,"set err [catch {Ng_ParseGeometry}]\n"
5879 ,"if {$err} {\n"
5880 ,"puts \"error: parsing geometry failed\"\n"
5881 ,"}\n"
5882 ,"}\n"
5883 ,"Ng_RegisterCmd \"ngparsegeometry\" \"netgen\" \"ngparsegeometry\" \"parse geometry\"\n"
5884 ,"proc nggeneratemesh {} {\n"
5885 ,"set err [catch {Ng_GenerateMesh}]\n"
5886 ,"if {$err} {\n"
5887 ,"puts \"error:  mesh generation failed\"\n"
5888 ,"}\n"
5889 ,"}\n"
5890 ,"Ng_RegisterCmd \"nggeneratemesh\" \"netgen\" \"nggeneratemesh\" \"generate mesh\"\n"
5891 ,"proc ngsavemesh { fname } {\n"
5892 ,"if { [file exists $fname]} {\n"
5893 ,"puts \"warning: existing file $fname overwritten\"\n"
5894 ,"} else {\n"
5895 ,"set err [catch {Ng_SaveMesh $fname}]\n"
5896 ,"if {$err != 0} {\n"
5897 ,"puts \"error: saving mesh failed\"\n"
5898 ,"}\n"
5899 ,"}\n"
5900 ,"}\n"
5901 ,"Ng_RegisterCmd \"ngsavemesh\" \"netgen\" \"ngsavemesh <file>\" \"save mesh to file\"\n"
5902 ,"proc ngset { opt {val 0} } {\n"
5903 ,"if {$opt == \"meshsize\"} {\n"
5904 ,"set ::options.meshsize $val\n"
5905 ,"Ng_SetMeshingParameters\n"
5906 ,"} elseif {$opt == \"printmsg\"} {\n"
5907 ,"set ::options.printmsg $val\n"
5908 ,"Ng_SetMeshingParameters\n"
5909 ,"} else {\n"
5910 ,"puts \"error: unknown option $opt\";\n"
5911 ,"}\n"
5912 ,"}\n"
5913 ,"Ng_RegisterCmd \"ngset\" \"netgen\" \"ngset <option> <val>\" \"set option to val\"\n"
5914 ,"proc nganalyzegeometry {} {\n"
5915 ,"Ng_GenerateMesh ag ag\n"
5916 ,"Ng_ReadStatus\n"
5917 ,"}\n"
5918 ,"proc ngmeshedges {} {\n"
5919 ,"Ng_GenerateMesh me me\n"
5920 ,"Ng_ReadStatus\n"
5921 ,"}\n"
5922 ,"proc ngmeshsurface { } {\n"
5923 ,"Ng_GenerateMesh ms ms\n"
5924 ,"Ng_ReadStatus\n"
5925 ,"}\n"
5926 ,"proc ngoptimizesurface { {step all} } {\n"
5927 ,"if {$step == \"all\"} {\n"
5928 ,"Ng_GenerateMesh os os cmsmSm\n"
5929 ,"} elseif {$step == \"meshsmoothing\"} {\n"
5930 ,"Ng_GenerateMesh os os m\n"
5931 ,"} elseif {$step == \"topologicedgeswapping\" } {\n"
5932 ,"Ng_GenerateMesh os os s\n"
5933 ,"} elseif {$step == \"metricedgeswapping\"} {\n"
5934 ,"Ng_GenerateMesh os os S\n"
5935 ,"} elseif {$step == \"combinepoints\"} {\n"
5936 ,"Ng_GenerateMesh os os c\n"
5937 ,"} else {\n"
5938 ,"puts \"error: unknown option in ngoptimizesurface\"\n"
5939 ,"return\n"
5940 ,"}\n"
5941 ,"Ng_ReadStatus\n"
5942 ,"}\n"
5943 ,"proc ngmeshvolume { } {\n"
5944 ,"Ng_GenerateMesh mv mv\n"
5945 ,"Ng_ReadStatus\n"
5946 ,"}\n"
5947 ,"proc ngoptimizevolume {{step \"\"} } {\n"
5948 ,"if {$step == \"\"} {\n"
5949 ,"Ng_GenerateMesh ov ov\n"
5950 ,"} elseif {$step == \"smooth\"} {\n"
5951 ,"Ng_GenerateMesh ov ov m\n"
5952 ,"} elseif {$step == \"smoothjacobian\"} {\n"
5953 ,"Ng_GenerateMesh ov ov j\n"
5954 ,"} else {\n"
5955 ,"puts \"error: unknown step $step in ngoptimizevolume\"\n"
5956 ,"return\n"
5957 ,"}\n"
5958 ,"Ng_ReadStatus\n"
5959 ,"}\n"
5960 ,"proc ngsloadpde {fname} {\n"
5961 ,"if { ![file exists $fname] } {\n"
5962 ,"puts \"warning: pdefile $fname does not exist\"\n"
5963 ,"} else {\n"
5964 ,"puts \"load pde $fname\"\n"
5965 ,"NGS_LoadPDE $fname\n"
5966 ,"}\n"
5967 ,"}\n"
5968 ,"proc ngssolvepde {} {\n"
5969 ,"NGS_SolvePDE\n"
5970 ,"}\n"
5971 ,"catch {source \"${::ngdir}/ngtesting.tcl\"} errcode\n"
5972 ,"} errcode]\n"
5973 ,"if {$code} {\n"
5974 ,"puts \"error: $errcode\"\n"
5975 ,"}\n"
5976 ,"set code [ catch {Ng_RunShell} errcode]\n"
5977 ,"if {$code} {\n"
5978 ,"puts \"error: $errcode\"\n"
5979 ,"}\n"
5980 ,"Ng_Exit;\n"
5981 ,"exit\n"
5982 ,"}\n"
5983 ,"}\n"
5984 ,"set stereo [Ng_GetCommandLineParameter stereo]\n"
5985 ,"if { $stereo == \"defined\" } {\n"
5986 ,"set viewoptions.stereo 1\n"
5987 ,"puts \"use stereo mode\"\n"
5988 ,"Ng_SetVisParameters;\n"
5989 ,"redraw\n"
5990 ,"}\n"
5991 ,"set ngsolve_loaded 0\n"
5992 ,"catch {\n"
5993 ,"source ${ngdir}/ngsolve.tcl;\n"
5994 ,"set ngsolve_loaded 1\n"
5995 ,"}\n"
5996 ,"set pathlist [split $::env(PATH) \\ [expr {$::tcl_platform(platform) == \"windows\" ? \";\" : \":\"}]]\n"
5997 ,"foreach dir $pathlist {\n"
5998 ,"if { $ngsolve_loaded != 1 } {\n"
5999 ,"catch {\n"
6000 ,"source ${dir}/ngsolve.tcl\n"
6001 ,"set ngsolve_loaded 1\n"
6002 ,"}\n"
6003 ,"}\n"
6004 ,"}\n"
6005 ,"set scriptfilename [Ng_GetCommandLineParameter script]\n"
6006 ,"if { $scriptfilename != \"undefined\" } {\n"
6007 ,"if { [catch { source $scriptfilename } errstring] == 1 } {\n"
6008 ,"puts \"Error in input: $errstring\"\n"
6009 ,"}\n"
6010 ,"}\n"
6011 ,"if { [Ng_GetCommandLineParameter help]==\"defined\" } {\n"
6012 ,"if { $zugstange == 1 } {\n"
6013 ,"print_zug_commandline_help\n"
6014 ,"exit;\n"
6015 ,"} {\n"
6016 ,"if { $trafoapp == 1 } {\n"
6017 ,"print_trafo_commandline_help;\n"
6018 ,"} {\n"
6019 ,"print_commandline_help;\n"
6020 ,"Ng_Exit;\n"
6021 ,"exit\n"
6022 ,"}\n"
6023 ,"}\n"
6024 ,"}\n"
6025 ,"if { [file exists startup.tcl] } {\n"
6026 ,"source startup.tcl }\n"
6027 ,"catch { source ${ngdir}/demoapp.tcl }\n"
6028 ,"catch { source ${ngdir}/dropsexp.tcl }\n"
6029 , nullptr
6030 };
6031