Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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);
            }
        }
Ejemplo n.º 3
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);
        }