1
package Bio::Graphics::Glyph::pentagram;
4
use base qw(Bio::Graphics::Glyph::generic);
10
my $font = $self->option('labelfont') || $self->font;
12
my $pad = $font->height;
14
if ($self->option('text'))
26
sub default_text_pad_x
31
sub default_text_pad_y
44
my ($x1,$y1,$x2,$y2) = $self->calculate_boundaries(@_);
46
my $fg = $self->fgcolor;
47
my $bg = $self->bgcolor;
49
my $size = defined $self->option('size') ? $self->option('size') : $self->default_size();
51
my $poly_pkg = $self->polygon_package;
53
my $polygon = $poly_pkg->new();
55
if ($self->option('inverted') == 1)
57
$polygon->addPt($x1,$y2);
58
$polygon->addPt($x1+$size/2,$y2-$size/2);
59
$polygon->addPt($x1,$y2-$size);
60
$polygon->addPt($x1+$size, $y2-$size);
61
$polygon->addPt($x1+$size, $y2);
65
$polygon->addPt($x1,$y2);
66
$polygon->addPt($x1,$y2-$size);
67
$polygon->addPt($x1+$size/2,$y2-$size);
68
$polygon->addPt($x1+$size, $y2-$size/2);
69
$polygon->addPt($x1+$size/2, $y2);
72
$gd->filledPolygon($polygon, $bg);
73
$gd->polygon($polygon,$fg);
75
my $text = defined $self->option('text') ? $self->option('text') : $self->default_text();
79
my $text_pad_x = defined $self->option('text_pad_x') ? $self->option('text_pad_x') : $self->default_text_pad_x();
80
my $text_pad_y = defined $self->option('text_pad_y') ? $self->option('text_pad_y') : $self->default_text_pad_y();
81
my $font = $self->option('labelfont') || $self->font;
82
$gd->string($font, $x1+$text_pad_x, $y2-$size-$text_pad_y-$font->height, $text, $fg);
95
Bio::Graphics::Glyph::pentagram - The "pentagram" glyph
99
See L<Bio::Graphics::Panel> and L<Bio::Graphics::Glyph>.
103
This glyph draws a pentagram with the sharp angle pointing right
104
or,if the 'inverted' option is set to 1, an "inverted" pentagram
105
(with the sharp angle pointing inwards, not outwards).
106
There may be an optional text above the glyph.
110
In addition to the common options, the following glyph-specific
111
options are recognized:
113
Option Description Default
114
------ ----------- -------
116
-size Width and height of the 20
119
-text Text to show none
121
-text_pad_x Number of pixels between 0
122
the left edge of the glyph
123
and the start of text
125
-text_pad_x Number of pixels between 3
135
L<Bio::Graphics::Panel>,
136
L<Bio::Graphics::Glyph>,
137
L<Bio::Graphics::Glyph::arrow>,
138
L<Bio::Graphics::Glyph::cds>,
139
L<Bio::Graphics::Glyph::crossbox>,
140
L<Bio::Graphics::Glyph::diamond>,
141
L<Bio::Graphics::Glyph::dna>,
142
L<Bio::Graphics::Glyph::dot>,
143
L<Bio::Graphics::Glyph::ellipse>,
144
L<Bio::Graphics::Glyph::extending_arrow>,
145
L<Bio::Graphics::Glyph::generic>,
146
L<Bio::Graphics::Glyph::graded_segments>,
147
L<Bio::Graphics::Glyph::heterogeneous_segments>,
148
L<Bio::Graphics::Glyph::line>,
149
L<Bio::Graphics::Glyph::pinsertion>,
150
L<Bio::Graphics::Glyph::primers>,
151
L<Bio::Graphics::Glyph::rndrect>,
152
L<Bio::Graphics::Glyph::segments>,
153
L<Bio::Graphics::Glyph::ruler_arrow>,
154
L<Bio::Graphics::Glyph::toomany>,
155
L<Bio::Graphics::Glyph::transcript>,
156
L<Bio::Graphics::Glyph::transcript2>,
157
L<Bio::Graphics::Glyph::translation>,
158
L<Bio::Graphics::Glyph::triangle>,
167
Vsevolod (Simon) Ilyushchenko E<lt>simonf@cshl.eduE<gt>.
169
Copyright (c) 2004 Cold Spring Harbor Laboratory
171
This library is free software; you can redistribute it and/or modify
172
it under the same terms as Perl itself. See DISCLAIMER.txt for
173
disclaimers of warranty.