示例#1
0
        internal Matrix4D method_14()
        {
            Matrix4D toWcsTransform = DxfUtil.GetToWCSTransform(this.vector3D_0);

            toWcsTransform.Transpose();
            Matrix4D matrix4D1 = Transformation4D.RotateZ(this.double_6) * toWcsTransform;
            Matrix4D matrix4D2;
            Matrix4D matrix4D3;
            Matrix4D matrix4D4;

            if (this.PerspectiveMode)
            {
                double num1 = Class484.smethod_0(this.size2D_0, this.double_1, this.double_4);
                matrix4D2 = this.method_24();
                matrix4D3 = new Matrix4D(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0 / this.double_1, 0.0, 0.0, -1.0 / this.double_1, 0.0) * Transformation4D.Translation(0.0, 0.0, -num1);
                double num2 = System.Math.Sqrt(this.size2D_0.X * this.size2D_0.X + this.size2D_0.Y * this.size2D_0.Y) / 42.0;
                matrix4D4 = Transformation4D.Scaling(num2, num2, 1.0);
            }
            else
            {
                matrix4D2 = this.method_25();
                matrix4D3 = Matrix4D.Identity;
                double num = this.size2D_0.Y / this.double_4;
                matrix4D4 = Transformation4D.Scaling(num, num, 1.0);
            }
            Matrix4D matrix4D5 = Transformation4D.Translation(-this.point2D_0.X, -this.point2D_0.Y, 0.0);

            return(matrix4D2 * matrix4D4 * matrix4D5 * matrix4D3 * matrix4D1 * Transformation4D.Translation(-(WW.Math.Vector3D) this.point3D_1));
        }
示例#2
0
        public Matrix4D GetTransform(Size2D targetSize)
        {
            Matrix4D toWcsTransform = DxfUtil.GetToWCSTransform(this.vector3D_0);

            toWcsTransform.Transpose();
            Matrix4D matrix4D = Transformation4D.RotateZ(this.double_6) * toWcsTransform;

            return(Transformation4D.Translation(this.point2D_2.X, this.point2D_2.Y, 0.0) * (!this.PerspectiveMode ? Matrix4D.Identity : new Matrix4D(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0 / this.double_2, 0.0, 0.0, -1.0 / this.double_2, 0.0) * Transformation4D.Translation(0.0, 0.0, -Class484.smethod_0(new Size2D(targetSize.X * this.double_1, targetSize.Y), this.double_2, this.double_0))) * matrix4D * Transformation4D.Translation(-this.point3D_0.X, -this.point3D_0.Y, -this.point3D_0.Z));
        }
示例#3
0
文件: DxfView.cs 项目: 15831944/WW
        public Matrix4D GetTransform()
        {
            Matrix4D toWcsTransform = DxfUtil.GetToWCSTransform(this.vector3D_0);

            toWcsTransform.Transpose();
            Matrix4D matrix4D = Transformation4D.RotateZ(this.double_3) * toWcsTransform;

            return((!this.PerspectiveMode ? Matrix4D.Identity : new Matrix4D(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0 / this.double_0, 0.0, 0.0, -1.0 / this.double_0, 0.0) * Transformation4D.Translation(0.0, 0.0, -this.vector3D_0.GetLength())) * Transformation4D.Translation(-this.point2D_0.X, -this.point2D_0.Y, 0.0) * matrix4D * Transformation4D.Translation(-(Vector3D)this.point3D_0));
        }
示例#4
0
文件: DxfInsert.cs 项目: 15831944/WW
        private void DrawInternal(DxfInsert.Interface46 drawHandler, bool drawBlock)
        {
            Matrix4D toWcsTransform = DxfUtil.GetToWCSTransform(this.ZAxis);
            Matrix4D matrix4D1      = Transformation4D.Translation((WW.Math.Vector3D) this.InsertionPoint);
            Matrix4D matrix4D2      = Transformation4D.RotateZ(this.Rotation);
            Matrix4D matrix4D3      = Transformation4D.Scaling(this.ScaleFactor);
            ushort   num1           = this.RowCount;

            if (num1 < (ushort)1)
            {
                num1 = (ushort)1;
            }
            ushort num2 = this.ColumnCount;

            if (num2 < (ushort)1)
            {
                num2 = (ushort)1;
            }
            for (int row = 0; row < (int)num1; ++row)
            {
                for (int column = 0; column < (int)num2; ++column)
                {
                    if (drawBlock)
                    {
                        Matrix4D matrix4D4 = toWcsTransform * matrix4D1 * matrix4D2 * Transformation4D.Translation((double)column * this.ColumnSpacing, (double)row * this.RowSpacing, 0.0) * matrix4D3;
                        drawHandler.imethod_0(row, column, matrix4D4);
                        if (this.Block != null)
                        {
                            switch (this.method_16(matrix4D4, drawHandler))
                            {
                            case DxfInsert.Enum44.const_1:
                            case DxfInsert.Enum44.const_2:
                                drawHandler.Draw(this.Block, true);
                                break;

                            case DxfInsert.Enum44.const_3:
                                drawHandler.Draw(this.Block, true);
                                drawHandler.InsertCellDrawContext.vmethod_1();
                                break;
                            }
                        }
                    }
                    if (this.Attributes.Count > 0)
                    {
                        WW.Math.Vector3D vector = new WW.Math.Vector3D((double)column * this.ColumnSpacing, (double)row * this.RowSpacing, 0.0);
                        vector = (toWcsTransform * matrix4D2).Transform(vector);
                        Matrix4D instanceTransform = Transformation4D.Translation(vector.X, vector.Y, vector.Z);
                        drawHandler.imethod_1(row, column, instanceTransform);
                        foreach (DxfAttribute attribute in (IEnumerable <DxfAttribute>) this.Attributes)
                        {
                            drawHandler.Draw(attribute);
                        }
                    }
                }
            }
        }
示例#5
0
        internal void method_13(
            Matrix4D matrix,
            CommandGroup undoGroup,
            out Matrix4D transformationWithOcs)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            DxfPolyline2DBase.Class349 class349 = new DxfPolyline2DBase.Class349();
            // ISSUE: reference to a compiler-generated field
            class349.dxfPolyline2DBase_0 = this;
            Matrix4D transform = this.Transform;

            // ISSUE: reference to a compiler-generated field
            class349.double_0 = this.double_1;
            // ISSUE: reference to a compiler-generated field
            class349.vector3D_0 = this.vector3D_0;
            // ISSUE: reference to a compiler-generated field
            class349.double_1 = this.double_2;
            // ISSUE: reference to a compiler-generated field
            class349.double_2 = this.double_3;
            // ISSUE: reference to a compiler-generated field
            class349.double_3 = this.double_4;
            this.vector3D_0   = matrix.Transform(this.vector3D_0);
            this.double_4    *= this.vector3D_0.GetLength();
            this.vector3D_0.Normalize();
            this.double_1 = (DxfUtil.GetToWCSTransform(this.vector3D_0).GetInverse() * matrix * transform).Transform(WW.Math.Point3D.Zero).Z;
            Matrix4D inverse = this.Transform.GetInverse();

            transformationWithOcs = inverse * matrix * transform;
            this.double_2         = transformationWithOcs.Transform(new Vector2D(this.double_2, 0.0)).GetLength();
            this.double_3         = transformationWithOcs.Transform(new Vector2D(this.double_3, 0.0)).GetLength();
            if (undoGroup == null)
            {
                return;
            }
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: reference to a compiler-generated method
            // ISSUE: reference to a compiler-generated method
            undoGroup.UndoStack.Push((ICommand) new Command((object)this, new System.Action(new DxfPolyline2DBase.Class350()
            {
                class349_0 = class349,
                double_0   = this.double_1,
                vector3D_0 = this.vector3D_0,
                double_1   = this.double_2,
                double_2   = this.double_3,
                double_3   = this.double_4
            }.method_0), new System.Action(class349.method_0)));
        }
示例#6
0
文件: DxfShape.cs 项目: 15831944/WW
        public override void TransformMe(
            TransformConfig config,
            Matrix4D matrix,
            CommandGroup undoGroup)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            DxfShape.Class676 class676 = new DxfShape.Class676();
            // ISSUE: reference to a compiler-generated field
            class676.dxfShape_0 = this;
            // ISSUE: reference to a compiler-generated field
            class676.double_0 = this.double_1;
            // ISSUE: reference to a compiler-generated field
            class676.point3D_0 = this.point3D_0;
            // ISSUE: reference to a compiler-generated field
            class676.double_1 = this.double_2;
            // ISSUE: reference to a compiler-generated field
            class676.double_2 = this.double_3;
            // ISSUE: reference to a compiler-generated field
            class676.vector3D_0 = this.vector3D_0;
            this.vector3D_0     = matrix.Transform(this.vector3D_0);
            this.double_1      *= this.vector3D_0.GetLength();
            this.vector3D_0.Normalize();
            Matrix4D inverse = DxfUtil.GetToWCSTransform(this.vector3D_0).GetInverse();
            // ISSUE: reference to a compiler-generated field
            Matrix4D toWcsTransform = DxfUtil.GetToWCSTransform(class676.vector3D_0);
            Matrix4D matrix4D       = inverse * matrix * toWcsTransform;

            this.point3D_0 = matrix4D.Transform(this.point3D_0);
            this.double_2 *= matrix.Transform(new Vector2D(1.0, 0.0)).GetLength();
            this.double_3  = matrix4D.TransformAngle(this.double_3);
            if (undoGroup == null)
            {
                return;
            }
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: reference to a compiler-generated method
            // ISSUE: reference to a compiler-generated method
            undoGroup.UndoStack.Push((ICommand) new Command((object)this, new System.Action(new DxfShape.Class677()
            {
                class676_0 = class676,
                double_0   = this.double_1,
                point3D_0  = this.point3D_0,
                double_1   = this.double_2,
                double_2   = this.double_3,
                vector3D_0 = this.vector3D_0
            }.method_0), new System.Action(class676.method_0)));
        }
示例#7
0
        internal static Matrix4D smethod_6(
            ILeader leader,
            IList <WW.Math.Point3D> vertices,
            Vector3D zaxis)
        {
            WW.Math.Point3D vertex1        = vertices[0];
            WW.Math.Point3D vertex2        = vertices[1];
            Matrix4D        toWcsTransform = DxfUtil.GetToWCSTransform(zaxis);
            Vector3D        v1             = new Vector3D(toWcsTransform.M00, toWcsTransform.M10, toWcsTransform.M20);
            Vector3D        v2             = new Vector3D(toWcsTransform.M01, toWcsTransform.M11, toWcsTransform.M21);
            Vector3D        u     = vertex1 - vertex2;
            double          angle = System.Math.Atan2(Vector3D.DotProduct(u, v2), Vector3D.DotProduct(u, v1));
            double          effectiveArrowSize = leader.GetEffectiveArrowSize();

            return(Transformation4D.Translation((Vector3D)vertex1) * toWcsTransform * Transformation4D.RotateZ(angle) * Transformation4D.Scaling(effectiveArrowSize, effectiveArrowSize, effectiveArrowSize));
        }
示例#8
0
文件: DxfCircle.cs 项目: 15831944/WW
        internal void method_13(
            Matrix4D matrix,
            CommandGroup undoGroup,
            out Matrix4D transformationWithOcs)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            DxfCircle.Class538 class538 = new DxfCircle.Class538();
            // ISSUE: reference to a compiler-generated field
            class538.dxfCircle_0 = this;
            // ISSUE: reference to a compiler-generated field
            class538.point3D_0 = this.point3D_0;
            // ISSUE: reference to a compiler-generated field
            class538.double_0 = this.double_1;
            // ISSUE: reference to a compiler-generated field
            class538.vector3D_0 = this.vector3D_0;
            // ISSUE: reference to a compiler-generated field
            class538.double_1 = this.double_2;
            this.vector3D_0   = matrix.Transform(this.vector3D_0);
            this.double_2    *= this.vector3D_0.GetLength();
            this.vector3D_0.Normalize();
            Matrix4D inverse = DxfUtil.GetToWCSTransform(this.vector3D_0).GetInverse();
            // ISSUE: reference to a compiler-generated field
            Matrix4D toWcsTransform = DxfUtil.GetToWCSTransform(class538.vector3D_0);

            transformationWithOcs = inverse * matrix * toWcsTransform;
            this.point3D_0        = transformationWithOcs.Transform(this.point3D_0);
            // ISSUE: reference to a compiler-generated field
            this.double_1 = (this.point3D_0 - transformationWithOcs.Transform(class538.point3D_0 + this.double_1 * Vector3D.XAxis)).GetLength();
            if (undoGroup == null)
            {
                return;
            }
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: reference to a compiler-generated method
            // ISSUE: reference to a compiler-generated method
            undoGroup.UndoStack.Push((ICommand) new WW.Actions.Command((object)this, new System.Action(new DxfCircle.Class539()
            {
                class538_0 = class538,
                point3D_0  = this.point3D_0,
                double_0   = this.double_1,
                vector3D_0 = this.vector3D_0,
                double_1   = this.double_2
            }.method_0), new System.Action(class538.method_0)));
        }
示例#9
0
        void ILeader.imethod_0(
            DrawContext context,
            IList <WW.Math.Point3D> points,
            IList <WW.Math.Point3D> polyline)
        {
            DxfEntity entity = this.dxfObjectReference_6.Value as DxfEntity;

            if (entity == null)
            {
                return;
            }
            WW.Math.Point3D point = points[points.Count - 1];
            Vector3D        zaxis = this.HorizontalDirection;

            zaxis.Normalize();
            if (this.hookLineDirection_0 == HookLineDirection.Same)
            {
                zaxis = -zaxis;
            }
            BoundsCalculator boundsCalculator = new BoundsCalculator(context.Config);
            Matrix4D         transpose        = DxfUtil.GetToWCSTransform(zaxis).GetTranspose();
            Matrix4D         matrix4D         = Transformation4D.Translation(-(Vector3D)point);

            boundsCalculator.GetBounds(context.Model, entity, transpose * matrix4D);
            Bounds3D bounds = boundsCalculator.Bounds;

            if (!bounds.Initialized)
            {
                return;
            }
            double z1   = bounds.Min.Z;
            double z2   = bounds.Max.Z;
            double num1 = 0.5 * (z1 + z2);
            bool   flag = this.dxfDimensionStyleOverrides_0.TextVerticalAlignment != DimensionTextVerticalAlignment.Above && this.dxfDimensionStyleOverrides_0.TextVerticalPosition >= -0.7 && this.dxfDimensionStyleOverrides_0.TextVerticalPosition <= 0.7;
            double num2 = this.dxfDimensionStyleOverrides_0.ScaleFactor;

            if (num2 == 0.0)
            {
                num2 = 1.0;
            }
            double num3 = this.dxfDimensionStyleOverrides_0.DimensionLineGap * num2;
            double num4 = !flag ? (num1 < 0.0 ? z1 : z2) : System.Math.Max(z1 - num3, 0.0);

            polyline.Add(point + zaxis * num4);
        }
示例#10
0
        public override void TransformMe(
            TransformConfig config,
            Matrix4D matrix,
            CommandGroup undoGroup)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            DxfSolid.Class902 class902 = new DxfSolid.Class902();
            // ISSUE: reference to a compiler-generated field
            class902.dxfSolid_0 = this;
            // ISSUE: reference to a compiler-generated field
            class902.double_0 = this.double_1;
            // ISSUE: reference to a compiler-generated field
            class902.point3D_0 = this.list_0.ToArray();
            // ISSUE: reference to a compiler-generated field
            class902.vector3D_0 = this.vector3D_0;
            this.vector3D_0     = matrix.Transform(this.vector3D_0);
            this.double_1      *= this.vector3D_0.GetLength();
            this.vector3D_0.Normalize();
            Matrix4D inverse = DxfUtil.GetToWCSTransform(this.vector3D_0).GetInverse();
            // ISSUE: reference to a compiler-generated field
            Matrix4D toWcsTransform = DxfUtil.GetToWCSTransform(class902.vector3D_0);
            Matrix4D matrix4D       = inverse * matrix * toWcsTransform;

            for (int index = this.list_0.Count - 1; index >= 0; --index)
            {
                this.list_0[index] = matrix4D.Transform(this.list_0[index]);
            }
            if (undoGroup == null)
            {
                return;
            }
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: reference to a compiler-generated method
            // ISSUE: reference to a compiler-generated method
            undoGroup.UndoStack.Push((ICommand) new Command((object)this, new System.Action(new DxfSolid.Class903()
            {
                class902_0 = class902,
                double_0   = this.double_1,
                point3D_0  = this.list_0.ToArray(),
                vector3D_0 = this.vector3D_0
            }.method_0), new System.Action(class902.method_0)));
        }
示例#11
0
        public override void TransformMe(
            TransformConfig config,
            Matrix4D matrix,
            CommandGroup undoGroup)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            DxfLeader.Class897 class897 = new DxfLeader.Class897();
            // ISSUE: reference to a compiler-generated field
            class897.dxfLeader_0 = this;
            // ISSUE: reference to a compiler-generated field
            class897.double_0 = this.double_2;
            // ISSUE: reference to a compiler-generated field
            class897.double_1 = this.double_3;
            // ISSUE: reference to a compiler-generated field
            class897.point3D_0 = new WW.Math.Point3D[this.list_0.Count];
            // ISSUE: reference to a compiler-generated field
            class897.vector3D_0 = this.vector3D_0;
            // ISSUE: reference to a compiler-generated field
            class897.vector3D_1 = this.vector3D_1;
            // ISSUE: reference to a compiler-generated field
            class897.vector3D_2 = this.vector3D_2;
            // ISSUE: reference to a compiler-generated field
            class897.vector3D_3 = this.vector3D_3;
            this.vector3D_0     = matrix.Transform(this.vector3D_0);
            this.vector3D_0.Normalize();
            Matrix4D inverse = DxfUtil.GetToWCSTransform(this.vector3D_0).GetInverse();
            // ISSUE: reference to a compiler-generated field
            Matrix4D toWcsTransform = DxfUtil.GetToWCSTransform(class897.vector3D_0);
            Matrix4D matrix4D       = inverse * matrix * toWcsTransform;

            this.double_3 = matrix.Transform(new Vector2D(this.double_3, 0.0)).GetLength();
            this.double_2 = matrix.Transform(new Vector2D(0.0, this.double_2)).GetLength();
            for (int index = this.list_0.Count - 1; index >= 0; --index)
            {
                WW.Math.Point3D point = this.list_0[index];
                // ISSUE: reference to a compiler-generated field
                class897.point3D_0[index] = point;
                this.list_0[index]        = matrix.Transform(point);
            }
            this.vector3D_1 = matrix.Transform(this.vector3D_1).GetUnit();
            this.vector3D_2 = matrix.Transform(this.vector3D_2);
            this.vector3D_3 = matrix.Transform(this.vector3D_3);
            if (undoGroup == null)
            {
                return;
            }
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            DxfLeader.Class898 class898 = new DxfLeader.Class898();
            // ISSUE: reference to a compiler-generated field
            class898.class897_0 = class897;
            // ISSUE: reference to a compiler-generated field
            class898.double_0 = this.double_2;
            // ISSUE: reference to a compiler-generated field
            class898.double_1 = this.double_3;
            // ISSUE: reference to a compiler-generated field
            class898.point3D_0 = new WW.Math.Point3D[this.list_0.Count];
            for (int index = this.list_0.Count - 1; index >= 0; --index)
            {
                // ISSUE: reference to a compiler-generated field
                class898.point3D_0[index] = this.list_0[index];
            }
            // ISSUE: reference to a compiler-generated field
            class898.vector3D_0 = this.vector3D_0;
            // ISSUE: reference to a compiler-generated field
            class898.vector3D_1 = this.vector3D_1;
            // ISSUE: reference to a compiler-generated field
            class898.vector3D_2 = this.vector3D_2;
            // ISSUE: reference to a compiler-generated field
            class898.vector3D_3 = this.vector3D_3;
            // ISSUE: reference to a compiler-generated method
            // ISSUE: reference to a compiler-generated method
            undoGroup.UndoStack.Push((ICommand) new Command((object)this, new System.Action(class898.method_0), new System.Action(class897.method_0)));
        }
示例#12
0
文件: DxfMText.cs 项目: 15831944/WW
        public override void TransformMe(
            TransformConfig config,
            Matrix4D matrix,
            CommandGroup undoGroup)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            DxfMText.Class416 class416 = new DxfMText.Class416();
            // ISSUE: reference to a compiler-generated field
            class416.dxfMText_0 = this;
            // ISSUE: reference to a compiler-generated field
            class416.point3D_0 = this.point3D_0;
            // ISSUE: reference to a compiler-generated field
            class416.double_0 = this.double_1;
            // ISSUE: reference to a compiler-generated field
            class416.double_1 = this.double_2;
            // ISSUE: reference to a compiler-generated field
            class416.vector3D_0 = this.vector3D_0;
            // ISSUE: reference to a compiler-generated field
            class416.vector3D_1 = this.vector3D_1;
            // ISSUE: reference to a compiler-generated field
            class416.attachmentPoint_0 = this.attachmentPoint_0;
            this.vector3D_1            = matrix.Transform(this.vector3D_1);
            this.vector3D_1.Normalize();
            this.vector3D_0 = matrix.Transform(this.vector3D_0);
            this.vector3D_0.Normalize();
            Matrix4D inverse = DxfUtil.GetToWCSTransform(this.vector3D_1, this.vector3D_0).GetInverse();
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            Matrix4D toWcsTransform = DxfUtil.GetToWCSTransform(class416.vector3D_1, class416.vector3D_0);
            Matrix4D matrix4D       = inverse * matrix * toWcsTransform;

            this.point3D_0 = matrix.Transform(this.point3D_0);
            this.double_1  = matrix4D.Transform(new WW.Math.Vector3D(0.0, this.double_1, 0.0)).GetLength();
            this.double_2  = matrix4D.Transform(new WW.Math.Vector3D(this.double_2, 0.0, 0.0)).GetLength();
            if (matrix.GetDeterminant() < 0.0)
            {
                // ISSUE: reference to a compiler-generated field
                bool     flag       = WW.Math.Vector3D.DotProduct(this.vector3D_1, class416.vector3D_1) < 0.0;
                Bounds2D textBounds = this.TextBounds;
                if (flag)
                {
                    this.vector3D_1 = -this.vector3D_1;
                    switch (this.attachmentPoint_0)
                    {
                    case AttachmentPoint.TopLeft:
                        this.attachmentPoint_0 = AttachmentPoint.TopRight;
                        break;

                    case AttachmentPoint.TopRight:
                        this.attachmentPoint_0 = AttachmentPoint.TopLeft;
                        break;

                    case AttachmentPoint.MiddleLeft:
                        this.attachmentPoint_0 = AttachmentPoint.MiddleRight;
                        break;

                    case AttachmentPoint.MiddleRight:
                        this.attachmentPoint_0 = AttachmentPoint.MiddleLeft;
                        break;

                    case AttachmentPoint.BottomLeft:
                        this.attachmentPoint_0 = AttachmentPoint.BottomRight;
                        break;

                    case AttachmentPoint.BottomRight:
                        this.attachmentPoint_0 = AttachmentPoint.BottomLeft;
                        break;
                    }
                }
                else
                {
                    WW.Math.Vector3D.CrossProduct(this.vector3D_0, this.vector3D_1).GetUnit();
                    switch (this.attachmentPoint_0)
                    {
                    case AttachmentPoint.TopLeft:
                        this.attachmentPoint_0 = AttachmentPoint.BottomLeft;
                        break;

                    case AttachmentPoint.TopCenter:
                        this.attachmentPoint_0 = AttachmentPoint.BottomCenter;
                        break;

                    case AttachmentPoint.TopRight:
                        this.attachmentPoint_0 = AttachmentPoint.BottomRight;
                        break;

                    case AttachmentPoint.BottomLeft:
                        this.attachmentPoint_0 = AttachmentPoint.TopLeft;
                        break;

                    case AttachmentPoint.BottomCenter:
                        this.attachmentPoint_0 = AttachmentPoint.TopCenter;
                        break;

                    case AttachmentPoint.BottomRight:
                        this.attachmentPoint_0 = AttachmentPoint.TopRight;
                        break;
                    }
                }
            }
            this.method_15();
            if (undoGroup == null)
            {
                return;
            }
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: reference to a compiler-generated method
            // ISSUE: reference to a compiler-generated method
            undoGroup.UndoStack.Push((ICommand) new Command((object)this, new System.Action(new DxfMText.Class417()
            {
                class416_0        = class416,
                point3D_0         = this.point3D_0,
                double_0          = this.double_1,
                double_1          = this.double_2,
                vector3D_0        = this.vector3D_0,
                vector3D_1        = this.vector3D_1,
                attachmentPoint_0 = this.attachmentPoint_0
            }.method_0), new System.Action(class416.method_0)));
        }
示例#13
0
文件: ViewUtil.cs 项目: 15831944/WW
        public static Matrix4D GetBasicModelToViewportTransform(IViewDescription view)
        {
            Matrix4D matrix4D1 = view.IsTargetPaper ? Transformation4D.Translation(-view.ViewCenter.X, -view.ViewCenter.Y, 0.0) : Transformation4D.Translation(-view.ViewCenter.X, -view.ViewCenter.Y, -view.ViewDirection.GetLength()) * Transformation4D.RotateZ(view.ViewTwistAngle) * DxfUtil.GetToWCSTransform(view.ViewDirection).GetTranspose() * Transformation4D.Translation(-(Vector3D)view.ViewTarget);

            if ((view.ViewModeFlags & ViewportStatusFlags.PerspectiveMode) != ViewportStatusFlags.None)
            {
                double   num1      = 1.0 / System.Math.Tan(0.5 * (2.0 * System.Math.Atan(18.0 / view.FocalLength)));
                double   num2      = 0.5 * view.ViewWidth;
                Matrix4D matrix4D2 = new Matrix4D(num2, 0.0, 0.0, 0.0, 0.0, num2, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, -1.0, 0.0);
                matrix4D1 = Transformation4D.Scaling(num1, num1, 1.0) * matrix4D2 * matrix4D1;
            }
            return(matrix4D1);
        }
示例#14
0
        private IList <Polyline4D> method_16(IClippingTransformer transformer)
        {
            WW.Math.Point3D point3D0 = this.point3D_0;
            bool            closed   = this.Closed;

            DxfMLine.Segment segment1 = this.list_0[0];
            int num1 = int.MaxValue;

            foreach (DxfMLine.Segment segment2 in this.list_0)
            {
                if (segment2.Elements.Count < num1)
                {
                    num1 = segment2.Elements.Count;
                }
            }
            IList <Polyline4D> polyline4DList;

            if (num1 >= 2)
            {
                Polyline3D[] polyline3DArray = new Polyline3D[2];
                for (int index = 0; index < polyline3DArray.Length; ++index)
                {
                    polyline3DArray[index] = new Polyline3D(closed);
                }
                foreach (DxfMLine.Segment segment2 in this.list_0)
                {
                    WW.Math.Vector3D miterDirection = segment2.MiterDirection;
                    WW.Math.Point3D  position       = segment2.Position;
                    if (segment2.Elements.Count == 0)
                    {
                        polyline3DArray[0].Add(position);
                    }
                    else
                    {
                        DxfMLine.Segment.Element element1 = (DxfMLine.Segment.Element)null;
                        DxfMLine.Segment.Element element2 = (DxfMLine.Segment.Element)null;
                        double num2 = double.MaxValue;
                        double num3 = double.MinValue;
                        for (int index = 0; index < num1; ++index)
                        {
                            DxfMLine.Segment.Element element3 = segment2.Elements[index];
                            if (element3.Parameters.Count != 0)
                            {
                                if (element1 == null)
                                {
                                    element1 = element3;
                                    num2     = element1.Parameters[0];
                                }
                                else if (element3.Parameters[0] < num2)
                                {
                                    element1 = element3;
                                    num2     = element1.Parameters[0];
                                }
                                if (element2 == null)
                                {
                                    element2 = element3;
                                    num3     = element2.Parameters[0];
                                }
                                else if (element3.Parameters[0] > num3)
                                {
                                    element2 = element3;
                                    num3     = element2.Parameters[0];
                                }
                            }
                        }
                        if (num2 == double.MaxValue)
                        {
                            num2 = 0.0;
                        }
                        if (num3 == double.MinValue)
                        {
                            num3 = 0.0;
                        }
                        if (element1 != null && element2 != null)
                        {
                            polyline3DArray[0].Add(position + miterDirection * num2);
                            polyline3DArray[1].Add(position + miterDirection * num3);
                        }
                    }
                }
                List <Polyline3D> polyline3DList;
                if (closed)
                {
                    polyline3DList = new List <Polyline3D>(2);
                    polyline3DList.AddRange((IEnumerable <Polyline3D>)polyline3DArray);
                }
                else
                {
                    polyline3DList = new List <Polyline3D>(1);
                    Polyline3D polyline3D = new Polyline3D(polyline3DArray[0].Count + polyline3DArray[1].Count, true);
                    polyline3D.AddRange((IEnumerable <WW.Math.Point3D>)polyline3DArray[0]);
                    polyline3D.AddRange((IEnumerable <WW.Math.Point3D>)polyline3DArray[1].GetReverse());
                    polyline3DList.Add(polyline3D);
                }
                IClippingTransformer transformer1 = (IClippingTransformer)transformer.Clone();
                transformer1.SetPreTransform(DxfUtil.GetToWCSTransform(this.vector3D_0));
                polyline4DList = DxfUtil.smethod_36((IList <Polyline3D>)polyline3DList, false, transformer1);
            }
            else
            {
                polyline4DList = (IList <Polyline4D>)null;
            }
            return(polyline4DList);
        }
示例#15
0
        public override void TransformMe(
            TransformConfig config,
            Matrix4D matrix,
            CommandGroup undoGroup)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            DxfInsertBase.Class476 class476 = new DxfInsertBase.Class476();
            // ISSUE: reference to a compiler-generated field
            class476.dxfInsertBase_0 = this;
            // ISSUE: reference to a compiler-generated field
            class476.vector3D_0 = this.vector3D_0;
            // ISSUE: reference to a compiler-generated field
            class476.point3D_0 = this.insertionPoint;
            // ISSUE: reference to a compiler-generated field
            class476.double_0 = this.rotation;
            // ISSUE: reference to a compiler-generated field
            class476.vector3D_1 = this.scaleFactor;
            this.vector3D_0     = matrix.Transform(this.ZAxis).GetUnit();
            Matrix4D inverse = DxfUtil.GetToWCSTransform(this.ZAxis).GetInverse();
            // ISSUE: reference to a compiler-generated field
            Matrix4D toWcsTransform = DxfUtil.GetToWCSTransform(class476.vector3D_0);

            // ISSUE: reference to a compiler-generated field
            this.insertionPoint = inverse.Transform(matrix.Transform(toWcsTransform.Transform(class476.point3D_0)));
            // ISSUE: reference to a compiler-generated field
            Vector3D vector3D = inverse.Transform(matrix.Transform(toWcsTransform.Transform(Transformation4D.RotateZ(class476.double_0).Transform(Vector3D.XAxis))));

            this.rotation = System.Math.Atan2(vector3D.Y, vector3D.X);
            if (this.Rotation < 0.0)
            {
                this.Rotation += 2.0 * System.Math.PI;
            }
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            this.scaleFactor = Transformation4D.RotateZ(-this.Rotation).Transform(inverse.Transform(matrix.Transform(toWcsTransform.Transform(Transformation4D.RotateZ(class476.double_0).Transform(class476.vector3D_1)))));
            CommandGroup undoGroup1 = (CommandGroup)null;

            if (undoGroup != null)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                DxfInsertBase.Class477 class477 = new DxfInsertBase.Class477();
                // ISSUE: reference to a compiler-generated field
                class477.class476_0 = class476;
                undoGroup1          = new CommandGroup((object)this);
                undoGroup.UndoStack.Push((ICommand)undoGroup1);
                // ISSUE: reference to a compiler-generated field
                class477.vector3D_0 = this.vector3D_0;
                // ISSUE: reference to a compiler-generated field
                class477.point3D_0 = this.insertionPoint;
                // ISSUE: reference to a compiler-generated field
                class477.double_0 = this.rotation;
                // ISSUE: reference to a compiler-generated field
                class477.vector3D_1 = this.scaleFactor;
                // ISSUE: reference to a compiler-generated method
                // ISSUE: reference to a compiler-generated method
                undoGroup1.UndoStack.Push((ICommand) new Command((object)this, new System.Action(class477.method_0), new System.Action(class476.method_0)));
            }
            foreach (DxfEntity dxfEntity in (DxfHandledObjectCollection <DxfAttribute>) this.activeDxfHandledObjectCollection_0)
            {
                dxfEntity.TransformMe(config, matrix, undoGroup1);
            }
        }