Beispiel #1
0
        public Axial(vdDocument vdoc, string loads)
        {
            //X = Y = Z = 0.0;
            vDoc = vdoc;

            Wheel1 = new vdCircle();
            Wheel1.SetUnRegisterDocument(vdoc);
            Wheel1.setDocumentDefaults();
            Wheel1.Radius = WheelRadius;
            vdoc.ActiveLayOut.Entities.AddItem(Wheel1);

            Wheel2 = new vdCircle();
            Wheel2.SetUnRegisterDocument(vdoc);
            Wheel2.setDocumentDefaults();
            Wheel2.Radius = WheelRadius;
            vdoc.ActiveLayOut.Entities.AddItem(Wheel2);

            Axis = new vdLine();
            Axis.SetUnRegisterDocument(vdoc);
            Axis.setDocumentDefaults();
            Axis.StartPoint = Wheel1.Center;
            Axis.EndPoint   = Wheel2.Center;
            vdoc.ActiveLayOut.Entities.AddItem(Axis);


            WheelRadius = 0.3d;
            Load        = (new MyList(loads, ' ')).StringList[0];
        }
Beispiel #2
0
        public override void FillShapeEntities(ref vdEntities entities)
        {
            vdCircle circle = new vdCircle();

            entities.AddItem(circle);
            circle.MatchProperties(this, Document);
            circle.Radius          = mRadius;
            circle.HatchProperties = mhatchprops;

            if (mShowLines)
            {
                gPoint cen = new gPoint();
                vdLine line1;
                double angle = 0.0;
                for (int i = 0; i < 4; i++)
                {
                    line1 = new vdLine();
                    line1.MatchProperties(this, Document);
                    if (mhatchprops.FillMode == VdConstFill.VdFillModeNone)
                    {
                        line1.LineType = Document.LineTypes.Invisible;
                    }
                    line1.StartPoint = new gPoint(gPoint.Polar(cen, angle + mAngle, 3.0d * mRadius / 2.0d));
                    line1.EndPoint   = new gPoint(gPoint.Polar(cen, angle + mAngle, 2.0d * mRadius));
                    angle           += VectorDraw.Geometry.Globals.HALF_PI;
                    entities.AddItem(line1);
                }
            }
        }
Beispiel #3
0
        private vdPolyface CreatePolyFaceFromCurve(vdPolyline curvePath, double diameter)
        {
            var pf = new vdPolyface();

            pf.SetUnRegisterDocument(vDraw.ActiveDocument);
            pf.setDocumentDefaults();

            var circle = new vdCircle {
                Radius = diameter / 2.0
            };

            vdCurve path = curvePath;

            if (curvePath.VertexList.Count == 2)
            {
                var line = new vdLine();
                line.SetUnRegisterDocument(vDraw.ActiveDocument);
                line.setDocumentDefaults();
                line.StartPoint = curvePath.getStartPoint();
                line.EndPoint   = curvePath.getEndPoint();
                path            = line;
            }

            pf.Generate3dPathSection(path, circle, new gPoint(0, 0, 0), 6, 1);
            pf.SmoothAngle         = 45;
            pf.PenColor.ColorIndex = 2;
            vDraw.ActiveDocument.ActiveLayOut.Entities.Add(pf);

            return(pf);
        }
Beispiel #4
0
        public PlanWheel(vdDocument vdoc)
        {
            //X = Y = Z = 0.0;
            WheelRadius = 0.3d;
            vDoc        = vdoc;

            Wheel1 = new vdCircle();
            Wheel1.SetUnRegisterDocument(vdoc);
            Wheel1.setDocumentDefaults();
            Wheel1.Radius          = WheelRadius;
            Wheel1.ExtrusionVector = new Vector(0, 1, 0);
            vdoc.ActiveLayOut.Entities.AddItem(Wheel1);

            Wheel2 = new vdCircle();
            Wheel2.SetUnRegisterDocument(vdoc);
            Wheel2.setDocumentDefaults();
            Wheel2.Radius          = WheelRadius;
            Wheel2.ExtrusionVector = new Vector(0, 1, 0);
            vdoc.ActiveLayOut.Entities.AddItem(Wheel2);

            Axis = new vdLine();
            Axis.SetUnRegisterDocument(vdoc);
            Axis.setDocumentDefaults();
            Axis.StartPoint = Wheel1.Center;
            Axis.EndPoint   = Wheel2.Center;
            vdoc.ActiveLayOut.Entities.AddItem(Axis);
        }
Beispiel #5
0
        public void RemoveCircle(vdDocument Maindoc)
        {
            try
            {
                for (int i = 0; i < Maindoc.ActiveLayOut.Entities.Count; i++)
                {
                    vdCircle cir = Maindoc.ActiveLayOut.Entities[i] as vdCircle;
                    if (cir != null)
                    {
                        cir.Deleted = true;
                    }
                }

                Maindoc.ClearEraseItems();


                //if (Maindoc.ActiveLayOut.Entities.FindItem(cirMember))
                //{
                //    Maindoc.ActiveLayOut.Entities.RemoveItem(cirMember);
                //}
                //for (int i = 0; i < Maindoc.ActiveLayOut.Entities.Count; i++)
                //{
                //    if (Maindoc.ActiveLayOut.Entities[i] is vdCircle)
                //    {
                //        if (Maindoc.ActiveLayOut.Entities[i].Layer.Name == "0")
                //        {
                //            Maindoc.ActiveLayOut.Entities.RemoveAt(i); i = -1;
                //        }
                //    }
                //}
                Maindoc.Redraw(true);
            }
            catch (Exception ex) { }
        }
Beispiel #6
0
        public Axial(vdDocument vdoc)
        {
            //X = Y = Z = 0.0;
            vDoc = vdoc;

            Wheel1 = new vdCircle();
            Wheel1.SetUnRegisterDocument(vdoc);
            Wheel1.setDocumentDefaults();
            Wheel1.Radius = WheelRadius;
            vdoc.ActiveLayOut.Entities.AddItem(Wheel1);

            Wheel2 = new vdCircle();
            Wheel2.SetUnRegisterDocument(vdoc);
            Wheel2.setDocumentDefaults();
            Wheel2.Radius = WheelRadius;
            vdoc.ActiveLayOut.Entities.AddItem(Wheel2);

            Axis = new vdLine();
            Axis.SetUnRegisterDocument(vdoc);
            Axis.setDocumentDefaults();
            Axis.StartPoint = Wheel1.Center;
            Axis.EndPoint   = Wheel2.Center;
            vdoc.ActiveLayOut.Entities.AddItem(Axis);

            WheelRadius = (Width == 0.0) ? 0.2d : Width / 10.0;
        }
Beispiel #7
0
        public frmMemberLoadCase(vdDocument thisDoc, vdDocument memberDoc, vdDocument memberLoadDoc,
                                 vdDocument memberJointLoad, ASTRADoc thisAstDoc,
                                 Form thisForm, Form memberForm, Form memberLoadForm, Form memberJointLoadForm)
        {
            InitializeComponent();
            Maindoc            = thisDoc;
            MemberDoc          = memberDoc;
            MemberLoadDoc      = memberLoadDoc;
            MemberJointLoadDoc = memberJointLoad;


            astDoc = thisAstDoc;
            SetMember();

            memberLine = new vdLine();
            cirMember  = new vdCircle();
            cirMember.SetUnRegisterDocument(Maindoc);
            cirMember.setDocumentDefaults();

            memberLine.SetUnRegisterDocument(Maindoc);
            memberLine.setDocumentDefaults();
            Maindoc.ActiveLayOut.Entities.AddItem(memberLine);
            Maindoc.ActiveLayOut.Entities.AddItem(cirMember);

            formText = thisForm.Text;

            frmMain            = thisForm;
            frmMember          = memberForm;
            frmMemberLoad      = memberLoadForm;
            frmMemberJointLoad = memberJointLoadForm;
        }
Beispiel #8
0
        public void ShowElement(int index, vdDocument Maindoc, double cirRadius)
        {
            Element minc = new Element();

            try
            {
                minc = list[index];
            }
            catch (Exception exx) { return; }
            int mIndx = index;

            if (mIndx != -1)
            {
                try
                {
                    for (int i = 0; i < Maindoc.ActiveLayOut.Entities.Count; i++)
                    {
                        if (Maindoc.ActiveLayOut.Entities[i] is vdCircle)
                        {
                            Maindoc.ActiveLayOut.Entities.RemoveAt(i); i = -1;
                        }
                    }
                }
                catch (Exception ex) { }


                List <gPoint> list = new List <gPoint>();

                list.Add(minc.Node1.Point);
                list.Add(minc.Node2.Point);
                list.Add(minc.Node3.Point);
                list.Add(minc.Node4.Point);
                list.Add(minc.Node1.Point);

                vdCircle cirMember;
                for (int i = 1; i < list.Count; i++)
                {
                    cirMember = new vdCircle();
                    cirMember.SetUnRegisterDocument(Maindoc);
                    cirMember.setDocumentDefaults();
                    cirMember.PenColor  = new vdColor(Color.LightCoral);
                    cirMember.PenColor  = new vdColor(Color.IndianRed);
                    cirMember.Center    = list[i - 1];
                    cirMember.Radius    = cirRadius;
                    cirMember.Thickness = gPoint.Distance3D(list[i - 1], list[i]);

                    cirMember.ExtrusionVector = Vector.CreateExtrusion(list[i - 1], list[i]);
                    Maindoc.ActiveLayOut.Entities.AddItem(cirMember);
                }

                Maindoc.Redraw(true);
            }
        }
Beispiel #9
0
        public override bool DeSerialize(DeSerializer deserializer, string fieldname, object value)
        {
            if (base.DeSerialize(deserializer, fieldname, value))
            {
                return(true);
            }
            else if (fieldname == "NumSides")
            {
                mNumSides = (int)value;
            }
            else if (fieldname == "Radius")
            {
                mRadius = (double)value;
            }
            else if (fieldname == "TextString")
            {
                mText = (string)value;
            }
            else if (fieldname == "TextStyle")
            {
                mTextStyle = (vdTextstyle)value;
            }
            else if (fieldname == "TextHeight")
            {
                mTextHeight = (double)value;
            }
            else if (fieldname == "PipeHeight")
            {
                dPipeHeight = (double)value;
            }
            else if (fieldname == "StartCircle")
            {
                cirStart = value as vdCircle;
            }
            else if (fieldname == "EndCircle")
            {
                cirEnd = value as vdCircle;
            }
            else if (fieldname == "StartPoint")
            {
                gpStartPoint = value as gPoint;
            }
            else if (fieldname == "EndPoint")
            {
                gpEndPoint = value as gPoint;
            }

            else
            {
                return(false);
            }
            return(true);
        }
Beispiel #10
0
 private void Delete_Circles(vdDocument doc)
 {
     for (int i = 0; i < doc.ActiveLayOut.Entities.Count; i++)
     {
         vdCircle cir = doc.ActiveLayOut.Entities[i] as vdCircle;
         if (cir != null)
         {
             //rec.Deleted = true;
             //doc.ActiveLayOut.Entities[i].Deleted = true;
             doc.ActiveLayOut.Entities.RemoveAt(i);
             i = -1;
         }
     }
 }
Beispiel #11
0
        public frmMemberLoadCase(vdDocument thisDoc, ASTRADoc thisAstDoc)
        {
            InitializeComponent();
            Maindoc = thisDoc;
            astDoc  = thisAstDoc;
            SetMember();

            memberLine = new vdLine();
            cirMember  = new vdCircle();
            cirMember.SetUnRegisterDocument(Maindoc);
            cirMember.setDocumentDefaults();

            memberLine.SetUnRegisterDocument(Maindoc);
            memberLine.setDocumentDefaults();
            Maindoc.ActiveLayOut.Entities.AddItem(memberLine);
            Maindoc.ActiveLayOut.Entities.AddItem(cirMember);
        }
Beispiel #12
0
        public void DrawJointsText(vdDocument doc, double txtSize)
        {
            vdLayer nodalLay = null;

            nodalLay = doc.Layers.FindName("Nodes");
            if (nodalLay == null)
            {
                nodalLay      = new vdLayer();
                nodalLay.Name = "Nodes";
                nodalLay.SetUnRegisterDocument(doc);
                nodalLay.setDocumentDefaults();
                doc.Layers.AddItem(nodalLay);
            }
            nodalLay.PenColor = new vdColor(Color.Magenta);
            //nodalLay.PenColor = new vdColor(Color.Green);
            nodalLay.Update();


            vdMText vTxt = new vdMText();

            vTxt.SetUnRegisterDocument(doc);
            vTxt.setDocumentDefaults();
            vTxt.InsertionPoint = Point;
            vTxt.Height         = txtSize;
            vTxt.HorJustify     = VdConstHorJust.VdTextHorCenter;
            vTxt.VerJustify     = VdConstVerJust.VdTextVerCen;
            vTxt.TextString     = NodeNo.ToString();
            vTxt.Layer          = nodalLay;
            doc.ActiveLayOut.Entities.AddItem(vTxt);


            vdCircle vcir = new vdCircle();

            vcir.SetUnRegisterDocument(doc);
            vcir.setDocumentDefaults();
            vcir.Center = Point;
            vcir.Radius = txtSize;
            //vcir.TextString = list[i].NodeNo.ToString();
            vcir.Layer = nodalLay;
            doc.ActiveLayOut.Entities.AddItem(vcir);


            doc.Update();
            doc.Redraw(true);
        }
Beispiel #13
0
        private void AddPipeToEntities(vdEntities entities, double diameter, gPoint ptStart, gPoint ptEnd, string layerName)
        {
            var pf = new vdPolyface();

            pf.SetUnRegisterDocument(vDraw.ActiveDocument);
            pf.setDocumentDefaults();

            var line   = new vdLine(ptStart, ptEnd);
            var circle = new vdCircle
            {
                Radius = diameter / 2.0
            };

            pf.Generate3dPathSection(line, circle, new gPoint(0, 0, 0), 6, 1);
            pf.Layer       = vDraw.ActiveDocument.Layers.FindName(layerName);
            pf.SmoothAngle = 45;
            entities.Add(pf);
        }
Beispiel #14
0
        public override void InitializeProperties()
        {
            gpStartPoint = new gPoint();
            gpEndPoint   = new gPoint();
            dPipeHeight  = 0.0;
            cirStart     = new vdCircle();
            cirEnd       = new vdCircle();


            mNumSides   = 4;
            mText       = "";
            mTextHeight = 1.0d;
            mTextStyle  = null;
            if (Document != null)
            {
                mTextStyle = Document.TextStyles.Standard;
            }
            mRadius = 1.0d;
            base.InitializeProperties();
        }
Beispiel #15
0
        public override void MatchProperties(VectorDraw.Professional.vdObjects.vdPrimary _from, VectorDraw.Professional.vdObjects.vdDocument thisdocument)
        {
            base.MatchProperties(_from, thisdocument);
            Pipe3D from = _from as Pipe3D;

            if (from == null)
            {
                return;
            }
            gpStartPoint = from.gpStartPoint;
            gpEndPoint   = from.gpEndPoint;
            dPipeHeight  = from.dPipeHeight;
            cirStart     = from.cirStart;
            cirEnd       = from.cirEnd;


            TextString = from.TextString;
            NumSides   = from.NumSides;
            Radius     = from.Radius;
            TextStyle  = from.TextStyle;
            TextHeight = from.TextHeight;
        }
Beispiel #16
0
        public override void FillShapeEntities(ref vdEntities entities)
        {
            vdCircle circle = new vdCircle();

            entities.AddItem(circle);
            circle.MatchProperties(this, Document);
            circle.Radius = mRadius;

            if (mShowLines)
            {
                gPoint cen = new gPoint();
                vdLine line1;

                vdPolyline pLine = new vdPolyline();

                line1 = new vdLine();
                line1.MatchProperties(this, Document);
                if (mhatchprops.FillMode == VdConstFill.VdFillModeNone)
                {
                    line1.LineType = Document.LineTypes.Invisible;
                }
                line1.StartPoint = circle.Center;

                double ss = 0.5d;
                line1.EndPoint = new gPoint(line1.StartPoint.x - ss, line1.StartPoint.y - ss);

                pLine.MatchProperties(this, Document);
                pLine.VertexList.Add(line1.StartPoint);
                //pLine.VertexList.Add(new gPoint(line1.StartPoint.x,line1.StartPoint.y - circle.Radius));
                pLine.VertexList.Add(line1.EndPoint);
                pLine.VertexList.Add(new gPoint(line1.StartPoint.x + ss, line1.StartPoint.y - ss));
                pLine.VertexList.Add(pLine.VertexList[0]);


                //entities.AddItem(line1);
                entities.AddItem(pLine);
            }
        }
Beispiel #17
0
        public void ShowMember(int index, vdDocument Maindoc, double cirRadius)
        {
            MemberIncidence minc = new MemberIncidence();
            try
            {
                minc = list[index];
            }
            catch (Exception exx) { return; }
            int mIndx = index;

            if (mIndx != -1)
            {
                RemoveCircle(Maindoc);

                cirMember = new vdCircle();
                cirMember.SetUnRegisterDocument(Maindoc);
                cirMember.setDocumentDefaults();
                cirMember.PenColor = new vdColor(Color.LightCoral);
                cirMember.PenColor = new vdColor(Color.IndianRed);
                cirMember.Center = minc.StartNode.Point;
                cirMember.Radius = cirRadius;
                cirMember.Thickness = gPoint.Distance3D(minc.StartNode.Point,
                    minc.EndNode.Point);

                cirMember.ExtrusionVector = Vector.CreateExtrusion(minc.StartNode.Point,
                    minc.EndNode.Point);
                Maindoc.ActiveLayOut.Entities.AddItem(cirMember);
                cirMember.Update();

                //Maindoc.CommandAction.Zoom("W",
                //    new gPoint(minc.StartNode.Point.x + minc.Length, minc.StartNode.Point.y + minc.Length, minc.StartNode.Point.z + minc.Length),
                //new gPoint(minc.EndNode.Point.x - minc.Length, minc.EndNode.Point.y - minc.Length, minc.EndNode.Point.z - minc.Length));


                Maindoc.Redraw(true);
            }
        }
Beispiel #18
0
 public CVcadEllipse(vdCircle vdcircle)
 {
     this.vdobj = vdcircle;
 }
Beispiel #19
0
        public static void DrawHrdrographFromDataFile(string data_file, vdDocument vdDoc)
        {
            List <HydroData> list_hydro_coll = new List <HydroData>();
            MyStrings        mlist           = null;
            List <string>    file_content    = new List <string>(File.ReadAllLines(data_file));
            string           kStr            = "";
            HydroData        hdr             = null;
            vdMText          mtext           = null;
            vdPolyline       pl   = null;
            vdCircle         cir  = null;
            vdRect           rect = null;

            double min_x, min_y;
            double max_x, max_y;


            min_x = double.MaxValue;
            min_y = min_x;
            max_x = double.MinValue;
            max_y = max_x;
            bool   flag = false;
            double min_foundation_Level = 0.0, Max_Scour_Depth = 0.0;

            foreach (var item in file_content)
            {
                kStr  = item.Replace(",", " ");
                kStr  = item.Replace("=", " ");
                kStr  = MyStrings.RemoveAllSpaces(kStr.ToUpper());
                mlist = new MyStrings(kStr, ' ');

                if (kStr.ToUpper().Contains("DISTANCE"))
                {
                    flag = true;
                }
                if (mlist.StringList[0] == "MIN_FOUNDATION_LEVEL")
                {
                    min_foundation_Level = mlist.GetDouble(1);
                }
                if (mlist.StringList[0] == "MAXIMUM_SCOUR_DEPTH")
                {
                    Max_Scour_Depth = mlist.GetDouble(1);
                }

                //sw.WriteLine("MIN_FOUNDATION_LEVEL = {0}", min_foundation_Level);
                //sw.WriteLine("MAXIMUM_SCOUR_DEPTH = {0}", Max_Scour_Depth);

                if (flag == false)
                {
                    continue;
                }
                try
                {
                    hdr          = new HydroData();
                    hdr.SerialNo = list_hydro_coll.Count + 1;


                    hdr.Distance = mlist.GetDouble(0, -999.0);
                    if (hdr.Distance == -999.0)
                    {
                        throw (new Exception());
                    }

                    hdr.WaterLevel = mlist.GetDouble(1);



                    list_hydro_coll.Add(hdr);

                    if (min_x > hdr.Distance)
                    {
                        min_x = hdr.Distance;
                    }
                    if (min_y > hdr.WaterLevel)
                    {
                        min_y = hdr.WaterLevel;
                    }

                    if (max_x < hdr.Distance)
                    {
                        max_x = hdr.Distance;
                    }
                    if (max_y < hdr.WaterLevel)
                    {
                        max_y = hdr.WaterLevel;
                    }
                }
                catch (Exception ex) { }
            }

            pl = new vdPolyline();
            pl.SetUnRegisterDocument(vdDoc);
            pl.setDocumentDefaults();



            foreach (var item in list_hydro_coll)
            {
                cir = new vdCircle();
                cir.SetUnRegisterDocument(vdDoc);
                cir.setDocumentDefaults();
                cir.Center   = new VectorDraw.Geometry.gPoint(item.Distance, item.WaterLevel);
                cir.Radius   = 0.09;
                cir.PenColor = new vdColor(Color.GreenYellow);
                vdDoc.ActiveLayOut.Entities.AddItem(cir);

                pl.VertexList.Add(cir.Center);
            }
            pl.PenColor = new vdColor(Color.Red);
            vdDoc.ActiveLayOut.Entities.AddItem(pl);


            vdLine ln_min_found = new vdLine();

            ln_min_found.SetUnRegisterDocument(vdDoc);
            ln_min_found.setDocumentDefaults();
            ln_min_found.StartPoint.x = pl.BoundingBox.Left;
            ln_min_found.StartPoint.y = pl.BoundingBox.Bottom - min_foundation_Level;

            ln_min_found.EndPoint.x = pl.BoundingBox.Right;
            ln_min_found.EndPoint.y = pl.BoundingBox.Bottom - min_foundation_Level;
            vdDoc.ActiveLayOut.Entities.AddItem(ln_min_found);


            mtext = new vdMText();
            mtext.SetUnRegisterDocument(vdDoc);
            mtext.setDocumentDefaults();
            mtext.InsertionPoint.x = ln_min_found.StartPoint.x;
            mtext.InsertionPoint.y = ln_min_found.StartPoint.y - 0.2;
            mtext.Height           = 0.3;
            //mtext.Rotation = 90 * Math.PI / 180.0;

            mtext.TextString = "Depth from LBL to minimum Foundation Level = " + min_foundation_Level.ToString("0.0000");
            mtext.PenColor   = new vdColor(Color.Cyan);
            vdDoc.ActiveLayOut.Entities.AddItem(mtext);



            vdLine ln_max_scour = new vdLine();

            ln_max_scour.SetUnRegisterDocument(vdDoc);
            ln_max_scour.setDocumentDefaults();
            ln_max_scour.StartPoint.x = pl.BoundingBox.Left;
            ln_max_scour.StartPoint.y = pl.BoundingBox.Bottom - Max_Scour_Depth;

            ln_max_scour.EndPoint.x = pl.BoundingBox.Right;
            ln_max_scour.EndPoint.y = pl.BoundingBox.Bottom - Max_Scour_Depth;
            vdDoc.ActiveLayOut.Entities.AddItem(ln_max_scour);



            mtext = new vdMText();
            mtext.SetUnRegisterDocument(vdDoc);
            mtext.setDocumentDefaults();
            mtext.InsertionPoint    = ln_max_scour.StartPoint;
            mtext.InsertionPoint.y -= 0.2;
            mtext.Height            = 0.3;
            //mtext.Rotation = 90 * Math.PI / 180.0;

            mtext.TextString = "Maximum Scour Depth obtained = " + Max_Scour_Depth.ToString("0.0000");
            mtext.PenColor   = new vdColor(Color.Cyan);
            vdDoc.ActiveLayOut.Entities.AddItem(mtext);

            //Maximum Scour Depth adopted =

            //Depth from LBL to minimum Foundation Level


            //vdRect rect = null;
            rect = new vdRect();
            rect.SetUnRegisterDocument(vdDoc);
            rect.setDocumentDefaults();

            rect.InsertionPoint.x = pl.BoundingBox.Left - 2;
            if (min_foundation_Level > Max_Scour_Depth)
            {
                rect.InsertionPoint.y = pl.BoundingBox.Bottom - 2 - min_foundation_Level;
            }
            else
            {
                rect.InsertionPoint.y = pl.BoundingBox.Bottom - 2 - Max_Scour_Depth;
            }

            rect.Width = pl.BoundingBox.Width + 4;
            //rect.Height = -pl.BoundingBox.Height;
            rect.Height = -2;

            vdDoc.ActiveLayOut.Entities.AddItem(rect);


            vdLine ln = new vdLine();

            ln.SetUnRegisterDocument(vdDoc);
            ln.setDocumentDefaults();
            ln.StartPoint.x = rect.BoundingBox.Left;
            ln.StartPoint.y = rect.BoundingBox.Bottom + 1;
            ln.EndPoint.x   = rect.BoundingBox.Right;
            ln.EndPoint.y   = rect.BoundingBox.Bottom + 1;

            vdDoc.ActiveLayOut.Entities.AddItem(ln);

            foreach (var item in list_hydro_coll)
            {
                mtext = new vdMText();
                mtext.SetUnRegisterDocument(vdDoc);
                mtext.setDocumentDefaults();
                mtext.InsertionPoint.x = item.Distance;
                mtext.InsertionPoint.y = ln.BoundingBox.Bottom + 0.2;
                mtext.Height           = 0.1;
                mtext.Rotation         = 90 * Math.PI / 180.0;

                mtext.TextString = item.WaterLevel.ToString("0.0000");
                mtext.PenColor   = new vdColor(Color.Cyan);
                vdDoc.ActiveLayOut.Entities.AddItem(mtext);


                mtext = new vdMText();
                mtext.SetUnRegisterDocument(vdDoc);
                mtext.setDocumentDefaults();
                mtext.InsertionPoint.x = item.Distance;
                mtext.InsertionPoint.y = rect.BoundingBox.Bottom + 0.2;
                mtext.Height           = 0.1;
                mtext.Rotation         = 90 * Math.PI / 180.0;

                mtext.TextString = item.Distance.ToString("0.0000");
                mtext.PenColor   = new vdColor(Color.LightGreen);
                vdDoc.ActiveLayOut.Entities.AddItem(mtext);
            }


            mtext = new vdMText();
            mtext.SetUnRegisterDocument(vdDoc);
            mtext.setDocumentDefaults();
            mtext.InsertionPoint.x = rect.BoundingBox.Left + 0.2;
            mtext.InsertionPoint.y = rect.BoundingBox.Top + 0.2;
            mtext.Height           = 0.11;
            //mtext.Rotation = 90 * Math.PI / 180.0;

            mtext.TextString = "DATUM = " + rect.BoundingBox.Top.ToString("0.00");
            vdDoc.ActiveLayOut.Entities.AddItem(mtext);

            mtext = new vdMText();
            mtext.SetUnRegisterDocument(vdDoc);
            mtext.setDocumentDefaults();
            mtext.InsertionPoint.x = rect.BoundingBox.Left + 0.2;
            mtext.InsertionPoint.y = ln.BoundingBox.Bottom + 0.5;
            mtext.Height           = 0.1;
            //mtext.Rotation = 90 * Math.PI / 180.0;

            mtext.TextString = "RIVER BED LEVEL (m)";
            mtext.PenColor   = new vdColor(Color.Cyan);
            vdDoc.ActiveLayOut.Entities.AddItem(mtext);


            mtext = new vdMText();
            mtext.SetUnRegisterDocument(vdDoc);
            mtext.setDocumentDefaults();
            mtext.InsertionPoint.x = rect.BoundingBox.Left + 0.2;
            mtext.InsertionPoint.y = rect.BoundingBox.Bottom + 0.5;
            mtext.Height           = 0.1;
            //mtext.Rotation = 90 * Math.PI / 180.0;

            mtext.TextString = "DISTANCE (m)";
            mtext.PenColor   = new vdColor(Color.LightGreen);
            vdDoc.ActiveLayOut.Entities.AddItem(mtext);


            ln = new vdLine();
            ln.SetUnRegisterDocument(vdDoc);
            ln.setDocumentDefaults();
            ln.StartPoint.x = rect.BoundingBox.Left + 1.8;
            ln.StartPoint.y = rect.BoundingBox.Bottom;
            ln.EndPoint.x   = rect.BoundingBox.Left + 1.8;
            ln.EndPoint.y   = rect.BoundingBox.Top;


            vdDoc.ActiveLayOut.Entities.AddItem(ln);

            vdRect over_box = new vdRect();

            over_box.SetUnRegisterDocument(vdDoc);
            over_box.setDocumentDefaults();

            over_box.InsertionPoint.x = rect.BoundingBox.Left - 2;
            over_box.InsertionPoint.y = rect.BoundingBox.Bottom - 1;

            over_box.Width  = rect.BoundingBox.Width + 4;
            over_box.Height = (pl.BoundingBox.Top - rect.BoundingBox.Bottom) + 2;

            vdDoc.ActiveLayOut.Entities.AddItem(over_box);

            VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_VTop(vdDoc);
            vdDoc.Redraw(true);
        }
Beispiel #20
0
        public void Draw_Moving_Wheel(vdDocument doc, double radius, int load_case, double max_x, double max_y)
        {
            VectorDraw.Professional.Memory.vdMemory.Collect();

            vdHatchProperties hp = new vdHatchProperties();

            hp.SetUnRegisterDocument(doc);
            hp.FillMode  = VectorDraw.Professional.Constants.VdConstFill.VdFillModeSolid;
            hp.FillColor = new vdColor(Color.Black);


            double x = (double)(load_case * 0.2);

            double y = max_y + radius;


            vdCircle cir = new vdCircle();

            #region for loop
            for (int i = 0; i < list[0].Moving_Wheel[0].List_Distance.Count; i++)
            {
                if (x > 0 && x < max_x)
                {
                    for (int z = 0; z < list.Count; z++)
                    {
                        cir = new vdCircle();
                        cir.SetUnRegisterDocument(doc);
                        cir.setDocumentDefaults();
                        cir.Center          = new VectorDraw.Geometry.gPoint(x, y, list[z].Z);
                        cir.Radius          = radius;
                        cir.HatchProperties = hp;
                        doc.ActiveLayOut.Entities.AddItem(cir);
                    }
                }
                x -= list[0].Moving_Wheel[0].List_Distance.GetDouble(i);
            }
            #endregion

            /*
             *
             * if (x > 0 && x < max_x)
             * {
             *
             *  cir.SetUnRegisterDocument(doc);
             *  cir.setDocumentDefaults();
             *  cir.Center = new VectorDraw.Geometry.gPoint(x, y, list[0].Z);
             *  cir.Radius = radius;
             *  doc.ActiveLayOut.Entities.AddItem(cir);
             * }
             *
             * x -= 3.0;
             * if (x > 0 && x < max_x)
             * {
             *  cir = new vdCircle();
             *  cir.SetUnRegisterDocument(doc);
             *  cir.setDocumentDefaults();
             *  cir.Center = new VectorDraw.Geometry.gPoint(x, y, list[0].Z);
             *  cir.Radius = radius;
             *  doc.ActiveLayOut.Entities.AddItem(cir);
             * }
             *
             * x -= 3.0;
             *
             * if (x > 0 && x < max_x)
             * {
             *  cir = new vdCircle();
             *  cir.SetUnRegisterDocument(doc);
             *  cir.setDocumentDefaults();
             *  cir.Center = new VectorDraw.Geometry.gPoint(x, y, list[0].Z);
             *  cir.Radius = radius;
             *  doc.ActiveLayOut.Entities.AddItem(cir);
             * }
             *
             * x -= 4.30;
             * if (x > 0 && x < max_x)
             * {
             *
             *  cir = new vdCircle();
             *  cir.SetUnRegisterDocument(doc);
             *  cir.setDocumentDefaults();
             *  cir.Center = new VectorDraw.Geometry.gPoint(x, y, list[0].Z);
             *  cir.Radius = radius;
             *  doc.ActiveLayOut.Entities.AddItem(cir);
             * }
             *
             * x -= 1.2;
             *
             * if (x > 0 && x < max_x)
             * {
             *
             *  cir = new vdCircle();
             *  cir.SetUnRegisterDocument(doc);
             *  cir.setDocumentDefaults();
             *  cir.Center = new VectorDraw.Geometry.gPoint(x, y, list[0].Z);
             *  cir.Radius = radius;
             *  doc.ActiveLayOut.Entities.AddItem(cir);
             * }
             * x -= 3.2;
             * if (x > 0 && x < max_x)
             * {
             *
             *  cir = new vdCircle();
             *  cir.SetUnRegisterDocument(doc);
             *  cir.setDocumentDefaults();
             *  cir.Center = new VectorDraw.Geometry.gPoint(x, y, list[0].Z);
             *  cir.Radius = radius;
             *  doc.ActiveLayOut.Entities.AddItem(cir);
             * }
             * x -= 1.1;
             * if (x > 0 && x < max_x)
             * {
             *
             *  cir = new vdCircle();
             *  cir.SetUnRegisterDocument(doc);
             *  cir.setDocumentDefaults();
             *  cir.Center = new VectorDraw.Geometry.gPoint(x, y, list[0].Z);
             *  cir.Radius = radius;
             *  doc.ActiveLayOut.Entities.AddItem(cir);
             * }
             * //for (int i = 0; i < list[0].Moving_Wheel[0].List_Distance; i++)
             * //{
             * //    cir = new vdCircle();
             * //    cir.SetUnRegisterDocument(doc);
             * //    cir.setDocumentDefaults();
             * //    cir.Center = new VectorDraw.Geometry.gPoint(((double)(load_case * 0.2)) - 3.0, 3, list[0].Z);
             * //    cir.Radius = radius;
             * //    doc.ActiveLayOut.Entities.AddItem(cir);
             * ////}
             *
             * /**/
        }
Beispiel #21
0
        public static void CmdPipe3DFromText(vdDocument doc, string txtFileName)
        {
            Color  pipeColor = Color.Green;
            double pipeSize  = 100.0d;

            vdLayer pipeLay = new vdLayer();

            pipeLay.Name = "Pipes";
            pipeLay.SetUnRegisterDocument(doc);
            pipeLay.setDocumentDefaults();
            doc.Layers.AddItem(pipeLay);
            doc.ActiveLayer = pipeLay;


            vdLayer nodeBallLay = new vdLayer();

            nodeBallLay.Name = "NodalData";
            nodeBallLay.SetUnRegisterDocument(doc);
            nodeBallLay.setDocumentDefaults();
            doc.Layers.AddItem(nodeBallLay);
            nodeBallLay.PenColor = new vdColor(Color.Red);



            string fName = txtFileName;

            ReadPipes(fName);
            HEADSNeed.DisNet.frmDrawPipe fdp = new HEADSNeed.DisNet.frmDrawPipe();
            if (fdp.ShowDialog() == DialogResult.OK)
            {
                pipeColor = fdp.PipeColor;
                pipeSize  = fdp.PipeSize;
                //doc.ActiveLayer.PenColor = new vdColor(pipeColor);
                pipeLay.PenColor = new vdColor(pipeColor);
            }
            else
            {
                return;
            }
            for (int i = 0; i < lstPipe.Count; i++)
            {
                try
                {
                    DisNetPipe dnPipe = lstPipe[i];
                    vdCircle   cir    = new vdCircle();
                    cir.Center = dnPipe.StartPoint;
                    cir.Radius = dnPipe.Diameter * pipeSize;
                    //cir.Radius = dnPipe.Diameter;
                    cir.ExtrusionVector = Vector.CreateExtrusion(dnPipe.StartPoint, dnPipe.EndPoint);
                    cir.SetUnRegisterDocument(doc);
                    cir.setDocumentDefaults();
                    cir.Layer = pipeLay;

                    doc.ActionLayout.Entities.AddItem(cir);
                    cir.Thickness = dnPipe.Length;
                    //cir.PenColor = new vdColor(cl);
                    doc.CommandAction.CmdSphere(dnPipe.EndPoint, cir.Radius, 10, 10);
                    doc.ActiveLayer = nodeBallLay;
                    doc.CommandAction.CmdSphere(dnPipe.EndPoint, cir.Radius + 5.0d, 15, 10);
                    doc.ActiveLayer = pipeLay;
                    doc.CommandAction.Zoom("E", 100, 100);

                    if (i == 0)
                    {
                        vdPolyline pline = new vdPolyline();
                        pline.VertexList.Add(new gPoint(cir.Center.x - 35.0d, cir.Center.y + 25.0d, cir.Center.z));
                        pline.VertexList.Add(new gPoint(cir.Center.x - 35.0d, cir.Center.y, cir.Center.z));
                        pline.VertexList.Add(new gPoint(cir.Center.x + 35.0d, cir.Center.y, cir.Center.z));
                        pline.VertexList.Add(new gPoint(cir.Center.x + 35.0d, cir.Center.y + 25.0d, cir.Center.z));
                        pline.SetUnRegisterDocument(doc);
                        pline.setDocumentDefaults();

                        pline.PenColor = new vdColor(Color.LightPink);
                        pline.PenWidth = 2.0d;
                        doc.ActionLayout.Entities.AddItem(pline);


                        vdLine ln = new vdLine();
                        ln.SetUnRegisterDocument(doc);
                        ln.setDocumentDefaults();

                        ln.StartPoint = (pline.VertexList[0] + pline.VertexList[1]) / 2;
                        ln.EndPoint   = (pline.VertexList[2] + pline.VertexList[3]) / 2;
                        ln.PenColor   = new vdColor(Color.LightPink);
                        ln.PenWidth   = 2.0d;
                        doc.ActionLayout.Entities.AddItem(ln);

                        vdText tx = new vdText();
                        tx.SetUnRegisterDocument(doc);
                        tx.setDocumentDefaults();
                        tx.InsertionPoint = new gPoint(ln.StartPoint.x + 2.0d, ln.StartPoint.y + 3.0d, ln.StartPoint.z);
                        tx.TextString     = "SOURCE";
                        tx.PenColor       = new vdColor(Color.LightPink);
                        tx.Height         = 10.0d;

                        doc.ActionLayout.Entities.AddItem(tx);
                    }

                    //doc.Redraw(true);
                }
                catch (Exception exx)
                {
                }
            }
            doc.RenderMode = vdRender.Mode.Wire2dGdiPlus;
            doc.CommandAction.RegenAll();
            doc.Redraw(true);
        }
Beispiel #22
0
        public static void CmdPipe3D(vdDocument doc)
        {
            Color  pipeColor = Color.Green;
            double pipeSize  = 100.0d;

            vdLayer pipeLay = new vdLayer();

            pipeLay.Name = "Pipes";
            pipeLay.SetUnRegisterDocument(doc);
            pipeLay.setDocumentDefaults();
            doc.Layers.AddItem(pipeLay);
            doc.ActiveLayer = pipeLay;


            //OpenFileDialog ofd = new OpenFileDialog();
            //string fName = "";

            //ofd.Title = "SELECT DisNet Pipe Details File";
            //ofd.Filter = "Text File|*.txt";



            //if (ofd.ShowDialog() != DialogResult.Cancel)
            //{
            //    fName = ofd.FileName;
            //    ReadPipes(fName);
            //    HEADSNeed.DisNet.frmDrawPipe fdp = new HEADSNeed.DisNet.frmDrawPipe();
            //    if (fdp.ShowDialog() == DialogResult.OK)
            //    {
            //        pipeColor = fdp.PipeColor;
            //        pipeSize = fdp.PipeSize;
            //        //doc.ActiveLayer.PenColor = new vdColor(pipeColor);
            //        pipeLay.PenColor = new vdColor(pipeColor);
            //    }
            //    else
            //        return;
            //}

            //ReadPipes("C:\\DisNetPoints.txt");

            for (int i = 0; i < lstPipe.Count; i++)
            {
                try
                {
                    DisNetPipe dnPipe = lstPipe[i];
                    vdCircle   cir    = new vdCircle();
                    cir.Center = dnPipe.StartPoint;
                    cir.Radius = dnPipe.Diameter * pipeSize;
                    //cir.Radius = dnPipe.Diameter;
                    cir.ExtrusionVector = Vector.CreateExtrusion(dnPipe.StartPoint, dnPipe.EndPoint);
                    cir.SetUnRegisterDocument(doc);
                    cir.setDocumentDefaults();
                    cir.Layer = pipeLay;

                    doc.ActionLayout.Entities.AddItem(cir);
                    cir.Thickness = dnPipe.Length;
                    //cir.PenColor = new vdColor(cl);
                    doc.CommandAction.CmdSphere(dnPipe.EndPoint, cir.Radius, 10, 10);
                    doc.CommandAction.Zoom("E", 100, 100);



                    //doc.Redraw(true);
                }
                catch (Exception exx)
                {
                }
            }
            doc.RenderMode = vdRender.Mode.Render;
            doc.CommandAction.RegenAll();
            doc.Redraw(true);
        }
Beispiel #23
0
 public MemberIncidenceCollection()
 {
     list = new List<MemberIncidence>();
     cirMember = new vdCircle();
     Groups = new _MemberGroupCollection();
 }
Beispiel #24
0
        public override void FillShapeEntities(ref vdEntities entities)
        {
            vdCircle circle = new vdCircle();

            //entities.AddItem(circle);
            circle.MatchProperties(this, Document);
            circle.Radius          = mRadius;
            circle.HatchProperties = mhatchprops;

            if (mShowLines)
            {
                gPoint cen = new gPoint();
                vdLine line1;

                double dx = 0.0d, dy = 0.0d;

                dx = circle.Center.x - 0.5;
                dy = circle.Center.y;

                line1            = new vdLine();
                line1.StartPoint = new gPoint(dx, dy, circle.Center.z);
                line1.EndPoint   = new gPoint(circle.Center.x + 0.5d, circle.Center.y, circle.Center.z);
                line1.MatchProperties(this, Document);
                entities.AddItem(line1);


                for (int i = 0; i < 6; i++)
                {
                    line1 = new vdLine();
                    line1.MatchProperties(this, Document);

                    line1.StartPoint = new gPoint(dx, dy);
                    line1.EndPoint   = new gPoint(line1.StartPoint.x - 0.1d, line1.StartPoint.y - 0.3);

                    dx += 0.2;
                    //dy += 0.3;

                    entities.AddItem(line1);
                }

                //line1 = new vdLine();
                //line1.StartPoint = new gPoint(circle.Center.x - 1.0d, circle.Center.y, circle.Center.z);
                //line1.EndPoint = new gPoint(circle.Center.x + 1.0d, circle.Center.y, circle.Center.z);
                //line1.MatchProperties(this, Document);
                //entities.AddItem(line1);



                //line2 = new vdLine();
                //line2.StartPoint = line1.StartPoint;
                //line2.EndPoint = new gPoint(line1.StartPoint.x-0.1d, line1.StartPoint.y - 0.5d);
                //line2.MatchProperties(this, Document);
                //entities.AddItem(line2);


                //line3 = new vdLine();
                //line3.StartPoint = line1.EndPoint;
                //line3.EndPoint = new gPoint(line1.EndPoint.x - 0.1d, line1.EndPoint.y - 0.5d);
                //line3.MatchProperties(this, Document);
                //entities.AddItem(line3);


                //line4 = new vdLine();
                //line4.StartPoint = new gPoint(line1.StartPoint.x + 0.3d, line1.StartPoint.y);
                //line4.EndPoint = new gPoint(line4.StartPoint.x - 0.1d, line4.EndPoint.y - 0.5d);
                //line4.MatchProperties(this, Document);
                //entities.AddItem(line4);

                //line5 = new vdLine();
                //line5.StartPoint = new gPoint(line4.StartPoint.x + 0.3d, line4.StartPoint.y);
                //line5.EndPoint = new gPoint(line5.StartPoint.x - 0.1d, line5.EndPoint.y - 0.5d);
                //line5.MatchProperties(this, Document);
                //entities.AddItem(line5);

                //line6 = new vdLine();
                //line6.StartPoint = new gPoint(line5.StartPoint.x + 0.3d, line5.StartPoint.y);
                //line6.EndPoint = new gPoint(line6.StartPoint.x - 0.1d, line6.EndPoint.y - 0.5d);
                //line6.MatchProperties(this, Document);
                //entities.AddItem(line6);



                //ASTRASupportPinned pinn = new ASTRASupportPinned();
                //pinn.MatchProperties(this, Document);
                //pinn.Origin = circle.Center;
                //pinn.Radius = 0.2d;
                //entities.AddItem(pinn);
            }
        }