Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Main Repositories
otb
Commits
8ce6fb69
Commit
8ce6fb69
authored
Jul 11, 2016
by
Stéphane Albert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: Removed obsolete Dataset support.
parent
4280d8c8
Changes
26
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
1 addition
and
4500 deletions
+1
-4500
Code/Common/Core/CMakeLists.txt
Code/Common/Core/CMakeLists.txt
+0
-4
Code/Common/Core/mvdDatasetDescriptor.cxx
Code/Common/Core/mvdDatasetDescriptor.cxx
+0
-983
Code/Common/Core/mvdDatasetDescriptor.h
Code/Common/Core/mvdDatasetDescriptor.h
+0
-637
Code/Common/Core/mvdDatasetModel.cxx
Code/Common/Core/mvdDatasetModel.cxx
+0
-984
Code/Common/Core/mvdDatasetModel.h
Code/Common/Core/mvdDatasetModel.h
+0
-628
Code/Common/Core/mvdI18nCoreApplication.cxx
Code/Common/Core/mvdI18nCoreApplication.cxx
+0
-57
Code/Common/Core/mvdI18nCoreApplication.h
Code/Common/Core/mvdI18nCoreApplication.h
+0
-17
Code/Common/Core/mvdImageImporter.cxx
Code/Common/Core/mvdImageImporter.cxx
+0
-32
Code/Common/Core/mvdImageImporter.h
Code/Common/Core/mvdImageImporter.h
+0
-1
Code/Common/Core/mvdOverviewBuilder.cxx
Code/Common/Core/mvdOverviewBuilder.cxx
+0
-1
Code/Common/Core/mvdQuicklookModel.cxx
Code/Common/Core/mvdQuicklookModel.cxx
+0
-21
Code/Common/Core/mvdQuicklookModel.h
Code/Common/Core/mvdQuicklookModel.h
+0
-4
Code/Common/Core/mvdVectorImageModel.cxx
Code/Common/Core/mvdVectorImageModel.cxx
+1
-32
Code/Common/Core/mvdVectorImageModel.h
Code/Common/Core/mvdVectorImageModel.h
+0
-17
Code/Common/Gui/CMakeLists.txt
Code/Common/Gui/CMakeLists.txt
+0
-8
Code/Common/Gui/mvdDatasetCreationProgressDialog.cxx
Code/Common/Gui/mvdDatasetCreationProgressDialog.cxx
+0
-105
Code/Common/Gui/mvdDatasetCreationProgressDialog.h
Code/Common/Gui/mvdDatasetCreationProgressDialog.h
+0
-119
Code/Common/Gui/mvdDatasetCreationProgressDialog.ui
Code/Common/Gui/mvdDatasetCreationProgressDialog.ui
+0
-105
Code/Common/Gui/mvdDatasetPropertiesController.cxx
Code/Common/Gui/mvdDatasetPropertiesController.cxx
+0
-174
Code/Common/Gui/mvdDatasetPropertiesController.h
Code/Common/Gui/mvdDatasetPropertiesController.h
+0
-162
Code/Common/Gui/mvdDatasetPropertiesWidget.cxx
Code/Common/Gui/mvdDatasetPropertiesWidget.cxx
+0
-158
Code/Common/Gui/mvdDatasetPropertiesWidget.h
Code/Common/Gui/mvdDatasetPropertiesWidget.h
+0
-165
Code/Common/Gui/mvdDatasetPropertiesWidget.ui
Code/Common/Gui/mvdDatasetPropertiesWidget.ui
+0
-53
Code/Common/Gui/mvdI18nMainWindow.cxx
Code/Common/Gui/mvdI18nMainWindow.cxx
+0
-24
Code/Common/Gui/mvdI18nMainWindow.h
Code/Common/Gui/mvdI18nMainWindow.h
+0
-8
Code/Common/Gui/mvdQuicklookViewRenderer.cxx
Code/Common/Gui/mvdQuicklookViewRenderer.cxx
+0
-1
No files found.
Code/Common/Core/CMakeLists.txt
View file @
8ce6fb69
...
...
@@ -9,9 +9,7 @@ set( Common_Core_SOURCES
mvdAbstractWorker.cxx
mvdBackgroundTask.cxx
mvdCore.cxx
mvdDatasetDescriptor.cxx
mvdDataStream.cxx
mvdDatasetModel.cxx
mvdFilenameInterface.cxx
mvdHistogramModel.cxx
mvdI18nCoreApplication.cxx
...
...
@@ -47,8 +45,6 @@ set( Common_Core_HEADERS_MOC
# mvdAlgorithm.h
mvdBackgroundTask.h
# mvdCore.h
mvdDatasetDescriptor.h
mvdDatasetModel.h
mvdHistogramModel.h
mvdI18nCoreApplication.h
mvdImageImporter.h
...
...
Code/Common/Core/mvdDatasetDescriptor.cxx
deleted
100644 → 0
View file @
4280d8c8
This diff is collapsed.
Click to expand it.
Code/Common/Core/mvdDatasetDescriptor.h
deleted
100644 → 0
View file @
4280d8c8
/*=========================================================================
Program: Monteverdi
Language: C++
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See Copyright.txt for details.
Monteverdi is distributed under the CeCILL licence version 2. See
Licence_CeCILL_V2-en.txt or
http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt for more 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 __mvdDatasetDescriptor_h
#define __mvdDatasetDescriptor_h
//
// Configuration include.
//// Included at first position before any other ones.
#ifndef Q_MOC_RUN // See: https://bugreports.qt-project.org/browse/QTBUG-22829 //tag=QT4-boost-compatibility
#include "ConfigureMonteverdi.h"
#endif //tag=QT4-boost-compatibility
/*****************************************************************************/
/* INCLUDE SECTION */
//
// Qt includes (sorted by alphabetic order)
//// Must be included before system/custom includes.
#include <QtXml>
//
// System includes (sorted by alphabetic order)
//
// ITK includes (sorted by alphabetic order)
//
// OTB includes (sorted by alphabetic order)
//
// Monteverdi includes (sorted by alphabetic order)
#ifndef Q_MOC_RUN // See: https://bugreports.qt-project.org/browse/QTBUG-22829 //tag=QT4-boost-compatibility
#include "mvdCore.h"
#include "mvdAbstractModel.h"
#include "mvdAlgorithm.h"
#include "mvdSerializableInterface.h"
#endif //tag=QT4-boost-compatibility
/*****************************************************************************/
/* PRE-DECLARATION SECTION */
//
// External classes pre-declaration.
namespace
{
}
namespace
mvd
{
//
// Internal classes pre-declaration.
class
AbstractImageModel
;
class
ImageProperties
;
/*****************************************************************************/
/* CLASS DEFINITION SECTION */
/**
* \class DatasetDescriptor.
*
* \brief WIP.
*/
class
Monteverdi_EXPORT
DatasetDescriptor
:
public
AbstractModel
,
private
SerializableInterface
{
/*-[ QOBJECT SECTION ]-----------------------------------------------------*/
Q_OBJECT
;
/*-[ PUBLIC SECTION ]------------------------------------------------------*/
//
// Public types.
public:
/**
* \class BuildContext
* \brief WIP.
*/
class
BuildContext
{
//
// Public methods.
public:
BuildContext
(
const
QString
&
filename
)
:
m_Filename
(
filename
)
{
}
//
// Public attributes
public:
QString
m_Filename
;
};
//
// Public methods.
public:
//
// Static methods.
/**
*/
static
inline
bool
IsVersionCompliant
(
const
QString
&
filename
);
//
// Instance methods.
/** \brief Constructor. */
DatasetDescriptor
(
QObject
*
parent
=
NULL
);
/** \brief Destructor. */
virtual
~
DatasetDescriptor
();
/**
*/
inline
QString
GetVersionString
()
const
;
/**
*/
inline
QDateTime
GetDate
()
const
;
/**
*/
void
InsertImageModel
(
int
id
,
const
QString
&
imageFilename
,
const
QString
&
placename
,
const
void
*
imageSettings
,
const
QString
&
quicklookFilename
,
const
QString
&
histogramFilename
,
const
ImageProperties
*
properties
);
/**
*/
inline
QDomElement
FirstImageElement
();
/**
*/
inline
QDomElement
FirstDatasetElement
();
/**
*/
inline
QDomElement
FirstImageViewContextElement
();
/**
*/
static
inline
QDomElement
NextImageSiblingElement
(
const
QDomElement
&
sibling
);
/**
*/
static
void
GetImageModel
(
const
QDomElement
&
imageSibling
,
int
&
id
,
QString
&
filename
,
void
*
settings
,
QString
&
quicklookFilename
,
QString
&
histogramFilename
,
ImageProperties
*
imageProperties
);
/**
*/
static
void
GetDatasetInformation
(
const
QDomElement
&
datasetSibling
,
QString
&
datasetPath
,
QString
&
datasetAlias
);
/**
*/
static
void
GetRenderingImageInformation
(
const
QDomElement
&
datasetSibling
,
PointType
&
center
,
double
&
zoom
);
/**
*/
static
void
GetImagePlacename
(
const
QDomElement
&
datasetSibling
,
QString
&
placename
);
/**
*/
bool
SetImageModelSettings
(
int
id
,
const
void
*
settings
);
/**
*/
bool
SetImageModelProperties
(
int
id
,
const
ImageProperties
*
properties
);
bool
UpdateDatasetAlias
(
const
QString
&
newAlias
);
bool
UpdateViewContext
(
const
PointType
&
center
,
double
zoom
);
bool
UpdateImagePlacename
(
const
QString
&
nplacename
);
/**
*/
inline
void
Write
(
const
QString
&
filename
)
const
;
/*-[ SIGNALS SECTION ]-----------------------------------------------------*/
//
// Signals.
signals:
/*-[ PROTECTED SECTION ]---------------------------------------------------*/
//
// Protected methods.
protected:
//
// AbstractModel overrides.
/** */
virtual
void
virtual_BuildModel
(
void
*
context
=
NULL
);
//
// Protected attributes.
protected:
/*-[ PRIVATE SECTION ]-----------------------------------------------------*/
//
// Private methods.
private:
/**
* \brief Serialize an STL-compliant container to a QString
*/
template
<
typename
TInputIterator
>
inline
static
QString
ContainerToString
(
const
TInputIterator
&
first
,
const
TInputIterator
&
last
);
/**
* \brief Create a QDomElement containing specified text as child
*/
inline
QDomElement
CreateTextNode
(
const
QString
&
text
,
const
QString
&
tagName
);
/**
* \brief Deserialize a std::vector from a QDomElement
*/
template
<
typename
T
>
inline
static
void
ExtractVectorFromElement
(
std
::
vector
<
T
>&
vector
,
QDomElement
&
tagName
);
/**
* \brief Deserialize a itk::Array from a QDomElement
*/
template
<
typename
T
>
inline
static
void
ExtractArrayFromElement
(
itk
::
Array
<
T
>&
array
,
QDomElement
&
tagName
);
/**
*/
inline
QDomElement
GetImageElement
(
int
id
);
/**
*/
void
BuildDocument
();
/**
*/
inline
void
Read
(
const
QString
&
filename
);
/**
*/
inline
QDomElement
OptionalElement
(
const
char
*
name
,
QDomElement
&
parent
);
//
// SerializableInterface overrides.
//
using
SerializableInterface
::
Read
;
using
SerializableInterface
::
Write
;
virtual
void
virtual_Read
(
QIODevice
*
device
);
virtual
void
virtual_Write
(
QIODevice
&
device
)
const
;
//
// Private attributes.
private:
/**
*/
enum
Element
{
ELEMENT_DOCUMENT_ROOT
=
0
,
//
ELEMENT_DATASET_GROUP
,
ELEMENT_DATASET_NAME
,
ELEMENT_DATASET_ALIAS
,
ELEMENT_DATASET_DATE
,
// ELEMENT_DATASET_PATH,
// ELEMENT_DATASET_DIRECTORY,
//
ELEMENT_IMAGES_GROUP
,
ELEMENT_IMAGE_INFORMATION
,
ELEMENT_IMAGE_PLACENAME
,
ELEMENT_IMAGE
,
ELEMENT_QUICKLOOK
,
ELEMENT_HISTOGRAM
,
//
ELEMENT_SETTINGS_GROUP
,
ELEMENT_RGB_CHANNELS
,
ELEMENT_GRAYSCALE
,
ELEMENT_RGB_DYNAMICS_PARAMETERS
,
ELEMENT_W_DYNAMICS_PARAMETERS
,
ELEMENT_GAMMA
,
//
ELEMENT_PROPERTIES_GROUP
,
ELEMENT_PROPERTIES_NO_DATA
,
//
ELEMENT_VIEW_GROUP
,
ELEMENT_VIEW_CENTER
,
ELEMENT_VIEW_ZOOM
,
//
ELEMENT_COUNT
};
/**
*/
static
const
char
*
TAG_NAMES
[
ELEMENT_COUNT
];
/**
*/
QDomDocument
m_DomDocument
;
/**
*/
QDomElement
m_RootElement
;
/**
*/
QDomElement
m_DatasetGroupElement
;
/**
*/
QDomElement
m_ImagesGroupElement
;
/**
*/
QDomElement
m_ImageViewGroupElement
;
/*-[ PRIVATE SLOTS SECTION ]-----------------------------------------------*/
//
// Slots.
private
slots
:
};
}
// end namespace 'mvd'
/*****************************************************************************/
/* INLINE SECTION */
//
// Monteverdi deferred includes (sorted by alphabetic order)
#ifndef Q_MOC_RUN // See: https://bugreports.qt-project.org/browse/QTBUG-22829 //tag=QT4-boost-compatibility
#include "mvdDatasetModel.h"
#endif //tag=QT4-boost-compatibility
namespace
mvd
{
/*****************************************************************************/
inline
bool
DatasetDescriptor
::
IsVersionCompliant
(
const
QString
&
filename
)
{
// qDebug()
// << "DatasetDescriptor::IsVersionCompliant(" << filename << ")";
DatasetDescriptor
descriptor
;
descriptor
.
Read
(
filename
);
qDebug
()
<<
filename
<<
" version "
<<
descriptor
.
GetVersionString
();
return
!
descriptor
.
GetVersionString
().
isEmpty
()
&&
IsVersionGreaterEqual
(
descriptor
.
GetVersionString
(),
Monteverdi_DATA_VERSION_STRING
);
}
/*****************************************************************************/
inline
QString
DatasetDescriptor
::
GetVersionString
()
const
{
assert
(
!
m_RootElement
.
isNull
()
);
return
m_RootElement
.
attribute
(
"version"
);
}
/*****************************************************************************/
QDateTime
DatasetDescriptor
::
GetDate
()
const
{
assert
(
!
m_DatasetGroupElement
.
isNull
()
);
QDomElement
dateElt
(
m_DatasetGroupElement
.
firstChildElement
(
TAG_NAMES
[
ELEMENT_DATASET_DATE
]
)
);
assert
(
!
dateElt
.
isNull
()
);
return
QDateTime
::
fromString
(
dateElt
.
text
(),
"yyyy-MM-ddThh:mm:ss.zzz"
);
}
/*****************************************************************************/
inline
void
DatasetDescriptor
::
Read
(
const
QString
&
filename
)
{
Read
(
filename
,
SerializableInterface
::
MODE_TEXT
);
}
/*****************************************************************************/
inline
void
DatasetDescriptor
::
Write
(
const
QString
&
filename
)
const
{
Write
(
filename
,
SerializableInterface
::
MODE_TEXT
);
}
/*****************************************************************************/
inline
QDomElement
DatasetDescriptor
::
FirstImageElement
()
{
return
m_ImagesGroupElement
.
firstChildElement
(
TAG_NAMES
[
ELEMENT_IMAGE_INFORMATION
]
);
}
/*****************************************************************************/
inline
QDomElement
DatasetDescriptor
::
FirstDatasetElement
()
{
return
m_DatasetGroupElement
;
}
/*****************************************************************************/
inline
QDomElement
DatasetDescriptor
::
FirstImageViewContextElement
()
{
return
m_ImageViewGroupElement
;
}
/*****************************************************************************/
inline
QDomElement
DatasetDescriptor
::
GetImageElement
(
int
id
)
{
QDomElement
imageElt
;
for
(
imageElt
=
FirstImageElement
();
!
imageElt
.
isNull
()
&&
imageElt
.
attribute
(
"id"
).
toInt
()
!=
id
;
imageElt
=
DatasetDescriptor
::
NextImageSiblingElement
(
imageElt
)
);
return
imageElt
;
}
/*****************************************************************************/
inline
QDomElement
DatasetDescriptor
::
NextImageSiblingElement
(
const
QDomElement
&
sibling
)
{
return
sibling
.
nextSiblingElement
(
TAG_NAMES
[
ELEMENT_IMAGE_INFORMATION
]
);
}
/*****************************************************************************/
template
<
typename
TInputIterator
>
inline
QString
DatasetDescriptor
::
ContainerToString
(
const
TInputIterator
&
first
,
const
TInputIterator
&
last
)
{
QStringList
stringList
;
for
(
TInputIterator
it
(
first
);
it
!=
last
;
++
it
)
{
stringList
.
append
(
ToQString
(
*
it
)
);
}
return
stringList
.
join
(
" "
);
}
/*****************************************************************************/
inline
QDomElement
DatasetDescriptor
::
CreateTextNode
(
const
QString
&
text
,
const
QString
&
tagName
)
{
assert
(
!
tagName
.
isEmpty
()
);
QDomElement
vectorElement
(
m_DomDocument
.
createElement
(
tagName
)
);
assert
(
!
vectorElement
.
isNull
()
);
QDomText
textNode
(
m_DomDocument
.
createTextNode
(
text
)
);
assert
(
!
textNode
.
isNull
()
);
vectorElement
.
appendChild
(
textNode
);
return
vectorElement
;
}
/*****************************************************************************/
template
<
typename
T
>
inline
void
DatasetDescriptor
::
ExtractVectorFromElement
(
std
::
vector
<
T
>&
vector
,
QDomElement
&
element
)
{
QDomNode
node
=
element
.
firstChild
();
// TODO: Manage XML structure errors.
assert
(
!
node
.
isNull
()
);
assert
(
node
.
isText
()
);
QDomText
textNode
=
node
.
toText
();
assert
(
!
textNode
.
isNull
()
);
QString
data
=
textNode
.
data
();
QStringList
stringList
=
data
.
split
(
" "
);
size_t
size
=
static_cast
<
size_t
>
(
stringList
.
size
());
vector
.
resize
(
size
);
for
(
size_t
i
=
0
;
i
<
size
;
++
i
)
{
QVariant
v
=
stringList
[
i
];
vector
[
i
]
=
v
.
value
<
T
>
();
}
}
/*****************************************************************************/
template
<
typename
T
>
inline
void
DatasetDescriptor
::
ExtractArrayFromElement
(
itk
::
Array
<
T
>&
array
,
QDomElement
&
element
)
{
QDomNode
node
=
element
.
firstChild
();
// TODO: Manage XML structure errors.
assert
(
!
node
.
isNull
()
);
assert
(
node
.
isText
()
);
QDomText
textNode
=
node
.
toText
();
assert
(
!
textNode
.
isNull
()
);