gtsam_points
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
guik::ShaderSetting Struct Reference

Shader setting class that holds rendering settings. More...

#include <shader_setting.hpp>

Inheritance diagram for guik::ShaderSetting:
Inheritance graph
[legend]

Public Types

using Ptr = std::shared_ptr< ShaderSetting >
 
using ConstPtr = std::shared_ptr< const ShaderSetting >
 

Public Member Functions

 ShaderSetting ()
 Default constructor.
 
 ShaderSetting (int color_mode)
 Constructor.
 
 ShaderSetting (int color_mode, const Eigen::Matrix4f &transform)
 Constructor.
 
template<typename Transform >
 ShaderSetting (int color_mode, const Transform &transform)
 Constructor.
 
 ShaderSetting (const ShaderSetting &other)
 Copy constructor.
 
ShaderSettingoperator= (const ShaderSetting &other)
 Copy assignment operator.
 
virtual ~ShaderSetting ()
 Destructor.
 
ShaderSetting clone () const
 Clone the shader setting.
 
template<typename T >
ShaderSettingadd (const std::string &name_, const T &value)
 Add a new parameter to the shader setting.
 
template<typename T >
std::optional< T > get (const std::string &name_)
 Get a parameter value from the shader setting.
 
template<typename T >
std::optional< T > get (const std::string &name_) const
 Get a parameter value from the shader setting.
 
template<typename T >
cast (const std::string &name_) const
 Get a parameter value from the shader setting. This method avoid type checking. Fast but unsafe.
 
void set (glk::GLSLShader &shader) const
 Set shader parameters to the shader program.
 
ShaderSettingstatic_object ()
 Set static object flag.
 
ShaderSettingdynamic_object ()
 Set dynamic object flag.
 
Eigen::Vector4f material_color () const
 Get material color (FLAT_COLOR).
 
ShaderSettingset_color (float r, float g, float b, float a)
 Set material color (FLAT_COLOR).
 
template<typename Color >
ShaderSettingset_color (const Color &color_)
 Set material color (for FLAT_COLOR).
 
ShaderSettingset_alpha (float alpha)
 Set alpha value of the material color.
 
ShaderSettingmake_transparent ()
 Make the object transparent (alpha blending).
 
ShaderSettingset_rainbow_range (const Eigen::Vector2f &minmax_z)
 Set RAINBOW color range.
 
ShaderSettingset_rainbow_axis (const Eigen::Vector3f &axis)
 Set RAINBOW coloring axis.
 
float point_scale () const
 Get point size scale factor.
 
ShaderSettingset_point_scale (float scaling)
 Set point size scale factor.
 
float point_size () const
 Get point size.
 
ShaderSettingset_point_size (float size)
 Set point size.
 
ShaderSettingset_point_size_offset (float offset)
 Set point size offset.
 
ShaderSettingset_point_shape_mode (guik::PointShapeMode::MODE mode)
 Set point shape mode.
 
ShaderSettingset_point_shape_circle ()
 Set point shape to circle.
 
ShaderSettingset_point_shape_rectangle ()
 Set point shape to rectangle.
 
ShaderSettingset_point_scale_mode (guik::PointScaleMode::MODE mode)
 Set point size scale mode.
 
ShaderSettingset_point_scale_screenspace ()
 Set point size scale to screen space.
 
ShaderSettingset_point_scale_metric ()
 Set point size scale to metric.
 
ShaderSettingset_point_shape (float point_size, bool metric, bool circle)
 Set point shape with common settings.
 
ShaderSettingset_old_default_point_shape ()
 Set old (v0.1.9) default point shape (rectangle + screenspace)
 
ShaderSettingremove_model_matrix ()
 
int color_mode () const
 Get color mode.
 
ShaderSettingset_color_mode (int color_mode)
 Set color mode.
 
Eigen::Matrix4f model_matrix () const
 Get model matrix.
 
Eigen::Vector3f translation () const
 Get translation vector from the model matrix.
 
Eigen::Matrix3f rotation () const
 Get rotation matrix from the model matrix.
 
template<typename Transform >
ShaderSettingset_model_matrix (const Transform &transform)
 Set model matrix.
 
template<typename Transform >
ShaderSettingtransform (const Transform &transform)
 Apply transformation to the model matrix.
 
ShaderSettingtranslate (float tx, float ty, float tz)
 Apply translation to the model matrix.
 
ShaderSettingtranslate (const Eigen::Vector3f &translation)
 Apply translation to the model matrix.
 
template<typename Vector >
ShaderSettingtranslate (const Vector &translation)
 Apply translation to the model matrix.
 
ShaderSettingrotate (const float angle, const Eigen::Vector3f &axis)
 Apply rotation to the model matrix.
 
template<typename Vector >
ShaderSettingrotate (const float angle, const Vector &axis)
 Apply rotation to the model matrix.
 
template<typename Scalar >
ShaderSettingrotate (const Eigen::Quaternion< Scalar > &quat)
 Apply rotation to the model matrix.
 
template<typename Scalar , int Dim>
ShaderSettingrotate (const Eigen::Matrix< Scalar, Dim, Dim > &rot)
 Apply rotation to the model matrix.
 
ShaderSettingscale (float scaling)
 Apply uniform scaling to the model matrix.
 
ShaderSettingscale (float sx, float sy, float sz)
 Apply scaling to the model matrix (non-uniform).
 
ShaderSettingscale (const Eigen::Vector3f &scaling)
 Apply scaling to the model matrix (non-uniform).
 
template<typename Vector >
std::enable_if_t<!std::is_arithmetic_v< Vector >, ShaderSetting & > scale (const Vector &scaling)
 Apply scaling to the model matrix (non-uniform).
 
template<>
ShaderSettingadd (const std::string &name, const Eigen::Isometry3f &value)
 
template<>
ShaderSettingadd (const std::string &name, const Eigen::Affine3f &value)
 

Public Attributes

bool transparent
 If true, the object is rendered as transparent.
 
std::vector< ShaderParameterparams
 Shader parameters.
 

Detailed Description

Shader setting class that holds rendering settings.

Member Typedef Documentation

◆ ConstPtr

using guik::ShaderSetting::ConstPtr = std::shared_ptr<const ShaderSetting>

◆ Ptr

using guik::ShaderSetting::Ptr = std::shared_ptr<ShaderSetting>

Constructor & Destructor Documentation

◆ ShaderSetting() [1/5]

guik::ShaderSetting::ShaderSetting ( )

Default constructor.

Note
Default parameters are: color_mode : FLAT_COLOR point_scale : 1.0 model_matrix : Identity matrix

◆ ShaderSetting() [2/5]

guik::ShaderSetting::ShaderSetting ( int  color_mode)

Constructor.

Parameters
color_modeColor mode (ColorMode)

◆ ShaderSetting() [3/5]

guik::ShaderSetting::ShaderSetting ( int  color_mode,
const Eigen::Matrix4f &  transform 
)

Constructor.

Parameters
color_modeColor mode (ColorMode)
transformTransform matrix (Eigen::Matrix4f)

◆ ShaderSetting() [4/5]

template<typename Transform >
guik::ShaderSetting::ShaderSetting ( int  color_mode,
const Transform &  transform 
)
inline

Constructor.

Parameters
color_modeColor mode (ColorMode)
transformTransform matrix (e.g., Eigen::Matrix4(f|d) or Eigen::Isometry3(f|d))

◆ ShaderSetting() [5/5]

guik::ShaderSetting::ShaderSetting ( const ShaderSetting other)

Copy constructor.

◆ ~ShaderSetting()

virtual guik::ShaderSetting::~ShaderSetting ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ add() [1/3]

template<>
ShaderSetting & guik::ShaderSetting::add ( const std::string &  name,
const Eigen::Affine3f &  value 
)
inline

◆ add() [2/3]

template<>
ShaderSetting & guik::ShaderSetting::add ( const std::string &  name,
const Eigen::Isometry3f &  value 
)
inline

◆ add() [3/3]

template<typename T >
ShaderSetting & guik::ShaderSetting::add ( const std::string &  name_,
const T &  value 
)
inline

Add a new parameter to the shader setting.

Parameters
nameParameter name
valueParameter value
Returns
This object

◆ cast()

template<typename T >
T guik::ShaderSetting::cast ( const std::string &  name_) const
inline

Get a parameter value from the shader setting. This method avoid type checking. Fast but unsafe.

Parameters
nameParameter name
Returns
Parameter value

◆ clone()

ShaderSetting guik::ShaderSetting::clone ( ) const

Clone the shader setting.

◆ color_mode()

int guik::ShaderSetting::color_mode ( ) const

Get color mode.

◆ dynamic_object()

ShaderSetting & guik::ShaderSetting::dynamic_object ( )

Set dynamic object flag.

◆ get() [1/2]

template<typename T >
std::optional< T > guik::ShaderSetting::get ( const std::string &  name_)
inline

Get a parameter value from the shader setting.

Parameters
nameParameter name
Returns
Parameter value if found, otherwise std::nullopt

◆ get() [2/2]

template<typename T >
std::optional< T > guik::ShaderSetting::get ( const std::string &  name_) const
inline

Get a parameter value from the shader setting.

Parameters
nameParameter name
Returns
Parameter value if found, otherwise std::nullopt

◆ make_transparent()

ShaderSetting & guik::ShaderSetting::make_transparent ( )

Make the object transparent (alpha blending).

◆ material_color()

Eigen::Vector4f guik::ShaderSetting::material_color ( ) const

Get material color (FLAT_COLOR).

◆ model_matrix()

Eigen::Matrix4f guik::ShaderSetting::model_matrix ( ) const

Get model matrix.

◆ operator=()

ShaderSetting & guik::ShaderSetting::operator= ( const ShaderSetting other)

Copy assignment operator.

◆ point_scale()

float guik::ShaderSetting::point_scale ( ) const

Get point size scale factor.

◆ point_size()

float guik::ShaderSetting::point_size ( ) const

Get point size.

◆ remove_model_matrix()

ShaderSetting & guik::ShaderSetting::remove_model_matrix ( )

◆ rotate() [1/4]

template<typename Scalar , int Dim>
ShaderSetting & guik::ShaderSetting::rotate ( const Eigen::Matrix< Scalar, Dim, Dim > &  rot)
inline

Apply rotation to the model matrix.

Parameters
rotRotation matrix (Eigen::Matrix3(f|d))

◆ rotate() [2/4]

template<typename Scalar >
ShaderSetting & guik::ShaderSetting::rotate ( const Eigen::Quaternion< Scalar > &  quat)
inline

Apply rotation to the model matrix.

Parameters
quatRotation quaternion (Eigen::Quaternion(f|d))

◆ rotate() [3/4]

ShaderSetting & guik::ShaderSetting::rotate ( const float  angle,
const Eigen::Vector3f &  axis 
)

Apply rotation to the model matrix.

◆ rotate() [4/4]

template<typename Vector >
ShaderSetting & guik::ShaderSetting::rotate ( const float  angle,
const Vector &  axis 
)
inline

Apply rotation to the model matrix.

◆ rotation()

Eigen::Matrix3f guik::ShaderSetting::rotation ( ) const

Get rotation matrix from the model matrix.

◆ scale() [1/4]

ShaderSetting & guik::ShaderSetting::scale ( const Eigen::Vector3f &  scaling)

Apply scaling to the model matrix (non-uniform).

◆ scale() [2/4]

template<typename Vector >
std::enable_if_t<!std::is_arithmetic_v< Vector >, ShaderSetting & > guik::ShaderSetting::scale ( const Vector &  scaling)
inline

Apply scaling to the model matrix (non-uniform).

Template Parameters
VectorEigen vector type (e.g., Eigen::Vector3f, Eigen::Vector3d)

◆ scale() [3/4]

ShaderSetting & guik::ShaderSetting::scale ( float  scaling)

Apply uniform scaling to the model matrix.

◆ scale() [4/4]

ShaderSetting & guik::ShaderSetting::scale ( float  sx,
float  sy,
float  sz 
)

Apply scaling to the model matrix (non-uniform).

◆ set()

void guik::ShaderSetting::set ( glk::GLSLShader shader) const

Set shader parameters to the shader program.

Parameters
shaderShader program

◆ set_alpha()

ShaderSetting & guik::ShaderSetting::set_alpha ( float  alpha)

Set alpha value of the material color.

◆ set_color() [1/2]

template<typename Color >
ShaderSetting & guik::ShaderSetting::set_color ( const Color &  color_)
inline

Set material color (for FLAT_COLOR).

Template Parameters
ColorEigen 4d vector type (e.g., Eigen::Vector4f, Eigen::Vector4d)

◆ set_color() [2/2]

ShaderSetting & guik::ShaderSetting::set_color ( float  r,
float  g,
float  b,
float  a 
)

Set material color (FLAT_COLOR).

◆ set_color_mode()

ShaderSetting & guik::ShaderSetting::set_color_mode ( int  color_mode)

Set color mode.

◆ set_model_matrix()

template<typename Transform >
ShaderSetting & guik::ShaderSetting::set_model_matrix ( const Transform &  transform)
inline

Set model matrix.

Template Parameters
TransformTransform matrix type (e.g., Eigen::Matrix4(f|d) or Eigen::Isometry3(f|d))

◆ set_old_default_point_shape()

ShaderSetting & guik::ShaderSetting::set_old_default_point_shape ( )

Set old (v0.1.9) default point shape (rectangle + screenspace)

◆ set_point_scale()

ShaderSetting & guik::ShaderSetting::set_point_scale ( float  scaling)

Set point size scale factor.

◆ set_point_scale_metric()

ShaderSetting & guik::ShaderSetting::set_point_scale_metric ( )

Set point size scale to metric.

◆ set_point_scale_mode()

ShaderSetting & guik::ShaderSetting::set_point_scale_mode ( guik::PointScaleMode::MODE  mode)

Set point size scale mode.

◆ set_point_scale_screenspace()

ShaderSetting & guik::ShaderSetting::set_point_scale_screenspace ( )

Set point size scale to screen space.

◆ set_point_shape()

ShaderSetting & guik::ShaderSetting::set_point_shape ( float  point_size,
bool  metric,
bool  circle 
)

Set point shape with common settings.

Parameters
point_sizePoint size in meters (if metric) or in pseudo pixels (if screenspace)
metricIf true, point size is in meters. If false, point size is in pixels.
circleIf true, point shape is circle. If false, point shape is rectangle.

◆ set_point_shape_circle()

ShaderSetting & guik::ShaderSetting::set_point_shape_circle ( )

Set point shape to circle.

◆ set_point_shape_mode()

ShaderSetting & guik::ShaderSetting::set_point_shape_mode ( guik::PointShapeMode::MODE  mode)

Set point shape mode.

◆ set_point_shape_rectangle()

ShaderSetting & guik::ShaderSetting::set_point_shape_rectangle ( )

Set point shape to rectangle.

◆ set_point_size()

ShaderSetting & guik::ShaderSetting::set_point_size ( float  size)

Set point size.

◆ set_point_size_offset()

ShaderSetting & guik::ShaderSetting::set_point_size_offset ( float  offset)

Set point size offset.

◆ set_rainbow_axis()

ShaderSetting & guik::ShaderSetting::set_rainbow_axis ( const Eigen::Vector3f &  axis)

Set RAINBOW coloring axis.

◆ set_rainbow_range()

ShaderSetting & guik::ShaderSetting::set_rainbow_range ( const Eigen::Vector2f &  minmax_z)

Set RAINBOW color range.

◆ static_object()

ShaderSetting & guik::ShaderSetting::static_object ( )

Set static object flag.

◆ transform()

template<typename Transform >
ShaderSetting & guik::ShaderSetting::transform ( const Transform &  transform)
inline

Apply transformation to the model matrix.

Template Parameters
TransformTransform matrix type (e.g., Eigen::Matrix4(f|d) or Eigen::Isometry3(f|d))
Note
The transformation is applied after the existing transformation. (T_new = T_old * transform)

◆ translate() [1/3]

ShaderSetting & guik::ShaderSetting::translate ( const Eigen::Vector3f &  translation)

Apply translation to the model matrix.

◆ translate() [2/3]

template<typename Vector >
ShaderSetting & guik::ShaderSetting::translate ( const Vector &  translation)
inline

Apply translation to the model matrix.

Template Parameters
VectorEigen vector type (e.g., Eigen::Vector3f, Eigen::Vector3d)

◆ translate() [3/3]

ShaderSetting & guik::ShaderSetting::translate ( float  tx,
float  ty,
float  tz 
)

Apply translation to the model matrix.

◆ translation()

Eigen::Vector3f guik::ShaderSetting::translation ( ) const

Get translation vector from the model matrix.

Member Data Documentation

◆ params

std::vector<ShaderParameter> guik::ShaderSetting::params

Shader parameters.

◆ transparent

bool guik::ShaderSetting::transparent

If true, the object is rendered as transparent.


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