ArcGIS Procedural Runtime  3.2.10650
Functions
prtx::ShapeUtils Namespace Reference

Description

Utility functions for working with prtx::Shape instances.

Functions

MaterialPtr combineMaterials (const Material &shapeMat, const Material &meshMat)
 
void getBoundingBoxWorld (const prtx::Shape &shape, prtx::DoubleVector &bbMinMaxExtent)
 
void getGeometryToWorldTrafo (const Shape &shape, DoubleVector &trafoMatrix)
 
void getObjectToWorldTrafo (const Shape &shape, DoubleVector &trafoMatrix)
 
void getPivotToWorldTrafo (const Shape &shape, DoubleVector &trafoMatrix)
 
std::wstring getRuleArguments (const Shape &shape)
 
std::wstring getRuleName (const Shape &shape)
 
std::wstring getRuleParameters (const Shape &shape)
 
std::wstring getStyledRuleName (const Shape &shape)
 
std::wstring getStyledRuleSignature (const Shape &shape)
 
void transformPoint (const prtx::DoubleVector &trafo, const double vIn[3], double vOut[3])
 

Function Documentation

◆ combineMaterials()

MaterialPtr prtx::ShapeUtils::combineMaterials ( const Material shapeMat,
const Material meshMat 
)

Combine a shape's material with the material of the shape's geometry. The shape's material is written during cga generation. It defaults to "CityEngineMaterial". As long as it isn't changed, it is overridden by it's geometry's material (e.g. if you insert [i()] a textured asset, material.colormap is set to that texture). As soon as it is changed (via set(material.colormap, "myPic.jpg")), the shape material "wins".

In other words, you will get the material you see in the CityEngine renderer.

It is not trivial, use this function.

Parameters
shapeMatThe shape material.
meshMatThe mesh material.
Returns
The combined material.

◆ getBoundingBoxWorld()

void prtx::ShapeUtils::getBoundingBoxWorld ( const prtx::Shape shape,
prtx::DoubleVector bbMinMaxExtent 
)

Get the axis-aligned bounding box of a shape's geometry in world coordinates.

Parameters
shapeThe shape.
bbMinMaxExtentVector of doubles to receive min and max extent [minX, minY, minZ, maxX, maxY, maxZ]

◆ getGeometryToWorldTrafo()

void prtx::ShapeUtils::getGeometryToWorldTrafo ( const Shape shape,
DoubleVector trafoMatrix 
)

Extracts the transformation matrix which transforms a shape's geometry to world coordinates. This matrix depends on the actual geometry, the shape's attributes (scope, pivot) and the intialShape's origin.

Parameters
shape
[out]trafoMatrix4x4 harmonic transformation matrix, column major (OpenGL)

◆ getObjectToWorldTrafo()

void prtx::ShapeUtils::getObjectToWorldTrafo ( const Shape shape,
DoubleVector trafoMatrix 
)

Extracts the transformation matrix which transforms from object coordinates to world coordinates. This matrix depends on the intialShape's origin.

Parameters
shape
[out]trafoMatrix4x4 harmonic transformation matrix, column major (OpenGL)

◆ getPivotToWorldTrafo()

void prtx::ShapeUtils::getPivotToWorldTrafo ( const Shape shape,
DoubleVector trafoMatrix 
)

Extracts the transformation matrix which transforms from a shape's pivot coordinates to world coordinates. This matrix depends on the shape's attributes (pivot) and the intialShape's origin.

Parameters
shape
[out]trafoMatrix4x4 harmonic transformation matrix, column major (OpenGL)

◆ getRuleArguments()

std::wstring prtx::ShapeUtils::getRuleArguments ( const Shape shape)

Gets the actual arguments i.e. evaluated parameters of a shape's rule in the form: ({evaluated parameters})

Parameters
shapeThe shape.
Returns
rule parameters string.

◆ getRuleName()

std::wstring prtx::ShapeUtils::getRuleName ( const Shape shape)

Gets the name of a shape's rule, without style, in the form: import.rule

Parameters
shapeThe shape.
Returns
rule name string.

◆ getRuleParameters()

std::wstring prtx::ShapeUtils::getRuleParameters ( const Shape shape)

Gets the parameters of a shape's rule in the form: ({t}) with t = type = {b|f|s}

Parameters
shapeThe shape.
Returns
rule parameters string.

◆ getStyledRuleName()

std::wstring prtx::ShapeUtils::getStyledRuleName ( const Shape shape)

Gets the name of a shape's rule, inclusive style, in the form: style$import.rule

Parameters
shapeThe shape.
Returns
rule name string.

◆ getStyledRuleSignature()

std::wstring prtx::ShapeUtils::getStyledRuleSignature ( const Shape shape)

Gets the full signature of a shape's rule, inclusive style, in the form: style$import.rule({t}) with t = type = {b|f|s}

Parameters
shapeThe shape.
Returns
signature string.

◆ transformPoint()

void prtx::ShapeUtils::transformPoint ( const prtx::DoubleVector trafo,
const double  vIn[3],
double  vOut[3] 
)
inline

Transforms vIn (3 components) with the transformation matrix trafo (column first).

Parameters
trafoTransformation matrix.
vInvertex to transform (x,y,z)
[out]vOutlocation to write transformed vertex (x,y,z)