Loading...
Searching...
No Matches
operation.cuh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023, NVIDIA CORPORATION.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <cuproj/detail/utility/cuda.hpp>
21
22namespace cuproj {
23
36 AXIS_SWAP,
37 DEGREES_TO_RADIANS,
38 CLAMP_ANGULAR_COORDINATES,
39 OFFSET_SCALE_CARTESIAN_COORDINATES,
40 TRANSVERSE_MERCATOR
41};
42
44enum direction { FORWARD, INVERSE };
45
48{
49 return dir == direction::FORWARD ? direction::INVERSE : direction::FORWARD;
50}
51
62template <typename Coordinate, typename T = typename Coordinate::value_type>
63class operation {
64 public:
72 CUPROJ_HOST_DEVICE Coordinate operator()(Coordinate const& c, direction dir) const { return c; }
73
86 projection_parameters<T> setup(projection_parameters<T> const& params) { return params; };
87};
88
93} // namespace cuproj
Base class for all transform operations.
Definition operation.cuh:63
CUPROJ_HOST_DEVICE Coordinate operator()(Coordinate const &c, direction dir) const
Applies the transform operation to a coordinate.
Definition operation.cuh:72
projection_parameters< T > setup(projection_parameters< T > const &params)
Modifies the projection parameters for the transform operation.
Definition operation.cuh:86
direction
Enumerates the direction of a transform operation.
Definition operation.cuh:44
operation_type
Enumerates the different types of transform operations.
Definition operation.cuh:35
direction reverse(direction dir)
Returns the opposite of a direction.
Definition operation.cuh:47