From: Mikko Rasa Date: Tue, 21 May 2013 13:40:04 +0000 (+0300) Subject: Miscellaneous fixes, mostly stylistic X-Git-Url: http://git.tdb.fi/?p=libs%2Fmath.git;a=commitdiff_plain;h=1e34b120f1229b1390cee67c917829715615ccd0 Miscellaneous fixes, mostly stylistic --- diff --git a/source/geometry/dummy.cpp b/source/geometry/dummy.cpp index 885bc5a..cc7e2ba 100644 --- a/source/geometry/dummy.cpp +++ b/source/geometry/dummy.cpp @@ -4,6 +4,7 @@ #include "circle.h" #include "hyperbox.h" #include "hypersphere.h" +#include "ray.h" #include "rectangle.h" #include "shape.h" #include "transformedshape.h" diff --git a/source/geometry/hyperbox.h b/source/geometry/hyperbox.h index 0e4efd8..42e4d61 100644 --- a/source/geometry/hyperbox.h +++ b/source/geometry/hyperbox.h @@ -72,7 +72,7 @@ inline bool HyperBox::contains(const LinAl::Vector &point) const using std::abs; for(unsigned i=0; idimensions[i]/2) + if(abs(point[i])>dimensions[i]/T(2)) return false; return true; } diff --git a/source/geometry/hypersphere.h b/source/geometry/hypersphere.h index de028fa..35cddd1 100644 --- a/source/geometry/hypersphere.h +++ b/source/geometry/hypersphere.h @@ -23,7 +23,7 @@ private: T radius; public: - HyperSphere(); + HyperSphere(): radius(1) { } explicit HyperSphere(T); virtual HyperSphere *clone() const; @@ -37,11 +37,6 @@ public: virtual unsigned get_intersections(const Ray &, SurfacePoint *, unsigned) const; }; -template -inline HyperSphere::HyperSphere(): - radius(1) -{ } - template inline HyperSphere::HyperSphere(T r): radius(r) diff --git a/source/geometry/transformedshape.h b/source/geometry/transformedshape.h index bf508f9..5a5cf11 100644 --- a/source/geometry/transformedshape.h +++ b/source/geometry/transformedshape.h @@ -48,7 +48,7 @@ inline TransformedShape::TransformedShape(const Shape &s, const Affi { } template -inline TransformedShape::TransformedShape(const TransformedShape &other): +inline TransformedShape::TransformedShape(const TransformedShape &other): shape(other.shape->clone()), transformation(other.transformation), inverse_trans(other.inverse_trans)