PEXOCCSetBFDataMappingMethod - Set Back-Facing Data Mapping Method (5.2)


Synopsis

 
   void PEXOCCSetBFDataMappingMethod(
           PEXOCC context,
           int method,
           unsigned int data_rec_len,
           PEXPointer data_rec
      )
 

Arguments

context
An OC context returned by a successful PEXCreateOCC call.

display (OCC)
A pointer to a display structure returned by a successful XOpenDisplay call.

resource_id (OCC)
The resource identifier of the renderer or structure.

req_type (OCC)
The request type for the output command (PEXOCRender, PEXOCStore, PEXOCRenderSingle or PEXOCStoreSingle).

method
The data mapping method (PEXDataMapNone or PEXDataMapColor)

data_rec_len
The length of the supplied data record.

data_rec
A pointer to the data record.

Returns

None.

Description

Invoke PEXOCCSetBFDataMappingMethod to create an attribute output command which sets the back-facing data mapping method in the renderer's pipeline state according to the value specified by method.

The data mapping method specifies the mapping of color, or other application-specific data, to intrinsic color. This is the first stage in the color pipeline.

By setting the back-facing data mapping method attribute's ASF to PEXIndividual (see PEXOCCSetIndividualASF), you use the pipeline state's back-facing data mapping method entry to define the method for mapping color, or other application-specific data, to intrinsic color. When you set the back-facing data mapping method attribute's ASF to PEXBundled, the implementation uses the back-facing data mapping method from the data mapping table.

To apply the back-facing data mapping method to the back-facing surfaces of output primitives, you must set the facet distinguish flag to True (see PEXOCCSetFacetDistinguishFlag). If you set the flag to False, then the implementation uses the data mapping method when rendering back-facing surfaces (see PEXOCCSetDataMappingMethod).

PEXlib defines the following back-facing data mapping methods (method):

PEXDataMapNone
prioritizes the source of the intrinsic color, from first to last, as vertex color (if defined with the primitive), facet color (if defined with the primitive), and surface color. This method does not require any data. (5.2)
PEXDataMapColor
you define a prioritized list, which includes at least one of three sources. The source of intrinsic color is the vertex color (if defined with the primitive), facet color (if defined with the primitive), or surface color. The prioritized list starts with your top choice. If there is no match between the prioritized list of source selectors and the data defined with a primitive being data mapped, or if the source selectors are otherwise invalid, then the surface color is used as the source. (5.2)

If the implementation does not support the specified data mapping method, then the method defaults to PEXDataMapNone.

If the data record size (data_rec_len) does not match the data mapping method (method) or if you specify an undefined source selector, then the implementation issues a BadPEXOutputCommand error.

This function is a member of the data mapping attribute set and affects all output primitives which can be data mapped.

Data Structures

The method PEXDataMapNone requires no data record.

The method PEXDataMapColor requires a list of source selectors chosen from the set (PEXDMMSurfaceColor, PEXDMMVertexColor, PEXDMMFacetColor). See PEXColorApproxEntry.

Errors

BadPEXOutputCommand
The data record is incorrect.
BadPEXRenderer
The specified renderer resource identifier is invalid.
BadPEXStructure
The specified structure resource identifier is invalid.

See Also

For an overview and for a list of output attribute functions, see Output Attribute Functions.