.. _example-source-page:

##############
Code Examples
##############

Raw code for the all tutorials described under :ref:`tutorials-page`

This is the EXACT same code as shown in the tutorial documentation, but all step-by-step descriptions have been stripped.

.. |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_h| image:: ../images/tut_customnavigation.png
   :width: 150
   :target: custom-navigation.html

.. |img_g| image:: ../images/tut_highlight.png
   :width: 150
   :target: highlight.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-example`     |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-example`     |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-example`     |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-example`     |br|                                              |
|                       | Shows how to create a cutting plane and show a scalar result mapped as |br|        |
|                       | fringes to the surface.                                                            |
+-----------------------+------------------------------------------------------------------------------------+
| |img_is|              | :ref:`isosurface-example`     |br|                                                 |
|                       | Shows how to create an isosurface based on a scalar result id and a scalar |br|    |
|                       | value.                                                                             |
+-----------------------+------------------------------------------------------------------------------------+
| |img_iv|              | :ref:`isovolume-example`     |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-example`     |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-example`     |br|                                            |
|                       | Shows how to change scalar settings for visualized result.                         |
+-----------------------+------------------------------------------------------------------------------------+
| |img_vs|              | :ref:`vector-settings-example`     |br|                                            |
|                       | Shows how to change vector settings for visualized result.                         |
+-----------------------+------------------------------------------------------------------------------------+
| |img_des|             | :ref:`data-element-sets-example`     |br|                                          |
|                       | Shows how to use DataElementSets to filter the model by specifying which |br|      |
|                       | elements that are visible.                                                         |
+-----------------------+------------------------------------------------------------------------------------+
| |img_cdr|             | :ref:`custom-datareader-example`     |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-example`     |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_m|               | :ref:`custom-navigation-example`     |br|                                          |
|                       | Shows how to create a custom navigation scheme by subclassing the |br|             |
|                       | cee::vis::CameraInputHandler.                                                      |
+-----------------------+------------------------------------------------------------------------------------+
| |img_h|               | :ref:`highlight-example`     |br|                                                  |
|                       | Shows how highlight parts as a response to a mouse press event.                    |
+-----------------------+------------------------------------------------------------------------------------+
| |img_g|               | :ref:`geometry-example`     |br|                                                   |
|                       | Shows how to create a geometry model with different parts and effects.             |
+-----------------------+------------------------------------------------------------------------------------+
| |img_gt|              | :ref:`geometry-texture-example`     |br|                                           |
|                       | Shows how to create a geometry model using the texture effect to show a |br|       |
|                       | scalar result.                                                                     |
+-----------------------+------------------------------------------------------------------------------------+
| |img_gp|              | :ref:`geometry-texture-example`     |br|                                           |
|                       | Shows how to create a geometry with geometric primitives like spheres, |br|        |
|                       | boxes and cylinders.                                                               |
+-----------------------+------------------------------------------------------------------------------------+
| |img_r|               | :ref:`report-example`     |br|                                                     |
|                       | Shows how to generate a Word report containing a 3D model.                         |
+-----------------------+------------------------------------------------------------------------------------+
| |img_p|               | :ref:`plot-example`     |br|                                                       |
|                       | Creates a basic 2D plot and shows it as an overlay item in the view.               |
+-----------------------+------------------------------------------------------------------------------------+




.. toctree::
    :maxdepth: 2
    :caption: Examples
    :hidden:
    :titlesonly:

    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>
