Skip to content
Browse files

POD cleanups and additions in Branch.pm

  • Loading branch information...
1 parent 262a0e6 commit a08ec105b87df4aaf8c1798ec6796e8621c4c0f8 @Tlousky Tlousky committed Jun 14, 2010
Showing with 44 additions and 14 deletions.
  1. +43 −13 lib/Algorithm/Shape/RandomTree/Branch.pm
  2. +1 −1 lib/Algorithm/Shape/RandomTree/Branch/Point.pm
View
56 lib/Algorithm/Shape/RandomTree/Branch.pm
@@ -41,34 +41,64 @@ __END__
=head1 Algorithm::Shape::RandomTree::Branch
-Create an object representing a procedural, editable, randomized plant shape that
-can be rendered graphically by other modules.
+This object contains the attributes necessary to generate a branch, using
+the functions on Algorithm::Shape::RandomTree.
+
+Meant to be used as part of the Algorithm::Shape::RandomTree module and
+not really useful on it's own.
=head1 VERSION
Version 0.01
=head1 SYNOPSIS
-Quick summary of what the module does.
+ use Algorithm::Shape::RandomTree::Branch;
+
+ my $parent = $tree->branches('b1'); # The parent of the next branch
+
+ my $branch = Algorithm::Shape::RandomTree->new(
+ name => 'b2',
+ start_point => $parent->end_point,
+ end_point => $end_point, # Obj: Algorithm::Shape::RandomTree::Branch::Point
+ dy => 5,
+ dx => 5,
+ level => ( $parent->level + 1 ),
+ width => ( $parent->width - 1 ),
+ nodulation => ( $parent->nodulation - 1),
+ complexity => ( $parent->complexity),
+ path_string => "M $x1 $y1 C 3 3 2 2 $x2 $y2"; # SVG path string
+ );
+
+=head1 Attributes
+
+=head2 name
+
+=head2 start_point
+
+A Algorithm::Shape::RandomTree::Branch::Point object
+
+=head2 end_point
+
+A Algorithm::Shape::RandomTree::Branch::Point object
+
+=head2 dy
-Perhaps a little code snippet.
+=head2 dx
- use Algorithm::Shape::RandomTree;
+=head2 level
- my $foo = Algorithm::Shape::RandomTree->new();
- ...
+=head2 width
-=head1 EXPORT
+=head2 nodulation
-A list of functions that can be exported. You can delete this section
-if you don't export anything, such as for a purely object-oriented module.
+See in Algorithm::Shape::RandomTree
-=head1 SUBROUTINES/METHODS
+=head2 complexity
-=head2 function1
+See in Algorithm::Shape::RandomTree
-=head2 function2
+=head2 path_string
=head1 AUTHOR
View
2 lib/Algorithm/Shape/RandomTree/Branch/Point.pm
@@ -26,7 +26,7 @@ Version 0.01
# Create a point with (X,Y) coordinates of (1,3)
- my $foo = Algorithm::Shape::RandomTree::Branch::Point->new(
+ my $branch_point = Algorithm::Shape::RandomTree::Branch::Point->new(
x => 1,
y => 3,
);

0 comments on commit a08ec10

Please sign in to comment.
Something went wrong with that request. Please try again.