コード例 #1
0
 public ActionASTRAMemberLoad(gPoint reference, vdLayout layout)
     : base(reference, layout)
 {
     line = new ASTRAMemberLoad();
     line.SetUnRegisterDocument(layout.Document);
     line.setDocumentDefaults();
     line.StartPoint = reference;
     line.EndPoint   = reference;
 }
コード例 #2
0
        public override void MatchProperties(VectorDraw.Professional.vdObjects.vdPrimary _from, VectorDraw.Professional.vdObjects.vdDocument thisdocument)
        {
            base.MatchProperties(_from, thisdocument);
            ASTRAMemberLoad from = _from as ASTRAMemberLoad;

            if (from == null)
            {
                return;
            }
            StartPoint = from.StartPoint;
            EndPoint   = from.EndPoint;
            arrowSize  = from.arrowSize;
        }
コード例 #3
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);
            }
        }
コード例 #4
0
        public static void CmdASTRAMemberLoad(vdDocument document)
        {
            gPoint EPT, SPT;

            document.Prompt("Start Point:");
            object ret = document.ActionUtility.getUserPoint();

            document.Prompt(null);
            if (ret == null || !(ret is gPoint))
            {
                return;
            }
            SPT = ret as gPoint;

            ActionASTRAMemberLoad aFig = new ActionASTRAMemberLoad(SPT, document.ActiveLayOut);

            document.Prompt("End Point :");

            document.ActionAdd(aFig);
            StatusCode scode = aFig.WaitToFinish();

            document.Prompt(null);
            if (scode != VectorDraw.Actions.StatusCode.Success)
            {
                return;
            }

            EPT = aFig.Value as gPoint;



            vdLine line1 = new vdLine();

            line1.SetUnRegisterDocument(document);
            line1.setDocumentDefaults();
            line1.StartPoint = SPT;
            line1.EndPoint   = EPT;
            document.ActiveLayOut.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);
            document.ActiveLayOut.Entities.AddItem(line2);


            ASTRAMemberLoad aline = new ASTRAMemberLoad();

            document.ActionLayout.Entities.AddItem(aline);
            document.UndoHistory.PushEnable(false);
            aline.InitializeProperties();
            aline.setDocumentDefaults();
            aline.StartPoint = line2.StartPoint;
            aline.EndPoint   = line1.StartPoint;
            aline.arrowSize  = 0.3;
            aline.Transformby(document.User2WorldMatrix);
            document.UndoHistory.PopEnable();
            document.ActionDrawFigure(aline);


            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();
                document.ActionLayout.Entities.AddItem(aline1);
                document.UndoHistory.PushEnable(false);
                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);
                aline1.Transformby(document.User2WorldMatrix);
                document.UndoHistory.PopEnable();
                document.ActionDrawFigure(aline);
            }
            document.Redraw(true);
        }
コード例 #5
0
        public static void CmdASTRAMemberLoad3(vdDocument document, gPoint StartPoint, gPoint EndPoint)
        {
            gPoint EPT, SPT;

            SPT = StartPoint;

            EPT = EndPoint;



            vdLine line1 = new vdLine();

            line1.SetUnRegisterDocument(document);
            line1.setDocumentDefaults();
            line1.StartPoint = SPT;
            line1.EndPoint   = EPT;
            document.ActiveLayOut.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);
            document.ActiveLayOut.Entities.AddItem(line2);


            ASTRAMemberLoad aline = new ASTRAMemberLoad();

            document.ActionLayout.Entities.AddItem(aline);
            document.UndoHistory.PushEnable(false);
            aline.InitializeProperties();
            aline.setDocumentDefaults();
            aline.StartPoint = line2.StartPoint;
            aline.EndPoint   = line1.StartPoint;
            aline.arrowSize  = 0.3;
            aline.Transformby(document.User2WorldMatrix);
            document.UndoHistory.PopEnable();
            document.ActionDrawFigure(aline);


            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();
                document.ActionLayout.Entities.AddItem(aline1);
                document.UndoHistory.PushEnable(false);
                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);
                aline1.Transformby(document.User2WorldMatrix);
                document.UndoHistory.PopEnable();
                document.ActionDrawFigure(aline);
            }
            document.Redraw(true);
        }
コード例 #6
0
        public static void CmdASTRAMemberLoad1(vdDocument document)
        {
            gPoint EPT, SPT;

            document.Prompt("Start Point:");
            object ret = document.ActionUtility.getUserPoint();

            document.Prompt(null);
            if (ret == null || !(ret is gPoint))
            {
                return;
            }
            SPT = ret as gPoint;

            ActionASTRAMemberLoad aFig = new ActionASTRAMemberLoad(SPT, document.ActiveLayOut);

            document.Prompt("End Point :");

            document.ActionAdd(aFig);
            StatusCode scode = aFig.WaitToFinish();

            document.Prompt(null);
            if (scode != VectorDraw.Actions.StatusCode.Success)
            {
                return;
            }

            EPT = aFig.Value as gPoint;



            vdLine line1 = new vdLine();

            line1.SetUnRegisterDocument(document);
            line1.setDocumentDefaults();
            line1.StartPoint = SPT;
            line1.EndPoint   = EPT;
            document.ActiveLayOut.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);
            document.ActiveLayOut.Entities.AddItem(line2);


            ASTRAMemberLoad aline = new ASTRAMemberLoad();

            document.ActionLayout.Entities.AddItem(aline);
            document.UndoHistory.PushEnable(false);
            aline.InitializeProperties();
            aline.setDocumentDefaults();
            aline.StartPoint = line1.StartPoint;
            aline.EndPoint   = line2.StartPoint;
            aline.arrowSize  = 0.3;
            aline.Transformby(document.User2WorldMatrix);
            document.UndoHistory.PopEnable();
            document.ActionDrawFigure(aline);

            ASTRAMemberLoad aline1 = new ASTRAMemberLoad();

            document.ActionLayout.Entities.AddItem(aline1);
            document.UndoHistory.PushEnable(false);
            aline1.InitializeProperties();
            aline1.setDocumentDefaults();
            aline1.arrowSize  = 0.3;
            aline1.StartPoint = line1.EndPoint;
            aline1.EndPoint   = line2.EndPoint;
            aline1.Transformby(document.User2WorldMatrix);
            document.UndoHistory.PopEnable();
            document.ActionDrawFigure(aline);

            document.Redraw(true);
        }