/src/PROJ/src/iso19111/operation/coordinateoperation_private.hpp
Line | Count | Source |
1 | | /****************************************************************************** |
2 | | * |
3 | | * Project: PROJ |
4 | | * Purpose: ISO19111:2019 implementation |
5 | | * Author: Even Rouault <even dot rouault at spatialys dot com> |
6 | | * |
7 | | ****************************************************************************** |
8 | | * Copyright (c) 2018, Even Rouault <even dot rouault at spatialys dot com> |
9 | | * |
10 | | * Permission is hereby granted, free of charge, to any person obtaining a |
11 | | * copy of this software and associated documentation files (the "Software"), |
12 | | * to deal in the Software without restriction, including without limitation |
13 | | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
14 | | * and/or sell copies of the Software, and to permit persons to whom the |
15 | | * Software is furnished to do so, subject to the following conditions: |
16 | | * |
17 | | * The above copyright notice and this permission notice shall be included |
18 | | * in all copies or substantial portions of the Software. |
19 | | * |
20 | | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
21 | | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
22 | | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
23 | | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
24 | | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
25 | | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
26 | | * DEALINGS IN THE SOFTWARE. |
27 | | ****************************************************************************/ |
28 | | |
29 | | #ifndef COORDINATEROPERATION_PRIVATE_HPP |
30 | | #define COORDINATEROPERATION_PRIVATE_HPP |
31 | | |
32 | | #include "proj/coordinateoperation.hpp" |
33 | | #include "proj/util.hpp" |
34 | | |
35 | | // --------------------------------------------------------------------------- |
36 | | |
37 | | NS_PROJ_START |
38 | | namespace operation { |
39 | | |
40 | | // --------------------------------------------------------------------------- |
41 | | |
42 | | //! @cond Doxygen_Suppress |
43 | | struct CoordinateOperation::Private { |
44 | | util::optional<std::string> operationVersion_{}; |
45 | | std::vector<metadata::PositionalAccuracyNNPtr> |
46 | | coordinateOperationAccuracies_{}; |
47 | | std::weak_ptr<crs::CRS> sourceCRSWeak_{}; |
48 | | std::weak_ptr<crs::CRS> targetCRSWeak_{}; |
49 | | crs::CRSPtr interpolationCRS_{}; |
50 | | std::shared_ptr<util::optional<common::DataEpoch>> sourceCoordinateEpoch_{ |
51 | | std::make_shared<util::optional<common::DataEpoch>>()}; |
52 | | std::shared_ptr<util::optional<common::DataEpoch>> targetCoordinateEpoch_{ |
53 | | std::make_shared<util::optional<common::DataEpoch>>()}; |
54 | | bool hasBallparkTransformation_ = false; |
55 | | bool requiresPerCoordinateInputTime_ = false; |
56 | | |
57 | | // do not set this for a ProjectedCRS.definingConversion |
58 | | struct CRSStrongRef { |
59 | | crs::CRSNNPtr sourceCRS_; |
60 | | crs::CRSNNPtr targetCRS_; |
61 | | CRSStrongRef(const crs::CRSNNPtr &sourceCRSIn, |
62 | | const crs::CRSNNPtr &targetCRSIn) |
63 | 1.19M | : sourceCRS_(sourceCRSIn), targetCRS_(targetCRSIn) {} |
64 | | }; |
65 | | std::unique_ptr<CRSStrongRef> strongRef_{}; |
66 | | |
67 | 880k | Private() = default; |
68 | | Private(const Private &other) |
69 | 153k | : operationVersion_(other.operationVersion_), |
70 | 153k | coordinateOperationAccuracies_(other.coordinateOperationAccuracies_), |
71 | 153k | sourceCRSWeak_(other.sourceCRSWeak_), |
72 | 153k | targetCRSWeak_(other.targetCRSWeak_), |
73 | 153k | interpolationCRS_(other.interpolationCRS_), |
74 | 153k | sourceCoordinateEpoch_(other.sourceCoordinateEpoch_), |
75 | 153k | targetCoordinateEpoch_(other.targetCoordinateEpoch_), |
76 | 153k | hasBallparkTransformation_(other.hasBallparkTransformation_), |
77 | | requiresPerCoordinateInputTime_( |
78 | 153k | other.requiresPerCoordinateInputTime_), |
79 | 153k | strongRef_(other.strongRef_ |
80 | 153k | ? std::make_unique<CRSStrongRef>(*(other.strongRef_)) |
81 | 153k | : nullptr) {} |
82 | | |
83 | | Private &operator=(const Private &) = delete; |
84 | | }; |
85 | | //! @endcond |
86 | | |
87 | | // --------------------------------------------------------------------------- |
88 | | |
89 | | } // namespace operation |
90 | | NS_PROJ_END |
91 | | |
92 | | #endif // COORDINATEROPERATION_PRIVATE_HPP |