Fixed some picking issues after porting GLVolumes to C++.

Initial interface for print paths visualization by VBOs.
This commit is contained in:
bubnikv 2017-03-14 10:11:08 +01:00
parent 79e6f23fdc
commit e7a920fe16
5 changed files with 286 additions and 35 deletions

View file

@ -148,6 +148,8 @@ sub new {
$self->{layer_height_edit_last_object_id} = -1;
$self->{layer_height_edit_last_z} = 0.;
$self->{layer_height_edit_last_action} = 0;
$self->{use_VBOs} = 0;
$self->reset_objects;
@ -415,7 +417,7 @@ sub mouse_event {
}
# apply new temporary volume origin and ignore Z
$_->origin->translate($vector->x, $vector->y, 0) for @volumes; #,,
$_->translate($vector->x, $vector->y, 0) for @volumes; #,,
$self->_drag_start_pos($cur_pos);
$self->_dragged(1);
$self->Refresh;
@ -1685,7 +1687,8 @@ sub load_object {
sub load_print_toolpaths {
my ($self, $print) = @_;
Slic3r::GUI::_3DScene::_load_print_toolpaths($print, $self->volumes)
$self->GetContext if ($self->{use_VBOs});
Slic3r::GUI::_3DScene::_load_print_toolpaths($print, $self->volumes, $self->{use_VBOs})
if ($print->step_done(STEP_SKIRT) && $print->step_done(STEP_BRIM));
}
@ -1695,7 +1698,8 @@ sub load_print_toolpaths {
sub load_print_object_toolpaths {
my ($self, $object) = @_;
Slic3r::GUI::_3DScene::_load_print_object_toolpaths($object, $self->volumes);
$self->GetContext if ($self->{use_VBOs});
Slic3r::GUI::_3DScene::_load_print_object_toolpaths($object, $self->volumes, $self->{use_VBOs});
}
sub set_toolpaths_range {

View file

@ -237,7 +237,7 @@ sub selection_changed {
# deselect all meshes
if ($self->{canvas}) {
$_->selected(0) for @{$self->{canvas}->volumes};
$_->set_selected(0) for @{$self->{canvas}->volumes};
}
# disable things as if nothing is selected
@ -265,7 +265,7 @@ sub selection_changed {
if ($itemData->{type} eq 'volume') {
# select volume in 3D preview
if ($self->{canvas}) {
$self->{canvas}->volumes->[ $itemData->{volume_id} ]{selected} = 1;
$self->{canvas}->volumes->[ $itemData->{volume_id} ]->set_selected(1);
}
$self->{btn_delete}->Enable;