opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
open_sim_decoration_generator.h
Go to the documentation of this file.
1#pragma once
2
6
7#include <functional>
8
9namespace OpenSim { class Component; }
10namespace OpenSim { class Mesh; }
11namespace OpenSim { class Model; }
12namespace OpenSim { class ModelDisplayHints; }
13namespace opyn { class ModelStatePair; }
14namespace osc { struct SceneDecoration; }
15namespace osc { class SceneCache; }
16namespace SimTK { class State; }
17
18namespace opyn
19{
20 // generates 3D decorations for the given {model, state} pair and passes
21 // each of them, tagged with their associated component, to the output
22 // consumer
25 const OpenSim::Model&,
26 const SimTK::State&,
28 float fixupScaleFactor,
29 const std::function<void(const OpenSim::Component&, osc::SceneDecoration&&)>& out
30 );
31
32 // as above, but more convenient to use in simple use-cases
33 std::vector<osc::SceneDecoration> GenerateModelDecorations(
35 const ModelStatePair&,
36 const OpenSimDecorationOptions& = {},
37 float fixupScaleFactor = 1.0f
38 );
39
40 // as above, but more convenient to use in simpler use-cases
41 std::vector<osc::SceneDecoration> GenerateModelDecorations(
43 const OpenSim::Model&,
44 const SimTK::State&,
45 const OpenSimDecorationOptions& = {},
46 float fixupScaleFactor = 1.0f
47 );
48
49 // generates 3D decorations only for `subcomponent` within the given {model, state} pair
50 // and passes each of them, tagged with their associated (potentially, sub-subcomponent)
51 // component to the output consumer
54 const OpenSim::Model&,
55 const SimTK::State&,
56 const OpenSim::Component& subcomponent,
58 float fixupScaleFactor,
59 const std::function<void(const OpenSim::Component&, osc::SceneDecoration&&)>& out,
60 bool inclusiveOfProvidedSubcomponent = true
61 );
62
63 // tries to convert the given subcomponent mesh into an OSC mesh via the decoration
64 // generation API, or throws if it fails in some way
67 const OpenSim::Model&,
68 const SimTK::State&,
69 const OpenSim::Mesh&,
71 float fixupScaleFactor
72 );
73
74 // as above, but uncached and defaults decoration options and scale factor
76 const OpenSim::Model&,
77 const SimTK::State&,
78 const OpenSim::Mesh&
79 );
80
81 // as above, but also bakes the `OpenSim::Mesh`'s `scale_factors` into the mesh's
82 // vertex data
84 const OpenSim::Model&,
85 const SimTK::State&,
86 const OpenSim::Mesh&
87 );
88
89 // returns the recommended scale factor for the given {model, state} pair
92 const OpenSim::Model&,
93 const SimTK::State&,
95 );
96}
Definition model_state_pair.h:19
Definition open_sim_decoration_options.h:22
Definition mesh.h:33
Definition scene_cache.h:25
Definition static_component_registries.h:3
Definition custom_decoration_generator.h:6
Definition component_registry.h:14
osc::Mesh ToOscMeshBakeScaleFactors(const OpenSim::Model &, const SimTK::State &, const OpenSim::Mesh &)
void GenerateSubcomponentDecorations(osc::SceneCache &, const OpenSim::Model &, const SimTK::State &, const OpenSim::Component &subcomponent, const OpenSimDecorationOptions &, float fixupScaleFactor, const std::function< void(const OpenSim::Component &, osc::SceneDecoration &&)> &out, bool inclusiveOfProvidedSubcomponent=true)
float GetRecommendedScaleFactor(osc::SceneCache &, const OpenSim::Model &, const SimTK::State &, const OpenSimDecorationOptions &)
void GenerateModelDecorations(osc::SceneCache &, const OpenSim::Model &, const SimTK::State &, const OpenSimDecorationOptions &, float fixupScaleFactor, const std::function< void(const OpenSim::Component &, osc::SceneDecoration &&)> &out)
osc::Mesh ToOscMesh(osc::SceneCache &, const OpenSim::Model &, const SimTK::State &, const OpenSim::Mesh &, const OpenSimDecorationOptions &, float fixupScaleFactor)
Definition custom_decoration_generator.h:5
Definition scene_decoration.h:15