+FS::Path Catalogue3D::locate_file(const string &name)
+{
+ if(FS::exists(name))
+ return name;
+
+ FS::Path path = FS::Path("data")/name;
+ if(FS::exists(path))
+ return path;
+
+ throw Exception("Can't locate "+name);
+}
+
+template<typename T>
+T *Catalogue3D::create(const string &name)
+{
+ RefPtr<T> obj = new T;
+ DataFile::load(*obj, locate_file(name).str());
+ return obj.release();
+}
+
+template<typename T>
+T *Catalogue3D::create2(const string &name)
+{
+ RefPtr<T> obj = new T;
+ DataFile::load(*obj, locate_file(name).str(), *this);
+ return obj.release();
+}
+
+} // namespace R2C2