Vvidget Code Reference Manual

Vvidget Code > Dictionary > Perspective Volume Chart

This section explains how to form a dictionary for a Perspective Volume Chart such as this:

Rectilinear Perspective Volume Chart
Example

A perspective volume chart is a sequence of transformed scalars positioned on a regular 3D grid. Those scalars are mapped to a color using a color mapping. The specifics are determined by the template configuration which is a Vvidget Builder document. The Vvidget Builder manual explains those issues in more detail. If the color mapping coefficients are opaque then the volume appears solid. If it contains a transparent component then you can see into the volume and perhaps the volume will appear complex especially if the color map is setup correctly to make certain regions transparent and others opaque.

For more data exploration and layout the graph can be exported to Vvidget Builder where it can be rotated in realtime.

An example code fragment illustration follows:

/* Start of Illustration Code Fragment */

[constructor VC_append_key:"chart_type" string_value:@"perspective volume"];
[constructor VC_append_key:"chart_subtype" string_value:@"linear"];
[constructor VC_append_key:"chart_format_type" string_value:@"default"];
[constructor VC_append_key:"title" string_value:@"My Title"];
[constructor VC_append_key:"x_title" string_value:@"My X Title"];
[constructor VC_append_key:"y_title" string_value:@"My Y Title"];
[constructor VC_append_key:"z_title" string_value:@"My Z Title"];
[constructor VC_append_key:"grid_x_length" string_value:@"2"];
[constructor VC_append_key:"grid_x_minimum" string_value:@"1.0"];
[constructor VC_append_key:"grid_x_maximum" string_value:@"3.0"];
[constructor VC_append_key:"grid_y_length" string_value:@"2"];
[constructor VC_append_key:"grid_y_minimum" string_value:@"1.0"];
[constructor VC_append_key:"grid_y_maximum" string_value:@"3.0"];
[constructor VC_append_key:"grid_z_length" string_value:@"2"];
[constructor VC_append_key:"grid_z_minimum" string_value:@"1.0"];
[constructor VC_append_key:"grid_z_maximum" string_value:@"3.0"];
[constructor VC_append_key:"color_map_1_type" string_value:@"1"];
[constructor VC_append_key:"color_map_2_type" string_value:@"1"];
[constructor VC_append_key:"color_map_1_length" string_value:@"32"];
[constructor VC_append_key:"color_map_2_length" string_value:@"32"];
[constructor VC_append_key:"color_map_rgb_11" string_value:@"FF0000FF"];
[constructor VC_append_key:"color_map_rgb_12" string_value:@"FFFFFFFF"];
[constructor VC_append_key:"color_map_rgb_21" string_value:@"FFFFFFFF"];
[constructor VC_append_key:"color_map_rgb_22" string_value:@"0000FFFF"];
[constructor VC_append_key:"data_values" string_value:@"0.0 0.2 0.3 0.4 0.5 0.6 0.7 0.1"];

/* End of Illustration Code Fragment */

The code fragment above can be inserted into the illustration code section of the Illustration project for an immediate running Cocoa application. For additional information consult the Illustration section.

The following table defines the input string key and value pairs:

Chart Specific Entries
KeyValue Description
chart_type¹The string perspective volume, indicating a Perspective Volume Chart.
chart_subtype¹The string linear.
chart_format_type¹The string default.
titleThe main title of the graph. If this key is not present then the template's title is used.
x_titleThe x title of the graph. If this key is not present then the template's x-title is used.
y_titleThe y title of the graph. If this key is not present then the template's y-title is used.
z_titleThe z title of the graph. If this key is not present then the template's z-title is used.
grid_x_lengthThe number of grid cells in the x-direction.
grid_x_minimumThe minimum x-value of the grid.
grid_x_maximumThe maximum x-value of the grid.
grid_y_lengthThe number of grid cells in the y-direction.
grid_y_minimumThe minimum y-value of the grid.
grid_y_maximumThe maximum y-value of the grid.
grid_z_lengthThe number of grid cells in the z-direction.
grid_z_minimumThe minimum z-value of the grid.
grid_z_maximumThe maximum z-value of the grid.
color_map_1_typeThe color mapping type (0, 1, 2, 3).
color_map_1_lengthNumber of colors in map 1.
color_map_rgb_11Beginning color of the color mapping.
color_map_rgb_12Ending color of the color mapping.
color_map_2_typeThe color mapping type (0, 1, 2, 3).
color_map_2_lengthNumber of colors in map 2.
color_map_rgb_21Beginning color of the color mapping.
color_map_rgb_22Ending color of the color mapping.
templatesA custom Templates directory.
data_valuesA white space delimited list of values representing the density-values of the grid matrix. A density value is a value between zero and one inclusive. See Data Oriented keys for additional information and keys.

¹ Do not include this key value pair in the Interface Builder Plugin Inspector input string. It is included for you automatically.

If you incorporate this functionality into your own application then please consult Cocoa Programming. If you incorporate this functionality into CLI scripts then please consult Script Programming.

You can also modify the following Templates:

Template Document Names
TemplateDescription
PVST_Perspective_Volume_ChartForms the static attributes for the chart.

Please help improve this documentation. If a section is hard to understand, there is a typo, you would like a new section added, or you detect any other improvement that can be made then please email support@vvi.com with your information.




© Copyright 1993-2011 by VVimaging, Inc. (VVI); All Rights Reserved. Please email support@vvi.com with any comments you have concerning this documentation. See Legal for trademark and legal information.