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