Description
Base class for all YAML parsers.
#include <ChParserYAML.h>


Public Types | |
| enum | YamlFileType { MBS, SPH, TDPF, FSI, VEHICLE, CUSTOM } |
Type of a Chrono YAML specification file, as declared by its type key. More... | |
Public Member Functions | |
| void | SetVerbose (bool verbose) |
| Set verbose terminal output (default: false). | |
| virtual void | SetOutputDir (const std::string &out_dir) |
| Set root output directory (default: "."). More... | |
| const std::string & | GetName () const |
| Return the name of the YAML model. | |
| virtual bool | OutputEnabled () const |
| Return true if generating output. | |
| const ChOutput::Settings & | GetOutputSettings () const |
| Return all output settings. | |
| ChOutput::Format | GetOutputFormat () const |
| Return the output type. | |
| ChOutput::Mode | GetOutputMode () const |
| Return the output mode. | |
| virtual double | GetOutputFPS () const |
| Return the output frequency. | |
| virtual bool | VisualizationEnabled () const |
| Return true if visualization is enabled. | |
| const ChVisualSystem::Settings & | GetVisualizationSettings () const |
| Return all visualization settings. | |
| double | GetRenderFPS () const |
| CameraVerticalDir | GetCameraVerticalDir () const |
| const ChVector3d & | GetCameraLocation () const |
| const ChVector3d & | GetCameraTarget () const |
| bool | EnableShadows () const |
| bool | WriteImages () const |
| const std::string & | GetImageDir () const |
| virtual void | LoadSimData (const YAML::Node &yaml) |
| Load simulation settings for this parser from the specified YAML node. More... | |
| virtual void | WriteOutput (int frame, double time) |
| Write simulation output results at the current time. More... | |
| virtual void | Output (double time) |
| Generate output at the current frame. More... | |
| virtual bool | Render (ChVisualSystem &vis, double time) |
| Render the current frame using the specified visual system if run-time visualization is available and enabled. More... | |
Static Public Member Functions | |
| static YamlFileType | ReadYamlFileType (const std::string &yaml_filename) |
| Peek in the specified YAML file and read the declared file type. More... | |
Static Protected Member Functions | |
| static YamlFileType | ReadYamlFileType (const YAML::Node &a) |
| Read the YAML file type from the given node. More... | |
Protected Attributes | |
| std::string | m_name |
| name of the YAML model | |
| bool | m_verbose |
| verbose terminal output (default: false) | |
| bool | m_use_degrees |
| all angles given in degrees (default: true) | |
| ChVisualSystem::Settings | m_vis_settings |
| visualization settings | |
| ChOutput::Settings | m_output_settings |
| output settings | |
| std::string | m_output_dir |
| root output directory | |
| std::shared_ptr< ChOutput > | m_output_db |
| output database | |
| ChYamlFileHandler | m_file_handler |
| handler for data file paths | |
Member Enumeration Documentation
◆ YamlFileType
|
strong |
Type of a Chrono YAML specification file, as declared by its type key.
CUSTOM marks a file that is not consumed by any of the Chrono YAML parsers but is instead read by application code. An unrecognized type value is also reported as CUSTOM, with a warning.
Member Function Documentation
◆ LoadSimData()
|
virtual |
Load simulation settings for this parser from the specified YAML node.
This function reads settings common to all Chrono YAML parsers (run-time visualization and output). A derived class must also read any additional parser-specific simulation settings.
Reimplemented in chrono::parsers::ChParserMbsYAML, chrono::parsers::ChParserTdpfYAML, chrono::parsers::ChParserSphYAML, and chrono::parsers::ChParserFsiYAML.
◆ Output()
|
virtual |
Generate output at the current frame.
This function ensures that output occurs at the specified frequency.
Reimplemented in chrono::parsers::ChParserFsiYAML.
◆ ReadYamlFileType() [1/2]
|
static |
Peek in the specified YAML file and read the declared file type.
Throws a runtime error if the file does not exist or does not contain a type key. An unrecognized type value is not an error: it is reported as YamlFileType::CUSTOM, with a warning.
◆ ReadYamlFileType() [2/2]
|
staticprotected |
Read the YAML file type from the given node.
The value is matched case-insensitively against the recognized types. An unrecognized value is reported as YamlFileType::CUSTOM, with a warning naming the offending value.
◆ Render()
|
virtual |
Render the current frame using the specified visual system if run-time visualization is available and enabled.
Returns false if the visual system must shut down. This function ensures that frames are rendered at the specified frequency. If requested, snapshots are saved to disk.
◆ SetOutputDir()
|
virtual |
Set root output directory (default: ".").
The specified directory must exist.
Reimplemented in chrono::parsers::ChParserFsiYAML.
◆ WriteOutput()
|
virtual |
Write simulation output results at the current time.
This base class implementation creates and initializes the output database. Derived classes must
Reimplemented in chrono::parsers::ChParserMbsYAML, chrono::parsers::ChParserTdpfYAML, and chrono::parsers::ChParserSphYAML.
The documentation for this class was generated from the following files:
- /builds/uwsbel/chrono/src/chrono_parsers/yaml/ChParserYAML.h
- /builds/uwsbel/chrono/src/chrono_parsers/yaml/ChParserYAML.cpp