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
94032551
Commit
94032551
authored
Apr 18, 2013
by
Stéphane Albert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: Added AbstractWorker class.
parent
a1cfb8e2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
290 additions
and
8 deletions
+290
-8
Code/Application/Catalogue/mvdMainWindow.cxx
Code/Application/Catalogue/mvdMainWindow.cxx
+36
-1
Code/Application/Catalogue/mvdMainWindow.h
Code/Application/Catalogue/mvdMainWindow.h
+5
-0
Code/Application/Catalogue/mvdMainWindow.ui
Code/Application/Catalogue/mvdMainWindow.ui
+7
-7
Code/Common/Core/CMakeLists.txt
Code/Common/Core/CMakeLists.txt
+2
-0
Code/Common/Core/mvdAbstractWorker.cxx
Code/Common/Core/mvdAbstractWorker.cxx
+83
-0
Code/Common/Core/mvdAbstractWorker.h
Code/Common/Core/mvdAbstractWorker.h
+157
-0
No files found.
Code/Application/Catalogue/mvdMainWindow.cxx
View file @
94032551
...
...
@@ -158,7 +158,7 @@ MainWindow
m_OtbApplicationsBrowserDock
->
findChild
<
ApplicationsToolBox
*
>
()
);
assert
(
appWidget
!=
NULL
);
// # Step 2 : setup connections
QObject
::
connect
(
appWidget
,
...
...
@@ -720,6 +720,41 @@ MainWindow
/*****************************************************************************/
/* SLOTS */
/*****************************************************************************/
void
MainWindow
::
on_action_OpenImage_triggered
()
{
QString
filename
(
QFileDialog
::
getOpenFileName
(
this
,
tr
(
"Open file..."
)
)
);
if
(
filename
.
isNull
()
)
return
;
// emit OpenImageRequest( filename );
/*
try
{
DatasetModel* model = Application::LoadDatasetModel(
m_Filename, m_Width, m_Height );
// We can only push to another thread,
// so thread affinity must be set here,
// and not in the slot that receives the object
model->moveToThread(Application::Instance()->thread());
emit ModelLoaded(model);
}
catch( std::exception& exc )
{
emit Error( exc.what() );
}
emit Finished();
*/
}
/*****************************************************************************/
void
MainWindow
...
...
Code/Application/Catalogue/mvdMainWindow.h
View file @
94032551
...
...
@@ -281,6 +281,11 @@ private:
//
// Private slots.
private
slots
:
/**
* \brief Qt auto-connected slot which is called when 'File/Open
* image' menu action is triggered.
*/
void
on_action_OpenImage_triggered
();
/** */
void
OnUserCoordinatesEditingFinished
();
...
...
Code/Application/Catalogue/mvdMainWindow.ui
View file @
94032551
...
...
@@ -30,7 +30,7 @@
<property
name=
"title"
>
<string>
&
File
</string>
</property>
<addaction
name=
"action_Open"
/>
<addaction
name=
"action_Open
Image
"
/>
<addaction
name=
"separator"
/>
<addaction
name=
"action_Quit"
/>
</widget>
...
...
@@ -73,7 +73,7 @@
<attribute
name=
"toolBarBreak"
>
<bool>
false
</bool>
</attribute>
<addaction
name=
"action_Open"
/>
<addaction
name=
"action_Open
Image
"
/>
</widget>
<action
name=
"action_Quit"
>
<property
name=
"text"
>
...
...
@@ -86,22 +86,22 @@
<string>
Ctrl+Q
</string>
</property>
</action>
<action
name=
"action_Open"
>
<action
name=
"action_Open
Image
"
>
<property
name=
"enabled"
>
<bool>
fals
e
</bool>
<bool>
tru
e
</bool>
</property>
<property
name=
"icon"
>
<iconset
resource=
"mvdMainWindow.qrc"
>
<normaloff>
:/icons/action_Open_Icon
</normaloff>
:/icons/action_Open_Icon
</iconset>
</property>
<property
name=
"text"
>
<string>
&
Open...
</string>
<string>
&
Open
image
...
</string>
</property>
<property
name=
"iconText"
>
<string>
Open...
</string>
<string>
Open
image
...
</string>
</property>
<property
name=
"toolTip"
>
<string>
Open file.
</string>
<string>
Open
image-
file.
</string>
</property>
<property
name=
"shortcut"
>
<string>
Ctrl+O
</string>
...
...
Code/Common/Core/CMakeLists.txt
View file @
94032551
...
...
@@ -5,6 +5,7 @@
set
(
Common_Core_SOURCES
mvdAbstractImageModel.cxx
mvdAbstractModel.cxx
mvdAbstractWorker.cxx
mvdAlgorithm.cxx
mvdDatasetDescriptor.cxx
mvdDatabaseModel.cxx
...
...
@@ -29,6 +30,7 @@ set( Common_Core_SOURCES
set
(
Common_Core_HEADERS_MOC
mvdAbstractImageModel.h
mvdAbstractModel.h
mvdAbstractWorker.h
# mvdAlgorithm.h
mvdDatabaseModel.h
mvdDatasetDescriptor.h
...
...
Code/Common/Core/mvdAbstractWorker.cxx
0 → 100644
View file @
94032551
/*=========================================================================
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 "mvdAbstractWorker.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)
//
// Monteverdi includes (sorted by alphabetic order)
namespace
mvd
{
/*
TRANSLATOR mvd::AbstractWorker
Necessary for lupdate to be aware of C++ namespaces.
Context comment for translator.
*/
/*****************************************************************************/
/* CONSTANTS */
namespace
{
}
// end of anonymous namespace.
/*****************************************************************************/
/* STATIC IMPLEMENTATION SECTION */
/*****************************************************************************/
/* CLASS IMPLEMENTATION SECTION */
/*******************************************************************************/
AbstractWorker
::
AbstractWorker
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
/*******************************************************************************/
AbstractWorker
::~
AbstractWorker
()
{
}
/*******************************************************************************/
/* SLOTS */
/*******************************************************************************/
}
// end namespace 'mvd'
Code/Common/Core/mvdAbstractWorker.h
0 → 100644
View file @
94032551
/*=========================================================================
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 __mvdAbstractWorker_h
#define __mvdAbstractWorker_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)
/*****************************************************************************/
/* PRE-DECLARATION SECTION */
//
// External classes pre-declaration.
namespace
{
}
namespace
mvd
{
//
// Internal classes pre-declaration.
/*****************************************************************************/
/* CLASS DEFINITION SECTION */
/**
* \class AbstractWorker
*
* \brief Abstract worker object used as a base-class for threaded tasks.
*/
class
Monteverdi2_EXPORT
AbstractWorker
:
public
QObject
{
/*-[ QOBJECT SECTION ]-----------------------------------------------------*/
Q_OBJECT
;
/*-[ PUBLIC SECTION ]------------------------------------------------------*/
//
// Public methods.
public:
/** \brief Destructor. */
virtual
~
AbstractWorker
();
/*-[ PUBLIC SLOTS SECTION ]------------------------------------------------*/
//
// Public SLOTS.
public
slots
:
/*-[ SIGNALS SECTION ]-----------------------------------------------------*/
//
// Signals.
signals:
/*-[ PROTECTED SECTION ]---------------------------------------------------*/
//
// Protected methods.
protected:
/** \brief Constructor. */
AbstractWorker
(
QObject
*
parent
=
NULL
);
//
// Protected attributes.
protected:
/*-[ PRIVATE SECTION ]-----------------------------------------------------*/
//
// Private methods.
private:
//
// Private attributes.
private:
/*-[ 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 // __mvdAbstractWorker_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