Ejemplo n.º 1
0
 public RegAppTable Read(BinaryReader br)
 {
     // read each field
     Ehdr           = new Elm_hdr().Read(br);
     ComponentCount = br.ReadUInt32();
     Linkages       = V8Linkages.V8GetLinkages(br, Ehdr);
     return(this);
 }
Ejemplo n.º 2
0
 public ExtendedNonGraphicElm Read(BinaryReader br)
 {
     // read each field
     Ehdr           = new Elm_hdr().Read(br);
     ComponentCount = br.ReadUInt32();
     Padding        = br.ReadUInt32();
     Linkages       = V8Linkages.V8GetLinkages(br, Ehdr);
     return(this);
 }
Ejemplo n.º 3
0
 public LevelTable Read(BinaryReader br)
 {
     // read each field
     Ehdr           = new Elm_hdr().Read(br);
     ComponentCount = br.ReadUInt32();
     Dummy1         = br.ReadUInt32();
     ElementId      = br.ReadUInt64();
     Linkages       = V8Linkages.V8GetLinkages(br, Ehdr);
     return(this);
 }
Ejemplo n.º 4
0
 public FilterTable Read(BinaryReader br)
 {
     // read each field
     Ehdr           = new Elm_hdr().Read(br);
     ComponentCount = br.ReadUInt32();
     Dummy1         = br.ReadUInt32();
     ActiveFilterId = br.ReadInt32();
     Dummy2         = br.ReadUInt32();
     Linkages       = V8Linkages.V8GetLinkages(br, Ehdr);
     return(this);
 }
Ejemplo n.º 5
0
 public FilterTableElm Read(BinaryReader br)
 {
     // read each field
     Ehdr           = new Elm_hdr().Read(br);
     FilterId       = br.ReadUInt32();
     ParentFilterId = br.ReadUInt32();
     Dummy1         = br.ReadUInt16();
     FilterType     = br.ReadUInt16();
     Dummy2         = br.ReadUInt32();
     Linkages       = V8Linkages.V8GetLinkages(br, Ehdr);
     return(this);
 }
Ejemplo n.º 6
0
        public ViewGroupElm Read(BinaryReader br)
        {
            // read each field
            Ehdr           = new Elm_hdr().Read(br);
            ComponentCount = br.ReadUInt32();
            //Views = new


            Linkages    = V8Linkages.V8GetLinkages(br, Ehdr);
            Name        = V8Linkages.V8GetStringLinkage(Linkages, LinkageKeyValuesString.STRING_LINKAGE_KEY_Name);
            Description = V8Linkages.V8GetStringLinkage(Linkages, LinkageKeyValuesString.STRING_LINKAGE_KEY_Description);
            return(this);
        }
Ejemplo n.º 7
0
 public FontTableElm Read(BinaryReader br)
 {
     // read each field
     Ehdr       = new Elm_hdr().Read(br);
     Dummy1     = br.ReadUInt32();
     Dummy2     = br.ReadUInt32();
     FontNumber = br.ReadUInt32();
     NameLength = br.ReadUInt16();
     NameBytes  = br.ReadBytes(NameLength);
     FontName   = Encoding.Unicode.GetString(NameBytes);
     Linkages   = V8Linkages.V8GetLinkages(br, Ehdr);
     return(this);
 }
Ejemplo n.º 8
0
 public LevelTableElm Read(BinaryReader br)
 {
     // read each field
     Ehdr             = new Elm_hdr().Read(br);
     LevelId          = br.ReadUInt32();
     ParentId         = br.ReadUInt32();
     Dummy1           = br.ReadUInt32();
     Dummy2           = br.ReadUInt32();
     Linkages         = V8Linkages.V8GetLinkages(br, Ehdr);
     LevelName        = V8Linkages.V8GetStringLinkage(Linkages, LinkageKeyValuesString.STRING_LINKAGE_KEY_Name);
     LevelDescription = V8Linkages.V8GetStringLinkage(Linkages, LinkageKeyValuesString.STRING_LINKAGE_KEY_Description);
     return(this);
 }
Ejemplo n.º 9
0
        public static ModelInfo V8GetModelInfoFromCache(DgnCache cache)
        {
            var modelInfo  = new ModelInfo();
            var modelCache = cache.ModelCache;

            using MemoryStream ms = new(modelCache.Bytes);
            using BinaryReader br = new(ms);

            // what are bytes (ints) at 0x00, 0x04, 0x08 ???
            ms.Seek(0x1004, SeekOrigin.Begin);
            var modelHeaderElm = new ModelHeaderElm().Read(br);

            modelInfo.ModelId          = cache.ModelNum;
            modelInfo.ModelName        = V8Linkages.V8GetStringLinkage(modelHeaderElm.Linkages, LinkageKeyValuesString.STRING_LINKAGE_KEY_Name);
            modelInfo.ModelDescription = V8Linkages.V8GetStringLinkage(modelHeaderElm.Linkages, LinkageKeyValuesString.STRING_LINKAGE_KEY_Description);
            modelInfo.MasterUnit       = new UnitInfo
            {
                Numerator   = modelHeaderElm.MuNumerator,
                Denominator = modelHeaderElm.MuDenominator,
                Flags       = new UnitFlags
                {
                },
                Label = V8Linkages.V8GetStringLinkage(modelHeaderElm.Linkages, LinkageKeyValuesString.STRING_LINKAGE_KEY_MastUnitLabel)
            };
            modelInfo.SubUnit = new UnitInfo
            {
                Numerator   = modelHeaderElm.SuNumerator,
                Denominator = modelHeaderElm.SuDenominator,
                Flags       = new UnitFlags
                {
                },
                Label = V8Linkages.V8GetStringLinkage(modelHeaderElm.Linkages, LinkageKeyValuesString.STRING_LINKAGE_KEY_SubUnitLabel)
            };
            modelInfo.StorageUnit = new UnitInfo
            {
                Numerator   = modelHeaderElm.StNumerator,
                Denominator = modelHeaderElm.StDenominator,
                Flags       = new UnitFlags
                {
                },
                //Label =
            };
            modelInfo.UorPerSub                 = modelHeaderElm.UorsPerStorage * (modelHeaderElm.StNumerator / modelHeaderElm.StDenominator) / (modelHeaderElm.SuNumerator / modelHeaderElm.SuDenominator);
            modelInfo.UorPerStorage             = modelHeaderElm.UorsPerStorage;
            modelInfo.UorPerMaster              = modelHeaderElm.UorsPerStorage * (modelHeaderElm.StNumerator / modelHeaderElm.StDenominator) / (modelHeaderElm.MuNumerator / modelHeaderElm.MuDenominator);
            modelInfo.SubPerMaster              = (modelHeaderElm.SuNumerator / modelHeaderElm.SuDenominator) / (modelHeaderElm.MuNumerator / modelHeaderElm.MuDenominator);
            modelInfo.LastModified              = modelHeaderElm.LastModified;
            modelInfo.GlobalOrigin              = modelHeaderElm.GlobalOrigin;
            modelInfo.GridPerRefernce           = modelHeaderElm.GridPerReference;
            modelInfo.UorPerGrid                = modelHeaderElm.Z15;
            modelInfo.GridRatio                 = modelHeaderElm.Z16;
            modelInfo.ModelType                 = (int)(modelHeaderElm.Dummy1 & 0xFFFF0000) >> 16;
            modelInfo.DgnModelType              = (DgnModelType)(modelInfo.ModelType);
            modelInfo.AcsOrigin.X               = modelHeaderElm.Z2;
            modelInfo.AcsOrigin.Y               = modelHeaderElm.Z3;
            modelInfo.AcsOrigin.Z               = modelHeaderElm.Z4;
            modelInfo.AcsRotMatrix.Form3d       = new double[3, 3];
            modelInfo.AcsRotMatrix.Form3d[0, 0] = modelHeaderElm.Z5;
            modelInfo.AcsRotMatrix.Form3d[0, 1] = modelHeaderElm.Z6;
            modelInfo.AcsRotMatrix.Form3d[0, 2] = modelHeaderElm.Z7;
            modelInfo.AcsRotMatrix.Form3d[1, 0] = modelHeaderElm.Z8;
            modelInfo.AcsRotMatrix.Form3d[1, 1] = modelHeaderElm.Z9;
            modelInfo.AcsRotMatrix.Form3d[1, 2] = modelHeaderElm.Z10;
            modelInfo.AcsRotMatrix.Form3d[2, 0] = modelHeaderElm.Z11;
            modelInfo.AcsRotMatrix.Form3d[2, 1] = modelHeaderElm.Z12;
            modelInfo.AcsRotMatrix.Form3d[2, 2] = modelHeaderElm.Z13;

            modelInfo.Rng.Xlowlim  = modelHeaderElm.Y0;
            modelInfo.Rng.Ylowlim  = modelHeaderElm.Y1;
            modelInfo.Rng.Zlowlim  = modelHeaderElm.Y2;
            modelInfo.Rng.Xhighlim = modelHeaderElm.Y3;
            modelInfo.Rng.Yhighlim = modelHeaderElm.Y4;
            modelInfo.Rng.Zhighlim = modelHeaderElm.Y5;
            return(modelInfo);
        }
Ejemplo n.º 10
0
 public ModelHeaderElm Read(BinaryReader br)
 {
     // read each field
     Ehdr             = new Elm_hdr().Read(br);
     Dummy1           = br.ReadUInt32();
     Dummy2           = br.ReadUInt32();
     Dummy3           = br.ReadUInt32();
     Dummy4           = br.ReadUInt32();
     Dummy5           = br.ReadUInt32();
     Dummy6           = br.ReadUInt32();
     Dummy7           = br.ReadUInt32();
     GridPerReference = br.ReadUInt32();
     Dummy9           = br.ReadUInt32();
     Dummy10          = br.ReadUInt32();
     Dummy11          = br.ReadUInt32();
     Dummy12          = br.ReadUInt32();
     MuNumerator      = br.ReadDouble();
     MuDenominator    = br.ReadDouble();
     SuNumerator      = br.ReadDouble();
     SuDenominator    = br.ReadDouble();
     GlobalOrigin     = new DPoint3d().Read(br);
     LastModified     = br.ReadDouble();
     Y0             = br.ReadInt64();
     Y1             = br.ReadInt64();
     Y2             = br.ReadInt64();
     Y3             = br.ReadInt64();
     Y4             = br.ReadInt64();
     Y5             = br.ReadInt64();
     Y6             = br.ReadInt64();
     Y7             = br.ReadInt64();
     Y8             = br.ReadInt64();
     Y9             = br.ReadInt64();
     UorsPerStorage = br.ReadDouble();
     StNumerator    = br.ReadDouble();
     StDenominator  = br.ReadDouble();
     Z0             = br.ReadDouble();
     Z1             = br.ReadDouble();
     Z2             = br.ReadDouble();
     Z3             = br.ReadDouble();
     Z4             = br.ReadDouble();
     Z5             = br.ReadDouble();
     Z6             = br.ReadDouble();
     Z7             = br.ReadDouble();
     Z8             = br.ReadDouble();
     Z9             = br.ReadDouble();
     Z10            = br.ReadDouble();
     Z11            = br.ReadDouble();
     Z12            = br.ReadDouble();
     Z13            = br.ReadDouble();
     Z14            = br.ReadDouble();
     Z15            = br.ReadDouble();
     Z16            = br.ReadDouble();
     Z17            = br.ReadDouble();
     Z18            = br.ReadDouble();
     Z19            = br.ReadDouble();
     Z20            = br.ReadDouble();
     Z21            = br.ReadDouble();
     Z22            = br.ReadDouble();
     Z23            = br.ReadDouble();
     Z24            = br.ReadDouble();
     Z25            = br.ReadDouble();
     Z26            = br.ReadDouble();
     Z27            = br.ReadDouble();
     Z28            = br.ReadDouble();
     Z29            = br.ReadDouble();
     Z30            = br.ReadDouble();
     Linkages       = V8Linkages.V8GetLinkages(br, Ehdr);
     return(this);
 }
Ejemplo n.º 11
0
        public TestStyleTableElm Read(BinaryReader br)
        {
            // read each field
            Ehdr                = new Elm_hdr().Read(br);
            StyleId             = br.ReadUInt64();         // 0x20
            FontNumber          = br.ReadUInt32();         // 0x28
            Dummy1              = br.ReadUInt32();         // 0x2c
            Width               = br.ReadDouble();         // 0x30
            Height              = br.ReadDouble();         // 0x38
            Slant               = br.ReadDouble();         // 0x40
            LineSpacing         = br.ReadDouble();         // 0x48
            InterCharSpacing    = br.ReadDouble();         // 0x50
            UnderlineOffset     = br.ReadDouble();         // 0x58
            OverlineOffset      = br.ReadDouble();         // 0x60
            Dummy2              = br.ReadDouble();         // 0x68
            LineOffset          = new DPoint2d().Read(br); // 0x70
            Justification       = br.ReadUInt16();         // 0x80
            Dummy8              = br.ReadUInt16();         // 0x82
            LineLength          = br.ReadUInt16();         // 0x84
            Dummy9              = br.ReadUInt16();         // 0x86
            Dummy10             = br.ReadUInt16();         // 0x88
            Dummy11             = br.ReadUInt16();         // 0x8a
            BackgroudWeight     = br.ReadInt32();          // 0x8c
            BackgroudColor      = br.ReadInt32();          // 0x90
            BackgroudFillColor  = br.ReadInt32();          // 0x94
            BackgroundBorder    = new DPoint2d().Read(br); // 0x98
            UnderlineStyle      = br.ReadInt32();          // 0xa8
            UnderlineWeight     = br.ReadUInt32();         // 0xac
            UnderlineColor      = br.ReadUInt32();         // 0xb0
            OverlineStyle       = br.ReadInt32();          // 0xb4
            OverlineWeight      = br.ReadUInt32();         // 0xb8
            OverlineColor       = br.ReadUInt32();         // 0xbc
            Dummy4              = br.ReadUInt32();         // 0xc0
            Dummy5              = br.ReadUInt32();         // 0xc4
            Dummy6              = br.ReadUInt32();         // 0xc8
            Dummy7              = br.ReadUInt32();         // 0xcc
            ColorIndex          = br.ReadUInt32();         // 0xd0
            Dummy12             = br.ReadUInt32();         // 0xd4
            Dummy13             = br.ReadUInt32();         // 0xd8
            Dummy14             = br.ReadUInt32();         // 0xdc
            Dummy15             = br.ReadUInt32();         // 0xe0
            Dummy16             = br.ReadUInt32();         // 0xe4
            TextStyleNameLength = br.ReadUInt16();         // 0xe8
            var namePosition = br.BaseStream.Position;
            var Data         = br.ReadBytes(TextStyleNameLength);

            if ((TextStyleNameLength >= 4) && (Data[0] == 0xff) && (Data[1] == 0xfe) && (Data[2] == 0x01) && (Data[3] == 0x00))
            {
                // skip UTF32 LE BOM
                br.BaseStream.Seek(namePosition + 4, SeekOrigin.Begin);
                TextStyleNameLength -= 4;
            }
            else
            {
                br.BaseStream.Seek(namePosition, SeekOrigin.Begin);
            }

            TextStyleName = System.Text.Encoding.UTF8.GetString(br.ReadBytes(TextStyleNameLength));
            Linkages      = V8Linkages.V8GetLinkages(br, Ehdr);
            return(this);
        }