コード例 #1
0
ファイル: Class495.cs プロジェクト: 15831944/WW
        protected virtual bool vmethod_0(DxfReader r)
        {
            Struct18 currentGroup = r.CurrentGroup;
            bool     flag         = true;

            switch (currentGroup.Code)
            {
            case 2:
                this.string_0 = (string)currentGroup.Value;
                break;

            case 280:
                this.enum26_0 = (Enum26)currentGroup.Value;
                break;

            default:
                flag = false;
                break;
            }
            if (flag)
            {
                r.method_85();
            }
            return(flag);
        }
コード例 #2
0
        internal bool method_8(Struct18 g)
        {
            switch (g.Code)
            {
            case 10:
                this.point2D_1.X = (double)g.Value;
                break;

            case 11:
                this.point2D_0.X = (double)g.Value;
                break;

            case 20:
                this.point2D_1.Y = (double)g.Value;
                break;

            case 21:
                this.point2D_0.Y = (double)g.Value;
                break;

            case 50:
                this.double_0 = (double)g.Value * (System.Math.PI / 180.0);
                break;

            case 70:
                this.textHorizontalAlignment_0 = (TextHorizontalAlignment)g.Value;
                break;

            default:
                return(false);
            }
            return(true);
        }
コード例 #3
0
ファイル: DxfProxyEntity.cs プロジェクト: 15831944/WW
        private void method_20(DxfWriter w)
        {
            Interface30 binaryDataReader = Class444.Create(w.Version, this.stream_0);

            binaryDataReader.imethod_4(0L);
            Interface30 stringDataReader = (Interface30)null;

            if (this.stream_1 != null)
            {
                stringDataReader = Class444.Create(w.Version, this.stream_1);
                stringDataReader.imethod_4(0L);
            }
            DxfProxyEntity.Class362 class362 = new DxfProxyEntity.Class362(this.dwgVersion_0, this.long_0, binaryDataReader, this.uint_0, stringDataReader, this.list_0);
            while (!class362.IsAtEndOfStream)
            {
                Struct18 group = class362.method_0();
                w.Write(group);
            }
        }
コード例 #4
0
ファイル: DxfAttributeBase.cs プロジェクト: 15831944/WW
 internal DxfMText method_21()
 {
     if (this.ExtensionDictionary != null)
     {
         DxfObject valueByName = this.ExtensionDictionary.GetValueByName("ACAD_MLATT");
         if (valueByName is DxfXRecord)
         {
             DxfXRecord dxfXrecord            = (DxfXRecord)valueByName;
             int        num                   = 0;
             DxfXRecordValueCollection values = dxfXrecord.Values;
             while (num < values.Count)
             {
                 DxfXRecordValue dxfXrecordValue = values[num++];
                 if (dxfXrecordValue.Code == (short)1 && "Embedded Object".Equals(dxfXrecordValue.Value.ToString()))
                 {
                     break;
                 }
             }
             if (num < values.Count)
             {
                 DxfXRecordValueCollection xrecordValueCollection = new DxfXRecordValueCollection();
                 xrecordValueCollection.AddRange((IEnumerable <DxfXRecordValue>) new DxfXRecordValue[5]
                 {
                     new DxfXRecordValue((short)0, (object)"MTEXT"),
                     new DxfXRecordValue((short)100, (object)"AcDbEntity"),
                     new DxfXRecordValue((short)8, (object)this.Layer.Name),
                     new DxfXRecordValue((short)67, (object)(short)(this.PaperSpace ? 1 : 0)),
                     new DxfXRecordValue((short)100, (object)"AcDbMText")
                 });
                 while (num < values.Count)
                 {
                     xrecordValueCollection.Add(values[num++]);
                 }
                 Struct18 endGroup = new Struct18(0, (object)"ENDSIM");
                 DxfModel model    = this.Model;
                 if (model == null)
                 {
                     throw new Exception("Cannot get MTEXT substitute when attribute has no parent object.");
                 }
                 DxfMText dxfMtext = DxfReader.smethod_1(model, (Interface33) new Class720(endGroup, (IEnumerable <DxfXRecordValue>)xrecordValueCollection), endGroup) as DxfMText;
                 if (dxfMtext != null)
                 {
                     dxfMtext.method_12((DxfEntity)this);
                     dxfMtext.Style = this.Style;
                     if (this.IsAnnotative)
                     {
                         dxfMtext.IsAnnotative = true;
                         dxfMtext.vmethod_2((IDxfHandledObject)this);
                         DxfDictionary dxfDictionary1 = DxfAnnotationScaleObjectContextData.smethod_7((DxfHandledObject)this, true);
                         DxfDictionary dxfDictionary2 = DxfAnnotationScaleObjectContextData.smethod_7((DxfHandledObject)dxfMtext, true);
                         foreach (IDictionaryEntry entry in (ActiveList <IDictionaryEntry>)dxfDictionary1.Entries)
                         {
                             dxfDictionary2.Entries.Add((IDictionaryEntry) new DxfDictionaryEntry("*A", (DxfObject)((DxfAttributeObjectContextData)entry.Value).Mtext));
                         }
                     }
                     return(dxfMtext);
                 }
             }
         }
     }
     return((DxfMText)null);
 }
コード例 #5
0
 internal static extern IntPtr SetWinMetaFileBits(int A_0, byte[] A_1, IntPtr A_2, ref Struct18 A_3);
コード例 #6
0
ファイル: DxfProxyEntity.cs プロジェクト: 15831944/WW
        private void method_18(DxfReader r, Class259 objectBuilder)
        {
            this.bool_2 = true;
            DxfVersion version = r.ModelBuilder.Version;

            this.dwgVersion_0 = Class885.smethod_3(version);
            if (this.stream_0 == null)
            {
                this.stream_0 = (Stream) new PagedMemoryStream(1024L, 1024);
            }
            if (this.dwgVersion_0 > DwgVersion.Dwg1018 && this.stream_1 == null)
            {
                this.stream_1 = (Stream) new PagedMemoryStream(1024L, 1024);
            }
            r.method_85();
            Encoding    encoding   = Encodings.GetEncoding((int)r.Model.Header.DrawingCodePage);
            Interface40 nterface40 = (Interface40) new Class725(this.stream_0, encoding, version);

            DxfProxyEntity.Class361 class361 = new DxfProxyEntity.Class361((Interface29) new Class990((Stream)null, nterface40, this.dwgVersion_0 > DwgVersion.Dwg1018 ? (Interface40) new Class728(this.stream_1, encoding, version) : nterface40, nterface40));
            while (r.CurrentGroup.Code != 0)
            {
                switch (Class820.smethod_2(r.CurrentGroup.Code))
                {
                case Enum5.const_8:
                case Enum5.const_9:
                case Enum5.const_14:
                case Enum5.const_15:
                    ulong            handle           = (ulong)r.CurrentGroup.Value;
                    DxfHandledObject dxfHandledObject = new DxfHandledObject();
                    dxfHandledObject.SetHandle(handle);
                    DxfObjectReference dxfObjectReference = new DxfObjectReference((IDxfHandledObject)dxfHandledObject);
                    Struct18           group1             = new Struct18(r.CurrentGroup.Code, (object)dxfObjectReference);
                    class361.imethod_0(group1);
                    r.method_85();
                    continue;

                case Enum5.const_13:
                    int             code    = r.CurrentGroup.Code;
                    WW.Math.Point3D point3D = new WW.Math.Point3D((double)r.CurrentGroup.Value, 0.0, 0.0);
                    r.method_85();
                    if (r.CurrentGroup.Code == code + 10)
                    {
                        point3D.Y = (double)r.CurrentGroup.Value;
                        r.method_85();
                        if (r.CurrentGroup.Code == code + 20)
                        {
                            point3D.Z = (double)r.CurrentGroup.Value;
                            r.method_85();
                        }
                    }
                    Struct18 group2 = new Struct18(code, (object)point3D);
                    class361.imethod_0(group2);
                    continue;

                default:
                    class361.imethod_0(r.CurrentGroup);
                    r.method_85();
                    continue;
                }
            }
        }
コード例 #7
0
ファイル: DxfProxyEntity.cs プロジェクト: 15831944/WW
 public void imethod_4(Struct18 group)
 {
     throw new NotImplementedException();
 }
コード例 #8
0
ファイル: DxfProxyEntity.cs プロジェクト: 15831944/WW
 public void imethod_1(int baseCode, Struct18 group)
 {
     throw new NotImplementedException();
 }
コード例 #9
0
ファイル: DxfProxyEntity.cs プロジェクト: 15831944/WW
            public void imethod_0(Struct18 group)
            {
                this.interface29_0.imethod_32((short)group.Code);
                Enum5 enum5 = Class820.smethod_2(group.Code);

                switch (enum5)
                {
                case Enum5.const_1:
                    this.interface29_0.imethod_14((bool)group.Value);
                    break;

                case Enum5.const_2:
                    this.interface29_0.imethod_11((byte)group.Value);
                    break;

                case Enum5.const_3:
                    byte[] bytes = (byte[])group.Value;
                    this.interface29_0.imethod_32((short)bytes.Length);
                    this.interface29_0.imethod_12(bytes);
                    break;

                case Enum5.const_4:
                    this.interface29_0.imethod_16((double)group.Value);
                    break;

                case Enum5.const_5:
                    this.interface29_0.imethod_37((byte)0, (ulong)group.Value);
                    break;

                case Enum5.const_6:
                    this.interface29_0.imethod_37((byte)0, DxfHandledObject.Parse((string)group.Value));
                    break;

                case Enum5.const_7:
                    throw new Exception("Object ID is not supported.");

                case Enum5.const_8:
                    this.interface29_0.imethod_41((DxfHandledObject)((DxfObjectReference)group.Value).Value);
                    break;

                case Enum5.const_9:
                    this.interface29_0.imethod_39((DxfHandledObject)((DxfObjectReference)group.Value).Value);
                    break;

                case Enum5.const_10:
                case Enum5.const_17:
                    this.interface29_0.imethod_32((short)group.Value);
                    break;

                case Enum5.const_11:
                    this.interface29_0.imethod_33((int)group.Value);
                    break;

                case Enum5.const_12:
                    this.interface29_0.imethod_34((long)group.Value);
                    break;

                case Enum5.const_13:
                    this.interface29_0.imethod_24((WW.Math.Point3D)group.Value);
                    break;

                case Enum5.const_14:
                    this.interface29_0.imethod_38((DxfHandledObject)((DxfObjectReference)group.Value).Value);
                    break;

                case Enum5.const_15:
                    this.interface29_0.imethod_40((DxfHandledObject)((DxfObjectReference)group.Value).Value);
                    break;

                case Enum5.const_16:
                    this.interface29_0.imethod_4((string)group.Value);
                    break;

                default:
                    throw new Exception("Unsupported group value type " + (object)enum5 + ".");
                }
            }
コード例 #10
0
        internal void method_11(DxfReader r, Class259 objectBuilder, bool readBrackets)
        {
            if (readBrackets)
            {
                if (r.CurrentGroup.Code == 300)
                {
                    if ((string)r.CurrentGroup.Value != "CONTEXT_DATA{")
                    {
                        throw new Exception("Expected CONTEXT_DATA{, but got " + r.CurrentGroup.Value + " instead.");
                    }
                    r.method_85();
                }
                else
                {
                    readBrackets = false;
                }
            }
            while (true)
            {
                bool flag;
                do
                {
                    Struct18 currentGroup = r.CurrentGroup;
                    if (r.CurrentGroup.Code != 301 || !((string)r.CurrentGroup.Value == "}"))
                    {
                        flag = true;
                        switch (r.CurrentGroup.Code)
                        {
                        case 10:
                            this.point3D_0.X = (double)r.CurrentGroup.Value;
                            break;

                        case 20:
                            this.point3D_0.Y = (double)r.CurrentGroup.Value;
                            break;

                        case 30:
                            this.point3D_0.Z = (double)r.CurrentGroup.Value;
                            break;

                        case 40:
                            this.double_0 = (double)r.CurrentGroup.Value;
                            break;

                        case 41:
                            this.double_1 = (double)r.CurrentGroup.Value;
                            break;

                        case 110:
                            this.point3D_1.X = (double)r.CurrentGroup.Value;
                            break;

                        case 111:
                            this.vector3D_0.X = (double)r.CurrentGroup.Value;
                            break;

                        case 112:
                            this.vector3D_1.X = (double)r.CurrentGroup.Value;
                            break;

                        case 120:
                            this.point3D_1.Y = (double)r.CurrentGroup.Value;
                            break;

                        case 121:
                            this.vector3D_0.Y = (double)r.CurrentGroup.Value;
                            break;

                        case 122:
                            this.vector3D_1.Y = (double)r.CurrentGroup.Value;
                            break;

                        case 130:
                            this.point3D_1.Z = (double)r.CurrentGroup.Value;
                            break;

                        case 131:
                            this.vector3D_0.Z = (double)r.CurrentGroup.Value;
                            break;

                        case 132:
                            this.vector3D_1.Z = (double)r.CurrentGroup.Value;
                            break;

                        case 140:
                            this.double_2 = (double)r.CurrentGroup.Value;
                            break;

                        case 145:
                            this.double_3 = (double)r.CurrentGroup.Value;
                            break;

                        case 174:
                            this.textAttachment_0 = (MLeader.TextAttachment)(short) r.CurrentGroup.Value;
                            break;

                        case 175:
                            this.textAttachment_1 = (MLeader.TextAttachment)(short) r.CurrentGroup.Value;
                            break;

                        case 176:
                            this.textAlignment_0 = (MLeader.TextAlignment)r.CurrentGroup.Value;
                            break;

                        case 177:
                            this.blockAttachment_0 = (MLeader.BlockAttachment)r.CurrentGroup.Value;
                            break;

                        case 272:
                            this.textAttachment_3 = (MLeader.TextAttachment)(short) r.CurrentGroup.Value;
                            break;

                        case 273:
                            this.textAttachment_2 = (MLeader.TextAttachment)(short) r.CurrentGroup.Value;
                            break;

                        case 290:
                            this.bool_1 = (bool)r.CurrentGroup.Value;
                            if (this.bool_1)
                            {
                                r.method_85();
                                MLeader.ContentText contentText = new MLeader.ContentText();
                                contentText.Read(r, 296);
                                flag           = false;
                                this.content_0 = (MLeader.Content)contentText;
                                break;
                            }
                            break;

                        case 296:
                            this.bool_2 = (bool)r.CurrentGroup.Value;
                            if (this.bool_2)
                            {
                                r.method_85();
                                MLeader.ContentBlock contentBlock = new MLeader.ContentBlock();
                                contentBlock.Read(r);
                                flag           = false;
                                this.content_0 = (MLeader.Content)contentBlock;
                                break;
                            }
                            break;

                        case 297:
                            this.bool_3 = (bool)r.CurrentGroup.Value;
                            break;

                        case 302:
                            if ((string)r.CurrentGroup.Value == "LEADER{")
                            {
                                MLeader.LeaderNode leaderNode = new MLeader.LeaderNode();
                                r.method_85();
                                leaderNode.Read(r);
                                this.list_0.Add(leaderNode);
                                break;
                            }
                            break;
                        }
                    }
                    else
                    {
                        goto label_39;
                    }
                }while (!flag);
                r.method_85();
            }
            label_39 :;
        }
コード例 #11
0
ファイル: DxfExtendedData.cs プロジェクト: 15831944/WW
            internal static DxfExtendedData.ValueCollection Read(
                Class259 objectBuilder,
                DxfReader r)
            {
                DxfExtendedData.ValueCollection valueCollection1 = new DxfExtendedData.ValueCollection();
                r.method_85();
                bool flag1 = false;
                bool flag2 = true;
                int  num1  = -1;
                bool flag3 = false;

                while (!flag1)
                {
                    Struct18 currentGroup = r.CurrentGroup;
                    switch (currentGroup.Code)
                    {
                    case 1000:
                        valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.String((string)r.CurrentGroup.Value));
                        r.method_85();
                        continue;

                    case 1002:
                        if ((string)r.CurrentGroup.Value == "{")
                        {
                            if (flag2)
                            {
                                flag3 = true;
                                ++num1;
                            }
                            valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.Bracket(false));
                        }
                        else
                        {
                            if (!((string)r.CurrentGroup.Value == "}"))
                            {
                                throw new DxfException("Expected '{' or '}', found " + r.CurrentGroup.Value.ToString() + " instead.");
                            }
                            if (flag2)
                            {
                                if (num1 < 0)
                                {
                                    flag2 = false;
                                }
                                --num1;
                            }
                            valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.Bracket(true));
                        }
                        r.method_85();
                        continue;

                    case 1003:
                        valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.LayerReference(r.Model.GetLayerWithName((string)r.CurrentGroup.Value)));
                        r.method_85();
                        continue;

                    case 1004:
                        List <byte> byteList = new List <byte>();
                        byteList.AddRange((IEnumerable <byte>)(byte[]) r.CurrentGroup.Value);
                        r.method_85();
                        while (r.CurrentGroup.Code == 1004)
                        {
                            byteList.AddRange((IEnumerable <byte>)(byte[]) r.CurrentGroup.Value);
                            r.method_85();
                        }
                        valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.BinaryData(byteList.ToArray()));
                        continue;

                    case 1005:
                        ulong num2 = (ulong)r.CurrentGroup.Value;
                        DxfExtendedData.DatabaseHandle xdataDatabaseHandle = new DxfExtendedData.DatabaseHandle();
                        valueCollection1.Add((IExtendedDataValue)xdataDatabaseHandle);
                        objectBuilder.ChildBuilders.Add((Interface10) new Class618(xdataDatabaseHandle)
                        {
                            DatabaseHandle = num2
                        });
                        r.method_85();
                        continue;

                    case 1010:
                        double x1 = (double)r.CurrentGroup.Value;
                        r.method_85();
                        double y1 = (double)r.CurrentGroup.Value;
                        r.method_85();
                        double z1 = (double)r.CurrentGroup.Value;
                        valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.PointOrVector(x1, y1, z1));
                        r.method_85();
                        continue;

                    case 1011:
                        double x2 = (double)r.CurrentGroup.Value;
                        r.method_85();
                        double y2 = (double)r.CurrentGroup.Value;
                        r.method_85();
                        double z2 = (double)r.CurrentGroup.Value;
                        valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.WorldSpacePosition(x2, y2, z2));
                        r.method_85();
                        continue;

                    case 1012:
                        double x3 = (double)r.CurrentGroup.Value;
                        r.method_85();
                        double y3 = (double)r.CurrentGroup.Value;
                        r.method_85();
                        double z3 = (double)r.CurrentGroup.Value;
                        valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.WorldSpaceDisplacement(x3, y3, z3));
                        r.method_85();
                        continue;

                    case 1013:
                        currentGroup = r.CurrentGroup;
                        double x4 = (double)currentGroup.Value;
                        r.method_85();
                        currentGroup = r.CurrentGroup;
                        double y4 = (double)currentGroup.Value;
                        r.method_85();
                        currentGroup = r.CurrentGroup;
                        double z4 = (double)currentGroup.Value;
                        valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.WorldDirection(x4, y4, z4));
                        r.method_85();
                        continue;

                    case 1020:
                        double x5 = 0.0;
                        double y5 = (double)r.CurrentGroup.Value;
                        r.method_85();
                        double z5 = (double)r.CurrentGroup.Value;
                        valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.PointOrVector(x5, y5, z5));
                        r.method_85();
                        continue;

                    case 1021:
                        double x6 = 0.0;
                        double y6 = (double)r.CurrentGroup.Value;
                        r.method_85();
                        double z6 = (double)r.CurrentGroup.Value;
                        valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.WorldSpacePosition(x6, y6, z6));
                        r.method_85();
                        continue;

                    case 1022:
                        double x7 = 0.0;
                        double y7 = (double)r.CurrentGroup.Value;
                        r.method_85();
                        double z7 = (double)r.CurrentGroup.Value;
                        valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.WorldSpaceDisplacement(x7, y7, z7));
                        r.method_85();
                        continue;

                    case 1023:
                        double x8 = 0.0;
                        currentGroup = r.CurrentGroup;
                        double y8 = (double)currentGroup.Value;
                        r.method_85();
                        currentGroup = r.CurrentGroup;
                        double z8 = (double)currentGroup.Value;
                        valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.WorldDirection(x8, y8, z8));
                        r.method_85();
                        continue;

                    case 1040:
                        DxfExtendedData.ValueCollection valueCollection2 = valueCollection1;
                        currentGroup = r.CurrentGroup;
                        DxfExtendedData.Double @double = new DxfExtendedData.Double((double)currentGroup.Value);
                        valueCollection2.Add((IExtendedDataValue)@double);
                        r.method_85();
                        continue;

                    case 1041:
                        DxfExtendedData.ValueCollection valueCollection3 = valueCollection1;
                        currentGroup = r.CurrentGroup;
                        DxfExtendedData.Distance distance = new DxfExtendedData.Distance((double)currentGroup.Value);
                        valueCollection3.Add((IExtendedDataValue)distance);
                        r.method_85();
                        continue;

                    case 1042:
                        DxfExtendedData.ValueCollection valueCollection4 = valueCollection1;
                        currentGroup = r.CurrentGroup;
                        DxfExtendedData.ScaleFactor scaleFactor = new DxfExtendedData.ScaleFactor((double)currentGroup.Value);
                        valueCollection4.Add((IExtendedDataValue)scaleFactor);
                        r.method_85();
                        continue;

                    case 1070:
                        DxfExtendedData.ValueCollection valueCollection5 = valueCollection1;
                        currentGroup = r.CurrentGroup;
                        DxfExtendedData.Int16 int16 = new DxfExtendedData.Int16((short)currentGroup.Value);
                        valueCollection5.Add((IExtendedDataValue)int16);
                        r.method_85();
                        continue;

                    case 1071:
                        DxfExtendedData.ValueCollection valueCollection6 = valueCollection1;
                        currentGroup = r.CurrentGroup;
                        DxfExtendedData.Int32 int32 = new DxfExtendedData.Int32((int)currentGroup.Value);
                        valueCollection6.Add((IExtendedDataValue)int32);
                        r.method_85();
                        continue;

                    default:
                        flag1 = true;
                        continue;
                    }
                }
                if (flag3 && num1 == -1)
                {
                    DxfExtendedData.ValueCollection debracketized = new DxfExtendedData.ValueCollection();
                    int i = 0;
                    valueCollection1.method_0(debracketized, ref i);
                    valueCollection1 = debracketized;
                }
                return(valueCollection1);
            }