Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2017-09-19 14:55:48 +0300
committerbubnikv <bubnikv@gmail.com>2017-09-19 14:55:48 +0300
commit473233019cf6b3d0e6a9aac5b4b8e1b904e5d9ee (patch)
treeeb564a05dad1dcdb423438577eda9258175e5a68 /xs/src/perlglue.cpp
parentb58756f38b9871f713926fae38daec2db2e64640 (diff)
Initial partial implementation of presets in C++.
Diffstat (limited to 'xs/src/perlglue.cpp')
-rw-r--r--xs/src/perlglue.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/xs/src/perlglue.cpp b/xs/src/perlglue.cpp
index 17c343589..3b7a62299 100644
--- a/xs/src/perlglue.cpp
+++ b/xs/src/perlglue.cpp
@@ -57,6 +57,9 @@ REGISTER_CLASS(TriangleMesh, "TriangleMesh");
REGISTER_CLASS(GLShader, "GUI::_3DScene::GLShader");
REGISTER_CLASS(GLVolume, "GUI::_3DScene::GLVolume");
REGISTER_CLASS(GLVolumeCollection, "GUI::_3DScene::GLVolume::Collection");
+REGISTER_CLASS(Preset, "GUI::Preset");
+REGISTER_CLASS(PresetCollection, "GUI::PresetCollection");
+REGISTER_CLASS(PresetBundle, "GUI::PresetBundle");
SV*
ConfigBase__as_hash(ConfigBase* THIS) {
@@ -138,8 +141,8 @@ ConfigOption_to_SV(const ConfigOption &opt, const ConfigOptionDef &def) {
const ConfigOptionBools* optv = dynamic_cast<const ConfigOptionBools*>(&opt);
AV* av = newAV();
av_fill(av, optv->values.size()-1);
- for (std::vector<bool>::const_iterator it = optv->values.begin(); it != optv->values.end(); ++it)
- av_store(av, it - optv->values.begin(), newSViv(*it ? 1 : 0));
+ for (size_t i = 0; i < optv->values.size(); ++ i)
+ av_store(av, i, newSViv(optv->values[i] ? 1 : 0));
return newRV_noinc((SV*)av);
} else {
std::string serialized = opt.serialize();