opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
annotated_motion.h
Go to the documentation of this file.
1#pragma once
2
3#include <OpenSim/Simulation/Model/ModelComponent.h>
5
6#include <filesystem>
7#include <memory>
8
9namespace OpenSim { class Storage; }
10
11namespace opyn
12{
13 // Holds an annotated motion track.
14 //
15 // Note: This is similar to OpenSim GUI (4.5)'s `AnnotatedMotion.java` class. The
16 // reason it's reproduced here is to provide like-for-like (ish) behavior
17 // between OSC's 'Preview Experimental Data' workflow and OpenSim GUI's.
18 class AnnotatedMotion final : public OpenSim::ModelComponent {
19 OpenSim_DECLARE_CONCRETE_OBJECT(AnnotatedMotion, OpenSim::ModelComponent)
20 public:
21
22 // Constructs an `AnnotationMotion` that was loaded from the given filesystem
23 // path, or throws an `std::exception` if any error occurs.
24 explicit AnnotatedMotion(const std::filesystem::path& path);
25
26 // Returns the number of data series in the motion.
27 size_t getNumDataSeries() const;
28
29 // Returns the time range (first, last) of the loaded motion.
30 osc::ClosedInterval<float> timeRange() const;
31 private:
32 static std::shared_ptr<OpenSim::Storage> loadPathIntoStorage(const std::filesystem::path&);
33 explicit AnnotatedMotion(std::shared_ptr<OpenSim::Storage>);
34
35 std::shared_ptr<OpenSim::Storage> m_Storage;
36 };
37}
Definition annotated_motion.h:18
Definition static_component_registries.h:3
Definition component_registry.h:14
Definition closed_interval.h:20