ROOT logo
// $Id: Glass_SKEL.h 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/.

#ifndef Tmp1_Weed_H
#define Tmp1_Weed_H

#include <Glasses/ZNode.h>
#include <Glasses/ZVector.h>
#include <Stones/ZColor.h>


/**************************************************************************/
// Weed - a class the serves as start in introduction to plant modeling.  //
// Covers the first chapter of book The Algoritmic Beauty Of Plants by
// Przemwsylaw Pruskinewitch and Arstid Lindenmayer.
/**************************************************************************/

class Weed : public ZNode
{
  MAC_RNR_FRIENDS(Weed);

private:
  typedef std::map<char, int>              NameMap_t;
  typedef std::map<char, int>::iterator    NameMap_i;  
  NameMap_t    mNameMap;
  char*        mExpression;
  int          mLength;
  
  
  void _init();
  char* ExpandString(char* oldExp, int oldSize, char* newExp, int level);

protected:
  Int_t    mLevel;            // X{GST} 7 Value(-range=>[1, 7, 1])
  Double_t mAngle;            // X{GST} 7 Value(-range=>[0, 100, 1, 180])
  TString  mStart;            // X{GST} 7 Textor()  
  ZLink<ZVector> mRules;      // X{GS}  L {}
  
  ZColor	 mLineColor;        // X{GSP} 7 ColorButt()
  ZColor	 mLeafColor;        // X{GSP} 7 ColorButt()
  ZColor	 mFlowerColor;        // X{GSP} 7 ColorButt()

public:
  Weed(const Text_t* n="Weed", const Text_t* t=0);
  virtual ~Weed();
  
  virtual void Produce();
  const char* GetExpression() const { return mExpression; }
  int GetExpressionLength()   const { return mLength; }
  
  void DumpInfo() const;    // X{ED}  7 MButt()
  
#include "Weed.h7"
  ClassDef(Weed, 1);
}; // endclass Weed

#endif
 Weed.h:1
 Weed.h:2
 Weed.h:3
 Weed.h:4
 Weed.h:5
 Weed.h:6
 Weed.h:7
 Weed.h:8
 Weed.h:9
 Weed.h:10
 Weed.h:11
 Weed.h:12
 Weed.h:13
 Weed.h:14
 Weed.h:15
 Weed.h:16
 Weed.h:17
 Weed.h:18
 Weed.h:19
 Weed.h:20
 Weed.h:21
 Weed.h:22
 Weed.h:23
 Weed.h:24
 Weed.h:25
 Weed.h:26
 Weed.h:27
 Weed.h:28
 Weed.h:29
 Weed.h:30
 Weed.h:31
 Weed.h:32
 Weed.h:33
 Weed.h:34
 Weed.h:35
 Weed.h:36
 Weed.h:37
 Weed.h:38
 Weed.h:39
 Weed.h:40
 Weed.h:41
 Weed.h:42
 Weed.h:43
 Weed.h:44
 Weed.h:45
 Weed.h:46
 Weed.h:47
 Weed.h:48
 Weed.h:49
 Weed.h:50
 Weed.h:51
 Weed.h:52
 Weed.h:53
 Weed.h:54
 Weed.h:55
 Weed.h:56
 Weed.h:57
 Weed.h:58
 Weed.h:59
 Weed.h:60