mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 21:40:33 +05:00
visualization dialog box
This commit is contained in:
parent
9b6e013ca0
commit
4b71358839
@ -3518,12 +3518,10 @@ proc runtestdialog { } {
|
|||||||
if {[winfo exists .runtest_dlg] == 1} {
|
if {[winfo exists .runtest_dlg] == 1} {
|
||||||
wm withdraw $w
|
wm withdraw $w
|
||||||
wm deiconify $w
|
wm deiconify $w
|
||||||
# wm geometry $w =270x100
|
|
||||||
|
|
||||||
focus $w
|
focus $w
|
||||||
} {
|
} {
|
||||||
toplevel $w
|
toplevel $w
|
||||||
# wm geometry $w =270x100
|
|
||||||
|
|
||||||
# in2d testing #
|
# in2d testing #
|
||||||
frame $w.in2dframe
|
frame $w.in2dframe
|
||||||
|
@ -27,7 +27,7 @@ menu .ngmenu.file
|
|||||||
.ngmenu.file add command -label "Load Geometry..." -accelerator "<l><g>" \
|
.ngmenu.file add command -label "Load Geometry..." -accelerator "<l><g>" \
|
||||||
-command {
|
-command {
|
||||||
set types {
|
set types {
|
||||||
{"All Geometry types" { .stl .stlb .step .stp .geo .in2d .igs .iges .brep .in2dnew .sat} }
|
{"All Geometry types" { .stl .stlb .step .stp .geo .in2d .igs .iges .brep .sat} }
|
||||||
{"IGES Geometry" {.igs .iges} }
|
{"IGES Geometry" {.igs .iges} }
|
||||||
{"BREP OpenCascade Geometry" {.brep} }
|
{"BREP OpenCascade Geometry" {.brep} }
|
||||||
{"STL Geometry" {.stl} }
|
{"STL Geometry" {.stl} }
|
||||||
@ -35,7 +35,6 @@ menu .ngmenu.file
|
|||||||
{"STEP Geometry" {.step .stp} }
|
{"STEP Geometry" {.step .stp} }
|
||||||
{"Geometry file" {.geo} }
|
{"Geometry file" {.geo} }
|
||||||
{"2D Geometry" {.in2d } }
|
{"2D Geometry" {.in2d } }
|
||||||
{"2D Geometry New" {.in2dnew } }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
set ACISavailable [Ng_ACISCommand isACISavailable]
|
set ACISavailable [Ng_ACISCommand isACISavailable]
|
||||||
@ -43,10 +42,6 @@ menu .ngmenu.file
|
|||||||
lappend types {"ACIS Geometry" {.sat} }
|
lappend types {"ACIS Geometry" {.sat} }
|
||||||
}
|
}
|
||||||
|
|
||||||
# {"All Geometry types" {.stl .stlb .step .stp .geo .in2d .igs .iges .brep .in2dnew} }
|
|
||||||
|
|
||||||
# {"Naomi Geometry" {.nao} }
|
|
||||||
# {"New Geometry file" {.ngg} }
|
|
||||||
|
|
||||||
if {[catch {
|
if {[catch {
|
||||||
set file [tk_getOpenFile -filetypes $types -initialdir $dirname -typevariable loadgeomtypevar]
|
set file [tk_getOpenFile -filetypes $types -initialdir $dirname -typevariable loadgeomtypevar]
|
||||||
@ -398,10 +393,10 @@ set videoactive 0
|
|||||||
|
|
||||||
|
|
||||||
## herbert tcl load menue
|
## herbert tcl load menue
|
||||||
.ngmenu.file add command -label "Run tests ..." \
|
# .ngmenu.file add command -label "Run tests ..." \
|
||||||
-command { runtestdialog }
|
\# -command { runtestdialog }
|
||||||
##
|
##
|
||||||
.ngmenu.file add separator
|
# .ngmenu.file add separator
|
||||||
|
|
||||||
.ngmenu.file add command -label "Quit" -accelerator "<q>" \
|
.ngmenu.file add command -label "Quit" -accelerator "<q>" \
|
||||||
-command { puts "Thank you for using $progname"; Ng_Exit; destroy . }
|
-command { puts "Thank you for using $progname"; Ng_Exit; destroy . }
|
||||||
|
@ -20,9 +20,12 @@ proc Ng_RunShell {} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
## global list for help index
|
## global list for help index
|
||||||
set cmdindex {}
|
# ---> global var in variables.tcl
|
||||||
set hlpindex {}
|
# set cmdindex {}
|
||||||
set secindex {}
|
# set hlpindex {}
|
||||||
|
# set secindex {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# print comd list
|
# print comd list
|
||||||
proc Ng_PrintCmdIndex { } {
|
proc Ng_PrintCmdIndex { } {
|
||||||
@ -51,6 +54,9 @@ proc Ng_RegisterCmd { cmd section syntax {help ""} } {
|
|||||||
global hlpindex
|
global hlpindex
|
||||||
global cmdindex
|
global cmdindex
|
||||||
global secindex
|
global secindex
|
||||||
|
|
||||||
|
puts "register command $cmd"
|
||||||
|
|
||||||
if { [lsearch $cmdindex cmd] != -1 } {
|
if { [lsearch $cmdindex cmd] != -1 } {
|
||||||
puts "command '$cmd' already defined"
|
puts "command '$cmd' already defined"
|
||||||
} else {
|
} else {
|
||||||
@ -64,6 +70,7 @@ proc Ng_RegisterCmd { cmd section syntax {help ""} } {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# general purpose commands
|
# general purpose commands
|
||||||
Ng_RegisterCmd "exit" "general" "exit" "exit Netgen shell mode"
|
Ng_RegisterCmd "exit" "general" "exit" "exit Netgen shell mode"
|
||||||
#Ng_RegisterCmd "Ng_LoadGeometry" "netgen" "Ng_LoadGeometry <file>" "load geometry file"
|
#Ng_RegisterCmd "Ng_LoadGeometry" "netgen" "Ng_LoadGeometry <file>" "load geometry file"
|
||||||
@ -247,7 +254,5 @@ proc ngssolvepde {} {
|
|||||||
NGS_SolvePDE
|
NGS_SolvePDE
|
||||||
}
|
}
|
||||||
|
|
||||||
catch {source "${::ngdir}/ngtcltk/ngtesting.tcl"} errcode
|
catch {source "${::ngdir}/ngtesting.tcl"} errcode
|
||||||
# puts "errcode = $errcode"
|
# puts "errcode = $errcode"
|
||||||
|
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ proc ngtest { {t all} {f ""}} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
puts "\n ** testing in2d files in tutorials/ **"
|
puts "\n ** testing in2d files in tutorials/ **"
|
||||||
set testdir "$::ngdir/../tutorials"
|
set testdir "$::ngdir/../share/netgen"
|
||||||
set in2dfiles { demo2d newin2d square v2in2d }
|
set in2dfiles { demo2d newin2d square v2in2d }
|
||||||
foreach {tfile} $in2dfiles {
|
foreach {tfile} $in2dfiles {
|
||||||
if {$f != ""} { puts " * meshing file tutorials/$tfile.in2d..." }
|
if {$f != ""} { puts " * meshing file tutorials/$tfile.in2d..." }
|
||||||
@ -89,7 +89,7 @@ proc ngtest { {t all} {f ""}} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
puts "\n ** testing geo files in tutorials/ **"
|
puts "\n ** testing geo files in tutorials/ **"
|
||||||
set testdir "$::ngdir/../tutorials"
|
set testdir "$::ngdir/../share/netgen"
|
||||||
set geofiles { boxcyl cubemcyl extrusion revolution trafo
|
set geofiles { boxcyl cubemcyl extrusion revolution trafo
|
||||||
circle_on_cube cubemsphere fichera sculpture twobricks
|
circle_on_cube cubemsphere fichera sculpture twobricks
|
||||||
cone cylinder lshape3d shaft twocubes
|
cone cylinder lshape3d shaft twocubes
|
||||||
|
135
ng/ngvisual.tcl
135
ng/ngvisual.tcl
@ -1005,59 +1005,8 @@ proc visual_dialog { } {
|
|||||||
|
|
||||||
toplevel $w
|
toplevel $w
|
||||||
|
|
||||||
checkbutton $w.imaginary -text "Imaginary Part" \
|
|
||||||
-variable visoptions.imaginary \
|
|
||||||
-command { Ng_Vis_Set parameters; redraw }
|
|
||||||
|
|
||||||
|
|
||||||
frame $w.texframe
|
|
||||||
|
|
||||||
checkbutton $w.texframe.usetexture -text "Use Textures (" \
|
|
||||||
-variable visoptions.usetexture \
|
|
||||||
-command { Ng_Vis_Set parameters; redraw }
|
|
||||||
|
|
||||||
checkbutton $w.texframe.lintexture -text "Linear )" \
|
|
||||||
-variable visoptions.lineartexture \
|
|
||||||
-command { Ng_Vis_Set parametersrange; redraw }
|
|
||||||
|
|
||||||
|
|
||||||
# pack $w.texframe.usetexture $w.texframe.lintexture -side left -expand yes
|
|
||||||
|
|
||||||
|
|
||||||
checkbutton $w.invcolor -text "Inverse Color" \
|
|
||||||
-variable visoptions.invcolor \
|
|
||||||
-command { Ng_Vis_Set parametersrange; redraw }
|
|
||||||
|
|
||||||
checkbutton $w.redrawperiodic -text "Animate periodic" \
|
|
||||||
-variable visoptions.redrawperiodic \
|
|
||||||
-command {
|
|
||||||
redrawperiodic
|
|
||||||
Ng_Vis_Set parameters;
|
|
||||||
redraw
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
checkbutton $w.logscale -text "Log Scale" \
|
|
||||||
-variable visoptions.logscale \
|
|
||||||
-command { Ng_Vis_Set parameters; redraw }
|
|
||||||
|
|
||||||
checkbutton $w.lineartexture -text "Use Linear Texture" \
|
|
||||||
-variable visoptions.lineartexture \
|
|
||||||
-command { Ng_Vis_Set parameters; redraw }
|
|
||||||
|
|
||||||
scale $w.numcols -orient horizontal -length 100 -from 0 -to 50 \
|
|
||||||
-resolution 1 \
|
|
||||||
-variable visoptions.numtexturecols \
|
|
||||||
-command { popupcheckredraw visual_dialog_pop1 }
|
|
||||||
|
|
||||||
checkbutton $w.showclipsolution -text "Draw Clipping Plane Solution" \
|
|
||||||
-variable visoptions.showclipsolution \
|
|
||||||
-command { Ng_Vis_Set parameters; redraw }
|
|
||||||
|
|
||||||
checkbutton $w.showsurfsolution -text "Draw Surface Solution" \
|
|
||||||
-variable visoptions.showsurfacesolution \
|
|
||||||
-command { Ng_Vis_Set parameters; redraw }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
frame $w.grid -relief groove -borderwidth 3
|
frame $w.grid -relief groove -borderwidth 3
|
||||||
@ -1084,7 +1033,6 @@ proc visual_dialog { } {
|
|||||||
|
|
||||||
|
|
||||||
# pack $w.showclipsolution
|
# pack $w.showclipsolution
|
||||||
pack $w.showsurfsolution
|
|
||||||
pack $w.grid -fill x -ipady 3
|
pack $w.grid -fill x -ipady 3
|
||||||
pack $w.grid.size $w.grid.xoffset $w.grid.yoffset -side left -expand yes
|
pack $w.grid.size $w.grid.xoffset $w.grid.yoffset -side left -expand yes
|
||||||
|
|
||||||
@ -1235,11 +1183,6 @@ proc visual_dialog { } {
|
|||||||
# pack $w.iso.zpos -side right
|
# pack $w.iso.zpos -side right
|
||||||
|
|
||||||
|
|
||||||
checkbutton $w.showcurves -text "Show Curves" \
|
|
||||||
-variable visoptions.drawpointcurves \
|
|
||||||
-command { Ng_Vis_Set parameters; redraw }
|
|
||||||
|
|
||||||
pack $w.showcurves
|
|
||||||
|
|
||||||
frame $w.redraw -relief groove -borderwidth 3
|
frame $w.redraw -relief groove -borderwidth 3
|
||||||
checkbutton $w.redraw.auto -text "Auto-redraw" \
|
checkbutton $w.redraw.auto -text "Auto-redraw" \
|
||||||
@ -1335,16 +1278,12 @@ proc visual_dialog { } {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$w.scalfun configure -variable visoptions.scalfunction
|
$w.scalfun configure -variable visoptions.scalfunction
|
||||||
$w.scalfun configure -command { Ng_Vis_Set parameters; redraw }
|
$w.scalfun configure -command { Ng_Vis_Set parameters; redraw }
|
||||||
$w.vecfun configure -variable visoptions.vecfunction
|
$w.vecfun configure -variable visoptions.vecfunction
|
||||||
$w.vecfun configure -command { Ng_Vis_Set parameters; redraw }
|
$w.vecfun configure -command { Ng_Vis_Set parameters; redraw }
|
||||||
|
|
||||||
|
|
||||||
# puts "sclfunction = ${visoptions.scalfunction}"
|
|
||||||
|
|
||||||
|
|
||||||
tixOptionMenu $w.evaluate -label "Evaluate: " \
|
tixOptionMenu $w.evaluate -label "Evaluate: " \
|
||||||
-options {
|
-options {
|
||||||
label.width 18
|
label.width 18
|
||||||
@ -1372,13 +1311,72 @@ proc visual_dialog { } {
|
|||||||
label.anchor e
|
label.anchor e
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pack $w.multidimcomp
|
pack $w.multidimcomp
|
||||||
|
|
||||||
|
|
||||||
|
checkbutton $w.showsurfsolution -text "Draw Surface Vectors" \
|
||||||
|
-variable visoptions.showsurfacesolution \
|
||||||
|
-command { Ng_Vis_Set parameters; redraw }
|
||||||
|
|
||||||
|
checkbutton $w.showcurves -text "Show Curves" \
|
||||||
|
-variable visoptions.drawpointcurves \
|
||||||
|
-command { Ng_Vis_Set parameters; redraw }
|
||||||
|
|
||||||
|
checkbutton $w.imaginary -text "Imaginary Part" \
|
||||||
|
-variable visoptions.imaginary \
|
||||||
|
-command { Ng_Vis_Set parameters; redraw }
|
||||||
|
|
||||||
|
checkbutton $w.logscale -text "Log Scale" \
|
||||||
|
-variable visoptions.logscale \
|
||||||
|
-command { Ng_Vis_Set parameters; redraw }
|
||||||
|
|
||||||
|
checkbutton $w.invcolor -text "Inverse Color" \
|
||||||
|
-variable visoptions.invcolor \
|
||||||
|
-command { Ng_Vis_Set parametersrange; redraw }
|
||||||
|
|
||||||
|
|
||||||
|
frame $w.texframe
|
||||||
|
|
||||||
|
checkbutton $w.texframe.usetexture -text "Use Textures (" \
|
||||||
|
-variable visoptions.usetexture \
|
||||||
|
-command { Ng_Vis_Set parameters; redraw }
|
||||||
|
|
||||||
|
checkbutton $w.texframe.lintexture -text "Linear )" \
|
||||||
|
-variable visoptions.lineartexture \
|
||||||
|
-command { Ng_Vis_Set parametersrange; redraw }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
checkbutton $w.lineartexture -text "Use Linear Texture" \
|
||||||
|
-variable visoptions.lineartexture \
|
||||||
|
-command { Ng_Vis_Set parameters; redraw }
|
||||||
|
|
||||||
|
scale $w.numcols -orient horizontal -length 100 -from 0 -to 50 \
|
||||||
|
-resolution 1 \
|
||||||
|
-variable visoptions.numtexturecols \
|
||||||
|
-command { popupcheckredraw visual_dialog_pop1 }
|
||||||
|
|
||||||
|
checkbutton $w.showclipsolution -text "Draw Clipping Plane Solution" \
|
||||||
|
-variable visoptions.showclipsolution \
|
||||||
|
-command { Ng_Vis_Set parameters; redraw }
|
||||||
|
|
||||||
|
|
||||||
|
checkbutton $w.redrawperiodic -text "Animate periodic" \
|
||||||
|
-variable visoptions.redrawperiodic \
|
||||||
|
-command {
|
||||||
|
redrawperiodic
|
||||||
|
Ng_Vis_Set parameters;
|
||||||
|
redraw
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
pack $w.showsurfsolution $w.showcurves
|
||||||
pack $w.imaginary $w.logscale $w.texframe $w.invcolor $w.redrawperiodic
|
pack $w.imaginary $w.logscale $w.texframe $w.invcolor $w.redrawperiodic
|
||||||
pack $w.texframe.usetexture $w.texframe.lintexture -side left -expand yes
|
pack $w.texframe.usetexture $w.texframe.lintexture -side left -expand yes
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
frame $w.bu
|
frame $w.bu
|
||||||
pack $w.bu -pady 5
|
pack $w.bu -pady 5
|
||||||
|
|
||||||
@ -1447,12 +1445,16 @@ proc reset_visual_dialog { } {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
checkbutton $w.invcolor -text "Inverse Color" \
|
checkbutton $w.invcolor -text "Inverse Color" \
|
||||||
-variable visoptions.invcolor \
|
-variable visoptions.invcolor \
|
||||||
-command { Ng_Vis_Set parameters; redraw }
|
-command { Ng_Vis_Set parameters; redraw }
|
||||||
|
|
||||||
|
checkbutton $w.logscale -text "Log Scale" \
|
||||||
|
-variable visoptions.logscale \
|
||||||
|
-command { Ng_Vis_Set parameters; redraw }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
checkbutton $w.redrawperiodic -text "Animate periodic" \
|
checkbutton $w.redrawperiodic -text "Animate periodic" \
|
||||||
-variable visoptions.redrawperiodic \
|
-variable visoptions.redrawperiodic \
|
||||||
-command {
|
-command {
|
||||||
@ -1462,11 +1464,6 @@ proc reset_visual_dialog { } {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
checkbutton $w.logscale -text "Log Scale" \
|
|
||||||
-variable visoptions.logscale \
|
|
||||||
-command { Ng_Vis_Set parameters; redraw }
|
|
||||||
|
|
||||||
|
|
||||||
tixOptionMenu $w.scalfun -label "Scalar Function: " \
|
tixOptionMenu $w.scalfun -label "Scalar Function: " \
|
||||||
-options {
|
-options {
|
||||||
label.width 18
|
label.width 18
|
||||||
|
@ -691,3 +691,9 @@ proc loadmeshinifile { } {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
set cmdindex {}
|
||||||
|
set hlpindex {}
|
||||||
|
set secindex {}
|
||||||
|
Loading…
Reference in New Issue
Block a user