Commit a659b669 authored by Stéphane Albert's avatar Stéphane Albert

Backed out changeset eea2eaf1b972

parent c67f3829
......@@ -62,7 +62,7 @@ namespace mvd
/*******************************************************************************/
Application
::Application( int& argc, char** argv ) :
core::I18nApplication( argc, argv )
I18nApplication( argc, argv )
{
InitializeCore();
}
......
......@@ -68,7 +68,7 @@ namespace mvd
*
*/
class Monteverdi2_EXPORT Application
: public core::I18nApplication
: public I18nApplication
{
/*-[ QOBJECT SECTION ]-----------------------------------------------------*/
......
......@@ -89,13 +89,13 @@ Application
}
/*****************************************************************************/
core::DatasetModel*
DatasetModel*
Application::LoadDatasetModel( const QString& imageFilename,
int width,
int height )
{
// New model.
core::DatasetModel* model = new core::DatasetModel();
DatasetModel* model = new DatasetModel();
// Retrive path and name.
QString path;
......@@ -111,9 +111,9 @@ Application::LoadDatasetModel( const QString& imageFilename,
try
{
// try if the filename is valid
core::VectorImageModel::EnsureValidImage(imageFilename);
VectorImageModel::EnsureValidImage(imageFilename);
// Build model (relink to cached data).
core::DatasetModel::BuildContext context( path, name, width, height );
DatasetModel::BuildContext context( path, name, width, height );
model->BuildModel( &context );
// Load image if DatasetModel is empty.
......@@ -142,7 +142,7 @@ Application::LoadDatasetModel( const QString& imageFilename,
/*******************************************************************************/
Application
::Application( int& argc, char** argv ) :
core::I18nApplication( argc, argv ),
I18nApplication( argc, argv ),
m_Model( NULL )
{
InitializeCore();
......@@ -164,7 +164,7 @@ Application
/*******************************************************************************/
void
Application
::SetModel( core::AbstractModel* model )
::SetModel( AbstractModel* model )
{
emit AboutToChangeSelectedModel( model );
......
......@@ -58,14 +58,10 @@ namespace
namespace mvd
{
namespace core
{
//
// Class declaration.
class AbstractModel;
class DatasetModel;
}
/*****************************************************************************/
/* CLASS DEFINITION SECTION */
......@@ -74,7 +70,7 @@ class DatasetModel;
*
*/
class Monteverdi2_EXPORT Application
: public core::I18nApplication
: public I18nApplication
{
/*-[ QOBJECT SECTION ]-----------------------------------------------------*/
......@@ -105,11 +101,11 @@ public:
/**
*/
inline const core::AbstractModel* GetModel() const;
inline const AbstractModel* GetModel() const;
/**
*/
inline core::AbstractModel* GetModel();
inline AbstractModel* GetModel();
/**
*/
......@@ -165,7 +161,7 @@ public:
/**
*/
static
core::DatasetModel* LoadDatasetModel( const QString& imageFilename,
DatasetModel* LoadDatasetModel( const QString& imageFilename,
int width,
int height );
......@@ -175,7 +171,7 @@ public slots:
*/
// Method could be inline but it's better not new/delete in inline
// methods (heap and memory-alignment contexts).
void SetModel( core::AbstractModel* model );
void SetModel( AbstractModel* model );
/*-[ SIGNALS SECTION ]-----------------------------------------------------*/
......@@ -184,11 +180,11 @@ public slots:
signals:
/**
*/
void AboutToChangeSelectedModel( const core::AbstractModel* );
void AboutToChangeSelectedModel( const AbstractModel* );
/**
*/
void SelectedModelChanged( core::AbstractModel* );
void SelectedModelChanged( AbstractModel* );
/*-[ PROTECTED SECTION ]---------------------------------------------------*/
......@@ -219,7 +215,7 @@ private:
/**
*/
core::AbstractModel* m_Model;
AbstractModel* m_Model;
/*-[ PRIVATE SLOTS SECTION ]-----------------------------------------------*/
......@@ -240,7 +236,7 @@ Application*
Application
::Instance()
{
return core::I18nApplication::Instance< Application >();
return I18nApplication::Instance< Application >();
}
/*****************************************************************************/
......@@ -249,12 +245,12 @@ const Application*
Application
::ConstInstance()
{
return core::I18nApplication::ConstInstance< Application >();
return I18nApplication::ConstInstance< Application >();
}
/*****************************************************************************/
inline
const core::AbstractModel*
const AbstractModel*
Application
::GetModel() const
{
......@@ -263,7 +259,7 @@ Application
/*****************************************************************************/
inline
core::AbstractModel*
AbstractModel*
Application
::GetModel()
{
......
......@@ -66,7 +66,7 @@ ImageLoader
try
{
core::DatasetModel* model = Application::LoadDatasetModel(
DatasetModel* model = Application::LoadDatasetModel(
m_Filename, m_Width, m_Height );
// We can only push to another thread,
......
......@@ -51,12 +51,9 @@ namespace
namespace mvd
{
namespace core
{
//
// Internal class pre-declaration.
class AbstractModel;
}
/*****************************************************************************/
/* CLASS DEFINITION SECTION */
......@@ -83,7 +80,7 @@ public slots:
signals:
/** \brief Triggered after model is ready */
void ModelLoaded( core::AbstractModel* );
void ModelLoaded( AbstractModel* );
/** \brief Triggered when processing is finished */
void Finished();
......
......@@ -180,17 +180,8 @@ MainWindow
// Connect centralWidget manipulator to Ql renderer when viewportRegionChanged
QObject::connect(
m_ImageViewManipulator,
SIGNAL(
ViewportRegionRepresentationChanged( const core::PointType&,
const core::PointType& )
),
// to:
m_QLModelRenderer,
SLOT(
OnViewportRegionRepresentationChanged( const core::PointType&,
const core::PointType& )
)
m_ImageViewManipulator, SIGNAL( ViewportRegionRepresentationChanged(const PointType&, const PointType&) ),
m_QLModelRenderer, SLOT( OnViewportRegionRepresentationChanged(const PointType&, const PointType&) )
);
// Connect ql mousePressEventpressed to centralWidget manipulator
......@@ -208,15 +199,15 @@ MainWindow
// Connect Appllication and MainWindow when selected model is about
// to change.
QObject::connect(
qApp, SIGNAL( AboutToChangeSelectedModel( const core::AbstractModel* ) ),
this, SLOT( OnAboutToChangeSelectedModel( const core::AbstractModel* ) )
qApp, SIGNAL( AboutToChangeSelectedModel( const AbstractModel* ) ),
this, SLOT( OnAboutToChangeSelectedModel( const AbstractModel* ) )
);
// Connect Application and MainWindow when selected model has been
// changed.
QObject::connect(
qApp, SIGNAL( SelectedModelChanged( core::AbstractModel* ) ),
this, SLOT( OnSelectedModelChanged( core::AbstractModel* ) )
qApp, SIGNAL( SelectedModelChanged( AbstractModel* ) ),
this, SLOT( OnSelectedModelChanged( AbstractModel* ) )
);
// Show the progress dialog when a new image is loaded
......@@ -398,10 +389,10 @@ MainWindow::closeEvent( QCloseEvent* event )
// Ensure that there is no model or that the existing model is a
// DatasetModel.
assert( Application::ConstInstance()->GetModel()==
Application::ConstInstance()->GetModel< core::DatasetModel >() );
Application::ConstInstance()->GetModel< DatasetModel >() );
// Get model.
core::DatasetModel* model =
Application::Instance()->GetModel< core::DatasetModel >();
DatasetModel* model =
Application::Instance()->GetModel< DatasetModel >();
if( model==NULL || !model->IsModified() )
return;
......@@ -546,7 +537,7 @@ MainWindow
/*****************************************************************************/
void
MainWindow
::OnAboutToChangeSelectedModel( const core::AbstractModel* )
::OnAboutToChangeSelectedModel( const AbstractModel* )
{
//
// COLOR SETUP.
......@@ -567,8 +558,8 @@ MainWindow
const Application* app = Application::ConstInstance();
assert( app!=NULL );
const core::DatasetModel* datasetModel =
qobject_cast< const core::DatasetModel* >( app->GetModel() );
const DatasetModel* datasetModel =
qobject_cast< const DatasetModel* >( app->GetModel() );
// It is Ok there is no previously selected model (e.g. at
// application startup.
......@@ -579,8 +570,8 @@ MainWindow
assert( datasetModel->HasSelectedImageModel() );
const core::VectorImageModel* vectorImageModel =
qobject_cast< const core::VectorImageModel* >(
const VectorImageModel* vectorImageModel =
qobject_cast< const VectorImageModel* >(
datasetModel->GetSelectedImageModel()
);
......@@ -613,10 +604,10 @@ MainWindow
// disconnect the vectorimage model spacing change (when zooming)
QObject::disconnect(
vectorImageModel,
SIGNAL( SpacingChanged(const core::SpacingType&) ),
SIGNAL( SpacingChanged(const SpacingType&) ),
// to:
centralWidget(),
SLOT( OnSpacingChanged(const core::SpacingType&) )
SLOT( OnSpacingChanged(const SpacingType&) )
);
// disconnect signal used to update the ql widget
......@@ -711,18 +702,18 @@ MainWindow
/*****************************************************************************/
void
MainWindow
::OnSelectedModelChanged( core::AbstractModel* model )
::OnSelectedModelChanged( AbstractModel* model )
{
if( model==NULL )
return;
core::DatasetModel* datasetModel = qobject_cast< core::DatasetModel* >( model );
DatasetModel* datasetModel = qobject_cast< DatasetModel* >( model );
assert( datasetModel!=NULL );
assert( datasetModel->HasSelectedImageModel() );
core::VectorImageModel* vectorImageModel =
qobject_cast< core::VectorImageModel* >(
VectorImageModel* vectorImageModel =
qobject_cast< VectorImageModel* >(
datasetModel->GetSelectedImageModel()
);
......@@ -735,13 +726,7 @@ MainWindow
m_TitleLoader->moveToThread(thread);
// At thread startup, trigger the processing function
QObject::connect(
thread,
SIGNAL( started() ),
// to:
m_TitleLoader,
SLOT( LoadTitle() )
);
QObject::connect(thread, SIGNAL(started()), m_TitleLoader, SLOT(LoadTitle()));
// On Successfull title composition, update with the window title
QObject::connect(m_TitleLoader,
......@@ -800,10 +785,10 @@ MainWindow
// connect the vectorimage model spacing change (when zooming)
QObject::connect(
vectorImageModel,
SIGNAL( SpacingChanged(const core::SpacingType&) ),
SIGNAL( SpacingChanged(const SpacingType&) ),
// to:
centralWidget(),
SLOT( OnSpacingChanged(const core::SpacingType&) )
SLOT( OnSpacingChanged(const SpacingType&) )
);
// signal used to update the ql widget
......@@ -961,7 +946,7 @@ MainWindow
connect(thread, SIGNAL(started()), loader, SLOT(OpenImage()));
// On successfull image loading, notify ourself, passing the created AbstractModel instance
connect(loader, SIGNAL(ModelLoaded(core::AbstractModel*)), this, SLOT(OnModelLoaded(core::AbstractModel*)));
connect(loader, SIGNAL(ModelLoaded(AbstractModel*)), this, SLOT(OnModelLoaded(AbstractModel*)));
// On error, notify ourself
connect(loader, SIGNAL(Error(QString)), this, SLOT(OnOpenImageError(QString)));
......@@ -989,7 +974,7 @@ MainWindow
/*****************************************************************************/
void
MainWindow
::OnModelLoaded( core::AbstractModel* model )
::OnModelLoaded( AbstractModel* model )
{
try
{
......
......@@ -60,14 +60,9 @@ namespace
namespace mvd
{
namespace core
{
//
// Internal class pre-declaration.
class AbstractModel;
}
class AbstractModelController;
class ImageViewManipulator;
class QuicklookViewManipulator;
......@@ -194,7 +189,7 @@ private:
*
* \param model The model to assign to the controller.
*/
inline void SetControllerModel( QDockWidget* dock, core::AbstractModel* model );
inline void SetControllerModel( QDockWidget* dock, AbstractModel* model );
/** Write settings into a settings file*/
void WriteDsPathSettings(QString dsPath);
......@@ -292,13 +287,13 @@ private slots:
void OnColorDynamicsVisibilityChanged ( bool );
/** */
void OnAboutToChangeSelectedModel( const core::AbstractModel* );
void OnAboutToChangeSelectedModel( const AbstractModel* );
/** */
void OnModelLoaded( core::AbstractModel* );
void OnModelLoaded( AbstractModel* );
/** */
void OnSelectedModelChanged( core::AbstractModel* );
void OnSelectedModelChanged( AbstractModel* );
/** */
void OnUserCoordinatesEditingFinished();
......@@ -404,7 +399,7 @@ MainWindow
inline
void
MainWindow
::SetControllerModel( QDockWidget* dock, core::AbstractModel* model )
::SetControllerModel( QDockWidget* dock, AbstractModel* model )
{
assert( dock );
......
......@@ -42,12 +42,8 @@
namespace mvd
{
namespace core
{
/*
TRANSLATOR mvd::core::AbstractImageModel
TRANSLATOR mvd::AbstractImageModel
Necessary for lupdate to be aware of C++ namespaces.
......@@ -68,16 +64,16 @@ namespace
*/
const char*
ENHANCED_BAND_NAMES[ 10 ] = {
QT_TRANSLATE_NOOP( "mvd::core::AbstractImageModel", "Red" ),
QT_TRANSLATE_NOOP( "mvd::core::AbstractImageModel", "Green" ),
QT_TRANSLATE_NOOP( "mvd::core::AbstractImageModel", "Blue" ),
QT_TRANSLATE_NOOP( "mvd::core::AbstractImageModel", "Yellow" ),
QT_TRANSLATE_NOOP( "mvd::core::AbstractImageModel", "RedEdge" ),
QT_TRANSLATE_NOOP( "mvd::core::AbstractImageModel", "Coastal" ),
QT_TRANSLATE_NOOP( "mvd::core::AbstractImageModel", "NIR" ),
QT_TRANSLATE_NOOP( "mvd::core::AbstractImageModel", "NIR1" ),
QT_TRANSLATE_NOOP( "mvd::core::AbstractImageModel", "NIR2" ),
QT_TRANSLATE_NOOP( "mvd::core::AbstractImageModel", "PAN" ),
QT_TRANSLATE_NOOP( "mvd::AbstractImageModel", "Red" ),
QT_TRANSLATE_NOOP( "mvd::AbstractImageModel", "Green" ),
QT_TRANSLATE_NOOP( "mvd::AbstractImageModel", "Blue" ),
QT_TRANSLATE_NOOP( "mvd::AbstractImageModel", "Yellow" ),
QT_TRANSLATE_NOOP( "mvd::AbstractImageModel", "RedEdge" ),
QT_TRANSLATE_NOOP( "mvd::AbstractImageModel", "Coastal" ),
QT_TRANSLATE_NOOP( "mvd::AbstractImageModel", "NIR" ),
QT_TRANSLATE_NOOP( "mvd::AbstractImageModel", "NIR1" ),
QT_TRANSLATE_NOOP( "mvd::AbstractImageModel", "NIR2" ),
QT_TRANSLATE_NOOP( "mvd::AbstractImageModel", "PAN" ),
};
} // end of anonymous namespace.
......@@ -250,6 +246,4 @@ AbstractImageModel
/* SLOTS */
/*******************************************************************************/
} // end namespace 'core'
} // end namespace 'mvd'
......@@ -60,12 +60,6 @@ namespace
namespace mvd
{
//
// Internal classes pre-declaration.
namespace core
{
//
// Internal classes pre-declaration.
class HistogramModel;
......@@ -215,7 +209,7 @@ public slots:
// Signals.
signals:
/** */
void SpacingChanged( const core::SpacingType& );
void SpacingChanged( const SpacingType& );
/*-[ PROTECTED SECTION ]---------------------------------------------------*/
......@@ -280,8 +274,6 @@ private:
private slots:
};
} // end namespace 'core'
} // end namespace 'mvd'
/*****************************************************************************/
......@@ -300,9 +292,6 @@ private slots:
namespace mvd
{
namespace core
{
/*****************************************************************************/
int
AbstractImageModel
......@@ -424,8 +413,6 @@ AbstractImageModel
return ToImageBase()->GetOrigin();
}
} // end namespace 'core'
} // end namespace 'mvd'
#endif // __mvdAbstractImageModel_h
......@@ -41,12 +41,8 @@
namespace mvd
{
namespace core
{
/*
TRANSLATOR mvd::core::AbstractModel
TRANSLATOR mvd::AbstractModel
Necessary for lupdate to be aware of C++ namespaces.
......@@ -91,6 +87,4 @@ AbstractModel
/*******************************************************************************/
} // end namespace 'core'
} // end namespace 'mvd'
......@@ -62,10 +62,6 @@ namespace mvd
//
// Internal classes pre-declaration.
namespace core
{
//
// Internal classes pre-declaration.
/*****************************************************************************/
/* CLASS DEFINITION SECTION */
......@@ -156,8 +152,6 @@ private:
private slots:
};
} // end namespace 'core'.
} // end namespace 'mvd'.
/*****************************************************************************/
......@@ -166,9 +160,6 @@ private slots:
namespace mvd
{
namespace core
{
/*****************************************************************************/
template< typename TModel >
const TModel*
......@@ -231,8 +222,6 @@ AbstractModel
virtual_BuildModel( context );
}
} // end namespace 'core'
} // end namespace 'mvd'
#endif // __mvdAbstractModel_h
......@@ -40,12 +40,8 @@
namespace mvd
{
namespace core
{
/*
TRANSLATOR mvd::core::Algorithm
TRANSLATOR mvd::Algorithm
Necessary for lupdate to be aware of C++ namespaces.
......@@ -54,6 +50,4 @@ namespace core
/*******************************************************************************/
} // end namespace 'core'
} // end namespace 'mvd'
......@@ -64,14 +64,6 @@ namespace mvd
{
//
// Internal classes pre-declaration.
namespace core
{
//
// Internal classes pre-declaration.
} // end of namespace 'core'.
} // end of namespace 'mvd'.
......@@ -150,10 +142,6 @@ ToVariableLengthVector( itk::FixedArray< T1, N >& a,
namespace mvd
{
namespace core
{
/**
* Convert a StringVector object to a QStringList object.
*
......@@ -205,18 +193,12 @@ inline
std::string
ToStdString( const QString& str );
} // end namespace 'core'.
} // end namespace 'mvd'.
/*****************************************************************************/
namespace mvd
{
namespace core
{
/**
* \brief Test condition on all elements in range.
*
......@@ -261,8 +243,6 @@ inline
bool
NoneOf( TInputIterator first, TInputIterator last, TUnaryPredicate pred );
} // end namespace 'core'.
} // end namespace 'mvd'.
/*****************************************************************************/
......@@ -348,10 +328,6 @@ ToVariableLengthVector( itk::VariableLengthVector< T2 >& v,
namespace mvd
{
namespace core
{
/*******************************************************************************/
inline
QStringList
......@@ -392,18 +368,13 @@ ToStdString( const QString& str )
return std::string( str.toAscii().constData() );
}
} // end namespace 'core'
/*******************************************************************************/
} // end namespace 'mvd'
/*******************************************************************************/
namespace mvd
{
namespace core
{
/*******************************************************************************/
template< typename TInputIterator, typename TUnaryPredicate >
inline
......@@ -455,8 +426,6 @@ NoneOf( TInputIterator first, TInputIterator last, TUnaryPredicate pred )
return true;
}
} // end namespace 'core'
} // end namespace 'mvd'
......
......@@ -48,11 +48,8 @@
namespace mvd
{
namespace core
{
/*
TRANSLATOR mvd::core::DatasetDescriptor
TRANSLATOR mvd::DatasetDescriptor
Necessary for lupdate to be aware of C++ namespaces.
......@@ -540,6 +537,4 @@ DatasetDescriptor
/*******************************************************************************/
} // end namespace 'core'
} // end namespace 'mvd'
......@@ -60,10 +60,6 @@ namespace
namespace mvd
{
namespace core
{
//
// Internal classes pre-declaration.
class AbstractImageModel;
......@@ -282,8 +278,6 @@ private:
private slots:
};
} // end namespace 'core'
} // end namespace 'mvd'
/*****************************************************************************/
......@@ -296,9 +290,6 @@ private slots:
namespace mvd
{
namespace core
{
/*****************************************************************************/
inline
QDomElement
......