Exemplo n.º 1
0
 /// <summary>
 /// Construction
 /// </summary>
 public IteratorPrimitive(SerializableMatrix offset, int repeatAmount)
 {
     this.m_OffsetTransform = offset;
     this.m_RepeatAmount = repeatAmount;
     this.m_Geometry = new ArrayList();
 }
        /// <summary>
        /// Set Transform
        /// </summary>
        private void SetGeometryTransform(XmlDocument doc, XmlElement parentNode, SerializableMatrix transformMatrix)
        {
            if (transformMatrix == null) return;

            XmlElement transformMatrixNode = doc.CreateElement("GeometryTransform");

            if (transformMatrix.OffsetX != 0 || transformMatrix.OffsetY != 0)
            {
                XmlElement offsetNode = doc.CreateElement("OffsetTransform");

                XmlAttribute offsetX = doc.CreateAttribute("offsetX");
                offsetX.InnerText = "" + transformMatrix.OffsetX;
                offsetNode.SetAttributeNode(offsetX);

                XmlAttribute offsetY = doc.CreateAttribute("offsetY");
                offsetY.InnerText = "" + transformMatrix.OffsetY;
                offsetNode.SetAttributeNode(offsetY);

                transformMatrixNode.AppendChild(offsetNode);
            }

            if (transformMatrix.ScaleX != 1 || transformMatrix.ScaleY != 1)
            {
                XmlElement scaleNode = doc.CreateElement("ScaleTransform");

                XmlAttribute scaleX = doc.CreateAttribute("scaleX");
                scaleX.InnerText = "" + transformMatrix.ScaleX;
                scaleNode.SetAttributeNode(scaleX);

                XmlAttribute scaleY = doc.CreateAttribute("scaleY");
                scaleY.InnerText = "" + transformMatrix.ScaleY;
                scaleNode.SetAttributeNode(scaleY);

                transformMatrixNode.AppendChild(scaleNode);
            }

            if (transformMatrix.RotateAngle != 0)
            {
                XmlElement rotateNode = doc.CreateElement("RotateTransform");

                XmlAttribute angle = doc.CreateAttribute("angle");
                angle.InnerText = "" + transformMatrix.RotateAngle;
                rotateNode.SetAttributeNode(angle);

                transformMatrixNode.AppendChild(rotateNode);
            }
            parentNode.AppendChild(transformMatrixNode);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Construction
 /// </summary>
 public IteratorPrimitive(SerializableMatrix offset, int repeatAmount)
 {
     this.m_OffsetTransform = offset;
     this.m_RepeatAmount    = repeatAmount;
     this.m_Geometry        = new ArrayList();
 }