Just a note to tell I made something similar in idea, giving quite different results...
See
Ferns - Static view for an example of possible renderings.
It is a bit unfinished, I will rework on it someday.
All this to say I used (from the start of the design...
) classes similar to antiplastik's suggestion, because it is a natural design once you are used to OOP. Natural in both senses of word here...
I used a slightly different breakdown, working by connected segments: a plant is made of trunk segments, each one having two branches. Branches are made of segments holding each two leaves. Looks like:
abstract class Segment
class Trunk extends Segment
{
private Trunk m_nextTrunkSegment; // The trunk part attached on this one (smaller)
private Branch m_leftBranch; // One branch attached to base of this trunk segment
private Branch m_rightBranch; // The other branch
}
class Branch extends Segment
{
private Branch m_nextBranchSegment; // The branch part attached on this one (smaller)
private boolean m_bIsLeftBranch;
private Leaf m_leftLeaf; // One leaf attached to top of this branch segment
private Leaf m_rightLeaf; // The other leaf
}
class Leaf extends Segment
{
private boolean m_bIsLeftLeaf;
}
class Plant
{
private Trunk m_stump;
}
Segment has a genotype info which describes how the plant is curved, relative proportions, color changes, etc.
It makes more regular plants, which is my goal. I plan to make the ferns to grow from very curved small state to full grown less curved state.
Your design looks very nice too!