Actually I will correct myself… referring back to issue #27
“Since an object, e.g. a line, can depend on more than one object (like, a line on two points), the pattern graph is more complex than a tree. It’s a cycle-free directed graph.”
Not easily solved as currently coded. If it was - tools could use other tools in the future history. Right now the tool dependencies are based on a simple counter - where when a tool used by another tool, it’s reference counter is incremented. If a tool’s reference counter > 0 it can’t be deleted as it’s being used by another tool (or more). Tools have no way of knowing what other tools are using it. You have to solve the cycle-free directed graph.
To get a list of downstream dependent tools, we’d have to rewrite a whole new method of tracking dependencies. Like instead of just incrementing a counter, each tool would have a list of tool id’s it’s being used by… either directly or in a formula. 1) There’s your dependency list right there. 2) As long as the list is not empty, a tool can’t be deleted. Key words… “or in a formula” for there in always lies the rub. Oh… and the Line tool is likely to throw a wrench in the works as usual. ![]()