Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main Repositories
otb
Commits
1ad704ea
Commit
1ad704ea
authored
10 years ago
by
Guillaume Pasero
Browse files
Options
Downloads
Patches
Plain Diff
ADD: adapter for ossimLocalTm class
parent
4c2ebf53
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/UtilitiesAdapters/OssimAdapters/otbDateTimeAdapter.cxx
+88
-0
88 additions, 0 deletions
Code/UtilitiesAdapters/OssimAdapters/otbDateTimeAdapter.cxx
Code/UtilitiesAdapters/OssimAdapters/otbDateTimeAdapter.h
+96
-0
96 additions, 0 deletions
Code/UtilitiesAdapters/OssimAdapters/otbDateTimeAdapter.h
with
184 additions
and
0 deletions
Code/UtilitiesAdapters/OssimAdapters/otbDateTimeAdapter.cxx
0 → 100644
+
88
−
0
View file @
1ad704ea
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include
"otbDateTimeAdapter.h"
#include
"ossim/base/ossimDate.h"
namespace
otb
{
DateTimeAdapter
::
DateTimeAdapter
()
{
m_LocalTm
=
new
ossimLocalTm
(
0
);
}
DateTimeAdapter
::~
DateTimeAdapter
()
{
if
(
m_LocalTm
!=
NULL
)
{
delete
m_LocalTm
;
}
}
int
DateTimeAdapter
::
GetYear
()
{
return
m_LocalTm
->
getYear
();
}
int
DateTimeAdapter
::
GetMonth
()
{
return
m_LocalTm
->
getMonth
();
}
int
DateTimeAdapter
::
GetDay
()
{
return
m_LocalTm
->
getDay
();
}
int
DateTimeAdapter
::
GetHour
()
{
return
m_LocalTm
->
getHour
();
}
int
DateTimeAdapter
::
GetMinute
()
{
return
m_LocalTm
->
getMin
();
}
double
DateTimeAdapter
::
GetSeconds
()
{
return
static_cast
<
double
>
(
m_LocalTm
->
getSec
())
+
m_LocalTm
->
getFractionalSecond
();
}
bool
DateTimeAdapter
::
SetFromIso8601
(
const
std
::
string
&
date
)
{
return
m_LocalTm
->
setIso8601
(
date
);
}
double
DateTimeAdapter
::
GetDeltaInSeconds
(
const
DateTimeAdapter
*
pastDate
)
{
return
m_LocalTm
->
deltaInSeconds
(
*
(
pastDate
->
m_LocalTm
));
}
}
// namespace otb
This diff is collapsed.
Click to expand it.
Code/UtilitiesAdapters/OssimAdapters/otbDateTimeAdapter.h
0 → 100644
+
96
−
0
View file @
1ad704ea
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __otbDateTimeAdapter_h
#define __otbDateTimeAdapter_h
#include
"itkObject.h"
#include
"itkObjectFactory.h"
class
ossimLocalTm
;
//class ossimDate;
//class ossimTime;
namespace
otb
{
/** \class DateTimeAdapter
* \brief This is a dummy class to the ossimLocalTm class
*
* This class provide functions to define, compare and measure times and dates.
*
**/
class
DateTimeAdapter
:
public
itk
::
Object
{
public:
/** Standard class typedefs. */
typedef
DateTimeAdapter
Self
;
typedef
itk
::
Object
Superclass
;
typedef
itk
::
SmartPointer
<
Self
>
Pointer
;
typedef
itk
::
SmartPointer
<
const
Self
>
ConstPointer
;
/** Method for creation through the object factory. */
itkNewMacro
(
Self
);
/** Run-time type information (and related methods). */
itkTypeMacro
(
DateTimeAdapter
,
itk
::
Object
);
/** Year Accessor*/
int
GetYear
();
/** Month Accessor*/
int
GetMonth
();
/** Day Accessor*/
int
GetDay
();
/** Hour Accessor*/
int
GetHour
();
/** Minute Accessor*/
int
GetMinute
();
/** Seconds Accessor*/
double
GetSeconds
();
/** Set the date and time from an Iso8601 string
* Return true if the date is valid
*/
bool
SetFromIso8601
(
const
std
::
string
&
date
);
/** Return the delta with an other date, expressed in seconds */
double
GetDeltaInSeconds
(
const
DateTimeAdapter
*
pastDate
);
// TODO : add print self function
protected:
DateTimeAdapter
();
virtual
~
DateTimeAdapter
();
private:
DateTimeAdapter
(
const
Self
&
);
//purposely not implemented
void
operator
=
(
const
Self
&
);
//purposely not implemented
ossimLocalTm
*
m_LocalTm
;
};
// TODO add extern '<<' function
}
// namespace otb
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment