Magnum::Ui::LineLayer::Shared class

Shared state for the line layer.

Contains style definitions. See the LineLayer class documentation for information about setting up an instance of this layer and using it.

You'll most likely instantiate the class through LineLayerGL::Shared. In order to update or draw the layer it's expected that setStyle() was called.

Base classes

class Magnum::Ui::AbstractVisualLayer::Shared
Base shared state for visual data layers.

Derived classes

class Shared
Shared state for the OpenGL implementation of the base layer.

Public types

class Configuration
Configuration of a line layer shared state.

Public functions

auto styleUniformCount() const -> UnsignedInt
Style uniform count.
auto capStyle() const -> LineCapStyle
Cap style.
auto joinStyle() const -> LineJoinStyle
Join style.
auto setStyle(const LineLayerCommonStyleUniform& commonUniform, Containers::ArrayView<const LineLayerStyleUniform> uniforms, const Containers::StridedArrayView1D<const LineAlignment>& alignments, const Containers::StridedArrayView1D<const Vector4>& paddings) -> Shared&
Set style data with implicit mapping between styles and uniforms.
auto setStyle(const LineLayerCommonStyleUniform& commonUniform, std::initializer_list<LineLayerStyleUniform> uniforms, std::initializer_list<LineAlignment> alignments, std::initializer_list<Vector4> paddings) -> Shared&
auto setStyle(const LineLayerCommonStyleUniform& commonUniform, Containers::ArrayView<const LineLayerStyleUniform> uniforms, const Containers::StridedArrayView1D<const UnsignedInt>& styleToUniform, const Containers::StridedArrayView1D<const LineAlignment>& styleAlignments, const Containers::StridedArrayView1D<const Vector4>& stylePaddings) -> Shared&
Set style data.
auto setStyle(const LineLayerCommonStyleUniform& commonUniform, std::initializer_list<LineLayerStyleUniform> uniforms, std::initializer_list<UnsignedInt> styleToUniform, std::initializer_list<LineAlignment> styleAlignments, std::initializer_list<Vector4> stylePaddings) -> Shared&

Function documentation

UnsignedInt Magnum::Ui::LineLayer::Shared::styleUniformCount() const

Style uniform count.

Size of the style uniform buffer excluding dynamic styles. May or may not be the same as styleCount().

Shared& Magnum::Ui::LineLayer::Shared::setStyle(const LineLayerCommonStyleUniform& commonUniform, Containers::ArrayView<const LineLayerStyleUniform> uniforms, const Containers::StridedArrayView1D<const LineAlignment>& alignments, const Containers::StridedArrayView1D<const Vector4>& paddings)

Set style data with implicit mapping between styles and uniforms.

Parameters
commonUniform Common style uniform data
uniforms Style uniforms
alignments Line alignment corresponding to style uniforms
paddings Padding inside the node in order left, top, right, bottom corresponding to style uniforms
Returns Reference to self (for method chaining)

The uniforms view is expected to have the same size as styleUniformCount(), the alignments view the same size as styleCount(). The paddings view is expected to either have the same size as styleCount() or be empty, in which case all paddings are implicitly zero.

Can only be called if styleUniformCount() and styleCount() were set to the same value in Configuration passed to the constructor, otherwise you have to additionally provide a mapping from styles to uniforms using setStyle(const LineLayerCommonStyleUniform&, Containers::ArrayView<const LineLayerStyleUniform>, const Containers::StridedArrayView1D<const UnsignedInt>&, const Containers::StridedArrayView1D<const LineAlignment>&, const Containers::StridedArrayView1D<const Vector4>&) instead.

Calling this function causes LayerState::NeedsDataUpdate to be set on all layers that are constructed using this shared instance.

Shared& Magnum::Ui::LineLayer::Shared::setStyle(const LineLayerCommonStyleUniform& commonUniform, std::initializer_list<LineLayerStyleUniform> uniforms, std::initializer_list<LineAlignment> alignments, std::initializer_list<Vector4> paddings)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Shared& Magnum::Ui::LineLayer::Shared::setStyle(const LineLayerCommonStyleUniform& commonUniform, Containers::ArrayView<const LineLayerStyleUniform> uniforms, const Containers::StridedArrayView1D<const UnsignedInt>& styleToUniform, const Containers::StridedArrayView1D<const LineAlignment>& styleAlignments, const Containers::StridedArrayView1D<const Vector4>& stylePaddings)

Set style data.

Parameters
commonUniform Common style uniform data
uniforms Style uniforms
styleToUniform Style to style uniform mapping
styleAlignments Per-style line alignment
stylePaddings Per-style padding inside the node in order left, top, right, bottom
Returns Reference to self (for method chaining)

The uniforms view is expected to have the same size as styleUniformCount(), the styleToUniform and styleAlignments views the same size as styleCount(). All uniform indices are expected to be less than styleUniformCount().

The stylePaddings view is expected to either have the same size as styleCount() or be empty, in which case all paddings are implicitly zero.

Value of styleToUniform[i] should give back an index into the uniforms array for style i. If styleUniformCount() and styleCount() is the same and the mapping is implicit, you can use the setStyle(const LineLayerCommonStyleUniform&, Containers::ArrayView<const LineLayerStyleUniform>, const Containers::StridedArrayView1D<const LineAlignment>&, const Containers::StridedArrayView1D<const Vector4>&) convenience overload instead.

Calling this function causes LayerState::NeedsDataUpdate to be set on all layers that are constructed using this shared instance.

Shared& Magnum::Ui::LineLayer::Shared::setStyle(const LineLayerCommonStyleUniform& commonUniform, std::initializer_list<LineLayerStyleUniform> uniforms, std::initializer_list<UnsignedInt> styleToUniform, std::initializer_list<LineAlignment> styleAlignments, std::initializer_list<Vector4> stylePaddings)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.