2016-09-13 09:24:55 +00:00
|
|
|
# Extends C++ class Slic3r::DynamicPrintConfig
|
|
|
|
# This perl class does not keep any perl class variables,
|
|
|
|
# all the storage is handled by the underlying C++ code.
|
2011-10-03 09:55:32 +00:00
|
|
|
package Slic3r::Config;
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
2011-10-09 20:29:13 +00:00
|
|
|
use utf8;
|
2011-10-03 09:55:32 +00:00
|
|
|
|
2014-01-11 13:30:34 +00:00
|
|
|
use List::Util qw(first max);
|
2012-09-28 12:13:06 +00:00
|
|
|
|
2016-09-13 09:24:55 +00:00
|
|
|
# C++ Slic3r::PrintConfigDef exported as a Perl hash of hashes.
|
|
|
|
# The C++ counterpart is a constant singleton.
|
2013-12-21 23:39:03 +00:00
|
|
|
our $Options = print_config_def();
|
2013-12-21 20:06:45 +00:00
|
|
|
|
2017-11-02 15:21:34 +00:00
|
|
|
# Generate accessors.
|
2013-12-21 20:06:45 +00:00
|
|
|
{
|
2011-10-05 16:13:47 +00:00
|
|
|
no strict 'refs';
|
2012-07-27 19:13:03 +00:00
|
|
|
for my $opt_key (keys %$Options) {
|
2017-11-02 15:21:34 +00:00
|
|
|
*{$opt_key} = sub {
|
|
|
|
#print "Slic3r::Config::accessor $opt_key\n";
|
|
|
|
$_[0]->get($opt_key)
|
|
|
|
};
|
2012-07-27 19:13:03 +00:00
|
|
|
}
|
2011-10-05 16:13:47 +00:00
|
|
|
}
|
2014-06-16 13:18:39 +00:00
|
|
|
|
2015-12-16 11:33:19 +00:00
|
|
|
package Slic3r::Config::Static;
|
2014-10-18 15:41:21 +00:00
|
|
|
use parent 'Slic3r::Config';
|
|
|
|
|
2015-12-16 11:33:19 +00:00
|
|
|
sub Slic3r::Config::GCode::new { Slic3r::Config::Static::new_GCodeConfig }
|
|
|
|
sub Slic3r::Config::Print::new { Slic3r::Config::Static::new_PrintConfig }
|
2014-01-02 09:44:54 +00:00
|
|
|
|
2011-10-03 09:55:32 +00:00
|
|
|
1;
|