Example #1
0
        /// <summary>
        /// Serializes content from the writer
        /// </summary>
        public override void InternalFromBinary(IBinaryRawReader reader)
        {
            base.InternalFromBinary(reader);

            var messageVersion = VersionSerializationHelper.CheckVersionsByte(reader, VERSION_NUMBERS);

            if (messageVersion >= 1)
            {
                Mode = (DisplayMode)reader.ReadInt();

                if (reader.ReadBoolean())
                {
                    Palette = TileRenderRequestArgumentPaletteFactory.GetPalette(Mode);
                    Palette.FromBinary(reader);
                }

                if (reader.ReadBoolean())
                {
                    Extents = new BoundingWorldExtent3D();
                    Extents.FromBinary(reader);
                }

                CoordsAreGrid = reader.ReadBoolean();
                PixelsX       = (ushort)reader.ReadInt();
                PixelsY       = (ushort)reader.ReadInt();
            }

            if (messageVersion >= 2)
            {
                VolumeType = (VolumeComputationType)reader.ReadByte();
            }
        }
Example #2
0
        public void FromToBinary()
        {
            var cp1    = new BoundingWorldExtent3D(1, 2, 3, 4, 5, 6);
            var writer = new TestBinaryWriter();

            cp1.ToBinary(writer);

            var cp2 = new BoundingWorldExtent3D();

            cp2.FromBinary(new TestBinaryReader(writer._stream.BaseStream as MemoryStream));

            cp1.Should().BeEquivalentTo(cp2);
        }
Example #3
0
        /// <summary>
        /// Serialises content from the writer
        /// </summary>
        public override void InternalFromBinary(IBinaryRawReader reader)
        {
            base.InternalFromBinary(reader);

            var version = VersionSerializationHelper.CheckVersionByte(reader, VERSION_NUMBER);

            if (version == 1)
            {
                CellSize     = reader.ReadDouble();
                MinElevation = reader.ReadDouble();
                MaxElevation = reader.ReadDouble();
                CellsUsed    = reader.ReadInt();
                CellsScanned = reader.ReadInt();

                if (reader.ReadBoolean())
                {
                    BoundingExtents = new BoundingWorldExtent3D();
                    BoundingExtents.FromBinary(reader);
                }
            }
        }
Example #4
0
        public override void InternalFromBinary(IBinaryRawReader reader)
        {
            var version = VersionSerializationHelper.CheckVersionByte(reader, VERSION_NUMBER);

            if (version == 1)
            {
                ID               = reader.ReadGuid() ?? Guid.Empty;
                CreationDate     = DateTime.FromBinary(reader.ReadLong());
                LastModifiedDate = DateTime.FromBinary(reader.ReadLong());

                if (reader.ReadBoolean())
                {
                    SiteModelExtent = new BoundingWorldExtent3D();
                    SiteModelExtent.FromBinary(reader);
                }

                MachineCount         = reader.ReadInt();
                DesignCount          = reader.ReadInt();
                SurveyedSurfaceCount = reader.ReadInt();
                AlignmentCount       = reader.ReadInt();
            }
        }