17 std::vector<attribute::MeshAttributeHandle> original_attributes;
19 std::vector<attribute::MeshAttributeHandle> label_attributes;
21 std::string attr_name;
24 attr_name =
"vertex_label";
28 attr_name =
"edge_label";
32 attr_name =
"face_label";
36 attr_name =
"tetrahedron_label";
45 label_attributes.emplace_back(h);
48 label_attributes.emplace_back(h);
49 original_attributes.emplace_back(h);
55 return std::make_tuple(original_attributes, label_attributes, pass_through_attributes);
67 Mesh& mesh =
static_cast<Mesh&
>(*mesh_in);
69 auto [original_attributes, label_attributes, pass_through_attributes] =
74 std::vector<attribute::MeshAttributeHandle> keeps = pass_through_attributes;
75 keeps.insert(keeps.end(), original_attributes.begin(), original_attributes.end());
79 std::tie(original_attributes, label_attributes, pass_through_attributes) =
87 std::vector<attribute::MeshAttributeHandle> keeps = pass_through_attributes;
88 keeps.insert(keeps.end(), original_attributes.begin(), original_attributes.end());
void clear_attributes(const std::vector< attribute::MeshAttributeHandle::HandleVariant > &keep_attributes)
Remove all custom attributes besides the one passed in.
attribute::MeshAttributeHandle register_attribute(const std::string &name, PrimitiveType type, int64_t size, bool replace=false, T default_value=T(0))
attribute::MeshAttributeHandle get_attribute_handle(const std::string &name, const PrimitiveType ptype) const
PrimitiveType top_simplex_type() const
void write_mesh(const Mesh &m, const std::string &name, const std::map< std::string, std::vector< int64_t >> &multimesh_names={})
Write a mesh to cache.
std::shared_ptr< Mesh > read_mesh(const std::string &name) const
Load a mesh from cache.
std::vector< attribute::MeshAttributeHandle > get_attributes(const Mesh &m, const nlohmann::json &attribute_names)
auto gather_attributes(io::Cache &cache, Mesh &mesh, const internal::RegularSpaceOptions &options)
void regular_space(const utils::Paths &paths, const nlohmann::json &j, io::Cache &cache)
std::vector< PrimitiveType > primitive_below(PrimitiveType pt, bool lower_to_upper)
void log_and_throw_error(const std::string &msg)
nlohmann::json attributes
std::vector< int64_t > values
std::vector< std::string > pass_through