SunPHIGS 3.0 Extensions Reference Manual
只搜寻这本书
以 PDF 格式下载本书

NAME

SET CURVE APPROXIMATION CRITERIA - create a structure element to set the curve approximation criteria

SYNOPSIS

C Syntax

void
pset_curve_approx ( type, value )
Pint     type;    approximation type
Pfloat    value;   approximation value

FORTRAN Syntax

SUBROUTINE pscapx ( TYPE, VALUE )
INTEGER      TYPE       approximation type
REAL         VALUE      approximation value

Required PHIGS Operating States

(PHOP, * ,STOP, * )

DESCRIPTION

Purpose

SET CURVE APPROXIMATION CRITERIA places into the currently open structure a structure element that specifies the curve approximation type and value. The curve approximation type controls the display precision of non-uniform B-spline curves by specifying the method to use to render the curve.
When the current curve approximation criteria Aspect Source Flag (ASF) is set to INDIVIDUAL, the current value of this attribute defines the curve approximation criteria to be applied to the following output primitives:
GENERALIZED DRAWING PRIMITIVE
GENERALIZED DRAWING PRIMITIVE 3
NON-UNIFORM B-SPLINE CURVE
This is a SunPHIGS Extension function based on PHIGS PLUS and is not part of the PHIGS standard.

C Input Parameters

The following data types are predefined in phigs.h.
type
The curve approximation type. Predefined values are:
0
PCURV_WS_DEP
1
PCURV_CONSTANT_PARAMETRIC
2
PCURV_CONSTANT_PARAMETRIC_BETWEEN_KNOTS
3
PCURV_METRIC_WC
4
PCURV_METRIC_NPC
5
PCURV_CHORDAL_DEVIATION_WC
6
PCURV_CHORDAL_DEVIATION_NPC
value
The value to use when applying the specified approximation method. Valid values depend on the approximation method specified. See the Execution section below for a description of the use of value by each approximation method.

FORTRAN Input Parameters

All of the following data types are predefined in phigs77.h.
TYPE
The curve approximation type. Predefined values are:
1   PCAWSD     Workstation-dependent
2   PCAEPK     Constant Parametric Subdivision Between Knots
3   PCACSW     Chordal Size in WC
4   PCACSN     Chordal Size in NPC
5   PCACSD     Chordal Size in DC
6   PCACDW     Chordal Deviation in WC
7   PCACDN     Chordal Deviation in NPC
8   PCACDD     Chordal Deviation in DC

VALUE The value to use when applying the specified approximation method. Valid
values depend on the approximation type specified. See the Execution section below for a description of the use of .I "VALUE" by each approximation method.

Execution

Depending upon the edit mode, a SET CURVE APPROXIMATION CRITERIA element is inserted into the open structure after the element pointer, or replaces the element pointed at by the element pointer. The element pointer is then updated to point to this SET CURVE APPROXIMATION CRITERIA element.
The approximation methods corresponding to the defined approximation types and the use of the approximation value by each method are:
Workstation-dependent, Type 0
Use a workstation-dependent approximation method. Currently all SunPHIGS Extension workstation types use method 2 (Constant Parametric Subdivision Between Knots) as the workstation-dependent method. The approximation value has the same usage as for that method.
Constant Parametric Subdivision, Type 1
Tessellate using equal parametric increments along the entire curve. The integer portion of the approximation value is used and interpreted as follows:
. 0: Evaluate the curve only at the parameter limits (thus generating a single line per curve).
> 0: Evaluate the curve at the parameter limits and at the specified number of positions between the parameter limits.
Constant Parametric Subdivision Between Knots, Type 2
Tessellate using equal parametric increments between each pair of knots on the curve. The integer portion of the approximation value is used and interpreted as follows:
. 0: Evaluate the curve only at the parameter limits and at the knots that fall within the parameter limits.
> 0: Evaluate the curve at the parameter limits, at the knots that fall within the parameter limits, and at the specified number of positions between each pair of knots, but only if the position is within the
parameter limits.
Metric in WC, Type 3
Tessellate until the length in World Coordinates (WC) of every line segment (chord) representing the curve is less than the specified positive real-number approximation value.
Metric in NPC, Type 4
Tessellate until the length in Normalized Projection Coordinates (NPC) of every line segment (chord) representing the curve is less than the specified positive real-number approximation value.
SunPHIGS Extensions approximates this approximation type by a different adaptive method. The method used adjusts the tessellation of the curve according to the modelling and viewing transforms in effect when the curve is traversed. The approximation value corresponds to the maximum length of a tessellated segment, as a percentage of the workstation viewport. If an approximation value less than, or equal to, 0.0 is specified, then the value 0.01 (1 percent) is used.
Chordal Deviation in WC, Type 5
Tessellate until the absolute value of the maximum deviation measured in WC between the curve and approximating line segment (chord) is less than the specified positive real-number approximation value.
Chordal Deviation in NPC, Type 6
Tessellate until the absolute value of the maximum deviation measured in NPC between the curve and approximation line segment (chord) is less than the specified positive real-number approximating value.
SunPHIGS Extensions approximates this approximation type by a different adaptive method. The method used adjusts the tessellation of the curve according to the modelling and viewing transforms in effect when the curve is traversed. The approximation value corresponds to the maximum length of a tessellated segment, as a percentage of the workstation viewport. If an approximation value less than, or equal to, 0.0 is specified, then the value 0.01 (1 percent) is used.
At traversal time, approximation type zero (Workstation-dependent) and an approximation value of 1.0 are used if the specified approximation type is not supported by the workstation. If the approximation value is inconsistent with the specified approximation type, then a value of 1.0 is used. To determine the approximation types supported by a workstation type, see INQUIRE CURVE AND SURFACE FACILITIES, or the relevant entries in PHIGS WORKSTATION DESCRIPTION TABLE (7P).
When the current curve approximation criteria ASF is set to INDIVIDUAL, output primitives that follow in the structure network are filled using the current curve approximation criteria style.
When the current curve approximation criteria ASF is set to BUNDLED, the curve approximation criteria is taken from the workstation extended representation indicated by the current polyline index. In this case, the curve approximation criteria set with SET CURVE APPROXIMATION CRITERIA has no effect.

ERRORS

005
Ignoring function, function requires state (PHOP, * ,STOP, * )

SEE ALSO

NON-UNIFORM B-SPLINE CURVE (3PP)
INQUIRE CURVE AND SURFACE FACILITIES (3PP)
SET INDIVIDUAL ASF (3P)
INTRO (3PP)
GENERALIZED DRAWING PRIMITIVE (3P)
GENERALIZED DRAWING PRIMITIVE 3 (3P)
PHIGS WORKSTATION DESCRIPTION TABLE (7P)