Changeset 4415


Ignore:
Timestamp:
Jun 23, 2014 2:29:28 PM (10 years ago)
Author:
ldelgass
Message:

Since drawing object doesn't parse VTK files, it doesn't know what the bounds
are, so remove limits method.

File:
1 edited

Legend:

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

    r4414 r4415  
    22
    33# ----------------------------------------------------------------------
    4 #  COMPONENT: drawing - 2D drawing of data
     4#  COMPONENT: drawing - 3D drawing of data
    55# ======================================================================
    66#  AUTHOR:  Michael McLennan, Purdue University
     
    2020    private variable _drawing
    2121    private variable _xmlobj
    22     private variable _actors
    2322    private variable _styles
    2423    private variable _shapes
     
    2827    private variable _hints
    2928    private variable _units
    30     private variable _limits
    3129
    3230    constructor {xmlobj path} {
     
    3634        # defined below
    3735    }
    38     public method limits {axis}
     36
    3937    public method label { elem }
    4038    public method type { elem }
     
    237235
    238236# ----------------------------------------------------------------------
    239 # method limits <axis>
    240 #       Returns a list {min max} representing the limits for the
    241 #       specified axis.
    242 # ----------------------------------------------------------------------
    243 itcl::body Rappture::Drawing::limits {which} {
    244     set min ""
    245     set max ""
    246     foreach key [array names _data] {
    247         set actor $_actors($key)
    248         foreach key { xMin xMax yMin yMax zMin zMax} value [$actor GetBounds] {
    249             set _limits($key) $value
    250         }
    251         break
    252     }   
    253    
    254     foreach key [array names _actors] {
    255         set actor $_actors($key)
    256         foreach { xMin xMax yMin yMax zMin zMax} [$actor GetBounds] break
    257         if { $xMin < $_limits(xMin) } {
    258             set _limits(xMin) $xMin
    259         }
    260         if { $xMax > $_limits(xMax) } {
    261             set _limits(xMax) $xMax
    262         }
    263         if { $yMin < $_limits(yMin) } {
    264             set _limits(yMin) $yMin
    265         }
    266         if { $yMax > $_limits(yMax) } {
    267             set _limits(yMax) $yMax
    268         }
    269         if { $zMin < $_limits(zMin) } {
    270             set _limits(zMin) $zMin
    271         }
    272         if { $zMax > $_limits(zMax) } {
    273             set _limits(zMax) $zMax
    274         }
    275     }
    276     switch -- $which {
    277         x {
    278             set min $_limits(xMin)
    279             set max $_limits(xMax)
    280             set axis "xaxis"
    281         }
    282         y {
    283             set min $_limits(yMin)
    284             set max $_limits(yMax)
    285             set axis "yaxis"
    286         }
    287         v - z {
    288             set min $_limits(zMin)
    289             set max $_limits(zMax)
    290             set axis "zaxis"
    291         }
    292         default {
    293             error "unknown axis description \"$which\""
    294         }
    295     }
    296     return [list $min $max]
    297 }
    298 
    299 # ----------------------------------------------------------------------
    300237# USAGE: hints ?<keyword>?
    301238#
     
    327264    return [array get _hints]
    328265}
    329 
Note: See TracChangeset for help on using the changeset viewer.