MobileRT  1.0
A multi platform C++ CPU progressive Ray Tracer.
Utils.hpp File Reference
#include "Utils_dependent.hpp"
#include <algorithm>
#include <array>
#include <boost/assert.hpp>
#include <chrono>
#include <cmath>
#include <glm/ext.hpp>
#include <glm/glm.hpp>
#include <glm/gtx/string_cast.hpp>
#include <pcg_random.hpp>
#include <random>
#include <string>
#include <sstream>
#include <thread>
#include <vector>
Include dependency graph for Utils.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 MobileRT
 
 MobileRT::std
 

Macros

#define GLM_ENABLE_EXPERIMENTAL
 
#define LOG_DEBUG(...)
 
#define LOG_INFO(...)
 
#define LOG_WARN(...)
 
#define LOG_ERROR(...)
 
#define ASSERT(condition, ...)
 

Functions

template<typename T , ::std::size_t S>
void MobileRT::fillArrayWithHaltonSeq (::std::array< T, S > *values)
 
template<typename T , ::std::size_t S>
void MobileRT::fillArrayWithMersenneTwister (::std::array< T, S > *values)
 
template<typename T , ::std::size_t S>
void MobileRT::fillArrayWithPCG (::std::array< T, S > *values)
 
inline ::std::string MobileRT::getFileName (const char *filepath)
 
::std::int32_t MobileRT::roundDownToMultipleOf (const ::std::int32_t value, const ::std::int32_t multiple)
 
float MobileRT::haltonSequence (::std::uint32_t index, const ::std::uint32_t base)
 
::std::int32_t MobileRT::incrementalAvg (const ::glm::vec3 &sample, const ::std::int32_t avg, const ::std::int32_t numSample)
 
template<::std::int32_t S, typename T >
inline ::std::array< T, S > MobileRT::toArray (const char *values)
 
::glm::vec2 MobileRT::toVec2 (const char *const values)
 
::glm::vec3 MobileRT::toVec3 (const char *const values)
 
::glm::vec3 MobileRT::toVec3 (const float *const values)
 
bool MobileRT::equal (const float a, const float b)
 
bool MobileRT::equal (const ::glm::vec3 &vec1, const ::glm::vec3 &vec2)
 
template<::std::int32_t S, typename T >
bool MobileRT::isValid (const ::glm::vec< S, T > &value)
 
template<::std::int32_t S, typename T >
bool MobileRT::hasPositiveValue (const ::glm::vec< S, T > &value)
 
bool MobileRT::isValid (const float value)
 
::glm::vec2 MobileRT::normalize (const ::glm::vec2 &textureCoordinates)
 
::glm::vec3 MobileRT::normalize (const ::glm::vec3 &color)
 
float MobileRT::fresnel (const ::glm::vec3 &I, const ::glm::vec3 &N, const float ior)
 
void MobileRT::checkSystemError (const char *const message)
 
void MobileRT::printFreeMemory ()
 
template<::std::int32_t S, typename T >
void MobileRT::addToStringStream (::std::ostringstream *oss, const ::glm::vec< S, T > &parameter)
 
template<typename Type >
void MobileRT::addToStringStream (::std::ostringstream *oss, const Type &parameter)
 
template<typename First , typename... Args>
void MobileRT::addToStringStream (::std::ostringstream *oss, const First &parameter, Args &&... args)
 
template<typename... Args>
::std::string MobileRT::convertToString (Args &&... args)
 
template<typename T , typename... Args>
::std::unique_ptr< T > MobileRT::std::make_unique (Args &&... args)
 
template<typename T >
::std::string MobileRT::std::to_string (const T &str)
 

Macro Definition Documentation

◆ ASSERT

#define ASSERT (   condition,
  ... 
)
Value:
do { \
if (!(condition)) { \
LOG_DEBUG("Assertion '", #condition, "': ", __VA_ARGS__); \
BOOST_ASSERT_MSG(condition, ::MobileRT::convertToString(__VA_ARGS__).c_str()); \
} \
} while (false)
::std::string convertToString(Args &&... args)
Definition: Utils.hpp:174

If in debug mode, then the ASSERT macro will call the the assert macro from C++ Boost framework BOOST_ASSERT_MSG and then terminate the application with a printed error.

◆ GLM_ENABLE_EXPERIMENTAL

#define GLM_ENABLE_EXPERIMENTAL
<