Loading...
Searching...
No Matches
box.hpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022-2024, 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
20
21namespace cuspatial {
22
34template <typename T, typename Vertex = cuspatial::vec_2d<T>>
35class alignas(sizeof(Vertex)) box {
36 public:
37 using value_type = T;
38 Vertex v1;
39 Vertex v2;
40
41 private:
45 friend std::ostream& operator<<(std::ostream& os, cuspatial::box<T, Vertex> const& b)
46 {
47 return os << "{" << b.v1 << ", " << b.v2 << "}";
48 }
49};
50
51// deduction guide, enables CTAD
52template <typename T>
53box(vec_2d<T> a, vec_2d<T> b) -> box<T, vec_2d<T>>;
54
59} // namespace cuspatial
A generic axis-aligned box type.
Definition box.hpp:35
friend std::ostream & operator<<(std::ostream &os, cuspatial::box< T, Vertex > const &b)
Output stream operator for box<T> for human-readable formatting.
Definition box.hpp:45