Example #1
0
 public void Load()
 {
     foreach (Line L in list_Line)
     {
         ShapeSystem.ShapeList.Add(L);
         ShapeSystem.AddShapeToDataSet(L);
     }
     foreach (LinearDimension L in list_Dim)
     {
         ShapeSystem.ShapeList.Add(L);
         ShapeSystem.AddShapeToDataSet(L);
     }
     foreach (cadPoint L in list_cadPoint)
     {
         ShapeSystem.ShapeList.Add(L);
         ShapeSystem.AddShapeToDataSet(L);
     }
     foreach (Rect L in list_Rect)
     {
         ShapeSystem.ShapeList.Add(L);
         ShapeSystem.AddShapeToDataSet(L);
     }
     foreach (Ellipse L in list_Ellipse)
     {
         ShapeSystem.ShapeList.Add(L);
         ShapeSystem.AddShapeToDataSet(L);
     }
 }
Example #2
0
 public Ellipse(PointF P1, float R)
 {
     this.P1       = P1;
     this.R        = R;
     this.MetaName = "Ellipse";
     this.MetaDesc = P1.X.ToString() + "," + P1.Y.ToString() + "; R: " + R.ToString();
     ShapeSystem.AddShapeToDataSet(this);
 }
Example #3
0
 public cadPoint(PointF p1)
 {
     this.P1       = p1;
     this.ParentId = -1;
     this.MetaName = "Point";
     object[] MetaDescArray = { this.P1.X, this.P1.Y };
     this.MetaDesc = string.Format("({0},{1})", MetaDescArray);
     ShapeSystem.AddShapeToDataSet(this);
 }
Example #4
0
 //Line with Parent
 public Line(PointF p1, PointF p2, Shape parent)
 {
     this.Points.Add(p1);
     this.Points.Add(p2);
     this.ParentId = parent.IdShape;
     this.MetaName = "Line";
     object[] MetaDescArray = { this.Points[0].X, this.Points[0].Y, this.Points[1].X, this.Points[1].Y };
     this.MetaDesc = string.Format("({0},{1}):({2},{3})", MetaDescArray);
     ShapeSystem.AddShapeToDataSet(this);
     this.slope = (Points[1].Y - Points[0].Y) / (Points[1].X - Points[0].X);
 }
Example #5
0
        public Rect(PointF p1, PointF p2, PointF p3, PointF p4)
        {
            this.AB = new Line(p1, p2, (Shape)this);
            this.BC = new Line(p2, p3, (Shape)this);
            this.CD = new Line(p3, p4, (Shape)this);
            this.DA = new Line(p4, p1, (Shape)this);

            this.ParentId = -1;
            this.MetaName = "Rect";
            object[] MetaDescArray = { AB.IdShape, BC.IdShape, CD.IdShape, DA.IdShape };
            this.MetaDesc = string.Format("L{0}, L{1}, L{2}, L{3}", MetaDescArray);
            ShapeSystem.AddShapeToDataSet(this);
        }
Example #6
0
        public LinearDimension(PointF P1, PointF P2)
        {
            this.P1       = P1;
            this.P2       = P2;
            this.ParentId = -1;
            float x1 = this.P1.X;
            float y1 = this.P1.Y;
            float x2 = this.P2.X;
            float y2 = this.P2.Y;

            this.TxFont    = new System.Drawing.Font("Consolas", 8F, System.Drawing.FontStyle.Regular);
            this.dimLength = (float)Math.Sqrt((Math.Pow(x1 - x2, 2) + Math.Pow(y1 - y2, 2)));
            this.MetaName  = "Dim";
            object[] MetaDescArray = { P1.X, P1.Y, P2.X, P2.Y };
            this.MetaDesc                = string.Format("({0},{1}):({2},{3})", MetaDescArray);
            this.distanceFromLine        = .0625F;
            this.leadingLineLength       = .5F;
            this.dimInsetFromLeadingLine = .125F;
            ShapeSystem.AddShapeToDataSet(this);
        }
Example #7
0
        public LinearDimension(Line L, float dist)
        {
            this.P1       = L.P1;
            this.P2       = L.P2;
            this.ParentId = L.IdShape;
            float x1 = this.P1.X;
            float y1 = this.P1.Y;
            float x2 = this.P2.X;
            float y2 = this.P2.Y;

            this.TxFont    = new System.Drawing.Font("Consolas", 8F, System.Drawing.FontStyle.Regular);
            this.dimLength = (float)Math.Sqrt((Math.Pow(x1 - x2, 2) + Math.Pow(y1 - y2, 2)));
            this.MetaName  = "Dim";
            object[] MetaDescArray = { L.MetaName, L.IdShape };
            this.MetaDesc                = string.Format("{0} {1}", MetaDescArray);
            this.distanceFromLine        = .0625F;
            this.leadingLineLength       = dist;
            this.dimInsetFromLeadingLine = .125F;
            ShapeSystem.AddShapeToDataSet(this);
        }