Exemple #1
0
        /// <summary>
        /// Writes the time-tagged <see cref="UnitQuaternion"/> collection as an array in
        /// [Time, X, Y, Z, W] order.
        /// Times are epoch seconds since an epoch that is determined from the first date to be written.
        /// The epoch property is written as well.
        /// </summary>
        /// <param name="output">The stream to which to write the array.</param>
        /// <param name="propertyName">The name of the property to write.</param>
        /// <param name="dates">The dates at which the value is specified.</param>
        /// <param name="values">The corresponding value for each date.</param>
        /// <param name="startIndex">The index of the first element to use in the <paramref name="values"/> collection.</param>
        /// <param name="length">The number of elements to use from the <paramref name="values"/> collection.</param>
        public static void WriteUnitQuaternion(CesiumOutputStream output, string propertyName, IList <JulianDate> dates, IList <UnitQuaternion> values, int startIndex, int length)
        {
            if (dates.Count != values.Count)
            {
                throw new ArgumentException(CesiumLocalization.MismatchedNumberOfDatesAndValues, "values");
            }

            JulianDate epoch = GetAndWriteEpoch(output, dates, startIndex, length);

            output.WritePropertyName(propertyName);
            output.WriteStartSequence();
            int last = startIndex + length;

            for (int i = startIndex; i < last; ++i)
            {
                output.WriteValue(epoch.SecondsDifference(dates[i]));
                UnitQuaternion quaternion = values[i];
                output.WriteValue(quaternion.X);
                output.WriteValue(quaternion.Y);
                output.WriteValue(quaternion.Z);
                output.WriteValue(quaternion.W);
                output.WriteLineBreak();
            }

            output.WriteEndSequence();
        }
Exemple #2
0
        /// <summary>
        /// Writes time-tagged <see cref="Cartographic"/> values as an array in [Time, Longitude, Latitude, Height] order.
        /// Times are epoch seconds since an epoch that is determined from the first date to be written.
        /// The epoch property is written as well.
        /// </summary>
        /// <param name="output">The stream to which to write the array.</param>
        /// <param name="propertyName">The name of the property to write.</param>
        /// <param name="dates">The dates at which the value is specified.</param>
        /// <param name="values">The corresponding value for each date.</param>
        /// <param name="startIndex">The index of the first element to use in the <paramref name="values"/> collection.</param>
        /// <param name="length">The number of elements to use from the <paramref name="values"/> collection.</param>
        public static void WriteCartographic(CesiumOutputStream output, string propertyName, IList <JulianDate> dates, IList <Cartographic> values, int startIndex, int length)
        {
            if (dates.Count != values.Count)
            {
                throw new ArgumentException(CesiumLocalization.MismatchedNumberOfDatesAndValues, "values");
            }

            JulianDate epoch = GetAndWriteEpoch(output, dates, startIndex, length);

            output.WritePropertyName(propertyName);
            output.WriteStartSequence();
            int last = startIndex + length;

            for (int i = startIndex; i < last; ++i)
            {
                output.WriteValue(epoch.SecondsDifference(dates[i]));
                Cartographic value = values[i];
                output.WriteValue(value.Longitude);
                output.WriteValue(value.Latitude);
                output.WriteValue(value.Height);
                output.WriteLineBreak();
            }

            output.WriteEndSequence();
        }
Exemple #3
0
        /// <summary>
        /// Writes time-tagged <see cref="Motion&lt;Cartesian&gt;"/> values as an array in [Time, X, Y, Z, vX, vY, vZ] order.
        /// Times are epoch seconds since an epoch that is determined from the first date to be written.
        /// The epoch property is written as well.
        /// </summary>
        /// <param name="output">The stream to which to write the array.</param>
        /// <param name="propertyName">The name of the property to write.</param>
        /// <param name="dates">The dates at which the value is specified.</param>
        /// <param name="values">The corresponding value for each date.</param>
        /// <param name="startIndex">The index of the first element to use in the <paramref name="values"/> collection.</param>
        /// <param name="length">The number of elements to use from the <paramref name="values"/> collection.</param>
        public static void WriteCartesian3Velocity(CesiumOutputStream output, string propertyName, IList <JulianDate> dates, IList <Motion <Cartesian> > values, int startIndex, int length)
        {
            if (dates.Count != values.Count)
            {
                throw new ArgumentException(CesiumLocalization.MismatchedNumberOfDatesAndValues, "values");
            }

            JulianDate epoch = GetAndWriteEpoch(output, dates, startIndex, length);

            output.WritePropertyName(propertyName);
            output.WriteStartSequence();
            int last = startIndex + length;

            for (int i = startIndex; i < last; ++i)
            {
                output.WriteValue(epoch.SecondsDifference(dates[i]));
                Cartesian value    = values[i].Value;
                Cartesian velocity = values[i].FirstDerivative;
                output.WriteValue(value.X);
                output.WriteValue(value.Y);
                output.WriteValue(value.Z);
                output.WriteValue(velocity.X);
                output.WriteValue(velocity.Y);
                output.WriteValue(velocity.Z);
                output.WriteLineBreak();
            }

            output.WriteEndSequence();
        }
Exemple #4
0
 /// <summary>
 /// Writes a list of references.
 /// </summary>
 /// <param name="output">The stream to which to write.</param>
 /// <param name="references">The list of references to write.</param>
 public static void WriteReferences(CesiumOutputStream output, IEnumerable <string> references)
 {
     output.WriteStartSequence();
     foreach (string reference in references)
     {
         output.WriteValue(reference);
         output.WriteLineBreak();
     }
     output.WriteEndSequence();
 }
        /// <summary>
        /// Writes time-tagged <see cref="BoundingRectangle"/> values as an array in [Time, Clock, Cone, Magnitude] order.
        /// Times are epoch seconds since an epoch that is determined from the first date to be written.
        /// The epoch property is written as well.
        /// </summary>
        /// <param name="output">The stream to which to write the array.</param>
        /// <param name="propertyName">The name of the property to write.</param>
        /// <param name="dates">The dates at which the value is specified.</param>
        /// <param name="values">The corresponding value for each date.</param>
        /// <param name="startIndex">The index of the first element to use in the <paramref name="values"/> collection.</param>
        /// <param name="length">The number of elements to use from the <paramref name="values"/> collection.</param>
        public static void WriteBoundingRectangle(CesiumOutputStream output, string propertyName, IList<JulianDate> dates, IList<BoundingRectangle> values, int startIndex, int length)
        {
            if (dates.Count != values.Count)
                throw new ArgumentException(CesiumLocalization.MismatchedNumberOfDatesAndValues, "values");

            JulianDate epoch = GetAndWriteEpoch(output, dates, startIndex, length);

            output.WritePropertyName(propertyName);
            output.WriteStartSequence();
            int last = startIndex + length;
            for (int i = startIndex; i < last; ++i)
            {
                output.WriteValue(epoch.SecondsDifference(dates[i]));
                BoundingRectangle value = values[i];
                output.WriteValue(value.Left);
                output.WriteValue(value.Bottom);
                output.WriteValue(value.Width);
                output.WriteValue(value.Height);
                output.WriteLineBreak();
            }

            output.WriteEndSequence();
        }
        /// <summary>
        /// Writes the time-tagged <see cref="UnitQuaternion"/> collection as an array in
        /// [Time, X, Y, Z, W] order.
        /// Times are epoch seconds since an epoch that is determined from the first date to be written.
        /// The epoch property is written as well.
        /// </summary>
        /// <param name="output">The stream to which to write the array.</param>
        /// <param name="propertyName">The name of the property to write.</param>
        /// <param name="dates">The dates at which the value is specified.</param>
        /// <param name="values">The corresponding value for each date.</param>
        /// <param name="startIndex">The index of the first element to use in the <paramref name="values"/> collection.</param>
        /// <param name="length">The number of elements to use from the <paramref name="values"/> collection.</param>
        public static void WriteUnitQuaternion(CesiumOutputStream output, string propertyName, IList<JulianDate> dates, IList<UnitQuaternion> values, int startIndex, int length)
        {
            if (dates.Count != values.Count)
                throw new ArgumentException(CesiumLocalization.MismatchedNumberOfDatesAndValues, "values");

            JulianDate epoch = GetAndWriteEpoch(output, dates, startIndex, length);

            output.WritePropertyName(propertyName);
            output.WriteStartSequence();
            int last = startIndex + length;
            for (int i = startIndex; i < last; ++i)
            {
                output.WriteValue(epoch.SecondsDifference(dates[i]));
                UnitQuaternion quaternion = values[i];
                output.WriteValue(quaternion.X);
                output.WriteValue(quaternion.Y);
                output.WriteValue(quaternion.Z);
                output.WriteValue(quaternion.W);
                output.WriteLineBreak();
            }

            output.WriteEndSequence();
        }
        /// <summary>
        /// Writes time-tagged <see cref="Motion&lt;Cartesian&gt;"/> values as an array in [Time, X, Y, Z, vX, vY, vZ] order.
        /// Times are epoch seconds since an epoch that is determined from the first date to be written.
        /// The epoch property is written as well.
        /// </summary>
        /// <param name="output">The stream to which to write the array.</param>
        /// <param name="propertyName">The name of the property to write.</param>
        /// <param name="dates">The dates at which the value is specified.</param>
        /// <param name="values">The corresponding value for each date.</param>
        /// <param name="startIndex">The index of the first element to use in the <paramref name="values"/> collection.</param>
        /// <param name="length">The number of elements to use from the <paramref name="values"/> collection.</param>
        public static void WriteCartesian3Velocity(CesiumOutputStream output, string propertyName, IList<JulianDate> dates, IList<Motion<Cartesian>> values, int startIndex, int length)
        {
            if (dates.Count != values.Count)
                throw new ArgumentException(CesiumLocalization.MismatchedNumberOfDatesAndValues, "values");

            JulianDate epoch = GetAndWriteEpoch(output, dates, startIndex, length);

            output.WritePropertyName(propertyName);
            output.WriteStartSequence();
            int last = startIndex + length;
            for (int i = startIndex; i < last; ++i)
            {
                output.WriteValue(epoch.SecondsDifference(dates[i]));
                Cartesian value = values[i].Value;
                Cartesian velocity = values[i].FirstDerivative;
                output.WriteValue(value.X);
                output.WriteValue(value.Y);
                output.WriteValue(value.Z);
                output.WriteValue(velocity.X);
                output.WriteValue(velocity.Y);
                output.WriteValue(velocity.Z);
                output.WriteLineBreak();
            }

            output.WriteEndSequence();
        }
 /// <summary>
 /// Writes a list of references.
 /// </summary>
 /// <param name="output">The stream to which to write.</param>
 /// <param name="references">The list of references to write.</param>
 public static void WriteReferences(CesiumOutputStream output, IEnumerable<string> references)
 {
     output.WriteStartSequence();
     foreach (string reference in references)
     {
         output.WriteValue(reference);
         output.WriteLineBreak();
     }
     output.WriteEndSequence();
 }
        /// <summary>
        /// Writes time-tagged <see cref="CartographicExtent"/> values as an array in [Time, WestLongitude, SouthLatitude, EastLongitude, NorthLatitude] order.
        /// Times are epoch seconds since an epoch that is determined from the first date to be written.
        /// The epoch property is written as well.
        /// </summary>
        /// <param name="output">The stream to which to write the array.</param>
        /// <param name="propertyName">The name of the property to write.</param>
        /// <param name="dates">The dates at which the value is specified.</param>
        /// <param name="values">The corresponding value for each date.</param>
        /// <param name="startIndex">The index of the first element to use in the <paramref name="values"/> collection.</param>
        /// <param name="length">The number of elements to use from the <paramref name="values"/> collection.</param>
        public static void WriteCartographicExtent(CesiumOutputStream output, string propertyName, IList<JulianDate> dates, IList<CartographicExtent> values, int startIndex, int length)
        {
            if (dates.Count != values.Count)
                throw new ArgumentException(CesiumLocalization.MismatchedNumberOfDatesAndValues, "values");

            JulianDate epoch = GetAndWriteEpoch(output, dates, startIndex, length);

            output.WritePropertyName(propertyName);
            output.WriteStartSequence();
            int last = startIndex + length;
            for (int i = startIndex; i < last; ++i)
            {
                output.WriteValue(epoch.SecondsDifference(dates[i]));
                CartographicExtent value = values[i];
                output.WriteValue(value.WestLongitude);
                output.WriteValue(value.SouthLatitude);
                output.WriteValue(value.EastLongitude);
                output.WriteValue(value.NorthLatitude);
                output.WriteLineBreak();
            }

            output.WriteEndSequence();
        }