ArcGIS Procedural Runtime
3.2.10650
|
#include <EncoderInfoBuilder.h>
Public Member Functions | |
void | addAnnotation (const std::wstring &key, const prt::Annotation *a) |
virtual const prt::EncoderInfo * | create (std::wstring *warnings=0) const |
virtual const prt::EncoderInfo * | createAndReset (std::wstring *warnings=0) |
void | setDefaultOptions (prt::AttributeMap const *defaultOptions) |
void | setDescription (const std::wstring &desc) |
void | setExtension (const std::wstring &ext) |
void | setExtensions (const prtx::FileExtensions &exts) |
void | setIcon (const char *icon) |
void | setID (const std::wstring &id) |
void | setInitialShapeAttributes (prt::AttributeMap const *attributes) |
void | setMerit (double merit) |
void | setName (const std::wstring &name) |
void | setType (prt::ContentType type) |
void | setValidator (prtx::EncodeOptionsValidatorPtr validator) |
Public Member Functions inherited from prtx::Builder< const prt::EncoderInfo > | |
Builder (const Builder &)=delete | |
Builder & | operator= (const Builder &)=delete |
Builder class for EncoderInfo objects.
See Application Notes how to setup a valid encoder for CityEngine.
void prtx::EncoderInfoBuilder::addAnnotation | ( | const std::wstring & | key, |
const prt::Annotation * | a | ||
) |
Adds an annotation to a specific option or initial shape attribute. Please use the prtx::AnnotationBuilder to create annotations. There is also the prtx::EncodeOptionsAnnotator helper class for a more convenient way to set annotations for encoder options.
Initial shape attributes can be annotated with MANDATORY to make them a strict requirement for the encoder. If such annotated attributes are missing from an initial shape the prtx::Encoder::validate and prtx::Encoder::encode calls will fail.
Note: To make an encoder option appear in the CityEngine UI (version 2014.0 and later), the following annotations are mandatory: LABEL, ORDER, GROUP and DESCRIPTION
[in] | key | The encoder option or initial shape attribute key to annotate. |
[in] | a | The annotation instance. The ownership will be transferred. All annotations will be destroyed when the encoder info instance is destroyed. |
|
virtual |
Creates a prt::EncoderInfo instance from the current builder state.
Implements prtx::Builder< const prt::EncoderInfo >.
|
virtual |
Creates a prt::EncoderInfo instance from the current builder state and resets the builder state.
Implements prtx::Builder< const prt::EncoderInfo >.
void prtx::EncoderInfoBuilder::setDefaultOptions | ( | prt::AttributeMap const * | defaultOptions | ) |
Specify the default options of the corresponding encoder class. Takes over the ownership of defaultOptions.
void prtx::EncoderInfoBuilder::setDescription | ( | const std::wstring & | desc | ) |
Specifies the human-readable description of the corresponding encoder.
void prtx::EncoderInfoBuilder::setExtension | ( | const std::wstring & | ext | ) |
Convenience member function to directly specifiy a single file extension for the corresponding encoder.
ext | The extension, must start with a '.' |
void prtx::EncoderInfoBuilder::setExtensions | ( | const prtx::FileExtensions & | exts | ) |
Specifies the supported file extensions by the corresponding encoder.
void prtx::EncoderInfoBuilder::setIcon | ( | const char * | icon | ) |
Specifies the icon for the corresponding encoder. Useful for UI generation code.
[in] | icon | An icon as Base64-encoded PNG byte array. |
void prtx::EncoderInfoBuilder::setID | ( | const std::wstring & | id | ) |
Specifies the ID of the corresponding encoder.
void prtx::EncoderInfoBuilder::setInitialShapeAttributes | ( | prt::AttributeMap const * | attributes | ) |
Makes certain initial shape attribute keys known to the encoder. This can be combined with addAnnotation to give the encoder more semantic about certain initial shape attributes. For example, if an initial shape attribute 'foo' is annotated with MANDATORY, the validation and encode calls will fail if the attribute 'foo' of the specified type is missing.
[in] | attributes | The attribute map with known initial shape attributes. The ownership is transferred to the EncoderInfo object under construction. |
void prtx::EncoderInfoBuilder::setMerit | ( | double | merit | ) |
Sets the merit of this encoder. In case two encoders provide overlapping functionality, the one with the higher merit should be preferred.
void prtx::EncoderInfoBuilder::setName | ( | const std::wstring & | name | ) |
Specifies the human-readable name of the corresponding encoder.
void prtx::EncoderInfoBuilder::setType | ( | prt::ContentType | type | ) |
Specifies the content type of the corresponding encoder.
void prtx::EncoderInfoBuilder::setValidator | ( | prtx::EncodeOptionsValidatorPtr | validator | ) |
Registers a encoder-specific validator instance for the corresponding encoder. If no validator is set, only option key validation will take place, i.e. no option value validation will happen.