mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-22 00:01:09 -06:00
Ported Slic3r::Print::State to XS
This commit is contained in:
parent
d2295cdf70
commit
a6a6a6888b
9 changed files with 124 additions and 45 deletions
36
xs/src/Print.cpp
Normal file
36
xs/src/Print.cpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
#include "Print.hpp"
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
bool
|
||||
PrintState::started(PrintStep step) const
|
||||
{
|
||||
return this->_started.find(step) != this->_started.end();
|
||||
}
|
||||
|
||||
bool
|
||||
PrintState::done(PrintStep step) const
|
||||
{
|
||||
return this->_done.find(step) != this->_done.end();
|
||||
}
|
||||
|
||||
void
|
||||
PrintState::set_started(PrintStep step)
|
||||
{
|
||||
this->_started.insert(step);
|
||||
}
|
||||
|
||||
void
|
||||
PrintState::set_done(PrintStep step)
|
||||
{
|
||||
this->_done.insert(step);
|
||||
}
|
||||
|
||||
void
|
||||
PrintState::invalidate(PrintStep step)
|
||||
{
|
||||
this->_started.erase(step);
|
||||
this->_done.erase(step);
|
||||
}
|
||||
|
||||
}
|
29
xs/src/Print.hpp
Normal file
29
xs/src/Print.hpp
Normal file
|
@ -0,0 +1,29 @@
|
|||
#ifndef slic3r_Print_hpp_
|
||||
#define slic3r_Print_hpp_
|
||||
|
||||
#include <set>
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
enum PrintStep {
|
||||
psInitExtruders, psSlice, psPerimeters, prPrepareInfill,
|
||||
psInfill, psSupportMaterial, psSkirt, psBrim,
|
||||
};
|
||||
|
||||
class PrintState
|
||||
{
|
||||
private:
|
||||
std::set<PrintStep> _started;
|
||||
std::set<PrintStep> _done;
|
||||
|
||||
public:
|
||||
bool started(PrintStep step) const;
|
||||
bool done(PrintStep step) const;
|
||||
void set_started(PrintStep step);
|
||||
void set_done(PrintStep step);
|
||||
void invalidate(PrintStep step);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue