EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
EBGeometry_StreamOperators.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2022 Robert Marskar <robert.marskar@sintef.no>
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
14#ifndef EBGEOMETRY_STREAMOPERATORS_HPP
15#define EBGEOMETRY_STREAMOPERATORS_HPP
16
17// Std includes
18#include <ostream>
19
20// Our includes
22#include "EBGeometry_Vec.hpp"
23
24namespace EBGeometry {
25
33template <class T>
34inline std::ostream&
35operator<<(std::ostream& a_os, const Vec3T<T>& a_vec)
36{
37 a_os << '(' << a_vec[0] << ',' << a_vec[1] << ',' << a_vec[2] << ')';
38
39 return a_os;
40}
41
42namespace BoundingVolumes {
43
51template <class T>
52inline std::ostream&
53operator<<(std::ostream& a_os, const AABBT<T>& a_aabb)
54{
55 a_os << '(' << a_aabb.getLowCorner() << ", " << a_aabb.getHighCorner() << ')';
56
57 return a_os;
58}
59
60} // namespace BoundingVolumes
61
62} // namespace EBGeometry
63
64#endif
Declarations of bounding volume types used in bounding volume hierarchies.
Declaration of 2D and 3D point/vector classes with templated precision, and free functions on them.
Axis-aligned bounding box (AABB) enclosing a set of 3D points.
Definition EBGeometry_BoundingVolumes.hpp:37
Vec3T< T > & getLowCorner() noexcept
Get a modifiable reference to the low corner of the AABB.
Vec3T< T > & getHighCorner() noexcept
Get a modifiable reference to the high corner of the AABB.
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:258
std::ostream & operator<<(std::ostream &a_os, const AABBT< T > &a_aabb)
Print a bounding box as (low corner, high corner).
Definition EBGeometry_StreamOperators.hpp:53
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_Affine.hpp:26
std::ostream & operator<<(std::ostream &a_os, const Vec3T< T > &a_vec)
Print a vector as (x,y,z).
Definition EBGeometry_StreamOperators.hpp:35