SortingVisual3D

Nov 1, 2012 at 9:10 AM

Hi

 

Is it possible to use ContainerUIElement3D in conjunction with SortingVisual3D?  I would like sorted visuals that have the power of the ContainerUIElement3D class.

 

Best regards

Simon

Coordinator
Nov 2, 2012 at 9:33 PM

Hi Simon! I have not tried this, but I guess it should be possible. Let us know if there is a bug. And remember that the SortingVisual3D is only a 'basic' work-around for the transparency problem... 

Nov 5, 2012 at 9:08 AM
Edited Nov 5, 2012 at 9:08 AM

Hi Objo

Thanks for replying.  I was asking if it is possible as I can't get it to work.  If I add a ModelUIElement3D object as a child of a ContainerUIElement3D object, and add the ContainerUIElement3D object as a child of a SortingVisual3D object, I find that the mouse events are not fired.

e.g.  (geometry code excluded)

var element = new ModelUIElement3D();
element.Model = geometry;
element.MouseDown += this.ContainerElementMouseDown;
var containerUI = new ContainerUIElement3D();
containerUI.Children.Add(element);
var uiTransparentElements = new SortingVisual3D();
uiTransparentElements.Children.Add(containerUI);
viewport.Children.Add(uiTransparentElements);

It is not too big a deal since I could use VisualTreeHelper.HitTest instead of  ContainerUIElement3D, but I was wondering if I was missing something simple.

Regards

Simon

Coordinator
Nov 5, 2012 at 9:28 AM
Edited Nov 5, 2012 at 9:28 AM

ok, could changing the base class of HelixToolkit.Wpf.RenderingModelVisual help? Try replace ModelVisual3D by ContainerUIElement3D (I am guessing - no time to test right now).

Nov 5, 2012 at 12:33 PM

I did start to try that but unfortunately abandoned as didn't resolve all the build errors.  I will use HitTest workaround for now.  Is it possible to add to future enhancement list?

Thanks, Simon

Coordinator
Nov 6, 2012 at 6:29 PM

added http://helixtoolkit.codeplex.com/workitem/9971

Nov 26, 2012 at 10:48 AM
Edited Nov 26, 2012 at 10:48 AM

ContainerUIElement3D is a noniheritable class...

http://msdn.microsoft.com/en-us/library/system.windows.media.media3d.containeruielement3d.aspx

Coordinator
Nov 26, 2012 at 10:53 AM

Then try to add a ContainerUIElement3D to the ModelVisual3D.