AnalyticalGraphicsInc/cesium — pull request #97 by mramato (2012-07-09 21:09:54+00:00)
Title: Refactor JulianDate to always store components as TAI

This pull request addresses issue #85 by always storing interval values for JulianDate as TAI. We still accept UTC input but convert in the constructor. This removes the need for conversion from UTC when performing arithmetic, which in turn removes a lot of potential human error when using JulianDate that can result in rare exceptions and extremely poor performance.

If a user needs the UTC representation of a date, they can simply call toDate() to get the JavaScript Date equivalent or call getUtcMinusTai to determine the offset.

1. This change also removes the circular dependencies between LeapSecond/TimeStandard/JulianDate.

2. TimeStandard no longer exposes public conversion functions as they are no longer needed and are now private to JulianDate.

3. Default LeapSeconds are now loaded in JulianDate as opposed to LeapSecond.js to avoid another circular depedancy.

4. LeapSeconds are now defined in TAI as opposed to UTC since LeapSeconds are needed to convert to TAI for UTC input.

5. Some tests needed to be updated because they relied on internal UTC values that are now stored as TAI.

I have not refactored the JulianDate API to be mutable and consistent with other Core type yet. I didn't want to lump API changes in with the more arithmetic heavy changes in this pull. I'll work on those right after this is merged.