[0b990d] | 1 | #!@WISH@
|
---|
| 2 |
|
---|
| 3 | wm title . "MolRender"
|
---|
| 4 |
|
---|
| 5 | set level 3
|
---|
| 6 | set model "ball"
|
---|
| 7 | set inputoption "-keyval"
|
---|
| 8 | set inputfile "molrender.in"
|
---|
| 9 | set keyvalkey "molecule"
|
---|
| 10 |
|
---|
| 11 | proc make_inputoption { w } {
|
---|
| 12 | frame $w.frame -borderwidth 10
|
---|
| 13 | label $w.label -text "Input File Type"
|
---|
| 14 | pack $w.label $w.frame -side top -pady 2
|
---|
| 15 | radiobutton $w.frame.pdb -text "PDB File" -variable inputoption -value "-pdb" -relief flat
|
---|
| 16 | radiobutton $w.frame.keyval -text "KeyVal File" -variable inputoption -value "-keyval" -relief flat
|
---|
| 17 | pack $w.frame.pdb $w.frame.keyval -side top -pady 2 -expand yes -fill both
|
---|
| 18 | }
|
---|
| 19 |
|
---|
| 20 | proc make_model { w } {
|
---|
| 21 | frame $w.frame -borderwidth 10
|
---|
| 22 | label $w.label -text "Model"
|
---|
| 23 | pack $w.label $w.frame -side top -pady 2
|
---|
| 24 | radiobutton $w.frame.ball -text "Ball" -variable model -value "ball" -relief flat
|
---|
| 25 | radiobutton $w.frame.stick -text "Stick" -variable model -value "stick" -relief flat
|
---|
| 26 | radiobutton $w.frame.connolly -text "Connolly" -variable model -value "connolly" -relief flat
|
---|
| 27 | pack $w.frame.ball $w.frame.stick $w.frame.connolly -side top -pady 2 -expand yes -fill both
|
---|
| 28 | }
|
---|
| 29 |
|
---|
| 30 | proc make_level { w } {
|
---|
| 31 | frame $w.frame -borderwidth 10
|
---|
| 32 | label $w.label -text "Sphere Subdivision Level"
|
---|
| 33 | pack $w.label $w.frame -side top -pady 2
|
---|
| 34 | radiobutton $w.frame.a -text "1" -variable level -value 1 -relief flat
|
---|
| 35 | radiobutton $w.frame.b -text "2" -variable level -value 2 -relief flat
|
---|
| 36 | radiobutton $w.frame.c -text "3" -variable level -value 3 -relief flat
|
---|
| 37 | radiobutton $w.frame.d -text "4" -variable level -value 4 -relief flat
|
---|
| 38 | radiobutton $w.frame.e -text "5" -variable level -value 5 -relief flat
|
---|
| 39 | pack $w.frame.a $w.frame.b $w.frame.c $w.frame.d $w.frame.e -side top -pady 2 -expand yes -fill both
|
---|
| 40 | }
|
---|
| 41 |
|
---|
| 42 | proc render {} {
|
---|
| 43 | global model inputoption inputfile level keyvalkey
|
---|
| 44 | #puts stdout "molrender -quiet -model $model -keyword $keyvalkey $inputoption $inputfile -level $level"
|
---|
| 45 | set result [exec @prefix@/bin/molrender -quiet -render oogl -model $model -keyword $keyvalkey $inputoption $inputfile -level $level]
|
---|
| 46 | #puts stdout "(geometry $model $result)"
|
---|
| 47 | flush stdout
|
---|
| 48 | }
|
---|
| 49 |
|
---|
| 50 | proc clear {} {
|
---|
| 51 | #puts stdout "(geometry ball {})"
|
---|
| 52 | #puts stdout "(geometry stick {})"
|
---|
| 53 | #puts stdout "(geometry connolly {})"
|
---|
| 54 | #flush stdout
|
---|
| 55 | }
|
---|
| 56 |
|
---|
| 57 | proc done {} {
|
---|
| 58 | destroy .
|
---|
| 59 | }
|
---|
| 60 |
|
---|
| 61 | frame .inputarea
|
---|
| 62 | frame .inputarea.inputoption
|
---|
| 63 | frame .inputarea.model
|
---|
| 64 | frame .inputarea.level
|
---|
| 65 | make_inputoption .inputarea.inputoption
|
---|
| 66 | make_model .inputarea.model
|
---|
| 67 | make_level .inputarea.level
|
---|
| 68 |
|
---|
| 69 | frame .inputfile
|
---|
| 70 | label .inputfile.label -text "Input File:"
|
---|
| 71 | entry .inputfile.entry -relief sunken -textvariable inputfile
|
---|
| 72 | pack .inputfile.label .inputfile.entry -side left -expand yes -fill both
|
---|
| 73 |
|
---|
| 74 | frame .keyvalkey
|
---|
| 75 | label .keyvalkey.label -text "Keyword:"
|
---|
| 76 | entry .keyvalkey.entry -relief sunken -textvariable keyvalkey
|
---|
| 77 | pack .keyvalkey.label .keyvalkey.entry -side left -expand yes -fill both
|
---|
| 78 |
|
---|
| 79 | frame .buttons
|
---|
| 80 | button .buttons.render -text "Render" -command render
|
---|
| 81 | button .buttons.clear -text "Clear" -command clear
|
---|
| 82 | button .buttons.done -text "Done" -command done
|
---|
| 83 | pack .buttons.render .buttons.clear .buttons.done -side left -padx 2 -expand yes -fill both
|
---|
| 84 | pack .inputarea.inputoption .inputarea.model .inputarea.level -side left -padx 2 -expand yes -fill both
|
---|
| 85 | pack .inputarea .inputfile .keyvalkey .buttons -side top -pady 2
|
---|
| 86 |
|
---|
| 87 | clear
|
---|