mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
WIP: SLAPrintObjectConfig, SLAPrint / SLAPrintObject initialization.
This commit is contained in:
parent
06a51f9ed3
commit
870c435e1b
6 changed files with 92 additions and 20 deletions
|
@ -8,32 +8,64 @@
|
|||
namespace Slic3r {
|
||||
|
||||
enum SLAPrintStep {
|
||||
// slapsSliceModel,
|
||||
// slapsSliceSupports,
|
||||
slapsRasterize,
|
||||
slapsValidate,
|
||||
slapsCount
|
||||
};
|
||||
|
||||
enum SLAPrintObjectStep {
|
||||
slaposObjectSlice,
|
||||
slaposSupportIslands,
|
||||
slaposSupportPoints,
|
||||
slaposSupportTree,
|
||||
slaposBasePool,
|
||||
slaposSliceSupports,
|
||||
slaposCount
|
||||
};
|
||||
|
||||
class SLAPrint;
|
||||
|
||||
class SLAPrintObject : public PrintObjectBaseWithState<Print, SLAPrintObjectStep, slaposCount>
|
||||
class SLAPrintObject : public PrintObjectBaseWithState<SLAPrint, SLAPrintObjectStep, slaposCount>
|
||||
{
|
||||
private: // Prevents erroneous use by other classes.
|
||||
typedef PrintObjectBaseWithState<Print, SLAPrintObjectStep, slaposCount> Inherited;
|
||||
|
||||
public:
|
||||
const ModelObject* model_object() const { return m_model_object; }
|
||||
ModelObject* model_object() { return m_model_object; }
|
||||
|
||||
protected:
|
||||
// to be called from SLAPrint only.
|
||||
friend class SLAPrint;
|
||||
|
||||
SLAPrintObject(SLAPrint* print, ModelObject* model_object);
|
||||
~SLAPrintObject() {}
|
||||
|
||||
void config_apply(const ConfigBase &other, bool ignore_nonexistent = false) { this->m_config.apply(other, ignore_nonexistent); }
|
||||
void config_apply_only(const ConfigBase &other, const t_config_option_keys &keys, bool ignore_nonexistent = false)
|
||||
{ this->m_config.apply_only(other, keys, ignore_nonexistent); }
|
||||
void set_trafo(const Transform3d& trafo) { m_trafo = trafo; }
|
||||
|
||||
struct Instance {
|
||||
// Slic3r::Point objects in scaled G-code coordinates
|
||||
Point shift;
|
||||
// Rotation along the Z axis, in radians.
|
||||
float rotation;
|
||||
};
|
||||
bool set_instances(const std::vector<Instance> &instances);
|
||||
// Invalidates the step, and its depending steps in SLAPrintObject and SLAPrint.
|
||||
bool invalidate_step(SLAPrintObjectStep step);
|
||||
|
||||
private:
|
||||
// Points to the instance owned by a Model stored at the parent SLAPrint instance.
|
||||
ModelObject *m_model_object;
|
||||
// Object specific configuration, pulled from the configuration layer.
|
||||
SLAPrintObjectConfig m_config;
|
||||
// Translation in Z + Rotation by Y and Z + Scaling / Mirroring.
|
||||
Transform3d m_trafo = Transform3d::Identity();
|
||||
std::vector<Instance> m_instances;
|
||||
|
||||
// sla::EigenMesh3D emesh;
|
||||
std::vector<Vec2f> instances;
|
||||
// Transform3f tr;
|
||||
// std::unique_ptr<sla::SLASupportTree> support_tree_ptr;
|
||||
// SlicedSupports slice_cache;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue