From fb08588007111634586a82d629043dc5d4d82f8e Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Fri, 9 Jan 2015 01:30:04 +0100 Subject: [PATCH] Renamed PreviewCanvas to 3DScene --- lib/Slic3r/GUI.pm | 2 +- lib/Slic3r/GUI/{PreviewCanvas.pm => 3DScene.pm} | 6 +++--- lib/Slic3r/GUI/Plater/3D.pm | 2 +- lib/Slic3r/GUI/Plater/ObjectCutDialog.pm | 2 +- lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm | 2 +- utils/view-mesh.pl | 4 ++-- utils/view-toolpaths.pl | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) rename lib/Slic3r/GUI/{PreviewCanvas.pm => 3DScene.pm} (99%) diff --git a/lib/Slic3r/GUI.pm b/lib/Slic3r/GUI.pm index 3258e52e1..ed90c5aa2 100644 --- a/lib/Slic3r/GUI.pm +++ b/lib/Slic3r/GUI.pm @@ -26,7 +26,7 @@ use Slic3r::GUI::OptionsGroup::Field; use Slic3r::GUI::SimpleTab; use Slic3r::GUI::Tab; -our $have_OpenGL = eval "use Slic3r::GUI::PreviewCanvas; 1"; +our $have_OpenGL = eval "use Slic3r::GUI::3DScene; 1"; our $have_LWP = eval "use LWP::UserAgent; 1"; use Wx 0.9901 qw(:bitmap :dialog :icon :id :misc :systemsettings :toplevelwindow diff --git a/lib/Slic3r/GUI/PreviewCanvas.pm b/lib/Slic3r/GUI/3DScene.pm similarity index 99% rename from lib/Slic3r/GUI/PreviewCanvas.pm rename to lib/Slic3r/GUI/3DScene.pm index 8cbd7e16f..5407a8689 100644 --- a/lib/Slic3r/GUI/PreviewCanvas.pm +++ b/lib/Slic3r/GUI/3DScene.pm @@ -1,4 +1,4 @@ -package Slic3r::GUI::PreviewCanvas; +package Slic3r::GUI::3DScene; use strict; use warnings; @@ -375,7 +375,7 @@ sub load_object { my $color = [ @{COLORS->[ $color_idx % scalar(@{&COLORS}) ]} ]; push @$color, $volume->modifier ? 0.5 : 1; - push @{$self->volumes}, my $v = Slic3r::GUI::PreviewCanvas::Volume->new( + push @{$self->volumes}, my $v = Slic3r::GUI::3DScene::Volume->new( bounding_box => $mesh->bounding_box, group_id => $group_id, instance_idx => $instance_idx, @@ -940,7 +940,7 @@ sub draw_volumes { glDisableClientState(GL_VERTEX_ARRAY); } -package Slic3r::GUI::PreviewCanvas::Volume; +package Slic3r::GUI::3DScene::Volume; use Moo; has 'mesh' => (is => 'rw', required => 0); # only required for cut contours diff --git a/lib/Slic3r/GUI/Plater/3D.pm b/lib/Slic3r/GUI/Plater/3D.pm index c80da919f..0e1fca4e0 100644 --- a/lib/Slic3r/GUI/Plater/3D.pm +++ b/lib/Slic3r/GUI/Plater/3D.pm @@ -8,7 +8,7 @@ use Slic3r::Geometry qw(); use Slic3r::Geometry::Clipper qw(); use Wx qw(:misc :pen :brush :sizer :font :cursor wxTAB_TRAVERSAL); use Wx::Event qw(); -use base qw(Slic3r::GUI::PreviewCanvas Class::Accessor); +use base qw(Slic3r::GUI::3DScene Class::Accessor); __PACKAGE__->mk_accessors(qw(_volumes _volumes_inv)); diff --git a/lib/Slic3r/GUI/Plater/ObjectCutDialog.pm b/lib/Slic3r/GUI/Plater/ObjectCutDialog.pm index e332ba65a..2e6f2f9cb 100644 --- a/lib/Slic3r/GUI/Plater/ObjectCutDialog.pm +++ b/lib/Slic3r/GUI/Plater/ObjectCutDialog.pm @@ -86,7 +86,7 @@ sub new { # right pane with preview canvas my $canvas; if ($Slic3r::GUI::have_OpenGL) { - $canvas = $self->{canvas} = Slic3r::GUI::PreviewCanvas->new($self); + $canvas = $self->{canvas} = Slic3r::GUI::3DScene->new($self); $canvas->enable_cutting(1); $canvas->load_object($self->{model_object}); $canvas->set_auto_bed_shape; diff --git a/lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm b/lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm index 255a1685a..ba8003e6e 100644 --- a/lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm +++ b/lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm @@ -68,7 +68,7 @@ sub new { # right pane with preview canvas my $canvas; if ($Slic3r::GUI::have_OpenGL) { - $canvas = $self->{canvas} = Slic3r::GUI::PreviewCanvas->new($self); + $canvas = $self->{canvas} = Slic3r::GUI::3DScene->new($self); $canvas->load_object($self->{model_object}); $canvas->set_auto_bed_shape; $canvas->SetSize([500,500]); diff --git a/utils/view-mesh.pl b/utils/view-mesh.pl index 25fbf3638..67fb15a12 100644 --- a/utils/view-mesh.pl +++ b/utils/view-mesh.pl @@ -12,7 +12,7 @@ BEGIN { use Getopt::Long qw(:config no_auto_abbrev); use Slic3r; use Slic3r::GUI; -use Slic3r::GUI::PreviewCanvas; +use Slic3r::GUI::3DScene; $|++; my %opt = (); @@ -66,7 +66,7 @@ sub OnInit { my $frame = Wx::Frame->new(undef, -1, 'Mesh Viewer', [-1, -1], [500, 400]); my $panel = Wx::Panel->new($frame, -1); - $self->{canvas} = Slic3r::GUI::PreviewCanvas->new($panel); + $self->{canvas} = Slic3r::GUI::3DScene->new($panel); my $sizer = Wx::BoxSizer->new(wxVERTICAL); $sizer->Add($self->{canvas}, 1, wxEXPAND, 0); diff --git a/utils/view-toolpaths.pl b/utils/view-toolpaths.pl index 847ba61d9..14ff44227 100755 --- a/utils/view-toolpaths.pl +++ b/utils/view-toolpaths.pl @@ -12,7 +12,7 @@ BEGIN { use Getopt::Long qw(:config no_auto_abbrev); use Slic3r; use Slic3r::GUI; -use Slic3r::GUI::PreviewCanvas; +use Slic3r::GUI::3DScene; $|++; my %opt = (); @@ -82,7 +82,7 @@ sub OnInit { my $canvas; if ($d3) { - $canvas = Slic3r::GUI::PreviewCanvas->new($panel); + $canvas = Slic3r::GUI::3DScene->new($panel); $canvas->print($print); $canvas->set_bed_shape($print->config->bed_shape);