Esempio n. 1
0
        /// <summary>
        /// Create a deep copy of this object
        /// </summary>
        /// <returns>The copy</returns>
        public Substrokes Clone()
        {
            int i, len = m_substrokes.Count;
            List <Sketch.Substroke> tempSubstrokes = new List <Sketch.Substroke>(len);

            for (i = 0; i < len; ++i)
            {
                tempSubstrokes.Add(m_substrokes[i].Clone());
            }

            Substrokes clone = new Substrokes();

            clone.m_substrokes = tempSubstrokes;

            clone.m_minX = m_minX;
            clone.m_minY = m_minY;
            clone.m_maxX = m_maxX;
            clone.m_maxY = m_maxY;


            if (m_weightedCenter != null)
            {
                clone.m_weightedCenter = m_weightedCenter.Clone();
            }

            if (m_center != null)
            {
                clone.m_center = m_center.Clone();
            }

            clone.m_maxCenter         = m_maxCenter;
            clone.m_maxWeightedCenter = m_maxWeightedCenter;

            return(clone);
        }
Esempio n. 2
0
        /// <summary>
        /// Create a clone of these substrokes and rotate it around its weighted center
        /// </summary>
        /// <param name="theta">The angle to rotate by (in radians)</param>
        /// <returns>The rotated Substrokes</returns>
        public Substrokes rotateClone(double theta)
        {
            Substrokes clone = this.Clone();

            clone.rotate(theta);
            return(clone);
        }