opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
opyn::ModelSpecification Class Reference

#include <model_specification.h>

Public Member Functions

 ModelSpecification ()
 Constructs an empty ModelSpecification.
 
 ModelSpecification (OpenSim::Model &&opensim_model)
 Constructs a ModelSpecification from opensim_model.
 
Model compile () const
 
std::filesystem::path root_directory () const
 
void set_root_directory (const std::filesystem::path &)
 
void to_osim (const std::filesystem::path &destination) const
 Writes *this to destination in an .osim format.
 
std::string to_osim () const
 Returns *this written to a std::string in an .osim format.
 
void bake_station_defined_frames ()
 
void flush_in_memory_resources_to (const std::filesystem::path &directory)
 

Static Public Member Functions

static ModelSpecification from_osim (const std::filesystem::path &source)
 
static ModelSpecification example_pendulum ()
 
static ModelSpecification example_double_pendulum ()
 

Detailed Description

Represents a high-level model specification that can be validated and compiled into a Model.

Related: https://simtk.org/api_docs/opensim/api_docs32/classOpenSim_1_1Model.html#details Related: https://opensimconfluence.atlassian.net/wiki/spaces/OpenSim/pages/53089017/SimTK+Simulation+Concepts

Constructor & Destructor Documentation

◆ ModelSpecification() [1/2]

opyn::ModelSpecification::ModelSpecification ( )
explicit

Constructs an empty ModelSpecification.

◆ ModelSpecification() [2/2]

opyn::ModelSpecification::ModelSpecification ( OpenSim::Model &&  opensim_model)
explicit

Constructs a ModelSpecification from opensim_model.

Member Function Documentation

◆ bake_station_defined_frames()

void opyn::ModelSpecification::bake_station_defined_frames ( )

Converts any StationDefinedFrames in *this into PhysicalOffsetFrames.

Can be useful for compatibility with OpenSim <4.6, which doesn't support StationDefinedFrames.

◆ compile()

Model opyn::ModelSpecification::compile ( ) const

Returns a Model compiled from this ModelSpecification, throws an exception if there's a compilation error.

◆ example_double_pendulum()

static ModelSpecification opyn::ModelSpecification::example_double_pendulum ( )
static

◆ example_pendulum()

static ModelSpecification opyn::ModelSpecification::example_pendulum ( )
static

◆ flush_in_memory_resources_to()

void opyn::ModelSpecification::flush_in_memory_resources_to ( const std::filesystem::path &  directory)

Flushes all in-memory resources in *this to directory and updates the associated components to point to the flushed resources.

◆ from_osim()

static ModelSpecification opyn::ModelSpecification::from_osim ( const std::filesystem::path &  source)
static

◆ root_directory()

std::filesystem::path opyn::ModelSpecification::root_directory ( ) const

Returns the root directory that this ModelSpecification uses when it resolves filesystem resources. That is, complete resource paths are resolved as root_directory() / resource_path.

◆ set_root_directory()

void opyn::ModelSpecification::set_root_directory ( const std::filesystem::path &  )

Sets the root directory that this ModelSpecification uses when it resolves filesystem resources.

◆ to_osim() [1/2]

std::string opyn::ModelSpecification::to_osim ( ) const

Returns *this written to a std::string in an .osim format.

◆ to_osim() [2/2]

void opyn::ModelSpecification::to_osim ( const std::filesystem::path &  destination) const

Writes *this to destination in an .osim format.


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