Changeset 3302 for branches/Rappture 1.2/gui/scripts/field.tcl
- Timestamp:
- Feb 17, 2013, 8:27:24 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Rappture 1.2/gui/scripts/field.tcl
r3296 r3302 53 53 itcl::class Rappture::Field { 54 54 private variable _dim 0; # Dimension of mesh 55 private variable _xmlobj "" ; # ref to XML obj with devicedata55 private variable _xmlobj "" ; # ref to XML obj with field data 56 56 private variable _limits ; # maps box name => {z0 z1} limits 57 57 private variable _field "" … … 59 59 private variable _fieldUnits "" ; # list of units of each field name. 60 60 private variable _fieldLabels "" ; # list of labels of each field name. 61 private variable _viewer "auto" 61 private variable _viewer "" 62 private variable _hints 62 63 63 64 constructor {xmlobj path} { … … 568 569 # ---------------------------------------------------------------------- 569 570 itcl::body Rappture::Field::hints {{keyword ""}} { 570 set hints(fieldnames) $_fieldNames 571 set hints(fieldunits) $_fieldUnits 572 set hints(fieldlabels) $_fieldLabels 573 foreach {key path} { 574 camera camera.position 575 color about.color 576 default about.default 577 group about.group 578 label about.label 579 fieldnames about.fieldnames 580 fieldunits about.fieldunits 581 fieldlabels about.fieldlabels 582 scale about.scale 583 seeds about.seeds 584 style about.style 585 toolId tool.id 586 toolName tool.name 587 toolTitle tool.title 588 toolRevision tool.version.application.revision 589 type about.type 590 xlabel about.xaxis.label 591 ylabel about.yaxis.label 592 zlabel about.zaxis.label 593 xunits about.xaxis.units 594 yunits about.yaxis.units 595 zunits about.zaxis.units 596 units units 597 updir updir 598 vectors about.vectors 599 } { 600 set str [$_field get $path] 601 if {"" != $str} { 602 set hints($key) $str 603 } 604 } 605 # Set tool and path hints 606 set hints(tool) [$_xmlobj get tool.name] 607 set hints(path) $_path 608 if 0 { 609 # to be compatible with curve objects 610 set hints(xlabel) "Position" 611 } 612 if {[info exists hints(group)] && [info exists hints(label)]} { 613 # pop-up help for each curve 614 set hints(tooltip) $hints(label) 615 } 616 617 if {$keyword != ""} { 618 if {[info exists hints($keyword)]} { 571 if { ![info exists _hints] } { 572 set _hints(fieldnames) $_fieldNames 573 set _hints(fieldunits) $_fieldUnits 574 set _hints(fieldlabels) $_fieldLabels 575 foreach {key path} { 576 camera camera.position 577 color about.color 578 default about.default 579 group about.group 580 label about.label 581 fieldnames about.fieldnames 582 fieldunits about.fieldunits 583 fieldlabels about.fieldlabels 584 scale about.scale 585 seeds about.seeds 586 style about.style 587 type about.type 588 xlabel about.xaxis.label 589 ylabel about.yaxis.label 590 zlabel about.zaxis.label 591 xunits about.xaxis.units 592 yunits about.yaxis.units 593 zunits about.zaxis.units 594 units units 595 updir updir 596 vectors about.vectors 597 } { 598 set str [$_field get $path] 599 if { "" != $str } { 600 set _hints($key) $str 601 } 602 } 603 foreach {key path} { 604 toolid tool.id 605 toolname tool.name 606 toolcommand tool.execute 607 tooltitle tool.title 608 toolrevision tool.version.application.revision 609 } { 610 set str [$_xmlobj get $path] 611 if { "" != $str } { 612 set _hints($key) $str 613 } 614 } 615 # Set toolip and path hints 616 set _hints(path) $_path 617 if { [info exists _hints(group)] && [info exists _hints(label)] } { 618 # pop-up help for each curve 619 set _hints(tooltip) $_hints(label) 620 } 621 } 622 if { $keyword != "" } { 623 if {[info exists _hints($keyword)]} { 619 624 return $hints($keyword) 620 625 } 621 626 return "" 622 627 } 623 return [array get hints]628 return [array get _hints] 624 629 } 625 630 … … 1054 1059 incr _dim 1055 1060 } 1056 if { $_dim == 2 } { 1057 set _viewer heightmap 1058 } else { 1059 set _viewer isosurface 1061 if { $_viewer == "" } { 1062 if { $_dim == 2 } { 1063 set _viewer heightmap 1064 } else { 1065 set _viewer isosurface 1066 } 1060 1067 } 1061 1068 set _comp2dims($cname) ${_dim}D
Note: See TracChangeset
for help on using the changeset viewer.