OTB  6.7.0
Orfeo Toolbox
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
mvd::I18nCoreApplication Class Referenceabstract

#include <mvdI18nCoreApplication.h>

+ Inheritance diagram for mvd::I18nCoreApplication:
+ Collaboration diagram for mvd::I18nCoreApplication:

Public Types

enum  SettingsKey {
  SETTINGS_KEY_GEOID_PATH,
  SETTINGS_KEY_GEOID_PATH_ACTIVE,
  SETTINGS_KEY_OVERVIEWS_ENABLED,
  SETTINGS_KEY_OVERVIEWS_SIZE,
  SETTINGS_KEY_RESOLUTION,
  SETTINGS_KEY_RESULTS_DIR,
  SETTINGS_KEY_SRTM_DIR,
  SETTINGS_KEY_SRTM_DIR_ACTIVE,
  SETTINGS_KEY_TILE_SIZE,
  SETTINGS_KEY_COUNT
}
 

Public Slots

void SetModel (AbstractModel *model)
 

Signals

void AboutToChangeModel (const AbstractModel *model)
 
void ModelChanged (AbstractModel *model)
 

Public Member Functions

template<typename T >
const T * ConstInstance ()
 
bool ElevationSetup ()
 
const AbstractModelGetModel () const
 
AbstractModelGetModel ()
 
template<typename TModel >
const TModel * GetModel () const
 
template<typename TModel >
TModel * GetModel ()
 
const QDir & GetResultsDir () const
 
QDir & GetResultsDir ()
 
bool HasSettingsKey (SettingsKey) const
 
bool HasSettingsKey (const QString &key) const
 
 I18nCoreApplication (QCoreApplication *qtApp)
 
void Initialize ()
 
template<typename T >
T * Instance ()
 
QVariant RetrieveSettingsKey (SettingsKey) const
 
QVariant RetrieveSettingsKey (const QString &key) const
 
void StoreSettingsKey (SettingsKey, const QVariant &value)
 
void StoreSettingsKey (const QString &key, const QVariant &value)
 
 ~I18nCoreApplication () override
 

Static Public Member Functions

static const I18nCoreApplicationConstInstance ()
 
static QString DatasetPathName (QString &name, const QString &imageFilename)
 
static void DeleteDatasetModel (const QString &path, const QString &hash)
 
static I18nCoreApplicationInstance ()
 
static bool IsDirValid (const QString &path)
 
static bool IsResultsDirValid (const QString &path)
 
static VectorImageModelLoadImageModel (const QString &filename, int width, int height, QObject *p=NULL)
 
static bool MakeDirTree (const QString &path, const QString &tree, QDir *dir=NULL)
 

Static Public Attributes

static const char * DATASET_EXT
 
static const char * DEFAULT_CACHE_DIR_NAME
 
static const char * DEFAULT_CACHE_RESULT_DIR_NAME
 

Protected Member Functions

void InitializeCore (const QString &appName, const QString &appVersion, const QString &orgName, const QString &orgDomain)
 

Static Protected Member Functions

template<typename TApplication >
static const TApplication * ConstInstance ()
 
template<typename TApplication >
static TApplication * Instance ()
 

Private Member Functions

void InitializeLocale ()
 
void InitializeSettings ()
 
void LoadAndInstallTranslator (const QString &filename, const QString &directory=QString(), const QString &searchDelimiters=QString(), const QString &suffix=QString())
 
virtual void virtual_InitializeCore ()=0
 

Static Private Member Functions

static void HandleQtMessage (QtMsgType type, const QMessageLogContext &, const QString &message)
 

Private Attributes

bool m_IsRunningFromBuildDir
 
AbstractModelm_Model
 
QDir m_ResultsDir
 
QSettings * m_Settings
 

Static Private Attributes

static I18nCoreApplicationm_Instance
 
static const char * SETTINGS_KEYS [SETTINGS_KEY_COUNT]
 

Detailed Description

The MVD2 core-application (which is different from QCoreApplication).

I18nCoreApplication do not derive from QCoreApplication to prevent a dread diamong multiple inheritance scheme which could not be resolved using virtual inheritance (because Qt is not designed for).

I18nCoreApplication does not derive from QApplication to prevent package .../Common/Core to depend on QtGui package (which would have broken the Common/Core-Common/Gui package layout).

The dread diamond multiple inheritance scheme is solved using aggregation.

QCoreApplication is passed as argument of I18nCoreApplication constructor. So, is user application must derive QApplication (to, for example, provide sessio management), the specialized instance can be passed as argument of constructor.

Definition at line 101 of file mvdI18nCoreApplication.h.

Member Enumeration Documentation

Enumerator
SETTINGS_KEY_GEOID_PATH 
SETTINGS_KEY_GEOID_PATH_ACTIVE 
SETTINGS_KEY_OVERVIEWS_ENABLED 
SETTINGS_KEY_OVERVIEWS_SIZE 
SETTINGS_KEY_RESOLUTION 
SETTINGS_KEY_RESULTS_DIR 
SETTINGS_KEY_SRTM_DIR 
SETTINGS_KEY_SRTM_DIR_ACTIVE 
SETTINGS_KEY_TILE_SIZE 
SETTINGS_KEY_COUNT 

Definition at line 114 of file mvdI18nCoreApplication.h.

Constructor & Destructor Documentation

mvd::I18nCoreApplication::I18nCoreApplication ( QCoreApplication *  qtApp)

Constructor.

Parameters
qtAppThe parent Qt application of this MVD2 application.
mvd::I18nCoreApplication::~I18nCoreApplication ( )
override

Destructor.

Member Function Documentation

void mvd::I18nCoreApplication::AboutToChangeModel ( const AbstractModel model)
signal

Signal emitted when the AbstractModel of the MVC is about to be changed.

This signal could be slotted in order to disconnect previously managed model.

Parameters
modelThe newly managed model (previous model can still be accessed using the GetModel() methods).
const I18nCoreApplication * mvd::I18nCoreApplication::ConstInstance ( )
inlinestatic

Get the singleton constant instance of application as a I18Application pointer.

Returns
The singleton constant instance of I18nCoreApplication.

Definition at line 531 of file mvdI18nCoreApplication.h.

References m_Instance.

Referenced by ConstInstance(), mvd::Wrapper::OutputImageInitializer::operator()(), and mvd::Wrapper::ComplexOutputImageInitializer::operator()().

template<typename TApplication >
static const TApplication* mvd::I18nCoreApplication::ConstInstance ( )
inlinestaticprotected

Get the constant singleton instance of application (safe) casted into the TApplication type.

Returns
The constant singleton instance of application (safely) casted into TApplication type.
template<typename T >
const T* mvd::I18nCoreApplication::ConstInstance ( )
inline

Definition at line 551 of file mvdI18nCoreApplication.h.

References ConstInstance().

static QString mvd::I18nCoreApplication::DatasetPathName ( QString &  name,
const QString &  imageFilename 
)
static

Construct a consistent Dataset path-name.

Parameters
pathResulting path where the Dataset will be stored.
nameResulting name of the given Dataset.
imageFilenameThe image filename used to compute the path and name of the Dataset.
Returns
The MD5 hash-code generated from to full absolute pathname of image file.
static void mvd::I18nCoreApplication::DeleteDatasetModel ( const QString &  path,
const QString &  hash 
)
static
bool mvd::I18nCoreApplication::ElevationSetup ( )

setup elevation management

const AbstractModel * mvd::I18nCoreApplication::GetModel ( ) const
inline

Access the AbstractModel of the MVC which is managed by the application.

Returns
The managed AbstractModel.

Definition at line 560 of file mvdI18nCoreApplication.h.

AbstractModel * mvd::I18nCoreApplication::GetModel ( )
inline

Access the AbstractModel of the MVC which is managed by the application.

Returns
The managed AbstractModel.

Definition at line 569 of file mvdI18nCoreApplication.h.

template<typename TModel >
const TModel * mvd::I18nCoreApplication::GetModel ( ) const
inline

Access the AbstractModel of the MVC which is managed by the application and cast it into the given dynamic type.

Returns
The managed TModel typename instance.

Definition at line 579 of file mvdI18nCoreApplication.h.

template<typename TModel >
TModel * mvd::I18nCoreApplication::GetModel ( )
inline

Access the AbstractModel of the MVC which is managed by the application and cast it into the given dynamic type.

Returns
The managed TModel typename instance.

Definition at line 589 of file mvdI18nCoreApplication.h.

const QDir & mvd::I18nCoreApplication::GetResultsDir ( ) const
inline

Get the results directory (where output from OTBApplicaitons are stored).

Returns
Return the cache directory.

Definition at line 597 of file mvdI18nCoreApplication.h.

QDir & mvd::I18nCoreApplication::GetResultsDir ( )
inline

Definition at line 605 of file mvdI18nCoreApplication.h.

static void mvd::I18nCoreApplication::HandleQtMessage ( QtMsgType  type,
const QMessageLogContext &  ,
const QString &  message 
)
staticprivate

Handles Qt messages thrown by calls to qDebug(), qWarning(), qCritical(), qFatal().

This is a callback method registered into Qt message handling system.

Parameters
typeType of caught message.
messageContent of caught message.
bool mvd::I18nCoreApplication::HasSettingsKey ( SettingsKey  key) const
inline

Definition at line 614 of file mvdI18nCoreApplication.h.

References SETTINGS_KEYS.

bool mvd::I18nCoreApplication::HasSettingsKey ( const QString &  key) const
inline

Definition at line 641 of file mvdI18nCoreApplication.h.

void mvd::I18nCoreApplication::Initialize ( )
void mvd::I18nCoreApplication::InitializeCore ( const QString &  appName,
const QString &  appVersion,
const QString &  orgName,
const QString &  orgDomain 
)
protected
void mvd::I18nCoreApplication::InitializeLocale ( )
private
void mvd::I18nCoreApplication::InitializeSettings ( )
private
I18nCoreApplication * mvd::I18nCoreApplication::Instance ( )
inlinestatic

Get the singleton instance of application as a I18Application pointer.

Returns
The singleton instance of I18nCoreApplication.

Definition at line 523 of file mvdI18nCoreApplication.h.

References m_Instance.

Referenced by Instance().

template<typename TApplication >
static TApplication* mvd::I18nCoreApplication::Instance ( )
inlinestaticprotected

Get the singleton instance of application (safe) casted into the TApplication type.

Returns
The singleton instance of application (safely) casted into TApplication type.
template<typename T >
T* mvd::I18nCoreApplication::Instance ( )
inline

Definition at line 541 of file mvdI18nCoreApplication.h.

References Instance().

static bool mvd::I18nCoreApplication::IsDirValid ( const QString &  path)
static
static bool mvd::I18nCoreApplication::IsResultsDirValid ( const QString &  path)
static
void mvd::I18nCoreApplication::LoadAndInstallTranslator ( const QString &  filename,
const QString &  directory = QString(),
const QString &  searchDelimiters = QString(),
const QString &  suffix = QString() 
)
private
static VectorImageModel* mvd::I18nCoreApplication::LoadImageModel ( const QString &  filename,
int  width,
int  height,
QObject *  p = NULL 
)
static
static bool mvd::I18nCoreApplication::MakeDirTree ( const QString &  path,
const QString &  tree,
QDir *  dir = NULL 
)
static

Make directory tree in given path.

Throws mvd::SystemError exception if sub-directory tree could not have been created.

Parameters
pathLocation where to create sub-directory tree.
treeSub-directory tree path. E.g.: 'level_1/level_2'.
dirresulting directory, if non-NULL.
Returns
true if sub-directory tree is newly created or false if it is already existing.
void mvd::I18nCoreApplication::ModelChanged ( AbstractModel model)
signal

Signal emitted when the AbstractModel of the MVC has been changed.

This signal coulb be slotted in order to connect newly managed model.

Parameters
modelThe newly selected model.
QVariant mvd::I18nCoreApplication::RetrieveSettingsKey ( SettingsKey  key) const
inline

Definition at line 632 of file mvdI18nCoreApplication.h.

References SETTINGS_KEYS.

QVariant mvd::I18nCoreApplication::RetrieveSettingsKey ( const QString &  key) const
inline

Definition at line 665 of file mvdI18nCoreApplication.h.

void mvd::I18nCoreApplication::SetModel ( AbstractModel model)
slot

Accessor used to changed model which is managed by the Application.

This method emits the AboutToChangeModel() and ModelChanged() signals respectively, before and after, the model is changed.

Parameters
modelThe newly managed model.
void mvd::I18nCoreApplication::StoreSettingsKey ( SettingsKey  key,
const QVariant &  value 
)
inline

Definition at line 623 of file mvdI18nCoreApplication.h.

References SETTINGS_KEYS.

void mvd::I18nCoreApplication::StoreSettingsKey ( const QString &  key,
const QVariant &  value 
)
inline

Definition at line 652 of file mvdI18nCoreApplication.h.

virtual void mvd::I18nCoreApplication::virtual_InitializeCore ( )
privatepure virtual

Member Data Documentation

const char* mvd::I18nCoreApplication::DATASET_EXT
static

Definition at line 340 of file mvdI18nCoreApplication.h.

const char* mvd::I18nCoreApplication::DEFAULT_CACHE_DIR_NAME
static

Name of the cache directory

Definition at line 331 of file mvdI18nCoreApplication.h.

const char* mvd::I18nCoreApplication::DEFAULT_CACHE_RESULT_DIR_NAME
static

Name of the result cache directory

Definition at line 336 of file mvdI18nCoreApplication.h.

I18nCoreApplication* mvd::I18nCoreApplication::m_Instance
staticprivate

I18nCoreApplication singleton instance.

Definition at line 482 of file mvdI18nCoreApplication.h.

Referenced by ConstInstance(), and Instance().

bool mvd::I18nCoreApplication::m_IsRunningFromBuildDir
private

Definition at line 503 of file mvdI18nCoreApplication.h.

AbstractModel* mvd::I18nCoreApplication::m_Model
private

AbstractModel of the Model-View-Controller design pattern which is managed by the application.

Definition at line 499 of file mvdI18nCoreApplication.h.

QDir mvd::I18nCoreApplication::m_ResultsDir
private

Directory where all result files from OTB applications are stored.

Definition at line 488 of file mvdI18nCoreApplication.h.

QSettings* mvd::I18nCoreApplication::m_Settings
private

Application settings.

Definition at line 493 of file mvdI18nCoreApplication.h.

const char* mvd::I18nCoreApplication::SETTINGS_KEYS[SETTINGS_KEY_COUNT]
staticprivate

Definition at line 477 of file mvdI18nCoreApplication.h.

Referenced by HasSettingsKey(), RetrieveSettingsKey(), and StoreSettingsKey().


The documentation for this class was generated from the following file: