| 1 |
=pod |
| 2 |
|
| 3 |
=head1 NAME |
| 4 |
|
| 5 |
Pedigree::ChildlessNode - an abortion in a pedigree |
| 6 |
|
| 7 |
=head1 SYNOPSIS |
| 8 |
|
| 9 |
use Pedigree::ChildlessNode; |
| 10 |
|
| 11 |
$node = new Pedigree::ChildlessNode(I<%params>); |
| 12 |
|
| 13 |
$node->DrawNode(I<$xidst>, I<$ydist>, I<$belowtextfont>, I<$abovetextfont>, |
| 14 |
I<@fieldsfornode>); |
| 15 |
|
| 16 |
$node->PrintLegend(I<$land>, I<@fields>); |
| 17 |
|
| 18 |
|
| 19 |
=head1 DESCRIPTION |
| 20 |
|
| 21 |
This package contains data about a "childlessness" node. This node |
| 22 |
is not numbered in pedigree. |
| 23 |
|
| 24 |
=cut |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
#################################################################### |
| 29 |
# Define the package # |
| 30 |
#################################################################### |
| 31 |
|
| 32 |
package Pedigree::ChildlessNode; |
| 33 |
use Pedigree; |
| 34 |
use strict; |
| 35 |
our @ISA=('Pedigree::PersonNode'); |
| 36 |
|
| 37 |
#################################################################### |
| 38 |
# new # |
| 39 |
#################################################################### |
| 40 |
|
| 41 |
=pod |
| 42 |
|
| 43 |
=over 4 |
| 44 |
|
| 45 |
|
| 46 |
=item B<new>(I<%params>); |
| 47 |
|
| 48 |
Construct a new node from the given parameters. |
| 49 |
|
| 50 |
=cut |
| 51 |
|
| 52 |
sub new { |
| 53 |
my ($class,%params)=@_; |
| 54 |
my $self=$class->SUPER::new(%params); |
| 55 |
if (!ref($self)) { |
| 56 |
return 0; |
| 57 |
} |
| 58 |
|
| 59 |
# |
| 60 |
# These nodes are NOT numbered in pedigrees |
| 61 |
# |
| 62 |
|
| 63 |
$self->{'Numbered'}=0; |
| 64 |
|
| 65 |
return $self; |
| 66 |
|
| 67 |
} |
| 68 |
|
| 69 |
|
| 70 |
#################################################################### |
| 71 |
# DrawNode # |
| 72 |
#################################################################### |
| 73 |
|
| 74 |
=pod |
| 75 |
|
| 76 |
=item B<DrawNode>(I<$xdist>, I<$ydist>, I<$belowtextfont>, I<$abovetextfont>, |
| 77 |
I<@fieldsfornode>); |
| 78 |
|
| 79 |
Output the command to draw this node. The parameters are |
| 80 |
distances between the nodes (in cm) and fields for abovetext (not used |
| 81 |
here). We only print the Comment field below the node, and draw this |
| 82 |
node higher than other nodes. |
| 83 |
|
| 84 |
=cut |
| 85 |
|
| 86 |
sub DrawNode { |
| 87 |
my $self=shift; |
| 88 |
my ($xdist, $ydist, $belowtextfont, $abovetextfont, @fieldsfornode) = @_; |
| 89 |
my $result = '\rput('.($xdist*$self->GetAbsX()).", ". |
| 90 |
($ydist*($self->GetAbsY()+0.6)).'){\pstChildless['; |
| 91 |
my @opts=('belowtextrp=t'); |
| 92 |
if ($self->{'Comment'}) { |
| 93 |
push @opts, |
| 94 |
'belowtext={'."$belowtextfont ".$self->{'Comment'}.'}'; |
| 95 |
} |
| 96 |
if ($self->Type() eq 'infertile') { |
| 97 |
push @opts, 'infertile'; |
| 98 |
} |
| 99 |
if (scalar @opts) { |
| 100 |
$result .= join(', ',@opts); |
| 101 |
} |
| 102 |
$result .= ']{'.$self->Id()."}}\n"; |
| 103 |
return $result; |
| 104 |
} |
| 105 |
|
| 106 |
#################################################################### |
| 107 |
# PrintLegend # |
| 108 |
#################################################################### |
| 109 |
|
| 110 |
=pod |
| 111 |
|
| 112 |
=item B<PrintLegend>(I<$lang>, I<@fields>); |
| 113 |
|
| 114 |
This subroutine does nothing since childlessness has no legend. |
| 115 |
|
| 116 |
=cut |
| 117 |
|
| 118 |
sub PrintLegend { |
| 119 |
|
| 120 |
return; |
| 121 |
} |
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
#################################################################### |
| 126 |
# THE END # |
| 127 |
#################################################################### |
| 128 |
|
| 129 |
=pod |
| 130 |
|
| 131 |
=back |
| 132 |
|
| 133 |
=head1 ENVIRONMENT |
| 134 |
|
| 135 |
The calling program should define B<$main::DEBUG> and set it to 0 |
| 136 |
or 1. |
| 137 |
|
| 138 |
=head1 SEE ALSO |
| 139 |
|
| 140 |
pedigree(1), Pedigree(3) |
| 141 |
|
| 142 |
|
| 143 |
=head1 AUTHOR |
| 144 |
|
| 145 |
Boris Veytsman, Leila Akhmadeeva, 2007 |
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
=cut |
| 150 |
|
| 151 |
1; |