public IBackgroundPrimitive Clone() { IteratorPrimitive iterator = new IteratorPrimitive(this.OffsetTransform, this.RepeatAmount); for (int i = 0; i < this.Geometry.Count; i++) { iterator.Geometry.Add(((IBackgroundPrimitive)this.Geometry[i]).Clone()); } return iterator; }
public IBackgroundPrimitive Clone() { IteratorPrimitive iterator = new IteratorPrimitive(this.OffsetTransform, this.RepeatAmount); for (int i = 0; i < this.Geometry.Count; i++) { iterator.Geometry.Add(((IBackgroundPrimitive)this.Geometry[i]).Clone()); } return(iterator); }
public IteratorPrimitiveRenderer(IteratorPrimitive iterator, float zoom) { this.m_Iterator = iterator; this.m_Zoom = zoom; }
/// <summary> /// Parse Iterator Primitive /// </summary> private void SetIterator(XmlDocument doc, XmlElement parentNode,IteratorPrimitive iterator) { XmlElement iteratorNode = doc.CreateElement("Iterator"); XmlAttribute times = doc.CreateAttribute("times"); times.InnerText = "" + iterator.RepeatAmount; iteratorNode.SetAttributeNode(times); SetGeometryTransform(doc, iteratorNode, iterator.OffsetTransform); SetGeometry(doc, iteratorNode, iterator.Geometry); parentNode.AppendChild(iteratorNode); }
/// <summary> /// Parse Iterator Primitive /// </summary> private void ParseIterator(XmlNode iteratorNode, ArrayList geometryList) { IteratorPrimitive iterator = new IteratorPrimitive(null, 0); //get the repeat times XmlAttribute attribute = iteratorNode.Attributes["times"]; if(attribute!=null) { try { iterator.RepeatAmount = Int32.Parse(attribute.Value); } catch { } } //the child nodes are geometry list and transform matrix for(int i=0;i<iteratorNode.ChildNodes.Count;i++) { XmlNode node=iteratorNode.ChildNodes[i]; if(node.Name.Equals("GeometryTransform")) { iterator.OffsetTransform=ParseGeometryTransform(node); } else if(node.Name.Equals("Geometry")) { ParseGeometry(node,iterator.Geometry); } } geometryList.Add(iterator); }