Exemple #1
0
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;
}
Exemple #2
0
void ossimLocalTm::addDays(ossim_float64 n)
{
   setDateFromJulian(getJulian() + n);
}
Exemple #3
0
void ossimLocalTm::addHours(ossim_float64 n)
{
   setDateFromJulian(getJulian() + (n/24.0));
}
Exemple #4
0
void ossimLocalTm::addMinutes(ossim_float64 n)
{
   setDateFromJulian(getJulian() + (n/1440.0));
}
Exemple #5
0
void ossimLocalTm::addSeconds(ossim_float64 n)
{
   // use julian to help in this addition.  Julian is in days
   setDateFromJulian(getJulian() + (n/86400.0));
}
Exemple #6
0
ossimLocalTm& ossimLocalTm::setDateFromModifiedJulian(double mjd)
{
   setDateFromJulian(mjd + 2400000.5);

   return *this;
}
Exemple #7
0
void rspfLocalTm::addDays(rspf_float64 n)
{
   setDateFromJulian(getJulian() + n);
}
Exemple #8
0
void rspfLocalTm::addHours(rspf_float64 n)
{
   setDateFromJulian(getJulian() + (n/24.0));
}
Exemple #9
0
void rspfLocalTm::addMinutes(rspf_float64 n)
{
   setDateFromJulian(getJulian() + (n/1440.0));
}