Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

contour_enable(3G)

fill_color(3G)

polygon_with_data3d(3G)

polyhedron_with_data(3G)

shade_mode(3G)

define_contour_table(3G)

NAME

define_contour_table − specify the scalar contour value to R,G,B color mapping for contouring

SYNOPSIS

C Syntax:

void define_contour_table(fildes,num_entries,min_contour,
max_contour,contour_table,contour_flag);
int fildes,num_entries,contour_flag;
float min_contour,max_contour,contour_table[];

FORTRAN77 Syntax:

subroutine define_contour_table(fildes,num_entries,min_contour,
max_contour,contour_table,contour_flag)
integer*4 fildes,num_entries,contour_flag
real min_contour,max_contour
real contour_table(num_entries*3+num_entries*contour_flag)

Pascal Syntax:

procedure define_contour_table(fildes,num_entries:integer;
min_contour,max_contour:real;
var contour_table array [lo..hi:integer] of real;
contour_flag:integer);

DESCRIPTION

Input Parameters

fildes Integer file descriptor returned by gopen when an I/O path to a graphic device is opened. 

num_entries Specifies the total number of entries in the contour table. 

min_contour The real scalar value represented by the first contour line. 

max_contour The real scalar value represented by the last contour line. 

contour_table The real array for mapping scalar contour values to R,G,B. 

contour_flag (INTERPOLATED or DEFINED) Describes the structure of the contour table. 

Discussion

define_contour_table specifies the mapping from user-supplied contour scalar values per vertex to R,G,B values for rendering contoured polyhedron_with_data or polygon_with_data3d primitives when contouring is enabled via contour_enable.  The contour table defines the scalar contour value transitions and their corresponding R,G,B values.  Contoured triangular and/or quadrilateral facets can be rendered using contoured lines (CONTOUR_LINE), solid contoured bands (CONTOUR_SOLID), or shaded contoured bands (CONTOUR_SHADED) (see contour_enable).  Note that the shade_mode must be CMAP_FULL or CMAP_MONOTONIC for contouring to function correctly. 
 
The structure of contour_table is determined by contour_flag.  The following gives a view of the two different structures of the contour table:

INTERPOLATED DEFINED
r1,g1,b1 tc1,r1,g1,b1
r2,g2,b2 tc2,r2,g2,b2
     .   .
     .   .
     .   .
r(E),g(E),b(E) tc(E),r(E),g(E),b(E)

 
where E=num_entries and rN,bN,gN is the Nth R,G,B value and tcN is the Nth transition contour value. 
 
If contour_flag is INTERPOLATED, then contour_table consists of the num_entries R,G,B triples.  To determine the corresponding scalar contour value transitions for this table, linear interpolation between the min_contour and max_contour values is performed.  The first R,G,B triple corresponds to all scalar contour values that are less than min_contour.  The second R,G,B triple is used for the contour starting at the min_contour value.  This means that the first valid contour transition value corresponds to the second contour table entry.  The next num_entries - 2 contour values are linearly interpolated between min_contour and max_contour and mapped to the corresponding R,G,B triple in the contour table.  The last R,G,B triple corresponds to all scalar contour values that are greater than or equal to max_contour.  The min_contour value must be less than or equal to the max_contour value. 
 
If contour_flag is DEFINED, then contour_table consists of the num_entries contour_value,R,G,B quadruples.  In this case, the contour table explicitly defines the transition contour scalar values and their corresponding colors and min_contour and max_contour are not used.  Note that with a DEFINED contour table, nonlinear contour intervals can be specified.  All contour values which are less than the transition contour value of the second contour table entry are mapped to the R,G,B values of the first contour table entry.  Therefore, the transition contour value for the first quadruple in the contour table is not used. 
 
The contour table must have at least two entries. An error is generated if num_entries is less than 2.  In this case, the default values are used. 
 
For CONTOUR_LINE contouring,  each contour scalar transition value implicitly or explicitly defined in the contour table corresponds to a contour line. This is not true for the first contour table entry since by definition the second contour table entry marks the first valid contour transition.  Therefore, the first contour line drawn corresponds to the second contour table entry transition value. 

DEFAULTS

The default behavior for contouring when no contour table is defined is that the interior appears as a white line at transition contour value 1.0 for CONTOUR_LINE and solid white for CONTOUR_SOLID or CONTOUR_SHADED. 

SEE ALSO

Starbase Reference: contour_enable(3G), fill_color(3G), polygon_with_data3d(3G), polyhedron_with_data(3G), shade_mode(3G). 
Starbase Device Drivers Manual. 

 

Hewlett-Packard Company  —  HP-UX Release 9.0: August 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026