mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 06:33:57 -06:00
3DScene mouse event handler partially moved to c++ - part 2
This commit is contained in:
parent
276533e236
commit
6bf009edee
12 changed files with 257 additions and 173 deletions
|
@ -37,8 +37,6 @@ use Slic3r::Geometry qw(PI);
|
|||
__PACKAGE__->mk_accessors( qw(_quat init
|
||||
on_viewport_changed
|
||||
on_select
|
||||
on_move
|
||||
on_model_update
|
||||
volumes
|
||||
|
||||
_drag_volume_idx
|
||||
|
|
|
@ -143,7 +143,8 @@ sub new {
|
|||
$cfg->set('wipe_tower_y', $new_pos_3f->y);
|
||||
$self->GetFrame->{options_tabs}{print}->load_config($cfg);
|
||||
});
|
||||
$self->{canvas3D}->set_on_model_update(sub {
|
||||
#==============================================================================================================================
|
||||
Slic3r::GUI::_3DScene::register_on_model_update_callback($self->{canvas3D}, sub {
|
||||
if (wxTheApp->{app_config}->get("background_processing")) {
|
||||
$self->schedule_background_process;
|
||||
} else {
|
||||
|
@ -151,6 +152,16 @@ sub new {
|
|||
$self->{"print_info_box_show"}->(0);
|
||||
}
|
||||
});
|
||||
|
||||
# $self->{canvas3D}->set_on_model_update(sub {
|
||||
# if (wxTheApp->{app_config}->get("background_processing")) {
|
||||
# $self->schedule_background_process;
|
||||
# } else {
|
||||
# # Hide the print info box, it is no more valid.
|
||||
# $self->{"print_info_box_show"}->(0);
|
||||
# }
|
||||
# });
|
||||
#==============================================================================================================================
|
||||
$self->{canvas3D}->on_viewport_changed(sub {
|
||||
#==============================================================================================================================
|
||||
Slic3r::GUI::_3DScene::set_viewport_from_scene($self->{preview3D}->canvas, $self->{canvas3D});
|
||||
|
|
|
@ -50,9 +50,19 @@ sub new {
|
|||
#==============================================================================================================================
|
||||
Slic3r::GUI::_3DScene::register_on_select_callback($self, $self->on_select);
|
||||
#==============================================================================================================================
|
||||
$self->on_move(sub {
|
||||
|
||||
#==============================================================================================================================
|
||||
Slic3r::GUI::_3DScene::register_on_move_callback($self, sub {
|
||||
# $self->on_move(sub {
|
||||
#==============================================================================================================================
|
||||
my @volume_idxs = @_;
|
||||
|
||||
|
||||
#==============================================================================================================================
|
||||
print "cucu";
|
||||
#==============================================================================================================================
|
||||
|
||||
|
||||
my %done = (); # prevent moving instances twice
|
||||
my $object_moved;
|
||||
my $wipe_tower_moved;
|
||||
|
@ -186,10 +196,12 @@ sub set_on_wipe_tower_moved {
|
|||
$self->{on_wipe_tower_moved} = $cb;
|
||||
}
|
||||
|
||||
sub set_on_model_update {
|
||||
my ($self, $cb) = @_;
|
||||
$self->on_model_update($cb);
|
||||
}
|
||||
#==============================================================================================================================
|
||||
#sub set_on_model_update {
|
||||
# my ($self, $cb) = @_;
|
||||
# $self->on_model_update($cb);
|
||||
#}
|
||||
#==============================================================================================================================
|
||||
|
||||
sub set_on_enable_action_buttons {
|
||||
my ($self, $cb) = @_;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue