diff --git a/CMakeLists.txt b/CMakeLists.txt index fbee8d3b..0118de99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -230,7 +230,6 @@ list ( geom/fwd.hpp geom/aabb.cpp geom/aabb.hpp - geom/aabb.ipp geom/cylinder.cpp geom/cylinder.hpp geom/ellipse.cpp diff --git a/geom/aabb.hpp b/geom/aabb.hpp index a471136c..de82c9a2 100644 --- a/geom/aabb.hpp +++ b/geom/aabb.hpp @@ -79,6 +79,26 @@ namespace util::geom { typedef aabb<3,int> aabb3i; } -#include "aabb.ipp" + +/////////////////////////////////////////////////////////////////////////////// +#include "./sample.hpp" + +#include + +namespace util::geom { + template + struct sampler { + static point + fn (aabb b, G &g) + { + std::uniform_real_distribution d; + + point p; + std::generate (p.begin (), p.end (), [&] (void) { return d (g); }); + + return p * (b.p1 - b.p0) + b.p0.template as (); + } + }; +} #endif diff --git a/geom/aabb.ipp b/geom/aabb.ipp deleted file mode 100644 index 6e13332e..00000000 --- a/geom/aabb.ipp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Copyright 2015 Danny Robson - */ - -#if defined(__UTIL_GEOM_AABB_IPP) -#error -#endif - -#define __UTIL_GEOM_AABB_IPP - -#include "sample.hpp" - -#include - - -/////////////////////////////////////////////////////////////////////////////// -namespace util::geom { - template - struct sampler { - static point - fn (aabb b, G &g) - { - std::uniform_real_distribution d; - - point p; - std::generate (p.begin (), p.end (), [&] (void) { return d (g); }); - - return p * (b.p1 - b.p0) + b.p0.template as (); - } - }; -}