Skip to content
Snippets Groups Projects
Commit fd080219 authored by Luc Hermitte's avatar Luc Hermitte
Browse files

STY/COM: Comment non trivial code, improve style

parent 54c3291d
No related branches found
No related tags found
1 merge request!7Resolve "Factorize Computations in SARDEMProjection"
/*
* Copyright (C) 2005-2023 Centre National d'Etudes Spatiales (CNES)
* Copyright (C) 2005-2024 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
......@@ -24,9 +24,9 @@
#include "otbConfigure.h" // OTB_VERSION_MAJOR
#include "otbRepack.h"
#if (OTB_VERSION_MAJOR >= 8)
#include "otbSarSensorModel.h"
# include "otbSarSensorModel.h"
#else
#include "otbSarSensorModelAdapter.h"
# include "otbSarSensorModelAdapter.h"
#endif
#include <itkContinuousIndex.h>
......
/*
* Copyright (C) 2005-2023 Centre National d'Etudes Spatiales (CNES)
* Copyright (C) 2005-2024 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
......@@ -188,6 +188,7 @@ SARDEMPolygonsAnalysisImageFilter< TImageIn ,TImageOut, TImageDEM, TImageSAR, TF
{
m_Margin = 100;
}
otbMsgDevMacro(<< "margin used: " << m_Margin);
}
/**
......@@ -713,7 +714,7 @@ SARDEMPolygonsAnalysisImageFilter< TImageIn, TImageOut, TImageDEM, TImageSAR, TF
}
else // if (countSides == 3)
{
// Select extermes colunms among the three CLZY points to cover the biggest part of SAR Image
// Select extremes colunms among the three CLZY points to cover the biggest part of SAR Image
auto const Cmax_0 = std::max(CLZY_Up[0][0], CLZY_Down[0][0]);
auto const Cmin_0 = std::min(CLZY_Up[0][0], CLZY_Down[0][0]);
auto const Cmax_1 = std::max(CLZY_Up[1][0], CLZY_Down[1][0]);
......@@ -722,42 +723,44 @@ SARDEMPolygonsAnalysisImageFilter< TImageIn, TImageOut, TImageDEM, TImageSAR, TF
auto const Cmin_2 = std::min(CLZY_Up[2][0], CLZY_Down[2][0]);
// Max colunm
if (Cmax_0 > Cmax_1 && Cmax_0 > Cmax_2)
if (Cmax_0 > Cmax_1 && Cmax_0 > Cmax_2) // Cmax_0 is the max
{
i_InSideUp = i_Up[0];
i_InSideDown = i_Down[0];
// Min colunm
if (Cmin_0 < Cmin_1 && Cmin_0 < Cmin_2)
// TODO: can be simplified to idx = 1 if Cmin_1 < Cmax_2 else 2
if (Cmin_0 < Cmin_1 && Cmin_0 < Cmin_2) // Cmin_0 is the min
{
if (Cmin_1 < Cmin_2)
if (Cmin_1 < Cmin_2) // Cmin_0 < Cmin_1 < Cmin_2
{
i_OutSideUp = i_Up[1];
i_OutSideDown = i_Down[1];
}
else
else // Cmin_0 < Cmin_2 < Cmin_1
{
i_OutSideUp = i_Up[2];
i_OutSideDown = i_Down[2];
}
}
else if (Cmin_1 < Cmin_0 && Cmin_1 < Cmin_2)
else if (Cmin_1 < Cmin_0 && Cmin_1 < Cmin_2) // Cmin_1 is the min
{
i_OutSideUp = i_Up[1];
i_OutSideDown = i_Down[1];
}
else
else // Cmin_2 is the min
{
i_OutSideUp = i_Up[2];
i_OutSideDown = i_Down[2];
}
}
else if (Cmax_1 > Cmax_0 && Cmax_1 > Cmax_2)
else if (Cmax_1 > Cmax_0 && Cmax_1 > Cmax_2) // Cmax_1 is tha max
{
i_InSideUp = i_Up[1];
i_InSideDown = i_Down[1];
// Min colunm
// TODO: can be simplified to idx = 0 if Cmin_0 < Cmax_2 else 2
if (Cmin_0 < Cmin_1 && Cmin_0 < Cmin_2)
{
i_OutSideUp = i_Up[0];
......@@ -788,17 +791,18 @@ SARDEMPolygonsAnalysisImageFilter< TImageIn, TImageOut, TImageDEM, TImageSAR, TF
i_InSideDown = i_Down[2];
// Min colunm
if (Cmin_0 < Cmin_1 && Cmin_0 < Cmin_2)
// TODO: can be simplified to idx = 0 if Cmin_0 < Cmax_1 else 1
if (Cmin_0 < Cmin_1 && Cmin_0 < Cmin_2) // Cmin_0 is the min
{
i_OutSideUp = i_Up[0];
i_OutSideDown = i_Down[0];
}
else if (Cmin_1 < Cmin_0 && Cmin_1 < Cmin_2)
else if (Cmin_1 < Cmin_0 && Cmin_1 < Cmin_2) // Cmin_1 is the min
{
i_OutSideUp = i_Up[1];
i_OutSideDown = i_Down[1];
}
else
else // Cmin_2 is the min
{
if (Cmin_0 < Cmin_1)
{
......
/*
* Copyright (C) 2005-2021 Centre National d'Etudes Spatiales (CNES)
* Copyright (C) 2005-2023 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
......@@ -78,7 +78,7 @@ public:
/** Specialisation of OptResampleFilter with a remote
* sensing transform
*/
using GenericRSTransformType = GenericRSTransform<>;
using GenericRSTransformType = GenericRSTransform<double, 2, 2>;
using GenericRSTransformPointerType = typename GenericRSTransformType::Pointer;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment