ArcGIS Procedural Runtime
3.2.10650
|
The Procedural Runtime API namespace. The prt namespace contains the top level entry points into the Procedural Runtime API.
Namespaces | |
StringUtils | |
Utilities for string encoding. | |
Functions | |
Status | addLogHandler (LogHandler *logHandler) |
DecoderInfo const * | createDecoderInfo (const wchar_t *decoderId, Status *stat=nullptr) |
EncoderInfo const * | createEncoderInfo (const wchar_t *encoderId, Status *stat=nullptr) |
ResolveMap const * | createResolveMap (const wchar_t *rpkOrResURI, const wchar_t *unpackFileSystemPath=nullptr, Status *stat=nullptr) |
RuleFileInfo const * | createRuleFileInfo (const wchar_t *ruleFileURI, Cache *cache=nullptr, Status *stat=nullptr) |
const AttributeMap * | createTextureMetadata (const wchar_t *uri, Cache *cache=nullptr, Status *stat=nullptr) |
Status | encodeTexture (const AttributeMap *metadata, const uint8_t *pixeldata, const wchar_t *encoderId, const AttributeMap *encoderOptions, SimpleOutputCallbacks *soc) |
Status | generate (const InitialShape *const *initialShapes, size_t initialShapeCount, const OcclusionSet::Handle *occlusionHandles, const wchar_t *const *encoders, size_t encodersCount, const AttributeMap *const *encoderOptions, Callbacks *callbacks, Cache *cache, const OcclusionSet *occlSet, const AttributeMap *generateOptions=nullptr) |
Status | generate (const InitialShape *const *initialShapes, size_t initialShapeCount, const OcclusionSet::Handle *occlusionHandles, const wchar_t *const *encoders, size_t encodersCount, const AttributeMap *const *encoderOptions, Callbacks *callbacks, Cache *cache, const OcclusionSet *const *occlSets, const size_t *occlSetCounts, const AttributeMap *generateOptions=nullptr) |
Status | generateOccluders (const InitialShape *const *initialShapes, size_t initialShapeCount, OcclusionSet::Handle *occlusionHandles, const wchar_t *const *encoders, size_t encodersCount, const AttributeMap *const *encoderOptions, Callbacks *callbacks, Cache *cache, OcclusionSet *occlSet, const AttributeMap *generateOptions=nullptr) |
LogLevel | getLogLevel (Status *status=nullptr) |
const char * | getStatusDescription (Status stat) |
Status | getTexturePixeldata (const wchar_t *uri, uint8_t *buffer, size_t bufferSize, Cache *cache=nullptr) |
Version const * | getVersion () |
const Object * | init (const wchar_t *const *prtPlugins, size_t prtPluginsCount, LogLevel logLevel, Status *stat=nullptr) |
wchar_t * | listDecoderIds (wchar_t *result, size_t *resultSize, Status *stat=nullptr) |
wchar_t * | listEncoderIds (wchar_t *result, size_t *resultSize, Status *stat=nullptr) |
Status | log (const wchar_t *msg, LogLevel level) |
Status | removeLogHandler (LogHandler *logHandler) |
Status | setLogLevel (LogLevel level) |
Classes | |
class | Annotation |
class | AnnotationArgument |
class | Attributable |
class | AttributableSetter |
class | AttributeMap |
class | AttributeMapBuilder |
class | Cache |
class | CacheObject |
class | Callbacks |
class | ConsoleLogHandler |
class | DecoderInfo |
class | EncoderInfo |
class | FileLogHandler |
class | FileOutputCallbacks |
class | InitialShape |
class | InitialShapeBuilder |
class | LogHandler |
class | MemoryOutputCallbacks |
class | Object |
class | OcclusionSet |
class | ResolveMap |
class | ResolveMapBuilder |
class | RuleFileInfo |
class | SimpleOutputCallbacks |
struct | Version |
enum prt::CGAErrorLevel |
enum prt::ContentType |
Encodes the types handled by Decoders and Encoders.
Enumerator | |
---|---|
CT_UNDEFINED | Extension does not make use of specific content type. |
CT_GEOMETRY | Extension can handle geometries (and potentially also materials and textures). |
CT_MATERIAL | Extension can handle materials (and potentially also textures). |
CT_TEXTURE | Extension can handle textures. |
CT_SHADER | (Reserved) Extension can handle shader resources. |
CT_CGB | Extension can handle CGB resources. |
CT_INITIALSHAPE | (Reserved) extension can handle initial shape. |
CT_CGAERROR | Extension can handle CGA errors. |
CT_CGAPRINT | Extension can handle CGA print output (see cga print()). |
CT_CGAREPORT | Extension can handle CGA reports (see cga report()). |
CT_ATTRIBUTE | Extension can handle CGA attributes. |
CT_SHAPETREE | Extension can handle shape trees. |
CT_STRING | Extension can handle strings. |
CT_TABLE | Extension can handle tables. |
CT_COUNT | Sentinel value. |
enum prt::LogLevel |
Log levels for the the logger.
enum prt::Status |
The Status enum is used to indicate whether a function was successful or not.
Status prt::addLogHandler | ( | LogHandler * | logHandler | ) |
Register a log handler, can be called at any time (also before init()). Is thread-safe.
logHandler | LogHandler to register. |
DecoderInfo const* prt::createDecoderInfo | ( | const wchar_t * | decoderId, |
Status * | stat = nullptr |
||
) |
Creates an DecoderInfo instance for the given decoder id.
Must be called after init(), will return STATUS_NOT_INITIALIZED else. Is thread-safe. The returned instance must be destroyed by the caller.
decoderId | ID of decoder to get DecoderInfo for. | |
[out] | stat | Optional pointer to return the Status. |
EncoderInfo const* prt::createEncoderInfo | ( | const wchar_t * | encoderId, |
Status * | stat = nullptr |
||
) |
Creates an EncoderInfo instance for the given encoder id.
Must be called after init(), will return STATUS_NOT_INITIALIZED else. Is thread-safe. The returned instance must be destroyed by the caller.
encoderId | ID of encoder to get EncoderInfo for. | |
[out] | stat | Optional pointer to return the Status. |
ResolveMap const* prt::createResolveMap | ( | const wchar_t * | rpkOrResURI, |
const wchar_t * | unpackFileSystemPath = nullptr , |
||
Status * | stat = nullptr |
||
) |
Create a ResolveMap for a rpk or a resource which contains embedded resources. The entries will point into the rpk or the passed resource.
Must be called after init(), will return STATUS_NOT_INITIALIZED else. Is thread-safe. The returned instance must be destroyed by the caller.
rpkOrResURI | URI to the rpk or the resource, see Application Notes for URI creation. | |
unpackRPKToFileSystemPath | Optional. If non-null, the rpk / resource gets unpacked to the given directory in the filesystem and the ResolveMap entries will point to those files. | |
[out] | stat | Optional pointer to return the Status. |
RuleFileInfo const* prt::createRuleFileInfo | ( | const wchar_t * | ruleFileURI, |
Cache * | cache = nullptr , |
||
Status * | stat = nullptr |
||
) |
Creates a RuleFileInfo instance for a cgb file.
Must be called after init(), will return STATUS_NOT_INITIALIZED else. Is thread-safe. The returned instance must be destroyed by the caller.
ruleFileURI | URI to the cgb file, see Application Notes for URI creation. | |
cache | Optional Cache instance. | |
[out] | stat | Optional pointer to return the Status. |
const AttributeMap* prt::createTextureMetadata | ( | const wchar_t * | uri, |
Cache * | cache = nullptr , |
||
Status * | stat = nullptr |
||
) |
Creates a AttributeMap with the metadata for a given texture URI. See prtx::Texture for a list of supported metadata attributes.
Must be called after init(), will return STATUS_NOT_INITIALIZED else. Is thread-safe. The returned instance must be destroyed by the caller.
uri | URI of the texture, see Application Notes for URI creation. | |
cache | Optional Cache instance. | |
[out] | stat | Optional pointer to return the Status. |
Status prt::encodeTexture | ( | const AttributeMap * | metadata, |
const uint8_t * | pixeldata, | ||
const wchar_t * | encoderId, | ||
const AttributeMap * | encoderOptions, | ||
SimpleOutputCallbacks * | soc | ||
) |
Encodes the passed texture and writes the result to the passed SimpleOutputCallbacks instance.
metadata | The textures metadata, must contain width/height/format attributes. Other attributes are optional and it depends on the encoder whether they are supported. See prtx::Texture for a list of supported metadata attributes. |
pixeldata | The pixeldata to encode |
encoderId | Id of the encoder to use. |
encoderOptions | Options for the encoder. This includes the filename. |
soc | The SimpleOutputCallbacks instance which will receive the encoded texture. |
Status prt::generate | ( | const InitialShape *const * | initialShapes, |
size_t | initialShapeCount, | ||
const OcclusionSet::Handle * | occlusionHandles, | ||
const wchar_t *const * | encoders, | ||
size_t | encodersCount, | ||
const AttributeMap *const * | encoderOptions, | ||
Callbacks * | callbacks, | ||
Cache * | cache, | ||
const OcclusionSet * | occlSet, | ||
const AttributeMap * | generateOptions = nullptr |
||
) |
Generate and encode procedural models for a number of initial shapes.
Must be called after init(), will return STATUS_NOT_INITIALIZED else. Is thread-safe.
initialShapes | The initial shapes for which the procedural models have to be generated. |
initialShapeCount | The number of initial shapes in the array. |
occlusionHandles | One occlusion handle for each initial shape. Set to nullptr for no inter-model occlusion tests. Use generateOccluders() to obtain the occlusion handles. |
encoders | A number (>= 1) of encoders to use to encode the generated model. The encoders are identified by their ID, see EncoderInfo::getID(). |
encodersCount | The number of encoder ids in the array. |
encoderOptions | One AttributeMap with the enocder options for each encoder. |
callbacks | Pointer to an instance of an implementation of the Callbacks interface. |
cache | Pointer to an instance of an implementation of the Cache interface. See CacheObject. |
occlSet | The OcclusionSet which contains the occlusionHandles. Set to nullptr for no inter-model occlusion tests. |
generateOptions | An optional AttributeMap to set advanced generate options. int "numberWorkerThreads": number of worker threads to internally use for generation. 0 = no multithreading = default bool "cacheShapeTree": cache the generated shapetrees. default = false. |
Status prt::generate | ( | const InitialShape *const * | initialShapes, |
size_t | initialShapeCount, | ||
const OcclusionSet::Handle * | occlusionHandles, | ||
const wchar_t *const * | encoders, | ||
size_t | encodersCount, | ||
const AttributeMap *const * | encoderOptions, | ||
Callbacks * | callbacks, | ||
Cache * | cache, | ||
const OcclusionSet *const * | occlSets, | ||
const size_t * | occlSetCounts, | ||
const AttributeMap * | generateOptions = nullptr |
||
) |
Generate and encode procedural models for a number of initial shapes.
Must be called after init(), will return STATUS_NOT_INITIALIZED else. Is thread-safe.
initialShapes | The initial shapes for which the procedural models have to be generated. |
initialShapeCount | The number of initial shapes in the array. |
occlusionHandles | One occlusion handle for each initial shape. Set to nullptr for no inter-model occlusion tests. Each occlusion handle corresponds to one of the given occlusion sets. Use generateOccluders() to obtain the occlusion handles. |
encoders | A number (>= 1) of encoders to use to encode the generated model. The encoders are identified by their ID, see EncoderInfo::getID(). |
encodersCount | The number of encoder ids in the array. |
encoderOptions | One AttributeMap with the enocder options for each encoder. |
callbacks | Pointer to an instance of an implementation of the Callbacks interface. |
cache | Pointer to an instance of an implementation of the Cache interface. See CacheObject. |
occlSets | The OcclusionSets which contain the occlusionHandles. Set to nullptr for no inter-model occlusion tests. OcclusionSets are stored subsequently for each initial shape. Each initial shape can have 0, 1 or >1 OcclusionSets. The number of OcclusionSets of an initial shape is stored in occlSetCounts. |
occlSetCounts | The number of OcclusionSets in occlSets for each initial shape. Set to nullptr for no inter-model occlusion tests. |
generateOptions | An optional AttributeMap to set advanced generate options. int "numberWorkerThreads": number of worker threads to internally use for generation. 0 = no multithreading = default bool "cacheShapeTree": cache the generated shapetrees. default = false. |
Status prt::generateOccluders | ( | const InitialShape *const * | initialShapes, |
size_t | initialShapeCount, | ||
OcclusionSet::Handle * | occlusionHandles, | ||
const wchar_t *const * | encoders, | ||
size_t | encodersCount, | ||
const AttributeMap *const * | encoderOptions, | ||
Callbacks * | callbacks, | ||
Cache * | cache, | ||
OcclusionSet * | occlSet, | ||
const AttributeMap * | generateOptions = nullptr |
||
) |
Populate an OcclusionSet with occluder geometries for each initial shape and return an occlusion handle for each one. These handles (and the OcclusionSet) can then be used to generate() models based on rules with inter-model context and occlusion queries.
Must be called after init(), will return STATUS_NOT_INITIALIZED else. Is thread-safe.
initialShapes | The initial shapes for which the occluders have to be generated. | |
initialShapeCount | The number of initial shapes in the array. | |
[out] | occlusionHandles | Must be preallocated to hold initialShapeCount occlusion Handles, one for each initial shape. occlusionHandles[i] will receive the occlusion handle for initialShapes[i]. |
encoders | Optional encoders to run on the generated shapetree. Set to nullptr if no extra encoders should be used. Note that many encoders only consider leaf shapes and do not capture the correct occluder geometry; these are typically the encoders from the com.esri.prt.codecs plugin. Encoders which traverse the whole shapetree (such as com.esri.prt.core.CGAPrintEncoder, com.esri.prt.core.CGAErrorEncoder or com.esri.prt.core.CGAReportEncoder) can safely be used here. | |
encodersCount | The number of encoder ids in the array. | |
encoderOptions | Options for the additional encoders. Use nullptr if no encoders are used. | |
callbacks | Pointer to an instance of an implementation of the Callbacks interface. | |
cache | Pointer to an instance of an implementation of the Cache interface. See CacheObject. | |
occlSet | The OcclusionSet which will be filled with the generated occlusionHandles. | |
generateOptions | An optional AttributeMap to set generate options. |
const char* prt::getStatusDescription | ( | Status | stat | ) |
Returns a human readable description based on a Status value.
Status prt::getTexturePixeldata | ( | const wchar_t * | uri, |
uint8_t * | buffer, | ||
size_t | bufferSize, | ||
Cache * | cache = nullptr |
||
) |
Reads and decodes a texture and copies the pixel data to the passed buffer.
Must be called after init(), will return STATUS_NOT_INITIALIZED else. Is thread-safe.
uri | URI of the texture, see Application Notes for URI creation. | |
[out] | buffer | Pointer to pre-allocated buffer. The needed size can be calculated with createTextureMetadata() (width*height*bytesPerPixel). |
bufferSize | Size of the pre-allocated buffer. | |
cache | Optional Cache instance. |
Version const* prt::getVersion | ( | ) |
Returns the Version struct with information about the current Procedural Runtime.
const Object* prt::init | ( | const wchar_t *const * | prtPlugins, |
size_t | prtPluginsCount, | ||
LogLevel | logLevel, | ||
Status * | stat = nullptr |
||
) |
Performs global Procedural Runtime initialization. Must be called before prt can be used. Can be called multiple times to load additional extension libraries.
Is thread-safe. Blocks until initialization is done.
prtPlugins | List of paths to shared libraries or paths of directories to scan for shared libraries. | |
prtPluginsCount | Number of plugin paths provided. | |
logLevel | LogLevel to use. | |
[out] | stat | Optional pointer to return the Status. |
wchar_t* prt::listDecoderIds | ( | wchar_t * | result, |
size_t * | resultSize, | ||
Status * | stat = nullptr |
||
) |
Lists all registered decoders. If the result does not fit into the allocated buffer, the result is truncated. the INOUT parameter resultSize must be compared to the original buffer size after the call to detect this situation.
Must be called after init(), will return STATUS_NOT_INITIALIZED else. Is thread-safe.
[in,out] | result | Pointer to pre-allocated string to receive the semicolon-separated list of decoder ids. |
[in,out] | resultSize | Pointer to size of reserved buffer; receives the size of the actual result (incl. terminating 0). |
[out] | stat | Optional pointer to return the Status. |
wchar_t* prt::listEncoderIds | ( | wchar_t * | result, |
size_t * | resultSize, | ||
Status * | stat = nullptr |
||
) |
Lists all registered encoders. If the result does not fit into the allocated buffer, the result is truncated. the INOUT parameter resultSize must be compared to the original buffer size after the call to detect this situation.
Must be called after init(), will return STATUS_NOT_INITIALIZED else. Is thread-safe.
[in,out] | result | Pointer to pre-allocated string to receive the semicolon-separated list of encoder ids. |
[in,out] | resultSize | Pointer to size of reserved buffer; receives the size of the actual result (incl. terminating 0). |
[out] | stat | Optional pointer to return the Status. |
Status prt::removeLogHandler | ( | LogHandler * | logHandler | ) |
Remove a previously registered log handler, can be called at any time (also before init()). Is thread-safe.
logHandler | LogHandler to remove. |