namespace file_types

Overview

Definitions and functions for file types supported by codebase. More…

namespace file_types {

// enums

enum Type;

// global variables

static const std::map<Type, std::string> file_extensions =   {     { Type::praw, "praw" },     { Type::cogs, "cogs" },     { Type::ply, "ply" },     { Type::obj, "obj" },     { Type::dae, "dae" },     { Type::stl, "stl" },     { Type::fbx, "fbx" },     { Type::bvh, "bvh" },     { Type::jpg, "jpg" },     { Type::png, "png" },     { Type::gif, "gif" },     { Type::bmp, "bmp" },     { Type::exr, "exr" },   };
static const std::vector<Type> all_types = std_ext::Transformed(file_extensions,       [](const std::pair<Type, std::string>&pair)->Type { return pair.first; });
static const std::vector<Type> importable_scan_types {     Type::praw,     Type::cogs,     Type::ply,   };
static const std::vector<Type> exportable_scan_types {     Type::cogs,     Type::ply,     Type::exr,   };
static const std::vector<Type> exr_types {     Type::exr,   };
static const std::vector<Type> importable_point_cloud_types {     Type::cogs,     Type::obj,     Type::fbx,     Type::ply,   };
static const std::vector<Type> exportable_point_cloud_types {     Type::cogs,     Type::obj,     Type::fbx,     Type::ply,   };
static const std::vector<Type> importable_mesh_types {     Type::cogs,     Type::dae,     Type::obj,     Type::fbx,     Type::ply,     Type::stl,   };
static const std::vector<Type> exportable_mesh_types {     Type::cogs,     Type::dae,     Type::obj,     Type::fbx,     Type::ply,     Type::stl,   };
static const std::vector<Type> image_types {     Type::jpg,     Type::png,     Type::gif,     Type::bmp,     Type::exr,   };
static const std::vector<Type> assimp_types {     Type::bvh,     Type::dae,     Type::obj,     Type::fbx,     Type::ply,     Type::stl   };
static const std::vector<Type> cogs_types {     Type::cogs,   };

// global functions

static std::string GetExt(const Type type);
static std::optional<file_types::Type> GetType(const std::string& filename);
static bool IsType(const std::string& ext, file_types::Type type);

} // namespace file_types

Detailed Documentation

Definitions and functions for file types supported by codebase.

Global Variables

static const std::map<Type, std::string> file_extensions =   {     { Type::praw, "praw" },     { Type::cogs, "cogs" },     { Type::ply, "ply" },     { Type::obj, "obj" },     { Type::dae, "dae" },     { Type::stl, "stl" },     { Type::fbx, "fbx" },     { Type::bvh, "bvh" },     { Type::jpg, "jpg" },     { Type::png, "png" },     { Type::gif, "gif" },     { Type::bmp, "bmp" },     { Type::exr, "exr" },   }

A map of all file types and their extensions.

static const std::vector<Type> all_types = std_ext::Transformed(file_extensions,       [](const std::pair<Type, std::string>&pair)->Type { return pair.first; })

All file types defined.

static const std::vector<Type> importable_scan_types {     Type::praw,     Type::cogs,     Type::ply,   }

Recognized file types that can have a scan and that we can import.

Whether they do contain a scan or not is not guaranteed!

static const std::vector<Type> exportable_scan_types {     Type::cogs,     Type::ply,     Type::exr,   }

Recognized file types that can have a scan and that we can export.

static const std::vector<Type> importable_point_cloud_types {     Type::cogs,     Type::obj,     Type::fbx,     Type::ply,   }

Recognized file types that can have a point cloud and that we can import.

Whether they do contain a point cloud or not is not guaranteed!

static const std::vector<Type> exportable_point_cloud_types {     Type::cogs,     Type::obj,     Type::fbx,     Type::ply,   }

Recognized file types that can have a point cloud and that we can export.

static const std::vector<Type> importable_mesh_types {     Type::cogs,     Type::dae,     Type::obj,     Type::fbx,     Type::ply,     Type::stl,   }

Recognized file types that can have a mesh and that we can import.

Whether they do have a mesh or not is not guaranteed!

static const std::vector<Type> exportable_mesh_types {     Type::cogs,     Type::dae,     Type::obj,     Type::fbx,     Type::ply,     Type::stl,   }

Recognized file types that can have a mesh and that we can export.

static const std::vector<Type> image_types {     Type::jpg,     Type::png,     Type::gif,     Type::bmp,     Type::exr,   }

Recognized file types that can store images.

static const std::vector<Type> assimp_types {     Type::bvh,     Type::dae,     Type::obj,     Type::fbx,     Type::ply,     Type::stl   }

Recognized assimp file types that can hold a point cloud and/or mesh.

static const std::vector<Type> cogs_types {     Type::cogs,   }

Cogs (internal) types.

Global Functions

static std::string GetExt(const Type type)

Get extension from a file type. If can not deduce extension from type, returns empty string.

static std::optional<file_types::Type> GetType(const std::string& filename)

Get file type from a file name extension.

static bool IsType(const std::string& ext, file_types::Type type)

Checks if specified extension corresponds with specified type.