Ported the G-code generator from Perl to C++.

Removed GCode.pm
Removed the Perl bindigns for AvoidCrossingPerimeters, OozePrevention, SpiralVase, Wipe
Changed the std::set of extruder IDs to vector of IDs.
Removed some MSVC compiler warnings, removed obnoxious compiler warnings when compiling the Perl bindings.
This commit is contained in:
bubnikv 2017-05-03 18:28:22 +02:00
parent 72ae3585e4
commit e90279c513
52 changed files with 1362 additions and 1632 deletions

View file

@ -9,7 +9,7 @@ namespace Slic3r {
class Extruder
{
public:
public:
unsigned int id;
double E;
double absolute_E;
@ -17,10 +17,11 @@ class Extruder
double restart_extra;
double e_per_mm3;
double retract_speed_mm_min;
Extruder(unsigned int id, GCodeConfig *config);
virtual ~Extruder() {}
void reset();
void reset();
double extrude(double dE);
double retract(double length, double restart_extra);
double unretract();
@ -34,15 +35,26 @@ class Extruder
double extrusion_multiplier() const;
double retract_length() const;
double retract_lift() const;
int retract_speed() const;
int retract_speed() const;
double retract_restart_extra() const;
double retract_length_toolchange() const;
double retract_restart_extra_toolchange() const;
private:
GCodeConfig *config;
static Extruder key(unsigned int id) { return Extruder(id); }
private:
// Private constructor to create a key for a search in std::set.
Extruder(unsigned int id) : id(id) {}
GCodeConfig *m_config;
};
// Sort Extruder objects by the extruder id by default.
inline bool operator==(const Extruder &e1, const Extruder &e2) { return e1.id == e2.id; }
inline bool operator!=(const Extruder &e1, const Extruder &e2) { return e1.id != e2.id; }
inline bool operator< (const Extruder &e1, const Extruder &e2) { return e1.id < e2.id; }
inline bool operator> (const Extruder &e1, const Extruder &e2) { return e1.id > e2.id; }
}
#endif