Pedigree::Node(3)

NAME
Pedigree::Node - the base package for nodes in pedigree charts

SYNOPSIS
use Pedigree::Node;

$node = new Pedigree::Node(%params);

$node->CheckAllParents();

$Id = $node->Id();

$node->SetSortOrder(-1|0|1);

$result = $node->SortOrder();

$is_numbered=$node->isNumbered();

$type = $node->Type();

$Kids = $node->Kids();

$node->GetAndSortKids();

($root, $newgen) = $node->FindRoot($generation, [$sort_order]);

$x = $node->GetRelX();

$y = $node->GetRelY();

$node->SetRelX($x);

$node->SetRelX($y);

$x = $node->GetAbsX();

$y = $node->GetAbsY();

$node->SetIndexX($n);

$node->SetAbsX($x);

$node->SetAbsY($y);

$n = $node->GetIndexX();

$area = $node->SetArea();

$delta = $node->CenterKids();

$node->CalcAbsCoord($x, $y);

$node->AddConsanguinicMarriages();

$node->AddTwins($ydist);

$frame = $node->SetFrame($xdist, $ydist);

$node->DrawAll($xdist, $ydist, $belowtextfont, $abovetextfont,
           @fieldsfornode);

$node->DrawConnections();

$node->PrintAllLegends($land, @fields);

$node->PrintLegend($land, @fields);

DESCRIPTION
This is the basic package that defines nodes for pedigrees. Pedigree::PersonNode(3) and Pedigree::MarriageNode(3) inherit from this package.

    new(%params);

    Construct a new node from the given parameters. If a node with the give Id exists, add new information to the node.

    CheckAllParents();

    Check whether mothers and fathers of all nodes exist

    Id();

    Get Id of a node. Note that there is no way to set an Id of a node that was already created.

    SetSortOrder(-1|0|1);

    Normally the sibs nodes are sorted by age. However, if the nodes or their descendants are connected by a marriage line, we must sort them in the special way: all way to the left or all way to the right. The procedure SetSortOrder sets this flag for the node or deletes it depending on the argument.

    SortOrder();

    Normally the sibs nodes are sorted by age. However, if the nodes or their descendants are connected by a marriage line, we must sort them in the special way: all way to the left or all way to the right. The procedure SortOrder checks this flag.

    isNumbered();

    Check whether the node should be numbered in pedigree

    Type()

    Return node type.

    Kids();

    Get the reference to the array of kids

    GetAndSortKids();

    Apply sort the array of kids for the given node

    FindRoot($generation, [$sort_order]);

    Finds the root of the tree to which the current node belongs. Takes the current generation number and returns the root and its generation number. Here generation numbers go "backwards": the older generations have higher numbers. The found node is assigned sort order $sort_order.

    GetRelX();

    Find the relative x coordinate of the node. The coordinate is relative to the precedessor or to the marriage node, which connects this node to the proband

    GetRelY();

    Find the relative Y coordinate of the node. The coordinate is relative to the precedessor or to the marriage node, which connects this node to the proband. Note that the Y axis is down.

    SetRelX($x);

    Set the relative x coordinate of the node. The coordinate is relative to the precedessor or to the marriage node, which connects this node to the proband.

    SetRelY($y);

    Set the relative y coordinate of the node. The coordinate is relative to the precedessor or to the marriage node, which connects this node to the proband. Note that the Y axis is down.

    GetAbsX();

    Find the absolute x coordinate of the node.

    GetAbsY();

    Find the absolute Y coordinate of the node.

    GetIndexX();

    Find the number of the node in the given generation.

    SetAbsX($x);

    Set the absolute x coordinate of the node.

    SetAbsY($y);

    Set the absolute y coordinate of the node.

    SetIndexX($n);

    Set the number of the node in the given generation.

    SetArea();

    Calculate relative coordinates for all nodes, that are descendants of the given node. We create a Pedigree::Area(3) around the given node and recursively apply the function to all descendants. The subroutine returns the reference to the created area.

    CenterKids();

    Move the relative coordinates of all the kids of the given node so the given node is centered in relation to the kids. Returns the shift to be applied to the Pedigree::Area(3).

    CalcAbsCoor($x, $<y>);

    Set the absolute coordinates of the given node, if the absolute coordinates of the parent node are ($x, $y), and recursively do this for all descendants of this node. Additionally set up %node_by_gen.

    AddConsanguinicMarriages();

    Check the pedigree and add consanguinic marriages to it. Note that this procedure must be called after SetAbsCoor, so the coordinates of all nodes are set.

    AddTwins($ydist);

    Check the pedigree and add twin nodes. Note that this procedure must be called after SetAbsCoor and AddConsanguinicMarriages.

    SetFrame($xidst, $ydist);

    Calculate the frame: coordinates of the lower left and upper right corners of the picture (in ps units). As a side effect, add generation numbers to each person node and calculate the X index of each node.

    DrawConnections();

    Draw the connections from the given node to its descendants

    DrawAll($xdist, $ydist, $belowtextfont,
             $abovetextfont, @fieldsfornode);

    Draw all nodes and connections in the form suitable for pspicture

    PrintAllLegends($lang, @fields);

    Print legend for all the nodes. The first parameter is the language, the other is the fields to be included in the legend.

    PrintLegend($lang, @fields);

    This subroutine does nothing: a generic node has no legend. It is overriden by Pedigree::PersonNode(3) and Pedigree::AbortionNode(3).

ENVIRONMENT
The calling program should define $main::DEBUG and set it to 0 or 1.

SEE ALSO
pedigree(1), Pedigree(3)

AUTHOR
Boris Veytsman, Leila Akhmadeeva, 2006, 2007

POD ERRORS
Hey! The above document had some coding errors, which are explained below:

Around line 80:
    You can't have =items (as at line 136) unless the first thing after the =over is an =item