}
public nu.xom.Element toXML() {
Element element = new Element("CrossSliceSelection");
element.addAttribute(new Attribute("path", String.valueOf(this.path
.getId())));
element.addAttribute(new Attribute("start", String.valueOf(this.start)));
element.addAttribute(new Attribute("end", String.valueOf(this.end)));
element.addAttribute(new Attribute("spacing", String
.valueOf(this.spacing)));
element.addAttribute(new Attribute("type", String.valueOf(this.type)));
element.addAttribute(new Attribute("boarderX", String
.valueOf(this.boarderX)));
element.addAttribute(new Attribute("boarderY", String
.valueOf(this.boarderY)));
element.addAttribute(new Attribute("slatHeight", String
.valueOf(this.slatHeight)));
element.addAttribute(new Attribute("capType", String
.valueOf(this.capType)));
if (type == CrossSliceSelection.PLANE
|| type == CrossSliceSelection.PLANE_ON_EDGE
|| type == CrossSliceSelection.SLATSLICES)
element.addAttribute(new Attribute("teethCount", String
.valueOf(this.teethCount)));
if(extendLegSliceToTopOfLeg)
element.addAttribute(new Attribute("extendLegSliceToTopOfLeg", String
.valueOf(this.extendLegSliceToTopOfLeg)));
if (this.tieToLeg) {
element.addAttribute(new Attribute("tieToLeg", String
.valueOf(this.tieToLeg)));
element.addAttribute(new Attribute("legId", String
.valueOf(this.legSpline.getId())));
Element planeElement = new Element("legPlanes");
for (int i = 0; i < this.tiedToPlanes.size(); i++) {
SlicePlane curSlice = (SlicePlane)this.tiedToPlanes.get(i);
Element legPlane = new Element("legPlane");
legPlane.addAttribute(new Attribute("planeId", String
.valueOf(curSlice.getId())));
planeElement.appendChild(legPlane);
}
element.appendChild(planeElement);
}
if (this.cropToCurrentShape)
element.addAttribute(new Attribute("constrainToShape", String
.valueOf(this.cropToCurrentShape)));
if (this.flipSide)
element.addAttribute(new Attribute("flipSide", String
.valueOf(this.flipSide)));
if (this.generateFlushTops)
element.addAttribute(new Attribute("generateFlushTops", String
.valueOf(this.generateFlushTops)));
if (this.smooth)
element.addAttribute(new Attribute("smooth", String
.valueOf(this.smooth)));
return element;
}