ArcGIS Procedural Runtime  3.2.10650
List of all members | Public Member Functions
prtx::EncoderInfoBuilder Class Reference

#include <EncoderInfoBuilder.h>

Inheritance diagram for prtx::EncoderInfoBuilder:
[legend]

Public Member Functions

void addAnnotation (const std::wstring &key, const prt::Annotation *a)
 
virtual const prt::EncoderInfocreate (std::wstring *warnings=0) const
 
virtual const prt::EncoderInfocreateAndReset (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
 
Builderoperator= (const Builder &)=delete
 

Detailed Description

Builder class for EncoderInfo objects.

See Application Notes how to setup a valid encoder for CityEngine.

Member Function Documentation

◆ addAnnotation()

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

Parameters
[in]keyThe encoder option or initial shape attribute key to annotate.
[in]aThe annotation instance. The ownership will be transferred. All annotations will be destroyed when the encoder info instance is destroyed.

◆ create()

virtual const prt::EncoderInfo* prtx::EncoderInfoBuilder::create ( std::wstring *  warnings = 0) const
virtual

Creates a prt::EncoderInfo instance from the current builder state.

Returns
A new prt::EncoderInfo instance. Needs to be destroyed by the caller.

Implements prtx::Builder< const prt::EncoderInfo >.

◆ createAndReset()

virtual const prt::EncoderInfo* prtx::EncoderInfoBuilder::createAndReset ( std::wstring *  warnings = 0)
virtual

Creates a prt::EncoderInfo instance from the current builder state and resets the builder state.

Returns
A new prt::EncoderInfo instance. Needs to be destroyed by the caller.

Implements prtx::Builder< const prt::EncoderInfo >.

◆ setDefaultOptions()

void prtx::EncoderInfoBuilder::setDefaultOptions ( prt::AttributeMap const *  defaultOptions)

Specify the default options of the corresponding encoder class. Takes over the ownership of defaultOptions.

◆ setDescription()

void prtx::EncoderInfoBuilder::setDescription ( const std::wstring &  desc)

Specifies the human-readable description of the corresponding encoder.

◆ setExtension()

void prtx::EncoderInfoBuilder::setExtension ( const std::wstring &  ext)

Convenience member function to directly specifiy a single file extension for the corresponding encoder.

Parameters
extThe extension, must start with a '.'

◆ setExtensions()

void prtx::EncoderInfoBuilder::setExtensions ( const prtx::FileExtensions exts)

Specifies the supported file extensions by the corresponding encoder.

◆ setIcon()

void prtx::EncoderInfoBuilder::setIcon ( const char *  icon)

Specifies the icon for the corresponding encoder. Useful for UI generation code.

Parameters
[in]iconAn icon as Base64-encoded PNG byte array.

◆ setID()

void prtx::EncoderInfoBuilder::setID ( const std::wstring &  id)

Specifies the ID of the corresponding encoder.

◆ setInitialShapeAttributes()

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.

Parameters
[in]attributesThe attribute map with known initial shape attributes. The ownership is transferred to the EncoderInfo object under construction.

◆ setMerit()

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.

◆ setName()

void prtx::EncoderInfoBuilder::setName ( const std::wstring &  name)

Specifies the human-readable name of the corresponding encoder.

◆ setType()

void prtx::EncoderInfoBuilder::setType ( prt::ContentType  type)

Specifies the content type of the corresponding encoder.

◆ setValidator()

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.


The documentation for this class was generated from the following file: