mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 00:16:04 +08:00
Merge branch 'master' of https://github.com/prusa3d/Slic3r into time_estimate
This commit is contained in:
commit
4d727263c5
@ -68,6 +68,7 @@ __PACKAGE__->mk_accessors( qw(_quat _dirty init
|
|||||||
_zoom
|
_zoom
|
||||||
|
|
||||||
_legend_enabled
|
_legend_enabled
|
||||||
|
_apply_zoom_to_volumes_filter
|
||||||
|
|
||||||
) );
|
) );
|
||||||
|
|
||||||
@ -142,6 +143,7 @@ sub new {
|
|||||||
$self->_zoom(1);
|
$self->_zoom(1);
|
||||||
$self->_legend_enabled(0);
|
$self->_legend_enabled(0);
|
||||||
$self->use_plain_shader(0);
|
$self->use_plain_shader(0);
|
||||||
|
$self->_apply_zoom_to_volumes_filter(0);
|
||||||
|
|
||||||
# Collection of GLVolume objects
|
# Collection of GLVolume objects
|
||||||
$self->volumes(Slic3r::GUI::_3DScene::GLVolume::Collection->new);
|
$self->volumes(Slic3r::GUI::_3DScene::GLVolume::Collection->new);
|
||||||
@ -704,14 +706,18 @@ sub zoom_to_volume {
|
|||||||
|
|
||||||
sub zoom_to_volumes {
|
sub zoom_to_volumes {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
|
$self->_apply_zoom_to_volumes_filter(1);
|
||||||
$self->zoom_to_bounding_box($self->volumes_bounding_box);
|
$self->zoom_to_bounding_box($self->volumes_bounding_box);
|
||||||
|
$self->_apply_zoom_to_volumes_filter(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub volumes_bounding_box {
|
sub volumes_bounding_box {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
|
|
||||||
my $bb = Slic3r::Geometry::BoundingBoxf3->new;
|
my $bb = Slic3r::Geometry::BoundingBoxf3->new;
|
||||||
$bb->merge($_->transformed_bounding_box) for @{$self->volumes};
|
foreach my $v (@{$self->volumes}) {
|
||||||
|
$bb->merge($v->transformed_bounding_box) if (! $self->_apply_zoom_to_volumes_filter || $v->zoom_to_volumes);
|
||||||
|
}
|
||||||
return $bb;
|
return $bb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1384,7 +1384,7 @@ void GCode::apply_print_config(const PrintConfig &print_config)
|
|||||||
|
|
||||||
void GCode::append_full_config(const Print& print, std::string& str)
|
void GCode::append_full_config(const Print& print, std::string& str)
|
||||||
{
|
{
|
||||||
char buff[1024];
|
char buff[4096];
|
||||||
|
|
||||||
const StaticPrintConfig *configs[] = { &print.config, &print.default_object_config, &print.default_region_config };
|
const StaticPrintConfig *configs[] = { &print.config, &print.default_object_config, &print.default_region_config };
|
||||||
for (size_t i = 0; i < sizeof(configs) / sizeof(configs[0]); ++i) {
|
for (size_t i = 0; i < sizeof(configs) / sizeof(configs[0]); ++i) {
|
||||||
|
@ -2211,26 +2211,31 @@ void _3DScene::_update_gcode_volumes_visibility(const GCodePreviewData& preview_
|
|||||||
case GCodePreviewVolumeIndex::Travel:
|
case GCodePreviewVolumeIndex::Travel:
|
||||||
{
|
{
|
||||||
volume->is_active = preview_data.travel.is_visible;
|
volume->is_active = preview_data.travel.is_visible;
|
||||||
|
volume->zoom_to_volumes = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GCodePreviewVolumeIndex::Retraction:
|
case GCodePreviewVolumeIndex::Retraction:
|
||||||
{
|
{
|
||||||
volume->is_active = preview_data.retraction.is_visible;
|
volume->is_active = preview_data.retraction.is_visible;
|
||||||
|
volume->zoom_to_volumes = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GCodePreviewVolumeIndex::Unretraction:
|
case GCodePreviewVolumeIndex::Unretraction:
|
||||||
{
|
{
|
||||||
volume->is_active = preview_data.unretraction.is_visible;
|
volume->is_active = preview_data.unretraction.is_visible;
|
||||||
|
volume->zoom_to_volumes = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GCodePreviewVolumeIndex::Shell:
|
case GCodePreviewVolumeIndex::Shell:
|
||||||
{
|
{
|
||||||
volume->is_active = preview_data.shell.is_visible;
|
volume->is_active = preview_data.shell.is_visible;
|
||||||
|
volume->zoom_to_volumes = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
volume->is_active = false;
|
volume->is_active = false;
|
||||||
|
volume->zoom_to_volumes = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -215,6 +215,7 @@ public:
|
|||||||
drag_group_id(-1),
|
drag_group_id(-1),
|
||||||
selected(false),
|
selected(false),
|
||||||
is_active(true),
|
is_active(true),
|
||||||
|
zoom_to_volumes(true),
|
||||||
hover(false),
|
hover(false),
|
||||||
tverts_range(0, size_t(-1)),
|
tverts_range(0, size_t(-1)),
|
||||||
qverts_range(0, size_t(-1))
|
qverts_range(0, size_t(-1))
|
||||||
@ -253,6 +254,8 @@ public:
|
|||||||
bool selected;
|
bool selected;
|
||||||
// Whether or not this volume is active for rendering
|
// Whether or not this volume is active for rendering
|
||||||
bool is_active;
|
bool is_active;
|
||||||
|
// Whether or not to use this volume when applying zoom_to_volumes()
|
||||||
|
bool zoom_to_volumes;
|
||||||
// Boolean: Is mouse over this object?
|
// Boolean: Is mouse over this object?
|
||||||
bool hover;
|
bool hover;
|
||||||
|
|
||||||
|
@ -42,6 +42,8 @@
|
|||||||
%code%{ RETVAL = THIS->hover; %};
|
%code%{ RETVAL = THIS->hover; %};
|
||||||
void set_hover(int i)
|
void set_hover(int i)
|
||||||
%code%{ THIS->hover = i; %};
|
%code%{ THIS->hover = i; %};
|
||||||
|
int zoom_to_volumes()
|
||||||
|
%code%{ RETVAL = THIS->zoom_to_volumes; %};
|
||||||
|
|
||||||
int object_idx() const;
|
int object_idx() const;
|
||||||
int volume_idx() const;
|
int volume_idx() const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user