
3DF Use Cases
=============

The main purpose of the demo project is to be used as an example in order to integrate HOOPS Luminate into an existing application. It can also be used by more advanced users in order to test some functionalities based on the integration with HV 3DF.

****************
Default Use Case
****************

Purpose and Description of Beginner Mode
----------------------------------------

The main purpose of this demo is to show how to integrate HOOPS Luminate into a HV 3DF application by using the ``hoops_luminate_bridge`` library as a blackbox.

How to Use Beginner Mode
------------------------

Here are the steps to integrate HOOPS Luminate rendering into your application:

    1. Create a widget to render with HOOPS Luminate.

    2. Create an instance of ``LuminateBridge3DF`` which references your 3DF ``HQWidget``.

    3. Initialize ``LuminateBridge3DF`` by passing your license (must be valid for HOOPS Luminate) and the information relative to the rendering widget.

    4. During the resize of the widget, call ``LuminateBridge3DF.resize``

    5. During the rendering loop of the widget, call ``LuminateBridge3DF.draw``

    6. After loading a new model into the 3DF view, call ``LuminateBridge3DF.syncScene``

    7. When exiting the application, call ``LuminateBridge3DF.shutdown``

.. note::

    Please note that HOOPS Luminate uses threading intensively so a basic integration like this may impact your performances. See the section *Performances/Threads* on the :doc:`3df_bridge_projects` page to see how we handled that in our demo.

Expectations
------------

The current version is limited in term of conversion of data between HV 3DF and Luminate. We do not expect to support any kind of object and some major differences are expected between the two rendering views. 

**What we import:**

    * Geometry (i.e. sphere, cylinder, polycylinder, mesh, shell, polygon)

    * Vertex Attributes (i.e. normals, UV coordinates)

    * Materials (i.e. diffuse, bump, pbr(limité))

    * Vertex / Faces Colors

**What we don’t import:**

    * Lighting

    * Additionals Cameras (Only the first camera is imported)

    * Geometry (i.e. nurbs, nurbs curve, nurbs surface, line, elliptical arc, ellipse, circular arc, circle, markers, image, radial grid, quad grid, text, polyline)

    * Emissive Texture, Env Map


*****************************************************************************
Advanced Use Case - Using Source Code Beyond Demo in sandbox for Personal Use
*****************************************************************************

Purpose and Description of the Advanced Mode
--------------------------------------------

The project allows advanced users to see how to use HOOPS Luminate when integrating it into a HV 3DF application. You can modify it and test Luminate functionalities by editing and recompiling the ``hoops_luminate_bridge`` library.

Modifying Beyond the Demo's
---------------------------

Modifying the library allows you to test more advanced functionalities related to your needs. For example, you can support more geometry types by modifying the ``Hoops3DFLuminateBridge::convertSegmentTree`` function. For some help and ideas of functionalities to test, take a look at the `Luminate Tasks <https://docs.techsoft3d.com/luminate/latest/tasks/taskindex.html>`__ list. 

The widgets library is a great example of how to add various functionalities to the demo. We created a set of widgets to: manipulate Luminate parameters, change the materials on parts, or change the lighting environment. You can add your own widgets to the library and use them in the Bridge Demo in order to test some more advance Luminate functionalities.