diff --git a/.hgignore b/.hgignore index b73d0640..1f82d03a 100644 --- a/.hgignore +++ b/.hgignore @@ -1,46 +1,62 @@ -^Mitsuba.app/.*$ -.*\.obj$ -.*\.os$ -.*\.so$ -.*\.pyc$ -.*\.o$ -.*\.exe$ -.*\.pdb$ -.*\.manifest$ -.*\.exp$ -.*\.dylib$ +# Documentation +^doc/doxygen/.*$ ^doc/.*\.aux$ ^doc/.*\.log$ ^doc/.*\.out$ ^doc/.*\.pdf$ ^doc/.*\.toc$ + +# Qt-related .*ui_.*\.h$ .*moc_.*\.cc$ .*qrc_.*\.cc$ -\.DS_Store + +# SCons-related ^\.sconf_temp/.*$ +^.sconsign.dblite$ ^config.py$ ^config.log$ -^.sconsign.dblite$ -^src/utils/addimages$ +.*\.pyc$ + +# OSX binaries and byproducts +^Mitsuba.app/.*$ +\.DS_Store +.*\.dylib$ + +# Linux binaries and byproducts ^src/utils/createvol$ ^src/utils/dumpimage$ ^src/utils/joinrgb$ -^src/utils/ssalbedo$ ^src/utils/ttest$ -^src/utils/utils_test$ -^dist/.*$ ^mitsuba$ ^mtssrv$ ^mtsgui$ ^mtsimport$ ^mtsutil$ +.*\.so$ +.*\.os$ +.*\.o$ + + +# Windows binaries and byproducts +.*\.exe$ +.*\.obj$ ^src/.*\.lib$ ^src/.*\.dll$ ^plugins/.*\.lib$ ^plugins/.*\.dll$ +^dist/.*$ tools/windows/mitsuba_res.res +.*\.pdb$ +.*\.manifest$ +.*\.exp$ + +# Imported geometry ^meshes/.*$ ^textures/.*$ ^mitsuba.*.log$ -^doc/doxygen/.*$ + +# Eclipse CDT project files +^.externalToolBuilders/.*$ +^.settings/.*$ +^.cproject$ diff --git a/src/libcore/fresolver.cpp b/src/libcore/fresolver.cpp new file mode 100644 index 00000000..f535cbb7 --- /dev/null +++ b/src/libcore/fresolver.cpp @@ -0,0 +1,72 @@ +#include + +MTS_NAMESPACE_BEGIN + +FileResolver::FileResolver() { + m_paths.push_back(fs::current_path()); +} + +FileResolver *FileResolver::clone() const { + FileResolver *cloned = new FileResolver(); + cloned->m_paths = m_paths; + return cloned; +} + +void FileResolver::clear() { + m_paths.clear(); +} + +void FileResolver::addPath(const fs::path &path) { + bool found = false; + for (size_t i=0; i FileResolver::resolveAll(const fs::path &path) const { + std::vector results; + + if (fs::exists(path)) + results.push_back(path); + + for (unsigned int i=0; i