Skip to content

Commit 7c2ea70

Browse files
committed
zap unused ::{Scale,Translation,BoundingBox,Transformation}
1 parent 23692a5 commit 7c2ea70

File tree

3 files changed

+3
-100
lines changed

3 files changed

+3
-100
lines changed

lib/PDL/Graphics/TriD.pm

Lines changed: 3 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ without using indices is an Object. That is, if you have a surface,
600600
each vertex is not an object and neither is each segment of a long
601601
curve. The whole curve (or a set of curves) is the lowest level Object.
602602
603-
Transformations and groups of Objects are also Objects.
603+
Groups of Objects are also Objects.
604604
605605
A Window is simply an Object that has subobjects.
606606
@@ -622,10 +622,10 @@ There are objects that are not mentioned here; they are either internal
622622
to PDL3D or in rapidly changing states. If you use them, you do so at
623623
your own risk.
624624
625-
The syntax C<PDL::Graphics::TriD::Scale(x,y,z)> here means that you create
625+
The syntax C<PDL::Graphics::TriD::Quaternion(c,x,y,z)> here means that you create
626626
an object like
627627
628-
$c = PDL::Graphics::TriD::Scale->new($x,$y,$z);
628+
$c = PDL::Graphics::TriD::QuaternionScale->new($c,$x,$y,$z);
629629
630630
=head2 PDL::Graphics::TriD::LineStrip
631631
@@ -657,14 +657,6 @@ The constructor takes as arguments 3 2-dimensional ndarrays.
657657
This is simply a set of points in 3-space. Takes as arguments
658658
the x, y and z coordinates of the points as ndarrays.
659659
660-
=head2 PDL::Graphics::TriD::Scale(x,y,z)
661-
662-
Self-explanatory
663-
664-
=head2 PDL::Graphics::TriD::Translation(x,y,z)
665-
666-
Ditto
667-
668660
=head2 PDL::Graphics::TriD::Quaternion(c,x,y,z)
669661
670662
One way of representing rotations is with quaternions. See the appropriate
@@ -1020,57 +1012,6 @@ sub new {
10201012
return $this;
10211013
}
10221014

1023-
package PDL::Graphics::TriD::BoundingBox;
1024-
use base qw/PDL::Graphics::TriD::Object/;
1025-
use fields qw/Box/;
1026-
1027-
sub new {
1028-
my($type,$x0,$y0,$z0,$x1,$y1,$z1) = @_;
1029-
my $this = $type->SUPER::new();
1030-
$this->{Box} = [$x0,$y0,$z0,$x1,$y1,$z1];
1031-
}
1032-
1033-
sub normalize {my($this,$x0,$y0,$z0,$x1,$y1,$z1) = @_;
1034-
$this = $this->{Box};
1035-
my $trans = PDL::Graphics::TriD::Transformation->new();
1036-
my $sx = ($x1-$x0)/($this->[3]-$this->[0]);
1037-
my $sy = ($y1-$y0)/($this->[4]-$this->[1]);
1038-
my $sz = ($z1-$z0)/($this->[5]-$this->[2]);
1039-
$trans->add_transformation(
1040-
PDL::Graphics::TriD::Translation->new(
1041-
($x0-$this->[0]*$sx),
1042-
($y0-$this->[1]*$sy),
1043-
($z0-$this->[2]*$sz)
1044-
));
1045-
$trans->add_transformation(PDL::Graphics::TriD::Scale->new($sx,$sy,$sz));
1046-
return $trans;
1047-
}
1048-
1049-
package PDL::Graphics::TriD::OneTransformation;
1050-
use fields qw/Args/;
1051-
1052-
sub new {
1053-
my($type,@args) = @_;
1054-
my $this = fields::new($type);
1055-
$this->{Args} = [@args];
1056-
$this;
1057-
}
1058-
1059-
package PDL::Graphics::TriD::Scale;
1060-
use base qw/PDL::Graphics::TriD::OneTransformation/;
1061-
1062-
package PDL::Graphics::TriD::Translation;
1063-
use base qw/PDL::Graphics::TriD::OneTransformation/;
1064-
1065-
1066-
package PDL::Graphics::TriD::Transformation;
1067-
use base qw/PDL::Graphics::TriD::Object/;
1068-
1069-
sub add_transformation {
1070-
my($this,$trans) = @_;
1071-
push @{$this->{Transforms}},$trans;
1072-
}
1073-
10741015
=head1 AUTHOR
10751016
10761017
Copyright (C) 1997 Tuomas J. Lukka ([email protected]). Documentation

lib/PDL/Graphics/TriD/GL.pm

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,6 @@ sub PDL::Graphics::TriD::Object::delete_displist {
5252

5353
sub PDL::Graphics::TriD::Object::togl { $_->togl for @{$_[0]->{Objects}} }
5454

55-
my @bb1 = ([0,4,2],[0,1,2],[0,1,5],[0,4,5],[0,4,2],[3,4,2],
56-
[3,1,2],[3,1,5],[3,4,5],[3,4,2]);
57-
my @bb2 = ([0,1,2],[3,1,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]);
58-
sub PDL::Graphics::TriD::BoundingBox::togl {
59-
my($this) = @_;
60-
$this = $this->{Box};
61-
glDisable(GL_LIGHTING);
62-
glColor3d(1,1,1);
63-
glBegin(GL_LINES);
64-
glVertex3d(@{$this}[@$_]) for @bb1;
65-
glEnd();
66-
glBegin(GL_LINE_STRIP);
67-
glVertex3d(@{$this}[@$_]) for @bb2;
68-
glEnd();
69-
glEnable(GL_LIGHTING);
70-
}
71-
7255
sub PDL::Graphics::TriD::Graph::togl {
7356
my($this) = @_;
7457
$this->{Axis}{$_}->togl($this) for grep $_ ne "Default", keys %{$this->{Axis}};

lib/PDL/Graphics/TriD/VRML.pm

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -129,27 +129,6 @@ sub PDL::Graphics::TriD::Material::tovrml {
129129
);
130130
}
131131

132-
sub PDL::Graphics::TriD::Scale::tovrml {my ($this) = @_;
133-
print "Scale ",(join ',',@{$this->{Args}}),"\n";
134-
PDL::Graphics::VRMLNode->new('Transform',
135-
'scale',vrml3v(@{$this->{Args}}));
136-
}
137-
138-
139-
sub PDL::Graphics::TriD::Translation::tovrml {
140-
my ($this) = @_;
141-
PDL::Graphics::VRMLNode->new('Transform',
142-
'translation',vrml3v(@{$this->{Args}}));
143-
}
144-
145-
# XXXXX this has to be fixed -> wrap in one transform + children
146-
sub PDL::Graphics::TriD::Transformation::tovrml {
147-
my($this) = @_;
148-
my @nodes = map {$_->tovrml()} @{$this->{Transforms}};
149-
push @nodes,$this->SUPER::tovrml();
150-
}
151-
152-
153132
sub PDL::Graphics::TriD::Quaternion::tovrml {my($this) = @_;
154133
if(abs($this->[0]) == 1) { return ; }
155134
if(abs($this->[0]) >= 1) {

0 commit comments

Comments
 (0)