Changeset 644


Ignore:
Timestamp:
Mar 28, 2007, 11:45:13 AM (18 years ago)
Author:
nkissebe
Message:

sequence.tcl,sequenceresult.tcl: add support for molecule structure sequences

Location:
trunk/gui/scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/sequence.tcl

    r567 r644  
    6969                    set obj [Rappture::Image ::#auto $xmlobj $path.$name.$cname]
    7070                }
     71                structure {
     72                    # extract unique result set prefix
     73                    scan $xmlobj "::libraryObj%d" rset
     74
     75                    # object rooted at x.sequence(y).element(z).structure
     76                    set obj [$xmlobj element -as object $path.$name.$cname]
     77
     78                    # scene id (sequence id)
     79                    set sceneid [$xmlobj element -as id $path]-$rset
     80
     81                    # sequence/element/frame number starting at 1
     82                    set frameid [expr [$xmlobj element -as id $path.$name] + 1]
     83
     84                    # only supporting one molecule per structure at the moment
     85                    # otherwise should go through all children that are molecules
     86                    # and insert scene/frame data.
     87                    $obj put "components.molecule.state" $frameid
     88                    $obj put "components.molecule.model" $sceneid
     89                }
    7190                default {
    7291                    error "don't know how to handle sequences of $type"
  • trunk/gui/scripts/sequenceresult.tcl

    r513 r644  
    429429                pack $viewer -expand yes -fill both
    430430            }
     431            ::Rappture::LibraryObj {
     432                switch -- [$dataobj element -as type] {
     433                    structure {
     434                        Rappture::DeviceResult $viewer
     435                        pack $viewer -expand yes -fill both
     436                    }
     437                    default {
     438                        error "don't know how to view sequences of [$dataobj element -as type]"
     439                    }
     440                }
     441            }
    431442            default {
    432443                error "don't know how to view sequences of $type"
Note: See TracChangeset for help on using the changeset viewer.