OglVariable
OglIntVariable Defines an uniform variable for a OglShader. This is an abstract class which pass a value to an uniform variable defined into the shader. At the moment, following types are supported : - int, ivec2, ivec3, ivec4; - float, vec2, vec3, vec4; - int[], ivec2[], ivec3[], ivec4[]; - float[], vec2[], vec3[], vec4[];
Defines uniform variables for shaders in SOFA simulations, enabling the passing of various data types to these variables.
- module
- Sofa.GL.Component.Shader
- namespace
- sofa::gl::component::shader
- include
- sofa/gl/component/shader/OglVariable.h
- inherits
-
- VisualModel
- description
The OglVariable class in the SOFA framework is an abstract base class that defines uniform variables for use with shaders (OpenGL programs). This class does not directly contribute to the governing equations, operators, constitutive laws, or kinematic laws typically associated with finite element method (FEM) simulations. Instead, its role is purely related to visualization and rendering aspects of the simulation, which are necessary but do not involve mathematical operations on physical systems.
The
setValue(const DataTypes &v): Sets the value of a uniform variable.pushValue(): Abstract method that must be implemented by derived classes to push values onto the shader.
In summary, OglVariable does not contribute to the mathematical or physical aspects of FEM simulations but provides essential support for rendering and visualization within the SOFA framework.
Data Fields
| Name | Type | Default | Help |
|---|---|---|---|
value |
DataTypes | |
Methods
void
setValue
(const DataTypes & v)
virtual
void
pushValue
()
virtual
void
init
()
virtual
void
doInitVisual
(const core::visual::VisualParams * )
virtual
void
reinit
()
virtual
void
doUpdateVisual
(const core::visual::VisualParams * )
virtual
ShaderElementType
getSEType
()
virtual
const core::objectmodel::BaseData *
getSEValue
()
virtual
{
"name": "OglVariable",
"namespace": "sofa::gl::component::shader",
"module": "Sofa.GL.Component.Shader",
"include": "sofa/gl/component/shader/OglVariable.h",
"doc": "OglIntVariable\n\nDefines an uniform variable for a OglShader.\n This is an abstract class which pass a value to an uniform\n variable defined into the shader.\n At the moment, following types are supported :\n - int, ivec2, ivec3, ivec4;\n - float, vec2, vec3, vec4;\n - int[], ivec2[], ivec3[], ivec4[];\n - float[], vec2[], vec3[], vec4[];",
"inherits": [
"VisualModel"
],
"templates": [],
"data_fields": [
{
"name": "value",
"type": "DataTypes"
}
],
"links": [],
"methods": [
{
"name": "setValue",
"return_type": "void",
"params": [
{
"name": "v",
"type": "const DataTypes &"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "pushValue",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "public"
},
{
"name": "init",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "doInitVisual",
"return_type": "void",
"params": [
{
"name": "",
"type": "const core::visual::VisualParams *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "reinit",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "doUpdateVisual",
"return_type": "void",
"params": [
{
"name": "",
"type": "const core::visual::VisualParams *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getSEType",
"return_type": "ShaderElementType",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getSEValue",
"return_type": "const core::objectmodel::BaseData *",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
}
],
"description": "The `OglVariable` class in the SOFA framework is an abstract base class that defines uniform variables for use with shaders (OpenGL programs). It enables passing values to uniform variables within shaders, supporting various data types such as integers and floating-point numbers, along with their vector counterparts. The class inherits from `VisualModel`, indicating its role in visual representation and rendering within SOFA simulations.\n\n`OglVariable` interacts with other components through methods like `setValue`, which sets the value of a uniform variable, and `pushValue`, an abstract method that must be implemented by derived classes to push values onto the shader. It also includes initialization and update methods (`init`, `reinit`, `doInitVisual`, `doUpdateVisual`) that ensure proper setup and updating during the visualization pipeline.\n\nPractical usage involves setting a value through the `value` data field, which is of type `DataTypes`. Derived classes are responsible for implementing the `pushValue` method to specify how values are pushed onto the shader. The class provides methods to retrieve the shader element type (`getSEType`) and the associated base data (`getSEValue`).",
"maths": "The `OglVariable` class in the SOFA framework is an abstract base class that defines uniform variables for use with shaders (OpenGL programs). This class does not directly contribute to the governing equations, operators, constitutive laws, or kinematic laws typically associated with finite element method (FEM) simulations. Instead, its role is purely related to visualization and rendering aspects of the simulation, which are necessary but do not involve mathematical operations on physical systems.\n\nThe `OglVariable` class supports various data types including integers (`int`, `ivec2`, `ivec3`, `ivec4`) and floating-point numbers (`float`, `vec2`, `vec3`, `vec4`), along with their vector counterparts. The key methods include:\n\n- `setValue(const DataTypes &v)`: Sets the value of a uniform variable.\n- `pushValue()`: Abstract method that must be implemented by derived classes to push values onto the shader.\n\nThe class also includes initialization and update methods such as `init`, `reinit`, `doInitVisual`, and `doUpdateVisual` which ensure proper setup and updating during the visualization pipeline. These methods are part of the visual model framework in SOFA, ensuring that the graphical representation is consistent with the simulation state.\n\nIn summary, `OglVariable` does not contribute to the mathematical or physical aspects of FEM simulations but provides essential support for rendering and visualization within the SOFA framework.",
"abstract": "Defines uniform variables for shaders in SOFA simulations, enabling the passing of various data types to these variables.",
"sheet": "# OglVariable\n\n## Overview\nThe `OglVariable` class is an abstract base class that defines uniform variables for use with shaders (OpenGL programs) within the SOFA framework. It inherits from `VisualModel`, indicating its role in visual representation and rendering.\n\n## Parameters and Data\n- **value**: The value of a uniform variable, which can be one of several supported data types including integers (`int`, `ivec2`, `ivec3`, `ivec4`) and floating-point numbers (`float`, `vec2`, `vec3`, `vec4`), along with their vector counterparts. This field is of type `DataTypes`."
}