Changeset 1655 for trunk/examples/objects/api
- Timestamp:
- Feb 5, 2010, 10:26:35 AM (15 years ago)
- Location:
- trunk/examples/objects/api
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/objects/api/tcl/view
r1645 r1655 12 12 property <key> ?<val>? 13 13 propremove <key> 14 15 plot <name> -at "row,col" -table <table> {"x1" "y1" "s1" ...}16 volume <name> -at "row,col" -table <table> {"x1" "y1" "z1" "d1" ...}17 surface <name> -at "row,col" -table <table> {"x1" "y1" "d1" ...}18 image <object> -at "row,col"19 note <object> -at "row,col"20 21 14 vvalue ?<hints>? 22 15 random … … 27 20 is 28 21 22 plot <name> -at "row,col" -table <table> {"x1" "y1" "s1" ...} 23 surf2d <name> -at "row,col" -table <table> {"x1" "y1" "d1" ...} 24 surf3d <name> -at "row,col" -table <table> {"x1" "y1" "z1" "d1" ...} 25 image <object> -at "row,col" 26 note <object> -at "row,col" 27 28 29 29 --------------------------------------- 30 30 Rappture::View <name> -rows <rows> -cols <cols> 31 31 Purpose: construct a view for displaying data 32 Input Arguments: 1 manditory, 2 optional32 Input Arguments: 1 required, 2 optional 33 33 1. name - name of the view 34 34 2. rows - number of rows in the view, default is 1 … … 52 52 Code Example: 53 53 {{{ 54 set p [Rappture::Plot]55 $ pname56 # " "57 $ pname "fdfactor"58 $ pname54 set v [Rappture::View "fdfplots"] 55 $v name 56 # "fdfplots" 57 $v name "fdfactor" 58 $v name 59 59 # "fdfactor" 60 60 }}} … … 71 71 Code Example: 72 72 {{{ 73 set p [Rappture::Plot]74 $ ppath73 set v [Rappture::View "fdfplots"] 74 $v path 75 75 # "" 76 $ ppath "output"77 $ ppath76 $v path "output" 77 $v path 78 78 # "output" 79 79 }}} … … 89 89 Code Example: 90 90 {{{ 91 set p [Rappture::Plot]92 $ plabel91 set v [Rappture::View "fdfplots"] 92 $v label 93 93 # "" 94 $ plabel "Fermi-Dirac Factor"95 $ plabel94 $v label "Fermi-Dirac Factor" 95 $v label 96 96 # "Fermi-Dirac Factor" 97 97 }}} … … 102 102 1. val - new description 103 103 Return Value: description of the object 104 Notes: if no description is set, an empty string will be returned 105 the description is used by the graphical user 106 interface to describe what type of data is being 107 requested and how the input is used. 108 val, if provided, is used to set the object description 109 Code Example: 110 {{{ 111 set p [Rappture::Plot] 112 $p desc 104 Notes: if no description is set, an empty string will be 105 returned the description is used by the graphical 106 user interface to describe what type of data is 107 being requested and how the input is used. val, if 108 provided, is used to set the object description 109 110 Code Example: 111 {{{ 112 set v [Rappture::View "fdfplots"] 113 $v desc 113 114 # "" 114 $ pdesc "A plot of the Fermi-Dirac Factor"115 $ pdesc115 $v desc "A plot of the Fermi-Dirac Factor" 116 $v desc 116 117 # "A plot of the Fermi-Dirac Factor" 117 118 }}} … … 127 128 Code Example: 128 129 {{{ 129 set p [Rappture::Plot]130 $ phints130 set v [Rappture::View "fdfplots"] 131 $v hints 131 132 # "" 132 $ phints "no hints"133 $ phints133 $v hints "no hints" 134 $v hints 134 135 # "no hints" 135 136 }}} … … 144 145 Code Example: 145 146 {{{ 146 set p [Rappture::Plot]147 $ p property "name"147 set v [Rappture::View "fdfplots"] 148 $v property "label" 148 149 # "" 149 $ p property "name" "fdfactor"150 # " fdfactor"151 $ pname152 # " fdfactor"150 $v property "label" "Fermi-Dirac Factor" 151 # "Fermi-Dirac Factor" 152 $v name 153 # "Fermi-Dirac Factor" 153 154 }}} 154 155 … … 161 162 Code Example: 162 163 {{{ 163 set p [Rappture::Plot]164 $ pname "fdfactor"165 $ pproperty "name"164 set v [Rappture::View "fdfplots"] 165 $v name "fdfactor" 166 $v property "name" 166 167 # "fdfactor" 167 $ ppropremove "name"168 $v propremove "name" 168 169 # "fdfactor" 169 $ pproperty "name"170 $v property "name" 170 171 # "" 171 }}}172 173 plot <name> -at "row,col" -table <table> {"x1" "y1" "s1" "x2" "y2" "s2" ...}174 Purpose: populate a view object with a plot175 Input Arguments: 2 required, 2 optional176 1. name - name of the plot177 2. -at - position of the plot within the view, row and column number178 3. -table - name of the table holding the data.179 4. {"x1" "y1" "s1" ...} - x and y column names, followed by the style180 Return Value: None181 Notes: plots can be grouped together by specifying182 multiple x,y pairs within the list of columns183 from the last argument. eg:184 {"x1" "y1" "s1" "x2" "y2" "s2"}185 Code Example:186 {{{187 set results [Rappture::Table "dataTable"]188 $results column "Xvals" "X Values"189 $results column "Squared" "X Squared"190 $results column "Cubed" "X Cubed"191 192 # create a view with two curves grouped on a single plot193 # 1) x vs x^2194 # 2) x vs x^3195 set v1 [Rappture::View fdfview1]196 $v1 plot "fdfPlot1" -table "dataTable" \197 {"Xvals" "Squared" "g:o" "Xvals" "Cubed" "b-o"}198 199 # create a view with two plots, one stacked on top of the other200 # 1) x vs x^2201 # 2) x vs x^3202 set v2 [Rappture::View fdfview2 -rows 2 -cols 1]203 $v2 plot "fdfPlot2" -at "1,1" -table "dataTable" \204 {"Xvals" "Squared" "g:o"}205 $v2 plot "fdfPlot3" -at "2,1" -table "dataTable" \206 {"Xvals" "Cubed" "b-o"}207 208 # create a view with two plots side by side209 # 1) x vs x^2 2) x vs x^3210 set v3 [Rappture::View fdfview3 -rows 1 -cols 2]211 $v3 plot "fdfPlot4" -at "1,1" -table "dataTable" \212 {"Xvals" "Squared" "g:o"}213 $v3 plot "fdfPlot5" -at "1,2" -table "dataTable" \214 {"Xvals" "Cubed" "b-o"}215 }}}216 217 volume <name> -at "row,col" -table <table> {"x1" "y1" "z1" "d1",...}218 Purpose: populate a view object with a volume219 Input Arguments: 2 required, 2 optional220 1. name - name of the volume221 2. -at - position of the plot within the view, row and column number222 3. -table - name of the table holding the data.223 4. {"x1" "y1" "z1" "d1",...} - x, y, z, and data column names224 Return Value: None225 Notes: volumes can be grouped together by specifying226 multiple x,y,z triplets within the list of columns227 from the last argument. eg:228 {"x1" "y1" "z1" "d1" "x2" "y2" "z2" "d2"}229 ToDo:230 1. how to specify transfer function ranges231 2. how to specify uni rect grid instead of explicit points232 - three values in the coords columns is assumed to be233 the min, max, and step for that direction of the234 uniform rectangular grid?235 Code Example:236 {{{237 set results [Rappture::Table "dataTable"]238 $results column "Xcoords" "X coordinates"239 $results column "Ycoords" "Y coordinates"240 $results column "Zcoords" "Z coordinates"241 $results column "Data1" "Data Set #1"242 $results column "Data2" "Data Set #2"243 244 # create a view with two volumes in a single visualization window245 set v1 [Rappture::View fdfview1]246 $v1 volume "fdfVol1" -table "dataTable" \247 {"Xcoords" "Ycoords" "Zcoords" "Data1" \248 "Xcoords" "Ycoords" "Zcoords" "Data2"}249 250 # create a view with two volumes in different visualization windows251 # one stacked on top of the other252 set v2 [Rappture::View fdfview2 -rows 2 -cols 1]253 $v2 volume "fdfVol2" -at "1,1" -table "dataTable" \254 {"Xcoords" "Ycoords" "Zcoords" "Data1"}255 $v2 volume "fdfVol3" -at "2,1" -table "dataTable" \256 {"Xcoords" "Ycoords" "Zcoords" "Data2"}257 258 # create a view with two volumes in different visualization windows259 # side by side260 set v3 [Rappture::View fdfview3 -rows 1 -cols 2]261 $v3 volume "fdfVol4" -at "1,1" -table "dataTable" \262 {"Xcoords" "Ycoords" "Zcoords" "Data1"}263 $v3 volume "fdfVol5" -at "1,2" -table "dataTable" \264 {"Xcoords" "Ycoords" "Zcoords" "Data2"}265 }}}266 267 surface <name> -at "row,col" -table <table> {"x1" "y1" "d1" ...}268 Purpose: populate a view object with a surface plot269 Input Arguments: 2 required, 2 optional270 1. name - name of the volume271 2. -at - position of the plot within the view, row and column number272 3. -table - name of the table holding the data.273 4. {"x1" "y1" "d1",...} - x, y, and data column names274 Return Value: None275 Notes: surface plots can be grouped together by specifying276 multiple x,y pairs within the list of columns277 from the last argument. eg:278 {"x1" "y1" "d1" "x2" "y2" "d2"}279 ToDo:280 1. how to specify transfer function ranges281 2. how to specify uni rect grid instead of explicit points282 - three values in the coords columns is assumed to be283 the min, max, and step for that direction of the284 uniform rectangular grid?285 Code Example:286 {{{287 set results [Rappture::Table "dataTable"]288 $results column "Xcoords" "X coordinates"289 $results column "Ycoords" "Y coordinates"290 $results column "Data1" "Data Set #1"291 $results column "Data2" "Data Set #2"292 293 # create a view with two surface plots in a single visualization window294 set v1 [Rappture::View fdfview1]295 $v1 surface "fdfSurf1" -table "dataTable" \296 {"Xcoords" "Ycoords" "Data1" \297 "Xcoords" "Ycoords" "Data2"}298 299 # create a view with two volumes in different visualization windows300 # one stacked on top of the other301 set v2 [Rappture::View fdfview2 -rows 2 -cols 1]302 $v2 surface "fdfSurf2" -at "1,1" -table "dataTable" \303 {"Xcoords" "Ycoords" "Data1"}304 $v2 surface "fdfSurf3" -at "2,1" -table "dataTable" \305 {"Xcoords" "Ycoords" "Data2"}306 307 # create a view with two volumes in different visualization windows308 # side by side309 set v3 [Rappture::View fdfview3 -rows 1 -cols 2]310 $v3 surface "fdfSurf4" -at "1,1" -table "dataTable" \311 {"Xcoords" "Ycoords" "Data1"}312 $v3 surface "fdfSurf5" -at "1,2" -table "dataTable" \313 {"Xcoords" "Ycoords" "Data2"}314 }}}315 316 image <object> -at "row,col"317 Purpose: populate a view object with an image318 Input Arguments: 1 required, 1 optional319 1. object - object representing the image320 2. -at - position of the image within the view, row and column number321 Return Value: None322 Code Example:323 {{{324 set i1 [Rappture::Image "image1" -label "ilabel1" -desc "idesc1"]325 set i2 [Rappture::Image "image2" -label "ilabel2" -desc "idesc2"]326 327 # create a view with two images in different windows328 # one stacked on top of the other329 set v1 [Rappture::View fdfview1 -rows 2 -cols 1]330 $v1 image $i1 -at "1,1"331 $v1 image $i2 -at "2,1"332 333 # create a view with two images in different windows334 # side by side335 set v2 [Rappture::View fdfview2 -rows 1 -cols 2]336 $v2 image $i1 -at "1,1"337 $v2 image $i2 -at "1,2"338 }}}339 340 note <object> -at "row,col"341 Purpose: populate a view object with a note342 Input Arguments: 1 required, 1 optional343 1. object - object representing the note344 2. -at - position of the note within the view, row and column number345 Return Value: None346 Code Example:347 {{{348 set i1 [Rappture::Note "note1" -label "nlabel1" -desc "ndesc1"]349 set i2 [Rappture::Note "note2" -label "nlabel2" -desc "ndesc2"]350 351 # create a view with two notes in different windows352 # one stacked on top of the other353 set v1 [Rappture::View fdfview1 -rows 2 -cols 1]354 $v1 note $n1 -at "1,1"355 $v1 note $n2 -at "2,1"356 357 # create a view with two notes in different windows358 # side by side359 set v2 [Rappture::View fdfview2 -rows 1 -cols 2]360 $v2 note $i1 -at "1,1"361 $v2 note $i2 -at "1,2"362 172 }}} 363 173 … … 719 529 }}} 720 530 721 722 531 is 723 532 Purpose: return an integer tag describing the object. … … 726 535 Notes: None 727 536 Code Example: 537 538 plot <name> -at "row,col" -table <table> {"x1" "y1" "s1" "x2" "y2" "s2" ...} 539 Purpose: populate a view object with a plot 540 Input Arguments: 2 required, 2 optional 541 1. name - name of the plot 542 2. -at - position of the plot within the view, row and column number 543 3. -table - name of the table holding the data. 544 4. {"x1" "y1" "s1" ...} - x and y column names, followed by the style 545 Return Value: None 546 Notes: plots can be grouped together by specifying 547 multiple x,y pairs within the list of columns 548 from the last argument. eg: 549 {"x1" "y1" "s1" "x2" "y2" "s2"} 550 Code Example: 551 {{{ 552 set results [Rappture::Table "dataTable"] 553 $results column "Xvals" "X Values" 554 $results column "Squared" "X Squared" 555 $results column "Cubed" "X Cubed" 556 557 # create a view with two curves grouped on a single plot 558 # 1) x vs x^2 559 # 2) x vs x^3 560 set v1 [Rappture::View fdfview1] 561 $v1 plot "fdfPlot1" -table "dataTable" \ 562 {"Xvals" "Squared" "g:o" "Xvals" "Cubed" "b-o"} 563 564 # create a view with two plots, one stacked on top of the other 565 # 1) x vs x^2 566 # 2) x vs x^3 567 set v2 [Rappture::View fdfview2 -rows 2 -cols 1] 568 $v2 plot "fdfPlot2" -at "1,1" -table "dataTable" \ 569 {"Xvals" "Squared" "g:o"} 570 $v2 plot "fdfPlot3" -at "2,1" -table "dataTable" \ 571 {"Xvals" "Cubed" "b-o"} 572 573 # create a view with two plots side by side 574 # 1) x vs x^2 2) x vs x^3 575 set v3 [Rappture::View fdfview3 -rows 1 -cols 2] 576 $v3 plot "fdfPlot4" -at "1,1" -table "dataTable" \ 577 {"Xvals" "Squared" "g:o"} 578 $v3 plot "fdfPlot5" -at "1,2" -table "dataTable" \ 579 {"Xvals" "Cubed" "b-o"} 580 }}} 581 582 surf2d <name> -at "row,col" -table <table> {"x1" "y1" "d1" ...} 583 Purpose: populate a view object with a 2 dimensional surface plot 584 Input Arguments: 2 required, 2 optional 585 1. name - name of the 2 dimensional surface 586 2. -at - position of the plot within the view, row and column number 587 3. -table - name of the table holding the data. 588 4. {"x1" "y1" "d1",...} - x, y, and data column names. 589 data column is used for both height and color. 590 Return Value: None 591 Notes: surface plots can be grouped together by specifying 592 multiple x,y pairs within the list of columns 593 from the last argument. eg: 594 {"x1" "y1" "d1" "x2" "y2" "d2"} 595 ToDo: 596 1. how to specify transfer function ranges 597 2. how to specify uni rect grid instead of explicit points 598 - three values in the coords columns is assumed to be 599 the min, max, and step for that direction of the 600 uniform rectangular grid? 601 Code Example: 602 {{{ 603 set results [Rappture::Table "dataTable"] 604 $results column "Xcoords" "X coordinates" 605 $results column "Ycoords" "Y coordinates" 606 $results column "Data1" "Data Set #1" 607 $results column "Data2" "Data Set #2" 608 609 # create a view with two 2d surface plots in a single visualization window 610 set v1 [Rappture::View fdfview1] 611 $v1 surf2d "fdfSurf1" -table "dataTable" \ 612 {"Xcoords" "Ycoords" "Data1" \ 613 "Xcoords" "Ycoords" "Data2"} 614 615 # create a view with two 2d surface plots in different visualization windows 616 # one stacked on top of the other 617 set v2 [Rappture::View fdfview2 -rows 2 -cols 1] 618 $v2 surf2d "fdfSurf2" -at "1,1" -table "dataTable" \ 619 {"Xcoords" "Ycoords" "Data1"} 620 $v2 surf2d "fdfSurf3" -at "2,1" -table "dataTable" \ 621 {"Xcoords" "Ycoords" "Data2"} 622 623 # create a view with two 2d surface plots in different visualization windows 624 # side by side 625 set v3 [Rappture::View fdfview3 -rows 1 -cols 2] 626 $v3 surf2d "fdfSurf4" -at "1,1" -table "dataTable" \ 627 {"Xcoords" "Ycoords" "Data1"} 628 $v3 surf2d "fdfSurf5" -at "1,2" -table "dataTable" \ 629 {"Xcoords" "Ycoords" "Data2"} 630 }}} 631 632 surf3d <name> -at "row,col" -table <table> {"x1" "y1" "z1" "d1",...} 633 Purpose: populate a view object with a 3 dimensional surface 634 Input Arguments: 2 required, 2 optional 635 1. name - name of the 3 dimensional surface 636 2. -at - position of the plot within the view, row and column number 637 3. -table - name of the table holding the data. 638 4. {"x1" "y1" "z1" "d1",...} - x, y, z, and data column names 639 Return Value: None 640 Notes: 3d surfaces can be grouped together by specifying 641 multiple x,y,z triplets within the list of columns 642 from the last argument. eg: 643 {"x1" "y1" "z1" "d1" "x2" "y2" "z2" "d2"} 644 ToDo: 645 1. how to specify transfer function ranges 646 2. how to specify uni rect grid instead of explicit points 647 - three values in the coords columns is assumed to be 648 the min, max, and step for that direction of the 649 uniform rectangular grid? 650 Code Example: 651 {{{ 652 set results [Rappture::Table "dataTable"] 653 $results column "Xcoords" "X coordinates" 654 $results column "Ycoords" "Y coordinates" 655 $results column "Zcoords" "Z coordinates" 656 $results column "Data1" "Data Set #1" 657 $results column "Data2" "Data Set #2" 658 659 # create a view with two 3d surfaces in a single visualization window 660 set v1 [Rappture::View fdfview1] 661 $v1 surf3d "fdfVol1" -table "dataTable" \ 662 {"Xcoords" "Ycoords" "Zcoords" "Data1" \ 663 "Xcoords" "Ycoords" "Zcoords" "Data2"} 664 665 # create a view with two 3d surfaces in different visualization windows 666 # one stacked on top of the other 667 set v2 [Rappture::View fdfview2 -rows 2 -cols 1] 668 $v2 surf3d "fdfVol2" -at "1,1" -table "dataTable" \ 669 {"Xcoords" "Ycoords" "Zcoords" "Data1"} 670 $v2 surf3d "fdfVol3" -at "2,1" -table "dataTable" \ 671 {"Xcoords" "Ycoords" "Zcoords" "Data2"} 672 673 # create a view with two 3d surfaces in different visualization windows 674 # side by side 675 set v3 [Rappture::View fdfview3 -rows 1 -cols 2] 676 $v3 surf3d "fdfVol4" -at "1,1" -table "dataTable" \ 677 {"Xcoords" "Ycoords" "Zcoords" "Data1"} 678 $v3 surf3d "fdfVol5" -at "1,2" -table "dataTable" \ 679 {"Xcoords" "Ycoords" "Zcoords" "Data2"} 680 }}} 681 682 image <object> -at "row,col" 683 Purpose: populate a view object with an image 684 Input Arguments: 1 required, 1 optional 685 1. object - object representing the image 686 2. -at - position of the image within the view, row and column number 687 Return Value: None 688 Code Example: 689 {{{ 690 set i1 [Rappture::Image "image1" -label "ilabel1" -desc "idesc1"] 691 set i2 [Rappture::Image "image2" -label "ilabel2" -desc "idesc2"] 692 693 # create a view with two images in different windows 694 # one stacked on top of the other 695 set v1 [Rappture::View fdfview1 -rows 2 -cols 1] 696 $v1 image $i1 -at "1,1" 697 $v1 image $i2 -at "2,1" 698 699 # create a view with two images in different windows 700 # side by side 701 set v2 [Rappture::View fdfview2 -rows 1 -cols 2] 702 $v2 image $i1 -at "1,1" 703 $v2 image $i2 -at "1,2" 704 }}} 705 706 note <object> -at "row,col" 707 Purpose: populate a view object with a note 708 Input Arguments: 1 required, 1 optional 709 1. object - object representing the note 710 2. -at - position of the note within the view, row and column number 711 Return Value: None 712 Code Example: 713 {{{ 714 set i1 [Rappture::Note "note1" -label "nlabel1" -desc "ndesc1"] 715 set i2 [Rappture::Note "note2" -label "nlabel2" -desc "ndesc2"] 716 717 # create a view with two notes in different windows 718 # one stacked on top of the other 719 set v1 [Rappture::View fdfview1 -rows 2 -cols 1] 720 $v1 note $n1 -at "1,1" 721 $v1 note $n2 -at "2,1" 722 723 # create a view with two notes in different windows 724 # side by side 725 set v2 [Rappture::View fdfview2 -rows 1 -cols 2] 726 $v2 note $i1 -at "1,1" 727 $v2 note $i2 -at "1,2" 728 }}} 729
Note: See TracChangeset
for help on using the changeset viewer.