Geometrize  1.0
An application for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
imagetaskpreferencesdata.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <map>
4 #include <string>
5 
6 #include "cereal/cereal.hpp"
7 #include "cereal/types/map.hpp"
8 #include "cereal/types/vector.hpp"
9 
10 #include "geometrize/runner/imagerunneroptions.h"
11 
12 namespace geometrize
13 {
14 
15 namespace serialization
16 {
17 
22 {
23 public:
24  template<class Archive>
25  void archive(Archive& ar, geometrize::ImageRunnerOptions& options, bool& scriptsEnabled, std::map<std::string, std::string>& scripts)
26  {
27  ar(cereal::make_nvp(shapeAlphaKey, options.alpha));
28  ar(cereal::make_nvp(maxShapeMutationsKey, options.maxShapeMutations));
29  ar(cereal::make_nvp(shapeCountKey, options.shapeCount));
30  ar(cereal::make_nvp(shapeTypesKey, options.shapeTypes));
31  ar(cereal::make_nvp(randomSeedKey, options.seed));
32  ar(cereal::make_nvp(maxThreadsKey, options.maxThreads));
33 
34  ar(cereal::make_nvp(scriptsEnabledKey, scriptsEnabled));
35  ar(cereal::make_nvp(scriptsKey, scripts));
36  }
37 
38 private:
39  const std::string shapeAlphaKey{"shapeAlpha"};
40  const std::string maxShapeMutationsKey{"maxShapeMutations"};
41  const std::string shapeCountKey{"shapeCount"};
42  const std::string shapeTypesKey{"shapeTypes"};
43  const std::string randomSeedKey{"randomSeed"};
44  const std::string maxThreadsKey{"maxThreads"};
45 
46  const std::string scriptsEnabledKey{"scriptModeEnabled"};
47  const std::string scriptsKey{"scripts"};
48 };
49 
50 }
51 
52 }
void archive(Archive &ar, geometrize::ImageRunnerOptions &options, bool &scriptsEnabled, std::map< std::string, std::string > &scripts)
Definition: imagetaskpreferencesdata.h:25
const std::string randomSeedKey
Definition: imagetaskpreferencesdata.h:43
const std::string maxShapeMutationsKey
Definition: imagetaskpreferencesdata.h:40
const std::string scriptsKey
Definition: imagetaskpreferencesdata.h:47
const std::string shapeAlphaKey
Definition: imagetaskpreferencesdata.h:39
const std::string scriptsEnabledKey
Definition: imagetaskpreferencesdata.h:46
const std::string shapeTypesKey
Definition: imagetaskpreferencesdata.h:42
const std::string shapeCountKey
Definition: imagetaskpreferencesdata.h:41
const std::string maxThreadsKey
Definition: imagetaskpreferencesdata.h:44
The ImageTaskPreferencesData struct represents the preferences data for an image task.
Definition: imagetaskpreferencesdata.h:21