Exemple #1
0
  public void toXML(PrintWriter w) throws ParamError {
    prepare(); // read parameters from paramDB
    w.println("<?xml version='1.0' ?>");
    w.println();
    w.println("<arbaro>");
    w.println("  <species name='" + Species + "'>");
    w.println("    <!-- general params -->");
    // FIXME: maybe use paramDB to print out params
    // thus no one could be forgotten?
    writeParamXML(w, "WoodType", WoodType);
    writeParamXML(w, "Shape", Shape);
    writeParamXML(w, "Levels", Levels);
    writeParamXML(w, "Scale", Scale);
    writeParamXML(w, "ScaleV", ScaleV);
    writeParamXML(w, "BaseSize", BaseSize);
    writeParamXML(w, "Ratio", Ratio);
    writeParamXML(w, "RatioPower", RatioPower);
    writeParamXML(w, "Flare", Flare);
    writeParamXML(w, "Lobes", Lobes);
    writeParamXML(w, "LobeDepth", LobeDepth);
    writeParamXML(w, "Smooth", Smooth);
    writeParamXML(w, "Leaves", Leaves);
    writeParamXML(w, "LeafShape", LeafShape);
    writeParamXML(w, "LeafScale", LeafScale);
    writeParamXML(w, "LeafScaleX", LeafScaleX);
    writeParamXML(w, "LeafQuality", LeafQuality);
    writeParamXML(w, "LeafStemLen", LeafStemLen);
    writeParamXML(w, "LeafDistrib", LeafDistrib);
    writeParamXML(w, "LeafBend", LeafBend);
    writeParamXML(w, "AttractionUp", AttractionUp);
    writeParamXML(w, "PruneRatio", PruneRatio);
    writeParamXML(w, "PrunePowerLow", PrunePowerLow);
    writeParamXML(w, "PrunePowerHigh", PrunePowerHigh);
    writeParamXML(w, "PruneWidth", PruneWidth);
    writeParamXML(w, "PruneWidthPeak", PruneWidthPeak);
    writeParamXML(w, "0Scale", _0Scale);
    writeParamXML(w, "0ScaleV", _0ScaleV);
    writeParamXML(w, "0BaseSplits", _0BaseSplits);

    for (int i = 0; i <= Math.min(Levels, 3); i++) {
      levelParams[i].toXML(w, i == Levels); // i==Levels => leaf level only
    }
    w.println("  </species>");
    w.println("</arbaro>");
    w.flush();
  }