udConvertCustomItem provides a way to convert proprietary or unsupported file formats to Unlimited Detail format
Settings the custom converts need to be aware of that are set by the user
Values:
| Value | Description |
|---|---|
udCCIF_None | No additional flags specified. |
udCCIF_SkipErrorsWherePossible | If its possible to continue parsing, that is perferable to failing. |
udCCIF_PolygonVerticesOnly | Do not rasterise the polygons, just use the vertices as points. |
udCCIF_BakeLighting | Bake normals into color channel for polygons conversion. |
udCCIF_ExportImages | Export images contained in e57 files. |
Indicates the geometry type of a vertex passed to pReadPrimitives
Values:
| Value | Description |
|---|---|
udPVT_Null | The vertex does not form part of a primitive. |
udPVT_Line | The vertex is the start point of a line, the next vertex will represent the endpoint. |
udPVT_Triangle | The next 3 vertices in the buffer represent a triangle. |
Indicates the geometry type of a vertex passed to pReadPrimitives
Values:
| Value | Description |
|---|---|
udPMF_None | Default material options. |
udPMF_Filter | Apply bilinear filtering to the texture. |
udPMF_Clamp | Apply clamping to the texture. |
Adds a prefilled udConvertCustomItem to a udConvertContext
| Parameter | Description |
|---|---|
pConvertContext | The convert context to add the item to |
pCustomItem | The custom convert item to add |
Returns: A udError value based on the result of adding the item
Registers a format in the udConvertContext to allow users to just call udConvert_AddItem
!NOTE pTryAddItem needs to handle being called if a file doesn’t match any of the extensions
| Parameter | Description |
|---|---|
pConvertContext | The convert context to register the format with |
pExtensionCheck | The callback used to determine if the format should be used, returns 1 when a match, 0 otherwise |
pTryAddItem | The callback used when calling udConvert_AddItem needs to populate the pCustomItem parameter, returns udE_Success on success |
Returns: A udError value based on the result of registering the format
Gets the id of a material suitable for use in a primitive
| Parameter | Description |
|---|---|
pConvertItem | The convert item to get the material ID from |
pMaterialID | A pointer to the ID to be populated. |
pTexturePath | THe path to the texture to be used in the material |
textureFlags | flags indicating how the texture is processed |
Returns: A udError value based on the result of getting the texture ID
Estimates the number of points generated by a vertex buffer when passed to a udPrimitive convert.
| Parameter | Description |
|---|---|
pBuffer | The buffer of vertices as passed to pReadPrimitives, each vertex must have at minimum a udPrimitiveID indicating the type of primitive (udPVT_Line or udPVT_Triangle) |
gridResolution | The resolution that the conversion takes place at |
pPointCount | a pointer to which the resultant estimate will be written |
Returns: A udError value based on the result of estimating the number of points generated by the vertex buffer
Allows for conversion of custom data formats to UDS
| Field | Type | Description |
|---|---|---|
flags) | enum [udError](udError.md) (\*pOpen)(struct udConvertCustomItem \*pConvertInput, uint32_t everyNth, double pointResolution, enum udConvertCustomItemFlags | Open the file and provide information on the file (bounds, point count, etc.). |
pBuffer) | enum [udError](udError.md) (\*pReadPointsFloat)(struct udConvertCustomItem \*pConvertInput, struct [udPointBufferF64](udPointBuffer.md) \* | Provide position and attribute data to convert to UDS. |
pBuffer) | enum [udError](udError.md) (\*pReadPrimitives)(struct udConvertCustomItem \*pConvertInput, struct [udPointBufferF64](udPointBuffer.md) \* | Provide vertex data of primitives to convert to UDS. |
pConvertInput) | void (\*pDestroy)(struct udConvertCustomItem \* | Cleanup all memory related to this custom convert item. |
pConvertInput) | void (\*pClose)(struct udConvertCustomItem \* | This function will be called on completion of reading the file. |
pData | void \* | Private user data relevant to the specific geomtype, must be freed by the pClose function. |
pName | const char \* | Filename or other identifier. |
boundMin[3] | double | Optional (see boundsKnown) source space minimum values. |
boundMax[3] | double | Optional (see boundsKnown) source space maximum values. |
sourceResolution | double | Source resolution (eg 0.01 if points are 1cm apart). 0 indicates unknown. |
pointCount | int64_t | Number of points coming, -1 if unknown. |
srid | int32_t | If non-zero, this input is considered to be within the given srid code (useful mainly as a default value for other files in the conversion). |
attributes | struct [udAttributeSet](udAttributes.md) | Content of the input; this might not match the output. |
boundsKnown | uint32_t | If not 0, boundMin and boundMax are valid, if 0 they will be calculated later. |
pointCountIsEstimate | uint32_t | If not 0, the point count is an estimate and may be different. |
pReserved | void \* | Contains information used in primitive convert. |