File: Graphics2D.pm

package info (click to toggle)
pdl 1%3A2.4.2-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 8,140 kB
  • ctags: 3,310
  • sloc: perl: 22,273; ansic: 7,467; fortran: 6,374; sh: 214; makefile: 53
file content (47 lines) | stat: -rw-r--r-- 1,002 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package PDL::Graphics2D;


=head1 NAME

PDL::Graphics2D - An object oriented interface to PDL graphics

=head1 SYNOPSIS

use PDL::Graphics2D;
$win = PDL::Graphics2D->new(<Interface>, <Options>);

=head1 DESCRIPTION

This is an umbrella class allowing for a simple interface to all plotting
routines in PDL. On its own it does not do any work it merely passes
information to the appropriate class. Ideally this should probably offer
a uniform interface to a variety of packages.

This requires a lot more work before it is useful I feel, but it can be
used already.

=cut


{
  my %lookup=(
	      'PGPLOT' => 'PDL::Graphics::PGPLOT::Window'
	     );
  sub new {

    my $type=shift;
    my $interface=shift;

    #
    # Translate the interface name to the appropriate class name.
    #
    $interface=uc($interface);
    die "Interface $interface is not known!\n" if !exists($lookup{$interface});
    my $class = $lookup{$interface};
    eval "require $class;";
    return $class->new(@_);
  }
}

1;