コード例 #1
0
ファイル: SvgDocument.cs プロジェクト: EdgarEDT/myitoppsp
        private string getOuterXml(Graph graph1,Point offset,IList connectLines ,StringBuilder sb,SvgElementCollection selectCollection)
        {
            XmlElement node = graph1.Clone() as XmlElement;
            if(graph1 is ConnectLine)
            {
                ConnectLine cline = graph1 as ConnectLine;
                if(connectLines.Contains(graph1.ID) ||(cline.StartGraph==null||cline.EndGraph==null)||(!selectCollection.Contains(cline.StartGraph)||!selectCollection.Contains(cline.EndGraph))) return string.Empty;

                connectLines.Add(graph1.ID);
            }else
            {
                Matrix matrix1 =new Matrix();
                if (graph1.SvgAttributes.ContainsKey("transform"))
                {
                    matrix1 = (graph1.SvgAttributes["transform"] as Matrix).Clone();
                }
                matrix1.Translate(-offset.X,-offset.Y,MatrixOrder.Append);
                node.SetAttribute("transform", new ItopVector.Core.Types.Transf(matrix1).ToString());
            }

            sb.Append(node.OuterXml);

            foreach(Graph graph2 in graph1.ConnectLines)
            {
                getOuterXml(graph2,Point.Empty,connectLines, sb,selectCollection);
            }

            return sb.ToString();
        }
コード例 #2
0
ファイル: SelectOperation.cs プロジェクト: EdgarEDT/myitoppsp
        public void OnMouseMove(MouseEventArgs e)
        {
            SvgElementCollection collection1;
            PointF tf1 = this.mouseAreaControl.PicturePanel.PointToView(this.mouseAreaControl.CenterPoint);
            PointF tf2 = this.mouseAreaControl.PicturePanel.PointToView(new PointF((float) e.X, (float) e.Y));
            ToolOperation operation1 = this.mouseAreaControl.CurrentOperation;
            if (this.mouseAreaControl.CurrentOperation == ToolOperation.AreaSelect && !OperationFunc.IsConnectLineOperation(operation1))
            {
                if (!this.tooltips.ContainsKey("select"))
                {
                    this.tooltips.Add("select", DrawAreaConfig.GetLabelForName("select").Trim());
                }
                this.mouseAreaControl.PicturePanel.ToolTip((string) this.tooltips["select"], 1);
            }
            if(OperationFunc.IsConnectLineOperation(operation1) && MouseArea.ConnectLinePoints==0)
            {
                if (!this.tooltips.ContainsKey("connlinestart"))
                {
                    this.tooltips.Add("connlinestart", DrawAreaConfig.GetLabelForName("connlinestart").Trim());
                }
                this.mouseAreaControl.PicturePanel.ToolTip((string) this.tooltips["connlinestart"], 1);
            }
            if(OperationFunc.IsConnectLineOperation(operation1) && MouseArea.ConnectLinePoints==1)
            {
                if (!this.tooltips.ContainsKey("connlineend"))
                {
                    this.tooltips.Add("connlineend", DrawAreaConfig.GetLabelForName("connlineend").Trim());
                }
                this.mouseAreaControl.PicturePanel.ToolTip((string) this.tooltips["connlineend"], 1);
            }
            if (e.Button != MouseButtons.None)
            {
                if (e.Button == MouseButtons.Left)
                {
                    //					string aaa=((XmlElement)selectCollection[0]).GetAttribute("layer").ToString();
                    if(this.mouseAreaControl.CanEdit==false )
                    {
                        goto Lable_CanMove;
                    }

                    if (operation1 == ToolOperation.AreaSelect)
                    {
                        this.AreaPoints.Add(new PointF((float) e.X, (float) e.Y));
                        this.mouseAreaControl.Invalidate();
                    }
                    else if (operation1 != ToolOperation.ColorSelect)
                    {
                        SizeF ef1 = this.mouseAreaControl.PicturePanel.GridSize;
                        float single1 = ef1.Height;
                        float single2 = ef1.Width;
                        if (this.currentMousePoint == MousePoint.CenterPoint)
                        {
                            this.win32.hdc = this.win32.W32GetDC(this.mouseAreaControl.Handle);
                            this.win32.W32SetROP2(7);
                            this.win32.W32PolyDraw(this.reversePath);
                            this.reversePath.Reset();
                            PointF tf5 = this.mouseAreaControl.PicturePanel.PointToView(new PointF((float) e.X, (float) e.Y));
                            if (this.mouseAreaControl.PicturePanel.SnapToGrid)
                            {
                                int num2 = (int) ((tf5.X + (single2 / 2f)) / single2);
                                int num3 = (int) ((tf5.Y + (single1 / 2f)) / single1);
                                tf5 = (PointF) new Point((int) (num2 * single2), (int) (single1 * num3));
                            }
                            PointF tf6 = this.mouseAreaControl.PicturePanel.PointToSystem(tf5);
                            this.reversePath.AddEllipse((float) (tf6.X - 3f), (float) (tf6.Y - 3f), (float) 8f, (float) 8f);
                            this.win32.W32PolyDraw(this.reversePath);
                            this.win32.ReleaseDC();
                        }
                        else if ((this.currentMousePoint != MousePoint.None) && (this.toBeSelectedPath != null)&&(this.toBeSelectedGraph==null||(this.toBeSelectedGraph!=null && !this.toBeSelectedGraph.IsLock)) && (((IGraph)selectCollection[0]).Layer.ID==SvgDocument.currentLayer || freeSelect))
                        {//�϶���ѡͼ��
                            if(operation1==ToolOperation.WindowZoom)
                            {
                                this.win32.hdc = this.win32.W32GetDC(this.mouseAreaControl.Handle);
                                this.win32.W32SetROP2(7);
                                this.win32.W32PolyDraw(this.reversePath);
                                this.reversePath.Reset();
                                PointF tf12 = new PointF((float) e.X, (float) e.Y);
                                PointF tf13 = this.mouseAreaControl.PicturePanel.PointToSystem(startpoint);
                                float single9 = Math.Min(tf13.X, tf12.X);
                                float single10 = Math.Min(tf13.Y, tf12.Y);
                                float single11 = Math.Max(tf13.X, tf12.X);
                                float single12 = Math.Max(tf13.Y, tf12.Y);
                                this.reversePath.AddRectangle(new RectangleF(single9, single10, single11 - single9, single12 - single10));
                                this.win32.W32PolyDraw(this.reversePath);
                                this.win32.ReleaseDC();
                                goto Lable_CanMove;
                            }
                            this.win32.hdc = this.win32.W32GetDC(this.mouseAreaControl.Handle);
                            this.win32.W32SetROP2(7);
                            this.win32.W32PolyDraw(this.reversePath);
                            //this.win32.ReleaseDC();
                            float single3 = 0f;
                            float single4 = 0f;
                            PointF tf7 = this.startpoint;// this.mouseAreaControl.PicturePanel.PointToView(this.startpoint);
                            PointF tf8 = this.mouseAreaControl.PicturePanel.PointToView(new PointF((float) e.X, (float) e.Y));
                            if (this.mouseAreaControl.PicturePanel.SnapToGrid)
                            {
                                int num4 = (int) ((tf7.X + (single2 / 2f)) / single2);
                                int num5 = (int) ((tf7.Y + (single1 / 2f)) / single1);
                                tf7 = (PointF) new Point((int) (num4 * single2), (int) (num5 * single1));
                                num4 = (int) ((tf8.X + (single2 / 2f)) / single2);
                                num5 = (int) ((tf8.Y + (single1 / 2f)) / single1);
                                tf8 = (PointF) new Point((int) (num4 * single2), (int) (single1 * num5));
                            }
                            tf7 = this.mouseAreaControl.PicturePanel.PointToSystem(tf7);
                            tf8 = this.mouseAreaControl.PicturePanel.PointToSystem(tf8);
                            PointF tf9 = tf7;
                            PointF tf10 = tf8;
                            this.reversePath.Reset();
                            int num6 = 0;
                            SvgElementCollection clines=new SvgElementCollection();
                            SvgElementCollection.ISvgElementEnumerator enumerator1 = this.selectCollection.GetEnumerator();

                            while (enumerator1.MoveNext())
                            {
                                float single5;
                                float single6;
                                GraphicsPath path7;
                                SvgElement element2 = (SvgElement) enumerator1.Current;
                                if (!(element2 is IGraph) )
                                {
                                    continue;
                                }
                                if (element2 is Use && (element2 as Use).LimitSize && currentMousePoint!=MousePoint.Translate)continue;
                                this.reversePath.StartFigure();
                                Matrix matrix6 = ((IGraph) element2).GraphTransform.Matrix.Clone();
                                PointF tf11 = PointF.Empty;
                                GraphicsPath path6 = (GraphicsPath) ((IGraph) element2).GPath.Clone();
                                RectangleF ef2 = PathFunc.GetBounds(path6);
                                PointF[] tfArray3 = new PointF[9] { new PointF(ef2.X, ef2.Y), new PointF(ef2.X, ef2.Y + (ef2.Height / 2f)), new PointF(ef2.X, ef2.Bottom), new PointF(ef2.X + (ef2.Width / 2f), ef2.Y), new PointF(ef2.Right, ef2.Y), new PointF(ef2.Right, ef2.Y + (ef2.Height / 2f)), new PointF(ef2.Right, ef2.Bottom), new PointF(ef2.X + (ef2.Width / 2f), ef2.Bottom), new PointF(ef2.X + (ef2.Width / 2f), ef2.Y + (ef2.Height / 2f)) } ;
                                PointF[] tfArray1 = tfArray3;
                                Matrix matrix7 = matrix6.Clone();
                                if(matrix7.IsInvertible)
                                    matrix7.Invert();
                                PointF[] tfArray4 = new PointF[3] { tf9, tf10, this.mouseAreaControl.CenterPoint } ;
                                PointF[] tfArray2 = tfArray4;
                                if(this.currentMousePoint!=MousePoint.Rotate)
                                {
                                    matrix7.TransformPoints(tfArray2);
                                }
                                tf7 = tfArray2[0];
                                tf8 = tfArray2[1];
                                tf1 = tfArray2[2];
                                matrix6.Reset();
                                single3 = tf8.X - tf7.X;
                                single4 = tf8.Y - tf7.Y;

                                switch (this.currentMousePoint)
                                {
                                    case MousePoint.ScaleTopLeft:
                                    case MousePoint.ScaleTopMiddle:
                                    case MousePoint.ScaleTopRight:
                                    case MousePoint.ScaleMiddleLeft:
                                    case MousePoint.ScaleMiddleRight:
                                    case MousePoint.ScaleBottomLeft:
                                    case MousePoint.ScaleBottomMiddle:
                                    case MousePoint.ScaleBottomRight:
                                    {
                                        if ((Control.ModifierKeys & Keys.Control) != Keys.Control)
                                        {
                                            goto Label_0D82;
                                        }
                                        if (this.currentMousePoint != MousePoint.ScaleTopLeft)
                                        {
                                            goto Label_0CC6;
                                        }
                                        tf11 = tfArray1[6];
                                        goto Label_0D85;
                                    }
                                    case MousePoint.ScaleFromCenter:
                                    case MousePoint.SkewXFromCenter:
                                    case MousePoint.SkewYFromCenter:
                                    case MousePoint.RotateFromCenter:
                                    {
                                        goto Label_MOVE;
                                    }
                                    case MousePoint.SkewXTop:
                                    case MousePoint.SkewXBottom:
                                    case MousePoint.SkewYLeft:
                                    case MousePoint.SkewYRight:
                                    {
                                        if ((Control.ModifierKeys & Keys.Control) != Keys.Control)
                                        {
                                            goto Label_0ED9;
                                        }
                                        if (this.currentMousePoint != MousePoint.SkewXBottom)
                                        {
                                            goto Label_0E88;
                                        }
                                        tf11 = tfArray1[0];
                                        goto Label_0EDC;
                                    }
                                    case MousePoint.Rotate://��ת
                                    {
                                        if ((Control.ModifierKeys & Keys.Control) != Keys.Control)
                                        {
                                            goto Label_103D;
                                        }
                                        tf11 = tfArray1[this.rotateindex];
                                        goto Label_ROTATE;
                                    }
                                    case MousePoint.Translate:
                                    {
                                        //										if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift)//�ƶ���ΧΪ45�ǵı���
                                        //										{
                                        //											single5 = (((float) Math.Atan2((double) single4, (double) single3)) * 180f) / 3.141593f;
                                        //											single5 = ((int) Math.Round((double) (single5 / 45f), 0)) * 0x2d;
                                        //											if ((single5 != 90f) && (single5 != -90f))
                                        //											{
                                        //												break;
                                        //											}
                                        //											single3 = 0f;
                                        //										}
                                        if (element2 is IGraph)
                                        {

                                            foreach(ConnectLine cline in (element2 as IGraph).ConnectLines)
                                            {
                                                if(!this.selectCollection.Contains(cline) && cline.Visible )
                                                {
                                                    if(selectCollection.Contains(cline.StartGraph) && selectCollection.Contains(cline.EndGraph))
                                                    {
                                                        if(!clines.Contains(cline))
                                                        {
                                                            clines.Add(cline);
                                                            GraphicsPath path11 =cline.GetTempPath2(element2 as IGraph,new PointF(single3,single4));
                                                            if(path11.PointCount>0)
                                                                this.reversePath.AddPath(path11,false);
                                                        }
                                                    }
                                                    else
                                                    {
                                                        GraphicsPath path11 =cline.GetTempPath(element2 as IGraph,new PointF(single3,single4));
                                                        if(path11.PointCount>0)
                                                            this.reversePath.AddPath(path11,false);
                                                    }
                                                }
                                            }
                                        }
                                        goto Label_0C84;
                                    }
                                    default:
                                    {
                                        goto Label_MOVE;
                                    }
                                }
                                single5 = (float) Math.Tan((single5 / 180f) * 3.1415926535897931);
                                single4 = single3 * single5;
                            Label_0C84:
                                matrix6.Translate(single3, single4, MatrixOrder.Prepend);
                                goto Label_MOVE;
                            Label_0CC6:
                                if (this.currentMousePoint == MousePoint.ScaleTopRight)
                                {
                                    tf11 = tfArray1[2];
                                    goto Label_0D85;
                                }
                                if (this.currentMousePoint == MousePoint.ScaleBottomLeft)
                                {
                                    tf11 = tfArray1[4];
                                    goto Label_0D85;
                                }
                                if (this.currentMousePoint == MousePoint.ScaleBottomRight)
                                {
                                    tf11 = tfArray1[0];
                                    goto Label_0D85;
                                }
                                if (this.currentMousePoint == MousePoint.ScaleMiddleLeft)
                                {
                                    tf11 = tfArray1[5];
                                    goto Label_0D85;
                                }
                                if (this.currentMousePoint == MousePoint.ScaleMiddleRight)
                                {
                                    tf11 = tfArray1[1];
                                    goto Label_0D85;
                                }
                                if (this.currentMousePoint == MousePoint.ScaleTopMiddle)
                                {
                                    tf11 = tfArray1[7];
                                    goto Label_0D85;
                                }
                                if (this.currentMousePoint == MousePoint.ScaleBottomMiddle)
                                {
                                    tf11 = tfArray1[3];
                                }
                                goto Label_0D85;
                            Label_0D82:
                                tf11 = tf1;
                            Label_0D85:

                                single3 = (tf8.X - tf11.X) / (tf7.X - tf11.X);
                                single4 = (tf8.Y - tf11.Y) / (tf7.Y - tf11.Y);
                                if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift)
                                {
                                    single3 = single4 = Math.Min(single3, single4);
                                }
                                if ((this.currentMousePoint == MousePoint.ScaleMiddleLeft) || (this.currentMousePoint == MousePoint.ScaleMiddleRight))
                                {
                                    single4 = 1f;
                                }
                                else if ((this.currentMousePoint == MousePoint.ScaleTopMiddle) || (this.currentMousePoint == MousePoint.ScaleBottomMiddle))
                                {
                                    single3 = 1f;
                                }
                                matrix6.Translate(tf11.X, tf11.Y, MatrixOrder.Prepend);
                                matrix6.Scale(single3, single4, MatrixOrder.Prepend);
                                matrix6.Translate(-tf11.X, -tf11.Y, MatrixOrder.Prepend);
                                goto Label_MOVE;
                            Label_0E88:
                                if (this.currentMousePoint == MousePoint.SkewXTop)
                                {
                                    tf11 = tfArray1[6];
                                    goto Label_0EDC;
                                }
                                if (this.currentMousePoint == MousePoint.SkewYLeft)
                                {
                                    tf11 = tfArray1[4];
                                    goto Label_0EDC;
                                }
                                if (this.currentMousePoint == MousePoint.SkewYRight)
                                {
                                    tf11 = tfArray1[0];
                                }
                                goto Label_0EDC;
                            Label_0ED9:
                                tf11 = tf1;
                            Label_0EDC:
                                single3 /= (tfArray1[6].Y - tfArray1[4].Y);
                                single4 /= (tfArray1[6].X - tfArray1[2].X);
                                if ((this.currentMousePoint == MousePoint.SkewXTop) || (this.currentMousePoint == MousePoint.SkewXBottom))
                                {
                                    single4 = 0f;
                                    if (this.currentMousePoint == MousePoint.SkewXTop)
                                    {
                                        single3 = -single3;
                                    }
                                }
                                else if ((this.currentMousePoint == MousePoint.SkewYLeft) || (this.currentMousePoint == MousePoint.SkewYRight))
                                {
                                    if (this.currentMousePoint == MousePoint.SkewYLeft)
                                    {
                                        single4 = -single4;
                                    }
                                    single3 = 0f;
                                }
                                single3 = (single3 == 0f) ? 0f : ((single3 / Math.Abs(single3)) * Math.Min(Math.Abs(single3), (float) 3f));
                                single4 = (single4 == 0f) ? 0f : ((single4 / Math.Abs(single4)) * Math.Min(Math.Abs(single4), (float) 3f));
                                matrix6.Translate(tf11.X, tf11.Y, MatrixOrder.Prepend);
                                matrix6.Shear(single3, single4, MatrixOrder.Prepend);
                                matrix6.Translate(-tf11.X, -tf11.Y, MatrixOrder.Prepend);
                                goto Label_MOVE;
                            Label_103D:
                                tf11 = tf1;
                            Label_ROTATE://��ת
                                single6 = 0f;
                                float single7=0f;
                                if(tf7.X==tf11.X)
                                {
                                    single7 = 1.570796f;
                                }
                                else
                                {
                                    single7 = (float) Math.Atan((double) ((tf7.Y - tf11.Y) / (tf7.X - tf11.X)));
                                }
                                float single8 = 0f;
                                if(tf8.X==tf11.X)
                                {
                                    single8 = 1.570796f;
                                }
                                else
                                {
                                    single8 = (float) Math.Atan((double) ((tf8.Y - tf11.Y) / (tf8.X - tf11.X)));
                                }
                                single6 = ((float) (((double) (single8 - single7)) / 3.1415926535897931)) * 180f;
                                if (((tf8.X - tf11.X) * (tf7.X - tf11.X)) < 0f)
                                {
                                    single6 += 180f;
                                }
                                if (((Control.ModifierKeys & Keys.Shift) == Keys.Shift) && (single6 != 0f))
                                {
                                    single6 = (single6 / Math.Abs(single6)) * ((((int) (Math.Abs(single6) + 23f)) / 0x2d) * 0x2d);
                                }
                                matrix6.RotateAt(single6,tf11);

                            Label_MOVE://�ƶ�
                                path7 = new GraphicsPath();
                                if (element2 is Text)
                                {
                                    RectangleF ef3 = ((IGraph) element2).GPath.GetBounds();
                                    path7.AddRectangle(ef3);
                                }
                                else
                                {
                                    path7 = (GraphicsPath) ((IGraph) element2).GPath.Clone();
                                    if ((path7.PointCount > 0xbb8) || (element2 is Group))
                                    {
                                        RectangleF ef4 = path7.GetBounds();
                                        path7.Reset();
                                        path7.AddRectangle(ef4);
                                    }
                                }
                                using (Matrix matrix8 = ((IGraph) element2).GraphTransform.Matrix.Clone())
                                {
                                    if(this.currentMousePoint==MousePoint.Rotate)
                                    {
                                        matrix8.Multiply(matrix6,MatrixOrder.Append);
                                    }
                                    else
                                    {
                                        matrix8.Multiply(matrix6, MatrixOrder.Prepend);
                                    }
                                    path7.Transform(matrix8);
                                }
                                if (path7.PointCount > 0)
                                {
                                    this.reversePath.AddPath(path7, false);
                                }
                                num6++;
                            }
                            if (this.reversePath.PointCount > 0xbb8)
                            {
                                RectangleF ef5 = this.reversePath.GetBounds();
                                this.reversePath.Reset();
                                this.reversePath.AddRectangle(ef5);
                            }
                            this.win32.W32PolyDraw(this.reversePath);
                            this.win32.ReleaseDC();
                        }
                        else if ((this.currentMousePoint == MousePoint.None) && (OperationFunc.IsSelectOperation(operation1) || OperationFunc.IsTransformOperation(operation1)))
                        {//ѡ��

                            this.win32.hdc = this.win32.W32GetDC(this.mouseAreaControl.Handle);
                            this.win32.W32SetROP2(7);
                            this.win32.W32PolyDraw(this.reversePath);

                            this.reversePath.Reset();
                            PointF tf12 = new PointF((float) e.X, (float) e.Y);
                            PointF tf13 = this.mouseAreaControl.PicturePanel.PointToSystem(startpoint);

                            float single9 = Math.Min(tf13.X, tf12.X);
                            float single10 = Math.Min(tf13.Y, tf12.Y);
                            float single11 = Math.Max(tf13.X, tf12.X);
                            float single12 = Math.Max(tf13.Y, tf12.Y);
                            this.reversePath.AddRectangle(new RectangleF(single9, single10, single11 - single9, single12 - single10));
                            this.win32.W32PolyDraw(this.reversePath);

                            this.win32.ReleaseDC();
                        }
                    }
                }// ����������

                return;
            }
            Lable_CanMove:
                this.selectMatrix.Reset();
            this.toBeSelectedGraph = null;
            this.toBeSelectedPath = null;
            Matrix matrix1 = this.mouseAreaControl.PicturePanel.CoordTransform.Clone();
            matrix1.Invert();

            Pen pen2 = new Pen(Color.Blue,3/this.mouseAreaControl.PicturePanel.ScaleUnit);
            pen2.Alignment = PenAlignment.Center;
            if ((!OperationFunc.IsSelectOperation(operation1)) /*&& (operation1 != ToolOperation.ShapeTransform))*/ && !OperationFunc.IsTransformOperation(operation1) && !OperationFunc.IsConnectLineOperation(operation1))
            {
                goto Label_05AD;
            }

            if (this.mouseAreaControl.SVGDocument.SelectCollection.Count > 0)
            {

                if ((operation1 == ToolOperation.Select) ||(operation1 == ToolOperation.Exceptant)|| (operation1 == ToolOperation.ShapeTransform))
                {//��ͼԪ���ƶ�

                    GraphicsPath path1 = new GraphicsPath();
                    path1.AddEllipse((float) (this.mouseAreaControl.CenterPoint.X - 4f), (float) (this.mouseAreaControl.CenterPoint.Y - 4f), (float) 8f, (float) 8f);
                    //					if (path1.IsVisible(new PointF(e.X + this.mouseAreaControl.PicturePanel.VirtualLeft, e.Y + this.mouseAreaControl.PicturePanel.VirtualTop)))
                    //					{
                    //
                    //						this.CurrentMousePoint = MousePoint.CenterPoint;
                    //						return;
                    //					}

                    this.selectMatrix = this.mouseAreaControl.PicturePanel.SelectMatrix.Clone();
                    GraphicsPath path2 = (GraphicsPath) this.mouseAreaControl.PicturePanel.SelectPath.Clone();
                    PointF tf3 = tf2;
                    Matrix matrix2 = this.selectMatrix.Clone();
                    matrix2.Multiply(matrix1, MatrixOrder.Append);
                    this.CurrentMousePoint = this.GetMousePoint(path2, tf3, matrix2, operation1);

                    //

                    //					if(selectCollection.Count>0)
                    //					{
                    //						if(((XmlElement)selectCollection[0]).GetAttribute("layer").ToString()!=SvgDocument.currentLayer)
                    //						{
                    //							this.CurrentMousePoint = MousePoint.None;
                    //							return;
                    //						}
                    //					}

                    if (this.currentMousePoint == MousePoint.None) //��ѡ�е�ͼԪ�Ƴ�
                    {
                        if(graphTemp2!=null) //graphTemp2 ѡ�е�ͼԪ
                        {
                            this.mouseAreaControl.PicturePanel.OnMoveOut(mouseAreaControl.SVGDocument.SelectCollection[0] as SvgElement,e);
                            graphTemp2=null;
                        }
                        goto Label_044B;
                    }

                    this.toBeSelectedPath = (GraphicsPath) this.mouseAreaControl.PicturePanel.SelectPath.Clone();
                    this.selectMatrix = this.mouseAreaControl.PicturePanel.SelectMatrix.Clone();
                    //

                    if(this.currentMousePoint==MousePoint.Translate)  //�ƽ�ѡ�е�ͼԪ
                    {
                        if(graphTemp2==null)
                        {
                            bool flag1=false;
                            foreach(IGraph graph11 in mouseAreaControl.SVGDocument.SelectCollection)
                            {
                                using (Matrix matrix5 = graph11.GraphTransform.Matrix.Clone())
                                {
                                    matrix5.Multiply(matrix1, MatrixOrder.Append);

                                    using(GraphicsPath path5 =graph11.GPath.Clone() as GraphicsPath)
                                    {
                                        path5.Transform(matrix5);

                                        if(graph11 is Line || graph11 is Polyline )//��
                                        {
                                            //											using(Pen pen2 = new Pen(Color.Blue, ((GraphPath)graph11).GraphStroke.StrokePen.Width + 2f))
                                            //											{
                                            //												pen2.Alignment = PenAlignment.Center;
                                            flag1=path5.IsOutlineVisible(tf2,pen2);
                                            //											}
                                        }
                                        else if (graph11 is Use || graph11 is Text)
                                        {
                                            flag1 = path5.GetBounds().Contains(tf2);

                                        }
                                        else
                                        {

                                            flag1=path5.IsVisible(tf2)||path5.IsOutlineVisible(tf2,pen2);//.GetBounds().Contains(tf2);
                                        }
                                    }
                                }
                                if (flag1)
                                {

                                    graphTemp2=graph11;
                                    break;
                                }

                            }
                            //							graphTemp2=mouseAreaControl.SVGDocument.SelectCollection[0] as IGraph;

                            if (graphTemp2!=null)
                            {
                                this.mouseAreaControl.PicturePanel.OnMoveIn(graphTemp2 as SvgElement,e);
                            }
                            return;
                        }
                    }
                    //�¼�
                    if(this.currentMousePoint == MousePoint.Translate) //��ѡ�е�ͼԪ���ƶ�
                    {
                        this.mouseAreaControl.PicturePanel.OnMoveOver(this.mouseAreaControl.SVGDocument.SelectCollection[0],e);
                    }

                    //					return;    test
                }

                if (((operation1 == ToolOperation.FreeTransform) || (operation1 == ToolOperation.Scale)) || ((operation1 == ToolOperation.Rotate) || (operation1 == ToolOperation.Skew)))
                {
                    //this.mouseAreaControl.PicturePanel.OnMoveOver(this.mouseAreaControl.SVGDocument.SelectCollection[0],e);
                    //					if ((Math.Abs((float) (e.X - this.mouseAreaControl.CenterPoint.X)) < 2f) && (Math.Abs((float) (e.Y - this.mouseAreaControl.CenterPoint.Y)) < 2f))
                    //					{
                    //						//���ĵ�
                    //						this.CurrentMousePoint = MousePoint.CenterPoint;
                    //						return;
                    //					}

                    GraphicsPath path3 = (GraphicsPath) this.mouseAreaControl.PicturePanel.SelectPath.Clone();
                    this.selectMatrix = this.mouseAreaControl.PicturePanel.SelectMatrix.Clone();
                    Matrix matrix3 = this.selectMatrix.Clone();
                    matrix3.Multiply(matrix1, MatrixOrder.Append);
                    PointF tf4 = tf2;
                    bool flag1 = true;
                    if ((this.mouseAreaControl.SVGDocument.SelectCollection.Count == 1) && (this.mouseAreaControl.SVGDocument.SelectCollection[0] is IGraph))
                    {
                        SvgElement element1 = (SvgElement) this.mouseAreaControl.SVGDocument.SelectCollection[0];
                        if (!flag1)
                        {
                            GraphicsPath path4 = (GraphicsPath) ((IGraph) element1).GPath.Clone();
                            Matrix matrix4 = ((IGraph) element1).GraphTransform.Matrix.Clone();
                            matrix4.Multiply(matrix1, MatrixOrder.Append);
                            path4.Transform(matrix4);
                            Pen pen1 = new Pen(Color.Blue, 3f);
                            pen1.Alignment = PenAlignment.Center;
                            if (path4.IsVisible(tf2))
                            {
                                this.CurrentMousePoint = MousePoint.Translate;
                            }
                            else
                            {
                                this.CurrentMousePoint = MousePoint.None;
                            }
                        }
                    }
                    if (flag1)
                    {
                        this.CurrentMousePoint = this.GetMousePoint(path3, new PointF((float) e.X, (float) e.Y), this.selectMatrix.Clone(), operation1);
                    }
                    //�¼�
                    if(this.currentMousePoint == MousePoint.Translate) //��ѡ��ͼԪ���ƶ�
                    {
                        this.mouseAreaControl.PicturePanel.OnMoveOver(this.mouseAreaControl.SVGDocument.SelectCollection[0],e);

                    }
                    if (this.currentMousePoint != MousePoint.None)
                    {
                        this.toBeSelectedPath = (GraphicsPath) this.mouseAreaControl.PicturePanel.SelectPath.Clone();
                        this.selectMatrix = this.mouseAreaControl.PicturePanel.SelectMatrix.Clone();
                        return;
                    }

                }
            }
            Label_044B://û��ѡ��ͼԪʱ
            ILayer layer1 = this.mouseAreaControl.SVGDocument.Layers[SvgDocument.currentLayer] as ILayer;
            if (layer1 == null) return;
            collection1 = layer1.GraphList; // this.mouseAreaControl.PicturePanel.ElementList;
            if (collection1 == null)
            {
                return;
            }

            for (int num1 = collection1.Count - 1; num1 >= 0; num1--)
            {
                IGraph graph1 = (IGraph)collection1[num1];
                if (graph1.CanSelect && graph1.DrawVisible && graph1.Visible)
                {
                    bool flag1 = false;

                    using (GraphicsPath path5 = (GraphicsPath)graph1.GPath.Clone())
                    {
                        using (Matrix matrix5 = graph1.GraphTransform.Matrix.Clone())
                        {
                            matrix5.Multiply(matrix1, MatrixOrder.Append);

                            path5.Transform(matrix5);

                            if (graph1 is Line || graph1 is Polyline)//�?
                            {
                                //								using(Pen pen2 = new Pen(Color.Blue, ((GraphPath)graph1).GraphStroke.StrokePen.Width + 2f))
                                //								{
                                //									pen2.Alignment = PenAlignment.Center;
                                flag1 = path5.IsOutlineVisible(tf2, pen2);
                                //								}
                            }
                            else if (graph1 is Use || graph1 is Text)
                            {
                                flag1 = path5.GetBounds().Contains(tf2);

                            }
                            else
                            {

                                flag1 = (path5.IsVisible(tf2) || path5.IsOutlineVisible(tf2, pen2));//.GetBounds().Contains(tf2);
                            }
                        }

                        if (flag1)// && ((XmlElement)graph1).GetAttribute("layer").ToString()==SvgDocument.currentLayer)
                        {

                            //if(this.mouseAreaControl.Cursor != SpecialCursors.DragInfoCursor)

                            //							path5.Transform((this.mouseAreaControl.SVGDocument.RootElement as SVG).GraphTransform.Matrix);
                            //							System.Windows.Forms.ControlPaint.DrawBorder3D(this.mouseAreaControl.CreateGraphics(),Rectangle.Ceiling(path5.GetBounds()),Border3DStyle.Raised);

                            this.toBeSelectedGraph = graph1;
                            this.toBeSelectedPath = (GraphicsPath)graph1.GPath.Clone();
                            this.selectMatrix = graph1.GraphTransform.Matrix.Clone();
                            //							if (!this.tooltips.ContainsKey("select"))
                            //							{
                            //								this.tooltips.Add("select", DrawAreaConfig.GetLabelForName("select"));
                            //							}
                            //							this.mouseAreaControl.PicturePanel.ToolTip((string) this.tooltips["select"], 1);
                            //没有选中图元时,鼠标移入图元区域

                            this.mouseAreaControl.Cursor = SpecialCursors.DragInfoCursor;
                            if (this.mouseAreaControl.CurrentOperation == ToolOperation.WindowZoom)
                            {
                                this.mouseAreaControl.Cursor = SpecialCursors.WindowZoom;
                            }
                            //if (this.currentMousePoint == MousePoint.None && graphTemp == null)
                            {
                                if (this.currentMousePoint == MousePoint.None && graphTemp == null) {
                                    graphTemp = graph1;
                                    this.mouseAreaControl.PicturePanel.OnMoveIn(graph1 as SvgElement, e);
                                    return;
                                } else if (graphTemp!=null && graphTemp != graph1) {
                                    this.mouseAreaControl.PicturePanel.OnMoveOut(graphTemp as SvgElement, e);
                                    graphTemp = graph1;
                                    this.mouseAreaControl.PicturePanel.OnMoveIn(graph1 as SvgElement, e);
                                    return;
                                }

                            }
                            //没有选中图元时,鼠标在图元区域移�?

                            this.mouseAreaControl.PicturePanel.OnMoveOver(graph1 as SvgElement, e);

                            return;
                        }
                    }
                }
            }

            Label_05AD:
                if(graphTemp!=null) //û��ѡ��ͼԪʱ������Ƴ�ͼԪ����
                {
                    //if(this.mouseAreaControl.Cursor == SpecialCursors.DragInfoCursor)
                    this.mouseAreaControl.PicturePanel.OnMoveOut(graphTemp as SvgElement,e);
                    graphTemp=null;
                    //					graphTemp2=null;
                }
            this.CurrentMousePoint = MousePoint.None;
        }