Commit 46ee96b6 authored by Guillaume Pasero's avatar Guillaume Pasero

MRG: synchronize with branch 'develop'

Conflicts:
	Modules/Applications/AppDomainTransform/app/otbDomainTransform.cxx
	Modules/MPI/MPIConfig/src/otbMPIConfig.cxx
parents 446e5939 f7409759
......@@ -312,7 +312,12 @@ if(OTB_WRAP_PYTHON)
set(OTB_CONFIG_CODE "${OTB_CONFIG_CODE}
set(OTB_PYTHONPATH \"${OTB_BINARY_DIR}/${OTB_INSTALL_PYTHON_DIR}\")")
endif()
if(OTB_HAS_CXX11)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(OTB_REQUIRED_CXX_FLAGS " -std=c++11")
endif()
endif()
set(OTB_CONFIG_APPLICATION_PATH "${OTB_BINARY_DIR}/${OTB_INSTALL_APP_DIR}")
set(OTB_CONFIG_TARGETS_CONDITION " AND NOT OTB_BINARY_DIR")
set(OTB_CONFIG_TARGETS_FILE "${OTB_BINARY_DIR}/OTBTargets.cmake")
......
......@@ -93,17 +93,17 @@ A: This is due to a conflict with system Qt4 (usually seen on KDE) and Qt4 + gtk
Q: Monteverdi and Mapla applications look different from my other applications.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A: By default, Monteverdi, Mapla and otbapplication (otbgui\_\*) uses a default gtk theme (plastic)
which is distributed with the OTB package!. We do this to be on safe side, like when a user does
not have gtk libraries installed when using our package.
A: By default, Monteverdi, Mapla and otbapplication (otbgui\_\*) uses a the
system gtk theme. If you can't install GTK on your system you can use the
distributed with the OTB package. Note that using system GTK is the preferred
way with the OTB standalone package as the distributed version of GTK do not
work on recent Linux distributions.
gtk libraries in the package is the reason why you are getting a default "plastic" look & feel that
makes it look different from other GUI applications.
To get same look and feel, you can "force" Monteverdi and Mapla to use system GTK.
To use the distributed GTK libraries you need to set the OTB_USE_LOCAL_GTK:
::
export OTB_USE_SYSTEM_GTK=1
export OTB_USE_LOCAL_GTK=1
And now start ``monteverdi.sh`` or ``mapla.sh`` from OTB-|release|-Linux64
To get back default behaviour, unset OTB_USE_SYSTEM_GTK=1 or set OTB_USE_SYSTEM_GTK=0
To get back default behaviour, unset OTB_USE_LOCAL_GTK=1 or set OTB_USE_LOCAL_GTK=0
Synopsis
--------
This archive provides a development kit for the ORFEO ToolBox library which
allows to easily compile OTB and facilitate the creation of programs based on
OTB.
It contains shared libraries of OTB dependencies and helper scripts for the
configuration and the compilation of the library.
Note that OTB sources are not included in the archive (see instructions below).
Prerequisites
-------------
- cmake (>= 3.2)
- gcc (>= 4.9)
- git
Extract XDK
-----------
::
cd /opt (You can use another a directory of your own choice)
chmod +x OTB-|release|-xdk-Linux64.run
./OTB-|release|-xdk-Linux64.run
**You now will have a directory named OTB-|release|-xdk-Linux64 in \'/opt\'**
Setup environment
-----------------
There is a helper script in package called **xdkenv.profile**. This script export
required environments to configure and build OTB.
::
cd /opt/OTB-|release|-xdk-Linux64
. ./xdkenv.profile
Test environment setup by checking value of CMAKE_PREFIX_PATH
::
echo $CMAKE_PREFIX_PATH
The above command will output:
/opt/OTB-|release|-xdk-Linux64
Download, Configure and build OTB
---------------------------------
::
mkdir -p /opt/OTB/build && cd /opt/OTB
git clone --depth=1 --branch=develop https://git@git.orfeo-toolbox.org/git/otb.git source
cd build && cmake ../source
make -j2
Notes
~~~~~
* By default, all OTB\_USE\_\* variables in OTB are set to FALSE except for 6S and SiftFast. You can check/activate them in your cmake-gui/ccmake.
* If you need to activate Qt4 modules (Monteverdi, Ice, QtWidget, ApplicationEngine ..), you must set *QT_BINARY_DIR*.
::
cd /opt/OTB/build && cmake -DOTB_USE_QT4=TRUE -DQT_BINARY_DIR=$CMAKE_PREFIX_PATH/bin
This is because Qt tools ( moc, rcc, et al) are reported as not found by cmake due to incorrect path in "qmake -query"
......@@ -12,22 +12,19 @@ Monteverdi is a satellite image viewer. Its main features are:
- **Powerful**: Access to all processing application from OTB. Orthorectification,
optical calibration, classification, SAR processing, and much more!
GUI : what does it look like ?
------------------------------
.. image:: Art/MonteverdiImages/gui.png
This is Monteverdi’s main window where the different functionalities are reachable:
This is Monteverdi’s main window where the different functionalities are:
#. Main menu
#. Top toolbar
#. Image displaying
#. Image View
#. Right side dock
#. Widgets
#. Stack layer
#. Layer stack
Main menu
~~~~~~~~~
......@@ -92,9 +89,9 @@ In the image displaying part:
- CTRL+Mouse drag = Quick scroll view (rending is done after releasing
CTRL key)
- CTRL+Mouse wheel = Zoom in out
- Mouse wheel = Zoom
- + or - = Zoom in out
- + or - = Zoom
In the layer stack part:
......
......@@ -62,7 +62,7 @@ FIND_PATH(OTB_DATA_ROOT README-OTB-Data PATHS $ENV{OTB_DATA_ROOT} ${OTB_SOURCE_D
FIND_PATH(OTB_DATA_LARGEINPUT_ROOT OTBData.readme PATHS $ENV{OTB_DATA_LARGEINPUT_ROOT})
IF( NOT OTB_DATA_LARGEINPUT_ROOT )
MESSAGE(FATAL_ERROR "Large input directory is not set")
MESSAGE(FATAL_ERROR "Large input directory is not set and is mandatory to build the Software Guide.")
ENDIF( NOT OTB_DATA_LARGEINPUT_ROOT )
# OTB_DATA_PATHS is searched recursively.. you need not enter sub-directories
......
......@@ -33,6 +33,7 @@ Julien Osman,
Julien Radoux (UCL),
Laurentiu Nicola (CS Romania),
Luc Hermitte (CS),
Ludovic Hussonnois (CS),
Manuel Grizonnet (CNES),
Massimo Di Stefano,
Mathieu Deltorre (CS),
......
......@@ -150,7 +150,7 @@ name of the files to write, but they also encapsulate the corresponding writers.
\section{Composite application}
The application framework has been extended to allow the implementation of composite applications :
applications that use other applications. The concept is simple : you have two applications A and B
\textbf{applications that use other applications}. The concept is simple : you have two applications A and B
that you want to chain in order to build a third application C. Rather than writing C by copying
the code of A and B, you would like to re-use applications A and B. This plain example will be
re-used in this section for explanations.
......@@ -231,7 +231,7 @@ with \code{b.in}. In this case, you have to manually call the writers of paramet
\code{a.out}.
\end{itemize}
At the moment, the connexion of vector data parameters is not supported.
At the moment, the in-memory connexion of vector data parameters is not supported.
\subsection{Orchestration}
......@@ -242,8 +242,17 @@ parameter update.
In the \code{DoExecute()} of your composite application, you have to call \code{ExecuteInternal()}
in order to launch each internal application. The order should be compatible with
image parameter connexions. If you want to do "in-memory" connexions, you can to it between
two calls to \code{ExecuteInternal()}.
image parameter connexions. If you want to do "in-memory" connexions, you can do it between
two calls to \code{ExecuteInternal()}, for instance :
\small
\begin{lstlisting}
ExecuteInternal("a");
GetInternalApplication("b")->SetParameterInputImage("in",
GetInternalApplication("a")->GetParameterOutputImage("out"));
ExecuteInternal("b");
\end{lstlisting}
\normalsize
The application BundleToPerfectSensor is a simple example of composite applications.
For a more complex example, you can check the application TrainImagesClassifier.
......
......@@ -42,6 +42,12 @@ using boost::interprocess::move;
/*===========================================================================*/
/*================================[ Feature ]================================*/
/*===========================================================================*/
inline
void otb::ogr::Feature::CheckInvariants() const
{
assert(m_Feature && "OGRFeature can't be null");
}
inline
otb::ogr::Feature otb::ogr::Feature::Clone() const
{
......@@ -199,11 +205,4 @@ void otb::ogr::Feature::PrintSelf(std::ostream & os, itk::Indent indent) const
UncheckedPrintSelf(os, indent);
}
inline
void otb::ogr::Feature::CheckInvariants() const
{
assert(m_Feature && "OGRFeature can't be null");
}
#endif // otbOGRFeatureWrapper_txx
......@@ -166,6 +166,9 @@ public:
*/
void Assign(Field const& f);
/** \copydoc Field::ogr() const */
OGRField & ogr();
/** Access to the raw underlying OGR data.
* This function provides an abstraction leak in case deeper control on the
* underlying \c OGRFeature is required.
......@@ -174,9 +177,6 @@ public:
*/
OGRField & ogr() const;
/** \copydoc Field::ogr() const */
OGRField & ogr();
private:
/**\name Unchecked definitions
* All the definitions that follow do the real work. However, they are not the
......
......@@ -465,12 +465,6 @@ void otb::ogr::Field::Assign(Field const& f)
CheckInvariants();
}
inline
OGRField & otb::ogr::Field::ogr() const
{
return const_cast <Field*>(this)->ogr();
}
inline
OGRField & otb::ogr::Field::ogr()
{
......@@ -480,4 +474,10 @@ OGRField & otb::ogr::Field::ogr()
return *f;
}
inline
OGRField & otb::ogr::Field::ogr() const
{
return const_cast <Field*>(this)->ogr();
}
#endif // otbOGRFieldWrapper_txx
......@@ -506,7 +506,11 @@ public:
*/
OGRwkbGeometryType GetGeomType() const;
friend bool otb::ogr::operator==(Layer const& lhs, Layer const& rhs);
friend bool operator==(Layer const& lhs, Layer const& rhs)
{
const bool equal = lhs.m_Layer.get() == rhs.m_Layer.get();
return equal;
}
private:
/**
......
......@@ -448,8 +448,3 @@ OGRwkbGeometryType otb::ogr::Layer::GetGeomType() const
#endif
}
bool otb::ogr::operator==(Layer const& lhs, Layer const& rhs)
{
const bool equal = lhs.m_Layer.get() == rhs.m_Layer.get();
return equal;
}
/*=========================================================================
Program: ORFEO Toolbox
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.
=========================================================================*/
#ifndef otbSarSensorModelAdapter_h
#define otbSarSensorModelAdapter_h
#include <memory>
#include "otbDEMHandler.h"
namespace ossimplugins
{
class ossimSarSensorModel;
}
namespace otb
{
class ImageKeywordlist;
/**
* \class SarSensorModelAdapter
* \brief Wrapper class to access SarSensorModel specific methods
*
* This class is NOT intended to be used outside of OTB. Use the
* InverseSensorModel and ForwardSensorModel. If you feel that you need to use
* it directly, think again!
*
* \sa InverseSensorModel
* \sa ForwardSensorModel
* \ingroup Projection
*
*
* \ingroup OTBOSSIMAdapters
**/
class OTBOSSIMAdapters_EXPORT SarSensorModelAdapter: public itk::Object
{
public:
/** Standard class typedefs. */
typedef SarSensorModelAdapter Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef std::auto_ptr<ossimplugins::ossimSarSensorModel> InternalModelPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(SarSensorModelAdapter, itk::Object);
/** Load model from keyword list */
bool LoadState(const ImageKeywordlist& image_kwl);
/** Save keyword list from model */
bool SaveState(ImageKeywordlist & image_kwl);
/** Is sensor model valid method. return false if the m_SensorModel is null*/
bool IsValidSensorModel() const;
/** Deburst metadata if possible and return lines to keep in image file */
bool Deburst(std::vector<std::pair<unsigned long, unsigned long> > & lines);
static bool ImageLineToDeburstLine(const std::vector<std::pair<unsigned long,unsigned long> >& lines, unsigned long imageLine, unsigned long & deburstLine);
static void DeburstLineToImageLine(const std::vector<std::pair<unsigned long,unsigned long> >& lines, unsigned long deburstLine, unsigned long & imageLine);
protected:
SarSensorModelAdapter();
virtual ~SarSensorModelAdapter() ITK_OVERRIDE;
private:
SarSensorModelAdapter(const Self &); //purposely not implemented
void operator =(const Self&); //purposely not implemented
InternalModelPointer m_SensorModel;
};
} // namespace otb
#endif
......@@ -11,6 +11,7 @@ set(OTBOSSIMAdapters_SRC
otbFilterFunctionValues.cxx
otbMetaDataKey.cxx
otbEllipsoidAdapter.cxx
otbSarSensorModelAdapter.cxx
)
add_library(OTBOSSIMAdapters ${OTBOSSIMAdapters_SRC})
......
/*=========================================================================
Program: ORFEO Toolbox
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 "otbSarSensorModelAdapter.h"
#include <cassert>
#include "otbMacro.h"
#include "otbImageKeywordlist.h"
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wshadow"
#pragma GCC diagnostic ignored "-Woverloaded-virtual"
#include "ossim/ossimSarSensorModel.h"
#include "ossim/ossimPluginProjectionFactory.h"
#pragma GCC diagnostic pop
#else
#include "ossim/ossimSarSensorModel.h"
#include "ossim/ossimPluginProjectionFactory.h"
#endif
namespace otb
{
SarSensorModelAdapter::SarSensorModelAdapter():
m_SensorModel(ITK_NULLPTR)
{
}
SarSensorModelAdapter::~SarSensorModelAdapter()
{}
bool SarSensorModelAdapter::LoadState(const ImageKeywordlist& image_kwl)
{
// InternalModelPointer model = new ossimplugins::ossimSarSensorModel();
ossimKeywordlist geom;
image_kwl.convertToOSSIMKeywordlist(geom);
m_SensorModel.reset(dynamic_cast<ossimplugins::ossimSarSensorModel* >(ossimplugins::ossimPluginProjectionFactory::instance()->createProjection(geom)));
return IsValidSensorModel();
}
bool SarSensorModelAdapter::SaveState(ImageKeywordlist & image_kwl)
{
if(m_SensorModel.get() != ITK_NULLPTR)
{
ossimKeywordlist geom;
bool success = m_SensorModel->saveState(geom);
if(success)
{
image_kwl.Clear();
image_kwl.SetKeywordlist(geom);
}
return success;
}
return false;
}
bool SarSensorModelAdapter::IsValidSensorModel() const
{
return m_SensorModel.get() != ITK_NULLPTR;
}
bool SarSensorModelAdapter::Deburst(std::vector<std::pair<unsigned long, unsigned long> > & lines)
{
if(m_SensorModel.get() != ITK_NULLPTR)
{
return m_SensorModel->deburst(lines);
}
return false;
}
bool SarSensorModelAdapter::ImageLineToDeburstLine(const std::vector<std::pair<unsigned long,unsigned long> >& lines, unsigned long imageLine, unsigned long & deburstLine)
{
return ossimplugins::ossimSarSensorModel::imageLineToDeburstLine(lines,imageLine,deburstLine);
}
void SarSensorModelAdapter::DeburstLineToImageLine(const std::vector<std::pair<unsigned long,unsigned long> >& lines, unsigned long deburstLine, unsigned long & imageLine)
{
ossimplugins::ossimSarSensorModel::deburstLineToImageLine(lines,deburstLine,imageLine);
}
} // namespace otb
......@@ -66,13 +66,18 @@ GetExistingDirectory( QWidget * p,
const QString& dir,
QFileDialog::Options options )
{
QString dialogCaption(caption.isEmpty()
? QObject::tr( "Select directory..." )
: caption);
QString dialogDir(dir.isEmpty()
? RecentDirectory
: dir);
QString path(
QFileDialog::getExistingDirectory(
p,
caption.isEmpty()
? QObject::tr( "Select directory..." )
: caption,
dir.isEmpty() ? RecentDirectory : dir,
dialogCaption,
dialogDir,
options
)
);
......@@ -95,13 +100,18 @@ GetOpenFileName( QWidget * p,
QString* selectedFilter,
QFileDialog::Options options )
{
QString dialogCaption(caption.isEmpty()
? QObject::tr( "Open file..." )
: caption);
QString dialogDir(dir.isEmpty()
? RecentDirectory
: dir);
QString filename(
QFileDialog::getOpenFileName(
p,
caption.isEmpty()
? QObject::tr( "Open file..." )
: caption,
dir.isEmpty() ? RecentDirectory : dir,
dialogCaption,
dialogDir,
filter,
selectedFilter,
options
......@@ -124,13 +134,18 @@ GetOpenFileNames( QWidget * p,
QString * selectedFilter,
QFileDialog::Options options )
{
QString dialogCaption(caption.isEmpty()
? QObject::tr( "Open file..." )
: caption);
QString dialogDir(dir.isEmpty()
? RecentDirectory
: dir);
QStringList filenames(
QFileDialog::getOpenFileNames(
p,
caption.isEmpty()
? QObject::tr( "Open file..." )
: caption,
dir.isEmpty() ? RecentDirectory : dir,
dialogCaption,
dialogDir,
filter,
selectedFilter,
options
......@@ -153,13 +168,18 @@ GetSaveFileName( QWidget * p,
QString * selectedFilter,
QFileDialog::Options options )
{
QString dialogCaption(caption.isEmpty()
? QObject::tr( "Save file..." )
: caption);
QString dialogDir(dir.isEmpty()
? RecentDirectory
: dir);
QString filename(
QFileDialog::getSaveFileName(
p,
caption.isEmpty()
? QObject::tr( "Save file..." )
: caption,
dir.isEmpty() ? RecentDirectory : dir,
dialogCaption,
dialogDir,
filter,
selectedFilter,
options
......
......@@ -140,12 +140,12 @@ private:
AddParameter(ParameterType_String, "cri", "Criterion");
SetParameterDescription("cri", "Dempster Shafer criterion (by default (belief+plausibility)/2)");
MandatoryOff("cri");
SetParameterString("cri","((Belief + Plausibility)/2.)");
SetParameterString("cri","((Belief + Plausibility)/2.)", false);
AddParameter(ParameterType_Float,"wgt","Weighting");
SetParameterDescription("wgt","Coefficient between 0 and 1 to promote undetection or false detections (default 0.5)");
MandatoryOff("wgt");
SetParameterFloat("wgt", 0.5);
SetParameterFloat("wgt",0.5, false);
AddParameter(ParameterType_InputFilename,"initmod","initialization model");
SetParameterDescription("initmod","Initialization model (xml file) to be used. If the xml initialization model is set, the descriptor list is not used (specified using the option -desclist)");
......@@ -154,12 +154,12 @@ private:
AddParameter(ParameterType_StringList, "desclist","Descriptor list");
SetParameterDescription("desclist","List of the descriptors to be used in the model (must be specified to perform an automatic initialization)");
MandatoryOff("desclist");
SetParameterString("desclist","");
SetParameterString("desclist","", false);
AddParameter(ParameterType_Int,"maxnbit","Maximum number of iterations");
MandatoryOff("maxnbit");
SetParameterDescription("maxnbit","Maximum number of optimizer iteration (default 200)");
SetParameterInt("maxnbit", 200);