16 bool all_configured =
true;
18 if (strat->invalid_state()) {
19 all_configured =
false;
20 wmtk::logger().warn(
"Attribute new {} was not configured", strat->name());
23 return all_configured;
29 auto collect_attrs = [&](
auto&&
mesh) {
31 if constexpr (!std::is_const_v<std::remove_reference_t<decltype(
mesh)>>) {
37 [&](
auto&& tah) noexcept {
38 using HandleType =
typename std::decay_t<decltype(tah)>;
39 if constexpr (attribute::MeshAttributeHandle::template handle_type_is_basic<
41 using T =
typename HandleType::Type;
78 std::shared_ptr<const operations::BaseCollapseNewAttributeStrategy>
82 if (s->matches_attribute(attribute))
return s;
85 throw std::runtime_error(
"unable to find attribute");
94 const std::shared_ptr<const operations::BaseCollapseNewAttributeStrategy>& other)
103 logger().debug(
"Set new collapse attribute strategy on a free mesh, there are no new "
104 "attributes for free mesh collapses");
108 throw std::runtime_error(
"unable to find attribute");
116 [&](
auto&& val) noexcept ->
void {
117 using HandleType =
typename std::decay_t<decltype(val)>;
118 if constexpr (attribute::MeshAttributeHandle::template handle_type_is_basic<
120 using T =
typename HandleType::Type;
123 std::shared_ptr<OpType> tmp = std::make_shared<OpType>(attribute);
124 tmp->set_strategy(strategy);
133 const std::vector<simplex::Simplex>& unmods,
134 const std::vector<simplex::Simplex>& mods)
const
136 if (
mesh().is_free()) {
std::vector< attribute::MeshAttributeHandle::HandleVariant > custom_attributes() const
decltype(auto) parent_scope(Functor &&f, Args &&... args) const
Evaluate the passed in function inside the parent scope.
void execute_from_root(Mesh &mesh)
std::vector< simplex::Simplex > unmodified_primitives(const simplex::Simplex &simplex) const override
Returns all simplices that will be potentially affected by the operation.
std::shared_ptr< const operations::BaseCollapseNewAttributeStrategy > get_new_attribute_strategy(const attribute::MeshAttributeHandle &attribute) const
std::vector< simplex::Simplex > execute(const simplex::Simplex &simplex) override
returns an empty vector in case of failure
void clear_attribute_new_strategies()
bool after(const std::vector< simplex::Simplex > &unmods, const std::vector< simplex::Simplex > &mods) const final override
bool attribute_new_all_configured() const
void set_new_attribute_strategy(const attribute::MeshAttributeHandle &attribute, const std::shared_ptr< const operations::BaseCollapseNewAttributeStrategy > &other)
std::vector< std::shared_ptr< const operations::BaseCollapseNewAttributeStrategy > > m_new_attr_strategies
virtual bool after(const std::vector< simplex::Simplex > &unmods, const std::vector< simplex::Simplex > &mods) const
const Mesh & mesh() const
const Tuple & tuple() const
static Simplex vertex(const Mesh &m, const Tuple &t)
std::vector< simplex::Simplex > multi_mesh_edge_collapse_with_modified_simplices(Mesh &mesh, const simplex::Simplex &simplex, const std::vector< std::shared_ptr< const operations::BaseCollapseNewAttributeStrategy >> &new_attr_strategies)
spdlog::logger & logger()
Retrieves the current logger.