Utility functions for working with prtx::Shape instances.
◆ combineMaterials()
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
-
shapeMat | The shape material. |
meshMat | The mesh material. |
- Returns
- The combined material.
◆ getBoundingBoxWorld()
Get the axis-aligned bounding box of a shape's geometry in world coordinates.
- Parameters
-
shape | The shape. |
bbMinMaxExtent | Vector 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] | trafoMatrix | 4x4 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] | trafoMatrix | 4x4 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] | trafoMatrix | 4x4 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
-
- 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
-
- 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
-
- 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
-
- 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
-
- 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
-
| trafo | Transformation matrix. |
| vIn | vertex to transform (x,y,z) |
[out] | vOut | location to write transformed vertex (x,y,z) |