Finding object in 3D view

Everything DG Kernel: Technical discussions and issues
Post Reply
Russell 22
Posts: 1
Joined: Fri Aug 02, 2024 2:06 am

Finding object in 3D view

Post by Russell 22 »

Hello

I have a tree view in my application, similar to model explorer, which shows the entities. I would like to highlight the object in 3D view when it is selected in the tree view.

I need a bit of help with that.
Thank you
Prashant Kande
Posts: 65
Joined: Tue Jun 18, 2024 6:12 am

Re: Finding object in 3D view

Post by Prashant Kande »

Hello Russel

This can also be done using Model Explore and DGK's Misc event like demoes in eMotion sample.

It seems that you prefer your own implementation. You are creating a tree view node per entity, right? I suggest that you store reference to IEntity_DG in the node. I think it has Tag property for that, otherwise just use an appropriate map.

In a handler of your tree view selection, you need to add/update the list of selected entities as the current entity list:
dgk.GetView() > IView_DG > GetScene() > IScene_DG > GetCurrentItemSet() > ISelection_DG.
And use ISelection_DG.ClearSelection(), SetSelected(entity as IObject_DG, true).

This will mix is a red component into the entity's color during presentation.

You can also implement your own way of highlighting the selection either using colors or may be something like adding a wireframe box around the object

Regards
Post Reply