geom/traits: add initial shape_traits trait
This commit is contained in:
parent
33b141eb3a
commit
979deaa4aa
@ -363,6 +363,7 @@ list (
|
||||
geom/segment.hpp
|
||||
geom/sphere.cpp
|
||||
geom/sphere.hpp
|
||||
geom/traits.hpp
|
||||
geom/tri.cpp
|
||||
geom/tri.hpp
|
||||
hash.hpp
|
||||
|
30
geom/traits.hpp
Normal file
30
geom/traits.hpp
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright 2019 Danny Robson <danny@nerdcruft.net>
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "fwd.hpp"
|
||||
|
||||
#include "../point.hpp"
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
|
||||
namespace cruft::geom {
|
||||
template <typename ShapeT>
|
||||
struct shape_traits { };
|
||||
|
||||
|
||||
template <std::size_t S, typename T>
|
||||
struct shape_traits <::cruft::region<S,T>> {
|
||||
static constexpr auto elements = S;
|
||||
using value_type = T;
|
||||
|
||||
using point_type = cruft::point<S,T>;
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user