Ejemplo n.º 1
0
        public void AddProjection()
        {
            if (IsProjectionAdded_)
            {
                return;
            }

            BCOM.LineElement contour = Task.GetLineContour();
            BCOM.LineElement cross   =
                ElementHelper.createCrossInContour(contour);

            BCOM.Level level = ElementHelper.GetOrCreateLevel(LEVEL_PROJECTION_NAME);

            FrameList.AddProjection(contour, "contour", level);
            FrameList.AddProjection(cross, "cross", level);

            // 2-ая проекция:
            var contour2 = (BCOM.LineElement)contour.Clone();
            var cross2   = (BCOM.LineElement)cross.Clone();

            contour2.Move(App.Point3dScale(Task.DepthVec, Task.Depth));
            cross2.Move(App.Point3dScale(Task.DepthVec, Task.Depth));

            FrameList.AddProjection(contour2, "contour", level);
            FrameList.AddProjection(cross2, "cross", level);

            IsProjectionAdded_ = true;
        }
Ejemplo n.º 2
0
        //posistion unit:m
        BCOM.LineElement[] CreateArrowElement(Point3d position, IPileProperty pileprop)
        {
            //double uorpermaster = app.ActiveModelReference.UORsPerMasterUnit;
            BCOM.Point3d centroidp = position.Point3dToBCOMPoint3d(1e4 / uorpermaster);
            centroidp.Z = 0; // 平面
            BG.DVector3d linevector     = new BG.DVector3d(pileprop.PileTopPoint.Point3dToDPoint3d(), pileprop.PileBottomPoint.Point3dToDPoint3d());
            double       xyrotationRad  = linevector.AngleXY.Radians;
            double       arrowbarlength = 5 * pileprop.PileDiameter * 1e4 / uorpermaster;

            BCOM.Point3d     startp = app.Point3dZero(), endp = app.Point3dFromXY(arrowbarlength, 0);
            BCOM.LineElement bar      = app.CreateLineElement2(null, ref startp, ref endp);
            BCOM.Point3d     wingendp = app.Point3dFromXY(-arrowbarlength / 3, 0);
            var wing1 = app.CreateLineElement2(null, ref startp, ref wingendp);
            var wing2 = wing1.Clone().AsLineElement();

            wing1.RotateAboutZ(ref startp, app.Radians(25));
            wing2.RotateAboutZ(ref startp, app.Radians(-25));
            wing1.Move(ref endp); wing2.Move(ref endp);
            var lineArray = new BCOM.LineElement[] { bar, wing1, wing2 };

            foreach (var line in lineArray)
            {
                line.RotateAboutZ(ref startp, xyrotationRad);
                line.Move(ref centroidp);
                line.Color = 2;
                //line.LineWeight = 3;
            }
            return(lineArray);
        }
Ejemplo n.º 3
0
        private GroupByTaskModel()
        {
            penData_ = PenetrDataSource.Instance;

            TaskTable = new DataTable();
            TaskTable.Columns.Add(FieldName.STATUS, typeof(string));
            TaskTable.Columns.Add(PropKey.CODE, typeof(string));
            TaskTable.Columns.Add(PropKey.NAME, typeof(string));
            TaskTable.Columns.Add(FieldName.FLANGES, typeof(long));
            TaskTable.Columns.Add(FieldName.DIAMETER, typeof(string));
            TaskTable.Columns.Add(FieldName.LENGTH, typeof(int));
            TaskTable.Columns.Add(FieldName.REF_POINT1, typeof(string));
            TaskTable.Columns.Add(FieldName.REF_POINT2, typeof(string));
            TaskTable.Columns.Add(FieldName.REF_POINT3, typeof(string));

            foreach (Sp3dToDataGroupMapProperty item in Sp3dToDGMapping.Instance.Items)
            {
                if (item.Key == PropKey.CODE || item.Key == PropKey.NAME)
                {
                    continue;
                }

                if (!string.IsNullOrEmpty(item.TargetXPath))
                {
                    TaskTable.Columns.Add(item.TargetName, typeof(string));
                }
            }
            TaskTable.RowChanged += TaskTable_RowChanged;
            signOnNotify(NP.SelectionCount, NP.TaskSelection);


            BCOM.Point3d     zero = App.Point3dZero();
            BCOM.LineElement line = App.CreateLineElement2(null, zero, zero);
            line.Color = 255;

            selectionTranCon_ = App.CreateTransientElementContainer1(
                line,
                BCOM.MsdTransientFlags.DisplayFirst |
                BCOM.MsdTransientFlags.Overlay,
                BCOM.MsdViewMask.AllViews,
                BCOM.MsdDrawingMode.Temporary);

            previewTranCon_ = App.CreateTransientElementContainer1(
                line,
                BCOM.MsdTransientFlags.DisplayFirst |
                BCOM.MsdTransientFlags.Overlay | BCOM.MsdTransientFlags.Snappable | BCOM.MsdTransientFlags.IncludeInPlot,
                BCOM.MsdViewMask.AllViews,
                BCOM.MsdDrawingMode.Temporary);
        }
Ejemplo n.º 4
0
 public MstnNodeData(long ID, BCOM.Point3d rmCoordinates, BCOM.Element nodeElement, BCOM.LineElement lineElement, string nodeName, string nodeDescr)
 {
     this.ParentNodeID     = -1;
     this.ID               = nodeElement.ID;
     this.nodeElement      = nodeElement;
     this.nodeName         = nodeName;
     this.nodeDescription  = nodeDescr;
     this._reticMasterPt3D = rmCoordinates;
     this.conductor        = lineElement;
     //if (nodeElement.IsCellElement())
     //    this in as LV transfomer
     //    get MVLV cell in that position
     //    assign the parent node ID to the mvlv cell id
     //else
     //    it is a source shape, ellipse
     //   ParentNodeID = 0;
 }
Ejemplo n.º 5
0
        private GroupByTaskModel()
        {
            TaskTable = new DataTable();
            TaskTable.Columns.Add(FieldName.STATUS, typeof(string));
            TaskTable.Columns.Add(FieldName.CODE, typeof(string));
            TaskTable.Columns.Add(FieldName.HEIGHT, typeof(double));
            TaskTable.Columns.Add(FieldName.WIDTH, typeof(double));
            TaskTable.Columns.Add(FieldName.DEPTH, typeof(double));

            foreach (Sp3dToDataGroupMapProperty item in Sp3dToDGMapping.Instance.Items)
            {
                if (!string.IsNullOrEmpty(item.TargetXPath) && item.Key != FieldName.CODE)
                {
                    TaskTable.Columns.Add(item.TargetName, typeof(string));
                }
            }

            TaskTable.RowChanged += TaskTable_RowChanged;

            signOnNotify(NP.SelectionCount, NP.TaskSelection);

            BCOM.Point3d     zero = App.Point3dZero();
            BCOM.LineElement line = App.CreateLineElement2(null, zero, zero);
            line.Color = 255;

            selectionTranCon_ = App.CreateTransientElementContainer1(
                line,
                BCOM.MsdTransientFlags.DisplayFirst |
                BCOM.MsdTransientFlags.Overlay,
                BCOM.MsdViewMask.AllViews,
                BCOM.MsdDrawingMode.Temporary);

            previewTranCon_ = App.CreateTransientElementContainer1(
                line,
                BCOM.MsdTransientFlags.DisplayFirst |
                BCOM.MsdTransientFlags.Overlay | BCOM.MsdTransientFlags.Snappable | BCOM.MsdTransientFlags.IncludeInPlot,
                BCOM.MsdViewMask.AllViews,
                BCOM.MsdDrawingMode.Temporary);
        }
Ejemplo n.º 6
0
        public BCOM.LineElement GetLineContour()
        {
            var bounds = new BCOM.Point3d[5];

            bounds[0] = Origin.AddScaled(HeigthVec, -0.5 * Height)
                        .AddScaled(WidthVec, -0.5 * Width);
            bounds[1] = Origin.AddScaled(HeigthVec, 0.5 * Height)
                        .AddScaled(WidthVec, -0.5 * Width);
            bounds[2] = Origin.AddScaled(HeigthVec, 0.5 * Height)
                        .AddScaled(WidthVec, 0.5 * Width);
            bounds[3] = Origin.AddScaled(HeigthVec, -0.5 * Height)
                        .AddScaled(WidthVec, 0.5 * Width);
            bounds[4] = bounds[0];

            BCOM.LineElement line = App.CreateLineElement1(null, bounds);

            if (!App.Point3dEqualTolerance(
                    line.Normal.Normalize(), DepthVec.Normalize(), 0.00005))
            {
                line.Reverse();
            }
            return(line);
        }
Ejemplo n.º 7
0
        public MstnNodeData(long parID, long ID, BCOM.Point3d rmCoordinates, BCOM.Element nodeElement, BCOM.LineElement lineElement, string nodeName, string nodeDescr)
        {
            //ParentNodeID = 0;// ;
            this.ID          = nodeElement.ID;
            this.nodeElement = nodeElement;

            //if (sourceElement.IsCellElement())
            //    //this in as LV transfomer
            //else
            //    //it is  a source shape, ellipse
        }