Hello,
I have an application that uses a MFC multiple-document interface (MDI) with multiple different View types (one 3D, others 2D) that all can be opened at the same time and each view should work with the SpaceMouse.
My first working implementation derived MainFrame from TDx::SpaceMouse::Navigation3D::CNavigation3D like the navlib_viewer Sample does.
But because of the difference between the views (3d vs. 2d) I tried to derive each View class from TDx::SpaceMouse::Navigation3D::CNavigation3D and call Enable3DNavigation(); in OnSetActive() and Disable3DNavigation(); in OnKillActive().
This seems to work, but I am not sure if this is the right solution.
I would be grateful for a recommendation.
How to use the 3DxWare SDK in an Application with multiple different Views
Moderator: Moderators
Re: How to use the 3DxWare SDK in an Application with multiple different Views
Not quite.
If you derive from CNavigation3D for each View (a perfectly reasonable approach), you are opening a "connection" to the driver but, as you verified, it cannot determine which view is active. For this, set the "Focus" property when your view becomes active.
Calling Enable3DNavigation() is expensive but the "Focus" property is lightweight and meant precisely for what you're looking to address.
Nuno Gomes
Re: How to use the 3DxWare SDK in an Application with multiple different Views
Many thanks for the quick response. I will change that.
I have a few more questions:
EnableNavigation has to be called for each connection after the window has been created, right?
Could I also use different profiles for the different views?
I have a few more questions:
EnableNavigation has to be called for each connection after the window has been created, right?
Could I also use different profiles for the different views?
Re: How to use the 3DxWare SDK in an Application with multiple different Views
That's correct. Each instance of CNavigation3D must be "enabled" by calling that method.
Are you referring to driver profiles? If so, the driver can only support different "button" profiles: users can assign different commands for different application "command sets" (or "environments"). Refer to CNavigation3D::ActiveCommandSet() and section 3.4.8 in page 15 of the navlib.pdf document.Could I also use different profiles for the different views?
Re: How to use the 3DxWare SDK in an Application with multiple different Views
Thank you very much.
I was thinking of the Profile property in Enable3DNavigation - something like setting the property to <My Application Name>.<View Type 1> in one view class and to <My Application Name>.<View Type 2> in another view class to allow users different settings (e.g. speed) for the different views.Are you referring to driver profiles? If so, the driver can only support different "button" profiles: users can assign different commands for different application "command sets" (or "environments"). Refer to CNavigation3D::ActiveCommandSet() and section 3.4.8 in page 15 of the navlib.pdf document.
Re: How to use the 3DxWare SDK in an Application with multiple different Views
That is undesirable. Normally, users will adjust speed on a per application basis, not per view or environment.StefanF wrote: ↑Tue Dec 21, 2021 10:20 am I was thinking of the Profile property in Enable3DNavigation - something like setting the property to <My Application Name>.<View Type 1> in one view class and to <My Application Name>.<View Type 2> in another view class to allow users different settings (e.g. speed) for the different views.
Re: How to use the 3DxWare SDK in an Application with multiple different Views
I understand. Many thanks for your help.