mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-16 02:02:42 -07:00
Type handling is mainly done using templates. Template Slic3r::ClassTraits is used to store info about exported types (perl class name). Currently only perl class name and refference name is used. Template values are initialized by REGISTER_CLASS macro. This macro is used in .cpp file of class ( it needs to be used exactly for each type). Ref<type> class is used to return value as perl reference. Operator overloading is used to make c++ and XSpp happy, only pointer value should be possible to return. Clone<type> class is used to return copy of value ( using new and copy constructor). Copy is created on assigment, this should be probably improved (memory leak on multiple assignments). It is overloaded to be able to return type, type* and type&. Typechecking in ExtrusionEntityCollection updated to check all passed types.
51 lines
740 B
C++
51 lines
740 B
C++
#include "Print.hpp"
|
|
#ifdef SLIC3RXS
|
|
#include "perlglue.hpp"
|
|
#endif
|
|
|
|
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);
|
|
}
|
|
|
|
void
|
|
PrintState::invalidate_all()
|
|
{
|
|
this->_started.clear();
|
|
this->_done.clear();
|
|
}
|
|
|
|
#ifdef SLIC3RXS
|
|
REGISTER_CLASS(PrintState, "Print::State");
|
|
#endif
|
|
|
|
}
|