Exporter
The `Exporter` class facilitates the export of simulation data to files by setting bounding boxes, background color, and black-and-white rendering options, and exporting the rendered scene using specific file formats.
- namespace
- vrender
- include
- Exporter.h
- description
The Exporter class in the SOFA framework is designed to handle the exportation of simulation data to files, but it does not directly implement any governing equations or operators from a mathematical or physical perspective. Instead, its primary role is to facilitate the output of the rendered scene and post-processing results. This class provides methods for setting parameters related to bounding boxes (setBoundingBox), background color (setClearColor, setClearBackground), and black-and-white rendering (setBlackAndWhite). The central method, exportToFile, exports the rendered scene to a specified file format based on provided quality settings and rendering parameters (VRenderParams).
The class relies on virtual methods such as spewPoint, spewSegment, spewPolygone, writeHeader, and writeFooter. These methods are intended to be implemented by derived classes, enabling the handling of specific data structures and file formats. The methods spewPoint, spewSegment, and spewPolygone are responsible for writing geometric information (points, segments, polygons) to a text stream, while writeHeader and writeFooter handle the header and footer information of the exported file.
Given that Exporter is an I/O component primarily focused on exporting simulation data, it does not directly contribute to the governing equations or operators such as mass matrix $M$, stiffness matrix $K$, internal force $oldsymbol{f}_{ ext{int}}$, residual $R$, etc. It also does not involve constitutive or kinematic laws, nor does it play a role in assembly, time integration, nonlinear solve, linear solve, constraint handling, mapping, or other components of the global FEM pipeline.
In summary, Exporter is an auxiliary component designed for exporting and saving simulation results to files, aiding post-processing and analysis without directly contributing to the mathematical or physical aspects of the simulation itself.
Methods
void
exportToFile
(const QString & filename, const int & , VRenderParams & )
virtual
void
setBoundingBox
(float xmin, float ymin, float xmax, float ymax)
void
setClearColor
(float r, float g, float b)
void
setClearBackground
(bool b)
void
setBlackAndWhite
(bool b)
void
spewPoint
(const Point * , QTextStream & out)
virtual
void
spewSegment
(const Segment * , QTextStream & out)
virtual
void
spewPolygone
(const Polygone * , QTextStream & out)
virtual
void
writeHeader
(QTextStream & out)
virtual
void
writeFooter
(QTextStream & out)
virtual
{
"name": "Exporter",
"namespace": "vrender",
"module": "",
"include": "Exporter.h",
"doc": "",
"inherits": [],
"templates": [],
"data_fields": [],
"links": [],
"methods": [
{
"name": "exportToFile",
"return_type": "void",
"params": [
{
"name": "filename",
"type": "const QString &"
},
{
"name": "",
"type": "const int &"
},
{
"name": "",
"type": "VRenderParams &"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "setBoundingBox",
"return_type": "void",
"params": [
{
"name": "xmin",
"type": "float"
},
{
"name": "ymin",
"type": "float"
},
{
"name": "xmax",
"type": "float"
},
{
"name": "ymax",
"type": "float"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "setClearColor",
"return_type": "void",
"params": [
{
"name": "r",
"type": "float"
},
{
"name": "g",
"type": "float"
},
{
"name": "b",
"type": "float"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "setClearBackground",
"return_type": "void",
"params": [
{
"name": "b",
"type": "bool"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "setBlackAndWhite",
"return_type": "void",
"params": [
{
"name": "b",
"type": "bool"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "spewPoint",
"return_type": "void",
"params": [
{
"name": "",
"type": "const Point *"
},
{
"name": "out",
"type": "QTextStream &"
}
],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "protected"
},
{
"name": "spewSegment",
"return_type": "void",
"params": [
{
"name": "",
"type": "const Segment *"
},
{
"name": "out",
"type": "QTextStream &"
}
],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "protected"
},
{
"name": "spewPolygone",
"return_type": "void",
"params": [
{
"name": "",
"type": "const Polygone *"
},
{
"name": "out",
"type": "QTextStream &"
}
],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "protected"
},
{
"name": "writeHeader",
"return_type": "void",
"params": [
{
"name": "out",
"type": "QTextStream &"
}
],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "protected"
},
{
"name": "writeFooter",
"return_type": "void",
"params": [
{
"name": "out",
"type": "QTextStream &"
}
],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "protected"
}
],
"description": "The `Exporter` class in the SOFA framework, part of the vrender namespace, is designed to facilitate exporting simulation data to files. It provides methods for setting bounding boxes (`setBoundingBox`), clearing background color (`setClearColor`, `setClearBackground`), and controlling black-and-white rendering (`setBlackAndWhite`). The primary method `exportToFile` allows exporting the rendered scene to a specified file format, with parameters for specifying the filename, quality settings, and rendering parameters (`VRenderParams`). This class relies on virtual methods such as `spewPoint`, `spewSegment`, `spewPolygone`, `writeHeader`, and `writeFooter` that are implemented by derived classes to handle specific data structures and file formats. These methods write the geometry and header/footer information of the exported file. The component is used for saving simulation results or intermediate states in a variety of formats, aiding post-processing and analysis.",
"maths": "The `Exporter` class in the SOFA framework is designed to handle the exportation of simulation data to files, but it does not directly implement any governing equations or operators from a mathematical or physical perspective. Instead, its primary role is to facilitate the output of the rendered scene and post-processing results. This class provides methods for setting parameters related to bounding boxes (`setBoundingBox`), background color (`setClearColor`, `setClearBackground`), and black-and-white rendering (`setBlackAndWhite`). The central method, `exportToFile`, exports the rendered scene to a specified file format based on provided quality settings and rendering parameters (`VRenderParams`).\n\nThe class relies on virtual methods such as `spewPoint`, `spewSegment`, `spewPolygone`, `writeHeader`, and `writeFooter`. These methods are intended to be implemented by derived classes, enabling the handling of specific data structures and file formats. The methods `spewPoint`, `spewSegment`, and `spewPolygone` are responsible for writing geometric information (points, segments, polygons) to a text stream, while `writeHeader` and `writeFooter` handle the header and footer information of the exported file.\n\nGiven that `Exporter` is an I/O component primarily focused on exporting simulation data, it does not directly contribute to the governing equations or operators such as mass matrix $M$, stiffness matrix $K$, internal force $\boldsymbol{f}_{\text{int}}$, residual $R$, etc. It also does not involve constitutive or kinematic laws, nor does it play a role in assembly, time integration, nonlinear solve, linear solve, constraint handling, mapping, or other components of the global FEM pipeline.\n\nIn summary, `Exporter` is an auxiliary component designed for exporting and saving simulation results to files, aiding post-processing and analysis without directly contributing to the mathematical or physical aspects of the simulation itself.",
"abstract": "The `Exporter` class facilitates the export of simulation data to files by setting bounding boxes, background color, and black-and-white rendering options, and exporting the rendered scene using specific file formats.",
"sheet": "# Exporter\n\n## Overview\n\nThe `Exporter` class in the SOFA framework is designed to facilitate the exportation of simulation data to various file formats. It provides methods for setting bounding boxes (`setBoundingBox`), background color (`setClearColor`, `setClearBackground`), and black-and-white rendering options (`setBlackAndWhite`). The primary method, `exportToFile`, exports the rendered scene based on specified quality settings and rendering parameters.\n\n## Parameters and Data\n\nThe significant data fields exposed by the `Exporter` class include:\n\n- **Bounding Box**: Controls the bounding box dimensions with methods `setBoundingBox(xmin, ymin, xmax, ymax)`.\n- **Background Color**: Sets the background color using `setClearColor(r, g, b)`, where `r`, `g`, and `b` are float values representing red, green, and blue components respectively.\n- **Clear Background**: Enables or disables clearing the background with `setClearBackground(b)` where `b` is a boolean value.\n- **Black-and-White Rendering**: Controls black-and-white rendering using `setBlackAndWhite(b)`, where `b` is a boolean value.\n\n## Dependencies and Connections\n\nThe `Exporter` class typically requires data from the simulation scene to be exported. It interacts with other components that provide the rendered scene data, such as visual models or renderers. The `exportToFile` method relies on virtual methods (`spewPoint`, `spewSegment`, `spewPolygone`, `writeHeader`, and `writeFooter`) implemented by derived classes to handle specific file formats and data structures.\n\n## Practical Notes\n\n- Ensure that the simulation scene is fully rendered before calling `exportToFile` for accurate results.\n- The virtual methods (`spewPoint`, `spewSegment`, `spewPolygone`, `writeHeader`, `writeFooter`) must be implemented by derived classes to handle specific file formats and data structures effectively."
}