.. _triangle-with-results-example:

#########################################
UnstructGrid: A Simple Model with Results 
#########################################

This example shows how to build a custom memory data source. 


.. image:: ../images/tut_triangle_with_results.png
   :height: 300
   :align: center

The geometry is a simple structure containing only a single triangle. 

Three results are created and mapped to the triangle geometry:

-   A node mapped scalar result
-   A node mapped vector result 
-   A displacement result
-   A transformation result

When a result has been created, it must be added to the current model specification to be 
visualized with the model. This example sets all four result types in the model specification. 
The scalar result is set to be shown as fringes.

Remember to toggle on result visibility in each part's :class:`cee::ug::PartSettings`. 

.. literalinclude:: ../../../../EnvisionDesktop/Tutorials/UnstructGridModelResults.cpp
    :language: cpp
    :lines: 39-228
    