Visual Computing Library
Loading...
Searching...
No Matches
vcl::MeshRenderInfo Class Reference

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.
 
boolvisible ()
 Sets the visibility status of the mesh.
 
template<Primitive PRIMITIVE>
BitSet16 settings () const
 Returns the settings for a given primitive.
 
template<Primitive PRIMITIVE>
BitSet16settings ()
 Returns the settings for a given primitive.
 
BitSet16 points () const
 Returns the settings for the points primitive.
 
BitSet16points ()
 Returns the settings for the points primitive.
 
BitSet16 surface () const
 Returns the settings for the surface primitive.
 
BitSet16surface ()
 Returns the settings for the surface primitive.
 
BitSet16 wireframe () const
 Returns the settings for the wireframe primitive.
 
BitSet16wireframe ()
 Returns the settings for the wireframe primitive.
 
BitSet16 edges () const
 Returns the settings for the edges primitive.
 
BitSet16edges ()
 Returns the settings for the edges primitive.
 
void reset ()
 Resets all the settings of the mesh.
 
bool operator== (const MeshRenderInfo &o) const
 
MeshRenderInfooperator&= (const MeshRenderInfo &o)
 
MeshRenderInfooperator|= (const MeshRenderInfo &o)
 
MeshRenderInfooperator^= (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 autoexclusiveRanges ()
 
static constexpr auto getExclusiveRange (auto value, const auto &array)
 

Private Attributes

bool mVisible
 
std::array< BitSet16, toUnderlying(Primitive::COUNT)> mSettings
 

Static Private Attributes

static constexpr const auto POINTS_EXCLUSIVE_RANGES
 
static constexpr const auto SURFACE_EXCLUSIVE_RANGES
 
static constexpr const auto WIREFRAME_EXCLUSIVE_RANGES
 
static constexpr const auto EDGES_EXCLUSIVE_RANGES
 

Detailed Description

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.

Member Function Documentation

◆ edges() [1/2]

BitSet16 & vcl::MeshRenderInfo::edges ( )
inline

Returns the settings for the edges primitive.

Returns
the settings for the edges primitive.

◆ edges() [2/2]

BitSet16 vcl::MeshRenderInfo::edges ( ) const
inline

Returns the settings for the edges primitive.

Returns
the settings for the edges primitive.

◆ edgesExclusiveRange()

static constexpr auto vcl::MeshRenderInfo::edgesExclusiveRange ( auto  value)
inlinestaticconstexpr

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_.

Parameters
[in]valuethe option to query.
Returns
a pair representing the range of the mutual exclusive settings for the given value.

◆ exclusiveRange()

template<Primitive PRIMITIVE>
static constexpr auto vcl::MeshRenderInfo::exclusiveRange ( auto  value)
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_.

Template Parameters
PRIMITIVEthe primitive for which to get the exclusive range.
Parameters
[in]valuethe option to query.
Returns
a pair representing the range of the mutual exclusive settings for the given value.

◆ points() [1/2]

BitSet16 & vcl::MeshRenderInfo::points ( )
inline

Returns the settings for the points primitive.

Returns
the settings for the points primitive.

◆ points() [2/2]

BitSet16 vcl::MeshRenderInfo::points ( ) const
inline

Returns the settings for the points primitive.

Returns
the settings for the points primitive.

◆ pointsExclusiveRange()

static constexpr auto vcl::MeshRenderInfo::pointsExclusiveRange ( auto  value)
inlinestaticconstexpr

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_.

Parameters
[in]valuethe option to query.
Returns
a pair representing the range of the mutual exclusive settings for the given value.

◆ settings() [1/2]

template<Primitive PRIMITIVE>
BitSet16 & vcl::MeshRenderInfo::settings ( )
inline

Returns the settings for a given primitive.

Template Parameters
PRIMITIVEthe primitive for which to get the settings.
Returns
the settings for the given primitive.

◆ settings() [2/2]

template<Primitive PRIMITIVE>
BitSet16 vcl::MeshRenderInfo::settings ( ) const
inline

Returns the settings for a given primitive.

Template Parameters
PRIMITIVEthe primitive for which to get the settings.
Returns
the settings for the given primitive.

◆ surface() [1/2]

BitSet16 & vcl::MeshRenderInfo::surface ( )
inline

Returns the settings for the surface primitive.

Returns
the settings for the surface primitive.

◆ surface() [2/2]

BitSet16 vcl::MeshRenderInfo::surface ( ) const
inline

Returns the settings for the surface primitive.

Returns
the settings for the surface primitive.

◆ surfaceExclusiveRange()

static constexpr auto vcl::MeshRenderInfo::surfaceExclusiveRange ( auto  value)
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_.

Parameters
[in]valuethe option to query.
Returns
a pair representing the range of the mutual exclusive settings for the given value.

◆ visible() [1/2]

bool & vcl::MeshRenderInfo::visible ( )
inline

Sets the visibility status of the mesh.

Returns
the visibility status of the mesh.

◆ visible() [2/2]

bool vcl::MeshRenderInfo::visible ( ) const
inline

Returns the visibility status of the mesh.

Returns
the visibility status of the mesh.

◆ wireframe() [1/2]

BitSet16 & vcl::MeshRenderInfo::wireframe ( )
inline

Returns the settings for the wireframe primitive.

Returns
the settings for the wireframe primitive.

◆ wireframe() [2/2]

BitSet16 vcl::MeshRenderInfo::wireframe ( ) const
inline

Returns the settings for the wireframe primitive.

Returns
the settings for the wireframe primitive.

◆ wireframeExclusiveRange()

static constexpr auto vcl::MeshRenderInfo::wireframeExclusiveRange ( auto  value)
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_.

Parameters
[in]valuethe option to query.
Returns
a pair representing the range of the mutual exclusive settings for the given value.

Member Data Documentation

◆ EDGES_EXCLUSIVE_RANGES

constexpr const auto vcl::MeshRenderInfo::EDGES_EXCLUSIVE_RANGES
inlinestaticconstexprprivate
Initial value:
=
detail::makeExclusiveReangesArray<Edges>(
Edges::SHADING_NONE,
Edges::SHADING_SMOOTH,
Edges::COLOR_VERTEX,
Edges::COLOR_USER)

◆ POINTS_EXCLUSIVE_RANGES

constexpr const auto vcl::MeshRenderInfo::POINTS_EXCLUSIVE_RANGES
inlinestaticconstexprprivate
Initial value:
=
detail::makeExclusiveReangesArray<Points>(
Points::SHAPE_PIXEL,
Points::SHAPE_CIRCLE,
Points::SHADING_NONE,
Points::SHADING_VERT,
Points::COLOR_VERTEX,
Points::COLOR_USER)

◆ SURFACE_EXCLUSIVE_RANGES

constexpr const auto vcl::MeshRenderInfo::SURFACE_EXCLUSIVE_RANGES
inlinestaticconstexprprivate
Initial value:
=
detail::makeExclusiveReangesArray<Surface>(
Surface::SHADING_NONE,
Surface::SHADING_SMOOTH,
Surface::COLOR_VERTEX,
Surface::COLOR_USER)

◆ WIREFRAME_EXCLUSIVE_RANGES

constexpr const auto vcl::MeshRenderInfo::WIREFRAME_EXCLUSIVE_RANGES
inlinestaticconstexprprivate
Initial value:
=
detail::makeExclusiveReangesArray<Wireframe>(
Wireframe::SHADING_NONE,
Wireframe::SHADING_VERT,
Wireframe::COLOR_VERTEX,
Wireframe::COLOR_USER)

The documentation for this class was generated from the following file: