diff options
author | Alessandro Ranellucci <aar@cpan.org> | 2015-12-02 21:32:57 +0300 |
---|---|---|
committer | Alessandro Ranellucci <aar@cpan.org> | 2015-12-02 21:32:57 +0300 |
commit | 4f8a18bbadb52c107fa7c0f37a6fa0edb4385c5c (patch) | |
tree | f0d24bab6534b17fa5aa37215cf79124f0366b80 /xs/src/libslic3r/Config.cpp | |
parent | 3a9cf91f83a466919909bfc783a8337d0ae560f1 (diff) |
Ported Layer::maker_perimeters() to XS
Diffstat (limited to 'xs/src/libslic3r/Config.cpp')
-rw-r--r-- | xs/src/libslic3r/Config.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/xs/src/libslic3r/Config.cpp b/xs/src/libslic3r/Config.cpp index ba77d2aba..366291ff2 100644 --- a/xs/src/libslic3r/Config.cpp +++ b/xs/src/libslic3r/Config.cpp @@ -8,6 +8,18 @@ namespace Slic3r { bool +operator== (const ConfigOption &a, const ConfigOption &b) +{ + return a.serialize().compare(b.serialize()) == 0; +} + +bool +operator!= (const ConfigOption &a, const ConfigOption &b) +{ + return !(a == b); +} + +bool ConfigBase::has(const t_config_option_key &opt_key) { return (this->option(opt_key, false) != NULL); } @@ -52,8 +64,8 @@ ConfigBase::diff(ConfigBase &other) { } std::string -ConfigBase::serialize(const t_config_option_key &opt_key) { - ConfigOption* opt = this->option(opt_key); +ConfigBase::serialize(const t_config_option_key &opt_key) const { + const ConfigOption* opt = this->option(opt_key); assert(opt != NULL); return opt->serialize(); } |