ROOT logo
// $Id: Glass_SKEL.cxx 2089 2008-11-23 20:31:03Z matevz $

// Copyright (C) 1999-2008, Matevz Tadel. All rights reserved.
// This file is part of GLED, released under GNU General Public License version 2.
// For the licensing terms see $GLEDSYS/LICENSE or http://www.gnu.org/.

#include "SympodialTree.h"
#include "SympodialTree.c7"

// SympodialTree

//______________________________________________________________________________
//
//

ClassImp(SympodialTree);

//==============================================================================


SympodialTree::SympodialTree(const Text_t* n, const Text_t* t) :
  MonopodialTree(n, t)
{
 // _init();
}

SympodialTree::~SympodialTree()
{}

//==============================================================================

void SympodialTree::ExpandRule(const Text_t* rule, TwoParam& parent, ParametricSystem::Segments_t& newExp)
{
  const static float widthDecrease = TMath::Sqrt(0.5f);
  bool firstStack = true;
  for (size_t k = 0; k < strlen(rule); ++k)
  {
    newExp.push_back(TwoParam(rule[k], parent.mParam1, parent.mParam2));  

    TwoParam& s = newExp.back();
    if (s.mType == ']')
    {
      firstStack = false;
    }
    
    if (s.mType == '&' || s.mType == '^')
    {
      s.mParam1 = firstStack ? mTrunkAngle : mLateralAngle;
    }
    else if (s.mType == '+' || s.mType == '-')
    {
      s.mParam1 = firstStack ? mTrunkAngle : mLateralAngle;
    }
    else if (s.mType == '\\' || s.mType == '/')
    {
      s.mParam1 = 180;
    }
    else if (s.mType == 'A' || s.mType == 'B')
    {
      float contraction = firstStack ? mTrunkContraction : mLateralContraction;
      s.mParam1 *= contraction;
      s.mParam2 *= widthDecrease;
    }
  } 
  
 SympodialTree.cxx:1
 SympodialTree.cxx:2
 SympodialTree.cxx:3
 SympodialTree.cxx:4
 SympodialTree.cxx:5
 SympodialTree.cxx:6
 SympodialTree.cxx:7
 SympodialTree.cxx:8
 SympodialTree.cxx:9
 SympodialTree.cxx:10
 SympodialTree.cxx:11
 SympodialTree.cxx:12
 SympodialTree.cxx:13
 SympodialTree.cxx:14
 SympodialTree.cxx:15
 SympodialTree.cxx:16
 SympodialTree.cxx:17
 SympodialTree.cxx:18
 SympodialTree.cxx:19
 SympodialTree.cxx:20
 SympodialTree.cxx:21
 SympodialTree.cxx:22
 SympodialTree.cxx:23
 SympodialTree.cxx:24
 SympodialTree.cxx:25
 SympodialTree.cxx:26
 SympodialTree.cxx:27
 SympodialTree.cxx:28
 SympodialTree.cxx:29
 SympodialTree.cxx:30
 SympodialTree.cxx:31
 SympodialTree.cxx:32
 SympodialTree.cxx:33
 SympodialTree.cxx:34
 SympodialTree.cxx:35
 SympodialTree.cxx:36
 SympodialTree.cxx:37
 SympodialTree.cxx:38
 SympodialTree.cxx:39
 SympodialTree.cxx:40
 SympodialTree.cxx:41
 SympodialTree.cxx:42
 SympodialTree.cxx:43
 SympodialTree.cxx:44
 SympodialTree.cxx:45
 SympodialTree.cxx:46
 SympodialTree.cxx:47
 SympodialTree.cxx:48
 SympodialTree.cxx:49
 SympodialTree.cxx:50
 SympodialTree.cxx:51
 SympodialTree.cxx:52
 SympodialTree.cxx:53
 SympodialTree.cxx:54
 SympodialTree.cxx:55
 SympodialTree.cxx:56
 SympodialTree.cxx:57
 SympodialTree.cxx:58
 SympodialTree.cxx:59
 SympodialTree.cxx:60
 SympodialTree.cxx:61
 SympodialTree.cxx:62
 SympodialTree.cxx:63
 SympodialTree.cxx:64
 SympodialTree.cxx:65