From eec591b8880d5dcb9fb1f030a1f3e5397b6e1cb5 Mon Sep 17 00:00:00 2001 From: Lukas Werner <lks.werner@fau.de> Date: Fri, 26 Jan 2018 10:40:40 +0100 Subject: [PATCH] Inlined isPlaneVisible and coordinateToArrayIndex --- src/pe/raytracing/Raytracer.cpp | 4 ++-- src/pe/raytracing/Raytracer.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pe/raytracing/Raytracer.cpp b/src/pe/raytracing/Raytracer.cpp index a9ef0546f..33b40ab8f 100644 --- a/src/pe/raytracing/Raytracer.cpp +++ b/src/pe/raytracing/Raytracer.cpp @@ -179,7 +179,7 @@ void Raytracer::writeTBufferToFile(const std::vector<real_t>& tBuffer, const std * Checks if a plane should get rendered by comparing the planes normal and the ray direction. * If the rays direction vectors projection on the planes normal is positive, the plane is considered invisible. */ -bool Raytracer::isPlaneVisible(const PlaneID plane, const Ray& ray) const { +inline bool Raytracer::isPlaneVisible(const PlaneID plane, const Ray& ray) const { return plane->getNormal() * ray.getDirection() < 0; } @@ -188,7 +188,7 @@ bool Raytracer::isPlaneVisible(const PlaneID plane, const Ray& ray) const { * \param y Y component of the coordinate. * \return Array index. */ -size_t Raytracer::coordinateToArrayIndex(size_t x, size_t y) const { +inline size_t Raytracer::coordinateToArrayIndex(size_t x, size_t y) const { return y*pixelsHorizontal_ + x; } } diff --git a/src/pe/raytracing/Raytracer.h b/src/pe/raytracing/Raytracer.h index 9efa084f4..49b3c3521 100644 --- a/src/pe/raytracing/Raytracer.h +++ b/src/pe/raytracing/Raytracer.h @@ -124,8 +124,8 @@ public: private: void writeTBufferToFile(const std::vector<real_t>& tBuffer, size_t timestep, bool isGlobalImage = false) const; void writeTBufferToFile(const std::vector<real_t>& tBuffer, const std::string& fileName) const; - bool isPlaneVisible(const PlaneID plane, const Ray& ray) const; - size_t coordinateToArrayIndex(size_t x, size_t y) const; + inline bool isPlaneVisible(const PlaneID plane, const Ray& ray) const; + inline size_t coordinateToArrayIndex(size_t x, size_t y) const; //@} }; -- GitLab