
.. _tutorials-page:

#############
Tutorials
#############

The |ProductName| documentation provides a large collection of examples, tutorials and code samples. These pages 
cover a range of topics, from basic viewers to step-by-step tutorials for specific features.

The examples and tutorials are provided with full source code and can be compiled and run on several platforms and UI 
toolkits.

**Tutorials**

The tutorials focuses on how to use the different visualization features provided in |ProductName|. Select
one of the tutorials in the list below to go directly to the documentation and the step-by-step instructions.

.. |img_tt| image:: ../images/tut_twotriangles.png
   :width: 150
   :target: two-triangles.html

.. |img_twr| image:: ../images/tut_triangle_with_results.png
   :width: 150
   :target: triangle-with-results.html

.. |img_lf| image:: ../images/tut_loadvtf.png
   :width: 150
   :target: simple-load-vtf.html

.. |img_cp| image:: ../images/tut_cuttingplane.png
   :width: 150
   :target: cutting-plane.html

.. |img_is| image:: ../images/tut_isosurface.png
   :width: 150
   :target: isosurface.html

.. |img_iv| image:: ../images/tut_isovolume.png
   :width: 150
   :target: isovolume.html

.. |img_ps| image:: ../images/tut_partsettings.png
   :width: 150
   :target: part-settings.html

.. |img_ss| image:: ../images/tut_scalarsettings.png
   :width: 150
   :target: scalar-settings.html

.. |img_vs| image:: ../images/tut_vectorsettings.png
   :width: 150
   :target: vector-settings.html

.. |img_des| image:: ../images/tut_dataelementsets.png
   :width: 150
   :target: data-element-sets.html

.. |img_cdr| image:: ../images/tut_custom_datareader.png
   :width: 150
   :target: custom-datareader.html

.. |img_m| image:: ../images/tut_markup.png
   :width: 150
   :target: markup.html

.. |img_cn| image:: ../images/tut_customnavigation.png
   :width: 150
   :target: custom-navigation.html

.. |img_h| image:: ../images/tut_highlight.png
   :width: 150
   :target: highlight.html

.. |img_g| image:: ../images/tut_geometrymodel.png
   :width: 150
   :target: geometry.html

.. |img_gt| image:: ../images/tut_geometrytexture.png
   :width: 150
   :target: geometry-texture.html

.. |img_gp| image:: ../images/tut_geometry_primitives.png
   :width: 150
   :target: geometry-primitives.html

.. |img_r| image:: ../images/tut_report.png
   :width: 150
   :target: report.html

.. |img_p| image:: ../images/tut_plot.png
   :width: 150
   :target: plot.html


+-----------------------+------------------------------------------------------------------------------------+
| |img_tt|              | :ref:`two-triangles-tutorial`     |br|                                             |
|                       | Shows how to create your own part and to use it in a model.                   |br| |
|                       | The geometry is a very simple structure containing two triangles only.             |
+-----------------------+------------------------------------------------------------------------------------+
| |img_twr|             | :ref:`triangle-with-results-tutorial`     |br|                                     |
|                       | Shows how to build an UnstructGridModel geometry, part and results.           |br| |
|                       | The geometry is a very simple structure containing a single triangle and |br|      |
|                       | a scalar result mapped as fringes, a vector result and a displacement result.      |
+-----------------------+------------------------------------------------------------------------------------+
| |img_lf|              | :ref:`simple-load-vtf-tutorial`     |br|                                           |
|                       | Shows how to create a data source by loading a VTFx file and how to setup a |br|   |
|                       | model specification                                                                |
+-----------------------+------------------------------------------------------------------------------------+
| |img_cp|              | :ref:`cutting-plane-tutorial`     |br|                                             |
|                       | Shows how to create a cutting plane and show a scalar result mapped as |br|        |
|                       | fringes to the surface.                                                            |
+-----------------------+------------------------------------------------------------------------------------+
| |img_is|              | :ref:`isosurface-tutorial`     |br|                                                |
|                       | Shows how to create an isosurface based on a scalar result id and a scalar |br|    |
|                       | value.                                                                             |
+-----------------------+------------------------------------------------------------------------------------+
| |img_iv|              | :ref:`isovolume-tutorial`     |br|                                                 |
|                       | Shows how to create an isovolume based on a scalar result id and a maximum |br|    |
|                       | and minimum scalar value. In addition, the scalar result will be shown as |br|     |
|                       | fringes on the isosurface.                                                         |
+-----------------------+------------------------------------------------------------------------------------+
| |img_ps|              | :ref:`part-settings-tutorial`     |br|                                             |
|                       | Shows how to apply some part settings to parts in the model. |br|                  |
|                       | (Part 1: Set invisible, Part 2: Set color to blue, Part 3: Set draw style |br|     |
|                       | surface mesh, Part 4: Set opacity)                                                 |
+-----------------------+------------------------------------------------------------------------------------+
| |img_ss|              | :ref:`scalar-settings-tutorial`     |br|                                           |
|                       | Shows how to change scalar settings for visualized result.                         |
+-----------------------+------------------------------------------------------------------------------------+
| |img_vs|              | :ref:`vector-settings-tutorial`     |br|                                           |
|                       | Shows how to change vector settings for visualized result.                         |
+-----------------------+------------------------------------------------------------------------------------+
| |img_des|             | :ref:`data-element-sets-tutorial`     |br|                                         |
|                       | Shows how to use DataElementSets to filter the model by specifying which |br|      |
|                       | elements that are visible.                                                         |
+-----------------------+------------------------------------------------------------------------------------+
| |img_cdr|             | :ref:`custom-datareader-tutorial`     |br|                                         |
|                       | Shows how to get your own analysis results into the UnstructGridModel by |br|      |
|                       | creating a DataReader. It is a very simple reader that returns one hexahedron |br| |
|                       | element with one scalar, one vector, one displacement and one transformation |br|  |
|                       | result, but it will work as a starting point for building your own file reader.    |
+-----------------------+------------------------------------------------------------------------------------+
| |img_m|               | :ref:`markup-tutorial`     |br|                                                    |
|                       | Shows how to create a data source by loading a VTFx file and drawing the |br|      |
|                       | models bounding box as a markup model.                                             |
+-----------------------+------------------------------------------------------------------------------------+
| |img_cn|              | :ref:`custom-navigation-tutorial`     |br|                                         |
|                       | Shows how to create a custom navigation scheme by subclassing the |br|             |
|                       | cee::vis::CameraInputHandler.                                                      |
+-----------------------+------------------------------------------------------------------------------------+
| |img_h|               | :ref:`highlight-tutorial`     |br|                                                 |
|                       | Shows how highlight parts as a response to a mouse press event.                    |
+-----------------------+------------------------------------------------------------------------------------+
| |img_g|               | :ref:`geometry-tutorial`     |br|                                                  |
|                       | Shows how to create a geometry model with different parts and effects.             |
+-----------------------+------------------------------------------------------------------------------------+
| |img_gt|              | :ref:`geometry-texture-tutorial`     |br|                                          |
|                       | Shows how to create a geometry model using the texture effect to show a |br|       |
|                       | scalar result.                                                                     |
+-----------------------+------------------------------------------------------------------------------------+
| |img_gp|              | :ref:`geometry-primitives-tutorial`     |br|                                       |
|                       | Shows how to create a geometry with geometric primitives like spheres, |br|        |
|                       | boxes and cylinders.                                                               |
+-----------------------+------------------------------------------------------------------------------------+
| |img_r|               | :ref:`report-tutorial`     |br|                                                    |
|                       | Shows how to generate a Word report containg a 3D model.                           |
+-----------------------+------------------------------------------------------------------------------------+
| |img_p|               | :ref:`plot-tutorial`     |br|                                                      |
|                       | Creates a basic 2D plot and shows it as an overlay item in the view.               |
+-----------------------+------------------------------------------------------------------------------------+


The code of the tutorials is also available without the step-by-step instructions on the :ref:`example-source-page` page to 
make it easier to copy the code into your projects. 

**TutorialRunner**

The tutorials can also be tested directly in one of the TutorialRunner applications. 
These are called **QtTutorialRunner**, **MfcTutorialRunner**, and **WxTutorialRunner** and can be found in their 
respective folders under **Tutorials** in your installation. 

Please note that the TutorialRunner framework is not meant to represent best-practice code, and only serves as a 
convenient way to demonstrate the code in the tutorials. Please compile them in-source to find necessary test data.

**Demo Applications**

We have created two demo applications; One for Qt and one for Windows Forms. These can serve as a starting point for 
your own application, as inspiration and a best-practice-coding-guide. They also give a more in-depth demonstration of 
the Core, Visualization, and UnstructGrid components. 

.. |img_qtdemo| image:: ../images/example_qt_demoapp.png
   :width: 150

.. |img_wfdemo| image:: ../images/example_winforms_demoapp.png
   :width: 150

+-----------------------+------------------------------------------------------------------------------------+
| |img_qtdemo|          | **Location**\ : Examples/Qt/QtDemoApp |br|                                         |
|                       | A small Post Processor written in Qt to showcase some of the features in the  |br| |
|                       | UnstructGrid component.                                                            |
+-----------------------+------------------------------------------------------------------------------------+
| |img_qtdemo|          | **Location**\ : Examples/Qt/QtDemoApp |br|                                         |
|                       | A small Post Processor written in Windows Forms to showcase some of the |br|       |
|                       | features in the UnstructGrid component.                                            |
+-----------------------+------------------------------------------------------------------------------------+


.. toctree::
    :maxdepth: 1
    :caption: Topics
    :hidden:

    Simple Model with Two Triangles <two-triangles>
    Simple Model with Results <triangle-with-results>
    Model Specification <simple-load-vtf>
    Scalar Settings <scalar-settings>
    Vector Settings <vector-settings>
    Part Settings <part-settings>
    Cutting Plane <cutting-plane>
    Isosurface <isosurface>
    Isovolume <isovolume>
    Filtering with Element Sets <data-element-sets>
    Custom DataReader <custom-datareader>
    Highlight Clicked Parts <highlight>
    Geometry Model <geometry>
    Geometry Model with Texture <geometry-texture>
    Geometry Model with Geometric Primitives <geometry-primitives>
    Markup Model <markup>
    Custom Navigation Handler <custom-navigation>
    Create Word Report <report>
    Create Overlay 2D Plot <plot>

