ArcGIS Procedural Runtime  3.2.10650
List of all members | Public Member Functions | Static Public Member Functions
prt::InitialShapeBuilder Class Referenceabstract
Inheritance diagram for prt::InitialShapeBuilder:
[legend]

Public Member Functions

virtual InitialShape const * createInitialShape (Status *status=nullptr)=0
 
virtual InitialShape const * createInitialShapeAndReset (Status *status=nullptr)=0
 
virtual Status resetGeometry ()=0
 
virtual Status resolveAttributes (wchar_t const *key, ResolveMap const *resolveMap=nullptr, Cache *cache=nullptr)=0
 
virtual Status resolveGeometry (wchar_t const *key, ResolveMap const *resolveMap=nullptr, Cache *cache=nullptr)=0
 
virtual Status resolveTextures (wchar_t const *const *textureKeys, size_t textureCount, uint32_t const *faceTextureIndices, uint32_t facesCount, ResolveMap const *resolveMap=nullptr, Cache *cache=nullptr)=0
 
virtual Status setAttributes (wchar_t const *ruleFile, wchar_t const *startRule, int32_t randomSeed, wchar_t const *name, AttributeMap const *attributes, ResolveMap const *resolveMap)=0
 
virtual Status setGeometry (double const *vertexCoords, size_t vcCount, uint32_t const *indices, size_t indicesCount, uint32_t const *faceCounts, size_t faceCountsCount, const uint32_t *holes=nullptr, size_t holesCount=0)=0
 
virtual Status setUVs (double const *uvCoords, size_t uvcCount, uint32_t const *uvIndices, size_t uvIndicesCount, uint32_t const *faceCounts, size_t faceCountsCount, uint32_t uvSet=0)=0
 
- Public Member Functions inherited from prt::Object
void destroy () const
 
virtual char * toXML (char *result, size_t *resultSize, Status *stat=0) const =0
 
char * toXMLDocument (char *result, size_t *resultSize, Status *stat=0) const
 

Static Public Member Functions

static InitialShapeBuildercreate (Status *status=nullptr)
 

Additional Inherited Members

- Protected Member Functions inherited from prt::Object
 Object (const Object &)
 

Member Function Documentation

◆ create()

static InitialShapeBuilder* prt::InitialShapeBuilder::create ( Status status = nullptr)
static

Creates an empty InitialShapeBuilder.

Parameters
statPointer to a Status object which will receive a status code.
Returns
Pointer to a new InitialShapeBuilder instance, must be destroyed by the caller.

◆ createInitialShape()

virtual InitialShape const* prt::InitialShapeBuilder::createInitialShape ( Status status = nullptr)
pure virtual

Creates an initial shape instance and keeps the builder state.

Returns
Pointer to a new InitialShape instance, must be destroyed by the caller.

◆ createInitialShapeAndReset()

virtual InitialShape const* prt::InitialShapeBuilder::createInitialShapeAndReset ( Status status = nullptr)
pure virtual

Creates an InitialShape instance and resets the builder to its default state.

Returns
Pointer to a new InitialShape instance, must be destroyed by the caller.

◆ resetGeometry()

virtual Status prt::InitialShapeBuilder::resetGeometry ( )
pure virtual

Resets geometry and textures, so setGeometry(), setUVs() and resolveTextures() can be called once more. Typically used to create multiple InitialShapes with the same attributes but different geometry.

Returns
STATUS_OK on success or other status value in cause of failure.

◆ resolveAttributes()

virtual Status prt::InitialShapeBuilder::resolveAttributes ( wchar_t const *  key,
ResolveMap const *  resolveMap = nullptr,
Cache cache = nullptr 
)
pure virtual

Updates initial shape attributes based on an asset (if the corresponding decoder supports it). Please refer to InitialShapeBuilder::setAttributes for a description of the attribute key semantics. By using the same cache object as in the InitialShapeBuilder::resolveGeometry call this can be done efficiently.

Parameters
keyThe key (into resolveMap) of the geometry asset to load. If resolveMap is 0, key is treated as a an URI.
resolveMapThe resolveMap which contains key/URI entries for the key plus nested resources (such as a mtl file referenced by an obj file etc.).
cacheCache to use for texture lookups. 0 for no caching.
Returns
STATUS_OK on success, STATUS_ATTRIBUTES_NOT_SET if setAttributes has not been called yet or another detailed value in cause of failure.
See also
setAttributes
resolveGeometry

◆ resolveGeometry()

virtual Status prt::InitialShapeBuilder::resolveGeometry ( wchar_t const *  key,
ResolveMap const *  resolveMap = nullptr,
Cache cache = nullptr 
)
pure virtual

Sets an initial shape's geometry (plus uv coordinates and texturing if available) from an external resource. Overrides any existing data set with setGeometry(), setUVs() and/or resolveTextures(). If an initial shape's geometry is loaded with resolveGeometry, calls to setGeometry(), setUVs() and resolveTextures() will return an error until resetGeometryAndTextures() is called.

Parameters
keyThe key (into resolveMap) of the geometry asset to load. If resolveMap is 0, key is treated as a an URI.
resolveMapThe resolveMap which contains key/URI entries for the key plus nested resources (such as a mtl file referenced by an obj file etc.).
cacheCache to use for texture lookups. 0 for no caching.
Returns
STATUS_OK on success or other detailed value in cause of failure.

◆ resolveTextures()

virtual Status prt::InitialShapeBuilder::resolveTextures ( wchar_t const *const *  textureKeys,
size_t  textureCount,
uint32_t const *  faceTextureIndices,
uint32_t  facesCount,
ResolveMap const *  resolveMap = nullptr,
Cache cache = nullptr 
)
pure virtual

Sets up the initial shape''s material by resolving, loading and decoding the given textures. The faceTextureIndices must match the geometry set with setGeometry(). If a texture can not be resolved, STATUS_UNABLE_TO_RESOLVE is returned and builtin:unknowntexture.png is used for that texture. To use this member function for multiple InitialShapes, call resetGeometry() before the next resolveTextures().

Overrides any existing data set with resolveGeometry().

Parameters
textureKeysThe textures (keys into texturesResolveMap / uris if resolveMap is 0). 0 or an empty string means 'no texture'.
textureCountThe number of textures.
faceTextureIndicesArray with texture index for each face.
facesCountThe number of faces (== faceCountsCount in setGeometry()). This is the number of elements in faceTextureIndices.
resolveMapResolveMap to use for texture lookups
cacheCache to use for texture lookups. 0 for no caching.
Returns
STATUS_OK on success or other detailed value in cause of failure.

◆ setAttributes()

virtual Status prt::InitialShapeBuilder::setAttributes ( wchar_t const *  ruleFile,
wchar_t const *  startRule,
int32_t  randomSeed,
wchar_t const *  name,
AttributeMap const *  attributes,
ResolveMap const *  resolveMap 
)
pure virtual

Sets the initial shape's attributes. The major purpose is to override rule attributes with concrete values in order to control the procedural model generation. However, any attribute name can be used; this allows for passing initial shape specific attributes to the encoder (see below). There is a number of reserved attribute names for special purposes; if present, they influence the model generation:

Attribute Key Type Default Description
streetWidth float array A semantic attribute to transport information about streets adjacent to the initial shape. If present it is used to evaluate the street.xxx selectors in cga (for instance in the comp() operation). The index into the array corresponds to the edge-index, and the value corresponds to the width of the street on that side. 0 means no street, a value > 0 means street.
/edgeattr/name float/bool/string array A semantic attribute to transport information of edges of the initial shape. It can be sampled by edgeAttr.getFloat/Bool/String() functions. The array is filled in face-edge-order.
/arrayDimRows/<array attr name> int Allows to set the number of rows for 2D arrays. <array attr name> must be the name of a float/bool/string array in attributes.
/cgaenv/ Reserved namespace for controlling cga execution.
/cgaenv/occlDisableIntra bool false Disable intra-model occlusion queries (i.e. they all return false)
/cgaenv/occlDisableInter bool false Disable inter-model occlusion queries (i.e. they all return false)
/cgaenv/maxDerivationDepth int 1024 Maximum recursion level for cga operations
/cgaenv/maxDerivationWidth int 100000 Maximum shapetree width (for cga)
/cgaenv/maxFuncCallDepth int 1024 Maximum recursion level for cga functions
/cgaenv/floatCheck int 2 Controls checking of float parameters of operation/built-in functions for inf/nan values: 0 = ignore(don't check), 1 = check and abort if inf/nan detected, 2 = check and replace with 0 if inf/nan detected
/cgaenv/maxArraySize int 100000 Maximum size of arrays
/cgaenv/trimPlanesComputeSize float 100.0 The size of the computed trimplanes in meters; float; default: 100.0
/cgaenv/touchesMaxDist float 1e-3 Due to floating point limitations, occlusion queries use this threshold value.
/cache/key string Set the cache key associated to this initial shape. This allows e.g. for re-using an initial shape's cache key with a different instance. See also the generateOptions parameter of generate().
/enc/ Reserved namespace for encoders. The encoder documentation lists the known initial shape attributes per encoder. Typically, these attributes are used to control encoder behavior on a per-initial-shape basis, i.e. they are the per-initial-shape counterpart to the encoder options. Also see the Application Notes for an usage example.
Parameters
ruleFileThe cgb file (as a key into the resolveMap).
startRuleThe start rule, with style prefix (e.g. "Default$Init"). Currently only rules from the default style are supported. This will be the initialShape.startRule cga attribute.
randomSeedThe random seed; this will be the seedian cga attribute of the initial shape.
nameThe name of the initial shape. This will be the initialShape.name cga attribute.
attributesThe rule attributes. Ownership remains with caller.
resolveMapThe resolve map to use in generate().
Returns
STATUS_OK on success or other detailed value in cause of failure.

◆ setGeometry()

virtual Status prt::InitialShapeBuilder::setGeometry ( double const *  vertexCoords,
size_t  vcCount,
uint32_t const *  indices,
size_t  indicesCount,
uint32_t const *  faceCounts,
size_t  faceCountsCount,
const uint32_t *  holes = nullptr,
size_t  holesCount = 0 
)
pure virtual

Sets the initial shape's geometry. Faces have counter-clockwise vertex ordering. To use this member function for multiple InitialShapes, call resetGeometry() before the next setGeometry().

Overrides any existing data set with resolveGeometry().

Parameters
vertexCoordsThe vertex coordinates as (x,y,z) tuples: { x0, y0, z0, x1, y1, z1, ... }.
vcCountThe size of vertexCoords == 3 * number of vertices.
indicesThe vertex indices per face: { f0i0, f0i1, f0i2, f0if0Count-1, ..., f1i0, ... }
indicesCountThe size of indices.
faceCountsThe number of vertices per face: { f0Count, f1Count, ... }. Each face must have a vertex count > 0.
faceCountsCountThe number of faces.
holesList which assigns hole-faces to faces. Holes must have the opposite vertex-ordering as the encircling face. The Structure is: { face-with-holes1-idx, hole-face-idx1, hole-face-idx2, ..., MAX_UINT32_T, ..., face-with-holesn-idx, hole-face-idx1, hole-face-idx2, ..., MAX_UINT32_T }
holesCountThe number of uint32_t entries in the array above.
Returns
STATUS_OK on success or other detailed value in cause of failure.

◆ setUVs()

virtual Status prt::InitialShapeBuilder::setUVs ( double const *  uvCoords,
size_t  uvcCount,
uint32_t const *  uvIndices,
size_t  uvIndicesCount,
uint32_t const *  faceCounts,
size_t  faceCountsCount,
uint32_t  uvSet = 0 
)
pure virtual

Sets the initial shape's uv coordinates (texture coordinates). The uvs must match the geometry set with setGeometry(). This member function can only be called once per uvSet. Use resetGeometry() first to call setUVs for another InitialShape.

Overrides any existing data set with resolveGeometry().

Parameters
uvCoordsThe uv coords as (u,v) tuples: { u0, v0, u1, v1, ... }.
uvCountThe number of texture coords = 2 * number of (u,v) tuples.
indicesThe uv indices per face.
indicesCountThe uv indices per face (analogous to indices in setGeometry()).
faceCountsThe number of vertices per face: { f0Count, f1Count, ... } (== faceCounts in setGeometry()).
faceCountsCountThe number of faces (== faceCountsCount in setGeometry())
uvSetOptional index of uvSet. Defaults to 0.
Returns
STATUS_OK on success or other detailed value in cause of failure.

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