LuciadCPillar 2023.1.04
luciad::MeshStyle::Builder Class Referencefinal

A builder class for creating mesh styles. More...

#include <luciad/layers/styles/MeshStyle.h>

Public Member Functions

 Builder (const Builder &other)
 
 ~Builder ()
 
MeshStyle build () const
 Returns a newly created mesh style, based on the properties set on this builder. More...
 
BuildercolorExpression (StyleExpression< Color > expression)
 An expression to specify what colors to apply to mesh data. More...
 
BuilderdisplacementExpression (StyleExpression< Coordinate > expression)
 An expression to displace mesh data. More...
 
BuilderfacetCulling (FacetCullingType facetCullingType)
 This setting determines which side of the surfaces (facets) that make up a mesh are omitted (culled) from the rendering result. More...
 
BuildervisibilityExpression (StyleExpression< bool > expression)
 An expression to filter mesh data. More...
 

Detailed Description

A builder class for creating mesh styles.

Constructor & Destructor Documentation

◆ Builder()

luciad::MeshStyle::Builder::Builder ( const Builder other)

◆ ~Builder()

luciad::MeshStyle::Builder::~Builder ( )

Member Function Documentation

◆ build()

MeshStyle luciad::MeshStyle::Builder::build ( ) const

Returns a newly created mesh style, based on the properties set on this builder.

Returns
a newly created mesh style, based on the properties set on this builder.

◆ colorExpression()

Builder & luciad::MeshStyle::Builder::colorExpression ( StyleExpression< Color expression)

An expression to specify what colors to apply to mesh data.

To create expressions, you must use the factory methods on StyleExpressionFactory. The expression must be well-formed and resolve to a color value.

If you want to update the styling very often, consider using parameters in your expression. Changing the values of parameters is more efficient than replacing the whole expression.

If you define a colorExpression, the texture data, if any, will not be displayed. The color expression will determine the color. Note that the alpha component of the color is ignored so the color will be fully opaque, unless you enable transparency.

By default, no color expression is set, and the mesh will use the texture data of the mesh, if any.

Parameters
expressiona color expression
Returns
this builder

◆ displacementExpression()

Builder & luciad::MeshStyle::Builder::displacementExpression ( StyleExpression< Coordinate expression)

An expression to displace mesh data.

To create expressions, you must use the factory methods on StyleExpressionFactory. The expression must be well-formed and resolve to a coordinate value. This coordinate is interpreted as a displacement vector during painting.

If you want to update the styling very often, consider using parameters in your expressions. Changing the values of parameters is more efficient than replacing the whole expression.

By default, meshes are not displaced.

Parameters
expressiona coordinate expression
Returns
this builder

◆ facetCulling()

Builder & luciad::MeshStyle::Builder::facetCulling ( FacetCullingType  facetCullingType)

This setting determines which side of the surfaces (facets) that make up a mesh are omitted (culled) from the rendering result.

When rendering meshes, all surfaces that make up the mesh face a certain direction. This direction is often called the normal direction. This normal is used to determine if the surface is being seen from the front or the back. When rendering objects that have no holes in them, it is only possible to see the front of all surfaces. Graphics pipelines therefore often don't render the back sides of those surfaces to speed up rendering.

Apart from performance, some applications are made possible by enabling back-face culling. Consider for example a mesh that represents a room. Its normals would all point to the inside of the room. When enabling back-face culling, you can see the walls and floor of the room, without having to move the camera inside the room itself.

In some cases however, enabling back-face culling (i.e. not rendering the back-side of surfaces) can have undesired artifacts. This can for example happen:

  • for objects with incorrect normals. In that case, you will for example only see the inside of a mesh instead of the outside
  • for objects with holes in them. In that case, you won't be able to see the inside of the mesh, even when looking through the hole

Both can be resolved by disabling culling.

By default, no culling takes place and both sides of a surface are painted.

Parameters
facetCullingTypethe facet culling type to use
Returns
this builder

◆ visibilityExpression()

Builder & luciad::MeshStyle::Builder::visibilityExpression ( StyleExpression< bool >  expression)

An expression to filter mesh data.

To create expressions, you must use the factory methods on StyleExpressionFactory. The expression must be well-formed and resolve to a boolean value.

If you want to update the styling very often, consider using parameters in your expressions. Changing the values of parameters is more efficient than replacing the whole expression.

By default, no expression is set. The entire mesh is visible.

Parameters
expressiona boolean expression
Returns
this builder