Changeset 3288 for branches


Ignore:
Timestamp:
Feb 8, 2013 2:20:22 PM (11 years ago)
Author:
gah
Message:

make placeholder for isosurface viewer

Location:
branches/Rappture 1.2/gui/scripts
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • branches/Rappture 1.2/gui/scripts/Makefile.in

    r3246 r3288  
    133133                $(srcdir)/visviewer.tcl \
    134134                $(srcdir)/vtkviewer.tcl \
    135                 $(srcdir)/vtkcontourviewer.tcl \
     135                $(srcdir)/vtkisosurfaceviewer.tcl \
    136136                $(srcdir)/vtkstreamlinesviewer.tcl \
    137137                $(srcdir)/vtkvolumeviewer.tcl \
  • branches/Rappture 1.2/gui/scripts/cloud.tcl

    r3201 r3288  
    4343    private variable _numPoints 0
    4444    private variable _vtkdata ""
     45    private variable _vtkpoints ""
    4546    private variable _points ""
     47    private variable _dim 0
    4648}
    4749
     
    112114    }
    113115
     116    set data [$xmlobj get $path.points]
     117    Rappture::ReadPoints $data _dim values
     118
    114119    foreach lim {xmin xmax ymin ymax zmin zmax} {
    115120        set _limits($lim) ""
     
    146151        incr _numPoints
    147152    }
     153    if { $_dim == 3 } {
     154        set _vtkpoints [vtkPoints $this-vtkpoints]
     155        foreach { x y z } $_points {
     156            $_vtkpoints InsertNextPoint $x $y $z
     157        }
     158    }
     159    parray _limits
    148160    append out "DATASET POLYDATA\n"
    149161    append out "POINTS $_numPoints float\n"
     
    176188# ----------------------------------------------------------------------
    177189itcl::body Rappture::Cloud::mesh {} {
     190    if { $_dim == 3 } {
     191        return $_vtkpoints
     192    }
    178193    return $_points
    179194}
     
    194209# ----------------------------------------------------------------------
    195210itcl::body Rappture::Cloud::dimensions {} {
     211    return $_dim
    196212    # count the dimensions with real limits
    197213    set dims 0
  • branches/Rappture 1.2/gui/scripts/contourresult.tcl

    r3177 r3288  
    590590                        return
    591591                    }
     592puts stderr "ContourResult: dataobj=$dataobj mesh=$mesh "
    592593                    switch -- [$mesh GetClassName] {
    593594                      vtkPoints {
  • branches/Rappture 1.2/gui/scripts/field.tcl

    r3272 r3288  
    5858    private variable _comp2vtk   ;# maps component name => vtkFloatArray
    5959    private variable _comp2vtkstreamlines   ;# maps component name => vtkFloatArray
     60    private variable _comp2isosurface   ;# maps component name => vtkFloatArray
    6061    private variable _comp2vtkcontour   ;# maps component name => vtkFloatArray
    6162    private variable _comp2vtkvolume   ;# maps component name => vtkFloatArray
     
    151152        itcl::delete object $_comp2flowhints($name)
    152153    }
     154    foreach name [array names _comp2isosurface] {
     155        set mesh [lindex $_comp2isosurface($name) 0]
     156        set class [$mesh info class]
     157        ${class}::release $mesh
     158        set vtkarray [lindex $_comp2isosurface($name) 1]
     159        rename $vtkarray ""
     160    }
    153161    foreach name [array names _comp2heightmap] {
    154162        set mesh [lindex $_comp2heightmap($name) 0]
     
    216224    }
    217225    if {[info exists _comp2xy($cname)]} {
     226puts stderr "comp2xy"
    218227        return [lindex $_comp2xy($cname) 0]  ;# return xv
    219228    }
    220229    if { [info exists _comp2vtkstreamlines($cname)] } {
     230puts stderr "comp2vtkstreamlines"
    221231        error "mesh: not implemented for streamlines"
    222232        return [$mobj mesh]
    223233    }
    224234    if { [info exists _comp2vtkcontour($cname)] } {
     235puts stderr "comp2vtkcontour"
    225236        error "method \"mesh\" is not implemented for vtkcontour"
    226237    }
    227238    if { [info exists _comp2vtk($cname)] } {
    228239        set mobj [lindex $_comp2vtk($cname) 0]
     240 puts stderr "comp2vtk mobj=$mobj mesh=[$mobj mesh]"
    229241        return [$mobj mesh]
    230242    }
    231243    if {[info exists _comp2dx($cname)]} {
     244puts stderr "comp2dx"
    232245        return ""  ;# no mesh -- it's embedded in the value data
    233246    }
    234247    if {[info exists _comp2heightmap($cname)]} {
     248puts stderr "comp2heightmap"
    235249        return ""  ;# no mesh -- it's embedded in the value data
    236250    }
     251    if {[info exists _comp2isosurface($cname)]} {
     252puts stderr "comp2isosurface"
     253        return ""  ;# no mesh -- it's embedded in the value data
     254    }
    237255    if {[info exists _comp2vtkvolume($cname)]} {
     256puts stderr "comp2vtkvolume"
    238257        return ""  ;# no mesh -- it's embedded in the value data
    239258    }
    240259    if {[info exists _comp2unirect2d($cname)]} {
     260puts stderr "comp2unirect2d"
    241261        set mobj [lindex $_comp2unirect2d($cname) 0]
    242262        return [$mobj mesh]
    243263    }
    244264    if {[info exists _comp2unirect3d($cname)]} {
     265puts stderr "comp2unirect3d"
    245266        set mobj [lindex $_comp2unirect3d($cname) 0]
    246267        return [$mobj mesh]
     
    267288    }
    268289    if { [info exists _comp2heightmap($cname)] } {
     290        return $_values
     291    }
     292    if { [info exists _comp2isosurface($cname)] } {
    269293        return $_values
    270294    }
     
    690714    array unset _comp2volume
    691715    array unset _comp2vtkstreamlines
    692     array unset _comp2vtkcontour
    693716    array unset _comp2unirect2d
    694717    array unset _comp2unirect3d
     
    736759                set type "dx"
    737760            }
    738         }
     761        }
    739762        set _comp2style($cname) ""
    740763       
     
    746769        }
    747770        set _comp2extents($cname) $extents
     771puts stderr "type=$type"
    748772        set _type $type
    749773        if {$type == "1D"} {
     
    10551079        default {
    10561080            set mesh [$dataobj mesh $cname]
     1081puts stderr "dataobj=$dataobj, mesh=$mesh"
    10571082            switch -- [$mesh GetClassName] {
    10581083                vtkPoints {
     
    11941219        return $_comp2vtkcontour($cname)
    11951220    }
    1196     if { [info exists _comp2vtk($cname)] && $_dim == 2 } {
     1221    if { [info exists _comp2vtk($cname)] } {
    11971222        return $_comp2vtk($cname)
    11981223    }
     
    12051230        }
    12061231        foreach {mesh vector} $_comp2heightmap($cname) break
     1232        append out "# vtk DataFile Version 3.0\n"
     1233        append out "[hints label]\n"
     1234        append out "ASCII\n"
     1235        append out [$mesh vtkdata]
     1236        append out "SCALARS $label float\n"
     1237        append out "LOOKUP_TABLE default\n"
     1238        append out "[$vector range 0 end]\n"
     1239        return $out
     1240    }
     1241    if { [info exists _comp2isosurface($cname)] } {
     1242        set label [hints zlabel]
     1243        if { $label == "" } {
     1244            set label $cname
     1245        } else {
     1246            regsub -all { } $label {_} label
     1247        }
     1248        foreach {mesh vector} $_comp2isosurface($cname) break
    12071249        append out "# vtk DataFile Version 3.0\n"
    12081250        append out "[hints label]\n"
     
    12391281            set extents 1
    12401282        }
     1283        set _dim 3
    12411284        set _comp2dims($cname) "3D"
    12421285        set _comp2unirect3d($cname) \
     
    12561299            set extents 1
    12571300        }
     1301        set _dim 2
    12581302        set _comp2dims($cname) "2D"
    12591303        set _comp2unirect2d($cname) \
     
    12781322        }
    12791323    }
    1280     if {[$mesh dimensions] == 1} {
     1324    set _dim [$mesh dimensions]
     1325 puts stderr "mesh=$mesh dim=[$mesh dimensions]"
     1326    if {$_dim == 1} {
    12811327        # Is this used anywhere?
    12821328        #
     
    12871333        set yv [blt::vector create y$_counter]
    12881334       
    1289         set points [$mesh points]
    1290         set max [$points GetNumberOfPoints]
    1291         for {set i 0} {$i < $max} {incr i} {
    1292             $xv append [lindex [$points GetPoint $i] 0]
    1293         }
    1294         set class [$mesh info class]
    1295         ${class}::release $mesh
    1296        
    1297         set values [$_field get $cname.values]
    1298         foreach y $values {
    1299             if {"" != $_units} {
    1300                 set y [Rappture::Units::convert $y \
    1301                            -context $_units -to $_units -units off]
    1302             }
    1303             $yv append $y
    1304         }
     1335        $yv set [$mesh points]
     1336        $xv seq 0 1 [$yv length]
    13051337        # sort x-coords in increasing order
    13061338        $xv sort $yv
     
    13101342        incr _counter
    13111343        return
    1312     }
    1313 
    1314     if {[$mesh dimensions] == 3} {
     1344    } elseif {$_dim == 3} {
    13151345        #
    13161346        # 3D data: Store cloud/field as components
     
    13251355            $farray InsertNextValue $v
    13261356        }
     1357        set _viewer "vtkisosurface"
     1358        set _type "vtkisosurface"
     1359        set vector [blt::vector create \#auto]
     1360        $vector set [$_field get $cname.values]
    13271361        set _comp2dims($cname) "[$mesh dimensions]D"
    1328         set _comp2vtk($cname) [list $mobj $farray]
     1362        set _comp2isosurface($cname) [list $mesh $vector]
    13291363        set _comp2style($cname) [$_field get $cname.style]
    13301364        incr _counter
     1365        set label [hints zlabel]
     1366        if { $label != "" } {
     1367            set _fieldNames $label
     1368            regsub -all { } $_fieldNames {_} _fieldNames
     1369            set _fieldLabels $label
     1370        }
     1371        set units [hints zunits]
     1372        if { $units != "" } {
     1373            set _fieldUnits $units
     1374        }
    13311375        return
    1332     }
    1333     if {[$mesh dimensions] == 2} {
    1334 
    1335         # 2D data: Convert field data to vtkFloatArray
    1336 
     1376    } elseif {$_dim == 2} {
     1377        set _type "vtkheightmap"
    13371378        set vector [blt::vector create \#auto]
    13381379        $vector set [$_field get $cname.values]
  • branches/Rappture 1.2/gui/scripts/field3dresult.tcl

    r3177 r3288  
    5959            set servers [Rappture::VisViewer::GetServerList "nanovis"]
    6060        }
    61         "vtkcontour" - "vtkheightmap" - "vtkstreamlines" - "vtkviewer" - "vtkvolume" {
     61        "vtkisosurface" - "vtkheightmap" - "vtkstreamlines" - "vtkviewer" - "vtkvolume" {
    6262            set servers [Rappture::VisViewer::GetServerList "vtkvis"]
    6363        }
     
    8282                }
    8383            }
    84             "vtkcontour" {
     84            "vtkcontour" - "vtkheightmap" {
    8585                itk_component add renderer {
    86                     Rappture::VtkContourViewer $itk_interior.ren $servers
     86                    Rappture::VtkHeightmapViewer $itk_interior.ren $servers
    8787                }
    8888            }
    89             "vtkheightmap" {
     89            "vtkisosurface" {
    9090                itk_component add renderer {
    91                     Rappture::VtkHeightmapViewer $itk_interior.ren $servers
     91                    Rappture::VtkIsosurfaceViewer $itk_interior.ren $servers
    9292                }
    9393            }
     
    125125        pack $itk_component(renderer) -expand yes -fill both
    126126    }
    127 
    128127    eval itk_initialize $args
    129128}
  • branches/Rappture 1.2/gui/scripts/mesh.tcl

    r3271 r3288  
    6565    private common _xp2obj       ;      # used for fetch/release ref counting
    6666    private common _obj2ref      ;      # used for fetch/release ref counting
    67 
     67    private variable _isValid 0
    6868    private variable _vtkoutput ""
    6969    private variable _vtkreader ""
     
    7777    private variable _yValues   "";     # For the blt contour only
    7878   
     79    private method GetDimension {}
     80    private method GetDouble { path }
     81    private method GetInt { path }
     82    private method ReadBltCloudMesh { path }
     83    private method ReadBltGridMesh { path }
     84    private method ReadBltMesh { path }
     85    private method ReadBltTriangleMesh { path }
     86    private method ReadCells { xmlobj path }
    7987    private method ReadCloud { xmlobj path }
    8088    private method ReadGrid { xmlobj path }
    8189    private method ReadTriangles { xmlobj path }
    8290    private method ReadVtk { xmlobj path }
    83     private method GetBltCloudMesh { path }
    84     private method GetBltGridMesh { path }
    85     private method GetBltTriangleMesh { path }
    86     private method GetBltMesh { path }
    87     private method GetDouble { path }
    88     private method GetInt { path }
    89     private method GetDimension {}
    9091    private method _buildNodesElements {xmlobj path}
    9192}
     
    171172    # <element> +  <node> definitions
    172173    # <cloud>           x,y coordinates or x,y,z coordinates
    173     # <unirect>         uniform rectangular grid (2D) or cubes (3D)
    174     # <rectangle>       non-uniform rectangular mesh
     174    # <grid>            rectangular mesh
     175    # <triangles>       triangular mesh
     176    # <cells>           homogeneous cell type mesh.
     177
     178    # Check that only one mesh type was defined.
     179    set subcount 0
     180    foreach cname [$_mesh children] {
     181        foreach type { vtk cloud grid triangles cells } {
     182            if { [$_mesh element $type] != "" } {
     183                incr subcount
     184                break
     185            }
     186        }
     187    }
     188    set elemcount 0
     189    foreach cname [$_mesh children] {
     190        foreach type { node element } {
     191            if { [$_mesh element $type] != "" } {
     192                incr elemcount
     193                break
     194            }
     195        }
     196    }
     197    if { $elemcount > 0 } {
     198        incr $subcount
     199    }
     200    if { $subcount > 1 } {
     201        puts stderr "too many mesh types specified: picking first found."
     202    }
    175203    if { [$_mesh element vtk] != ""} {
    176204        ReadVtk $xmlobj $path
     
    181209    } elseif {[$_mesh element triangles] != "" } {
    182210        ReadTriangles $xmlobj $path
     211    } elseif {[$_mesh element cells] != "" } {
     212        ReadCells $xmlobj $path
    183213    } elseif {[$_mesh element node] != "" && [$_mesh element element] != ""} {
    184214        ReadNodesElements $xmlobj $path
    185     } else {
    186         error "can't find mesh data in $path"
    187215    }
    188216}
     
    296324        "blt" {
    297325            if { $_bltmesh == "" } {
    298                 GetBltMesh
     326                ReadBltMesh
    299327                return $_bltmesh
    300328            }
     
    558586        set _vtkdata $out
    559587        foreach axis {x y z} {
    560         set vector [set ${axis}v]
     588            set vector [set ${axis}v]
    561589            set _limits(${axis}min) [${vector} min]
    562590            set _limits(${axis}max) [${vector} max]
     
    587615    set _vtkpoints [$_vtkoutput GetPointData]
    588616    file delete $tmpfile
     617    set _isValid 1
    589618}
    590619
     
    614643    }
    615644    if { $numNonUniform == 0 && $numUniform > 0 } {
    616         # Specially handle the case where all axes are uniform.
    617         # This means we can use a vtkImageData to represent the data
    618         # instead of a vtkRectlinearGrid.
    619         # Vtk points are always 3D     
     645        # Specially handle the case where all axes are uniform.  This means we
     646        # can use a vtkImageData to represent the data instead of a
     647        # vtkRectlinearGrid.  Vtk points are always 3D
    620648        if { $_dim == 2 } {
    621649            append out "DATASET STRUCTURED_POINTS\n"
     
    650678            error "bad dimension of mesh \"$_dim\""
    651679        }
     680        set _isValid 1
    652681        return 1
    653682    }
     
    729758    }
    730759    blt::vector destroy $xv $yv $zv
     760    set _isValid 1
    731761    return 1
     762}
     763
     764itcl::body Rappture::Mesh::ReadCells { xmlobj path } {
     765    set _type "cells"
     766    set celltype [$xmlobj get $path.cells.celltype]
     767    array set type2vertices {
     768        triangle 3
     769        quad     4
     770        tetraheadron 4
     771        voxel 8
     772        hexaheadron 8
     773        wedge 6
     774        pyramid 5
     775    }
     776    array set type2dim {
     777        triangle 2
     778        quad     2
     779        tetraheadron 3
     780        voxel 3
     781        hexaheadron 3
     782        wedge 3
     783        pyramid 3
     784    }
     785    array set type2vtkid {
     786        triangle 5
     787        quad     9
     788        tetraheadron 10
     789        voxel 11
     790        hexaheadron 12
     791        wedge 13
     792        pyramid 14
     793    }
     794    if { ![info exists type2vertices($celltype)] } {
     795        puts stderr "unknown celltype \"$celltype\""
     796        return 0
     797    }
     798    set numVertices $type2vertices($celltype)
     799    set _dim $type2dim($celltype)
     800    set vtkid $type2vtkid($celltype)
     801   
     802    set points [$xmlobj get $path.cells.points]
     803    set xvalues [$xmlobj get $path.cells.xvalues]
     804    set yvalues [$xmlobj get $path.cells.yvalues]
     805    if { $_dim == 2 } {
     806        if { $xvalues != "" && $yvalues != "" } {
     807            set xv [blt::vector create \#auto]
     808            set yv [blt::vector create \#auto]
     809            $xv set $xvalues
     810            $yx set $yvalues
     811        } elseif { $points != "" } {
     812            set all [blt::vector create \#auto]
     813            $all set $points
     814            set xv [blt::vector create \#auto]
     815            set yv [blt::vector create \#auto]
     816            $all split $xv $yv
     817        } else {
     818            puts stderr "missing either xvalues, yvalues, or points for $celltype cell mesh"
     819            return 0
     820        }
     821        set _numPoints [$xv length]
     822        set numIndices 0
     823        set data {}
     824        set indices [$xmlobj get $path.cells.indices]
     825        foreach { a b c } $indices {
     826            append data "    $numVertices $a $b $c\n"
     827            incr numIndices
     828        }
     829        set celltypes {}
     830        for { set i 0 } { $i < $numIndices } { incr i } {
     831            append celltypes "$vtkid\n"
     832        }
     833        append out "DATASET UNSTRUCTURED_GRID\n"
     834        append out "POINTS $_numPoints float\n"
     835        foreach x [$xv range 0 end] y [$yv range 0 end] {
     836            append out "    $x $y 0\n"
     837        }
     838        append out "CELLS $numIndices [expr $numIndices * 4]\n"
     839        append out $data
     840        append out "CELL_TYPES $numIndices\n"
     841        append out $celltypes
     842        append out "POINT_DATA $_numPoints\n"
     843        set _limits(xmin) [$xv min]
     844        set _limits(xmax) [$xv max]
     845        set _limits(ymin) [$yv min]
     846        set _limits(ymax) [$yv max]
     847    } else {
     848        set zvalues [$xmlobj get $path.cells.zvalues]
     849        if { $xvalues != "" && $yvalues != ""  && $zvalues != "" } {
     850            set xv [blt::vector create \#auto]
     851            set yv [blt::vector create \#auto]
     852            set zv [blt::vector create \#auto]
     853            $xv set $xvalues
     854            $yx set $yvalues
     855            $zx set $yvalues
     856        } elseif { $points != "" } {
     857            set all [blt::vector create \#auto]
     858            $all set $points
     859            set xv [blt::vector create \#auto]
     860            set yv [blt::vector create \#auto]
     861            set zv [blt::vector create \#auto]
     862            $all split $xv $yv $zv
     863        } else {
     864            puts stderr "missing either xvalues, yvalues, zvalues, or points for $celltype cell mesh"
     865            return 0
     866        }
     867        set _numPoints [$xv length]
     868        set data {}
     869        set indices [$xmlobj get $path.cells.indices]
     870        set numIndices 0
     871        foreach { a b c } $indices {
     872            append data "    $numVertices $a $b $c\n"
     873            incr numIndices
     874        }
     875        set celltypes {}
     876        for { set i 0 } { $i < $numIndices } { incr i } {
     877            append celltypes "$vtkid\n"
     878        }
     879        append out "DATASET UNSTRUCTURED_GRID\n"
     880        append out "POINTS $_numPoints float\n"
     881        foreach x [$xv range 0 end] y [$yv range 0 end] z [$zv range 0 end] {
     882            append out "    $x $y $z\n"
     883        }
     884        append out "CELLS $numIndices [expr $numIndices * 4]\n"
     885        append out $data
     886        append out "CELL_TYPES $numIndices\n"
     887        append out $celltypes
     888        append out "POINT_DATA $_numPoints\n"
     889        set _limits(xmin) [$xv min]
     890        set _limits(xmax) [$xv max]
     891        set _limits(ymin) [$yv min]
     892        set _limits(ymax) [$yv max]
     893        set _limits(zmin) [$zv min]
     894        set _limits(zmax) [$zv max]
     895    }
     896    set _vtkdata $out
     897    set _isValid 1
    732898}
    733899
     
    784950    set _limits(ymax) [$yv max]
    785951    set _vtkdata $out
    786 }
    787 
    788 itcl::body Rappture::Mesh::GetBltGridMesh { path } {
     952    set _isValid 1
     953}
     954
     955itcl::body Rappture::Mesh::ReadBltGridMesh { path } {
    789956    if { $_dim != 2 } {
    790957        error "must be 2D mesh for BLT"
     
    8411008}
    8421009
    843 itcl::body Rappture::Mesh::GetBltTriangleMesh { path } {
     1010itcl::body Rappture::Mesh::ReadBltTriangleMesh { path } {
    8441011    set _xv [blt::vector create \#auto]
    8451012    set _yv [blt::vector create \#auto]
     
    8561023}
    8571024
    858 itcl::body Rappture::Mesh::GetBltCloudMesh { path } {
     1025itcl::body Rappture::Mesh::ReadBltCloudMesh { path } {
    8591026    # Read the points into a vector and split them into individual coordinate
    8601027    # arrays.
     
    8831050}
    8841051
    885 itcl::body Rappture::Mesh::GetBltMesh { path } {
     1052itcl::body Rappture::Mesh::ReadBltMesh { path } {
    8861053    if { $_dim != 2 } {
    8871054        error "dimension of mesh $_dim is not 2"
     
    8891056    switch -- $_type {
    8901057        "cloud" {
    891             set _bltmesh [GetBltCloudMesh $path ]
     1058            set _bltmesh [ReadBltCloudMesh $path ]
    8921059        }
    8931060        "unirect" {
    894             set _bltmesh [GetBltRegularMesh $path]
     1061            set _bltmesh [ReadBltRegularMesh $path]
    8951062        }
    8961063        "rectangle" {
    897             set _bltmesh [GetBltIrregularMesh $path]
     1064            set _bltmesh [ReadBltIrregularMesh $path]
    8981065        }
    8991066        "triangle" {
    900             set _bltmesh [GetBltTriangleMesh $path]
     1067            set _bltmesh [ReadBltTriangleMesh $path]
    9011068        }
    9021069        default {
     
    9891156    }
    9901157    set _vtkdata $out
    991 }
     1158    set _isValid 1
     1159}
  • branches/Rappture 1.2/gui/scripts/resultviewer.tcl

    r3210 r3288  
    336336                                set fmt "vtkstreamlines"
    337337                            }
     338                            "vtkisosurface" {
     339                                set fmt "vtkisosurface"
     340                            }
    338341                        }
    339342                        set w $itk_interior.field3D
  • branches/Rappture 1.2/gui/scripts/xyresult.tcl

    r3236 r3288  
    749749        # Create text/line markers for each *axis.marker specified.
    750750        #
    751         foreach m [$dataobj xmarkers] {
    752             foreach {at label style} $m break
    753             set id [$g marker create line -coords [list $at $ymin $at $ymax]]
    754             $g marker bind $id <Enter> \
    755                 [itcl::code $this EnterMarker $g x-$label $at $ymin $at]
    756             $g marker bind $id <Leave> \
    757                 [itcl::code $this LeaveMarker $g x-$label]
    758             set options [GetLineMarkerOptions $style]
    759             if { $options != "" } {
    760                 eval $g marker configure $id $options
    761             }
    762             if { $label != "" } {
    763                 set id [$g marker create text -anchor nw \
    764                             -text $label -coords [list $at $ymax]]
    765                 set options [GetTextMarkerOptions $style]
    766                 if { $options != "" } {
    767                     eval $g marker configure $id $options
    768                 }
    769             }
    770         }
    771         foreach m [$dataobj ymarkers] {
    772             foreach {at label style} $m break
    773             set id [$g marker create line -coords [list $xmin $at $xmax $at]]
    774             $g marker bind $id <Enter> \
    775                 [itcl::code $this EnterMarker $g y-$label $at $xmin $at]
    776             $g marker bind $id <Leave> \
    777                 [itcl::code $this LeaveMarker $g y-$label]
    778             set options [GetLineMarkerOptions $style]
    779             if { $options != "" } {
    780                 eval $g marker configure $id $options
    781             }
    782             if { $label != "" } {
    783                 set id [$g marker create text -anchor se \
    784                         -text $label -coords [list $xmax $at]]
    785                 set options [GetTextMarkerOptions $style]
    786                 if { $options != "" } {
    787                     eval $g marker configure $id $options
    788                 }
    789             }
    790         }
     751        if { [$dataobj info class] == "Rappture::Curve" } {
     752            foreach m [$dataobj xmarkers] {
     753                foreach {at label style} $m break
     754                set id [$g marker create line \
     755                            -coords [list $at $ymin $at $ymax]]
     756                $g marker bind $id <Enter> \
     757                    [itcl::code $this EnterMarker $g x-$label $at $ymin $at]
     758                $g marker bind $id <Leave> \
     759                    [itcl::code $this LeaveMarker $g x-$label]
     760                set options [GetLineMarkerOptions $style]
     761                if { $options != "" } {
     762                    eval $g marker configure $id $options
     763                }
     764                if { $label != "" } {
     765                    set id [$g marker create text -anchor nw \
     766                                -text $label -coords [list $at $ymax]]
     767                    set options [GetTextMarkerOptions $style]
     768                    if { $options != "" } {
     769                        eval $g marker configure $id $options
     770                    }
     771                }
     772            }
     773            foreach m [$dataobj ymarkers] {
     774                foreach {at label style} $m break
     775                set id [$g marker create line \
     776                            -coords [list $xmin $at $xmax $at]]
     777                $g marker bind $id <Enter> \
     778                    [itcl::code $this EnterMarker $g y-$label $at $xmin $at]
     779                $g marker bind $id <Leave> \
     780                    [itcl::code $this LeaveMarker $g y-$label]
     781                set options [GetLineMarkerOptions $style]
     782                if { $options != "" } {
     783                    eval $g marker configure $id $options
     784                }
     785                if { $label != "" } {
     786                    set id [$g marker create text -anchor se \
     787                                -text $label -coords [list $xmax $at]]
     788                    set options [GetTextMarkerOptions $style]
     789                    if { $options != "" } {
     790                        eval $g marker configure $id $options
     791                    }
     792                }
     793            }
     794        }
    791795    }
    792796    $itk_component(legend) reset
Note: See TracChangeset for help on using the changeset viewer.