Visual Computing Library
|
The MeshRenderInfo class is a collection of rendering settings for a Mesh. More...
#include <vclib/render/drawable/mesh/mesh_render_info.h>
Public Types | |
enum class | Buffers : uint { VERTICES , VERT_NORMALS , VERT_COLORS , VERT_TEXCOORDS , TRIANGLES , TRI_NORMALS , TRI_COLORS , WEDGE_TEXCOORDS , WIREFRAME , EDGES , EDGE_COLORS , EDGE_NORMALS , TEXTURES , MESH_UNIFORMS , COUNT } |
enum class | Primitive { POINTS = 0 , SURFACE , WIREFRAME , EDGES , COUNT } |
List of primitives for which settings can be stored. | |
enum class | Points { VISIBLE = VCL_MRS_DRAW_POINTS , SHAPE_PIXEL = VCL_MRS_POINTS_PIXEL , SHAPE_CIRCLE = VCL_MRS_POINTS_CIRCLE , SHADING_NONE = VCL_MRS_POINTS_SHADING_NONE , SHADING_VERT = VCL_MRS_POINTS_SHADING_VERT , COLOR_VERTEX = VCL_MRS_POINTS_COLOR_VERTEX , COLOR_MESH = VCL_MRS_POINTS_COLOR_MESH , COLOR_USER = VCL_MRS_POINTS_COLOR_USER , COUNT } |
List of possible settings for the points primitive. | |
enum class | Surface { VISIBLE = VCL_MRS_DRAW_SURF , SHADING_NONE = VCL_MRS_SURF_SHADING_NONE , SHADING_FLAT = VCL_MRS_SURF_SHADING_FLAT , SHADING_SMOOTH = VCL_MRS_SURF_SHADING_SMOOTH , COLOR_VERTEX = VCL_MRS_SURF_COLOR_VERTEX , COLOR_FACE = VCL_MRS_SURF_COLOR_FACE , COLOR_VERTEX_TEX = VCL_MRS_SURF_TEX_VERTEX , COLOR_WEDGE_TEX = VCL_MRS_SURF_TEX_WEDGE , COLOR_MESH = VCL_MRS_SURF_COLOR_MESH , COLOR_USER = VCL_MRS_SURF_COLOR_USER , COUNT } |
List of possible settings for the surface primitive. | |
enum class | Wireframe { VISIBLE = VCL_MRS_DRAW_WIREFRAME , SHADING_NONE = VCL_MRS_WIREFRAME_SHADING_NONE , SHADING_VERT = VCL_MRS_WIREFRAME_SHADING_VERT , COLOR_VERTEX = VCL_MRS_WIREFRAME_COLOR_VERT , COLOR_MESH = VCL_MRS_WIREFRAME_COLOR_MESH , COLOR_USER = VCL_MRS_WIREFRAME_COLOR_USER , COUNT } |
List of possible settings for the wireframe primitive. | |
enum class | Edges { VISIBLE = VCL_MRS_DRAW_EDGES , SHADING_NONE = VCL_MRS_EDGES_SHADING_NONE , SHADING_FLAT = VCL_MRS_EDGES_SHADING_FLAT , SHADING_SMOOTH = VCL_MRS_EDGES_SHADING_SMOOTH , COLOR_VERTEX = VCL_MRS_EDGES_COLOR_VERTEX , COLOR_EDGE = VCL_MRS_EDGES_COLOR_EDGE , COLOR_MESH = VCL_MRS_EDGES_COLOR_MESH , COLOR_USER = VCL_MRS_EDGES_COLOR_USER , COUNT } |
List of possible settings for the edges primitive. | |
using | BuffersBitSet = vcl::BitSet< BuffersBitSetUnderlyingType > |
Public Member Functions | |
bool | visible () const |
Returns the visibility status of the mesh. | |
bool & | visible () |
Sets the visibility status of the mesh. | |
template<Primitive PRIMITIVE> | |
BitSet16 | settings () const |
Returns the settings for a given primitive. | |
template<Primitive PRIMITIVE> | |
BitSet16 & | settings () |
Returns the settings for a given primitive. | |
BitSet16 | points () const |
Returns the settings for the points primitive. | |
BitSet16 & | points () |
Returns the settings for the points primitive. | |
BitSet16 | surface () const |
Returns the settings for the surface primitive. | |
BitSet16 & | surface () |
Returns the settings for the surface primitive. | |
BitSet16 | wireframe () const |
Returns the settings for the wireframe primitive. | |
BitSet16 & | wireframe () |
Returns the settings for the wireframe primitive. | |
BitSet16 | edges () const |
Returns the settings for the edges primitive. | |
BitSet16 & | edges () |
Returns the settings for the edges primitive. | |
void | reset () |
Resets all the settings of the mesh. | |
bool | operator== (const MeshRenderInfo &o) const |
MeshRenderInfo & | operator&= (const MeshRenderInfo &o) |
MeshRenderInfo & | operator|= (const MeshRenderInfo &o) |
MeshRenderInfo & | operator^= (const MeshRenderInfo &o) |
Static Public Member Functions | |
template<Primitive PRIMITIVE> | |
static constexpr auto | exclusiveRange (auto value) |
Given a primitive and a setting, returns pair representing the range in the primitive enumeration of the mutual exclusive settings for the given setting. | |
static constexpr auto | pointsExclusiveRange (auto value) |
Returns pair representing the range in the Points enumeration of the mutual exclusive settings for the given setting. | |
static constexpr auto | surfaceExclusiveRange (auto value) |
Returns pair representing the range in the Surface enumeration of the mutual exclusive settings for the given setting. | |
static constexpr auto | wireframeExclusiveRange (auto value) |
Returns pair representing the range in the Wireframe enumeration of the mutual exclusive settings for the given setting. | |
static constexpr auto | edgesExclusiveRange (auto value) |
Returns pair representing the range in the Edges enumeration of the mutual exclusive settings for the given setting. | |
Static Public Attributes | |
static const BuffersBitSet | BUFFERS_NONE = BuffersBitSet() |
static const BuffersBitSet | BUFFERS_ALL = buffersAll() |
Private Types | |
using | BuffersBitSetUnderlyingType = ushort |
Static Private Member Functions | |
static BuffersBitSet | buffersAll () |
template<Primitive PRIMITIVE> | |
static constexpr auto & | exclusiveRanges () |
static constexpr auto | getExclusiveRange (auto value, const auto &array) |
Private Attributes | |
bool | mVisible |
std::array< BitSet16, toUnderlying(Primitive::COUNT)> | mSettings |
The MeshRenderInfo class is a collection of rendering settings for a Mesh.
It provides a set of enums that can be used for various rendering purposes (like rendering settings, render buffer lists, ...).
It also allows to store settings that can be used for draw capability or draw mode of a mesh.
|
inline |
Returns the settings for the edges primitive.
|
inline |
Returns the settings for the edges primitive.
Returns pair representing the range in the Edges enumeration of the mutual exclusive settings for the given setting.
If the given value does not belong to any range, the function returns a pair having the same value as first and second element.
E.g. if the setting given is COLOR_USER, the function returns a pair having as first value the first setting of the Edges enumeration that starts with COLOR_ and as second value the last setting of the Edges enumeration that starts with COLOR_.
[in] | value | the option to query. |
|
inlinestaticconstexpr |
Given a primitive and a setting, returns pair representing the range in the primitive enumeration of the mutual exclusive settings for the given setting.
If the given value does not belong to any range, the function returns a pair having the same value as first and second element.
E.g. for a Points primitive, if the setting given is COLOR_USER, the function returns a pair having as first value the first setting of the Points enumeration that starts with COLOR_ and as second value the last setting of the Points enumeration that starts with COLOR_.
PRIMITIVE | the primitive for which to get the exclusive range. |
[in] | value | the option to query. |
|
inline |
Returns the settings for the points primitive.
|
inline |
Returns the settings for the points primitive.
Returns pair representing the range in the Points enumeration of the mutual exclusive settings for the given setting.
If the given value does not belong to any range, the function returns a pair having the same value as first and second element.
E.g. if the setting given is COLOR_USER, the function returns a pair having as first value the first setting of the Points enumeration that starts with COLOR_ and as second value the last setting of the Points enumeration that starts with COLOR_.
[in] | value | the option to query. |
Returns the settings for a given primitive.
PRIMITIVE | the primitive for which to get the settings. |
Returns the settings for a given primitive.
PRIMITIVE | the primitive for which to get the settings. |
|
inline |
Returns the settings for the surface primitive.
|
inline |
Returns the settings for the surface primitive.
|
inlinestaticconstexpr |
Returns pair representing the range in the Surface enumeration of the mutual exclusive settings for the given setting.
If the given value does not belong to any range, the function returns a pair having the same value as first and second element.
E.g. if the setting given is COLOR_USER, the function returns a pair having as first value the first setting of the Surface enumeration that starts with COLOR_ and as second value the last setting of the Surface enumeration that starts with COLOR_.
[in] | value | the option to query. |
|
inline |
Sets the visibility status of the mesh.
|
inline |
Returns the visibility status of the mesh.
|
inline |
Returns the settings for the wireframe primitive.
|
inline |
Returns the settings for the wireframe primitive.
|
inlinestaticconstexpr |
Returns pair representing the range in the Wireframe enumeration of the mutual exclusive settings for the given setting.
If the given value does not belong to any range, the function returns a pair having the same value as first and second element.
E.g. if the setting given is COLOR_USER, the function returns a pair having as first value the first setting of the Wireframe enumeration that starts with COLOR_ and as second value the last setting of the Wireframe enumeration that starts with COLOR_.
[in] | value | the option to query. |