Commit 7ce71d7b authored by Cédric Traizet's avatar Cédric Traizet

STY: apply clang-format to the whole library

parent 96347f4b
Pipeline #2632 passed with stages
in 86 minutes and 27 seconds

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -57,9 +57,9 @@ int main(int argc, char* argv[])
// the types of the two input images and the type of the generated change
// image (which is now of multi-components), in a similar way as the
// KullbackLeiblerDistanceImageFilter.
using ImageType = otb::Image<PixelType, Dimension>;
using VectorImageType = otb::VectorImage<PixelType, Dimension>;
using FilterType = otb::KullbackLeiblerProfileImageFilter<ImageType, ImageType, VectorImageType>;
using ImageType = otb::Image<PixelType, Dimension>;
using VectorImageType = otb::VectorImage<PixelType, Dimension>;
using FilterType = otb::KullbackLeiblerProfileImageFilter<ImageType, ImageType, VectorImageType>;
using OutVectorImageType = otb::VectorImage<OutPixelType, Dimension>;
using ReaderType = otb::ImageFileReader<ImageType>;
using WriterType = otb::ImageFileWriter<OutVectorImageType>;
......
......@@ -148,7 +148,7 @@ int CSVConfusionMatrixFileReader(const std::string fileName, MapOfClassesType& m
if (mapOfClassesRefClX.count(labelProd) != 0)
{
// Indice of labelProd in mapOfClassesRefClX; itMapOfClassesRef->second elements are already SORTED
indiceLabelProd = mapOfClassesRefClX[labelProd];
indiceLabelProd = mapOfClassesRefClX[labelProd];
confusionMatrixClX(indiceLabelRef, indiceLabelProd) = confusionMatrixClXTemp(indiceLabelRefTemp, indiceLabelProdTemp);
}
}
......
......@@ -210,7 +210,7 @@ int main(int argc, char* argv[])
#ifdef OTB_MUPARSER_HAS_CXX_LOGICAL_OPERATORS
std::string leftExpr = "inleft != 0 ? 255 : 0";
#else
std::string leftExpr = "if(inleft != 0,255,0)";
std::string leftExpr = "if(inleft != 0,255,0)";
#endif
m_LBandMathFilter->SetExpression(leftExpr);
......
......@@ -31,7 +31,7 @@
#include "otbImage.h"
int main(int, char*[])
int main(int, char* [])
{
// Then we must decide with what type to represent the pixels
// and what the dimension of the image will be. With these two
......
......@@ -32,7 +32,7 @@
#include "otbImage.h"
int main(int, char*[])
int main(int, char* [])
{
// First the image type should be declared
using ImageType = otb::Image<unsigned short, 2>;
......
......@@ -61,7 +61,7 @@
#include "otbImage.h"
#include "itkPoint.h"
int main(int, char*[])
int main(int, char* [])
{
using ImageType = otb::Image<unsigned short, 2>;
......
......@@ -46,7 +46,7 @@
#include "otbVectorImage.h"
int main(int, char*[])
int main(int, char* [])
{
// The VectorImage class is templated over the type used to represent
// the coordinate in space and over the dimension of the space. In
......
......@@ -209,7 +209,7 @@ public:
if ((!mask && !m_InvertedMask) || (mask && m_InvertedMask))
{
for (unsigned int i = 0; i < m_SatRSR->GetNbBands(); i++)
pix[i] = static_cast<typename OutputPixelType::ValueType>(0);
pix[i] = static_cast<typename OutputPixelType::ValueType>(0);
return pix;
}
......@@ -254,13 +254,13 @@ public:
// or the spectra has been set from outside the functor (ex. bare soil, etc.)
else if (m_LabelSpectra.find(label) != m_LabelSpectra.end())
{
for (unsigned int i = 0; i < SimNbBands; i++)
for (unsigned int i = 0; i < SimNbBands; i++)
hxSpectrum[i].second = static_cast<typename OutputPixelType::ValueType>(m_LabelSpectra[label][i]);
}
// or the class does not exist
else
{
for (unsigned int i = 0; i < SimNbBands; i++)
for (unsigned int i = 0; i < SimNbBands; i++)
hxSpectrum[i].second = static_cast<typename OutputPixelType::ValueType>(0);
}
// Spectral response \code{aResponse} is set using \code{hxSpectrum}.
......@@ -285,7 +285,7 @@ public:
// \code{pix} value is returned for desired Satellite bands
for (unsigned int i = 0; i < m_SatRSR->GetNbBands(); i++)
pix[i] = static_cast<typename OutputPixelType::ValueType>(reducedResponse[i].second);
pix[i] = static_cast<typename OutputPixelType::ValueType>(reducedResponse[i].second);
return pix;
}
......@@ -462,7 +462,7 @@ int main(int argc, char* argv[])
using SimuFunctorType = otb::Functor::ProsailSimulatorFunctor<LAIPixelType, LabelType, MaskPixelType, SimulatedImageType::PixelType, SpectraParameterType,
LabelParameterMapType, AcquistionParsType, SatRSRType>;
using SimulatorType = otb::TernaryFunctorImageFilterWithNBands<LAIImageType, LabelImageType, MaskImageType, SimulatedImageType, SimuFunctorType>;
using SimulatorType = otb::TernaryFunctorImageFilterWithNBands<LAIImageType, LabelImageType, MaskImageType, SimulatedImageType, SimuFunctorType>;
// Read the acquisition parameter file which is like
// Angl val
......
......@@ -27,7 +27,9 @@
* \see http://www.boost.org/
* @{
*/
namespace boost { }
namespace boost
{
}
//@}
#endif // otbBoostDox_h
......@@ -31,31 +31,31 @@
#include <boost/range/empty.hpp>
namespace otb
{
/**\ingroup Common
* Joins elements from a range into a stream.
* \tparam TRange range type, see <a
* href="www.boost.org/doc/libs/release/libs/range/doc/html/">boost.Range</a>
* to see what qualifies as an \em Range.
* \param os destination stream
* \param[in] range Range to print
* \param[in] separator Separator string to use between elements.
*
* \return the stream
* \throw None At least, this function is exception neutral.
*/
template <typename TRange> inline
std::ostream & Join(std::ostream &os, TRange const& range, std::string const& separator)
/**\ingroup Common
* Joins elements from a range into a stream.
* \tparam TRange range type, see <a
* href="www.boost.org/doc/libs/release/libs/range/doc/html/">boost.Range</a>
* to see what qualifies as an \em Range.
* \param os destination stream
* \param[in] range Range to print
* \param[in] separator Separator string to use between elements.
*
* \return the stream
* \throw None At least, this function is exception neutral.
*/
template <typename TRange>
inline std::ostream& Join(std::ostream& os, TRange const& range, std::string const& separator)
{
if (!boost::empty(range))
{
{
typename boost::range_iterator<TRange const>::type first = boost::begin(range);
typename boost::range_iterator<TRange const>::type const last = boost::end(range);
typename boost::range_iterator<TRange const>::type const last = boost::end(range);
os << *first;
for (++first; first!=last; ++first)
{
for (++first; first != last; ++first)
{
os << separator << *first;
}
}
}
return os;
}
} // end namespace otb
......
......@@ -48,18 +48,19 @@ namespace otb
{
namespace Utils
{
template <typename Res, typename In >
inline
Res LexicalCast(In const& in, std::string const& kind) {
try
{
return boost::lexical_cast<Res>(in);
}
catch (boost::bad_lexical_cast &) {
std::ostringstream oss;
oss << "Cannot decode '" << in << "' as this is not a valid value for '" << kind << "'";
throw std::runtime_error(oss.str());
}
template <typename Res, typename In>
inline Res LexicalCast(In const& in, std::string const& kind)
{
try
{
return boost::lexical_cast<Res>(in);
}