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
ea990457
Commit
ea990457
authored
Mar 13, 2013
by
Otmane Lahlou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ADD: class in charge of generating appliation mvd2 mainWindow title
parent
f4ace00b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
169 additions
and
0 deletions
+169
-0
Code/Common/CMakeLists.txt
Code/Common/CMakeLists.txt
+2
-0
Code/Common/mvdMainWindowTitleLoader.cxx
Code/Common/mvdMainWindowTitleLoader.cxx
+72
-0
Code/Common/mvdMainWindowTitleLoader.h
Code/Common/mvdMainWindowTitleLoader.h
+95
-0
No files found.
Code/Common/CMakeLists.txt
View file @
ea990457
...
...
@@ -29,6 +29,7 @@ set( Common_SOURCES
mvdTypes.cxx
mvdVectorImageModel.cxx
mvdApplicationsToolBox.cxx
mvdMainWindowTitleLoader.cxx
mvdApplicationsBrowser.cxx
)
...
...
@@ -58,6 +59,7 @@ set( Common_HEADERS_MOC
mvdStatusBarWidget.h
mvdVectorImageModel.h
mvdApplicationsToolBox.h
mvdMainWindowTitleLoader.h
mvdApplicationsBrowser.h
)
...
...
Code/Common/mvdMainWindowTitleLoader.cxx
0 → 100644
View file @
ea990457
/*=========================================================================
Program: Monteverdi2
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for 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 "mvdMainWindowTitleLoader.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)
#include "mvdVectorImageModel.h"
namespace
mvd
{
MainWindowTitleLoader
::
MainWindowTitleLoader
(
VectorImageModel
*
model
)
:
m_Model
(
model
)
{
}
void
MainWindowTitleLoader
::
LoadTitle
()
{
// This method is executed in a separate thread
std
::
ostringstream
oss
;
oss
<<
PROJECT_NAME
<<
" - "
<<
otb
::
System
::
GetShortFileName
(
ToStdString
(
m_Model
->
GetFilename
()));
oss
<<
" ("
<<
m_Model
->
GetNbComponents
()
<<
tr
(
" bands, "
).
toLatin1
().
constData
();
oss
<<
m_Model
->
GetNativeLargestRegion
().
GetSize
()[
0
];
oss
<<
"x"
<<
m_Model
->
GetNativeLargestRegion
().
GetSize
()[
1
]
<<
tr
(
" pixels)"
).
toLatin1
().
constData
();
emit
TitleLoaded
(
FromStdString
(
oss
.
str
())
);
// add the placename to the title if any
std
::
string
placename
=
m_Model
->
GetCenterPixelPlaceName
();
if
(
!
placename
.
empty
())
{
oss
<<
" - "
<<
ToStdString
(
tr
(
"Location"
)
)
<<
" : "
<<
placename
;
emit
TitleLoaded
(
FromStdString
(
oss
.
str
())
);
}
emit
Finished
();
}
}
// end namespace 'mvd'
Code/Common/mvdMainWindowTitleLoader.h
0 → 100644
View file @
ea990457
/*=========================================================================
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 __mvdMainWindowTitleLoader_h
#define __mvdMainWindowTitleLoader_h
//
// Configuration include.
//// Included at first position before any other ones.
#include "ConfigureMonteverdi2.h"
//
// 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)
//
// External classes pre-declaration.
namespace
{
}
namespace
mvd
{
//
// Internal class pre-declaration.
class
VectorImageModel
;
/*****************************************************************************/
/* CLASS DEFINITION SECTION */
/**
* \class MainWindowTitleLoader
*
* \brief Imports an image into a Monteverdi2 dataset
*
* This class is used to deport the dataset creation
* in a separate thread
*/
class
MainWindowTitleLoader
:
public
QObject
{
Q_OBJECT
;
public:
/** \brief Constructor */
MainWindowTitleLoader
(
VectorImageModel
*
model
);
public
slots
:
/** \brief Trigger the dataset creation */
void
LoadTitle
();
signals:
/** \brief Triggered after model is ready */
void
TitleLoaded
(
const
QString
&
);
/** \brief Triggered when processing is finished */
void
Finished
();
private:
VectorImageModel
*
m_Model
;
};
}
// end namespace 'mvd'
#endif // __mvdImageModel_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