PEXOCCSetDataMappingMethod - Set Data Mapping Method (5.2)


Synopsis

 
   void PEXOCCSetDataMappingMethod(
        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 PEXOCCSetDataMappingMethod to create an output primitive which sets the data mapping method in the renderer's pipeline state according to the value specified by method.

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

If you do not set the facet distinguish flag to True (see PEXOCCSetFacetDistinguishFlag), then the implementation applies this data mapping method to back-facing as well as front-facing surfaces of output primitives. Otherwise the implementation uses the back-facing data mapping method (see PEXOCCSetBFDataMappingMethod).

PEXlib defines the following 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 -
defines 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.

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).

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.