.\"##
.\" $XConsortium: p374,v 5.2 94/04/17 20:58:48 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 SURFACE APPROXIMATION CRITERIA\s+2
.TH "SET SURFACE APPROXIMATION CRITERIA" 3P+ "29 February 1991"
.SH NAME
SET SURFACE APPROXIMATION CRITERIA \- create a structure element to set the 
surface approximation criteria
.IX "PHIGS Extension Functions" "SET SURFACE APPROXIMATION CRITERIA"
.IX "Aspect Source Flags" "SET SURFACE APPROXIMATION CRITERIA"
.IX "Filled Area Interior Attributes" "SET SURFACE APPROXIMATION CRITERIA"
.IX "Attributes, Filled Area Interior Attributes" "SET SURFACE APPROXIMATION CRITERIA"
.SH SYNOPSIS
.SS C Syntax
.ft B
.ta 1.25i 3i
.nf
void
pset_surf_approx ( type, uvalue, vvalue )
Pint	type;	\fIapproximation type\fP
Pfloat	uvalue;	\fIapproximation value for u dimension\fP
Pfloat	vvalue;	\fIapproximation value for v dimension\fP
.fi
.ft R
.SS Required PHIGS Operating States
(PHOP, *, STOP, *)
.SH DESCRIPTION
.SS Purpose
\s-2SET SURFACE APPROXIMATION CRITERIA\s+2
places into the currently open structure a structure element
that specifies the surface approximation type and values.
The surface approximation type controls the display precision of
non-uniform B-spline surfaces by specifying the method to use to render the
surface.  The approximation values are used in a type-specific way,
as described in the \fIExecution\fP section below.
.LP
When the current surface approximation criteria
Aspect Source Flag (\s-2ASF\s+2) is set to
\s-2INDIVIDUAL\s+2,
the current value of this attribute
defines the surface approximation criteria
to be applied to the following output primitive:
.RS
.ta 0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i
.LP
\(bu
.SM "NON-UNIFORM B-SPLINE SURFACE"
.ta
.RE
.SS C Input Parameters
.IP \fItype\fP
The surface approximation type.  Possible values defined in phigs.h are:
.sp
.nf
.ta .5i
1	PSURF_WS_DEP
2	PSURF_CONSTANT_PARAMETRIC_BETWEEN_KNOTS
3	PSURF_CHORDAL_SIZE_WC
4	PSURF_CHORDAL_SIZE_NPC
5	PSURF_CHORDAL_SIZE_DC
6	PSURF_PLANAR_DEVIATION_WC
7	PSURF_PLANAR_DEVIATION_NPC
8	PSURF_PLANAR_DEVIATION_DC
.ig XX
9	PSURF_REL_WC
10	PSURF_REL_NPC
11	PSURF_REL_DC
.XX
.fi
.sp
.IP "\fIuvalue, vvalue\fP"
The values to use when applying the specified approximation method.
Valid values depend on the approximation method. The
value for the \fIu\fP dimension is \fIuvalue\fR. The value
for the \fIv\fP dimension is \fIvvalue\fR. See the \fIExecution\fP
section below for a description of the use of these values by
each approximation method.
.SS Execution
.LP
Depending upon the edit mode, a \s-2SET SURFACE APPROXIMATION CRITERIA\s+2 
element is either 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 SURFACE APPROXIMATION CRITERIA\s+2 element.
.LP
The approximation methods corresponding to the defined approximation types
and the use of the approximation values by each method are:
.IP "\fIWorkstation 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 the \fIuknots\fR
and the \fIvknots\fR.
The integer portion of the \fIu\fR and \fIv\fR approximation values are used and
interpreted as follows:
.RS
.IP
\(<= 0: Evaluate the surface only at the parameter limits and at the knots
that fall within the parameter limits.
.IP
> 0: Evaluate the surface at the parameter limits, at the knots that fall
within the parameter limits, and at the \fIuvalue\fR or \fIvvalue\fR number of
positions between the knots, but only if the position is within
the parameter limits.
.RE
.IP "\fIChordal Size in WC, Type 3\fP"
Tessellate until the maximum length chord measured in World Coordinates (WC)
for both the \fIu\fP and \fIv\fP dimensions is less than the corresponding
positive real-number approximation value,
\fIuvalue\fR and \fIvvalue\fR, respectively.
.IP "\fIChordal Size in NPC, Type 4\fP"
Tessellate until the maximum length chord measured in Normalized 
Projection Coordinates (NPC)
for both the \fIu\fP and \fIv\fP dimensions is less than the corresponding
positive real-number approximation value,
\fIuvalue\fR and \fIvvalue\fR, respectively.
.IP "\fIChordal Size in DC, Type 5\fP"
Tessellate until the maximum length chord measured in 
Device Coordinates (DC)
for both the \fIu\fP and \fIv\fP dimensions is less than the corresponding
positive real-number approximation value,
\fIuvalue\fR and \fIvvalue\fR, respectively.
.IP "\fIPlanar Deviation in WC, Type 6\fP"
Tessellate until the absolute value of the deviation measured in
WC between the surface and the generated planar
sub-primitives is less than the specified positive real-number
approximation value.
.IP "\fIPlanar Deviation in NPC, Type 7\fP"
Tessellate until the absolute value of the deviation measured in
NPC between
the surface and the generated planar sub-primitives is less than the
specified positive real-number approximation value.
.IP "\fIPlanar Deviation in DC, Type 8\fP"
Tessellate until the absolute value of the deviation measured in
DC between the surface and the generated planar sub-primitives is less than the
specified positive real-number approximation value.
.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 NPC coordinates.
.IP "\fIRelative in DC, Type 11\fP"
Maintain a relative level in quality based on the tolerance value 
independent of scaling in DC 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 values are inconsistent with the specified approximation
type, values of 1.0 is 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 surface approximation criteria \s-2ASF\s+2 is set to
\s-2INDIVIDUAL\s+2, area-defining output primitives that follow in
the structure network are filled using the current curve 
approximation criteria style.
.LP
When the current surface approximation criteria
\s-2ASF\s+2 is set to \s-2BUNDLED\s+2,
the surface approximation criteria is taken from the
workstation extended representation indicated by the current interior index.
In this case, the surface approximation criteria
set with \s-2SET SURFACE 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)
.IP 138
Ignoring function, one or more of the fields in the specified
data record are inconsistent with the specified type
.SH SEE ALSO
.nf
.IP
.ta 0.5i
.SM "NON-UNIFORM B-SPLINE SURFACE (3P+)"
.\" .SM "SET TRIMMING CURVE APPROXIMATION CRITERIA (3P+)"
.SM "INQUIRE CURVE AND SURFACE FACILITIES (3P+)"
.ig XX
.SM "SET INDIVIDUAL ASF (3P)"
.SM "SET INTERIOR REPRESENTATION PLUS (3P+)"
.XX
.fi
