Wildmeshing Toolkit
|
Classes | |
struct | ComponentOptionsBase |
class | PathResolver |
Functions | |
attribute::MeshAttributeHandle | get_attribute (const Mesh &m, const std::string &name) |
Get an attribute handle only by name. More... | |
attribute::MeshAttributeHandle | get_attribute (const Mesh &m, const nlohmann::json &attribute) |
std::vector< attribute::MeshAttributeHandle > | get_attributes (const Mesh &m, const nlohmann::json &attribute_names) |
WMTK_NLOHMANN_JSON_FRIEND_TO_JSON_PROTOTYPE (PathResolver) | |
WMTK_NLOHMANN_JSON_FRIEND_FROM_JSON_PROTOTYPE (PathResolver) | |
fs::path | resolve_path (const fs::path &root, const fs::path &path) |
fs::path | resolve_paths (const fs::path &root, const std::initializer_list< fs::path > &paths) |
std::filesystem::path | resolve_path_if_not_empty (const std::filesystem::path &root, const std::filesystem::path &path) |
Wraps resolve_path() but returns path directly if it is empty. More... | |
std::filesystem::path | resolve_path (const std::filesystem::path &root, const std::filesystem::path &path) |
Wraps the path concatenation root / path . More... | |
std::filesystem::path | resolve_paths (const std::filesystem::path &root, const std::initializer_list< std::filesystem::path > &paths) |
Call resolve_path() to concatenate several paths. More... | |
attribute::MeshAttributeHandle wmtk::components::utils::get_attribute | ( | const Mesh & | m, |
const nlohmann::json & | attribute | ||
) |
Definition at line 49 of file get_attributes.cpp.
References get_attribute(), and wmtk::log_and_throw_error().
attribute::MeshAttributeHandle wmtk::components::utils::get_attribute | ( | const Mesh & | m, |
const std::string & | name | ||
) |
Get an attribute handle only by name.
If there is no or multiple attributes, an error is thrown.
m | Mesh holding the attribute. |
name | Name of the attribute. |
Definition at line 14 of file get_attributes.cpp.
References wmtk::Mesh::get_attribute_handle(), wmtk::Mesh::has_attribute(), wmtk::log_and_throw_error(), wmtk::utils::primitive_below(), and wmtk::Mesh::top_simplex_type().
Referenced by get_attribute(), and get_attributes().
std::vector< attribute::MeshAttributeHandle > wmtk::components::utils::get_attributes | ( | const Mesh & | m, |
const nlohmann::json & | attribute_names | ||
) |
Definition at line 67 of file get_attributes.cpp.
References get_attribute().
Referenced by wmtk::components::gather_attributes(), and wmtk::components::wildmeshing().
fs::path wmtk::components::utils::resolve_path | ( | const fs::path & | root, |
const fs::path & | path | ||
) |
Definition at line 10 of file resolve_path.cpp.
Referenced by wmtk::components::export_cache(), wmtk::components::import_cache(), resolve_path_if_not_empty(), resolve_paths(), and wmtk::components::run_components().
std::filesystem::path wmtk::components::utils::resolve_path | ( | const std::filesystem::path & | root, |
const std::filesystem::path & | path | ||
) |
Wraps the path concatenation root / path
.
If path
is absolute it is returned the way it is and root is ignored. If root
is a file the containing folder is considered as root path.
Examples: root = "a/" path = "b.txt" returns: "a/b.txt"
root = "a/f.json" path = "o/b.txt" returns: "a/o/b.txt"
root = "a/" path = "/c/b.txt" returns: "/c/b.txt"
An exception is thrown if the root path does not exist.
root | The folder used as root. If it is a file the parent folder is used as root. |
path | The path that should be made absolute. |
std::filesystem::path wmtk::components::utils::resolve_path_if_not_empty | ( | const std::filesystem::path & | root, |
const std::filesystem::path & | path | ||
) |
Wraps resolve_path()
but returns path directly if it is empty.
Definition at line 38 of file resolve_path.cpp.
References resolve_path().
fs::path wmtk::components::utils::resolve_paths | ( | const fs::path & | root, |
const std::initializer_list< fs::path > & | paths | ||
) |
Definition at line 27 of file resolve_path.cpp.
References resolve_path().
std::filesystem::path wmtk::components::utils::resolve_paths | ( | const std::filesystem::path & | root, |
const std::initializer_list< std::filesystem::path > & | paths | ||
) |
Call resolve_path()
to concatenate several paths.
The behavior resembles: root / path_1 / path_2 / path_3 / ...
wmtk::components::utils::WMTK_NLOHMANN_JSON_FRIEND_FROM_JSON_PROTOTYPE | ( | PathResolver | ) |
Definition at line 101 of file PathResolver.cpp.
wmtk::components::utils::WMTK_NLOHMANN_JSON_FRIEND_TO_JSON_PROTOTYPE | ( | PathResolver | ) |
Definition at line 97 of file PathResolver.cpp.