Commit 8ce6fb69 authored by Stéphane Albert's avatar Stéphane Albert

ENH: Removed obsolete Dataset support.

parent 4280d8c8
......@@ -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
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -40,7 +40,6 @@
//
// Monteverdi includes (sorted by alphabetic order)
#include "mvdAlgorithm.h"
#include "mvdDatasetModel.h"
#include "mvdSystemError.h"
#include "mvdVectorImageModel.h"
......@@ -212,62 +211,6 @@ I18nCoreApplication
return imageModel;
}
/*****************************************************************************/
DatasetModel*
I18nCoreApplication
::LoadDatasetModel( const QString & imageFilename,
int width,
int height,
bool forceCreate )
{
// New model.
DatasetModel* model = new DatasetModel();
// Retrive path and name.
QString path;
QString name;
I18nCoreApplication::DatasetPathName( name, imageFilename );
qDebug() << "Dataset name:" << name;
QString pathname( QDir( path ).filePath( name ) );
// Setup QObject
model->setObjectName( pathname );
try
{
// try if the filename is valid
VectorImageModel::EnsureValidImage( imageFilename );
// get the basename from the filename to be used as an Alias
QFileInfo finfo( imageFilename );
// Build model (relink to cached data).
DatasetModel::BuildContext context(
path, name, finfo.baseName(), width, height, forceCreate
);
model->BuildModel( &context );
// Load image if DatasetModel is empty.
if( !model->HasSelectedImageModel() )
{
// Import image from filename given (w; h) size to choose
// best-fit resolution.
model->ImportImage( imageFilename, width, height );
}
}
catch( ... )
{
delete model;
model = NULL;
throw;
}
return model;
}
/*****************************************************************************/
void
I18nCoreApplication
......
......@@ -298,23 +298,6 @@ public:
int height,
QObject * parent =NULL );
/**
* \brief Load a DatasetModel from disk.
*
* \param imageFilename The input image filename.
* \param with The width (in pixels) of the screen best fit.
* \param height The height (in pixels) of the screen best fit.
* \param forceCreate true to force dataset creation even if there
* is already an existing non-empty dataset directory.
*
* \return The loaded DatasetModel instance or NULL if the method has failed.
*/
static
DatasetModel* LoadDatasetModel( const QString& imageFilename,
int width,
int height,
bool forceCreate );
/**
*/
static
......
......@@ -38,7 +38,6 @@
//
// Monteverdi includes (sorted by alphabetic order)
#include "mvdDatasetModel.h"
#include "mvdI18nCoreApplication.h"
#include "mvdVectorImageModel.h"
......@@ -66,23 +65,6 @@ namespace
/*****************************************************************************/
/* CLASS IMPLEMENTATION SECTION */
/*******************************************************************************/
ImageImporter
::ImageImporter( const QString& filename,
bool isForceCreateEnabled,
int width,
int height,
QObject* parent ) :
AbstractWorker( parent ),
m_Filename( filename ),
m_ModelType( DATASET ),
m_Width( width ),
m_Height( height ),
m_IsForceCreateEnabled( isForceCreateEnabled )
{
}
/*******************************************************************************/
ImageImporter
::ImageImporter( const QString& filename,
......@@ -126,13 +108,6 @@ ImageImporter
// Load model.
switch( m_ModelType )
{
case DATASET:
return
I18nCoreApplication::LoadDatasetModel(
m_Filename, m_Width, m_Height, m_IsForceCreateEnabled
);
break;
case IMAGE:
return
I18nCoreApplication::LoadImageModel(
......@@ -155,13 +130,6 @@ ImageImporter
{
switch( m_ModelType )
{
case DATASET:
return
tr( "Importing image '%1' as dataset into cache directory..." )
.arg( QFileInfo( m_Filename ).fileName()
);
break;
case IMAGE:
return
tr( "Loading image '%1'..." )
......
......@@ -162,7 +162,6 @@ protected:
private:
enum ModelType
{
DATASET,
IMAGE,
};
......
......@@ -39,7 +39,6 @@
//
// Monteverdi includes (sorted by alphabetic order)
#include "mvdDatasetModel.h"
#include "mvdI18nCoreApplication.h"
#include "mvdProcessObjectObserver.h"
#include "mvdVectorImageModel.h"
......
......@@ -75,27 +75,6 @@ QuicklookModel
{
}
/*****************************************************************************/
const DatasetModel*
QuicklookModel
::GetDatasetModel() const
{
return const_cast< QuicklookModel* >( this )->GetDatasetModel();
}
/*****************************************************************************/
DatasetModel*
QuicklookModel
::GetDatasetModel()
{
VectorImageModel* imageModel = GetImageModel< VectorImageModel >();
if( imageModel==NULL )
return NULL;
return imageModel->GetDatasetModel();
}
/*******************************************************************************/
void
QuicklookModel
......
......@@ -135,10 +135,6 @@ public:
//
// VectorImageModel overloads.
virtual const DatasetModel* GetDatasetModel() const;
virtual DatasetModel* GetDatasetModel();
/*-[ PUBLIC SLOTS SECTION ]------------------------------------------------*/
//
......
......@@ -86,24 +86,6 @@ VectorImageModel
{
}
/*****************************************************************************/
const DatasetModel*
VectorImageModel
::GetDatasetModel() const
{
// assert( GetParentModel()==GetParentModel< DatasetModel >() );
return GetParentModel< DatasetModel >();
}
/*****************************************************************************/
DatasetModel*
VectorImageModel
::GetDatasetModel()
{
// assert( GetParentModel()==GetParentModel< DatasetModel >() );
return GetParentModel< DatasetModel >();
}
/*****************************************************************************/
void
VectorImageModel
......@@ -575,20 +557,7 @@ VectorImageModel
{
assert( GetProperties()!=NULL );
DatasetModel* datasetModel = GetDatasetModel();
if( datasetModel==NULL )
RefreshHistogram( NULL );
else
{
HistogramModel::BuildContext context(
true, // Force writing new histogram-model.
datasetModel->HistogramFileInfo( GetFilename() ).filePath()
);
RefreshHistogram( &context );
}
RefreshHistogram( NULL );
}
/*****************************************************************************/
......
......@@ -116,20 +116,6 @@ public:
/** Destructor */
virtual ~VectorImageModel();
/**
* \brief Get the parent DatasetModel.
*
* \return The parent DatasetModel.
*/
virtual const DatasetModel* GetDatasetModel() const;
/**
* \brief Get the parent DatasetModel.
*
* \return The parent DatasetModel.
*/
virtual DatasetModel* GetDatasetModel();
/** */
static void EnsureValidImage( const QString& filename );
......@@ -348,9 +334,6 @@ private slots:
//
// Monteverdi 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
......
......@@ -12,9 +12,6 @@ set( Common_Gui_SOURCES
mvdColorDynamicsWidget.cxx
mvdColorSetupController.cxx
mvdColorSetupWidget.cxx
mvdDatasetCreationProgressDialog.cxx
mvdDatasetPropertiesController.cxx
mvdDatasetPropertiesWidget.cxx
mvdDoubleValidator.cxx
mvdDropLineEdit.cxx
mvdFilenameDragAndDropEventFilter.cxx
......@@ -64,9 +61,6 @@ set( Common_Gui_HEADERS_MOC
mvdColorDynamicsWidget.h
mvdColorSetupController.h
mvdColorSetupWidget.h
mvdDatasetCreationProgressDialog.h
mvdDatasetPropertiesController.h
mvdDatasetPropertiesWidget.h
mvdDoubleValidator.h
mvdDropLineEdit.h
mvdFilenameDragAndDropEventFilter.h
......@@ -108,8 +102,6 @@ set( Common_Gui_FORMS
mvdColorBandDynamicsWidget.ui
mvdColorDynamicsWidget.ui
mvdColorSetupWidget.ui
mvdDatasetCreationProgressDialog.ui
mvdDatasetPropertiesWidget.ui
mvdHistogramWidget.ui
mvdImportImagesDialog.ui
mvdImportSubDatasetDialog.ui
......
/*=========================================================================
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.
=========================================================================*/
#include "Gui/mvdDatasetCreationProgressDialog.h"
#include "Gui/ui_mvdDatasetCreationProgressDialog.h"
//
// Qt includes (sorted by alphabetic order)
//// Must be included before system/custom includes.
//
// System includes (sorted by alphabetic order)
//
// ITK includes (sorted by alphabetic order)
//
// OTB includes (sorted by alphabetic order)
//
// Monteverdi includes (sorted by alphabetic order)
namespace mvd
{
/*
TRANSLATOR mvd::DatasetCreationProgressDialog
Necessary for lupdate to be aware of C++ namespaces.
Context comment for translator.
*/
/*******************************************************************************/
DatasetCreationProgressDialog
::DatasetCreationProgressDialog( QWidget* parent ) :
QDialog( parent, Qt::CustomizeWindowHint | Qt::WindowTitleHint ),
m_UI( new mvd::Ui::DatasetCreationProgressDialog() )
{
m_UI->setupUi( this );
}
/*******************************************************************************/
DatasetCreationProgressDialog
::~DatasetCreationProgressDialog()
{
delete m_UI;
m_UI = NULL;
}
/*****************************************************************************/
QString
DatasetCreationProgressDialog
::GetImage( ) const
{
return m_UI->imageLabel->text();
}
/*****************************************************************************/
void
DatasetCreationProgressDialog
::SetImage(QString value)
{
m_UI->imageLabel->setText(value);
}
/*****************************************************************************/
QString
DatasetCreationProgressDialog
::GetDataset( ) const
{
return m_UI->datasetLabel->text();
}
/*****************************************************************************/
void
DatasetCreationProgressDialog
::SetDataset(QString value)
{
m_UI->datasetLabel->setText(value);
}
/*******************************************************************************/
/* SLOTS */
/*******************************************************************************/
/*******************************************************************************/
} // end namespace 'mvd'
/*=========================================================================
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 __mvdDatasetCreationProgressDialog_h
#define __mvdDatasetCreationProgressDialog_h
//
// Configuration include.
//// Included at first position before any other ones.
#include "ConfigureMonteverdi.h"
//
// Qt includes (sorted by alphabetic order)
//// Must be included before system/custom includes.
#include <QtGui>
//
// System includes (sorted by alphabetic order)
//
// ITK includes (sorted by alphabetic order)
//
// OTB includes (sorted by alphabetic order)
//
// Monteverdi includes (sorted by alphabetic order)
//
// External classes pre-declaration.
namespace
{
}
namespace mvd
{
//
// Internal classes pre-declaration.
namespace Ui
{
class DatasetCreationProgressDialog;
}
/** \class DatasetCreationProgressDialog
*
*/
class Monteverdi_EXPORT DatasetCreationProgressDialog :
public QDialog
{
Q_OBJECT;
//
// Public methods.
public:
/** Constructor */
DatasetCreationProgressDialog( QWidget* parent = NULL );
/** Destructor */
virtual ~DatasetCreationProgressDialog();
/** */
QString GetImage() const;
/** */
void SetImage( QString imageName );
/** */
QString GetDataset() const;
/** */
void SetDataset( QString datasetName );
//
// SIGNALS.
signals:
//
// Protected methods.
protected:
//
// Protected attributes.
protected:
//
// Private methods.
private:
//
// Private attributes.
private:
/**
*/
Ui::DatasetCreationProgressDialog* m_UI;
//
// SLOTS.
private slots:
};
} // end namespace 'mvd'
#endif // __mvdAboutDialog_h
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>mvd::DatasetCreationProgressDialog</class>
<widget class="QDialog" name="mvd::DatasetCreationProgressDialog">
<property name="windowModality">
<enum>Qt::ApplicationModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>318</width>
<height>157</height>
</rect>
</property>
<property name="maximumSize">
<size>
<width>600</width>
<height>16777215</height>
</size>
</property>
<property name="windowTitle">
<string>Please wait while processing...</string>
</property>
<property name="locale">
<locale language="C" country="AnyCountry"/>
</property>
<property name="sizeGripEnabled">
<bool>false</bool>
</property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_1">
<property name="text">
<string>Importing image:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="imageLabel">
<property name="minimumSize">
<size>
<width>300</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>/home/otbval/LargeInput/mvd2/dataset.ds</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>into dataset:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="datasetLabel">
<property name="minimumSize">
<size>
<width>300</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>/home/user/cache/mvd2/dataset.ds</string>
</property>
</widget>
</item>