From d415ec108d5f32f2f431b9e96b40ee53d2968692 Mon Sep 17 00:00:00 2001 From: Florens Wasserfall Date: Thu, 30 Mar 2017 16:05:26 +0200 Subject: [PATCH] Use config system correctly --- lib/Slic3r/GUI/Plater/ObjectLayersDialog.pm | 5 ++--- xs/src/libslic3r/LayerHeightSpline.cpp | 2 -- xs/src/libslic3r/LayerHeightSpline.hpp | 6 ------ xs/src/libslic3r/PrintObject.cpp | 5 ----- xs/xsp/LayerHeightSpline.xsp | 3 --- 5 files changed, 2 insertions(+), 19 deletions(-) diff --git a/lib/Slic3r/GUI/Plater/ObjectLayersDialog.pm b/lib/Slic3r/GUI/Plater/ObjectLayersDialog.pm index 748080a9b..7c3a28e67 100644 --- a/lib/Slic3r/GUI/Plater/ObjectLayersDialog.pm +++ b/lib/Slic3r/GUI/Plater/ObjectLayersDialog.pm @@ -99,7 +99,6 @@ sub new { $self->{splineControl}->on_z_indicator(sub { my ($z) = @_; - #$self->{preview3D}->canvas->cutting_plane_z($z); $self->{preview3D}->canvas->SetCuttingPlane(Z, $z, []); $self->{preview3D}->canvas->Render; }); @@ -121,8 +120,8 @@ sub new { $self->{plater}->pause_background_process; my $quality_value = $quality_slider->GetValue/100; $value_label->SetLabel(sprintf '%.2f', $quality_value); - my $success = $object->config->set('adaptive_slicing_quality', $quality_value); - $object->layer_height_spline->setCuspValue($quality_value); + $self->{model_object}->config->set('adaptive_slicing_quality', $quality_value); + # trigger re-slicing $self->{plater}->stop_background_process; $self->{object}->invalidate_step(STEP_SLICE); diff --git a/xs/src/libslic3r/LayerHeightSpline.cpp b/xs/src/libslic3r/LayerHeightSpline.cpp index 596a40932..505d6d8db 100644 --- a/xs/src/libslic3r/LayerHeightSpline.cpp +++ b/xs/src/libslic3r/LayerHeightSpline.cpp @@ -18,7 +18,6 @@ LayerHeightSpline::LayerHeightSpline(coordf_t object_height) this->_update_required = true; this->_layers_updated = false; this->_layer_heights_updated = false; - this->_cusp_value = -1; } LayerHeightSpline::LayerHeightSpline(const LayerHeightSpline &other) @@ -32,7 +31,6 @@ LayerHeightSpline::LayerHeightSpline(const LayerHeightSpline &other) this->_update_required = other._update_required; this->_layers_updated = other._layers_updated; this->_layer_heights_updated = other._layer_heights_updated; - this->_cusp_value = other._cusp_value; if(this->_is_valid) { this->_updateBSpline(); } diff --git a/xs/src/libslic3r/LayerHeightSpline.hpp b/xs/src/libslic3r/LayerHeightSpline.hpp index 3fe9c09a4..9a72a748b 100644 --- a/xs/src/libslic3r/LayerHeightSpline.hpp +++ b/xs/src/libslic3r/LayerHeightSpline.hpp @@ -26,15 +26,9 @@ class LayerHeightSpline std::vector getInterpolatedLayers() const; const coordf_t getLayerHeightAt(coordf_t height); - void setCuspValue(coordf_t cusp_value) {this->_cusp_value = cusp_value;}; - coordf_t getCuspValue() {return this->_cusp_value;}; - private: bool _updateBSpline(); - - coordf_t _cusp_value; - coordf_t _object_height; bool _is_valid; bool _update_required; // this should be always true except if we want to generate new layers from this spline diff --git a/xs/src/libslic3r/PrintObject.cpp b/xs/src/libslic3r/PrintObject.cpp index 7f9bf1764..b1df227a0 100644 --- a/xs/src/libslic3r/PrintObject.cpp +++ b/xs/src/libslic3r/PrintObject.cpp @@ -617,11 +617,6 @@ std::vector PrintObject::generate_object_layers(coordf_t first_layer_h if (this->config.adaptive_slicing.value) { height = 999; - // FIXME: this should de done directly via config at the dialog... - if(this->layer_height_spline.getCuspValue() >= 0) { - adaptive_quality = this->layer_height_spline.getCuspValue(); //FIXME: rename variable (cusp) - this->config.adaptive_slicing_quality.value = adaptive_quality; - } // determine next layer height height = as.next_layer_height(print_z, adaptive_quality, min_layer_height, max_layer_height); diff --git a/xs/xsp/LayerHeightSpline.xsp b/xs/xsp/LayerHeightSpline.xsp index a7b33608f..750c47b5e 100644 --- a/xs/xsp/LayerHeightSpline.xsp +++ b/xs/xsp/LayerHeightSpline.xsp @@ -24,7 +24,4 @@ std::vector getOriginalLayers(); std::vector getInterpolatedLayers(); coordf_t getLayerHeightAt(coordf_t height); - - void setCuspValue(coordf_t cusp_value); - coordf_t getCuspValue(); };