OpenSim Moco
0.4.0
|
This class describes a workflow for processing a Model using ModelOperators.
The user must provide a source model via either the model property or the filepath property. In C++, one can easily chain together the operators in a processor using the C++ pipe operator:
#include <Moco/Moco/ModelProcessor.h>
Public Member Functions | |
OpenSim_DECLARE_PROPERTY (filepath, std::string, "File path to a Model (.osim).") | |
OpenSim_DECLARE_LIST_PROPERTY (operators, ModelOperator, "Operators to apply to the source Model of this processor.") | |
ModelProcessor () | |
This constructor is only for use when reading (deserializing) from an XML file. More... | |
ModelProcessor (Model model) | |
Use a Model object as the source model. More... | |
ModelProcessor (std::string filepath) | |
Use the filepath of a .osim file to obtain the source model. More... | |
Model * | setModel (std::unique_ptr< Model > model) |
Set the base model. More... | |
const Model & | getModel () const |
Obtain the base model, if one was provided via the model property or setModel(). More... | |
Model & | updModel () |
Obtain a mutable reference to the base model, if one was provided via the model property or setModel(). More... | |
Model | process (const std::string &relativeToDirectory={}) const |
Process and obtain the model. More... | |
ModelProcessor & | append (const ModelOperator &op) |
Append an operation to the end of the operations in this processor. | |
ModelProcessor & | operator| (const ModelOperator &right) |
This operator allows one to write the following code in C++: More... | |
|
inline |
This constructor is only for use when reading (deserializing) from an XML file.
|
inline |
Use a Model object as the source model.
Since this constructor is not explicit, you can provide a Model to any function that takes a ModelProcessor (in C++).
|
inline |
Use the filepath of a .osim file to obtain the source model.
Since this constructor is not explicit, you can provide a string filepath any function that takes a ModelProcessor (in C++).
|
inline |
Obtain the base model, if one was provided via the model property or setModel().
This ignores base models specified via the filepath property.
|
inline |
This operator allows one to write the following code in C++:
|
inline |
Process and obtain the model.
If the base model is specified via the filepath property, the filepath will be evaluated relative to relativeToDirectory
, if provided.
|
inline |
Set the base model.
This returns a raw pointer equal to the pointer provided.
|
inline |
Obtain a mutable reference to the base model, if one was provided via the model property or setModel().
This ignores base models specified via the filepath property.