.\"##
.\" $XConsortium: p302,v 5.2 94/04/17 20:57:57 rws Exp $
.\"##
.\"## 
$XMCOPY
.\"## Copyright (c) 1990, 1991 by Sun Microsystems, Inc. 
.\"## 
.\"##                         All Rights Reserved
.\"## 
.\"## Permission to use, copy, modify, and distribute this software and its 
.\"## documentation for any purpose and without fee is hereby granted, 
.\"## provided that the above copyright notice appear in all copies and that
.\"## both that copyright notice and this permission notice appear in 
.\"## supporting documentation, and that the name of Sun Microsystems,
.\"## not be used in advertising or publicity 
.\"## pertaining to distribution of the software without specific, written 
.\"## prior permission.  
.\"## 
.\"## SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 
.\"## INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
.\"## EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
.\"## CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
.\"## USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
.\"## OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\"## PERFORMANCE OF THIS SOFTWARE.
.ds f \s-2SET CURVE APPROXIMATION CRITERIA\s+2
.TH "SET CURVE APPROXIMATION CRITERIA" 3P+ "29 February 1991"
.SH NAME
SET CURVE APPROXIMATION CRITERIA \- create a structure element to set the curve approximation criteria
.IX "Aspect Source Flags" "SET CURVE APPROXIMATION CRITERIA"
.IX "Line Attributes" "SET CURVE APPROXIMATION CRITERIA"
.IX "Attributes, Line Attributes" "SET CURVE APPROXIMATION CRITERIA"
.\".IX "PHIGS Extension Functions" "SET CURVE APPROXIMATION CRITERIA"
.SH SYNOPSIS
.SS C Syntax
.ft B
.ta 1.25i 3i
.nf
void
pset_curve_approx ( type, value )
Pint	type;	\fIapproximation type\fP
Pfloat	value;	\fIapproximation value\fP
.fi
.ft R
.SS Required PHIGS Operating States
(PHOP, *, STOP, *)
.SH DESCRIPTION
.SS Purpose
\s-2SET CURVE APPROXIMATION CRITERIA\s+2 
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.  
.LP
When the current curve approximation criteria
Aspect Source Flag (\s-2ASF\s+2) is set to
\s-2INDIVIDUAL\s+2,
the current value of this attribute
defines the curve approximation criteria
to be applied to the following output primitive:
.RS
.LP
\(bu
.SM "NON-UNIFORM B-SPLINE CURVE"
.LP
\(bu
.SM "GENERALIZED DRAWING PRIMITIVE"
.LP
\(bu
.SM "GENERALIZED DRAWING PRIMITIVE 3"
.RE
.SS C Input Parameters
.IP \fItype\fP
The curve approximation type.  Possible values defined in phigs.h are:
.sp
.nf
.ta .5i
1	PCURV_WS_DEP
2	PCURV_CONSTANT_PARAMETRIC_BETWEEN_KNOTS
3	PCURV_CHORDAL_SIZE_WC
4	PCURV_CHORDAL_SIZE_NPC
5	PCURV_CHORDAL_SIZE_DC
6	PCURV_CHORDAL_DEVIATION_WC
7	PCURV_CHORDAL_DEVIATION_NPC
8	PCURV_CHORDAL_DEVIATION_DC
.ig XX
9	PCURV_REL_WC
10	PCURV_REL_NPC
11	PCURV_REL_DC
.XX
.fi
.sp
.IP \fIvalue\fP
The value to use when applying the specified approximation method.
Valid values depend on the approximation method specified.  See the
\fIExecution\fP section below for a description of the use of
\fIvalue\fP by each approximation method.
.SS Execution
.LP
Depending upon the edit mode, a \s-2SET CURVE APPROXIMATION CRITERIA\s+2
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 \s-2SET CURVE
APPROXIMATION CRITERIA\s+2 element.
.LP
The approximation methods corresponding to the defined approximation types
and the use of the approximation value by each method are:
.IP "\fIImplementation Dependent, Type 1\fP"
Use an implementation-dependent approximation method.
This method is defined by the server.
.IP "\fIConstant 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:
.RS
.IP
\(<= 0: Evaluate the curve only at the parameter limits and at the knots
that fall within the parameter limits.
.IP
> 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.
.RE
.IP "\fIChordal Size in WC, Type 3\fP"
Tessellate until the length in World Coordinates (\s-2WC\s+2) of 
every line segment
(chord) representing the curve is less than the specified positive
real-number approximation value.
.IP "\fIChordal Size in NPC, Type 4\fP"
Tessellate until the length in Normalized Projection Coordinates 
(\s-2NPC\s+2) of every line segment (chord) representing the curve 
is less than the specified positive real-number approximation value.
.IP "\fIChordal Size in DC, Type 5\fP"
Tessellate until the length in Device Coordinates (\s-2DC\s+2) of 
every line segment (chord) representing the curve 
is less than the specified positive real-number approximation value.
.ig XX
.LP
\s-2PEX-SI\s0 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.
.XX
.IP "\fIChordal Deviation in WC, Type 6\fP"
Tessellate until the absolute value of the maximum deviation measured in
\s-2WC\s+2 between the curve and approximating line segment (chord)
is less than the specified positive real-number approximation value.
.IP "\fIChordal Deviation in NPC, Type 7\fP"
Tessellate until the absolute value of the maximum deviation measured in
\s-2NPC\s+2 between the curve and approximation line segment (chord) is 
less than the specified positive real-number approximating value.
.IP "\fIChordal Deviation in DC, Type 8\fP"
Tessellate until the absolute value of the maximum deviation measured in
\s-2DC\s+2 between the curve and approximation line segment (chord) is 
less than the specified positive real-number approximating value.
.ig XX
.LP
\s-2PEX-SI\s0 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.
.XX
.ig XX
.IP "\fIRelative in WC, Type 9\fP"
Maintain a relative level in quality based on the tolerance value 
independent of scaling in World Coordinates.
.IP "\fIRelative in NPC, Type 10\fP"
Maintain a relative level in quality based on the tolerance value 
independent of scaling in Normalized Projection Coordinates.
.IP "\fIRelative in DC, Type 11\fP"
Maintain a relative level in quality based on the tolerance value 
independent of scaling in Deviation Coordinates.
.XX
.LP
At traversal time, the default approximation type is 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 
\s-2INQUIRE CURVE AND SURFACE FACILITIES\s+2,
or by consulting the relevant entries in
\s-2PHIGS WORKSTATION DESCRIPTION TABLE (7P)\s+2.
.LP
When the current curve approximation criteria \s-2ASF\s+2 is set to
\s-2INDIVIDUAL\s+2, output primitives that follow in
the structure network are filled using the current curve 
approximation criteria style.
.LP
When the current curve approximation criteria
\s-2ASF\s+2 is set to \s-2BUNDLED\s+2,
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 \s-2SET CURVE APPROXIMATION CRITERIA\s+2 has no effect.
.SH ERRORS
.IP 005
Ignoring function, function requires state 
(\s-2PHOP\s+2, \s-2*\s+2, \s-2STOP\s+2, \s-2*\s+2)
.SH SEE ALSO
.nf
.IP
.ta 0.5i
.SM "NON-UNIFORM B-SPLINE CURVE (3P+)"
.SM "INQUIRE CURVE AND SURFACE FACILITIES (3P+)"
.ig XX
.SM "SET INDIVIDUAL ASF (3P)"
.SM "INTRO PHIGS PLUS (3P+)"
.XX
.fi
