SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
10 #ifndef smtk_task_UIState_h
11 #define smtk_task_UIState_h
13 #include "smtk/CoreExports.h"
15 #include "smtk/string/Token.h"
16 #include "smtk/task/UIStateGenerator.h"
18 #include "nlohmann/json.hpp"
22 #include <unordered_map>
38 void setData(std::shared_ptr<smtk::task::Task> task,
const nlohmann::json& j);
44 void setGenerator(
const std::string& className, std::shared_ptr<UIStateGenerator> generator)
46 m_generators[className] = generator;
50 void updateJson(std::shared_ptr<smtk::task::Task> task, nlohmann::json& j)
const;
53 void dump(std::ostream& os);
57 std::unordered_map<smtk::string::Token, std::unordered_map<smtk::string::Token, nlohmann::json>>
61 std::unordered_map<std::string, std::shared_ptr<UIStateGenerator>>
m_generators;
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
Stores UI state data for task UI classes.
Definition: UIState.h:31
void setGenerator(const std::string &className, std::shared_ptr< UIStateGenerator > generator)
Stores generator for given class name.
Definition: UIState.h:44
Task is a base class for all SMTK tasks.
Definition: Task.h:70
A string token identified by an integer.
Definition: Token.h:30
std::unordered_map< smtk::string::Token, std::unordered_map< smtk::string::Token, nlohmann::json > > m_data
Nested map of <<class>, <task_id, json>> for deserialized UI state data.
Definition: UIState.h:58
std::unordered_map< std::string, std::shared_ptr< UIStateGenerator > > m_generators
Map of <classname, generator> for serializing UI state data.
Definition: UIState.h:61