SET CURVE APPROXIMATION CRITERIA(3P+) — MISC. REFERENCE MANUAL PAGES
NAME
SET CURVE APPROXIMATION CRITERIA − create a structure element to set the curve approximation criteria
SYNOPSIS
C Syntax
void
psetcurvapprox ( type, value )
Pinttype;approximation type
Pfloatvalue;approximation value
FORTRAN Syntax
SUBROUTINE pscapx ( TYPE, VALUE )
INTEGERTYPEapproximation type
REALVALUEapproximation 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:
• NON-UNIFORM B-SPLINE CURVE
This is a SunPHIGS Extension function based on PHIGS+ and is not part of the PHIGS standard.
C Input Parameters
All of the following data types are predefined in phigs.h.
typeThe curve approximation type. Predefined values are:
0PCURV_WS_DEP
1PCURV_CONSTANT_PARAMETRIC
2PCURV_CONSTANT_PARAMETRIC_BETWEEN_KNOTS
3PCURV_METRIC_WC
4PCURV_METRIC_NPC
5PCURV_CHORDAL_DEVIATION_WC
6PCURV_CHORDAL_DEVIATION_NPC
valueThe 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.
TYPEThe curve approximation type. Predefined values are:
0PCAWSDWorkstation Dependent
1PCAEPConstant Parametric Subdivision
2PCAEPKConstant Parametric Subdivision Between Knots
3PCAMWMetric in WC
4PCAMNMetric in NPC
5PCACDWChordal Deviation in WC
6PCACDNChordal Deviation in NPC
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 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, the value 0.01 (1 percent) will be 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, the value 0.01 (1 percent) will be 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, a value of 1.0 will be used. The approximation types supported by a workstation type can be determined with the function INQUIRE CURVE AND SURFACE FACILITIES.
When the current curve approximation criteria ASF is set to INDIVIDUAL, NON-UNIFORM B-SPLINE CURVE output primitives which 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
005Ignoring function, function requires state (PHOP, ∗, STOP, ∗)
SEE ALSO
NON-UNIFORM B-SPLINE CURVE (3P+)
INQUIRE CURVE AND SURFACE FACILITIES (3P+)
SET INDIVIDUAL ASF (3P)
SET EXTENDED POLYLINE REPRESENTATION (3P+)
INTRO PHIGS+ (3P+)
Sun Release 4.0 — Last change: 28 July 1989