version 1.5 | version 1.6 |
---|
| |
set z $zarg | set z $zarg |
| |
set flip_priority_axis $flip | set flip_priority_axis $flip |
| |
set I [Orient::calc_principalaxes $x $y $z] | set I [Orient::calc_principalaxes $x $y $z] |
set ::NeuronVND::princ_axes $I | set ::NeuronVND::princ_axes $I |
| |
| |
set a2 [lindex $I 1] | set a2 [lindex $I 1] |
set a3 [lindex $I 2] | set a3 [lindex $I 2] |
| |
# find the size of the system #Haky vnd way | |
set xmin [tcl::mathfunc::min {*}$xarg] | set xmin [tcl::mathfunc::min {*}$xarg] |
set ymin [tcl::mathfunc::min {*}$yarg] | set ymin [tcl::mathfunc::min {*}$yarg] |
set zmin [tcl::mathfunc::min {*}$zarg] | set zmin [tcl::mathfunc::min {*}$zarg] |
| |
| |
set minT [list $xmin $ymin $zmin] | set minT [list $xmin $ymin $zmin] |
set maxT [list $xmax $ymax $zmax] | set maxT [list $xmax $ymax $zmax] |
| |
#dict lappend minmax $minT | |
#dict lappend minmax $maxT | |
| |
#puts "MINIMAX$minmax" | |
#set minmax [measure minmax $sel] remove because VMD only | |
#set ranges [vecsub [lindex $minmax 1] [lindex $minmax 0]] | |
set ranges [vecsub $maxT $minT] | set ranges [vecsub $maxT $minT] |
# puts "ranges = $ranges" | |
set scale [expr .7*[Orient::max [lindex $ranges 0] \ | set scale [expr .7*[Orient::max [lindex $ranges 0] \ |
[lindex $ranges 1] \ | [lindex $ranges 1] \ |
[lindex $ranges 2]]] | [lindex $ranges 2]]] |
set ::NeuronVND::princ_axes_scale $scale | set ::NeuronVND::princ_axes_scale $scale |
set scale2 [expr 1.02 * $scale] | set scale2 [expr 1.02 * $scale] |
| set ::NeuronVND::scale $scale |
| |
# draw some nice vectors | # draw some nice vectors |
#graphics $mol delete all | #graphics $mol delete all |
graphics $mol color red | |
set COM [Orient::sel_com $x $y $z] | set COM [Orient::sel_com $x $y $z] |
set ::NeuronVND::princ_axes_com $COM | set ::NeuronVND::princ_axes_com $COM |
vmd_draw_vector $mol $COM [vecscale $scale $a1] | |
graphics $mol color green | |
vmd_draw_vector $mol $COM [vecscale $scale $a2] | |
| |
graphics $mol color 24 | |
#Biological Constraint Check to See if We have to Flip the Axis for 3D Reconstruction | #Biological Constraint Check to See if We have to Flip the Axis for 3D Reconstruction |
set ::NeuronVND::priority_axis $a3 | set ::NeuronVND::priority_axis $a3 |
| |
if {$flip_priority_axis == 1} { | if {$flip_priority_axis == 1} { |
#set $a3 [vecscale -1 $a3] | |
set flippy -1 | set flippy -1 |
set text "1" | set text "1*" |
| set text2 "2*" |
| set text3 "3*" |
} else { | } else { |
set flippy 1 | set flippy 1 |
set text "1" | set text "1" |
| set text2 "2" |
| set text3 "3" |
} | } |
| graphics $mol color red |
| vmd_draw_vector $mol $COM [vecscale [expr $flippy * $scale] $a1] |
| graphics $mol color green |
| vmd_draw_vector $mol $COM [vecscale [expr $flippy * $scale] $a2] |
| graphics $mol color 24 |
vmd_draw_vector $mol $COM [vecscale [expr $flippy * $scale] $a3] | vmd_draw_vector $mol $COM [vecscale [expr $flippy * $scale] $a3] |
| |
| |
| set ::NeuronVND::scale $scale |
#setup data and order ascending | #setup data and order ascending |
#a1 is x, a2 is z, a3 is y | #a1 is x, a2 is z, a3 is y |
graphics $mol color white | graphics $mol color white |
graphics $mol text [vecadd $COM [vecscale $scale2 $a1]] "3" | graphics $mol text [vecadd $COM [vecscale [expr $flippy * $scale2] $a1]] "$text3" |
graphics $mol text [vecadd $COM [vecscale $scale2 $a2]] "2" | graphics $mol text [vecadd $COM [vecscale [expr $flippy * $scale2] $a2]] "$text2" |
graphics $mol text [vecadd $COM [vecscale [expr $flippy * $scale2] $a3]] "$text" | graphics $mol text [vecadd $COM [vecscale [expr $flippy * $scale2] $a3]] "$text" |
set paxis [list $a1 $a2 $a3] | set paxis [list $a1 $a2 $a3] |
return $paxis | return $paxis |
| |
set a3 "[lindex $I 5] [lindex $I 8] [lindex $I 11]" | set a3 "[lindex $I 5] [lindex $I 8] [lindex $I 11]" |
set calculated_axis [list $a1 $a2 $a3] | set calculated_axis [list $a1 $a2 $a3] |
| |
| set xmin [tcl::mathfunc::min {*}$x] |
| set ymin [tcl::mathfunc::min {*}$y] |
| set zmin [tcl::mathfunc::min {*}$z] |
| |
| set xmax [tcl::mathfunc::max {*}$x] |
| set ymax [tcl::mathfunc::max {*}$y] |
| set zmax [tcl::mathfunc::max {*}$z] |
| |
| set minT [list $xmin $ymin $zmin] |
| set maxT [list $xmax $ymax $zmax] |
| set ranges [vecsub $maxT $minT] |
| set scale [expr .7*[Orient::max [lindex $ranges 0] \ |
| [lindex $ranges 1] \ |
| [lindex $ranges 2]]] |
| set ::NeuronVND::princ_axes_scale $scale |
| |
set ::NeuronVND::priority_axis $a3 | set ::NeuronVND::priority_axis $a3 |
| set ::NeuronVND::scale $scale |
return $::Orient::calculated_axis | return $::Orient::calculated_axis |
} | } |
| |