# $Id: iso.tcl,v 1.1 2007/03/02 16:56:15 akohlmey Exp akohlmey $ # Display settings display projection Orthographic display nearclip set 0.000000 display farclip set 10.000000 display depthcue off # store the molecule id for later use set updmol [mol new {02.cube} type cube waitfor all] mol addfile {03.cube} type cube waitfor all mol addfile {04.cube} type cube waitfor all mol addfile {05.cube} type cube waitfor all mol addfile {06.cube} type cube waitfor all mol addfile {07.cube} type cube waitfor all mol addfile {08.cube} type cube waitfor all mol addfile {09.cube} type cube waitfor all mol addfile {10.cube} type cube waitfor all mol addfile {11.cube} type cube waitfor all mol addfile {12.cube} type cube waitfor all mol addfile {13.cube} type cube waitfor all mol addfile {14.cube} type cube waitfor all mol addfile {15.cube} type cube waitfor all mol addfile {16.cube} type cube waitfor all mol addfile {17.cube} type cube waitfor all mol addfile {27.cube} type cube waitfor all mol addfile {37.cube} type cube waitfor all mol addfile {47.cube} type cube waitfor all mol addfile {49.cube} type cube waitfor all # Representation 0: The molecule mol delrep 0 top mol representation licorice mol material Opaque mol color Name mol selection {all} mol addrep top # Representation 1: Positive isosurface mol material Transparent mol color ColorID 0 mol representation Isosurface 0.02 0.0 0.0 0.0 mol selection {all} mol addrep top # Representation 2: Negative isosurface mol color ColorID 1 mol representation Isosurface -0.02 0.0 0.0 0.0 mol selection {all} mol addrep top set updrep1 [mol repname top 1] set updrep2 [mol repname top 2] mol rename top {test} # use the volumetric data set for the isosurface corresponding to the frame. # $updmol contains the id of the molecule and $updrep the (unique) name of # the isosurface representation # proc update_iso {args} { global updmol global updrep1 global updrep2 # get representation id and return if invalid set repid1 [mol repindex $updmol $updrep1] if {$repid1 < 0} { return } set repid2 [mol repindex $updmol $updrep2] if {$repid2 < 0} { return } # update representation but replace the data set # id with the current frame number. set frame [molinfo $updmol get frame] lassign [molinfo $updmol get "{rep $repid1}"] rep mol material Transparent mol color colorid 0 mol representation [lreplace $rep 2 2 $frame] mol modrep $repid1 $updmol lassign [molinfo $updmol get "{rep $repid2}"] rep mol material Transparent mol color colorid 1 mol representation [lreplace $rep 2 2 $frame] mol modrep $repid2 $updmol } trace variable vmd_frame($updmol) w update_iso animate goto 0