Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
273
Issues
273
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main Repositories
otb
Commits
7fafc49c
Commit
7fafc49c
authored
Mar 12, 2013
by
Otmane Lahlou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ADD: init a class in charge of searching applications in a given directory
parent
56d94002
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
312 additions
and
1 deletion
+312
-1
Code/Common/CMakeLists.txt
Code/Common/CMakeLists.txt
+3
-1
Code/Common/mvdApplicationsBrowser.cxx
Code/Common/mvdApplicationsBrowser.cxx
+131
-0
Code/Common/mvdApplicationsBrowser.h
Code/Common/mvdApplicationsBrowser.h
+178
-0
No files found.
Code/Common/CMakeLists.txt
View file @
7fafc49c
...
...
@@ -29,6 +29,7 @@ set( Common_SOURCES
mvdTypes.cxx
mvdVectorImageModel.cxx
mvdApplicationsToolBox.cxx
mvdApplicationsBrowser.cxx
)
# Headers for classes with Q_OBJECT macro (needs to go to Qt moc)
...
...
@@ -57,6 +58,7 @@ set( Common_HEADERS_MOC
mvdStatusBarWidget.h
mvdVectorImageModel.h
mvdApplicationsToolBox.h
mvdApplicationsBrowser.h
)
# Qt designer UI files
...
...
@@ -108,7 +110,7 @@ add_library(Monteverdi2_Common
#############################################################################
target_link_libraries
(
Monteverdi2_Common
OTBIO
OTBIO
OTBApplicationEngine
${
OPENGL_LIBRARIES
}
Qt4::QtCore
Qt4::QtGui
...
...
Code/Common/mvdApplicationsBrowser.cxx
0 → 100644
View file @
7fafc49c
/*=========================================================================
Program: Monteverdi2
Language: C++
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See Copyright.txt for details.
Monteverdi2 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 "mvdApplicationsBrowser.h"
/*****************************************************************************/
/* INCLUDE SECTION */
//
// 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)
#include "otbWrapperApplicationRegistry.h"
#include "otbWrapperApplication.h"
//
// Monteverdi includes (sorted by alphabetic order)
namespace
mvd
{
/*
TRANSLATOR mvd::ApplicationsBrowser
Necessary for lupdate to be aware of C++ namespaces.
Context comment for translator.
*/
/*****************************************************************************/
/* CONSTANTS */
/*****************************************************************************/
/* STATIC IMPLEMENTATION SECTION */
/*****************************************************************************/
/* CLASS IMPLEMENTATION SECTION */
/*******************************************************************************/
ApplicationsBrowser
::
ApplicationsBrowser
(
QObject
*
parent
)
:
QObject
(
parent
),
m_AutoLoadPath
(
""
)
{
}
/*******************************************************************************/
ApplicationsBrowser
::~
ApplicationsBrowser
()
{
}
/*******************************************************************************/
void
ApplicationsBrowser
::
SetAutoLoadPath
(
const
std
::
string
&
itk_auto_load_path
)
{
m_AutoLoadPath
=
itk_auto_load_path
;
//
// add the path
otb
::
Wrapper
::
ApplicationRegistry
::
AddApplicationPath
(
m_AutoLoadPath
);
}
/*******************************************************************************/
StringVector
ApplicationsBrowser
::
GetAvailableApplications
()
{
//
// check if search path is not empty
// TODO : throw exception to be catched by the catalog manager later
if
(
m_AutoLoadPath
.
empty
())
{
std
::
cerr
<<
"ERROR: Search path is empty "
<<
std
::
endl
;
}
//
// Get available application in search path
StringVector
appList
=
otb
::
Wrapper
::
ApplicationRegistry
::
GetAvailableApplications
();
//
// some verbosity
// TODO : remove this verbosity later
if
(
appList
.
size
()
==
0
)
{
std
::
cerr
<<
"ERROR: Available modules : none."
<<
std
::
endl
;
}
else
{
std
::
cout
<<
"--- Available modules :"
<<
std
::
endl
;
for
(
StringVector
::
const_iterator
it
=
appList
.
begin
();
it
!=
appList
.
end
();
++
it
)
{
std
::
cout
<<
"
\t
"
<<
*
it
<<
std
::
endl
;
}
}
return
appList
;
}
/*******************************************************************************/
/* SLOTS */
/*******************************************************************************/
}
// end namespace 'mvd'
Code/Common/mvdApplicationsBrowser.h
0 → 100644
View file @
7fafc49c
/*=========================================================================
Program: Monteverdi2
Language: C++
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See Copyright.txt for details.
Monteverdi2 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 __mvdApplicationsBrowser_h
#define __mvdApplicationsBrowser_h
//
// Configuration include.
//// Included at first position before any other ones.
#include "ConfigureMonteverdi2.h"
/*****************************************************************************/
/* INCLUDE SECTION */
//
// Qt includes (sorted by alphabetic order)
//// Must be included before system/custom includes.
#include <QtCore>
//
// System includes (sorted by alphabetic order)
//
// ITK includes (sorted by alphabetic order)
//
// OTB includes (sorted by alphabetic order)
//
// Monteverdi includes (sorted by alphabetic order)
#include "mvdTypes.h"
/*****************************************************************************/
/* PRE-DECLARATION SECTION */
//
// External classes pre-declaration.
namespace
{
}
namespace
mvd
{
//
// Internal classes pre-declaration.
/*****************************************************************************/
/* CLASS DEFINITION SECTION */
/**
* \class ApplicationsBrowser
*
* \brief Search for available applications in a directory.
*
* This class provides the functionnalities to look for
* otbWrapperApplication apps in a given directory. The method used to
* set the directory is SetAutoLoadPath(const std::string &).
*
* If applications are available in the directory set by the user,
* tags of each application are extracted.
*
* An association application-tags is then setup and stored in a
* std::vector to be sent ( via a signal ) to the
* mvd::ApplicationsToolBox or any widget or class connected to this
* signal.
*
*/
class
Monteverdi2_EXPORT
ApplicationsBrowser
:
public
QObject
{
/*-[ QOBJECT SECTION ]-----------------------------------------------------*/
Q_OBJECT
;
/*-[ PUBLIC SECTION ]------------------------------------------------------*/
//
// Public methods.
public:
/** \brief Constructor. */
ApplicationsBrowser
(
QObject
*
parent
=
NULL
);
/** \brief Destructor. */
virtual
~
ApplicationsBrowser
();
/** Set the path where to look for applications */
void
SetAutoLoadPath
(
const
std
::
string
&
itk_auto_load_path
);
/** Get available applications in the search path */
StringVector
GetAvailableApplications
();
/*-[ PUBLIC SLOTS SECTION ]------------------------------------------------*/
//
// Public SLOTS.
public
slots
:
/*-[ SIGNALS SECTION ]-----------------------------------------------------*/
//
// Signals.
signals:
/*-[ PROTECTED SECTION ]---------------------------------------------------*/
//
// Protected methods.
protected:
//
// Protected attributes.
protected:
/*-[ PRIVATE SECTION ]-----------------------------------------------------*/
//
// Private methods.
private:
//
// Private attributes.
private:
std
::
string
m_AutoLoadPath
;
/*-[ PRIVATE SLOTS SECTION ]-----------------------------------------------*/
//
// Slots.
private
slots
:
};
}
// end namespace 'mvd'.
/*****************************************************************************/
/* INLINE SECTION */
//
// 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
{
}
// end namespace 'mvd'
#endif // __mvdApplicationsBrowser_h
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment