Merge branch 'master' into codim2integrals

This commit is contained in:
Christopher Lackner 2016-11-16 12:15:55 +01:00
commit 3d80b48a7a
12 changed files with 1133 additions and 818 deletions

View File

@ -60,6 +60,7 @@ namespace netgen
T operator*() const { return ar[ind]; } T operator*() const { return ar[ind]; }
T & operator*() { return ar[ind]; } T & operator*() { return ar[ind]; }
bool operator != (ArrayIterator d2) { return ind != d2.ind; } bool operator != (ArrayIterator d2) { return ind != d2.ind; }
bool operator == (ArrayIterator d2) { return ind == d2.ind; }
}; };

View File

@ -16,17 +16,17 @@ namespace netgen
void MyMPI_SendCmd (const char * cmd) void MyMPI_SendCmd (const char * cmd)
{ {
char buf[100]; char buf[10000];
strcpy (buf, cmd); strcpy (buf, cmd);
// MPI_Bcast (&buf, 100, MPI_CHAR, 0, MPI_COMM_WORLD); // MPI_Bcast (&buf, 100, MPI_CHAR, 0, MPI_COMM_WORLD);
for (int dest = 1; dest < ntasks; dest++) for (int dest = 1; dest < ntasks; dest++)
MPI_Bsend( &buf, 100, MPI_CHAR, dest, MPI_TAG_CMD, MPI_COMM_WORLD); MPI_Send( &buf, 10000, MPI_CHAR, dest, MPI_TAG_CMD, MPI_COMM_WORLD);
} }
string MyMPI_RecvCmd () string MyMPI_RecvCmd ()
{ {
char buf[100]; char buf[10000];
// MPI_Bcast (&buf, 100, MPI_CHAR, 0, MPI_COMM_WORLD); // MPI_Bcast (&buf, 100, MPI_CHAR, 0, MPI_COMM_WORLD);
// VT_OFF(); // VT_OFF();
@ -44,7 +44,7 @@ namespace netgen
while (!flag); while (!flag);
// VT_ON(); // VT_ON();
MPI_Recv( &buf, 100, MPI_CHAR, 0, MPI_TAG_CMD, MPI_COMM_WORLD, &status); MPI_Recv( &buf, 10000, MPI_CHAR, 0, MPI_TAG_CMD, MPI_COMM_WORLD, &status);
return string(buf); return string(buf);
} }

View File

@ -10,6 +10,8 @@
#include <immintrin.h> #include <immintrin.h>
#ifdef WIN32 #ifdef WIN32
#ifndef AVX_OPERATORS_DEFINED
#define AVX_OPERATORS_DEFINED
inline __m128d operator- (__m128d a) { return _mm_xor_pd(a, _mm_set1_pd(-0.0)); } inline __m128d operator- (__m128d a) { return _mm_xor_pd(a, _mm_set1_pd(-0.0)); }
inline __m128d operator+ (__m128d a, __m128d b) { return _mm_add_pd(a,b); } inline __m128d operator+ (__m128d a, __m128d b) { return _mm_add_pd(a,b); }
inline __m128d operator- (__m128d a, __m128d b) { return _mm_sub_pd(a,b); } inline __m128d operator- (__m128d a, __m128d b) { return _mm_sub_pd(a,b); }
@ -36,6 +38,7 @@ inline __m256d operator-= (__m256d &a, __m256d b) { return a = a-b; }
inline __m256d operator*= (__m256d &a, __m256d b) { return a = a*b; } inline __m256d operator*= (__m256d &a, __m256d b) { return a = a*b; }
inline __m256d operator/= (__m256d &a, __m256d b) { return a = a/b; } inline __m256d operator/= (__m256d &a, __m256d b) { return a = a/b; }
#endif #endif
#endif

View File

@ -20,6 +20,7 @@ namespace netgen
template <typename T, int BASE = 0, typename TIND = int> template <typename T, int BASE = 0, typename TIND = int>
void ExportArray (py::module &m) void ExportArray (py::module &m)
{ {
using TA = Array<T,BASE,TIND>;
string name = string("Array_") + typeid(T).name(); string name = string("Array_") + typeid(T).name();
py::class_<Array<T,BASE,TIND>>(m, name.c_str()) py::class_<Array<T,BASE,TIND>>(m, name.c_str())
.def ("__len__", [] ( Array<T,BASE,TIND> &self ) { return self.Size(); } ) .def ("__len__", [] ( Array<T,BASE,TIND> &self ) { return self.Size(); } )
@ -31,6 +32,9 @@ void ExportArray (py::module &m)
return self[i]; return self[i];
}), }),
py::return_value_policy::reference) py::return_value_policy::reference)
.def("__iter__", [] ( TA & self) {
return py::make_iterator (self.begin(),self.end());
}, py::keep_alive<0,1>()) // keep array alive while iterator is used
; ;
} }

View File

@ -776,13 +776,16 @@ namespace netgen
{ {
string displname; string displname;
// Display * dpy = glXGetCurrentDisplay(); Display * dpy = glXGetCurrentDisplay();
GLXDrawable drawable = glXGetCurrentDrawable(); GLXDrawable drawable = glXGetCurrentDrawable();
GLXContext ctx = glXGetCurrentContext(); GLXContext ctx = glXGetCurrentContext();
GLXContextID xid = glXGetContextIDEXT (ctx); GLXContextID xid = glXGetContextIDEXT (ctx);
displname = XDisplayName (0); displname = XDisplayName (0);
if( glXIsDirect ( dpy, ctx ) )
cout << "WARNING: direct rendering enabled; this might break mpi-parallel netgen (especially if X-forwarding is used! (to disable, change -indirect to true in ng/drawing.tcl)" << endl;
/* /*
cout << "Init Parallel GL" << endl; cout << "Init Parallel GL" << endl;
cout << "DisplayName = " << displname << endl; cout << "DisplayName = " << displname << endl;

View File

@ -893,7 +893,6 @@ proc viewingoptionsdialog { } {
# stl geometry # stl geometry
set f $w.nb.stl set f $w.nb.stl
ttk::labelframe $f.show -relief groove -borderwidth 3 -text "STL viewing options" ttk::labelframe $f.show -relief groove -borderwidth 3 -text "STL viewing options"
pack $f.show -fill x -pady 15 pack $f.show -fill x -pady 15
ttk::checkbutton $f.show.showtrias -text "Show STL-Triangles" \ ttk::checkbutton $f.show.showtrias -text "Show STL-Triangles" \
@ -935,7 +934,7 @@ proc viewingoptionsdialog { } {
-validatecommand "Ng_SetVisParameters; redraw;my_validate %W [$f.fn.scale3 cget -from] [$f.fn.scale3 cget -to] %P 0" \ -validatecommand "Ng_SetVisParameters; redraw;my_validate %W [$f.fn.scale3 cget -from] [$f.fn.scale3 cget -to] %P 0" \
-invalidcommand "my_invalid %W;Ng_SetVisParameters; redraw;" -invalidcommand "my_invalid %W;Ng_SetVisParameters; redraw;"
grid $f.fn.scale3 $f.fn.ent3 $f.fn.lab3 -stick nw -padx 4 grid $f.fn.scale3 $f.fn.ent3 $f.fn.lab3 -sticky nw -padx 4
#frame $f.fo -relief groove -borderwidth 3 #frame $f.fo -relief groove -borderwidth 3
@ -1576,7 +1575,6 @@ proc clippingdialog { } {
proc my_Press {w x y} { proc my_Press {w x y} {
puts [$w identify $x $y]
set inc [expr {([$w get $x $y] <= [$w get]) ? -1 : 1}] set inc [expr {([$w get $x $y] <= [$w get]) ? -1 : 1}]
ttk::Repeatedly ttk::scale::Increment $w [expr 0.001*$inc] ttk::Repeatedly ttk::scale::Increment $w [expr 0.001*$inc]
@ -1687,27 +1685,46 @@ proc refinementdialog { } {
#ttk::labelframe $w.main -text "Refinement options" -relief groove -borderwidth 3 #ttk::labelframe $w.main -text "Refinement options" -relief groove -borderwidth 3
#pack $w.main -fill x -pady 15 #pack $w.main -fill x -pady 15
#set w $w.main #set w $w.main
tixControl $w.meshsize -label "max mesh-size: " -integer false \ # tixControl $w.meshsize -label "max mesh-size: " -integer false \
-variable options.meshsize -min 1e-6 -max 1e6 \ # -variable options.meshize -min 1e-6 -max 1e6 \
-options { # -options {
entry.width 6 # entry.width 6
label.width 25 # label.width 25
label.anchor e # label.anchor e
} # }
pack $w.meshsize -anchor e # pack $w.meshsize -anchor e
global localh global localh
set localh 1 set localh 1
tixControl $w.loch -label "local mesh-size: " -integer false \ # tixControl $w.loch -label "local mesh-size: " -integer false \
-variable localh -min 1e-6 -max 1e6 \ # -variable localh -min 1e-6 -max 1e6 \
-options { # -options {
entry.width 6 # entry.width 6
label.width 25 # label.width 25
label.anchor e # label.anchor e
} # }
pack $w.loch -anchor e # pack $w.loch -anchor e
ttk::frame $w.meshsize
ttk::label $w.meshsize.l1 -text "max mesh-size: "
ttk::spinbox $w.meshsize.sp1 -from 1e-6 -to 1e6 -textvariable options.meshsize -validate focus -validatecommand "my_validatespinbox %W %P 4" \
-invalidcommand "my_invalidspinbox %W" -width 6 -increment 0.1
#pack $w.meshsize.l1 $w.meshsize.sp1 -fill x -side left
ttk::frame $w.meshsizeloc
#pack $w.meshsize -anchor e
#pack $w.meshsizeloc -anchor e
ttk::label $w.meshsizeloc.l1 -text "local mesh-size: "
ttk::spinbox $w.meshsizeloc.sp1 -from 1e-6 -to 1e6 -textvariable localh -validate focus -validatecommand "my_validatespinbox %W %P 4" \
-invalidcommand "my_invalidspinbox %W" -width 6 -increment 0.1
#pack $w.meshsizeloc.l1 $w.meshsizeloc.sp1 -expand yes -fill x
pack $w.meshsize
pack $w.meshsizeloc
grid $w.meshsize.l1 $w.meshsize.sp1
grid $w.meshsizeloc.l1 $w.meshsizeloc.sp1
ttk::button $w.restface -text "Restrict H at face" \ ttk::button $w.restface -text "Restrict H at face" \
@ -1736,7 +1753,7 @@ proc refinementdialog { } {
} }
pack $w.restface $w.restedge $w.restelement $w.restpoint -anchor e pack $w.restface $w.restedge $w.restelement $w.restpoint
@ -2211,17 +2228,17 @@ proc stloptionsdialog { } {
} }
proc stldoctordialog { } { proc stldoctordialog { } {
Ng_STLDoctor 0 0
set wd .stldoctor_dlg set wd .stldoctor_dlg
if {[winfo exists .stldoctor_dlg] == 1} { if {[winfo exists .stldoctor_dlg] == 1} {
wm withdraw $wd wm withdraw $wd
wm deiconify $wd wm deiconify $wd
focus $wd focus $wd
} { } {
toplevel $wd toplevel $wd
pack [ttk::notebook $wd.nb] -fill both -fill both -side top pack [ttk::notebook $wd.nb] -fill both -fill both -side top
$wd.nb add [ttk::frame $wd.nb.general] -text "General" -underline 0 $wd.nb add [ttk::frame $wd.nb.general] -text "General" -underline 0
$wd.nb add [ttk::frame $wd.nb.topology] -text "Edit Topology" -underline 5 $wd.nb add [ttk::frame $wd.nb.topology] -text "Edit Topology" -underline 5
@ -2241,16 +2258,16 @@ proc stldoctordialog { } {
# GENERAL ***************************** # GENERAL *****************************
set f $wd.nb.general set f $wd.nb.general
ttk::frame $f.selectframe -borderwidth 0
frame $f.show #ttk::frame $f.show
pack $f.show -fill x #pack $f.show -fill x
checkbutton $f.show.showtrias -text "Show STL-Triangles" \ ttk::checkbutton $f.selectframe.showtrias -text "Show STL-Triangles" \
-variable stloptions.showtrias -command { Ng_SetVisParameters; redraw } -variable stloptions.showtrias -command { Ng_SetVisParameters; redraw }
pack $f.show.showtrias -anchor w #pack $f.selectframe.showtrias -anchor w
checkbutton $f.show.showfilledtrias -text "Show Filled Triangles" \ ttk::checkbutton $f.selectframe.showfilledtrias -text "Show Filled Triangles" \
-variable stloptions.showfilledtrias -command { Ng_SetVisParameters; redraw } -variable stloptions.showfilledtrias -command { Ng_SetVisParameters; redraw }
pack $f.show.showfilledtrias -anchor w #pack $f.show.showfilledtrias -anchor w
set selmodevals { 0 1 2 3 4 } set selmodevals { 0 1 2 3 4 }
set selmodelabs(0) "triangle" set selmodelabs(0) "triangle"
@ -2259,72 +2276,104 @@ proc stldoctordialog { } {
set selmodelabs(3) "line" set selmodelabs(3) "line"
set selmodelabs(4) "line cluster" set selmodelabs(4) "line cluster"
tixOptionMenu $f.selmode -label "Double Click selects :" \ # tixOptionMenu $f.selmode -label "Double Click selects :" \
-options { # -options {
label.width 19 # label.width 19
label.anchor e # label.anchor e
menubutton.width 15 # menubutton.width 15
} # }
foreach selmodev $selmodevals { # foreach selmodev $selmodevals {
$f.selmode add command $selmodev -label $selmodelabs($selmodev) # $f.selmode add command $selmodev -label $selmodelabs($selmodev)
} # }
$f.selmode config -variable stldoctor.selectmode # $f.selmode config -variable stldoctor.selectmode
$f.selmode config -command { Ng_STLDoctor } # $f.selmode config -command { Ng_STLDoctor }
global stldoctor.selectmode global stldoctor.selectmode
pack $f.selmode # pack $f.selmode
frame $f.sm ttk::label $f.selectframe.dblcsellab -text "Double Click selects : "
ttk::menubutton $f.selectframe.dblcselbut -menu $f.selectframe.dblcselmen -text "triangle" -width 16
menu $f.selectframe.dblcselmen -tearoff 0
foreach selmode { 0 1 2 3 4 } {
$f.selectframe.dblcselmen add command -label $selmodelabs($selmode) \
-command "set stldoctor.selectmode $selmode ; Ng_STLDoctor ; $f.selectframe.dblcselbut configure -text \"$selmodelabs($selmode)\""
}
$f.selectframe.dblcselmen invoke $selmodelabs(${stldoctor.selectmode})
pack $f.selectframe
grid $f.selectframe.showtrias -sticky nw
grid $f.selectframe.showfilledtrias -sticky nw
grid $f.selectframe.dblcsellab $f.selectframe.dblcselbut -sticky nw
ttk::frame $f.sm
pack $f.sm -fill x pack $f.sm -fill x
checkbutton $f.sm.bu -text "select with mouse" \ ttk::checkbutton $f.sm.bu -text "select with mouse" \
-variable stldoctor.selectwithmouse -variable stldoctor.selectwithmouse
pack $f.sm.bu pack $f.sm.bu
frame $f.st -relief groove -borderwidth 3 ttk::frame $f.st -relief groove -borderwidth 3
pack $f.st -fill x pack $f.st -fill x
label $f.st.lab -text "Select triangle by number"; ttk::label $f.st.lab -text "Select triangle by number";
entry $f.st.ent -width 5 -relief sunken \ ttk::entry $f.st.ent -width 5 \
-textvariable stldoctor.selecttrig -textvariable stldoctor.selecttrig
pack $f.st.ent $f.st.lab -side left -expand yes pack $f.st.ent $f.st.lab -side left -expand yes
frame $f.vc -relief groove -borderwidth 3 ttk::frame $f.vc -relief groove -borderwidth 3
pack $f.vc -fill x pack $f.vc -fill x
checkbutton $f.vc.bu -text "show vicinity" \ ttk::checkbutton $f.vc.bu -text "show vicinity" \
-variable stldoctor.showvicinity \ -variable stldoctor.showvicinity \
-command {Ng_STLDoctor vicinity; redraw} -command {Ng_STLDoctor vicinity; redraw}
label $f.vc.lab -text "vicinity size"; ttk::label $f.vc.lab -text "vicinity size";
scale $f.vc.sc -orient horizontal -length 200 -from 0 -to 200 \
#scale $f.vc.sc -orient horizontal -length 200 -from 0 -to 200 \
-resolution 1 -variable stldoctor.vicinity \ -resolution 1 -variable stldoctor.vicinity \
-command { Ng_STLDoctor vicinity; redraw } -command { Ng_STLDoctor vicinity; redraw }
ttk::frame $f.vc.sc
ttk::scale $f.vc.sc.scale -orient horizontal -length 200 -from 0 -to 200 \
-variable stldoctor.vicinity -takefocus 0 -command "Ng_STLDoctor vicinity; redraw; roundscale $f.vc.sc.scale 0"
ttk::entry $f.vc.sc.entry -textvariable stldoctor.vicinity -width 3 \
-validatecommand "Ng_STLDoctor vicinity; redraw; my_validate %W [$f.vc.sc.scale cget -from] [$f.vc.sc.scale cget -to] %P 0" \
-invalidcommand "my_invalid %W;Ng_STLDoctor vicinity; redraw;" -validate focus
ttk::label $f.vc.sc.lab -text "vicinity size"
grid $f.vc.sc.scale $f.vc.sc.entry $f.vc.sc.lab -sticky nw -padx 4
pack $f.vc.bu $f.vc.lab $f.vc.sc -expand yes pack $f.vc.bu $f.vc.lab $f.vc.sc -expand yes
frame $f.ge -relief groove -borderwidth 3 ttk::frame $f.ge -relief groove -borderwidth 0
pack $f.ge -fill x pack $f.ge -expand yes
button $f.ge.neighbourangles -text "calc neighbourangles" -command {Ng_STLDoctor neighbourangles} ttk::button $f.ge.neighbourangles -text "calc neighbourangles" -command {Ng_STLDoctor neighbourangles}
button $f.ge.showcoords -text "show coords of touched triangle" -command {Ng_STLDoctor showcoords} ttk::button $f.ge.showcoords -text "show coords of touched triangle" -command {Ng_STLDoctor showcoords}
button $f.ge.moveptm -text "move point to middle of trianglepoints" -command {Ng_STLDoctor movepointtomiddle; redraw} ttk::button $f.ge.moveptm -text "move point to middle of trianglepoints" -command {Ng_STLDoctor movepointtomiddle; redraw}
button $f.ge.destroy0trigs -text "destroy 0-volume triangles" -command {Ng_STLDoctor destroy0trigs} ttk::button $f.ge.destroy0trigs -text "destroy 0-volume triangles" -command {Ng_STLDoctor destroy0trigs}
pack $f.ge.neighbourangles $f.ge.showcoords $f.ge.moveptm $f.ge.destroy0trigs -expand yes grid $f.ge.neighbourangles -sticky nw -padx 4 -pady 4
grid $f.ge.showcoords -sticky nw -padx 4 -pady 4
grid $f.ge.moveptm -sticky nw -padx 4 -pady 4
grid $f.ge.destroy0trigs -sticky nw -padx 4 -pady 4
button $f.ge.cancle -text "Done" -command {destroy .stldoctor_dlg } ttk::button $f.ge.cancle -text "Done" -command {destroy .stldoctor_dlg }
pack $f.ge.cancle -expand yes grid $f.ge.cancle -sticky nw
# TOPOLOGY ******************** # TOPOLOGY ********************
set f $wd.nb.topology set f $wd.nb.topology
frame $f.oc -relief groove -borderwidth 3 ttk::frame $f.oc -relief groove -borderwidth 3
pack $f.oc -fill x pack $f.oc -pady 3 -ipady 3 -fill y -fill x
button $f.oc.bu -text "invert orientation of selected trig" -command {Ng_STLDoctor invertselectedtrig; redraw } ttk::frame $f.oc.oc1 -borderwidth 0
button $f.oc.bu2 -text "orient after selected trig" -command {Ng_STLDoctor orientafterselectedtrig; redraw } pack $f.oc.oc1
pack $f.oc.bu $f.oc.bu2 -side left -expand yes ttk::button $f.oc.oc1.bu -text "invert orientation \n of selected trig" -command {Ng_STLDoctor invertselectedtrig; redraw }
ttk::button $f.oc.oc1.bu2 -text "orient after \n selected trig" -command {Ng_STLDoctor orientafterselectedtrig; redraw }
button $f.toperr -text "mark inconsistent triangles" -command {Ng_STLDoctor marktoperrortrigs; redraw }
button $f.deltrig -text "delete selected triangle" -command {Ng_STLDoctor deleteselectedtrig; redraw } ttk::button $f.oc.oc1.toperr -text "mark inconsistent triangles" -command {Ng_STLDoctor marktoperrortrigs; redraw }
button $f.geosmooth -text "geometric smoothing" -command {Ng_STLDoctor smoothgeometry; redraw } ttk::button $f.oc.oc1.deltrig -text "delete selected triangle" -command {Ng_STLDoctor deleteselectedtrig; redraw }
ttk::button $f.oc.oc1.geosmooth -text "geometric smoothing" -command {Ng_STLDoctor smoothgeometry; redraw }
pack $f.toperr $f.deltrig $f.geosmooth grid $f.oc.oc1.bu x $f.oc.oc1.bu2 -sticky nw -padx 4 -pady 4
grid $f.oc.oc1.toperr - x -sticky nw -padx 4 -pady 4
grid $f.oc.oc1.deltrig - x -sticky nw -padx 4 -pady 4
grid $f.oc.oc1.geosmooth - x -sticky nw -padx 4 -pady 4
@ -2334,27 +2383,50 @@ proc stldoctordialog { } {
set f $wd.nb.edges set f $wd.nb.edges
frame $f.be -relief groove -borderwidth 3 ttk::frame $f.be -relief groove -borderwidth 3
pack $f.be -fill x pack $f.be -fill x
label $f.be.lab -text "build edges with yellow angle:";
scale $f.be.sc -orient horizontal -length 200 -from 0 -to 100 \ #scale $f.be.sc -orient horizontal -length 200 -from 0 -to 100 \
#-resolution 0.5
ttk::frame $f.be.frame
pack $f.be.frame -ipady 4 -pady 4
ttk::label $f.be.frame.lab -text "build edges with yellow angle:";
ttk::scale $f.be.frame.scale -orient horizontal -length 200 -from 0 -to 200 \
-variable stloptions.yangle -takefocus 0 -command "roundscale $f.be.frame.scale 1; Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw"
ttk::entry $f.be.frame.entry -textvariable stloptions.yangle -width 5 \
-validatecommand "Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw;my_validate %W [$f.be.frame.scale cget -from] [$f.be.frame.scale cget -to] %P 1" \
-invalidcommand "my_invalid %W;Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw" -validate focus
grid $f.be.frame.lab - -sticky nw -padx 4
grid $f.be.frame.scale $f.be.frame.entry -sticky nw -padx 4
#$f.be.sc config -variable stloptions.yangle
#$f.be.sc config -command { Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw }
ttk::label $f.be.frame.lab2 -text "continue edges with yellow angle:";
# scale $f.be.sc2 -orient horizontal -length 200 -from 0 -to 100 \
-resolution 0.5 -resolution 0.5
$f.be.sc config -variable stloptions.yangle ttk::scale $f.be.frame.scale2 -orient horizontal -length 200 -from 0 -to 100 \
$f.be.sc config -command { Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw } -variable stloptions.contyangle -takefocus 0 -command "roundscale $f.be.frame.scale2 1; Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw"
label $f.be.lab2 -text "continue edges with yellow angle:"; ttk::entry $f.be.frame.entry2 -textvariable stloptions.contyangle -width 5 \
scale $f.be.sc2 -orient horizontal -length 200 -from 0 -to 100 \ -validatecommand "Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw;my_validate %W [$f.be.frame.scale2 cget -from] [$f.be.frame.scale2 cget -to] %P 1" \
-resolution 0.5 -invalidcommand "my_invalid %W;Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw" -validate focus
$f.be.sc2 config -variable stloptions.contyangle
$f.be.sc2 config -command { Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw } grid $f.be.frame.lab2 - -sticky nw -padx 4
grid $f.be.frame.scale2 $f.be.frame.entry2 -sticky nw -padx 4
#$f.be.sc2 config -variable stloptions.contyangle
#$f.be.sc2 config -command { Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw }
button $f.be.buildedges -text "Build Edges" -command {Ng_STLDoctor buildedges; redraw} ttk::button $f.be.frame.buildedges -text "Build Edges" -command {Ng_STLDoctor buildedges; redraw}
pack $f.be.lab $f.be.sc $f.be.lab2 $f.be.sc2 $f.be.buildedges -expand yes grid $f.be.frame.buildedges - -sticky n -padx 4 -pady 4
#pack $f.be.lab $f.be.sc $f.be.lab2 $f.be.sc2 $f.be.buildedges -expand yes
frame $f.se ttk::frame $f.se -relief groove -borderwidth 3
pack $f.se -fill x pack $f.se -fill x
checkbutton $f.se.bu -text "show excluded" \ ttk::checkbutton $f.se.bu -text "show excluded" \
-variable stldoctor.showexcluded \ -variable stldoctor.showexcluded \
-command {Ng_STLDoctor; redraw} -command {Ng_STLDoctor; redraw}
pack $f.se.bu pack $f.se.bu
@ -2368,25 +2440,41 @@ proc stldoctordialog { } {
set edgeselmodelabs(3) "candidate" set edgeselmodelabs(3) "candidate"
set edgeselmodelabs(4) "excluded" set edgeselmodelabs(4) "excluded"
tixOptionMenu $f.edgeselmode -label "Double Click sets edge :" \ # tixOptionMenu $f.edgeselmode -label "Double Click sets edge :" \
-options { # -options {
label.width 19 # label.width 19
label.anchor e # label.anchor e
menubutton.width 15 # menubutton.width 15
} # }
foreach edgeselmodev $edgeselmodevals { # foreach edgeselmodev $edgeselmodevals {
$f.edgeselmode add command $edgeselmodev -label $edgeselmodelabs($edgeselmodev) # $f.edgeselmode add command $edgeselmodev -label $edgeselmodelabs($edgeselmodev)
} # }
$f.edgeselmode config -variable stldoctor.edgeselectmode # $f.edgeselmode config -variable stldoctor.edgeselectmode
$f.edgeselmode config -command { Ng_STLDoctor } # $f.edgeselmode config -command { Ng_STLDoctor }
global stldoctor.edgeselectmode global stldoctor.edgeselectmode
pack $f.edgeselmode # pack $f.edgeselmode
ttk::frame $f.scaleframe -relief groove -borderwidth 0
pack $f.scaleframe -ipadx 4 -pady 4 -expand yes
ttk::label $f.scaleframe.dblcedgelab -text "Double Click sets edge :"
ttk::menubutton $f.scaleframe.dblcledgebut -menu $f.scaleframe.dblcledgem -text "coarse" -width 16
menu $f.scaleframe.dblcledgem -tearoff 0
foreach selectmode { 0 1 2 3 4 } {
$f.scaleframe.dblcledgem add command -label $edgeselmodelabs($selectmode) \
-command "set stldoctor.edgeselectmode $selectmode ; $f.scaleframe.dblcledgebut configure -text \"$edgeselmodelabs($selectmode)\""
}
$f.scaleframe.dblcledgem invoke $edgeselmodelabs(${stldoctor.edgeselectmode})
grid $f.scaleframe.dblcedgelab $f.scaleframe.dblcledgebut -sticky n -ipadx 4
# edge buttons # edge buttons
frame $f.edg -relief groove -borderwidth 3 ttk::frame $f.edg -relief groove -borderwidth 3
pack $f.edg -fill x pack $f.edg -fill x -ipadx 4 -ipady 4
# checkbutton $f.edg.bu -text "use external edges" \ # checkbutton $f.edg.bu -text "use external edges" \
# -variable stldoctor.useexternaledges \ # -variable stldoctor.useexternaledges \
@ -2394,36 +2482,36 @@ proc stldoctordialog { } {
# pack $f.edg.bu -expand yes # pack $f.edg.bu -expand yes
frame $f.edg.f0 ttk::frame $f.edg.f0
pack $f.edg.f0 pack $f.edg.f0
button $f.edg.f0.confirmedge -text "confirm" -command {Ng_STLDoctor confirmedge; redraw} ttk::button $f.edg.f0.confirmedge -text "confirm" -command {Ng_STLDoctor confirmedge; redraw}
button $f.edg.f0.candidateedge -text "candidate" -command {Ng_STLDoctor candidateedge; redraw} ttk::button $f.edg.f0.candidateedge -text "candidate" -command {Ng_STLDoctor candidateedge; redraw}
button $f.edg.f0.excludeedge -text "exclude" -command {Ng_STLDoctor excludeedge; redraw} ttk::button $f.edg.f0.excludeedge -text "exclude" -command {Ng_STLDoctor excludeedge; redraw}
button $f.edg.f0.undefinededge -text "undefined" -command {Ng_STLDoctor undefinededge; redraw} ttk::button $f.edg.f0.undefinededge -text "undefined" -command {Ng_STLDoctor undefinededge; redraw}
pack $f.edg.f0.confirmedge $f.edg.f0.candidateedge $f.edg.f0.excludeedge $f.edg.f0.undefinededge -side left pack $f.edg.f0.confirmedge $f.edg.f0.candidateedge $f.edg.f0.excludeedge $f.edg.f0.undefinededge -side left
frame $f.edg.fa ttk::frame $f.edg.fa
pack $f.edg.fa pack $f.edg.fa
button $f.edg.fa.setallundefined -text "all undefined" -command {Ng_STLDoctor setallundefinededges; redraw} ttk::button $f.edg.fa.setallundefined -text "all undefined" -command {Ng_STLDoctor setallundefinededges; redraw}
button $f.edg.fa.erasecandidates -text "candidates to undefined" -command {Ng_STLDoctor erasecandidateedges; redraw} ttk::button $f.edg.fa.erasecandidates -text "candidates to undefined" -command {Ng_STLDoctor erasecandidateedges; redraw}
pack $f.edg.fa.setallundefined $f.edg.fa.erasecandidates -side left pack $f.edg.fa.setallundefined $f.edg.fa.erasecandidates -side left
frame $f.edg.fb ttk::frame $f.edg.fb
pack $f.edg.fb pack $f.edg.fb
button $f.edg.fb.confirmcandidates -text "candidates to confirmed" -command {Ng_STLDoctor confirmcandidateedges; redraw} ttk::button $f.edg.fb.confirmcandidates -text "candidates to confirmed" -command {Ng_STLDoctor confirmcandidateedges; redraw}
button $f.edg.fb.confirmedtocandidates -text "confirmed to candidates" -command {Ng_STLDoctor confirmedtocandidateedges; redraw} ttk::button $f.edg.fb.confirmedtocandidates -text "confirmed to candidates" -command {Ng_STLDoctor confirmedtocandidateedges; redraw}
pack $f.edg.fb.confirmcandidates $f.edg.fb.confirmedtocandidates -side left pack $f.edg.fb.confirmcandidates $f.edg.fb.confirmedtocandidates -side left
frame $f.edg.f1 ttk::frame $f.edg.f1
frame $f.edg.f2 ttk::frame $f.edg.f2
frame $f.edg.f3 ttk::frame $f.edg.f3
frame $f.edg.f4 ttk::frame $f.edg.f4
pack $f.edg.f1 $f.edg.f2 $f.edg.f3 $f.edg.f4 pack $f.edg.f1 $f.edg.f2 $f.edg.f3 $f.edg.f4
button $f.edg.f1.exportedges -text "export edges" -command {Ng_STLDoctor exportedges} ttk::button $f.edg.f1.exportedges -text "export edges" -command {Ng_STLDoctor exportedges}
button $f.edg.f1.importedges -text "import edges" -command {Ng_STLDoctor importedges; redraw} ttk::button $f.edg.f1.importedges -text "import edges" -command {Ng_STLDoctor importedges; redraw}
button $f.edg.f1.saveedgedata -text "save edgedata" \ ttk::button $f.edg.f1.saveedgedata -text "save edgedata" \
-command { -command {
set types { set types {
{"Netgen Edgedata" {.ned} } {"Netgen Edgedata" {.ned} }
@ -2434,7 +2522,7 @@ proc stldoctordialog { } {
} }
} }
button $f.edg.f1.loadedgedata -text "load edgedata" \ ttk::button $f.edg.f1.loadedgedata -text "load edgedata" \
-command { -command {
set types { set types {
{"Netgen Edgedata" {.ned} } {"Netgen Edgedata" {.ned} }
@ -2450,7 +2538,7 @@ proc stldoctordialog { } {
} }
} }
button $f.edg.f1.importAVLedges -text "import AVL edges" \ ttk::button $f.edg.f1.importAVLedges -text "import AVL edges" \
-command { -command {
set types {{"Edge file" {.edg }}} set types {{"Edge file" {.edg }}}
@ -2463,7 +2551,7 @@ proc stldoctordialog { } {
pack $f.edg.f1.importAVLedges $f.edg.f1.loadedgedata $f.edg.f1.saveedgedata -side left pack $f.edg.f1.importAVLedges $f.edg.f1.loadedgedata $f.edg.f1.saveedgedata -side left
# button $f.edg.f1.buildedges -text "build external edges" -command {Ng_STLDoctor buildexternaledges; redraw} # button $f.edg.f1.buildedges -text "build external edges" -command {Ng_STLDoctor buildexternaledges; redraw}
frame $f.edg2 -relief groove -borderwidth 3 ttk::frame $f.edg2 -relief groove -borderwidth 3
pack $f.edg2 -fill x pack $f.edg2 -fill x
@ -2485,75 +2573,85 @@ proc stldoctordialog { } {
# NORMALS *********************** # NORMALS ***********************
set f $wd.nb.normals set f $wd.nb.normals
frame $f.dt -relief groove -borderwidth 3 ttk::frame $f.dt -relief groove -borderwidth 3
pack $f.dt -fill x pack $f.dt -fill x
label $f.dt.lab -text "dirty triangle factor"; ttk::label $f.dt.lab -text "dirty triangle factor";
entry $f.dt.ent -width 5 -relief sunken \ ttk::entry $f.dt.ent -width 5 \
-textvariable stldoctor.dirtytrigfact -textvariable stldoctor.dirtytrigfact -validatecommand "Ng_SetSTLParameters;my_validate %W -1e9 1e9 %P 3" \
pack $f.dt.ent $f.dt.lab -side left -expand yes -invalidcommand "my_invalid %W;Ng_SetSTLParameters" -validate focus
pack $f.dt.ent $f.dt.lab -side left -expand yes -pady 8
frame $f.srt -relief groove -borderwidth 3 ttk::frame $f.srt -relief groove -borderwidth 3
pack $f.srt -fill x pack $f.srt -fill x
button $f.srt.bu -text "smooth reverted triangles geometric" -command {Ng_STLDoctor smoothrevertedtrigs; redraw } ttk::button $f.srt.bu -text "smooth reverted triangles geometric" -command {Ng_STLDoctor smoothrevertedtrigs; redraw }
entry $f.srt.ent -width 5 -relief sunken \ ttk::entry $f.srt.ent -width 5 \
-textvariable stldoctor.smoothangle -textvariable stldoctor.smoothangle -validatecommand "Ng_SetSTLParameters;my_validate %W -1e9 1e9 %P 2" \
pack $f.srt.ent $f.srt.bu -side left -expand yes -invalidcommand "my_invalid %W;Ng_SetSTLParameters" -validate focus
pack $f.srt.ent $f.srt.bu -side left -expand yes -pady 8
frame $f.bdt -relief groove -borderwidth 3 ttk::frame $f.bdt -relief groove -borderwidth 3
pack $f.bdt -fill x pack $f.bdt -fill x
button $f.bdt.bu -text "mark dirty triangles" -command {Ng_STLDoctor markdirtytrigs; redraw } ttk::button $f.bdt.bu -text "mark dirty triangles" -command {Ng_STLDoctor markdirtytrigs; redraw }
button $f.bdt.bu2 -text "smooth dirty triangles normal" -command {Ng_STLDoctor smoothdirtytrigs; redraw } ttk::button $f.bdt.bu2 -text "smooth dirty triangles normal" -command {Ng_STLDoctor smoothdirtytrigs; redraw }
pack $f.bdt.bu $f.bdt.bu2 -side left -expand yes pack $f.bdt.bu $f.bdt.bu2 -side left -expand yes -pady 8
frame $f.sno -relief groove -borderwidth 3 ttk::frame $f.sno -relief groove -borderwidth 3
pack $f.sno pack $f.sno -fill x
ttk::frame $f.sno.snoframe -borderwidth 0
label $f.sno.labrough -text "rough" #ttk::label $f.sno.labrough -text "rough"
scale $f.sno.scsmooth -orient horizontal -length 100 -from 0 -to 0.8 \ #scale $f.sno.scsmooth -orient horizontal -length 100 -from 0 -to 0.8 \
-resolution 0.01 -variable stldoctor.smoothnormalsweight \ -resolution 0.01 -variable stldoctor.smoothnormalsweight \
-command { Ng_SetSTLParameters } -command { Ng_SetSTLParameters }
label $f.sno.labsmooth -text "smooth" #ttk::label $f.sno.labsmooth -text "smooth"
button $f.sno.smoothnormals -text "smooth normals" -command { Ng_STLDoctor smoothnormals; redraw} ttk::button $f.sno.smoothnormals -text "smooth normals" -command { Ng_STLDoctor smoothnormals; redraw}
ttk::scale $f.sno.snoframe.scale -orient horizontal -length 100 -from 0.0 -to 0.8 \
-variable stldoctor.smoothnormalsweight -takefocus 0 -command "roundscale $f.sno.snoframe.scale 2;Ng_SetSTLParameters"
ttk::entry $f.sno.snoframe.entry -textvariable stldoctor.smoothnormalsweight -width 4 \
-validatecommand "Ng_SetSTLParameters;my_validate %W [$f.sno.snoframe.scale cget -from] [$f.sno.snoframe.scale cget -to] %P 2" \
-invalidcommand "my_invalid %W;Ng_SetSTLParameters" -validate focus
ttk::label $f.sno.snoframe.labrough -text "rough"
ttk::label $f.sno.snoframe.labsmooth -text "smooth"
grid $f.sno.snoframe.labrough $f.sno.snoframe.scale $f.sno.snoframe.labsmooth $f.sno.snoframe.entry -sticky nw -padx 4
#pack $f.sno.labrough $f.sno.scsmooth $f.sno.labsmooth $f.sno.smoothnormals -side left -padx 5
pack $f.sno.labrough $f.sno.scsmooth $f.sno.labsmooth $f.sno.smoothnormals -side left -padx 5 pack $f.sno.snoframe $f.sno.smoothnormals -side left -padx 5 -pady 8
ttk::frame $f.no -relief groove -borderwidth 3
frame $f.no -relief groove -borderwidth 3
pack $f.no -fill x pack $f.no -fill x
button $f.no.marknonsmoothnormals -text "mark non-smooth triangles" -command {Ng_STLDoctor marknonsmoothnormals; redraw} ttk::button $f.no.marknonsmoothnormals -text "mark non-smooth triangles" -command {Ng_STLDoctor marknonsmoothnormals; redraw}
button $f.no.calcnormals -text "calculate normals from geometry" -command {Ng_STLDoctor calcnormals; redraw} ttk::button $f.no.calcnormals -text "calculate normals from geometry" -command {Ng_STLDoctor calcnormals; redraw}
pack $f.no.marknonsmoothnormals $f.no.calcnormals -expand yes pack $f.no.marknonsmoothnormals $f.no.calcnormals -expand yes -pady 8
# ADVANCED ************************** # ADVANCED **************************
set f $wd.nb.advanced set f $wd.nb.advanced
frame $f.sc ttk::frame $f.sc
pack $f.sc -fill x pack $f.sc -fill x
checkbutton $f.sc.bu -text "spiral check" \ ttk::checkbutton $f.sc.bu -text "spiral check" \
-variable stldoctor.spiralcheck \ -variable stldoctor.spiralcheck \
-command {Ng_STLDoctor;} -command {Ng_STLDoctor;}
checkbutton $f.sc.bu2 -text "cone check" \ ttk::checkbutton $f.sc.bu2 -text "cone check" \
-variable stldoctor.conecheck \ -variable stldoctor.conecheck \
-command {Ng_STLDoctor;} -command {Ng_STLDoctor;}
pack $f.sc.bu $f.sc.bu2 pack $f.sc.bu $f.sc.bu2
tixControl $f.gtol -label "load-geometry tolerance factor" -integer false \ #tixControl $f.gtol -label "load-geometry tolerance factor" -integer false \
-variable stldoctor.geom_tol_fact \ -variable stldoctor.geom_tol_fact \
-options { -options {
entry.width 8 # entry.width 8
label.width 30 # label.width 30
label.anchor e # label.anchor e
} #}
ttk::spinbox $f.gtol -from 1 -to 20 -textvariable stldoctor.geom_tol_fact -width 8
pack $f.gtol pack $f.gtol
button $f.adap -text "Apply" -command { ttk::button $f.adap -text "Apply" -command {
.stldoctor_dlg.nb.advanced.gtol invoke .stldoctor_dlg.nb.advanced.gtol invoke
Ng_STLDoctor; Ng_STLDoctor;
} }
@ -2596,45 +2694,52 @@ proc meshdoctordialog { } {
Ng_MeshDoctor; Ng_MeshDoctor;
frame $w.vis -relief groove -borderwidth 3 ttk::frame $w.vis -relief groove -borderwidth 3
pack $w.vis pack $w.vis
checkbutton $w.vis.showfilledtrigs -text "Show filled triangles" \ ttk::checkbutton $w.vis.showfilledtrigs -text "Show filled triangles" \
-variable viewoptions.drawfilledtrigs \ -variable viewoptions.drawfilledtrigs \
-command { Ng_SetVisParameters; redraw } -command { Ng_SetVisParameters; redraw }
checkbutton $w.vis.showedges -text "Show edges" \ ttk::checkbutton $w.vis.showedges -text "Show edges" \
-variable viewoptions.drawedges \ -variable viewoptions.drawedges \
-command { Ng_SetVisParameters; redraw } -command { Ng_SetVisParameters; redraw }
checkbutton $w.vis.showoutline -text "Show Triangle Outline" \ ttk::checkbutton $w.vis.showoutline -text "Show Triangle Outline" \
-variable viewoptions.drawoutline \ -variable viewoptions.drawoutline \
-command { Ng_SetVisParameters; redraw } -command { Ng_SetVisParameters; redraw }
pack $w.vis.showfilledtrigs $w.vis.showoutline $w.vis.showedges pack $w.vis.showfilledtrigs $w.vis.showoutline $w.vis.showedges
tixControl $w.markedgedist -label "Mark edge dist: " -integer true \ ttk::frame $w.markedgedist
-min 0 -max 999 \ ttk::label $w.markedgedist.l -text "Mark edge dist: "
-variable meshdoc.markedgedist \ ttk::spinbox $w.markedgedist.s -from 0 -to 999 -width 5 -increment 1 -validate focus -validatecommand "my_validatespinbox %W %P 0" \
-options { -invalidcommand "my_invalidspinbox %W" -command {Ng_MeshDoctor markedgedist ${meshdoc.markedgedist};redraw} -textvariable meshdoc.markedgedist
entry.width 3 #pack $f.grading -fill x
label.width 20 pack $w.markedgedist.l $w.markedgedist.s -side left
label.anchor e
} \ # tixControl $w.markedgedist -label "Mark edge dist: " -integer true \
-command { # -min 0 -max 999 \
Ng_MeshDoctor markedgedist ${meshdoc.markedgedist} # -variable meshdoc.markedgedist \
redraw # -options {
} # entry.width 3
# label.width 20
# label.anchor e
# } \
# -command {
# Ng_MeshDoctor markedgedist ${meshdoc.markedgedist}
# redraw
# }
pack $w.markedgedist pack $w.markedgedist
button $w.deledge -text "Delete marked segments" -command { ttk::button $w.deledge -text "Delete marked segments" -command {
Ng_MeshDoctor deletemarkedsegments Ng_MeshDoctor deletemarkedsegments
redraw redraw
} }
pack $w.deledge pack $w.deledge
button $w.close -text "Close" -command { ttk::button $w.close -text "Close" -command {
set meshdoctor.active 0; set meshdoctor.active 0;
Ng_MeshDoctor; Ng_MeshDoctor;
destroy .meshdoc_dlg destroy .meshdoc_dlg
@ -2961,117 +3066,117 @@ proc printlatestwarning { } {
proc runtestdialog { } { # proc runtestdialog { } {
source $::ngdir/ngshell.tcl # source $::ngdir/ngshell.tcl
set w .runtest_dlg # set w .runtest_dlg
if {[winfo exists .runtest_dlg] == 1} { # if {[winfo exists .runtest_dlg] == 1} {
wm withdraw $w # wm withdraw $w
wm deiconify $w # wm deiconify $w
focus $w # focus $w
} { # } {
toplevel $w # toplevel $w
# in2d testing # # # in2d testing #
frame $w.in2dframe # frame $w.in2dframe
pack $w.in2dframe # pack $w.in2dframe
set in2dlogfile "" # set in2dlogfile ""
tixLabelEntry $w.in2dframe.ent -label "in2d log-file: console if empty" \ # tixLabelEntry $w.in2dframe.ent -label "in2d log-file: console if empty" \
-labelside top \ # -labelside top \
-options { # -options {
entry.textVariable in2dlogfile # entry.textVariable in2dlogfile
entry.width 35 # entry.width 35
label.width 25 # label.width 25
label.anchor w # label.anchor w
} # }
button $w.in2dframe.btn -text "Browse" -command { # button $w.in2dframe.btn -text "Browse" -command {
set types { { "Log file" {.log} } } # set types { { "Log file" {.log} } }
set in2dlogfile [tk_getOpenFile -filetypes $types -initialfile $in2dlogfile] # set in2dlogfile [tk_getOpenFile -filetypes $types -initialfile $in2dlogfile]
} # }
button $w.in2dframe.test -text "Test in2d meshing" -command { ngtest in2d $in2dlogfile } # button $w.in2dframe.test -text "Test in2d meshing" -command { ngtest in2d $in2dlogfile }
pack $w.in2dframe.test -side left -anchor s -padx 4 -pady 4 # pack $w.in2dframe.test -side left -anchor s -padx 4 -pady 4
pack $w.in2dframe.ent -side left -expand yes -fill x -anchor s -padx 4 -pady 4 # pack $w.in2dframe.ent -side left -expand yes -fill x -anchor s -padx 4 -pady 4
pack $w.in2dframe.btn -side left -anchor s -padx 4 -pady 4 # pack $w.in2dframe.btn -side left -anchor s -padx 4 -pady 4
# geo testing # # # geo testing #
frame $w.geoframe # frame $w.geoframe
pack $w.geoframe # pack $w.geoframe
set geologfile "" # set geologfile ""
tixLabelEntry $w.geoframe.ent -label "geo log-file: console if empty" \ # tixLabelEntry $w.geoframe.ent -label "geo log-file: console if empty" \
-labelside top \ # -labelside top \
-options { # -options {
entry.textVariable geologfile # entry.textVariable geologfile
entry.width 35 # entry.width 35
label.width 25 # label.width 25
label.anchor w # label.anchor w
} # }
button $w.geoframe.btn -text "Browse" -command { # button $w.geoframe.btn -text "Browse" -command {
set types { { "Log file" {.log} } } # set types { { "Log file" {.log} } }
set geologfile [tk_getOpenFile -filetypes $types -initialfile $geologfile] # set geologfile [tk_getOpenFile -filetypes $types -initialfile $geologfile]
} # }
button $w.geoframe.test -text "Test geo meshing" -command { ngtest geo $geologfile } # button $w.geoframe.test -text "Test geo meshing" -command { ngtest geo $geologfile }
pack $w.geoframe.test -side left -anchor s -padx 4 -pady 4 # pack $w.geoframe.test -side left -anchor s -padx 4 -pady 4
pack $w.geoframe.ent -side left -expand yes -fill x -anchor s -padx 4 -pady 4 # pack $w.geoframe.ent -side left -expand yes -fill x -anchor s -padx 4 -pady 4
pack $w.geoframe.btn -side left -anchor s -padx 4 -pady 4 # pack $w.geoframe.btn -side left -anchor s -padx 4 -pady 4
# stl testing # # # stl testing #
frame $w.stlframe # frame $w.stlframe
pack $w.stlframe # pack $w.stlframe
set stllogfile "" # set stllogfile ""
tixLabelEntry $w.stlframe.ent -label "stl log-file: console if empty" \ # tixLabelEntry $w.stlframe.ent -label "stl log-file: console if empty" \
-labelside top \ # -labelside top \
-options { # -options {
entry.textVariable stllogfile # entry.textVariable stllogfile
entry.width 35 # entry.width 35
label.width 25 # label.width 25
label.anchor w # label.anchor w
} # }
button $w.stlframe.btn -text "Browse" -command { # button $w.stlframe.btn -text "Browse" -command {
set types { { "Log file" {.log} } } # set types { { "Log file" {.log} } }
set stllogfile [tk_getOpenFile -filetypes $types -initialfile $stllogfile] # set stllogfile [tk_getOpenFile -filetypes $types -initialfile $stllogfile]
} # }
button $w.stlframe.test -text "Test stl meshing" -command { ngtest stl $stllogfile } # button $w.stlframe.test -text "Test stl meshing" -command { ngtest stl $stllogfile }
pack $w.stlframe.test -side left -anchor s -padx 4 -pady 4 # pack $w.stlframe.test -side left -anchor s -padx 4 -pady 4
pack $w.stlframe.ent -side left -expand yes -fill x -anchor s -padx 4 -pady 4 # pack $w.stlframe.ent -side left -expand yes -fill x -anchor s -padx 4 -pady 4
pack $w.stlframe.btn -side left -anchor s -padx 4 -pady 4 # pack $w.stlframe.btn -side left -anchor s -padx 4 -pady 4
# pde testing # # # pde testing #
frame $w.pdeframe # frame $w.pdeframe
pack $w.pdeframe # pack $w.pdeframe
set pdelogfile "" # set pdelogfile ""
tixLabelEntry $w.pdeframe.ent -label "pde log-file: console if empty" \ # tixLabelEntry $w.pdeframe.ent -label "pde log-file: console if empty" \
-labelside top \ # -labelside top \
-options { # -options {
entry.textVariable pdelogfile # entry.textVariable pdelogfile
entry.width 35 # entry.width 35
label.width 25 # label.width 25
label.anchor w # label.anchor w
} # }
button $w.pdeframe.btn -text "Browse" -command { # button $w.pdeframe.btn -text "Browse" -command {
set types { { "Log file" {.log} } } # set types { { "Log file" {.log} } }
set pdelogfile [tk_getOpenFile -filetypes $types -initialfile $pdelogfile] # set pdelogfile [tk_getOpenFile -filetypes $types -initialfile $pdelogfile]
} # }
button $w.pdeframe.test -text "Test ngsolve pde's" -command { ngtest pde $pdelogfile } # button $w.pdeframe.test -text "Test ngsolve pde's" -command { ngtest pde $pdelogfile }
pack $w.pdeframe.test -side left -anchor s -padx 4 -pady 4 # pack $w.pdeframe.test -side left -anchor s -padx 4 -pady 4
pack $w.pdeframe.ent -side left -expand yes -fill x -anchor s -padx 4 -pady 4 # pack $w.pdeframe.ent -side left -expand yes -fill x -anchor s -padx 4 -pady 4
pack $w.pdeframe.btn -side left -anchor s -padx 4 -pady 4 # pack $w.pdeframe.btn -side left -anchor s -padx 4 -pady 4
wm title $w "Testing" # wm title $w "Testing"
focus .runtest_dlg # focus .runtest_dlg
} # }
} # }

View File

@ -854,17 +854,28 @@ ttk::button .bubar.center -text "Center" \
-command { Ng_Center; redraw } -command { Ng_Center; redraw }
# tk_optionMenu .bubar.modesel drawmode "rotate" "move " "zoom " # tk_optionMenu .bubar.modesel drawmode "rotate" "move " "zoom "
tixOptionMenu .bubar.modesel \ # tixOptionMenu .bubar.modesel \
-options { # -options {
label.width 0 # label.width 0
label.anchor e # label.anchor e
menubutton.width 6 # menubutton.width 6
} \ # } \
-variable drawmode # -variable drawmode
# .bubar.modesel add command rotate -label Rotate
# .bubar.modesel add command move -label Move
# .bubar.modesel add command zoom -label Zoom
ttk::menubutton .bubar.modesel -menu .bubar.modesel.menu -text "" -width 6
menu .bubar.modesel.menu -tearoff 0
.bubar.modesel.menu add command -label "Rotate" -command "set drawmode \"rotate\" ;.bubar.modesel configure -text \"Rotate\""
.bubar.modesel.menu add command -label "Move" -command "set drawmode \"move\" ;.bubar.modesel configure -text \"Move\""
.bubar.modesel.menu add command -label "Zoom" -command "set drawmode \"zoom\" ;.bubar.modesel configure -text \"Zoom\""
.bubar.modesel.menu invoke "Rotate"
.bubar.modesel add command rotate -label Rotate
.bubar.modesel add command move -label Move
.bubar.modesel add command zoom -label Zoom
@ -881,19 +892,20 @@ set viewvallabs(surfmeshing) "Mesh Gen"
set viewvallabs(modelview) "Modeller" set viewvallabs(modelview) "Modeller"
set viewvallabs(solution) "Solution" set viewvallabs(solution) "Solution"
tixOptionMenu .bubar.selview \ # tixOptionMenu .bubar.selview \
-options { # -options {
label.width 0 # label.width 0
label.anchor e # label.anchor e
menubutton.width 10 # menubutton.width 10
} \ # } \
foreach viewv $viewvals { # foreach viewv $viewvals {
.bubar.selview add command $viewv -label $viewvallabs($viewv) # .bubar.selview add command $viewv -label $viewvallabs($viewv)
} # }
# .bubar.selview config -variable selectvisual
# .bubar.selview config -command { Ng_SetVisParameters; redraw }
.bubar.selview config -variable selectvisual
.bubar.selview config -command { Ng_SetVisParameters; redraw }
# pack .bubar.modesel -side right # pack .bubar.modesel -side right
@ -961,8 +973,9 @@ pack .statbar.selslabel .statbar.selsval -side left -ipady 3p
# } # }
tixMeter .statbar.per -value 0 -text 0% #tixMeter .statbar.per -value 0 -text 0%
.statbar.per configure -fillcolor blue ttk::progressbar .statbar.per -value 0 -maximum 1
#.statbar.per configure -fillcolor blue
pack .statbar.per -side right pack .statbar.per -side right
pack .statbar.task -side right -ipady 4 pack .statbar.task -side right -ipady 4
@ -1017,7 +1030,8 @@ proc timer2 { } {
# set mem_moveable [Ng_MemInfo moveable] # set mem_moveable [Ng_MemInfo moveable]
.statbar.per config -value [expr $status_percent/100] -text [format %2.1f [expr 0.1*int(10*$status_percent)]]% .statbar.per configure -value [expr $status_percent/100]
# -text [format %2.1f [expr 0.1*int(10*$status_percent)]]%
if { $multithread_running } { if { $multithread_running } {

View File

@ -54,7 +54,7 @@ proc show_menu_help { entry } {
} }
tixBalloon .balloon -statusbar .helpline #tixBalloon .balloon -statusbar .helpline
proc set_control_help { control helpmsg } { proc set_control_help { control helpmsg } {
bind $control <Enter> "show_control_help {$helpmsg}" bind $control <Enter> "show_control_help {$helpmsg}"

View File

@ -227,35 +227,48 @@ proc lineplotdialog { } {
} }
tixOptionMenu $w.filesettings.latestevals -label "Use Evaluate Results: " \ # tixOptionMenu $w.filesettings.latestevals -label "Use Evaluate Results: " \
-options { # -options {
label.width 25 # label.width 25
label.anchor e # label.anchor e
menubutton.width 40 # menubutton.width 40
} # }
# for {set i 0} {$i < [llength ${visoptions.evaluatefilenames}]} {incr i} {
# $w.filesettings.latestevals add command $i \
# -label "[lindex ${visoptions.evaluatefiledescriptions} $i] ([lindex ${visoptions.evaluatefilenames} $i])"
# }
# $w.filesettings.latestevals config -variable visoptions.lineplotselectedeval
# pack $w.filesettings.latestevals
ttk::frame $w.filesettings.latestevals
ttk::label $w.filesettings.latestevals.lab -text "Use Evaluate Results: "
ttk::menubutton $w.filesettings.latestevals.but -menu $w.filesettings.latestevals.menu -text "coarse" -width 40
menu $w.filesettings.latestevals.menu -tearoff 0
for {set i 0} {$i < [llength ${visoptions.evaluatefilenames}]} {incr i} { for {set i 0} {$i < [llength ${visoptions.evaluatefilenames}]} {incr i} {
$w.filesettings.latestevals add command $i \ $w.filesettings.latestevals.menu add command -label $i\
-label "[lindex ${visoptions.evaluatefiledescriptions} $i] ([lindex ${visoptions.evaluatefilenames} $i])" -command "set visoptions.lineplotselectedeval $i ; $w.filesettings.latestevals.but configure -text \"[lindex ${visoptions.evaluatefiledescriptions} $i] ([lindex ${visoptions.evaluatefilenames} $i])\""
} }
$w.filesettings.latestevals config -variable visoptions.lineplotselectedeval $w.filesettings.latestevals.menu invoke ${visoptions.lineplotselectedeval}
grid $w.filesettings.latestevals.lab $w.filesettings.latestevals.but -sticky nw
pack $w.filesettings.latestevals pack $w.filesettings.latestevals
ttk::frame $w.filesettings.sfn
frame $w.filesettings.sfn ttk::button $w.filesettings.sfn.bb -text "Browse" \
button $w.filesettings.sfn.bb -text "Browse" \
-command { set visoptions.lineplotfile [tk_getOpenFile] } -command { set visoptions.lineplotfile [tk_getOpenFile] }
entry $w.filesettings.sfn.fn -width 50 -relief sunken \ ttk::entry $w.filesettings.sfn.fn -width 50 \
-textvariable visoptions.lineplotfile -textvariable visoptions.lineplotfile
pack $w.filesettings.sfn.bb $w.filesettings.sfn.fn -side left pack $w.filesettings.sfn.bb $w.filesettings.sfn.fn -side left
pack $w.filesettings.sfn pack $w.filesettings.sfn
button $w.filesettings.refresh -text "Refresh" -command { ttk::button $w.filesettings.refresh -text "Refresh" -command {
if { ${visoptions.lineplotselectedeval} != 0} { if { ${visoptions.lineplotselectedeval} != 0} {
set visoptions.lineplotfile [lindex ${visoptions.evaluatefilenames} ${visoptions.lineplotselectedeval}] set visoptions.lineplotfile [lindex ${visoptions.evaluatefilenames} ${visoptions.lineplotselectedeval}]
} }
@ -308,31 +321,60 @@ proc lineplotdialog { } {
pack $w.filesettings.refresh pack $w.filesettings.refresh
frame $w.filesettings.using ttk::frame $w.filesettings.using
global visoptions.lineplotdatadescr global visoptions.lineplotdatadescr
tixOptionMenu $w.filesettings.using.xco -label "X-Coord:"\ # tixOptionMenu $w.filesettings.using.xco -label "X-Coord:"\
-options { # -options {
label.width 8 # label.width 8
label.anchor e # label.anchor e
menubutton.width 15 # menubutton.width 15
} # }
for { set i 0 } { $i < [llength ${visoptions.lineplotdatadescr}] } { incr i } { # for { set i 0 } { $i < [llength ${visoptions.lineplotdatadescr}] } { incr i } {
$w.filesettings.using.xco add command $i -label [lindex ${visoptions.lineplotdatadescr} $i] # $w.filesettings.using.xco add command $i -label [lindex ${visoptions.lineplotdatadescr} $i]
} # }
$w.filesettings.using.xco config -variable visoptions.lineplotusingx
tixOptionMenu $w.filesettings.using.yco -label "Y-Coord:"\ ttk::frame $w.filesettings.using.xco
-options { ttk::label $w.filesettings.using.xco.lab -text "X-Coord:"
label.width 8 ttk::menubutton $w.filesettings.using.xco.but -menu $w.filesettings.using.xco.menu -text "" -width 15
label.anchor e
menubutton.width 15 menu $w.filesettings.using.xco.menu -tearoff 0
} for {set i 0} {$i < [llength ${visoptions.lineplotdatadescr}]} {incr i} {
for { set i 0 } { $i < [llength ${visoptions.lineplotdatadescr}] } { incr i } { $w.filesettings.using.xco.menu add command -label [lindex ${visoptions.lineplotdatadescr} $i]\
$w.filesettings.using.yco add command $i -label [lindex ${visoptions.lineplotdatadescr} $i] -command "set visoptions.lineplotusingx $i ; $w.filesettings.using.xco.but configure -text \"[lindex ${visoptions.lineplotdatadescr} $i]\""
} }
$w.filesettings.using.yco config -variable visoptions.lineplotusingy $w.filesettings.using.xco.menu invoke [lindex ${visoptions.lineplotdatadescr} 0]
grid $w.filesettings.using.xco.lab $w.filesettings.using.xco.but -sticky nw
#pack $w.filesettings.using.xco
# $w.filesettings.using.xco config -variable visoptions.lineplotusingx
# tixOptionMenu $w.filesettings.using.yco -label "Y-Coord:"\
# -options {
# label.width 8
# label.anchor e
# menubutton.width 15
# }
# for { set i 0 } { $i < [llength ${visoptions.lineplotdatadescr}] } { incr i } {
# $w.filesettings.using.yco add command $i -label [lindex ${visoptions.lineplotdatadescr} $i]
# }
# $w.filesettings.using.yco config -variable visoptions.lineplotusingy
ttk::frame $w.filesettings.using.yco
ttk::label $w.filesettings.using.yco.lab -text "Y-Coord:"
ttk::menubutton $w.filesettings.using.yco.but -menu $w.filesettings.using.yco.menu -text "" -width 15
menu $w.filesettings.using.yco.menu -tearoff 0
for {set i 0} {$i < [llength ${visoptions.lineplotdatadescr}]} {incr i} {
$w.filesettings.using.yco.menu add command -label [lindex ${visoptions.lineplotdatadescr} $i]\
-command "set visoptions.lineplotusingy $i ; $w.filesettings.using.yco.but configure -text \"[lindex ${visoptions.lineplotdatadescr} $i]\""
}
$w.filesettings.using.yco.menu invoke [lindex ${visoptions.lineplotdatadescr} 0]
grid $w.filesettings.using.yco.lab $w.filesettings.using.yco.but -sticky nw
global visoptions.lineplotxcoordselector global visoptions.lineplotxcoordselector
global visoptions.lineplotycoordselector global visoptions.lineplotycoordselector
@ -351,85 +393,132 @@ proc lineplotdialog { } {
ttk::frame $w.settings.minmax ttk::frame $w.settings.minmax
ttk::checkbutton $w.settings.minmax.autoscale -text "Autoscale" -variable visoptions.lineplotautoscale ttk::checkbutton $w.settings.minmax.autoscale -text "Autoscale" -variable visoptions.lineplotautoscale
tixControl $w.settings.minmax.xmin -label "Min. x: " \ # tixControl $w.settings.minmax.xmin -label "Min. x: " \
-integer false -variable visoptions.lineplotxmin \ # -integer false -variable visoptions.lineplotxmin \
-options { # -options {
entry.width 6 # entry.width 6
label.width 8 # label.width 8
label.anchor e # label.anchor e
} # }
tixControl $w.settings.minmax.xmax -label "Max. x: " \ ttk::frame $w.settings.minmax.xmin
-integer false -variable visoptions.lineplotxmax \ ttk::label $w.settings.minmax.xmin.label -text "Min. x: "
-options { ttk::spinbox $w.settings.minmax.xmin.sp -textvariable visoptions.lineplotxmin -width 6 -increment 0.1 -validate focus -validatecommand "my_validatespinbox %W %P 3" \
entry.width 6 -invalidcommand "my_invalidspinbox %W" -from -1e9 -to 1e9
label.width 8
label.anchor e
}
tixControl $w.settings.minmax.ymin -label "Min. y: " \
-integer false -variable visoptions.lineplotymin \
-options {
entry.width 6
label.width 8
label.anchor e
}
tixControl $w.settings.minmax.ymax -label "Max. y: " \
-integer false -variable visoptions.lineplotymax \
-options {
entry.width 6
label.width 8
label.anchor e
}
# tixControl $w.settings.minmax.xmax -label "Max. x: " \
# -integer false -variable visoptions.lineplotxmax \
# -options {
# entry.width 6
# label.width 8
# label.anchor e
# }
ttk::frame $w.settings.minmax.xmax
ttk::label $w.settings.minmax.xmax.label -text "Max. x: "
ttk::spinbox $w.settings.minmax.xmax.sp -textvariable visoptions.lineplotxmax -width 6 -increment 0.1 -validate focus -validatecommand "my_validatespinbox %W %P 3" \
-invalidcommand "my_invalidspinbox %W" -from -1e9 -to 1e9
# tixControl $w.settings.minmax.ymin -label "Min. y: " \
# -integer false -variable visoptions.lineplotymin \
# -options {
# entry.width 6
# label.width 8
# label.anchor e
# }
ttk::frame $w.settings.minmax.ymin
ttk::label $w.settings.minmax.ymin.label -text "Min. y: "
ttk::spinbox $w.settings.minmax.ymin.sp -textvariable visoptions.lineplotymin -width 6 -increment 0.1 -validate focus -validatecommand "my_validatespinbox %W %P 3" \
-invalidcommand "my_invalidspinbox %W" -from -1e9 -to 1e9
# tixControl $w.settings.minmax.ymax -label "Max. y: " \
# -integer false -variable visoptions.lineplotymax \
# -options {
# entry.width 6
# label.width 8
# label.anchor e
# }
ttk::frame $w.settings.minmax.ymax
ttk::label $w.settings.minmax.ymax.label -text "Max. y: "
ttk::spinbox $w.settings.minmax.ymax.sp -textvariable visoptions.lineplotymax -width 6 -increment 0.1 -validate focus -validatecommand "my_validatespinbox %W %P 3" \
-invalidcommand "my_invalidspinbox %W" -from -1e9 -to 1e9
pack $w.settings.minmax.xmin.label $w.settings.minmax.xmin.sp
pack $w.settings.minmax.xmax.label $w.settings.minmax.xmax.sp
pack $w.settings.minmax.ymin.label $w.settings.minmax.ymin.sp
pack $w.settings.minmax.ymax.label $w.settings.minmax.ymax.sp
pack $w.settings.minmax.autoscale $w.settings.minmax.xmin $w.settings.minmax.xmax \ pack $w.settings.minmax.autoscale $w.settings.minmax.xmin $w.settings.minmax.xmax \
$w.settings.minmax.ymin $w.settings.minmax.ymax -side left $w.settings.minmax.ymin $w.settings.minmax.ymax -side left
pack $w.settings.minmax pack $w.settings.minmax
label $w.settings.empty1 -text "" ttk::label $w.settings.empty1 -text ""
pack $w.settings.empty1 pack $w.settings.empty1
frame $w.settings.plotsize ttk::frame $w.settings.plotsize
tixControl $w.settings.plotsize.xsize -label "Plotsize x: "\ # tixControl $w.settings.plotsize.xsize -label "Plotsize x: "\
-integer true -variable visoptions.lineplotsizex \ # -integer true -variable visoptions.lineplotsizex \
-options { # -options {
entry.width 6 # entry.width 6
label.width 13 # label.width 13
label.anchor e # label.anchor e
} # }
tixControl $w.settings.plotsize.ysize -label "y: "\
-integer true -variable visoptions.lineplotsizey \ ttk::frame $w.settings.plotsize.xsize
-options { ttk::label $w.settings.plotsize.xsize.label -text "Plotsize x: "
entry.width 6 ttk::spinbox $w.settings.plotsize.xsize.sp -textvariable visoptions.lineplotsizex -width 6 -increment 1 -validate focus -validatecommand "my_validatespinbox %W %P 0" \
label.width 3 -invalidcommand "my_invalidspinbox %W" -from -1e9 -to 1e9
label.anchor e pack $w.settings.plotsize.xsize.label $w.settings.plotsize.xsize.sp
}
# tixControl $w.settings.plotsize.ysize -label "y: "\
# -integer true -variable visoptions.lineplotsizey \
# -options {
# entry.width 6
# label.width 3
# label.anchor e
# }
ttk::frame $w.settings.plotsize.ysize
ttk::label $w.settings.plotsize.ysize.label -text "Plotsize y: "
ttk::spinbox $w.settings.plotsize.ysize.sp -textvariable visoptions.lineplotsizey -width 6 -increment 1 -validate focus -validatecommand "my_validatespinbox %W %P 0" \
-invalidcommand "my_invalidspinbox %W" -from -1e9 -to 1e9
pack $w.settings.plotsize.ysize.label $w.settings.plotsize.ysize.sp
pack $w.settings.plotsize.xsize $w.settings.plotsize.ysize -side left pack $w.settings.plotsize.xsize $w.settings.plotsize.ysize -side left
pack $w.settings.plotsize pack $w.settings.plotsize
label $w.settings.empty2 -text "" ttk::label $w.settings.empty2 -text ""
pack $w.settings.empty2 pack $w.settings.empty2
# tixOptionMenu $w.settings.color -label "Linecolor: " \
# -options {
# label.width 19
# label.anchor e
# menubutton.width 15
# }
# foreach step { red black blue green yellow } {
# $w.settings.color add command $step -label $step
# }
# $w.settings.color config -variable visoptions.lineplotcolor
ttk::frame $w.settings.color
ttk::label $w.settings.color.lab -text "Linecolor: "
ttk::menubutton $w.settings.color.but -menu $w.settings.color.menu -text "" -width 15
tixOptionMenu $w.settings.color -label "Linecolor: " \ menu $w.settings.color.menu -tearoff 0
-options {
label.width 19
label.anchor e
menubutton.width 15
}
foreach step { red black blue green yellow } { foreach step { red black blue green yellow } {
$w.settings.color add command $step -label $step $w.settings.color.menu add command -label $step -command "set visoptions.lineplotcolor $step; $w.settings.color.but configure -text \"$step\""
} }
$w.settings.color config -variable visoptions.lineplotcolor # for {set i 0} {$i < [llength ${visoptions.lineplotdatadescr}]} {incr i} {
# $w.filesettings.using.yco.menu add command -label [lindex ${visoptions.lineplotdatadescr} $i]\
# -command "set visoptions.lineplotusingy $i ; $w.filesettings.using.yco.but configure -text \"[lindex ${visoptions.lineplotdatadescr} $i]\""
# }
$w.settings.color.menu invoke "red"
grid $w.settings.color.lab $w.settings.color.but -sticky nw
pack $w.settings.color pack $w.settings.color
pack $w.settings pack $w.settings -fill x
set datax "" set datax ""
set datay "" set datay ""
@ -438,24 +527,33 @@ proc lineplotdialog { } {
set ymin 0 set ymin 0
set ymax 0 set ymax 0
frame $w.plots -relief groove -borderwidth 3 ttk::frame $w.plots -relief groove -borderwidth 3
tixOptionMenu $w.plots.selplot -label "Selected Plot: " \ # tixOptionMenu $w.plots.selplot -label "Selected Plot: " \
-options { # -options {
label.width 19 # label.width 19
label.anchor e # label.anchor e
menubutton.width 15 # menubutton.width 15
} # }
$w.plots.selplot add command none -label "None" # $w.plots.selplot add command none -label "None"
$w.plots.selplot config -variable visoptions.lineplotselected # $w.plots.selplot config -variable visoptions.lineplotselected
ttk::frame $w.plots.selplot
ttk::label $w.plots.selplot.lab -text "Linecolor: "
ttk::menubutton $w.plots.selplot.but -menu $w.plots.selplot.menu -text "" -width 15
menu $w.plots.selplot.menu -tearoff 0
$w.plots.selplot.menu add command -label "None" -command "set visoptions.lineplotselected \"None\"; $w.plots.selplot.but configure -text \"None\""
grid $w.plots.selplot.lab $w.plots.selplot.but -sticky nw
$w.plots.selplot.menu invoke "None"
global visoptions.lineplotselector global visoptions.lineplotselector
set visoptions.lineplotselector $w.plots.selplot set visoptions.lineplotselector $w.plots.selplot.menu
button $w.plots.new -text "Generate New Plot" -command { ttk::button $w.plots.new -text "Generate New Plot" -command {
if { ${visoptions.lineplotselectedeval} != 0} { if { ${visoptions.lineplotselectedeval} != 0} {
set visoptions.lineplotfile [lindex ${visoptions.evaluatefilenames} ${visoptions.lineplotselectedeval}] set visoptions.lineplotfile [lindex ${visoptions.evaluatefilenames} ${visoptions.lineplotselectedeval}]
} }
@ -491,7 +589,7 @@ proc lineplotdialog { } {
addplotline $ident $datax $datay $plotinfo ${visoptions.lineplotcolor} addplotline $ident $datax $datay $plotinfo ${visoptions.lineplotcolor}
} }
button $w.plots.addto -text "Add to Selected Plot" -command { ttk::button $w.plots.addto -text "Add to Selected Plot" -command {
if { ${visoptions.lineplotselectedeval} != 0} { if { ${visoptions.lineplotselectedeval} != 0} {
set visoptions.lineplotfile [lindex ${visoptions.evaluatefilenames} ${visoptions.lineplotselectedeval}] set visoptions.lineplotfile [lindex ${visoptions.evaluatefilenames} ${visoptions.lineplotselectedeval}]
} }
@ -516,7 +614,7 @@ proc lineplotdialog { } {
button $w.close -text "Close" -command "destroy $w" ttk::button $w.close -text "Close" -command "destroy $w"
pack $w.close pack $w.close
wm withdraw $w wm withdraw $w
@ -629,26 +727,43 @@ proc fieldlinesdialog { } {
tixOptionMenu $f.vecfun -label "Vector Function: " \ # tixOptionMenu $f.vecfun -label "Vector Function: " \
-options { # -options {
label.width 18 # label.width 18
label.anchor e # label.anchor e
menubutton.width 12 # menubutton.width 12
} # }
$f.vecfun add command none -label None # $f.vecfun add command none -label None
for { set i 1 } { $i <= [Ng_Vis_Field getnfieldnames] } { incr i } { # for { set i 1 } { $i <= [Ng_Vis_Field getnfieldnames] } { incr i } {
set fname [Ng_Vis_Field getfieldname $i] # set fname [Ng_Vis_Field getfieldname $i]
set fcomp [Ng_Vis_Field getfieldcomponents $i] # set fcomp [Ng_Vis_Field getfieldcomponents $i]
set iscomplex [Ng_Vis_Field iscomplex $i] # set iscomplex [Ng_Vis_Field iscomplex $i]
set sdim [Ng_Vis_Field getdimension] # set sdim [Ng_Vis_Field getdimension]
if { $iscomplex == 1 } { set fcomp [expr $fcomp / 2] } # if { $iscomplex == 1 } { set fcomp [expr $fcomp / 2] }
if { ($fcomp == $sdim) || ($fcomp == 3) } { # if { ($fcomp == $sdim) || ($fcomp == 3) } {
$f.vecfun add command $fname -label $fname # $f.vecfun add command $fname -label $fname
} # }
} # }
$f.vecfun configure -variable visoptions.fieldlinesvecfunction # $f.vecfun configure -variable visoptions.fieldlinesvecfunction
$f.vecfun configure -command { Ng_Vis_Set parameters; redraw } # $f.vecfun configure -command { Ng_Vis_Set parameters; redraw }
ttk::frame $f.vecfun
ttk::label $f.vecfun.lab -text "Vector Function: "
ttk::menubutton $f.vecfun.but -menu $f.vecfun.menu -text "" -width 12
menu $f.vecfun.menu -tearoff 0
# for {set i 0} {$i < [llength ${visoptions.evaluatefilenames}]} {incr i} {
# $w.filesettings.latestevals.menu add command -label $i\
# -command "set visoptions.lineplotselectedeval $i ; $w.filesettings.latestevals.but configure -text \"[lindex ${visoptions.evaluatefiledescriptions} $i] ([lindex ${visoptions.evaluatefilenames} $i])\""
# }
for { set i 1 } { $i <= [Ng_Vis_Field getnfieldnames] } { incr i } {
set fname [Ng_Vis_Field getfieldname $i]
set fcomp [Ng_Vis_Field getfieldcomponents $i]
set iscomplex [Ng_Vis_Field iscomplex $i]
set sdim [Ng_Vis_Field getdimension]
if { $iscomplex == 1 } { set fcomp [expr $fcomp / 2] }
if { ($fcomp == $sdim) || ($fcomp == 3) } {
$f.vecfun.menu add command -label $fname -command "set visoptions.fieldlinesvecfunction $fname;Ng_Vis_Set parameters; redraw;$f.vecfun.but configure -text \"$fname\" " }
}
grid $f.vecfun.lab $f.vecfun.but -sticky nw
pack $f.vecfun pack $f.vecfun
@ -660,12 +775,20 @@ proc fieldlinesdialog { } {
ttk::frame $f.phasesettings ttk::frame $f.phasesettings
ttk::checkbutton $f.phasesettings.onephase -text "Fix Phase" -variable visoptions.fieldlinesonlyonephase ttk::checkbutton $f.phasesettings.onephase -text "Fix Phase" -variable visoptions.fieldlinesonlyonephase
scale $f.phasesettings.phase -orient horizontal -length 300 -from 0 -to 360 \ # scale $f.phasesettings.phase -orient horizontal -length 300 -from 0 -to 360 \
-label "phi" \ # -label "phi" \
-resolution 1 \ # -resolution 1 \
-variable visoptions.fieldlinesphase \ # -variable visoptions.fieldlinesphase \
-command { popupcheckredraw3 fieldlinesdialog_pop1 } # -command { popupcheckredraw3 fieldlinesdialog_pop1 }
ttk::frame $f.phasesettings.phase
ttk::label $f.phasesettings.phase.lab -text "phi"
ttk::scale $f.phasesettings.phase.sc -orient horizontal -length 100 -from 0 -to 360 -variable visoptions.fieldlinesphase \
-command "roundscale $f.phasesettings.phase.sc 0; popupcheckredraw3 fieldlinesdialog_pop1"
ttk::entry $f.phasesettings.phase.ent -width 4 -textvariable visoptions.fieldlinesphase -validate focus -takefocus 0 \
-validatecommand "popupcheckredraw3 fieldlinesdialog_pop1;my_validate %W 0 1 %P 0" \
-invalidcommand "my_invalid %W;popupcheckredraw3 fieldlinesdialog_pop1"
grid $f.phasesettings.phase.lab $f.phasesettings.phase.sc $f.phasesettings.phase.ent -sticky nw -ipadx 4
pack $f.phasesettings.onephase $f.phasesettings.phase -side left pack $f.phasesettings.onephase $f.phasesettings.phase -side left
pack $f.phasesettings pack $f.phasesettings
@ -782,31 +905,49 @@ proc fieldlinesdialog { } {
set g $w.nb.settings set g $w.nb.settings
frame $g.linesettings -relief groove -borderwidth 3 ttk::frame $g.linesettings -relief groove -borderwidth 3
label $g.linesettings.title -text "\nLine Settings\n" ttk::label $g.linesettings.title -text "\nLine Settings\n"
tixControl $g.linesettings.length -label "rel. Length: " -integer false \ # tixControl $g.linesettings.length -label "rel. Length: " -integer false \
-variable visoptions.fieldlineslength -min 0.00001 -max 10000 -step 0.1 \ # -variable visoptions.fieldlineslength -min 0.00001 -max 10000 -step 0.1 \
-options { # -options {
entry.width 6 # entry.width 6
label.width 25 # label.width 25
label.anchor e # label.anchor e
} # }
tixControl $g.linesettings.maxpoints -label "max. Points: " -integer true \ ttk::frame $g.linesettings.length
-variable visoptions.fieldlinesmaxpoints -min 0 -max 10000 -step 1 \ ttk::label $g.linesettings.length.lab -text "rel. Length: "
-options { ttk::spinbox $g.linesettings.length.sp -textvariable visoptions.fieldlineslength -width 6 -increment 0.1 -validate focus -validatecommand "my_validatespinbox %W %P 5" \
entry.width 6 -invalidcommand "my_invalidspinbox %W" -from 0.00001 -to 10000
label.width 25 grid $g.linesettings.length.lab $g.linesettings.length.sp -sticky nw
label.anchor e
}
tixControl $g.linesettings.thick -label "rel. Thickness: " -integer false \ # tixControl $g.linesettings.maxpoints -label "max. Points: " -integer true \
-variable visoptions.fieldlinesthickness -min 1e-10 -max 0.5 -step 0.001 \ # -variable visoptions.fieldlinesmaxpoints -min 0 -max 10000 -step 1 \
-options { # -options {
entry.width 6 # entry.width 6
label.width 25 # label.width 25
label.anchor e # label.anchor e
} # }
ttk::frame $g.linesettings.maxpoints
ttk::label $g.linesettings.maxpoints.lab -text "max. Points: "
ttk::spinbox $g.linesettings.maxpoints.sp -textvariable visoptions.fieldlinesmaxpoints -width 6 -increment 1 -validate focus -validatecommand "my_validatespinbox %W %P 0" \
-invalidcommand "my_invalidspinbox %W" -from 0 -to 10000
grid $g.linesettings.maxpoints.lab $g.linesettings.maxpoints.sp -sticky nw
# tixControl $g.linesettings.thick -label "rel. Thickness: " -integer false \
# -variable visoptions.fieldlinesthickness -min 1e-10 -max 0.5 -step 0.001 \
# -options {
# entry.width 6
# label.width 25
# label.anchor e
# }
ttk::frame $g.linesettings.thick
ttk::label $g.linesettings.thick.lab -text "rel. Thickness: "
ttk::spinbox $g.linesettings.thick.sp -textvariable visoptions.fieldlinesthickness -width 6 -increment 0.001 -validate focus -validatecommand "my_validatespinbox %W %P 6" \
-invalidcommand "my_invalidspinbox %W" -from 1e-10 -to 0.5
grid $g.linesettings.thick.lab $g.linesettings.thick.sp -stick nw
pack $g.linesettings.title $g.linesettings.length $g.linesettings.maxpoints $g.linesettings.thick pack $g.linesettings.title $g.linesettings.length $g.linesettings.maxpoints $g.linesettings.thick
@ -818,29 +959,46 @@ proc fieldlinesdialog { } {
global visoptions.fieldlinestolerance global visoptions.fieldlinestolerance
frame $g.odesettings -relief groove -borderwidth 3 ttk::frame $g.odesettings -relief groove -borderwidth 3
label $g.odesettings.title -text "\nODE Settings\n" ttk::label $g.odesettings.title -text "\nODE Settings\n"
tixControl $g.odesettings.tol -label "rel. Tolerance: " -integer false \ # tixControl $g.odesettings.tol -label "rel. Tolerance: " -integer false \
-variable visoptions.fieldlinestolerance -min 0.00001 -max 1 -step 0.01 \ # -variable visoptions.fieldlinestolerance -min 0.00001 -max 1 -step 0.01 \
-options { # -options {
entry.width 6 # entry.width 6
label.width 25 # label.width 25
label.anchor e # label.anchor e
} # }
ttk::frame $g.odesettings.tol
ttk::label $g.odesettings.tol.lab -text "rel. Thickness: "
ttk::spinbox $g.odesettings.tol.sp -textvariable visoptions.fieldlinestolerance -width 6 -increment 0.01 -validate focus -validatecommand "my_validatespinbox %W %P 5" \
-invalidcommand "my_invalidspinbox %W" -from 0.00001 -to 1
grid $g.odesettings.tol.lab $g.odesettings.tol.sp -stick nw
tixOptionMenu $g.odesettings.rktype -label "RK-Type " \ # tixOptionMenu $g.odesettings.rktype -label "RK-Type " \
-options { # -options {
label.width 20 # label.width 20
label.anchor e # label.anchor e
menubutton.width 25 # menubutton.width 25
} # }
$g.odesettings.rktype add command euler -label "Euler, order 1" # $g.odesettings.rktype add command euler -label "Euler, order 1"
$g.odesettings.rktype add command eulercauchy -label "Euler-Cauchy, order 2" # $g.odesettings.rktype add command eulercauchy -label "Euler-Cauchy, order 2"
$g.odesettings.rktype add command simpson -label "Simpson, order 3" # $g.odesettings.rktype add command simpson -label "Simpson, order 3"
$g.odesettings.rktype add command crungekutta -label "classical Runge-Kutta, order 4" # $g.odesettings.rktype add command crungekutta -label "classical Runge-Kutta, order 4"
$g.odesettings.rktype configure -variable visoptions.fieldlinesrktype # $g.odesettings.rktype configure -variable visoptions.fieldlinesrktype
$g.odesettings.rktype configure -command { Ng_Vis_Set parameters; redraw } # $g.odesettings.rktype configure -command { Ng_Vis_Set parameters; redraw }
ttk::frame $g.odesettings.rktype
ttk::label $g.odesettings.rktype.lab -text "RK-Type "
ttk::menubutton $g.odesettings.rktype.but -menu $g.odesettings.rktype.menu -text "" -width 25
menu $g.odesettings.rktype.menu -tearoff 0
$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\" "
$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\" "
$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\""
$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\""
$g.odesettings.rktype.menu invoke "classical Runge-Kutta, order 4"
grid $g.odesettings.rktype.lab $g.odesettings.rktype.but -sticky nw
pack $g.odesettings.title $g.odesettings.tol $g.odesettings.rktype pack $g.odesettings.title $g.odesettings.tol $g.odesettings.rktype
@ -873,8 +1031,16 @@ proc fieldlinesdialog { } {
} { } {
toplevel .fieldlines_help toplevel .fieldlines_help
tixScrolledText .fieldlines_help.ht -scrollbar y set f [frame .fieldlines_help.ht]
set text .fieldlines_help.ht.text #ttk::scrollbar $f.hsb -orient horizontal -command [list $f.t xview]
ttk::scrollbar $f.vsb -orient vertical -command [list $f.t yview]
text $f.t -yscrollcommand [list $f.vsb set]
grid $f.t -row 0 -column 0 -sticky nsew
grid $f.vsb -row 0 -column 1 -sticky nsew
grid columnconfigure $f 0 -weight 1
grid rowconfigure $f 0 -weight 1
#tixScrolledText .fieldlines_help.ht -scrollbar y
set text $f.t
$text configure -setgrid true -wrap word $text configure -setgrid true -wrap word
@ -1496,177 +1662,177 @@ proc visual_dialog { } {
proc reset_visual_dialog { } { # proc reset_visual_dialog { } {
set w .visoptions_dlg # set w .visoptions_dlg
if {[winfo exists .visoptions_dlg] == 1} { # if {[winfo exists .visoptions_dlg] == 1} {
destroy $w.scalfun $w.vecfun $w.evaluate $w.multidimcomp # destroy $w.scalfun $w.vecfun $w.evaluate $w.multidimcomp
destroy $w.imaginary $w.logscale $w.texframe.usetexture $w.texframe.lintexture # destroy $w.imaginary $w.logscale $w.texframe.usetexture $w.texframe.lintexture
destroy $w.texframe # destroy $w.texframe
destroy $w.invcolor $w.redrawperiodic # destroy $w.invcolor $w.redrawperiodic
destroy $w.bu -pady 5 # destroy $w.bu -pady 5
destroy $w.bu.showsol $w.bu.clipping $w.bu.fieldlines $w.bu.lineplot $w.bu.done -side left -expand yes # destroy $w.bu.showsol $w.bu.clipping $w.bu.fieldlines $w.bu.lineplot $w.bu.done -side left -expand yes
checkbutton $w.imaginary -text "Imaginary Part" \ # checkbutton $w.imaginary -text "Imaginary Part" \
-variable visoptions.imaginary \ # -variable visoptions.imaginary \
-command { Ng_Vis_Set parameters; redraw } # -command { Ng_Vis_Set parameters; redraw }
frame $w.texframe # frame $w.texframe
checkbutton $w.texframe.usetexture -text "Use Textures (" \ # checkbutton $w.texframe.usetexture -text "Use Textures (" \
-variable visoptions.usetexture \ # -variable visoptions.usetexture \
-command { Ng_Vis_Set parameters; redraw } # -command { Ng_Vis_Set parameters; redraw }
checkbutton $w.texframe.lintexture -text "Linear )" \ # checkbutton $w.texframe.lintexture -text "Linear )" \
-variable visoptions.lineartexture \ # -variable visoptions.lineartexture \
-command { Ng_Vis_Set parameters; redraw } # -command { Ng_Vis_Set parameters; redraw }
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" \ # checkbutton $w.logscale -text "Log Scale" \
-variable visoptions.logscale \ # -variable visoptions.logscale \
-command { Ng_Vis_Set parameters; redraw } # -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 {
redrawperiodic # redrawperiodic
Ng_Vis_Set parameters; # Ng_Vis_Set parameters;
redraw # redraw
} # }
tixOptionMenu $w.scalfun -label "Scalar Function: " \ # tixOptionMenu $w.scalfun -label "Scalar Function: " \
-options { # -options {
label.width 18 # label.width 18
label.anchor e # label.anchor e
menubutton.width 12 # menubutton.width 12
} # }
tixOptionMenu $w.vecfun -label "Vector Function: " \ # tixOptionMenu $w.vecfun -label "Vector Function: " \
-options { # -options {
label.width 18 # label.width 18
label.anchor e # label.anchor e
menubutton.width 12 # menubutton.width 12
} # }
$w.scalfun add command none -label None # $w.scalfun add command none -label None
for { set i 1 } { $i <= [Ng_Vis_Field getnfieldnames] } { incr i } { # for { set i 1 } { $i <= [Ng_Vis_Field getnfieldnames] } { incr i } {
set fname [Ng_Vis_Field getfieldname $i] # set fname [Ng_Vis_Field getfieldname $i]
set fcomp [Ng_Vis_Field getfieldcomponents $i] # set fcomp [Ng_Vis_Field getfieldcomponents $i]
if { $fcomp == 1 } { # if { $fcomp == 1 } {
$w.scalfun add command $fname.1 -label $fname # $w.scalfun add command $fname.1 -label $fname
} { # } {
for { set j 1 } { $j <= $fcomp } { incr j } { # for { set j 1 } { $j <= $fcomp } { incr j } {
$w.scalfun add command $fname.$j -label "$fname ($j)" # $w.scalfun add command $fname.$j -label "$fname ($j)"
} # }
$w.scalfun add command $fname.0 -label "func ($fname)" # $w.scalfun add command $fname.0 -label "func ($fname)"
} # }
} # }
$w.vecfun add command none -label None # $w.vecfun add command none -label None
for { set i 1 } { $i <= [Ng_Vis_Field getnfieldnames] } { incr i } { # for { set i 1 } { $i <= [Ng_Vis_Field getnfieldnames] } { incr i } {
set fname [Ng_Vis_Field getfieldname $i] # set fname [Ng_Vis_Field getfieldname $i]
set fcomp [Ng_Vis_Field getfieldcomponents $i] # set fcomp [Ng_Vis_Field getfieldcomponents $i]
set iscomplex [Ng_Vis_Field iscomplex $i] # set iscomplex [Ng_Vis_Field iscomplex $i]
set sdim [Ng_Vis_Field getdimension] # set sdim [Ng_Vis_Field getdimension]
if { $iscomplex == 1 } { set fcomp [expr $fcomp / 2] } # if { $iscomplex == 1 } { set fcomp [expr $fcomp / 2] }
if { ($fcomp == $sdim) || ($fcomp == 3) } { # if { ($fcomp == $sdim) || ($fcomp == 3) } {
$w.vecfun add command $fname -label $fname # $w.vecfun add command $fname -label $fname
} # }
} # }
$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}" # # puts "sclfunction = ${visoptions.scalfunction}"
tixOptionMenu $w.evaluate -label "Evaluate: " \ # tixOptionMenu $w.evaluate -label "Evaluate: " \
-options { # -options {
label.width 18 # label.width 18
label.anchor e # label.anchor e
menubutton.width 12 # menubutton.width 12
} # }
$w.evaluate add command abs -label "|.|" # $w.evaluate add command abs -label "|.|"
$w.evaluate add command abstens -label "|tensor|" # $w.evaluate add command abstens -label "|tensor|"
$w.evaluate add command mises -label "Mises" # $w.evaluate add command mises -label "Mises"
$w.evaluate add command main -label "Main" # $w.evaluate add command main -label "Main"
$w.evaluate configure -variable visoptions.evaluate # $w.evaluate configure -variable visoptions.evaluate
$w.evaluate configure -command { # $w.evaluate configure -command {
Ng_Vis_Set parameters; # Ng_Vis_Set parameters;
redraw # redraw
} # }
pack $w.scalfun $w.vecfun $w.evaluate # pack $w.scalfun $w.vecfun $w.evaluate
tixControl $w.multidimcomp -label "multidim-component: " -integer true \ # tixControl $w.multidimcomp -label "multidim-component: " -integer true \
-variable visoptions.multidimcomponent -min 0 \ # -variable visoptions.multidimcomponent -min 0 \
-command { Ng_Vis_Set parameters; redraw } \ # -command { Ng_Vis_Set parameters; redraw } \
-options { # -options {
entry.width 6 # entry.width 6
label.width 18 # label.width 18
label.anchor e # label.anchor e
} # }
pack $w.multidimcomp # pack $w.multidimcomp
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
button $w.bu.showsol -text "Show Solution" -command { # button $w.bu.showsol -text "Show Solution" -command {
set selectvisual solution # set selectvisual solution
Ng_SetVisParameters # Ng_SetVisParameters
redraw # redraw
} # }
button $w.bu.clipping -text "Clipping" -command { # button $w.bu.clipping -text "Clipping" -command {
clippingdialog; # clippingdialog;
} # }
button $w.bu.fieldlines -text "Fieldlines" -command { # button $w.bu.fieldlines -text "Fieldlines" -command {
fieldlinesdialog; # fieldlinesdialog;
} # }
button $w.bu.lineplot -text "2D Lineplot" -command { # button $w.bu.lineplot -text "2D Lineplot" -command {
lineplotdialog; # lineplotdialog;
} # }
button $w.bu.done -text "Close" -command { # button $w.bu.done -text "Close" -command {
destroy .visoptions_dlg # destroy .visoptions_dlg
} # }
pack $w.bu.showsol $w.bu.clipping $w.bu.fieldlines $w.bu.lineplot $w.bu.done -side left -expand yes # pack $w.bu.showsol $w.bu.clipping $w.bu.fieldlines $w.bu.lineplot $w.bu.done -side left -expand yes
wm withdraw $w # wm withdraw $w
wm deiconify $w # wm deiconify $w
} # }
} # }

View File

@ -39,7 +39,7 @@ proc occdialogbuildtree {} {
global entities global entities
set w .occ_dlg set w .occ_dlg
set hlist [$w.mtre subwidget hlist] #set hlist [$w.mtre subwidget hlist]
set entities [Ng_GetOCCData getentities] set entities [Ng_GetOCCData getentities]
set nrentities [expr [llength $entities]] set nrentities [expr [llength $entities]]
@ -47,57 +47,74 @@ proc occdialogbuildtree {} {
if {$nrentities != 0} { if {$nrentities != 0} {
$hlist add Topology -itemtype text -text "Topology" #$hlist add Topology -itemtype text -text "Topology"
$hlist add Topology/CompSolids -itemtype text -text "Composite Solids" -data "Composite Solids" #$hlist add Topology/CompSolids -itemtype text -text "Composite Solids" -data "Composite Solids"
$hlist add Topology/FreeSolids -itemtype text -text "Free Solids" -data "Free Solids" #$hlist add Topology/FreeSolids -itemtype text -text "Free Solids" -data "Free Solids"
$hlist add Topology/FreeShells -itemtype text -text "Free Shells" -data "Free Shells" #$hlist add Topology/FreeShells -itemtype text -text "Free Shells" -data "Free Shells"
$hlist add Topology/FreeFaces -itemtype text -text "Free Faces" -data "Free Faces" #$hlist add Topology/FreeFaces -itemtype text -text "Free Faces" -data "Free Faces"
$hlist add Topology/FreeWires -itemtype text -text "Free Wires" -data "Free Wires" #$hlist add Topology/FreeWires -itemtype text -text "Free Wires" -data "Free Wires"
$hlist add Topology/FreeEdges -itemtype text -text "Free Edges" -data "Free Edges" #$hlist add Topology/FreeEdges -itemtype text -text "Free Edges" -data "Free Edges"
$hlist add Topology/FreeVertices -itemtype text -text "Free Vertices" -data "Free Vertices" #$hlist add Topology/FreeVertices -itemtype text -text "Free Vertices" -data "Free Vertices"
$w.tree insert {Topology} end -id "CompSolids" -text "Composite Solids"
$w.tree insert {Topology} end -id "FreeSolids" -text "Free Solids"
$w.tree insert {Topology} end -id "FreeShells" -text "Free Shells"
$w.tree insert {Topology} end -id "FreeFaces" -text "Free Faces"
$w.tree insert {Topology} end -id "FreeWires" -text "Free Wires"
$w.tree insert {Topology} end -id "FreeEdges" -text "Free Edges"
$w.tree insert {Topology} end -id "FreeVertices" -text "Free Vertices"
# $hlist add SingularEntities -itemtype text -text "Entities marked as singular" # $hlist add SingularEntities -itemtype text -text "Entities marked as singular"
$w.tree item "Topology" -open true
set i [expr 0] set i [expr 0]
while {$i < $nrentities} { while {$i < $nrentities} {
set entity [lindex $entities [expr $i]] set entity [lindex $entities [expr $i]]
incr i 1 incr i 1
set entityname [lindex $entities [expr $i]] set entityname [lindex $entities [expr $i]]
$hlist add Topology/$entity -text $entityname -data $entityname #$hlist add Topology/$entity -text $entityname -data $entityname
set myroot [string range $entity 0 [string last / $entity]-1]
$w.tree insert $myroot end -id $entity -text $entityname -value 1
incr i 1 incr i 1
$w.mtre close Topology/$entity #$w.mtre close Topology/$entity
} }
$w.mtre autosetmode #$w.mtre autosetmode
$w.mtre open Topology #$w.mtre open Topology
$w.mtre close Topology/CompSolids #$w.mtre close Topology/CompSolids
$w.mtre close Topology/FreeSolids #$w.mtre close Topology/FreeSolids
$w.mtre close Topology/FreeShells #$w.mtre close Topology/FreeShells
$w.mtre close Topology/FreeFaces #$w.mtre close Topology/FreeFaces
$w.mtre close Topology/FreeWires #$w.mtre close Topology/FreeWires
$w.mtre close Topology/FreeEdges #$w.mtre close Topology/FreeEdges
$w.mtre close Topology/FreeVertices #$w.mtre close Topology/FreeVertices
set i [expr 0] set i [expr 0]
while {$i < $nrentities} { while {$i < $nrentities} {
set entity [lindex $entities [expr $i]] set entity [lindex $entities [expr $i]]
$w.mtre close Topology/$entity #$w.mtre close Topology/$entity
$w.tree item $entity -open false
incr i 2 incr i 2
} }
set faces [Ng_OCCCommand getunmeshedfaceinfo] set faces [Ng_OCCCommand getunmeshedfaceinfo]
set nrfaces [expr [llength $faces]] set nrfaces [expr [llength $faces]]
if {$nrfaces >= 2} { if {$nrfaces >= 2} {
$hlist add ErrorFaces -itemtype text -text "Faces with surface meshing error" #$hlist add ErrorFaces -itemtype text -text "Faces with surface meshing error"
$w.mtre open ErrorFaces $w.tree insert {} -id ErrorFaces -text "Faces with surface meshing error"
#$w.mtre open ErrorFaces
$w.tree item ErrorFaces -open true
set i [expr 0] set i [expr 0]
while {$i < $nrfaces} { while {$i < $nrfaces} {
set entity [lindex $faces [expr $i]] set entity [lindex $faces [expr $i]]
set myroot [string range $entity 0 [string last / $entity]-1]
if { [string length $myroot] == 0 } {
set myroot ErrorFaces
}
incr i 1 incr i 1
set entityname [lindex $faces [expr $i]] set entityname [lindex $faces [expr $i]]
$hlist add ErrorFaces/$entity -text $entityname -data $entityname #$hlist add ErrorFaces/$entity -text $entityname -data $entityname
$w.tree insert {myroot} end -id $entity -text $entityname -value 0
incr i 1 incr i 1
} }
} }
@ -106,20 +123,27 @@ proc occdialogbuildtree {} {
set faces [Ng_OCCCommand getnotdrawablefaces] set faces [Ng_OCCCommand getnotdrawablefaces]
set nrfaces [expr [llength $faces]] set nrfaces [expr [llength $faces]]
if {$nrfaces >= 2} { if {$nrfaces >= 2} {
$hlist add NotDrawableFaces -itemtype text -text "Faces impossible to visualize" #$hlist add NotDrawableFaces -itemtype text -text "Faces impossible to visualize"
$w.mtre open NotDrawableFaces $w.tree insert {} -id NotDrawableFaces -text "Faces impossible to visualize"
#$w.mtre open NotDrawableFaces
$w.tree item NotDrawableFaces -open true
set i [expr 0] set i [expr 0]
while {$i < $nrfaces} { while {$i < $nrfaces} {
set entity [lindex $faces [expr $i]] set entity [lindex $faces [expr $i]]
set myroot [string range $entity 0 [string last / $entity]-1]
if { [string length $myroot ] == 0 } {
set myroot NotDrawableFaces
}
incr i 1 incr i 1
set entityname [lindex $faces [expr $i]] set entityname [lindex $faces [expr $i]]
$hlist add NotDrawableFaces/$entity -text $entityname -data $entityname #$hlist add NotDrawableFaces/$entity -text $entityname -data $entityname
$w.tree insert $myroot end -id $entity -text $entityname -value 0
incr i 1 incr i 1
} }
} }
$w.mtre autosetmode #$w.mtre autosetmode
puts "done" puts "done"
} }
@ -128,7 +152,8 @@ proc occdialogbuildtree {} {
proc rebuildoccdialog {} { proc rebuildoccdialog {} {
if {[winfo exists .occ_dlg] == 1} { if {[winfo exists .occ_dlg] == 1} {
[.occ_dlg.mtre subwidget hlist] delete all .occ_dlg.tree delete [.occ_dlg.tree children Topology]
#[.occ_dlg.mtre subwidget hlist] delete all
occdialogbuildtree occdialogbuildtree
} }
} }
@ -152,27 +177,28 @@ proc selectentity { entityname } {
set i [expr 0] set i [expr 0]
while {$i < $nrentities} { while {$i < $nrentities} {
set entitylength [] set entitylength []
set entity2 [lindex $entities [expr $i]] set entity2 [lindex $entities [expr $i]]
incr i 1 incr i 1
set entityname2 [lindex $entities [expr $i]] set entityname2 [lindex $entities [expr $i]]
incr i 1 incr i 1
set entityname2 [string range $entityname2 0 [expr [string length $entityname]-1]] set entityname2 [string range $entityname2 0 [expr [string length $entityname]-1]]
if {$entityname == $entityname2} { if {$entityname == $entityname2} {
set hlist [.occ_dlg.mtre subwidget hlist] # #set hlist [.occ_dlg.mtre subwidget hlist]
.occ_dlg.mtre open Topology # #.occ_dlg.mtre open Topology
set slashpos [string last "/" $entity2] # .occ_dlg.tree item Topology -open true
set entity3 [string range $entity2 0 [expr $slashpos-1]] # puts $entity2
while {$slashpos != -1} { # set slashpos [string last "/" $entity2]
.occ_dlg.mtre open Topology/$entity3 # set entity3 [string range $entity2 0 [expr $slashpos-1]]
# while {$slashpos != -1} {
set slashpos [string last "/" $entity3] # #.occ_dlg.mtre open Topology/$entity3
set entity3 [string range $entity3 0 [expr $slashpos-1]] # .occ_dlg.tree item $entity3 -open true
} # puts $entity3
$hlist selection clear # set slashpos [string last "/" $entity3]
$hlist see Topology/$entity2 # set entity3 [string range $entity3 0 [expr $slashpos-1]]
$hlist selection set Topology/$entity2 # }
#$hlist selection clear
.occ_dlg.tree see $entity2
.occ_dlg.tree selection set $entity2
} }
} }
} }
@ -197,26 +223,17 @@ proc occdialog { } {
} { } {
toplevel $w toplevel $w
tixTree $w.mtre -options { separator "/" } ttk::treeview $w.tree
pack $w.mtre -fill both -expand yes $w.tree insert {} end -id "Topology" -text "Topology"
pack $w.tree -fill both -expand yes
occdialogbuildtree occdialogbuildtree
set hlist [$w.mtre subwidget hlist] bind $w.tree <Double-1> {
$hlist configure -selectforeground black set entityname [.occ_dlg.tree item [.occ_dlg.tree selection] -text ]
$hlist configure -selectbackground grey set rootname ""
if {[.occ_dlg.tree item [.occ_dlg.tree selection] -value] == 1 } {
set solname {""} set rootname "Topology"
}
bind $hlist <Double-1> {
set oldsolname {$solname}
set solname [[.occ_dlg.mtre subwidget hlist] info selection]
if {$solname != "" && $oldsolname != $solname } {
set seppos [string first "/" $solname]
set rootname [string range $solname 0 [expr $seppos-1]]
set entityname [[.occ_dlg.mtre subwidget hlist] info data $solname]
set spacepos [string first " " $entityname] set spacepos [string first " " $entityname]
set entitytype [string range $entityname 0 [expr $spacepos-1]] set entitytype [string range $entityname 0 [expr $spacepos-1]]
set helpstring [string range $entityname [expr $spacepos+1] [expr [string length $entityname]-1]] set helpstring [string range $entityname [expr $spacepos+1] [expr [string length $entityname]-1]]
@ -231,19 +248,15 @@ proc occdialog { } {
if {$brackpos != -1} { if {$brackpos != -1} {
set entityname [string range $entityname 0 $brackpos] set entityname [string range $entityname 0 $brackpos]
} }
selectentity $entityname selectentity $entityname
} }
} }
} ttk::button $w.cl -text "Close" -command {
button $w.cl -text "Close" -command {
destroy .occ_dlg destroy .occ_dlg
} }
button $w.show -text "Show" -command { ttk::button $w.show -text "Show" -command {
set solname [[.occ_dlg.mtre subwidget hlist] info selection] set entityname [.occ_dlg.tree item [.occ_dlg.tree selection] -text ]
set entityname [[.occ_dlg.mtre subwidget hlist] info data $solname]
set spacepos [string first " " $entityname] set spacepos [string first " " $entityname]
set entitytype [string range $entityname 0 [expr $spacepos-1]] set entitytype [string range $entityname 0 [expr $spacepos-1]]
set helpstring [string range $entityname [expr $spacepos+1] [expr [string length $entityname]-1]] set helpstring [string range $entityname [expr $spacepos+1] [expr [string length $entityname]-1]]
@ -255,9 +268,8 @@ proc occdialog { } {
# Ng_SetVisParameters # Ng_SetVisParameters
redraw redraw
} }
button $w.hide -text "Hide" -command { ttk::button $w.hide -text "Hide" -command {
set solname [[.occ_dlg.mtre subwidget hlist] info selection] set entityname [.occ_dlg.tree item [.occ_dlg.tree selection] -text ]
set entityname [[.occ_dlg.mtre subwidget hlist] info data $solname]
set spacepos [string first " " $entityname] set spacepos [string first " " $entityname]
set entitytype [string range $entityname 0 [expr $spacepos-1]] set entitytype [string range $entityname 0 [expr $spacepos-1]]
set helpstring [string range $entityname [expr $spacepos+1] [expr [string length $entityname]-1]] set helpstring [string range $entityname [expr $spacepos+1] [expr [string length $entityname]-1]]
@ -270,9 +282,8 @@ proc occdialog { } {
redraw redraw
} }
button $w.swaporientation -text "Swap orientation" -command { ttk::button $w.swaporientation -text "Swap orientation" -command {
set solname [[.occ_dlg.mtre subwidget hlist] info selection] set entityname [.occ_dlg.tree item [.occ_dlg.tree selection] -text ]
set entityname [[.occ_dlg.mtre subwidget hlist] info data $solname]
set spacepos [string first " " $entityname] set spacepos [string first " " $entityname]
set entitytype [string range $entityname 0 [expr $spacepos-1]] set entitytype [string range $entityname 0 [expr $spacepos-1]]
set helpstring [string range $entityname [expr $spacepos+1] [expr [string length $entityname]-1]] set helpstring [string range $entityname [expr $spacepos+1] [expr [string length $entityname]-1]]
@ -283,14 +294,13 @@ proc occdialog { } {
set selectvisual geometry set selectvisual geometry
# Ng_SetVisParameters # Ng_SetVisParameters
redraw redraw
.occ_dlg.tree delete [.occ_dlg.tree children Topology]
[.occ_dlg.mtre subwidget hlist] delete all #[.occ_dlg.mtre subwidget hlist] delete all
occdialogbuildtree occdialogbuildtree
} }
button $w.marksingular -text "Mark/Unmark as singular" -command { ttk::button $w.marksingular -text "Mark/Unmark as singular" -command {
set solname [[.occ_dlg.mtre subwidget hlist] info selection] set entityname [.occ_dlg.tree item [.occ_dlg.tree selection] -text ]
set entityname [[.occ_dlg.mtre subwidget hlist] info data $solname]
set spacepos [string first " " $entityname] set spacepos [string first " " $entityname]
if { $spacepos != 0 } { if { $spacepos != 0 } {
set entitytype [string range $entityname 0 [expr $spacepos-1]] set entitytype [string range $entityname 0 [expr $spacepos-1]]
@ -298,46 +308,23 @@ proc occdialog { } {
set spacepos2 [string first " " $helpstring] set spacepos2 [string first " " $helpstring]
if { $spacepos2 != 0 } { if { $spacepos2 != 0 } {
set entitynumber [string range $helpstring 0 [expr $spacepos2-1]] set entitynumber [string range $helpstring 0 [expr $spacepos2-1]]
puts $entitytype
puts $entitynumber
global ismarkedsingular global ismarkedsingular
Ng_OCCCommand marksingular $entitytype $entitynumber Ng_OCCCommand marksingular $entitytype $entitynumber
set hlist [$w.mtre subwidget hlist]
# $hlist entryconfigure $solname -text "hallo"
# set style1 [tixDisplayStyle imagetext -font 8x13]
set style1 [tixDisplayStyle imagetext -foreground black -background white -selectforeground white -selectbackground blue]
set style2 [tixDisplayStyle imagetext -foreground red -background white -selectforeground red -selectbackground blue]
if { $ismarkedsingular == 0 } { if { $ismarkedsingular == 0 } {
$hlist entryconfigure $solname -style $style1 .occ_dlg.tree tag remove "Color" [.occ_dlg.tree selection]
} { } {
$hlist entryconfigure $solname -style $style2 .occ_dlg.tree tag add "Color" [.occ_dlg.tree selection]
.occ_dlg.tree tag configure "Color" -foreground "red"
.occ_dlg.tree tag configure "Color" -background "blue"
} }
# set hlist [$w.mtre subwidget hlist]
# foreach solname2 $hlist {
# if { $ismarkedsingular == 0 } {
# $hlist entryconfigure $solname2 -style $style1
# } {
# $hlist entryconfigure $solname2 -style $style2
# }
# }
} }
} }
# $hlist add test -after $solname
# $hlist add SingularEntities/$entityname -text $entityname
# set selectvisual geometry
# Ng_SetVisParameters
# redraw
# [.occ_dlg.mtre subwidget hlist] delete all
# occdialogbuildtree
} }
ttk::checkbutton $w.zoomtohighlightedentity -text "Zoom to highlighted entity" \
checkbutton $w.zoomtohighlightedentity -text "Zoom to highlighted entity" \
-variable occoptions.zoomtohighlightedentity \ -variable occoptions.zoomtohighlightedentity \
-command { -command {
Ng_SetOCCVisParameters Ng_SetOCCVisParameters
@ -353,58 +340,70 @@ proc occdialog { } {
frame $w.healing -relief groove -borderwidth 3 ttk::frame $w.healing -relief groove -borderwidth 3
button $w.healing.checkentities -text "Analyze geometry" -command { ttk::button $w.healing.checkentities -text "Analyze geometry" -command {
set irregent [Ng_OCCCommand findsmallentities] set irregent [Ng_OCCCommand findsmallentities]
set w .occ_dlg set w .occ_dlg
set hlist [$w.mtre subwidget hlist]
$hlist add ProblematicEntities -text "Problematic Entities"
$hlist delete offsprings ProblematicEntities
set nritems [expr [llength $irregent]] set nritems [expr [llength $irregent]]
set i [expr 0] set i [expr 0]
if {$nritems > 0 } {
if { [.occ_dlg.tree exists ProblematicEntities] == 1 } {
$w.tree delete ProblematicEntities
}
$w.tree insert {} end -id ProblematicEntities -text "Problematic Entities"
}
while {$i < $nritems} { while {$i < $nritems} {
set entity [lindex $irregent [expr $i]] set entity [lindex $irregent [expr $i]]
incr i 1 incr i 1
set entityname [lindex $irregent [expr $i]] set entityname [lindex $irregent [expr $i]]
$hlist add ProblematicEntities/$entity -text $entityname -data $entityname #puts $entity
#puts $entityname
set myroot [string range $entity 0 [string last / $entity]-1]
if { [string length $myroot] == 0 } {
set myroot ProblematicEntities
}
$w.tree insert $myroot end -id $entity -text $entityname
incr i 1 incr i 1
} }
$w.mtre open ProblematicEntities $w.tree item ProblematicEntities -open true
$w.mtre autosetmode
} }
tixControl $w.healing.tolerance -label "Healing tolerance: " -integer false \ # tixControl $w.healing.tolerance -label "Healing tolerance: " -integer false \
-variable occoptions.tolerance -min 1e-9 -max 1e6 \ # -variable occoptions.tolerance -min 1e-9 -max 1e6 \
-options { # -options {
entry.width 6 # entry.width 6
label.width 25 # label.width 25
label.anchor e # label.anchor e
} # }
checkbutton $w.healing.fixsmalledges -text "Fix small edges" \ ttk::frame $w.healing.tolerance
ttk::label $w.healing.tolerance.label -text "Healing tolerance: "
ttk::spinbox $w.healing.tolerance.sp -textvariable occoptions.tolerance -width 6 -increment 0.01 -validate focus -validatecommand "my_validatespinbox %W %P 12" \
-invalidcommand "my_invalidspinbox %W" -from -1e-9 -to 1e6
grid $w.healing.tolerance.label $w.healing.tolerance.sp
ttk::checkbutton $w.healing.fixsmalledges -text "Fix small edges" \
-variable occoptions.fixsmalledges -variable occoptions.fixsmalledges
checkbutton $w.healing.fixspotstripfaces -text "Fix spot/strip faces" \ ttk::checkbutton $w.healing.fixspotstripfaces -text "Fix spot/strip faces" \
-variable occoptions.fixspotstripfaces -variable occoptions.fixspotstripfaces
checkbutton $w.healing.sewfaces -text "Sew faces" \ ttk::checkbutton $w.healing.sewfaces -text "Sew faces" \
-variable occoptions.sewfaces -variable occoptions.sewfaces
checkbutton $w.healing.makesolids -text "Make solids" \ ttk::checkbutton $w.healing.makesolids -text "Make solids" \
-variable occoptions.makesolids -variable occoptions.makesolids
checkbutton $w.healing.splitpartitions -text "Split partitions" \ ttk::checkbutton $w.healing.splitpartitions -text "Split partitions" \
-variable occoptions.splitpartitions -variable occoptions.splitpartitions
button $w.healing.heal -text "Heal geometry" -command { ttk::button $w.healing.heal -text "Heal geometry" -command {
.occ_dlg.healing.tolerance invoke #.occ_dlg.healing.tolerance.sp invoke
Ng_OCCCommand shapehealing Ng_OCCCommand shapehealing
redraw redraw
[.occ_dlg.mtre subwidget hlist] delete all .occ_dlg.tree delete [.occ_dlg.tree children Topology]
#[.occ_dlg.mtre subwidget hlist] delete all
occdialogbuildtree occdialogbuildtree
} }

View File

@ -166,16 +166,18 @@ void ParallelRun()
" , h = ", XDisplayHeight (display, 0)); " , h = ", XDisplayHeight (display, 0));
*/ */
Window win;
int wx, wy;
unsigned int ww, wh, bw, depth;
// cout << "got drawable: " << curDrawable << endl;
XGetGeometry(display, curDrawable, &win,
&wx, &wy, &ww, &wh,
&bw, &depth);
/* /*
Window win;
int wx, wy;
unsigned int ww, wh, bw, depth;
cout << "got drawable: " << curDrawable << ", contextid: " << contextid << endl;
cout << "get geometriy..." << endl;
XGetGeometry(display, curDrawable, &win,
&wx, &wy, &ww, &wh,
&bw, &depth);
cout << "have!" << endl;
cout << "P" << id << ": window-props: x = " << wx << ", y = " << wy cout << "P" << id << ": window-props: x = " << wx << ", y = " << wy
<< ", w = " << ww << ", h = " << wh << ", depth = " << depth << endl; << ", w = " << ww << ", h = " << wh << ", depth = " << depth << endl;
*/ */
@ -183,6 +185,8 @@ void ParallelRun()
#define VISUAL #define VISUAL
#ifdef VISUAL #ifdef VISUAL
#ifdef VISINFO_OLD
//this does not seem to work anymore (but might still be with togl1.7?)
// make a new GLXContext // make a new GLXContext
// first, generate a visual (copied from togl) // first, generate a visual (copied from togl)
@ -224,16 +228,19 @@ void ParallelRun()
visinfo = glXChooseVisual(display, 0, visinfo = glXChooseVisual(display, 0,
attrib_list); attrib_list);
cout << "have vis?" << endl;
if (visinfo) { if (visinfo) {
/* found a GLX visual! */ /* found a GLX visual! */
// cout << "found VISINFO !!!" << endl; // cout << "found VISINFO !!!" << endl;
cout << "found VISINFO !!!" << endl;
/* /*
int hi = 0; int hi = 0;
std::cout << "attribs = "; std::cout << "attribs = ";
while (attrib_list[hi] != None) while (attrib_list[hi] != None)
std::cout << attrib_list[hi++] << " "; std::cout << attrib_list[hi++] << " ";
std::cout << std::endl; std::cout << std::endl;
*/ */
break; break;
@ -242,10 +249,26 @@ void ParallelRun()
if (!visinfo) if (!visinfo)
cerr << "no VISINFO found" << endl; cerr << "no VISINFO found" << endl;
#else
//get all possible confs
int nconfs;
auto cptr = glXGetFBConfigs (display,0, &nconfs);
Array<int> conf_ids(nconfs);
for(int k=0;k<nconfs;k++)
glXGetFBConfigAttrib(display, cptr[k], GLX_FBCONFIG_ID, &(conf_ids[k]));
//get drawable->FBConfig->visual
unsigned int d_fbc_id;
glXQueryDrawable( display, curDrawable, GLX_FBCONFIG_ID, &d_fbc_id);
GLXFBConfig d_fbc;
for(int k=0;k<nconfs;k++)
if(d_fbc_id==conf_ids[k])
d_fbc = cptr[k];
visinfo = glXGetVisualFromFBConfig(display,d_fbc);
#endif
// context = glXCreateContext( display, visinfo, 0, /* curContext, */ False ); // context = glXCreateContext( display, visinfo, 0, /* curContext, */ False );
context = glXCreateContext( display, visinfo, glXImportContextEXT ( display, contextid ), False); context = glXCreateContext( display, visinfo, glXImportContextEXT ( display, contextid ), False);
// cout << "context = " << context << endl;
glXMakeCurrent (display, curDrawable, context); glXMakeCurrent (display, curDrawable, context);
@ -255,11 +278,9 @@ void ParallelRun()
context = glXImportContextEXT ( display, contextid ); context = glXImportContextEXT ( display, contextid );
PrintMessage (1, "GLX-contextid = " , contextid, PrintMessage (1, "GLX-contextid = " , contextid,
" imported context ", context); " imported context ", context);
glXMakeCurrent (display, curDrawable, context); glXMakeCurrent (display, curDrawable, context);
#endif #endif
@ -283,7 +304,6 @@ void ParallelRun()
vsmesh.BuildFilledList (false); vsmesh.BuildFilledList (false);
} }
if (redraw_cmd == "solsurfellist") if (redraw_cmd == "solsurfellist")
{ {
vssolution.DrawSurfaceElements(); vssolution.DrawSurfaceElements();

View File

@ -33,24 +33,24 @@ proc clientsocketdialog { } {
global sockets.serverhost global sockets.serverhost
global sockets.serverport global sockets.serverport
frame $w.general ttk::frame $w.general
frame $w.host ttk::frame $w.host
label $w.host.lab -text "Serverhost: " ttk::label $w.host.lab -text "Serverhost: "
entry $w.host.name -width 30 -relief sunken -textvariable sockets.serverhost ttk::entry $w.host.name -width 30 -textvariable sockets.serverhost
pack $w.host.lab $w.host.name -side left pack $w.host.lab $w.host.name -side left
pack $w.host pack $w.host
frame $w.ports ttk::frame $w.ports
label $w.ports.lab1 -text "Serverport: " ttk::label $w.ports.lab1 -text "Serverport: "
entry $w.ports.statport -width 6 -relief sunken -textvariable sockets.serverport ttk::entry $w.ports.statport -width 6 -textvariable sockets.serverport
pack $w.ports.lab1 $w.ports.statport -side left pack $w.ports.lab1 $w.ports.statport -side left
pack $w.ports pack $w.ports
frame $w.listboxes ttk::frame $w.listboxes
frame $w.listboxes.choosesocketframe ttk::frame $w.listboxes.choosesocketframe
tixScrolledListBox $w.listboxes.choosesocketframe.choosesocket -scrollbar auto tixScrolledListBox $w.listboxes.choosesocketframe.choosesocket -scrollbar auto
@ -62,21 +62,21 @@ proc clientsocketdialog { } {
${sockets.serverlistbox} configure -selectmode browse ${sockets.serverlistbox} configure -selectmode browse
${sockets.serverlistbox} configure -exportselection false ${sockets.serverlistbox} configure -exportselection false
button $w.addserver -text "Add ServerSocket" -command { ttk::button $w.addserver -text "Add ServerSocket" -command {
Ng_Socket addserver ${sockets.serverport} ${sockets.serverhost} Ng_Socket addserver ${sockets.serverport} ${sockets.serverhost}
updateserverlist updateserverlist
} }
pack $w.addserver pack $w.addserver
label $w.linefeed -text "\n" ttk::label $w.linefeed -text "\n"
pack $w.linefeed pack $w.linefeed
frame $w.clientidframe ttk::frame $w.clientidframe
label $w.clientidframe.lab -text "Client ID: "; ttk::label $w.clientidframe.lab -text "Client ID: ";
global sockets.myidlabel global sockets.myidlabel
entry $w.clientidframe.val -width 5 -relief sunken -textvariable sockets.myidlabel ttk::entry $w.clientidframe.val -width 5 -textvariable sockets.myidlabel
button $w.clientidframe.but -text "Set" -command { ttk::button $w.clientidframe.but -text "Set" -command {
set opsel [${sockets.serverlistbox} curselection] set opsel [${sockets.serverlistbox} curselection]
if {[llength $opsel] > 0} { if {[llength $opsel] > 0} {
set opserver [lindex $opsel 0] set opserver [lindex $opsel 0]
@ -95,13 +95,13 @@ proc clientsocketdialog { } {
# pack $w.clientidlabel # pack $w.clientidlabel
label $w.listboxes.choosesocketframe.chooselab -text [format "\n\n%-16s %6s %6s " Host Socket MyID ] ttk::label $w.listboxes.choosesocketframe.chooselab -text [format "\n\n%-16s %6s %6s " Host Socket MyID ]
pack $w.listboxes.choosesocketframe.chooselab pack $w.listboxes.choosesocketframe.chooselab
pack $w.listboxes.choosesocketframe.choosesocket pack $w.listboxes.choosesocketframe.choosesocket
frame $w.listboxes.choosesocketframe.serverbuttons ttk::frame $w.listboxes.choosesocketframe.serverbuttons
button $w.listboxes.choosesocketframe.serverbuttons.save -text "Save" -command { ttk::button $w.listboxes.choosesocketframe.serverbuttons.save -text "Save" -command {
Ng_Socket saveserverlist Ng_Socket saveserverlist
} }
@ -109,7 +109,7 @@ proc clientsocketdialog { } {
Ng_Socket loadserverlist Ng_Socket loadserverlist
updateserverlist updateserverlist
button $w.listboxes.choosesocketframe.serverbuttons.delete -text "Delete" -command { ttk::button $w.listboxes.choosesocketframe.serverbuttons.delete -text "Delete" -command {
set opsel [${sockets.serverlistbox} curselection] set opsel [${sockets.serverlistbox} curselection]
if {[llength $opsel] > 0} { if {[llength $opsel] > 0} {
Ng_Socket deletesocket [lindex $opsel 0] Ng_Socket deletesocket [lindex $opsel 0]
@ -120,17 +120,17 @@ proc clientsocketdialog { } {
pack $w.listboxes.choosesocketframe.serverbuttons.save $w.listboxes.choosesocketframe.serverbuttons.delete -side left pack $w.listboxes.choosesocketframe.serverbuttons.save $w.listboxes.choosesocketframe.serverbuttons.delete -side left
pack $w.listboxes.choosesocketframe.serverbuttons pack $w.listboxes.choosesocketframe.serverbuttons
frame $w.listboxes.statusframe ttk::frame $w.listboxes.statusframe
label $w.listboxes.statusframe.statuslabel1 -text "\n\njobqueue" ttk::label $w.listboxes.statusframe.statuslabel1 -text "\n\njobqueue"
tixScrolledListBox $w.listboxes.statusframe.queuestatus -scrollbar auto tixScrolledListBox $w.listboxes.statusframe.queuestatus -scrollbar auto
label $w.listboxes.statusframe.statuslabel2 -text "\ncurrent job" ttk::label $w.listboxes.statusframe.statuslabel2 -text "\ncurrent job"
tixScrolledListBox $w.listboxes.statusframe.currentjobstatus -scrollbar auto tixScrolledListBox $w.listboxes.statusframe.currentjobstatus -scrollbar auto
label $w.listboxes.statusframe.statuslabel3 -text "\nanswers" ttk::label $w.listboxes.statusframe.statuslabel3 -text "\nanswers"
tixScrolledListBox $w.listboxes.statusframe.answers -scrollbar auto tixScrolledListBox $w.listboxes.statusframe.answers -scrollbar auto
@ -157,7 +157,7 @@ proc clientsocketdialog { } {
${sockets.answerlistbox} configure -selectmode browse ${sockets.answerlistbox} configure -selectmode browse
${sockets.answerlistbox} configure -exportselection false ${sockets.answerlistbox} configure -exportselection false
button $w.listboxes.statusframe.updatebutton -text "Update" -command { ttk::button $w.listboxes.statusframe.updatebutton -text "Update" -command {
set opsel [${sockets.serverlistbox} curselection] set opsel [${sockets.serverlistbox} curselection]
if {[llength $opsel] > 0} { if {[llength $opsel] > 0} {
set opserver [lindex $opsel 0] set opserver [lindex $opsel 0]
@ -199,14 +199,14 @@ proc clientsocketdialog { } {
pack $w.listboxes pack $w.listboxes
label $w.lab1 -text "\n" ttk::label $w.lab1 -text "\n"
pack $w.lab1 pack $w.lab1
frame $w.buttons1 ttk::frame $w.buttons1
frame $w.buttons2 ttk::frame $w.buttons2
button $w.buttons1.getid -text "Get ID" -command { ttk::button $w.buttons1.getid -text "Get ID" -command {
set opsel [${sockets.serverlistbox} curselection] set opsel [${sockets.serverlistbox} curselection]
if {[llength $opsel] > 0} { if {[llength $opsel] > 0} {
set opserver [lindex $opsel 0] set opserver [lindex $opsel 0]
@ -216,7 +216,7 @@ proc clientsocketdialog { } {
} }
} }
button $w.buttons1.killjob -text "Kill Cur. Job" -command { ttk::button $w.buttons1.killjob -text "Kill Cur. Job" -command {
set opsel [${sockets.serverlistbox} curselection] set opsel [${sockets.serverlistbox} curselection]
if {[llength $opsel] > 0} { if {[llength $opsel] > 0} {
set opserver [lindex $opsel 0] set opserver [lindex $opsel 0]
@ -224,7 +224,7 @@ proc clientsocketdialog { } {
} }
} }
button $w.buttons2.sendmesh -text "Send Mesh" -command { ttk::button $w.buttons2.sendmesh -text "Send Mesh" -command {
set opsel [${sockets.serverlistbox} curselection] set opsel [${sockets.serverlistbox} curselection]
if {[llength $opsel] > 0} { if {[llength $opsel] > 0} {
set opserver [lindex $opsel 0] set opserver [lindex $opsel 0]
@ -233,7 +233,7 @@ proc clientsocketdialog { } {
} }
} }
button $w.buttons2.sendpde -text "Send PDE" -command { ttk::button $w.buttons2.sendpde -text "Send PDE" -command {
set opsel [${sockets.serverlistbox} curselection] set opsel [${sockets.serverlistbox} curselection]
if {[llength $opsel] > 0} { if {[llength $opsel] > 0} {
set opserver [lindex $opsel 0] set opserver [lindex $opsel 0]
@ -241,7 +241,7 @@ proc clientsocketdialog { } {
} }
} }
button $w.buttons2.solvepde -text "Solve PDE" -command { ttk::button $w.buttons2.solvepde -text "Solve PDE" -command {
set opsel [${sockets.serverlistbox} curselection] set opsel [${sockets.serverlistbox} curselection]
if {[llength $opsel] > 0} { if {[llength $opsel] > 0} {
set opserver [lindex $opsel 0] set opserver [lindex $opsel 0]
@ -249,7 +249,7 @@ proc clientsocketdialog { } {
} }
} }
button $w.buttons2.writesol -text "Write Solution" -command { ttk::button $w.buttons2.writesol -text "Write Solution" -command {
set opsel [${sockets.serverlistbox} curselection] set opsel [${sockets.serverlistbox} curselection]
if {[llength $opsel] > 0} { if {[llength $opsel] > 0} {
set opserver [lindex $opsel 0] set opserver [lindex $opsel 0]
@ -257,7 +257,7 @@ proc clientsocketdialog { } {
} }
} }
button $w.buttons2.sendsol -text "Receive Solution" -command { ttk::button $w.buttons2.sendsol -text "Receive Solution" -command {
set opsel [${sockets.serverlistbox} curselection] set opsel [${sockets.serverlistbox} curselection]
if {[llength $opsel] > 0} { if {[llength $opsel] > 0} {
set opserver [lindex $opsel 0] set opserver [lindex $opsel 0]
@ -265,7 +265,7 @@ proc clientsocketdialog { } {
} }
} }
button $w.buttons1.blockserver -text "Block Server" -command { ttk::button $w.buttons1.blockserver -text "Block Server" -command {
set opsel [${sockets.serverlistbox} curselection] set opsel [${sockets.serverlistbox} curselection]
if {[llength $opsel] > 0} { if {[llength $opsel] > 0} {
set opserver [lindex $opsel 0] set opserver [lindex $opsel 0]
@ -273,7 +273,7 @@ proc clientsocketdialog { } {
} }
} }
button $w.buttons1.unblockserver -text "UnBlock Server" -command { ttk::button $w.buttons1.unblockserver -text "UnBlock Server" -command {
set opsel [${sockets.serverlistbox} curselection] set opsel [${sockets.serverlistbox} curselection]
if {[llength $opsel] > 0} { if {[llength $opsel] > 0} {
set opserver [lindex $opsel 0] set opserver [lindex $opsel 0]
@ -299,5 +299,5 @@ proc clientsocketdialog { } {
} }
.ngmenu.special add command -label "Client Socket" \ #.ngmenu.special add command -label "Client Socket" \
-command { clientsocketdialog } -command { clientsocketdialog }