-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI.Highlihght class? #630
Comments
Nice! |
It needs some more ponderance first. For example, I'm wondering if Some examples: Overlays.SuggestNode(...) // gently pulse a node
Overlays.HoverNode(...) // hover selection overlay
Overlays.SelectNode(...) // static selection overlay
Overlays.Icon(where, what, action) // add an icon Could such a class handle things like camera view caching (ie. what stuff is currently visible)? It could potentially have stuff like... Overlays.GetVisibleJunctionNodes() // list of junction nodes in camera view
// etc... So the various tools would just farm stuff out to the |
Don't design megaclasses which do everything. Maybe even subdivide duties:
For example for Lane Connectors we need to highlight nodes, and lanes. And segments to hover. Then the consumer of this API would create a node renderer, and a lane and segment renderer. Three renderers which all cache their visible lanes, nodes, and segments and can be invoked independently in any order. |
The rendering can be:
|
For the cache class, I assume it would just cache all visible nodes/segments (I assume lanes are always part of a segment?) that are applicalbe to any TMPE tool or overlay, even if they might not be relevant. My assumption is that quick built list is better than trying to add all sorts of excessive filtering logic in the cache class; and that way we wouldn't need to invalidate cache just to toggle certain overlays - everything relevant would always be there. We'd need a toggle to turn it on/off. For example, TMPE toolbar is open but no persistent overlays therefore it should be off to conserve frame rate. If persistent overlays is on, or a tool is active, then it gets enabled. The cache would be updated whenever camera moves more than certain delta, but ideally also have some de-spamming in there (eg. max 1 cache refresh per X milliseconds) to prevent laggy map scrolling on potato computers.
Yup, would be good for jitter hot-pathing and branch predication. The filter would be run over the 'view cached' whatever (nodes/segments). |
Suggestion: Split out the code that highlights nodes/segments/lanes/whatever in to a separate class?
So we could have things like:
That way we can centralise all the highlight functions rather than duplicating them, and any optimisations can be done centrally.
For example, there might be some benefit to batching the rendering, like, rather than creating new mesh each time for a node highlight, could we create it once and then duplicate it for each highligted node?
Also, we could have central methods to clear all current highlights (or highlights of given type or matching specific criteria, etc).
Later, we could have abstract classes for interacting with networks, so we could have something like:
The text was updated successfully, but these errors were encountered: