mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-05 10:30:36 +08:00
Use config system correctly
This commit is contained in:
parent
eacc9cf7e8
commit
d415ec108d
@ -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);
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -26,15 +26,9 @@ class LayerHeightSpline
|
||||
std::vector<coordf_t> 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
|
||||
|
@ -617,11 +617,6 @@ std::vector<coordf_t> 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);
|
||||
|
@ -24,7 +24,4 @@
|
||||
std::vector<double> getOriginalLayers();
|
||||
std::vector<double> getInterpolatedLayers();
|
||||
coordf_t getLayerHeightAt(coordf_t height);
|
||||
|
||||
void setCuspValue(coordf_t cusp_value);
|
||||
coordf_t getCuspValue();
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user