Editing
Vtk/XYPlotTutorial
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Understanding Role of Various Modules== 3. In Figure 2, we have rearranged the layout of the workflow in order to make the differentiation of tasks clearer; the snapshot of this workflow layout also has been annotated in order to aid in differentiation of tasks. The overall functionality of the workflow has not changed and execution will produce the same composite rendered image as displayed, above, in the bottom panel of Figure 1. <table align="center" border="1"> <tr><th align="center">Figure 2: Rearranged Workflow</th></tr> <tr> <td align="center"> [[File:WorkflowRearranged.png|350px|Default Workflow]] </td> </tr> </table> * To the left of the vertical yellow line in Figure 2, several distinct module groups have been identified by the three blue-bordered boxes: ** The uppermost group of modules is used to read in the 3D, "comb" fluid flow data set. ** The lower, left-most blue-bordered box identifies the modules that are used to draw the (black) boundaries of the 3D data set in the lefthand "live" portion of the spreadsheet window. ** The lower, right-most blue-bordered box identifies the group of modules that is used to draw three vertical, multi-colored "posts" inside of the 3D volume. The location, tilt, length, radius, etc. of each "post" is prescribed by variable values that have been specified inside one of the three vtkProbeFilter modules (found to the right of the vertical yellow line in Figure 2). * Modules that lie to the right of the vertical yellow line in Figure 2 are used to draw the set of three different 2D line-plots; for the most part, these have, in turn, been grouped into three sets (columns) containing an identical set of modules. Each column of modules in the Figure 2 workflow diagram is used to draw one of the three separate 2D line-plots. 4. Placing each 2D Plot As we shall explore more fully below, the vtkXYPlotActor module plays a key role in specifying the layout and annotation of each 2D plot, as the module contains a large number of methods whose values can be specified by the user. In §4.12, the [http://www.kitware.com/products/books/vtkguide.html ''VTK User's Guide''] explicitly describes how the location and relative size of an individual plot is specified. The following explanation is provided: <div id="SetPosition"> <table border="1" align="center" width="600px" cellpadding="8"> <tr> <td align="left" colspan="3"> "The PositionCoordinate instance variable defines the location of the lower-left corner of the x-y plot (specified in normalized viewport coordinates), and the Position2Coordinate instance variable defines the upper-right corner. (Note: The Position2Coordinate is relative to PositionCoordinate, so you can move the vtkXYPlotActor around the viewport by setting just the PositionCoordinate.) The combination of the two position coordinates specifies a rectangle in which the plot will lie." </td> </tr> <tr> <td align="center"> [[File:SetPosition1.png|200px|First SetPosition]] </td> <td align="center"> [[File:SetPosition2.png|200px|Second SetPosition]] </td> <td align="center"> [[File:SetPosition3.png|200px|Third SetPosition]] </td> </tr> </table> </div> So, "SetPosition" is essentially the x-y coordinates of the ''location'' of the bottom-left corner of a 2D plot, while "SetPosition2" essentially specifies the width and height of the 2D plot. The default values specified for "SetPosition" and for "SetPosition2" in all three of the 2D plots are shown here, immediately following the above quote. Notice that all three have same width/height specifications (100% & 33%; see SetPosition2 values), but the bottom-left corner location differs. 5. Demonstrate the functionality of each identified module grouping: * Suppose we want to remove all three 2D plots and just render the 3D configuration that is displayed in the lefthand portion of the default spreadsheet image (bottom panel of Figure 1)? We should be able to do this inside the workflow window by severing the connection between the vtkCell module and the right-most vtkRenderer module — the one used to draw all of the 2D line-plots. Figure 3A shows this modified (severed) workflow (top panel) as well as the resulting spreadsheet image (bottom panel). *The result is that the rendered 3D image (left half of the lower, Figure 3A panel image) is fine, but a garbage image has been drawn in the right half of the image. * Looking more closely at the list of methods that are available in the vtkRenderer module [see righthand list in the top (workflow) panel of Figure 3A], we see that, for the default demonstration, the "SetViewport" coordinates were set to (0.0,0.0) and (0.5, 1.0). These coordinates effectively play the same role as the [[#SetPosition|SetPosition and SetPosition2 coordinates discussed above]], in that the first pair specifies the location of the lower left-hand corner of the image ''within the spreadsheet window'' while the second pair specifies the width/height of the image in that window. Notice that, by default, the 3D "live" image is set up to fill only 50% of the window. As is illustrated in the two panels of Figure 3B, by changing the second coordinate pair to (1.0,1.0), the problem is fixed as the rendered 3D image (bottom panel) is stretched across 100%, rather than just 50%, of the spreadsheet window. <table align="center" border="1"> <tr><th align="center" colspan="3">Remove 2D Plots</th></tr> <tr> <th align="center">Figure 3A: Default Viewport Value</th> <th align="center" rowspan="3" width="5%" bgcolor="black"> </th> <th align="center">Figure 3B: Modified Viewport Value</th> </tr> <tr> <td align="center"> [[File:Figure3Workflow.png|350px|Default Workflow]] </td> <td align="center"> [[File:Figure3BWorkflow.png|350px|Default Workflow]] </td> </tr> <tr> <td align="center"> [[File:Figure3A.png|350px|Default Spreadsheet Figure]] </td> <td align="center"> [[File:Figure3B.png|350px|Default Spreadsheet Figure]] </td> </tr> </table> * The workflow displayed in the top panel of Figure 4 has been modified (from the one shown in Figure 2) to generate only a single 2D plot, and to stretch the plot (bottom panel of Figure 4) so that its height matches the the height of the spreadsheet window. Specifically, the modified workflow contains only one set — instead of three sets — of modules dedicated to drawing a 2D x-y plot (the set of modules enclosed by the blue-bordered box) and, inside the vtkXYPlotActor module, the "SetPosition2" coordinate-pair has been set to (1.0, 1.0). Other parameter-value modifications are discussed below. <table align="center" border="1"> <tr><th align="center">Figure 4: Displaying a Single 2D Plot</th></tr> <tr> <td align="center"> [[File:Figure4WorkflowA.png|350px|Default Workflow]] </td> </tr> <tr> <td align="center"> [[File:Figure4Single2Dplot.png|350px|Default Spreadsheet Figure]] </td> </tr> </table>
Summary:
Please note that all contributions to JETohlineWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
JETohlineWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Tiled Menu
Table of Contents
Old (VisTrails) Cover
Appendices
Variables & Parameters
Key Equations
Special Functions
Permissions
Formats
References
lsuPhys
Ramblings
Uploaded Images
Originals
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information