[CONNECT C++] Understanding IViewTransients

In attempting to better understand the IViewTransients interface, I've modified the ViewTransients example developed by Jon Summers. That example uses _DrawTransients() to draw several graphics on the view. I see that when the TransientHandler is initially added to the ViewManager, a RedrawElems struct is created and various params set. Finally, a call to DoRedraw() is used to initially invoke _DrawTransients(). Once inside the _DrawTransients() function, The DrawPurpose is checked and things are created using various IDrawGeom functions. I tried a simple test: based on the DrawPurpose, I wanted to change the color of a drawn item. So I used DrawLingString3d() with different colors. I expected the initial graphics to be drawn with the one color (DrawPurpose::TransientChanged) and as the cursor was moved (DrawPurpose::Pick) I expected the line to be redrawn with the other color. It wasn't. I *think* the transient stuff does not heal itself automatically. Does the initial display (DrawPurpose:TransientChanged) need to be "erased" in order for the same thing to be drawn again using a new color? If so, how do you perform the "erase"?

Bruce

Parents Reply
  • Yes - that reply is why I'm trying to understand how to use Transients. While I don't need the display to change with EVERY cursor movement, I would like to change it based on the cursor's position relative to a "selection". Specifically, the tool is picking two elements. If those two elements intersect, I wish to place a "jumper" symbol on one line and partially delete (clip) that line. The orientation of that jumper (to the left or to the right) would be dependent on the cursor's position relative to the element that is being "clipped". So, as the cursor moves across the line (prior to the acceptance datapoint) I would like the jumper's direction to follow (change).

    I'll go back to my tool code and try some more. My initial efforts using a transient did not success so I implemented the more typical dynamics approach, redrawing each frame. I'll try the transient approach again and see if I have more success.

Children