Circuit Editor Selection Weirdness - ATF Bug?

16 views
Skip to first unread message

vorp

unread,
Nov 16, 2015, 12:56:17 PM11/16/15
to Authoring Tools Framework
I'm running into some strange behavior with my customized Circuit Editor example that maybe someone can help with.
Basically, I have a setup where I have only one real node in my graph, but it's a group and contains lots of levels of subnodes.
I have done some work creating a custom look when you select subnodes, and even changing some of the draw code to get very customized results.
Everything is working great.
Except I just noticed the following: When you create or open a new document the selection highlighting stops working on all older tabs (documents).
Only the most recently opened tab still shows the selection highlighting.
I've tracked this odd behavior to what, I think, is the culprit: m_selectionPathProvider is not getting updated when you switch between tabs.
It looks like that variable only gets updated when SelectionAdapter.Bind() is called, which I only see happening on new tab creation, not when switching.

Now I'll admit that this has been a struggle. Tracing through the many classes involved in a tab-switch operation and how these classes affect my selected sub-node has been challenging.
I'm guessing that I'm seeing this problem because I've got the rather odd case that each document contains only ONE node with lots of sub-nodes, as opposed to the more common case where you are actually connecting lots of top-level nodes together with wires.

If I'm right that Bind() (or something like it) should be called on tab switch, I could use some help figuring out the best way to make this happen.

Thanks for any ideas.
-Len

vorp

unread,
Nov 16, 2015, 1:16:31 PM11/16/15
to Authoring Tools Framework
Correction: The Bind that modifies m_selectionPathProvider is D2dGraphAdapter.Bind()

vorp

unread,
Nov 16, 2015, 9:17:42 PM11/16/15
to Authoring Tools Framework
Ok...looking into this all day trying to figure it out. Still no luck.
Seems that the issue doesn't source quite where I thought before.
The problem starts with the jump from this function: D2dGraphAdapter.OnRender()
To this function: D2dCircuitRenderer.DrawExpandedGroup()

Since I have one multiply nested group, the top level node gets its Style calculated in the first function, line 378, which seems to work correctly.
However, once I'm in D2dCircuitRenderer, the GetStyle() call at line 1055 has a different m_selectionContext instance. I have no idea why.
This instance is always the selectionContext of the last file created or opened. So basically it doesn't find any of the currently selected nodes in the line:
m_selectionContext.SelectionContains(item)

I'm feeling like an idiot but the way all these classes are put together is taking some real time to deconstruct.

Bug in ATF? Don't know. I haven't seen the same problem in Circuit Editor Sample but I also haven't messed with grouped nodes there (yet).

Thanks for any pointers.


Reply all
Reply to author
Forward
0 new messages