diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-03-03 17:45:53 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2021-03-03 17:45:53 +0100 |
| commit | 095731d53405309c38bebe31af51d141f6319f1a (patch) | |
| tree | efa9f1e916c1c1373298900ac4e66702beec8f35 /src/transformations | |
| parent | 9e2eb067585b9a61b2b5e636547ac80dd4d01d06 (diff) | |
| download | PROJ-095731d53405309c38bebe31af51d141f6319f1a.tar.gz PROJ-095731d53405309c38bebe31af51d141f6319f1a.zip | |
Reformat code with clang-format-10 from ubuntu 20.04
Diffstat (limited to 'src/transformations')
| -rw-r--r-- | src/transformations/defmodel.cpp | 20 | ||||
| -rw-r--r-- | src/transformations/defmodel.hpp | 14 | ||||
| -rw-r--r-- | src/transformations/defmodel_impl.hpp | 27 | ||||
| -rw-r--r-- | src/transformations/tinshift_exceptions.hpp | 2 |
4 files changed, 34 insertions, 29 deletions
diff --git a/src/transformations/defmodel.cpp b/src/transformations/defmodel.cpp index 0d9f6690..443660c9 100644 --- a/src/transformations/defmodel.cpp +++ b/src/transformations/defmodel.cpp @@ -89,15 +89,17 @@ struct Grid : public GridPrototype { } } if (foundDesc && (!foundDescX || !foundDescY)) { - pj_log(ctx, PJ_LOG_ERROR, "grid %s : Found band description, " - "but not the ones expected", + pj_log(ctx, PJ_LOG_ERROR, + "grid %s : Found band description, " + "but not the ones expected", realGrid->name().c_str()); return false; } const auto unit = realGrid->unit(sampleX); if (!unit.empty() && unit != expectedUnit) { - pj_log(ctx, PJ_LOG_ERROR, "grid %s : Only unit=%s " - "currently handled for this mode", + pj_log(ctx, PJ_LOG_ERROR, + "grid %s : Only unit=%s " + "currently handled for this mode", realGrid->name().c_str(), expectedUnit.c_str()); return false; } @@ -145,15 +147,17 @@ struct Grid : public GridPrototype { } } if (foundDesc && !foundDescZ) { - pj_log(ctx, PJ_LOG_ERROR, "grid %s : Found band description, " - "but not the ones expected", + pj_log(ctx, PJ_LOG_ERROR, + "grid %s : Found band description, " + "but not the ones expected", realGrid->name().c_str()); return false; } const auto unit = realGrid->unit(sampleZ); if (!unit.empty() && unit != STR_METRE) { - pj_log(ctx, PJ_LOG_ERROR, "grid %s : Only unit=metre currently " - "handled for this mode", + pj_log(ctx, PJ_LOG_ERROR, + "grid %s : Only unit=metre currently " + "handled for this mode", realGrid->name().c_str()); return false; } diff --git a/src/transformations/defmodel.hpp b/src/transformations/defmodel.hpp index 6bf37d8b..7b511495 100644 --- a/src/transformations/defmodel.hpp +++ b/src/transformations/defmodel.hpp @@ -66,9 +66,9 @@ using json = nlohmann::json; class SpatialExtent { public: /** Parse the provided object as an extent. - * - * @throws ParsingException - */ + * + * @throws ParsingException + */ static SpatialExtent parse(const json &j); double minx() const { return mMinx; } @@ -130,9 +130,9 @@ class Epoch { class Component { public: /** Parse the provided object as a component. - * - * @throws ParsingException - */ + * + * @throws ParsingException + */ static Component parse(const json &j); /** Get a text description of the component. */ @@ -630,7 +630,7 @@ class Evaluator { // --------------------------------------------------------------------------- -} // namespace DeformationModel +} // namespace DEFORMATON_MODEL_NAMESPACE // --------------------------------------------------------------------------- diff --git a/src/transformations/defmodel_impl.hpp b/src/transformations/defmodel_impl.hpp index abd07286..afbf15ce 100644 --- a/src/transformations/defmodel_impl.hpp +++ b/src/transformations/defmodel_impl.hpp @@ -246,9 +246,8 @@ static double ISO8601ToDecimalYear(const std::string &dt) { throw ParsingException("Wrong formatting / invalid date-time for " + dt); } - return year + - (dayInYear * 86400 + hour * 3600 + min * 60 + sec) / - (isLeapYear ? 86400. * 366 : 86400. * 365); + return year + (dayInYear * 86400 + hour * 3600 + min * 60 + sec) / + (isLeapYear ? 86400. * 366 : 86400. * 365); } // --------------------------------------------------------------------------- @@ -1004,7 +1003,9 @@ bool Evaluator<Grid, GridSet, EvaluatorIface>::forward( !grid->getLonLatOffset(ix1, iy1, dx11, dy11)) { return false; } - } else /* if (compEx->displacementType == DisplacementType::THREE_D) */ { + } else /* if (compEx->displacementType == DisplacementType::THREE_D) + */ + { double dz00 = 0; double dz01 = 0; double dz10 = 0; @@ -1051,7 +1052,9 @@ bool Evaluator<Grid, GridSet, EvaluatorIface>::forward( !grid->getEastingNorthingOffset(ix1, iy1, de11, dn11)) { return false; } - } else /* if (compEx->displacementType == DisplacementType::THREE_D) */ { + } else /* if (compEx->displacementType == DisplacementType::THREE_D) + */ + { double dz00 = 0; double dz01 = 0; double dz10 = 0; @@ -1117,14 +1120,12 @@ bool Evaluator<Grid, GridSet, EvaluatorIface>::forward( const double sinlam = gridwithCacheRef.smallResx ? lam_rel_to_cell_center * - (1 - - (1. / 6) * (lam_rel_to_cell_center * - lam_rel_to_cell_center)) + (1 - (1. / 6) * (lam_rel_to_cell_center * + lam_rel_to_cell_center)) : sin(lam_rel_to_cell_center); const double coslam = gridwithCacheRef.smallResx - ? (1 - - 0.5 * (lam_rel_to_cell_center * - lam_rel_to_cell_center)) + ? (1 - 0.5 * (lam_rel_to_cell_center * + lam_rel_to_cell_center)) : cos(lam_rel_to_cell_center); // Convert back from geocentric deltas to easting, northing @@ -1243,8 +1244,8 @@ bool Evaluator<Grid, GridSet, EvaluatorIface>::inverse( return false; } #ifdef DEBUG_DEFMODEL - iface.log("After forward: x=" + toString(x_new) + ", y=" + - toString(y_new)); + iface.log("After forward: x=" + toString(x_new) + + ", y=" + toString(y_new)); #endif const double dx = x_new - x; const double dy = y_new - y; diff --git a/src/transformations/tinshift_exceptions.hpp b/src/transformations/tinshift_exceptions.hpp index d6d71302..1d13c2b1 100644 --- a/src/transformations/tinshift_exceptions.hpp +++ b/src/transformations/tinshift_exceptions.hpp @@ -49,4 +49,4 @@ const char *ParsingException::what() const noexcept { return msg_.c_str(); } // --------------------------------------------------------------------------- -} // namespace DEFORMATON_MODEL_NAMESPACE +} // namespace TINSHIFT_NAMESPACE |
