Наследование: Shape, ICloneable
Пример #1
0
        public object Clone()
        {
            ExtendedGeneralPath copy = (ExtendedGeneralPath)MemberwiseClone();

            copy._types  = (sbyte [])_types.Clone();
            copy._coords = (float [])_coords.Clone();
            return(copy);
        }
Пример #2
0
        public Shape createTransformedShape(AffineTransform at)
        {
            ExtendedGeneralPath gp = (ExtendedGeneralPath)Clone();

            if (at != null)
            {
                gp.transform(at);
            }
            return(gp);
        }
        public void Widen(Pen pen, Matrix matrix, float flatness)
        {
            if (pen == null)
            {
                throw new ArgumentNullException("pen");
            }

            Shape = new ExtendedGeneralPath(((Stroke)pen).createStrokedShape(this));
            Flatten(matrix, flatness);
        }
        public void CloseAllFigures()
        {
            ExtendedGeneralPath p  = new ExtendedGeneralPath();
            PathIterator        pi = NativeObject.getPathIterator(null);
            JPI lastSeg            = JPI.SEG_CLOSE;

            float [] points = new float[6];

            p.setWindingRule(pi.getWindingRule());
            while (!pi.isDone())
            {
                JPI curSeg = (JPI)pi.currentSegment(points);
                switch (curSeg)
                {
                case JPI.SEG_CLOSE:
                    p.closePath();
                    break;

                case JPI.SEG_MOVETO:
                    if (lastSeg != JPI.SEG_CLOSE)
                    {
                        p.closePath();
                    }
                    p.moveTo(points[0], points[1]);
                    break;

                case JPI.SEG_LINETO:
                    p.lineTo(points[0], points[1]);
                    break;

                case JPI.SEG_QUADTO:
                    p.quadTo(points[0], points[1], points[2], points[3]);
                    break;

                case JPI.SEG_CUBICTO:
                    p.curveTo(points[0], points[1], points[2], points[3], points[4], points[5]);
                    break;

                default:
                    break;
                }
                lastSeg = curSeg;
                pi.next();
            }

            p.closePath();
            Shape = p;
        }
        public void Flatten(Matrix matrix, float flatness)
        {
            AffineTransform tr = null;

            if (matrix != null)
            {
                tr = matrix.NativeObject;
            }

            //FIXME : Review (perfomance reasons).
            PathIterator        pi      = NativeObject.getPathIterator(tr, flatness);
            ExtendedGeneralPath newPath = new ExtendedGeneralPath();

            newPath.append(pi, false);
            Shape = newPath;
        }
Пример #6
0
		public GeneralPathIterator(ExtendedGeneralPath _path, AffineTransform at) 
		{
			this._path = _path;
			this._affine = at;
		}
Пример #7
0
		public GeneralPathIterator(ExtendedGeneralPath _path) : this (_path, null)
		{
		}
 GraphicsPath(ExtendedGeneralPath ptr) : base(ptr)
 {
 }
Пример #9
0
 public GeneralPathIterator(ExtendedGeneralPath _path, AffineTransform at)
 {
     this._path   = _path;
     this._affine = at;
 }
Пример #10
0
 public GeneralPathIterator(ExtendedGeneralPath _path) : this(_path, null)
 {
 }
Пример #11
0
		public void Flatten (Matrix matrix, float flatness)
		{
			AffineTransform tr = null;
			if(matrix != null)			
				tr = matrix.NativeObject;

			//FIXME : Review (perfomance reasons).
			PathIterator pi = NativeObject.getPathIterator(tr,flatness);
			ExtendedGeneralPath newPath = new ExtendedGeneralPath();
			newPath.append(pi,false);
			Shape = newPath;
		}
Пример #12
0
		public void CloseAllFigures()
		{
			ExtendedGeneralPath p = new ExtendedGeneralPath();
			PathIterator pi = NativeObject.getPathIterator(null);
			JPI lastSeg = JPI.SEG_CLOSE;
			float [] points = new float[6];
 
			p.setWindingRule(pi.getWindingRule());
			while(!pi.isDone())
			{
				JPI curSeg = (JPI)pi.currentSegment(points);
				switch(curSeg)
				{
					case JPI.SEG_CLOSE:
						p.closePath();
						break;
					case JPI.SEG_MOVETO:
						if(lastSeg != JPI.SEG_CLOSE)
							p.closePath();
						p.moveTo(points[0],points[1]);
						break;
					case JPI.SEG_LINETO:
						p.lineTo(points[0],points[1]);
						break;
					case JPI.SEG_QUADTO:
						p.quadTo(points[0],points[1],points[2],points[3]);
						break;
					case JPI.SEG_CUBICTO:
						p.curveTo(points[0],points[1],points[2],points[3],points[4],points[5]);
						break;
					default:
						break;
				}				
				lastSeg = curSeg;
				pi.next();
			}

			p.closePath();
			Shape = p;
		}  	
Пример #13
0
		GraphicsPath (ExtendedGeneralPath ptr) : base(ptr)
		{
		}
Пример #14
0
		public void Widen (Pen pen, Matrix matrix, float flatness)
		{
			if (pen == null)
				throw new ArgumentNullException("pen");

			Shape = new ExtendedGeneralPath(((Stroke)pen).createStrokedShape(this));
			Flatten(matrix, flatness);
		}