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
dddd2520
Commit
dddd2520
authored
Mar 13, 2013
by
Otmane Lahlou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: add methods to fil the map storing tag/apps associations
parent
dac67056
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
3 deletions
+93
-3
Code/Common/mvdApplicationsBrowser.cxx
Code/Common/mvdApplicationsBrowser.cxx
+79
-1
Code/Common/mvdApplicationsBrowser.h
Code/Common/mvdApplicationsBrowser.h
+14
-2
No files found.
Code/Common/mvdApplicationsBrowser.cxx
View file @
dddd2520
...
...
@@ -102,7 +102,7 @@ ApplicationsBrowser
}
//
//
G
et available application in search path
//
g
et available application in search path
StringVector
appList
=
otb
::
Wrapper
::
ApplicationRegistry
::
GetAvailableApplications
();
//
...
...
@@ -124,6 +124,84 @@ ApplicationsBrowser
return
appList
;
}
/*******************************************************************************/
StringVector
ApplicationsBrowser
::
GetApplicationTags
(
const
std
::
string
&
appName
)
{
//
// output vector
StringVector
vtags
;
//
// instantiate the application using the factory
otb
::
Wrapper
::
Application
::
Pointer
application
=
otb
::
Wrapper
::
ApplicationRegistry
::
CreateApplication
(
appName
);
//
// get tags
if
(
!
application
.
IsNull
()
)
{
vtags
=
application
->
GetDocTags
();
}
return
vtags
;
}
/*******************************************************************************/
void
ApplicationsBrowser
::
SearchAvailableApplicationsTags
()
{
//
// get all the applications in the search path
StringVector
vapp
=
GetAvailableApplications
();
//
// loop on the applications to get tags
ApplicationsTagContainer
outputContainer
;
StringVector
::
const_iterator
it
=
vapp
.
begin
();
while
(
it
!=
vapp
.
end
()
)
{
// get tags of current app
StringVector
ctags
=
GetApplicationTags
(
*
it
);
// key will be the tag (easier for tree origanisation in )
StringVector
::
const_iterator
itTag
=
ctags
.
begin
();
while
(
itTag
!=
ctags
.
end
()
)
{
// search for this tag in the output container
ApplicationsTagContainer
::
iterator
pos
=
outputContainer
.
find
(
*
itTag
);
if
(
pos
!=
outputContainer
.
end
()
)
// key found
{
//
// add the application name (*it) as value for the current app tag
(
*
pos
).
second
.
push_back
(
*
it
);
}
else
{
//
// if tag not found in the container, add it
std
::
pair
<
std
::
string
,
StringVector
>
currentAppTags
;
currentAppTags
.
first
=
*
itTag
;
currentAppTags
.
second
.
push_back
(
*
it
);
outputContainer
.
insert
(
currentAppTags
);
}
++
itTag
;
}
++
it
;
}
//
// emit a signal with the ApplicationsTagContainer as
// parameter
emit
AvailableApplicationsTagsChanged
(
outputContainer
);
}
/*******************************************************************************/
/* SLOTS */
/*******************************************************************************/
...
...
Code/Common/mvdApplicationsBrowser.h
View file @
dddd2520
...
...
@@ -96,18 +96,29 @@ class Monteverdi2_EXPORT ApplicationsBrowser :
// Public methods.
public:
/** typedef */
/** \brief Constructor. */
ApplicationsBrowser
(
QObject
*
parent
=
NULL
);
/** \brief Destructor. */
virtual
~
ApplicationsBrowser
();
/**
S
et the path where to look for applications */
/**
s
et the path where to look for applications */
void
SetAutoLoadPath
(
const
std
::
string
&
itk_auto_load_path
);
/**
G
et available applications in the search path */
/**
g
et available applications in the search path */
StringVector
GetAvailableApplications
();
/** return the list applications <->tags */
StringVector
GetApplicationTags
(
const
std
::
string
&
appName
);
/** return std::map storing tag/apps association for all the
* applications in the search path
*/
void
SearchAvailableApplicationsTags
();
/*-[ PUBLIC SLOTS SECTION ]------------------------------------------------*/
//
...
...
@@ -119,6 +130,7 @@ public slots:
//
// Signals.
signals:
void
AvailableApplicationsTagsChanged
(
const
ApplicationsTagContainer
&
);
/*-[ PROTECTED SECTION ]---------------------------------------------------*/
...
...
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