bool ossimLocalTm::loadXml(ossimRefPtr<ossimXmlNode> dateNode) { bool result = true; ossimRefPtr<ossimXmlNode> month = dateNode->findFirstNode("month"); ossimRefPtr<ossimXmlNode> day = dateNode->findFirstNode("day"); ossimRefPtr<ossimXmlNode> year = dateNode->findFirstNode("year"); ossimRefPtr<ossimXmlNode> hour = dateNode->findFirstNode("hour"); ossimRefPtr<ossimXmlNode> minutes = dateNode->findFirstNode("minutes"); ossimRefPtr<ossimXmlNode> seconds = dateNode->findFirstNode("seconds"); ossimRefPtr<ossimXmlNode> fractionalSecond = dateNode->findFirstNode("fractionalSecond"); ossimRefPtr<ossimXmlNode> julian = dateNode->findFirstNode("julian"); ossimRefPtr<ossimXmlNode> modifiedJulian = dateNode->findFirstNode("modifiedJulian"); if(month.valid()&& day.valid()&& year.valid()&& hour.valid()&& minutes.valid()&& seconds.valid()) { setMonth(month->getText().toInt32()); setDay(day->getText().toInt32()); setYear(year->getText().toInt32()); setHour(hour->getText().toInt32()); setMin(minutes->getText().toInt32()); setSec(seconds->getText().toInt32()); if(fractionalSecond.valid()) { setFractionalSecond(fractionalSecond->getText().toDouble()); } else { setFractionalSecond(0.0); } } else if(modifiedJulian.valid()) { setDateFromModifiedJulian(modifiedJulian->getText().toDouble()); } else if(julian.valid()) { setDateFromJulian(julian->getText().toDouble()); } else { result = false; } return result; }
void ossimLocalTm::addDays(ossim_float64 n) { setDateFromJulian(getJulian() + n); }
void ossimLocalTm::addHours(ossim_float64 n) { setDateFromJulian(getJulian() + (n/24.0)); }
void ossimLocalTm::addMinutes(ossim_float64 n) { setDateFromJulian(getJulian() + (n/1440.0)); }
void ossimLocalTm::addSeconds(ossim_float64 n) { // use julian to help in this addition. Julian is in days setDateFromJulian(getJulian() + (n/86400.0)); }
ossimLocalTm& ossimLocalTm::setDateFromModifiedJulian(double mjd) { setDateFromJulian(mjd + 2400000.5); return *this; }
void rspfLocalTm::addDays(rspf_float64 n) { setDateFromJulian(getJulian() + n); }
void rspfLocalTm::addHours(rspf_float64 n) { setDateFromJulian(getJulian() + (n/24.0)); }
void rspfLocalTm::addMinutes(rspf_float64 n) { setDateFromJulian(getJulian() + (n/1440.0)); }