Exemplo n.º 1
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);
                }
            }
        }
Exemplo n.º 2
0
        public override vdEntities Explode()
        {
            vdEntities Entities = new vdEntities();

            Entities.SetUnRegisterDocument(Document);
            if (Document != null)
            {
                Document.UndoHistory.PushEnable(false);
            }
            vdLine line = new vdLine();

            line.StartPoint = StartPoint;
            line.EndPoint   = EndPoint;
            line.MatchProperties(this, Document);
            Entities.AddItem(line);

            vdPolyline pl = new vdPolyline();

            pl.VertexList.AddRange(this.mArrowPoints);
            pl.Flag                              = VdConstPlineFlag.PlFlagCLOSE;
            pl.HatchProperties                   = new vdHatchProperties();
            pl.HatchProperties.FillMode          = VdConstFill.VdFillModeSolid;
            pl.HatchProperties.FillColor.ByBlock = true;
            pl.Transformby(ArrowEcsMatrix(new Vector(0, 0, 1)));
            pl.MatchProperties(this, Document);
            Entities.AddItem(pl);
            if (Document != null)
            {
                Document.UndoHistory.PopEnable();
            }
            return(Entities);
        }
Exemplo n.º 3
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);
            }
        }
Exemplo n.º 4
0
        public override void FillShapeEntities(ref vdEntities entities)
        {
            //calculate shape entities in ecs

            gPoint cen  = new gPoint();
            vdText text = new vdText();

            //entities.AddItem(text);
            //text.MatchProperties(this, Document);

            text.Style          = TextStyle;
            text.TextString     = TextString;
            text.VerJustify     = VdConstVerJust.VdTextVerCen;
            text.HorJustify     = VdConstHorJust.VdTextHorCenter;
            text.Height         = TextHeight;
            text.InsertionPoint = cen;
            vdPolyline pl = new vdPolyline();

            entities.AddItem(cirStart);
            entities.AddItem(pl);
            //entities.AddItem(pl2);

            pl.MatchProperties(this, Document);
            cirStart.MatchProperties(this, Document);
            cirEnd.MatchProperties(this, Document);

            Vertexes verts = new Vertexes();

            double stepangle = Globals.VD_TWOPI / this.NumSides;
            double sang      = 0.0d;

            for (int i = 0; i < NumSides; i++)
            {
                verts.Add(gPoint.Polar(cen, sang, Radius));
                sang += stepangle;
            }
            pl.VertexList = verts;
            pl.Flag       = VdConstPlineFlag.PlFlagCLOSE;

            //entities.AddItem(cirEnd);

            cirStart.Center    = cen;
            cirStart.Radius    = mRadius;
            cirStart.Thickness = PipeHeight;
            //cirStart.Thickness = cirStart.Center.Distance3D(EndPoint);
            //cirStart.ExtrusionVector = new Vector(0.0, 1.0, 0.0);
            //cirStart.ExtrusionVector = Vector.CreateExtrusion(EndPoint, StartPoint);
            cirStart.ExtrusionVector = Vector.CreateExtrusion(StartPoint, EndPoint);


            cirEnd.Center = EndPoint;
            cirEnd.Radius = mRadius;
            //cirEnd.ExtrusionVector = Vector.CreateExtrusion(cen, EndPoint);
            //cirEnd.ExtrusionVector = cirStart.ExtrusionVector;



            // Draw DisNet Pipe
            gPoints gPts = GetDisNetPipePoints();

            //vdPolyline plDisNet = new vdPolyline();
            pl.VertexList = new Vertexes(gPts);
            //entities.AddItem(pl);
        }
Exemplo n.º 5
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);
            }
        }
Exemplo n.º 6
0
        public override void FillShapeEntities(ref vdEntities entities)
        {
            //vdDocument document = entities.Document;
            //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);
            //    }
            //}

            gPoint EPT, SPT;

            SPT = StartPoint;
            EPT = EndPoint;

            vdLine line1 = new vdLine();

            //line1.SetUnRegisterDocument(document);
            //line1.setDocumentDefaults();
            line1.StartPoint = SPT;
            line1.EndPoint   = EPT;
            entities.AddItem(line1);

            vdLine line2 = new vdLine();

            //line2.SetUnRegisterDocument(document);
            //line2.setDocumentDefaults();
            line2.StartPoint = new gPoint(SPT.x, SPT.y - 1, SPT.z);
            line2.EndPoint   = new gPoint(EPT.x, EPT.y - 1, EPT.z);
            entities.AddItem(line2);


            ASTRAMemberLoad aline = new ASTRAMemberLoad();

            entities.AddItem(aline);
            aline.InitializeProperties();
            aline.setDocumentDefaults();
            aline.StartPoint = line2.StartPoint;
            aline.EndPoint   = line1.StartPoint;
            aline.arrowSize  = 0.3;


            double ll = ((line1.Length() / 5.0d) / line1.Length());
            double sx, sy, sz;
            double ex, ey, ez;

            sx = sy = sz = 0.0d;
            for (int j = 1; j <= 5; j++)
            {
                ASTRAMemberLoad aline1 = new ASTRAMemberLoad();
                entities.AddItem(aline1);
                aline1.InitializeProperties();
                aline1.setDocumentDefaults();
                aline1.arrowSize = 0.3;

                sx = (j * ll) * (line2.EndPoint.x - line2.StartPoint.x) + line2.StartPoint.x;
                sy = (j * ll) * (line2.EndPoint.y - line2.StartPoint.y) + line2.StartPoint.y;
                sz = (j * ll) * (line2.EndPoint.z - line2.StartPoint.z) + line2.StartPoint.z;

                aline1.StartPoint = new gPoint(sx, sy, sz);

                ex = (j * ll) * (line1.EndPoint.x - line1.StartPoint.x) + line1.StartPoint.x;
                ey = (j * ll) * (line1.EndPoint.y - line1.StartPoint.y) + line1.StartPoint.y;
                ez = (j * ll) * (line1.EndPoint.z - line1.StartPoint.z) + line1.StartPoint.z;
                aline1.EndPoint = new gPoint(ex, ey, ez);
            }
        }