/// <summary>
        /// Writes the value expressed as a <c>heightReference</c>, which is the height reference.
        /// </summary>
        /// <param name="value">The height reference.</param>
        public void WriteHeightReference(CesiumHeightReference value)
        {
            const string PropertyName = HeightReferencePropertyName;

            if (ForceInterval)
            {
                OpenIntervalIfNecessary();
            }
            if (IsInterval)
            {
                Output.WritePropertyName(PropertyName);
            }
            Output.WriteValue(CesiumFormattingHelper.HeightReferenceToString(value));
        }
예제 #2
0
        /// <summary>
        /// Converts a <see cref="CesiumHeightReference"/> to the corresponding string in a CZML stream.
        /// </summary>
        /// <param name="value">The value to convert.</param>
        /// <returns>The string representing the specified value.</returns>
        public static string HeightReferenceToString(CesiumHeightReference value)
        {
            switch (value)
            {
            case CesiumHeightReference.None:
                return("NONE");

            case CesiumHeightReference.ClampToGround:
                return("CLAMP_TO_GROUND");

            case CesiumHeightReference.RelativeToGround:
                return("RELATIVE_TO_GROUND");

            default:
                throw new ArgumentException(CesiumLocalization.UnknownEnumerationValue, "value");
            }
        }
예제 #3
0
        public void TestHeightReferenceProperties()
        {
            const double expectedExtrudedHeight = 10.0;
            const CesiumHeightReference expectedExtrudedHeightReference = CesiumHeightReference.RelativeToGround;

            using (Packet)
                using (var rectangle = Packet.OpenRectangleProperty())
                    using (var interval = rectangle.OpenInterval())
                    {
                        interval.WriteExtrudedHeightProperty(expectedExtrudedHeight);
                        interval.WriteExtrudedHeightReferenceProperty(expectedExtrudedHeightReference);
                    }

            AssertExpectedJson(PacketCesiumWriter.RectanglePropertyName, new Dictionary <string, object>
            {
                { RectangleCesiumWriter.ExtrudedHeightPropertyName, expectedExtrudedHeight },
                { RectangleCesiumWriter.ExtrudedHeightReferencePropertyName, CesiumFormattingHelper.HeightReferenceToString(expectedExtrudedHeightReference) },
            });
        }
        public void TestHeightReferenceToString(CesiumHeightReference value)
        {
            string s = CesiumFormattingHelper.HeightReferenceToString(value);

            Assert.IsNotNull(s);
        }
 /// <summary>
 /// Converts a <see cref="CesiumHeightReference"/> to the corresponding string in a CZML stream.
 /// </summary>
 /// <param name="value">The value to convert.</param>
 /// <returns>The string representing the specified value.</returns>
 public static string HeightReferenceToString(CesiumHeightReference value)
 {
     switch (value)
     {
         case CesiumHeightReference.None:
             return "NONE";
         case CesiumHeightReference.ClampToGround:
             return "CLAMP_TO_GROUND";
         case CesiumHeightReference.RelativeToGround:
             return "RELATIVE_TO_GROUND";
         default:
             throw new ArgumentException(CesiumLocalization.UnknownEnumerationValue, "value");
     }
 }