Exemplo n.º 1
0
        protected override SamplerStatus Sampler(JigPrompts prompts)
        {
            SamplerStatus         state = SamplerStatus.NoChange;
            JigPromptPointOptions prOpt = new JigPromptPointOptions("\nУкажите точку");

            prOpt.BasePoint    = _ptFirst;
            prOpt.UseBasePoint = true;

            PromptPointResult prRes = prompts.AcquirePoint(prOpt);

            if (prRes.Status == PromptStatus.Error || prRes.Status == PromptStatus.Cancel)
            {
                state = SamplerStatus.Cancel;
            }
            else
            {
                var ptNew = prRes.Value.TransformBy(UCS);
                if (_ptLast.DistanceTo(ptNew) <= _equalPoint)
                {
                    state = SamplerStatus.NoChange;
                }
                else
                {
                    _ptLast = ptNew;
                    state   = SamplerStatus.OK;
                }
            }
            return(state);
        }
Exemplo n.º 2
0
 public SamplerBLL(SamplerBLL source)
 {
     this._samplingTicketId = source._samplingTicketId;
     this._samplerId        = source._samplerId;
     this._status           = source._status;
     this._createdBy        = source._createdBy;
     this._createdDate      = source._createdDate;
     this._lastModifiedBy   = source._lastModifiedBy;
     this._lastModifiedDate = source._lastModifiedDate;
 }
        protected override SamplerStatus SamplerData()
        {
            if (!_drawing && _lines.Count > 0)
            {
                AddPolylines();
            }

            // Generate a point cloud

            SamplerStatus res = SamplerStatus.Cancel;

            try
            {
                res = base.SamplerData();
            }
            catch { }

            return(res);
        }
Exemplo n.º 4
0
        protected override SamplerStatus Sampler(JigPrompts prompts)
        {
            int           num;
            SamplerStatus samplerStatus;
            int           num7;
            object        obj;

            try
            {
IL_01:
                ProjectData.ClearProjectError();
                num = -2;
IL_09:
                int num2 = 2;
                JigPromptPointOptions jigPromptPointOptions = new JigPromptPointOptions("\r\n请指定插入点:");
IL_17:
                num2 = 3;
                jigPromptPointOptions.UserInputControls = 2;
IL_21:
                num2 = 4;
                jigPromptPointOptions.Cursor = 3;
IL_2B:
                num2 = 5;
                jigPromptPointOptions.BasePoint = this.point3d_0;
IL_3A:
                num2 = 6;
                jigPromptPointOptions.UseBasePoint = true;
IL_44:
                num2 = 7;
                PromptPointResult promptPointResult = prompts.AcquirePoint(jigPromptPointOptions);
IL_4F:
                num2 = 8;
                if (promptPointResult.Status != -5002)
                {
                    goto IL_65;
                }
IL_60:
                goto IL_1E9;
IL_65:
                num2 = 11;
IL_68:
                num2           = 12;
                this.point3d_1 = promptPointResult.Value;
IL_77:
                num2 = 13;
                if (!(this.point3d_2 != this.point3d_1))
                {
                    goto IL_112;
                }
IL_90:
                num2 = 14;
                Matrix3d matrix3d = Matrix3d.Displacement(this.point3d_1 - this.point3d_2);
IL_AB:
                num2 = 15;
                int num3 = 0;
                checked
                {
                    int num4 = this.objectId_0.Length - 1;
                    this.int_0 = num3;
                    for (;;)
                    {
                        int num5 = this.int_0;
                        int num6 = num4;
                        if (num5 > num6)
                        {
                            break;
                        }
IL_C3:
                        num2 = 16;
                        this.entity_0[this.int_0].TransformBy(matrix3d);
IL_DA:
                        num2 = 17;
                        this.int_0++;
                    }
IL_F9:
                    num2           = 18;
                    this.point3d_2 = this.point3d_1;
IL_108:
                    num2          = 19;
                    samplerStatus = 0;
                    goto IL_1E9;
IL_112:
                    num2 = 21;
IL_115:
                    num2          = 22;
                    samplerStatus = 1;
                    goto IL_1E9;
IL_11F:
                    goto IL_1DE;
IL_124:
                    num7 = num2;
                    if (num <= -2)
                    {
                        goto IL_13F;
                    }
                    @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num);
IL_13A:
                    goto IL_1DE;
                    IL_13F :;
                }
                int num8 = num7 + 1;
                num7 = 0;
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num8);
                goto IL_11F;
IL_1B8:
                goto IL_1E9;
            }
            catch when(endfilter(obj is Exception & num != 0 & num7 == 0))
            {
                Exception ex = (Exception)obj2;

                goto IL_124;
            }
IL_1DE:
            throw ProjectData.CreateProjectError(-2146828237);
IL_1E9:
            SamplerStatus result = samplerStatus;

            if (num7 != 0)
            {
                ProjectData.ClearProjectError();
            }
            return(result);
        }
Exemplo n.º 5
0
        protected override SamplerStatus Sampler(JigPrompts prompts)
        {
            int           num;
            SamplerStatus samplerStatus;
            int           num2;
            object        obj;

            try
            {
                ProjectData.ClearProjectError();
                num = 2;
                PromptPointResult promptPointResult = prompts.AcquirePoint(new JigPromptPointOptions("\r\n请指定下一点:")
                {
                    Cursor       = 2,
                    BasePoint    = this.point3d_0,
                    UseBasePoint = true
                });
                Point3d value = promptPointResult.Value;
                if (value != this.point3d_1)
                {
                    checked
                    {
                        if (this.bool_0)
                        {
                            this.double_0 = value.DistanceTo(this.point3d_0);
                            this.short_0  = (short)Math.Round(this.double_0 / 6.0);
                            this.double_2 = value.GetVectorTo(this.point3d_0).AngleOnPlane(new Plane());
                            this.point2d_0..ctor(this.point3d_0.X, this.point3d_0.Y);
                            this.jipAtgRsh..ctor(value.X, value.Y);
                        }
                        else
                        {
                            this.short_0 = (short)Math.Round(value.DistanceTo(this.point3d_0));
                            if ((double)this.short_0 >= this.double_0)
                            {
                                this.short_0 = (short)Math.Round(this.double_0);
                            }
                            else if ((double)this.short_0 <= this.double_0 / 6.0)
                            {
                                this.short_0 = (short)Math.Round(this.double_0 / 6.0);
                            }
                        }
                    }
                    Point2d point2dAngle  = CAD.GetPoint2dAngle(this.jipAtgRsh, (double)this.short_0 / 6.0, this.double_2 * 180.0 / 3.1415926535897931 - 90.0);
                    Point2d point2dAngle2 = CAD.GetPoint2dAngle(this.jipAtgRsh, (double)this.short_0 / 3.0, this.double_2 * 180.0 / 3.1415926535897931 - 90.0);
                    Point2d point2dAngle3 = CAD.GetPoint2dAngle(this.jipAtgRsh, (double)this.short_0 / 3.0, this.double_2 * 180.0 / 3.1415926535897931 + 180.0);
                    Point2d point2dAngle4 = CAD.GetPoint2dAngle(this.jipAtgRsh, (double)this.short_0 / 3.0, this.double_2 * 180.0 / 3.1415926535897931 + 90.0);
                    Point2d point2dAngle5 = CAD.GetPoint2dAngle(this.jipAtgRsh, (double)this.short_0 / 6.0, this.double_2 * 180.0 / 3.1415926535897931 + 90.0);
                    this.polyline_0 = new Polyline();
                    this.polyline_0.AddVertexAt(0, this.point2d_0, 0.0, 0.0, 0.0);
                    this.polyline_0.AddVertexAt(1, point2dAngle, 0.0, 0.0, 0.0);
                    this.polyline_0.AddVertexAt(2, point2dAngle2, 0.0, 0.0, 0.0);
                    this.polyline_0.AddVertexAt(3, point2dAngle3, 0.0, 0.0, 0.0);
                    this.polyline_0.AddVertexAt(4, point2dAngle4, 0.0, 0.0, 0.0);
                    this.polyline_0.AddVertexAt(5, point2dAngle5, 0.0, 0.0, 0.0);
                    this.polyline_0.Closed = true;
                    this.polyline_0.Layer  = "注释";
                    this.entity_0[0]       = this.polyline_0;
                    this.point3d_1         = value;
                    samplerStatus          = 0;
                    goto IL_431;
                }
                samplerStatus = 1;
                goto IL_431;
IL_3E9:
                num2 = -1;
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num);
IL_3FE:
                goto IL_426;
IL_400:
                samplerStatus = 1;
                goto IL_431;
            }
            catch when(endfilter(obj is Exception & num != 0 & num2 == 0))
            {
                Exception ex = (Exception)obj2;

                goto IL_3E9;
            }
IL_426:
            throw ProjectData.CreateProjectError(-2146828237);
IL_431:
            SamplerStatus result = samplerStatus;

            if (num2 != 0)
            {
                ProjectData.ClearProjectError();
            }
            return(result);
        }
Exemplo n.º 6
0
        protected override SamplerStatus Sampler(JigPrompts prompts)
        {
            int           num;
            SamplerStatus samplerStatus;
            int           num4;
            object        obj;

            try
            {
IL_01:
                ProjectData.ClearProjectError();
                num = -2;
IL_09:
                int num2 = 2;
                JigPromptPointOptions jigPromptPointOptions = new JigPromptPointOptions("\r\n请指定插入点:");
IL_16:
                num2 = 3;
                jigPromptPointOptions.UserInputControls = 2;
IL_1F:
                num2 = 4;
                jigPromptPointOptions.Cursor = 3;
IL_28:
                num2 = 5;
                jigPromptPointOptions.BasePoint = this.point3d_0;
IL_36:
                num2 = 6;
                jigPromptPointOptions.UseBasePoint = true;
IL_3F:
                num2 = 7;
                PromptPointResult promptPointResult = prompts.AcquirePoint(jigPromptPointOptions);
IL_4A:
                num2 = 8;
                if (promptPointResult.Status != -5002)
                {
                    goto IL_61;
                }
IL_5C:
                goto IL_192;
IL_61:
                num2 = 11;
IL_64:
                num2           = 12;
                this.point3d_1 = promptPointResult.Value;
IL_74:
                num2 = 13;
                if (!(this.point3d_2 != this.point3d_1))
                {
                    goto IL_CE;
                }
IL_8A:
                num2 = 14;
                Matrix3d matrix3d = Matrix3d.Displacement(this.point3d_1 - this.point3d_2);
IL_A5:
                num2 = 15;
                this.entity_0.TransformBy(matrix3d);
IL_B5:
                num2           = 16;
                this.point3d_2 = this.point3d_1;
IL_C4:
                num2          = 17;
                samplerStatus = 0;
                goto IL_192;
IL_CE:
                num2 = 19;
IL_D1:
                num2          = 20;
                samplerStatus = 1;
IL_DB:
                goto IL_192;
IL_E0:
                int num3 = num4 + 1;
                num4     = 0;
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num3);
IL_14C:
                goto IL_187;
IL_14E:
                num4 = num2;
                if (num <= -2)
                {
                    goto IL_E0;
                }
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num);
                IL_164 :;
            }
            catch when(endfilter(obj is Exception & num != 0 & num4 == 0))
            {
                Exception ex = (Exception)obj2;

                goto IL_14E;
            }
IL_187:
            throw ProjectData.CreateProjectError(-2146828237);
IL_192:
            SamplerStatus result = samplerStatus;

            if (num4 != 0)
            {
                ProjectData.ClearProjectError();
            }
            return(result);
        }