Exemplo n.º 1
0
        public void TestVerticalOriginToString(CesiumVerticalOrigin value)
        {
            string s = CesiumFormattingHelper.VerticalOriginToString(value);

            Assert.IsNotNull(s);
        }
Exemplo n.º 2
0
        public void TestClockStepToString(ClockStep value)
        {
            string s = CesiumFormattingHelper.ClockStepToString(value);

            Assert.IsNotNull(s);
        }
Exemplo n.º 3
0
        public void TestShadowModeToString(CesiumShadowMode value)
        {
            string s = CesiumFormattingHelper.ShadowModeToString(value);

            Assert.IsNotNull(s);
        }
Exemplo n.º 4
0
        public void TestStripeOrientationToString(CesiumStripeOrientation value)
        {
            string s = CesiumFormattingHelper.StripeOrientationToString(value);

            Assert.IsNotNull(s);
        }
Exemplo n.º 5
0
        public void TestLabelStyleToString(CesiumLabelStyle value)
        {
            string s = CesiumFormattingHelper.LabelStyleToString(value);

            Assert.IsNotNull(s);
        }
Exemplo n.º 6
0
        public void TestSensorVolumePortionToDisplayToString(CesiumSensorVolumePortionToDisplay value)
        {
            string s = CesiumFormattingHelper.SensorVolumePortionToDisplayToString(value);

            Assert.IsNotNull(s);
        }
Exemplo n.º 7
0
        public void TestInterpolationAlgorithmToString(CesiumInterpolationAlgorithm value)
        {
            string s = CesiumFormattingHelper.InterpolationAlgorithmToString(value);

            Assert.IsNotNull(s);
        }
Exemplo n.º 8
0
        public void TestShowPropertyInterval()
        {
            var startDate = new GregorianDate(2012, 4, 2, 12, 0, 0).ToJulianDate();
            var stopDate  = new GregorianDate(2012, 4, 2, 12, 1, 0).ToJulianDate();

            var interval1Start = startDate;
            var interval1Stop  = startDate.AddSeconds(1);
            var interval2Start = interval1Stop;
            var interval2Stop  = startDate.AddSeconds(2);
            var interval3Start = interval2Stop;
            var interval3Stop  = stopDate;

            const bool interval1Value = true;
            const bool interval2Value = false;
            const bool interval3Value = true;

            using (Packet)
                using (var polygon = Packet.OpenPolygonProperty())
                    using (var show = polygon.OpenShowProperty())
                        using (var showIntervals = show.OpenMultipleIntervals())
                        {
                            using (var interval = showIntervals.OpenInterval(interval1Start, interval1Stop))
                            {
                                interval.WriteBoolean(interval1Value);
                            }

                            using (var interval = showIntervals.OpenInterval(interval2Start, interval2Stop))
                            {
                                interval.WriteBoolean(interval2Value);
                            }

                            using (var interval = showIntervals.OpenInterval(interval3Start, interval3Stop))
                            {
                                interval.WriteBoolean(interval3Value);
                            }
                        }

            AssertExpectedJson(PacketCesiumWriter.PolygonPropertyName, new Dictionary <string, object>
            {
                {
                    PolygonCesiumWriter.ShowPropertyName, new List <Dictionary <string, object> >
                    {
                        new Dictionary <string, object>
                        {
                            { "interval", CesiumFormattingHelper.ToIso8601Interval(interval1Start, interval1Stop, Iso8601Format.Compact) },
                            { "boolean", interval1Value }
                        },
                        new Dictionary <string, object>
                        {
                            { "interval", CesiumFormattingHelper.ToIso8601Interval(interval2Start, interval2Stop, Iso8601Format.Compact) },
                            { "boolean", interval2Value }
                        },
                        new Dictionary <string, object>
                        {
                            { "interval", CesiumFormattingHelper.ToIso8601Interval(interval3Start, interval3Stop, Iso8601Format.Compact) },
                            { "boolean", interval3Value }
                        },
                    }
                },
            });
        }
Exemplo n.º 9
0
        public void TestWriteStripeMaterial()
        {
            var          expectedEvenColor = Color.Red;
            var          expectedOddColor  = Color.Blue;
            const double expectedOffset    = 1.5;
            const CesiumStripeOrientation expectedOrientation = CesiumStripeOrientation.Vertical;
            const double expectedRepeat = 3.5;

            using (Packet)
                using (var polyline = Packet.OpenPolylineProperty())
                    using (var material = polyline.OpenMaterialProperty())
                        using (var stripeMaterial = material.OpenStripeProperty())
                        {
                            stripeMaterial.WriteEvenColorProperty(expectedEvenColor);
                            stripeMaterial.WriteOddColorProperty(expectedOddColor);
                            stripeMaterial.WriteOffsetProperty(expectedOffset);
                            stripeMaterial.WriteOrientationProperty(expectedOrientation);
                            stripeMaterial.WriteRepeatProperty(expectedRepeat);
                        }

            AssertExpectedJson(PacketCesiumWriter.PolylinePropertyName, new Dictionary <string, object>
            {
                {
                    PolylineCesiumWriter.MaterialPropertyName, new Dictionary <string, object>
                    {
                        {
                            PolylineMaterialCesiumWriter.StripePropertyName, new Dictionary <string, object>
                            {
                                { StripeMaterialCesiumWriter.EvenColorPropertyName, expectedEvenColor },
                                { StripeMaterialCesiumWriter.OddColorPropertyName, expectedOddColor },
                                { StripeMaterialCesiumWriter.OffsetPropertyName, expectedOffset },
                                { StripeMaterialCesiumWriter.OrientationPropertyName, CesiumFormattingHelper.StripeOrientationToString(expectedOrientation) },
                                { StripeMaterialCesiumWriter.RepeatPropertyName, expectedRepeat },
                            }
                        },
                    }
                },
            });
        }
Exemplo n.º 10
0
        /// <summary>
        /// Create a CZML resource from a stream.  The data will
        /// be embedded in the CZML document using a data URI.
        /// </summary>
        /// <param name="stream">The stream containing data to write.</param>
        /// <param name="mimeType">The mime type of the data.</param>
        /// <returns>A new <see cref="CesiumResource"/> containing the data as a data URI.</returns>
        public static CesiumResource FromStream(Stream stream, string mimeType)
        {
            string dataUri = CesiumFormattingHelper.StreamToDataUri(stream, mimeType);

            return(new CesiumResource(dataUri, CesiumResourceBehavior.Embed));
        }
Exemplo n.º 11
0
        /// <summary>
        /// Create a CZML resource from a stream containing image data.  The image data will
        /// be embedded in the CZML document using a data URI.
        /// </summary>
        /// <param name="stream">The stream containing image data to write.</param>
        /// <param name="imageFormat">The format of the image.</param>
        /// <returns>A new <see cref="CesiumResource"/> containing the image data as a data URI.</returns>
        public static CesiumResource FromStream(Stream stream, CesiumImageFormat imageFormat)
        {
            string dataUri = CesiumFormattingHelper.ImageToDataUri(stream, imageFormat);

            return(new CesiumResource(dataUri, CesiumResourceBehavior.Embed));
        }