~ubuntu-branches/ubuntu/lucid/pdl/lucid

« back to all changes in this revision

Viewing changes to Graphics/Graphics2D.pm

  • Committer: Bazaar Package Importer
  • Author(s): Ben Gertzfield
  • Date: 2002-04-08 18:47:16 UTC
  • Revision ID: james.westby@ubuntu.com-20020408184716-0hf64dc96kin3htp
Tags: upstream-2.3.2
ImportĀ upstreamĀ versionĀ 2.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package PDL::Graphics2D;
 
2
 
 
3
 
 
4
=head1 NAME
 
5
 
 
6
PDL::Graphics2D - An object oriented interface to PDL graphics
 
7
 
 
8
=head1 SYNOPSIS
 
9
 
 
10
use PDL::Graphics2D;
 
11
$win = PDL::Graphics2D->new(<Interface>, <Options>);
 
12
 
 
13
=head1 DESCRIPTION
 
14
 
 
15
This is an umbrella class allowing for a simple interface to all plotting
 
16
routines in PDL. On its own it does not do any work it merely passes
 
17
information to the appropriate class. Ideally this should probably offer
 
18
a uniform interface to a variety of packages.
 
19
 
 
20
This requires a lot more work before it is useful I feel, but it can be
 
21
used already.
 
22
 
 
23
=cut
 
24
 
 
25
 
 
26
{
 
27
  my %lookup=(
 
28
              'PGPLOT' => 'PDL::Graphics::PGPLOT::Window'
 
29
             );
 
30
  sub new {
 
31
 
 
32
    my $type=shift;
 
33
    my $interface=shift;
 
34
 
 
35
    #
 
36
    # Translate the interface name to the appropriate class name.
 
37
    #
 
38
    $interface=uc($interface);
 
39
    die "Interface $interface is not known!\n" if !exists($lookup{$interface});
 
40
    my $class = $lookup{$interface};
 
41
    eval "require $class;";
 
42
    return $class->new(@_);
 
43
  }
 
44
}
 
45
 
 
46
1;
 
47