Rumba C++ SDK
IO.h
Go to the documentation of this file.
1 /*
2 
3  *
4  ***
5  *****
6  ********************* Mercenaries Engineering SARL
7  ***************** Copyright (C) 2018
8  *************
9  ********* http://www.mercenaries-engineering.com
10  ***********
11  **** ****
12  ** **
13 
14 */
15 #pragma once
16 
17 #include "Export.h"
18 #include "Value.h"
19 
20  namespace maquina
21  {
22  class Plug;
23  class Node;
24  class Dict;
25 
27 
31  const std::vector<Plug>& plugs,
32  const std::wstring& filepath
33  );
34 
36 
40  const std::vector<Plug>& plugs,
41  const std::wstring& filepath,
42  bool single_layer=false,
43  const std::function<bool(float, const char*)>& progress=nullptr
44  );
45 
47 
49  const std::wstring& filepath
50  );
51 
53 
55  const std::wstring& filename
56  );
57 
60  const Dict& pose,
61  float frame
62  );
64 
66  const std::wstring& filename
67  );
68 
70 
75  const std::vector<Plug>& plugs,
76  const std::wstring& filename
77  );
78 
80 
89  const std::vector<Plug>& plugs,
90  const std::wstring& filename
91  );
92 
94 
96  const std::wstring& filepath
97  );
98 
100  MAQUINA_EXPORT std::string serialize_nodes(
101  const std::vector<Node>& nodes,
102  bool serialize_external_input_connections = false
103  );
104 
106 
107  MAQUINA_EXPORT std::vector<Node> deserialize_nodes(
108  std::string buffer,
109  Node* parent=nullptr,
110  const std::string& valid_types=""
111  );
112 
114 
116  const std::wstring& file, //< Path to the input file.
117  const Dict& options //< The reader options
118  );
119 
121  MAQUINA_EXPORT std::string serialize_pose(
122  const Dict& pose
123  );
124 
127  std::string buffer
128  );
129 
130  }
MAQUINA_EXPORT void import_settings(const std::wstring &filepath)
Import workspace settings from a file.
MAQUINA_EXPORT bool import_plug_animation(const std::vector< Plug > &plugs, const std::wstring &filename)
Import an animation from a file.
MAQUINA_EXPORT void apply_pose(const Dict &pose, float frame)
Apply a pose.
MAQUINA_EXPORT std::string serialize_pose(const Dict &pose)
Serialize the pose in a string.
MAQUINA_EXPORT void export_plug_animation(const std::vector< Plug > &plugs, const std::wstring &filepath, bool single_layer=false, const std::function< bool(float, const char *)> &progress=nullptr)
Save the layer setup and plugs animation in a file.
This version of the SDK is unstable, i-e, it may change with no warning.
Definition: AddCurveAction.h:20
MAQUINA_EXPORT Dict load_pose(const std::wstring &filename)
Import the plugs values from a file.
MAQUINA_EXPORT void import_plug_values(const std::vector< Plug > &plugs, const std::wstring &filename)
Import the plugs values from a file and apply them.
#define MAQUINA_EXPORT
Definition: Export.h:31
MAQUINA_EXPORT Dict deserialize_pose(std::string buffer)
Deserialize the pose from a string.
MAQUINA_EXPORT std::vector< Node > deserialize_nodes(std::string buffer, Node *parent=nullptr, const std::string &valid_types="")
Deserialize the nodes from a string.
MAQUINA_EXPORT std::string serialize_nodes(const std::vector< Node > &nodes, bool serialize_external_input_connections=false)
Serialize the nodes in a string.
MAQUINA_EXPORT void export_settings(const std::wstring &filepath)
Save workspace settings to a file.
MAQUINA_EXPORT Dict load_animation_pose(const std::wstring &filename)
Import the animation pose from a file, in this case the value of the pose is not relevant.
MAQUINA_EXPORT void export_plug_values(const std::vector< Plug > &plugs, const std::wstring &filepath)
Save the plugs values in a file.
MAQUINA_EXPORT Value read_value(const std::wstring &file, const Dict &options)
Load an object value from a file.