Revamp object selector and update APIs #2025
Labels
topic: core
Issues relating to core geometry, operations, algorithms
type: feature
New features and improvements to existing features
I'm seeing opportunities for improvement:
Cycle
has different methods to select from its referenced edges in various ways, e.g. selecting the n-th edge, selecting the edge that comes after another, etc. While the referenced objects of other objects don't tend to have an inherent order, such an order might be assigned by the context of the user's code, meaning those selector methods could be useful for other objects too.UpdateCycle
has an additional method to update the n-th edge of a cycle. Having this capability for other update traits could be useful, for the same reason already stated above.The reason I'm packing all of this in a single issue, is that I believe that the same solution will solve all of those! Here's what I have in mind:
HandleSet
and use that as the standardized data structure to manage references to other objects in all objects that reference multiple objects of the same type.HandleIter
, and iterator over the handles inHandleSet
, and return that from all the appropriate methods.Cycle
toHandleIter
, making them available for all referenced objects.fn update_*(&self, &Handle<T>, impl FnOnce(&Handle<T>) -> Handle<T>) -> Self
I think this would make for a nice improvement, leading not only to more capabilities in the update API, but also better cohesion. I've started working on this, since I have use for it in #2023.
The text was updated successfully, but these errors were encountered: