"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Graphics/TriD/TriD/Mesh.pm" between
PDL-2.077.tar.gz and PDL-2.078.tar.gz

About: PDL (Perl Data Language) aims to turn perl into an efficient numerical language for scientific computing (similar to IDL and MatLab).

Mesh.pm  (PDL-2.077):Mesh.pm  (PDL-2.078)
skipping to change at line 45 skipping to change at line 45
my($type,$data,$xaxis,$yaxis) = @_; my($type,$data,$xaxis,$yaxis) = @_;
my @dims = $data->dims; my @dims = $data->dims;
my @xydims = splice @dims,0,2; my @xydims = splice @dims,0,2;
my @overdims = @dims; my @overdims = @dims;
my $this = { my $this = {
Vertices => PDL->zeroes(3,@xydims,@overdims)->double, Vertices => PDL->zeroes(3,@xydims,@overdims)->double,
XYDims => [@xydims], XYDims => [@xydims],
OverDims => [@overdims], OverDims => [@overdims],
Data => $data, Data => $data,
}; };
PDL::Primitive::axisvalues($this->{Vertices}->slice('(0),:,:')); PDL::Primitive::axisvalues($this->{Vertices}->slice('(0),:,:')->inplace);
PDL::Primitive::axisvalues($this->{Vertices}->slice('(1),:,:')->transpose PDL::Primitive::axisvalues($this->{Vertices}->slice('(1),:,:')->transpose
); ->inplace);
PDL::Ops::assgn($this->{Data},$this->{Vertices}->slice('(2),:,:')); PDL::Ops::assgn($this->{Data},$this->{Vertices}->slice('(2),:,:'));
bless $this,$type; bless $this,$type;
} }
sub printdims {print $_[0].": ".(join ', ',$_[1]->dims)," and ", sub printdims {print $_[0].": ".(join ', ',$_[1]->dims)," and ",
(join ', ',$_[1]->broadcastids),"\n"} (join ', ',$_[1]->broadcastids),"\n"}
sub get_boundingbox { sub get_boundingbox {
my ($this, $x, $y, $c) = @_; my ($this, $x, $y, $c) = @_;
my $foo = PDL->zeroes(6)->double; my $foo = PDL->zeroes(6)->double;
skipping to change at line 148 skipping to change at line 148
# glVertex3d( # glVertex3d(
# ($this->{Vertices}->slice(":,($x),($y)") + # ($this->{Vertices}->slice(":,($x),($y)") +
# $this->{Normals}->slice(":,($x),($y),($x),($y)")) # $this->{Normals}->slice(":,($x),($y),($x),($y)"))
# ->list()); # ->list());
# glEnd(); # glEnd();
} }
} }
} }
package PDL::Graphics::TriD; package PDL::Graphics::TriD;
#use PDL::Graphics::OpenGL;
use PDL::Graphics::OpenGL::Perl::OpenGL; use PDL::Graphics::OpenGL::Perl::OpenGL;
use PDL::Core ''; use PDL::Core '';
sub pdltotrianglemesh { sub pdltotrianglemesh {
my($pdl,$x0,$x1,$y0,$y1) = @_; my($pdl,$x0,$x1,$y0,$y1) = @_;
if($#{$pdl->{Dims}} != 1) { barf "Too many dimensions for PDL::GL::Mesh: $#{$pdl->{Dims}} \n"; } if($#{$pdl->{Dims}} != 1) { barf "Too many dimensions for PDL::GL::Mesh: $#{$pdl->{Dims}} \n"; }
my ($d0,$d1); my($x,$y); my ($d0,$d1); my($x,$y);
my $xincr = ($x1 - $x0) / ($pdl->{Dims}[0]-1.0); my $xincr = ($x1 - $x0) / ($pdl->{Dims}[0]-1.0);
my $yincr = ($y1 - $y0) / ($pdl->{Dims}[1]-1.0); my $yincr = ($y1 - $y0) / ($pdl->{Dims}[1]-1.0);
$x = $x0; $x = $x0;
 End of changes. 2 change blocks. 
4 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)