public void Move(AxMap pMap, PointF fromPt, PointF toPt) { float num; float num2; pMap.ConvertCoord(ref num, ref num2, ref this.m_GocX, ref this.m_GocY, ConversionConstants.miMapToScreen); num += toPt.X - fromPt.X; num2 += toPt.Y - fromPt.Y; pMap.ConvertCoord(ref num, ref num2, ref this.m_GocX, ref this.m_GocY, ConversionConstants.miScreenToMap); }
public void Shift(AxMap pMap, float deltaX, float deltaY) { float num; float num2; pMap.ConvertCoord(ref num, ref num2, ref this.m_GocX, ref this.m_GocY, ConversionConstants.miMapToScreen); num += deltaX; num2 += deltaY; pMap.ConvertCoord(ref num, ref num2, ref this.m_GocX, ref this.m_GocY, ConversionConstants.miScreenToMap); }
public void Scale(AxMap pMap, PointF rootPt, PointF fromPt, PointF toPt) { float num; float num2; pMap.ConvertCoord(ref num, ref num2, ref this.m_GocX, ref this.m_GocY, ConversionConstants.miMapToScreen); num -= rootPt.X; num2 -= rootPt.Y; PointF rootPt2 = default(PointF); rootPt2.X = num; rootPt2.Y = num2; fromPt.X -= rootPt.X; fromPt.Y -= rootPt.Y; toPt.X -= rootPt.X; toPt.Y -= rootPt.Y; try { IEnumerator enumerator = this.m_GObjs.GetEnumerator(); while (enumerator.MoveNext()) { GraphicObject graphicObject = (GraphicObject)enumerator.Current; graphicObject.Zoom(rootPt2, fromPt, toPt); } } finally { IEnumerator enumerator; if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } }
public void DrawNodes(AxMap pMap, Graphics g) { float num = (float)(this.m_Zoom / pMap.Zoom); num = Conversions.ToSingle(Operators.MultiplyObject(num, Interaction.IIf(this.m_MWidth > 0f, pMap.MapScreenWidth / this.m_MWidth, 1))); float dx; float dy; pMap.ConvertCoord(ref dx, ref dy, ref this.m_GocX, ref this.m_GocY, ConversionConstants.miMapToScreen); GraphicsContainer container = g.BeginContainer(); g.TranslateTransform(dx, dy); g.ScaleTransform(num, num); try { IEnumerator enumerator = this.m_GObjs.GetEnumerator(); while (enumerator.MoveNext()) { GraphicObject graphicObject = (GraphicObject)enumerator.Current; PointF[] points = graphicObject.GetPoints(); modBdTC.DrawNodes(g, points, 3f); } } finally { IEnumerator enumerator; if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } g.EndContainer(container); }
public void Scale2(AxMap pMap, PointF rootPt, float deltaX, float deltaY) { float num; float num2; pMap.ConvertCoord(ref num, ref num2, ref this.m_GocX, ref this.m_GocY, ConversionConstants.miMapToScreen); num -= rootPt.X; num2 -= rootPt.Y; PointF rootPt2 = default(PointF); rootPt2.X = num; rootPt2.Y = num2; RectangleF bounds = this.GetBounds(pMap); float deltaX2 = (bounds.Width + deltaX) / bounds.Width; float deltaY2 = (bounds.Height + deltaY) / bounds.Height; try { IEnumerator enumerator = this.m_GObjs.GetEnumerator(); while (enumerator.MoveNext()) { GraphicObject graphicObject = (GraphicObject)enumerator.Current; graphicObject.Zoom2(rootPt2, deltaX2, deltaY2); } } finally { IEnumerator enumerator; if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } }
public CSymbol(AxMap pMap, CGraphicObjs pGObjs) : this() { float num = 0f; float num2 = 0f; pMap.ConvertCoord(ref num, ref num2, ref this.m_GocX, ref this.m_GocY, ConversionConstants.miScreenToMap); this.m_Zoom = pMap.Zoom; this.m_MWidth = pMap.MapScreenWidth; this.m_GObjs = new CGraphicObjs(); try { IEnumerator enumerator = pGObjs.GetEnumerator(); while (enumerator.MoveNext()) { GraphicObject graphicObject = (GraphicObject)enumerator.Current; this.m_GObjs.Add(graphicObject.Clone()); } } finally { IEnumerator enumerator; if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } this.m_Description = ""; this.m_Blinking = false; }
public CSymbol(AxMap pMap, PointF pt0, CGraphicObjs pGObjs, double pZoom, float pMWidth) : this() { float x = pt0.X; float y = pt0.Y; pMap.ConvertCoord(ref x, ref y, ref this.m_GocX, ref this.m_GocY, ConversionConstants.miScreenToMap); pt0.Y = y; pt0.X = x; this.m_Zoom = pZoom; this.m_MWidth = pMWidth; this.m_GObjs = new CGraphicObjs(); try { IEnumerator enumerator = pGObjs.GetEnumerator(); while (enumerator.MoveNext()) { GraphicObject graphicObject = (GraphicObject)enumerator.Current; this.m_GObjs.Add(graphicObject.Clone()); } } finally { IEnumerator enumerator; if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } this.m_Description = ""; this.m_Blinking = false; }
public bool RootHitTest(AxMap pMap, PointF pt) { float num; float num2; pMap.ConvertCoord(ref num, ref num2, ref this.m_GocX, ref this.m_GocY, ConversionConstants.miMapToScreen); RectangleF rectangleF = new RectangleF(num - 3f, num2 - 3f, 7f, 7f); return(rectangleF.Contains(pt)); }
public void DrawRoot(AxMap pMap, Graphics g) { float num; float num2; pMap.ConvertCoord(ref num, ref num2, ref this.m_GocX, ref this.m_GocY, ConversionConstants.miMapToScreen); Pen pen = new Pen(Color.Black, 2f); System.Drawing.Rectangle rect = checked (new System.Drawing.Rectangle((int)Math.Round((double)(unchecked (num - 3f))), (int)Math.Round((double)(unchecked (num2 - 3f))), 7, 7)); g.DrawRectangle(pen, rect); pen.Dispose(); }
public void Draw(AxMap pMap, Graphics g) { float num = (float)(this.m_Zoom / pMap.Zoom); num = Conversions.ToSingle(Operators.MultiplyObject(num, Interaction.IIf(this.m_MWidth > 0f, pMap.MapScreenWidth / this.m_MWidth, 1))); float dx; float dy; pMap.ConvertCoord(ref dx, ref dy, ref this.m_GocX, ref this.m_GocY, ConversionConstants.miMapToScreen); GraphicsContainer container = g.BeginContainer(); g.TranslateTransform(dx, dy); this.m_GObjs.DrawObjects(g, num); g.EndContainer(container); }
public void ChangeRoot(AxMap pMap, double newGocX, double newGocY) { float num = (float)(pMap.Zoom / this.m_Zoom); num = Conversions.ToSingle(Operators.MultiplyObject(num, Interaction.IIf(this.m_MWidth > 0f, this.m_MWidth / pMap.MapScreenWidth, 1))); float num2; float num3; pMap.ConvertCoord(ref num2, ref num3, ref this.m_GocX, ref this.m_GocY, ConversionConstants.miMapToScreen); float num4; float num5; pMap.ConvertCoord(ref num4, ref num5, ref newGocX, ref newGocY, ConversionConstants.miMapToScreen); this.m_GocX = newGocX; this.m_GocY = newGocY; PointF toPt = new PointF(num2 * num, num3 * num); PointF fromPt = new PointF(num4 * num, num5 * num); try { IEnumerator enumerator = this.m_GObjs.GetEnumerator(); while (enumerator.MoveNext()) { GraphicObject graphicObject = (GraphicObject)enumerator.Current; graphicObject.Move(fromPt, toPt); } } finally { IEnumerator enumerator; if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } }
public CFOUNDNODE FindNodeAtPoint(AxMap pMap, PointF pt) { CFOUNDNODE cFOUNDNODE = new CFOUNDNODE(); float num = (float)(this.m_Zoom / pMap.Zoom); num = Conversions.ToSingle(Operators.MultiplyObject(num, Interaction.IIf(this.m_MWidth > 0f, pMap.MapScreenWidth / this.m_MWidth, 1))); float num2; float num3; pMap.ConvertCoord(ref num2, ref num3, ref this.m_GocX, ref this.m_GocY, ConversionConstants.miMapToScreen); Matrix matrix = new Matrix(); matrix.Translate(-num2, -num3, MatrixOrder.Append); matrix.Scale(1f / num, 1f / num, MatrixOrder.Append); PointF[] array = new PointF[] { pt }; matrix.TransformPoints(array); PointF pt2 = new PointF(array[0].X, array[0].Y); checked { CFOUNDNODE result; for (int i = this.m_GObjs.Count - 1; i >= 0; i += -1) { GraphicObject graphicObject = this.m_GObjs[i]; int num4 = graphicObject.FindNodeAtPoint(pt2, 4f); if (num4 > -1) { int nodeIndex = num4; cFOUNDNODE.FoundObject = graphicObject; cFOUNDNODE.NodeIndex = nodeIndex; result = cFOUNDNODE; return(result); } } result = null; return(result); } }
public bool HitTest(AxMap pMap, PointF pt) { float num = (float)(this.m_Zoom / pMap.Zoom); num = Conversions.ToSingle(Operators.MultiplyObject(num, Interaction.IIf(this.m_MWidth > 0f, pMap.MapScreenWidth / this.m_MWidth, 1))); float num2; float num3; pMap.ConvertCoord(ref num2, ref num3, ref this.m_GocX, ref this.m_GocY, ConversionConstants.miMapToScreen); Matrix matrix = new Matrix(); matrix.Translate(-num2, -num3, MatrixOrder.Append); matrix.Scale(1f / num, 1f / num, MatrixOrder.Append); PointF[] array = new PointF[] { pt }; matrix.TransformPoints(array); PointF pt2 = new PointF(array[0].X, array[0].Y); checked { bool result; if (this.m_GObjs.Count > 0) { for (int i = this.m_GObjs.Count - 1; i >= 0; i += -1) { GraphicObject graphicObject = this.m_GObjs[i]; if (graphicObject.HitTest(pt2)) { result = true; return(result); } } } result = false; return(result); } }
public GraphicObject FindObjectAtPoint(AxMap pMap, PointF pt) { float num = (float)(this.m_Zoom / pMap.Zoom); num = Conversions.ToSingle(Operators.MultiplyObject(num, Interaction.IIf(this.m_MWidth > 0f, pMap.MapScreenWidth / this.m_MWidth, 1))); float num2; float num3; pMap.ConvertCoord(ref num2, ref num3, ref this.m_GocX, ref this.m_GocY, ConversionConstants.miMapToScreen); Matrix matrix = new Matrix(); matrix.Translate(-num2, -num3, MatrixOrder.Append); matrix.Scale(1f / num, 1f / num, MatrixOrder.Append); PointF[] array = new PointF[] { pt }; matrix.TransformPoints(array); PointF pt2 = new PointF(array[0].X, array[0].Y); return(this.m_GObjs.FindObjectAtPoint(pt2)); }
public void MoveNodeTo(AxMap pMap, CFOUNDNODE ENode, PointF pt) { float num = (float)(this.m_Zoom / pMap.Zoom); num = Conversions.ToSingle(Operators.MultiplyObject(num, Interaction.IIf(this.m_MWidth > 0f, pMap.MapScreenWidth / this.m_MWidth, 1))); float num2; float num3; pMap.ConvertCoord(ref num2, ref num3, ref this.m_GocX, ref this.m_GocY, ConversionConstants.miMapToScreen); Matrix matrix = new Matrix(); GraphicObject foundObject = ENode.FoundObject; matrix.Translate(-num2, -num3, MatrixOrder.Append); matrix.Scale(1f / num, 1f / num, MatrixOrder.Append); PointF[] array = new PointF[] { pt }; matrix.TransformPoints(array); PointF pt2 = new PointF(array[0].X, array[0].Y); foundObject.MoveNodeTo(ENode.NodeIndex, pt2); }
public void DrawSelectedSymbol(AxMap pMap, Graphics g, CSymbol selectedSymbol, float Scale) { GraphicObject selectedObject = selectedSymbol.GObjs[0]; System.Drawing.Point ltPt = default(System.Drawing.Point); float num = (float)ltPt.X; float num2 = (float)ltPt.Y; GraphicObject graphicObject = selectedObject; double num3 = (double)graphicObject.X; GraphicObject graphicObject2 = selectedObject; double num4 = (double)graphicObject2.Y; pMap.ConvertCoord(ref num, ref num2, ref num3, ref num4, ConversionConstants.miMapToScreen); graphicObject2.Y = (float)num4; graphicObject.X = (float)num3; checked { ltPt.Y = (int)Math.Round((double)num2); ltPt.X = (int)Math.Round((double)num); GraphicsContainer gCon = g.BeginContainer(); g.ScaleTransform(Scale, Scale, MatrixOrder.Append); GraphicsContainer gCon2 = g.BeginContainer(); g.PageUnit = GraphicsUnit.Pixel; bool flag = selectedObject != null; if (flag) { Pen selectionPen = new Pen(Color.FromKnownColor(KnownColor.HotTrack)); selectionPen.DashStyle = DashStyle.Dot; selectionPen.Width = 1f; flag = (selectedObject.Rotation != 0f); if (flag) { Matrix myMatrix = g.Transform; Matrix arg_123_0 = myMatrix; float arg_123_1 = selectedObject.Rotation; PointF point = new PointF((float)ltPt.X, (float)ltPt.Y); arg_123_0.RotateAt(arg_123_1, point, MatrixOrder.Append); g.Transform = myMatrix; } PointF[] mPtfs = new PointF[3]; mPtfs[0].X = selectedObject.X; mPtfs[0].Y = selectedObject.Y; int mPtsCount; unchecked { mPtfs[1].X = selectedObject.X + selectedObject.Width; mPtfs[1].Y = selectedObject.Y + selectedObject.Height; mPtsCount = mPtfs.GetUpperBound(0); } System.Drawing.Point[] mPts = new System.Drawing.Point[mPtsCount + 1]; int arg_1B3_0 = 0; int num5 = mPtsCount; int i = arg_1B3_0; while (true) { int arg_281_0 = i; int num6 = num5; if (arg_281_0 > num6) { break; } System.Drawing.Point[] arg_1C3_0 = mPts; int num7 = i; num2 = (float)arg_1C3_0[num7].X; System.Drawing.Point[] arg_1DA_0 = mPts; int num8 = i; num = (float)arg_1DA_0[num8].Y; PointF[] arg_1F1_0 = mPtfs; int num9 = i; num4 = (double)arg_1F1_0[num9].X; PointF[] arg_208_0 = mPtfs; int num10 = i; num3 = (double)arg_208_0[num10].Y; pMap.ConvertCoord(ref num2, ref num, ref num4, ref num3, ConversionConstants.miMapToScreen); mPtfs[num10].Y = (float)num3; mPtfs[num9].X = (float)num4; mPts[num8].Y = (int)Math.Round((double)num); mPts[num7].X = (int)Math.Round((double)num2); i++; } float mW = (float)Math.Abs(mPts[1].X - mPts[0].X); float mH = (float)Math.Abs(mPts[1].Y - mPts[0].Y); float mPtX = (float)Math.Min(mPts[0].X, mPts[1].X); float mPtY = (float)Math.Min(mPts[0].Y, mPts[1].Y); System.Drawing.Rectangle rect = new System.Drawing.Rectangle((int)Math.Round((double)mPtX), (int)Math.Round((double)mPtY), (int)Math.Round((double)mW), (int)Math.Round((double)mH)); g.DrawRectangle(selectionPen, rect); } g.EndContainer(gCon2); g.EndContainer(gCon); } }
public RectangleF GetBounds(AxMap pMap) { float num = (float)(this.m_Zoom / pMap.Zoom); num = Conversions.ToSingle(Operators.MultiplyObject(num, Interaction.IIf(this.m_MWidth > 0f, pMap.MapScreenWidth / this.m_MWidth, 1))); float offsetX; float offsetY; pMap.ConvertCoord(ref offsetX, ref offsetY, ref this.m_GocX, ref this.m_GocY, ConversionConstants.miMapToScreen); Matrix matrix = new Matrix(); matrix.Translate(offsetX, offsetY); matrix.Scale(num, num); float left; float top; float right; float bottom; try { IEnumerator enumerator = this.m_GObjs.GetEnumerator(); while (enumerator.MoveNext()) { GraphicObject graphicObject = (GraphicObject)enumerator.Current; RectangleF bounds = graphicObject.GetBounds(); if (bounds.Left < left) { left = bounds.Left; } if (bounds.Top < top) { top = bounds.Top; } if (bounds.Right > right) { right = bounds.Right; } if (bounds.Bottom > bottom) { bottom = bounds.Bottom; } } } finally { IEnumerator enumerator; if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } PointF[] array = new PointF[4]; array[0] = new PointF(left, top); array[1] = new PointF(right, top); array[2] = new PointF(right, bottom); array[3] = new PointF(left, bottom); matrix.TransformPoints(array); matrix.Dispose(); PointF[] array2 = new PointF[2]; array2[0].X = Math.Min(Math.Min(Math.Min(array[0].X, array[1].X), array[2].X), array[3].X); array2[0].Y = Math.Min(Math.Min(Math.Min(array[0].Y, array[1].Y), array[2].Y), array[3].Y); array2[1].X = Math.Max(Math.Max(Math.Max(array[0].X, array[1].X), array[2].X), array[3].X); array2[1].Y = Math.Max(Math.Max(Math.Max(array[0].Y, array[1].Y), array[2].Y), array[3].Y); System.Drawing.Rectangle r = checked (new System.Drawing.Rectangle((int)Math.Round((double)array2[0].X), (int)Math.Round((double)array2[0].Y), (int)Math.Round((double)(unchecked (array2[1].X - array2[0].X))), (int)Math.Round((double)(unchecked (array2[1].Y - array2[0].Y))))); return(r); }
public void VeBound(AxMap pMap, Graphics g, Color Color) { float num = (float)(this.m_Zoom / pMap.Zoom); num = Conversions.ToSingle(Operators.MultiplyObject(num, Interaction.IIf(this.m_MWidth > 0f, pMap.MapScreenWidth / this.m_MWidth, 1))); float dx; float dy; pMap.ConvertCoord(ref dx, ref dy, ref this.m_GocX, ref this.m_GocY, ConversionConstants.miMapToScreen); GraphicsContainer container = g.BeginContainer(); g.TranslateTransform(dx, dy); g.ScaleTransform(num, num); float left; float top; float right; float bottom; try { IEnumerator enumerator = this.m_GObjs.GetEnumerator(); while (enumerator.MoveNext()) { GraphicObject graphicObject = (GraphicObject)enumerator.Current; RectangleF bounds = graphicObject.GetBounds(); if (bounds.Left < left) { left = bounds.Left; } if (bounds.Top < top) { top = bounds.Top; } if (bounds.Right > right) { right = bounds.Right; } if (bounds.Bottom > bottom) { bottom = bounds.Bottom; } } } finally { IEnumerator enumerator; if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } Pen pen = new Pen(Color.Black); pen.DashStyle = DashStyle.Dot; pen.Width = 2f; pen.Color = Color.White; Pen arg_175_1 = pen; checked { System.Drawing.Rectangle rect = new System.Drawing.Rectangle((int)Math.Round((double)left), (int)Math.Round((double)top), (int)Math.Round((double)(unchecked (right - left))), (int)Math.Round((double)(unchecked (bottom - top)))); g.DrawRectangle(arg_175_1, rect); pen.Width = 1f; pen.Color = Color; Pen arg_1C5_1 = pen; rect = new System.Drawing.Rectangle((int)Math.Round((double)left), (int)Math.Round((double)top), (int)Math.Round((double)(unchecked (right - left))), (int)Math.Round((double)(unchecked (bottom - top)))); g.DrawRectangle(arg_1C5_1, rect); pen.Dispose(); g.EndContainer(container); } }