mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Optimization of the configuration layer:
The values of StaticPrintConfig derived objects were searched by a name walking through a huge chained if. Now they are being mapped with a std::map. Also initialization of StaticPrintConfig classes from their ConfigOptionDef defaults is done by maintaining a single global definition of each StaticPrintConfig derived class, and a new instance is initialized from this static copy. Also the ConfigOption instances are casted using static_cast wherever possible, and their types are verified by a virtual type() method. This approach avoids insiginificant performance penalty of a dynamic_cast. Also the compare and clone methods were added to ConfigOption, and the cloning & compare work on binary values, not by serialization.
This commit is contained in:
parent
a91d7cb2f7
commit
3731820c48
14 changed files with 1475 additions and 934 deletions
|
@ -6,7 +6,13 @@
|
|||
|
||||
namespace Slic3r {
|
||||
|
||||
void GCodeReader::apply_config(const PrintConfigBase &config)
|
||||
void GCodeReader::apply_config(const GCodeConfig &config)
|
||||
{
|
||||
m_config = config;
|
||||
m_extrusion_axis = m_config.get_extrusion_axis()[0];
|
||||
}
|
||||
|
||||
void GCodeReader::apply_config(const DynamicPrintConfig &config)
|
||||
{
|
||||
m_config.apply(config, true);
|
||||
m_extrusion_axis = m_config.get_extrusion_axis()[0];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue