#####################
Architecture Overview
#####################

The top level object in |ProductName| is the :js:class:`~cee.CloudSession`. All apps must initialize this before they 
start using |ProductName|. The CloudSession object manages all the :js:class:`~cee.Viewer` in use, and also handles the 
rendering and background processing of all changes in a ``requestAnimationFrame()`` callback. A :js:class:`~cee.Viewer` 
is tied to a HTML5 Canvas element. A :js:class:`~cee.Viewer` can have one or more :js:class:`Views <cee.View>`. 

.. image:: /images/plantuml/TopLevel_diagram.png


******
Models
******

A view is capable of showing 0..N models. You can combine different types of models in a view to create
compound visualizations.

.. image:: /images/plantuml/Models_diagram.png


*****************************
Unstruct Grid Module (cee.ug)
*****************************

The :js:class:`~cee.ug.RemoteModel` implements all features required to create a full post-processing experience in a browser. It uses
a server (UgServer) to read and process the CAE model, and uses 3D Progressive Object Streaming to 
quickly send the relevant visualization data to the client. The user focuses on specifying what to show (result, states, 
cutting planes, etc) and the RemoteModel handles all the interaction with the server and all the visualization.

See :js:mod:`cee.ug` for more information.

.. image:: /images/plantuml/ugModule_diagram.png


***************************************
Constant Unstruct Grid Module (cee.cug)
***************************************

The :js:class:`~cee.cug.ConstantRemoteModel` provides a constant remote model designed for viewing CAE models. The :js:class:`~cee.cug.ConstantRemoteModel` can 
show any visualization that the :js:class:`~cee.ug.RemoteModel` can show, but with limited options for modifying the current setup. States, 
result selection, feature extraction etc. is fixed, but the model can be animated, interacted with, parts can be shown 
or hidden and model mesh can be turned on or off. 

The big benefit of the CUG model is that it only requires a stateless REST-API based server which consumes very little 
resources on the server side, independent of the model size. It will also start streaming immediately, independent of 
the model size.

See :js:mod:`cee.cug` for more information.

**************************************
Unstruct Surface Grid Module (cee.usg)
**************************************

The :js:class:`~cee.usg.UnstructGridModel` is a client side (in browser) FEA model for surface elements. 
It is suited for any size FEA surface models (as long as the part count is <10k), and supports any kind of surface 
elements (1..N nodes per element). The model is defined by elements and nodes, and support scalar, vector, displacement 
and transformation results. The model has support for any number of states (time steps).
Supports calculation of element-aware surface normals and element mesh lines as well as model outline. It also supports 
ray intersection at the element level. 
The model features all draw styles (surface, surface mesh, outline, lines, points, transparent surface).
The model handles only one result of each type at any given time, so you will have to handle the result database in 
application code. Components for implementing a stateless server for progressive streaming of models as well as a 
reference implementation will soon be available.

See :js:mod:`cee.usg` for more information.
 
.. image:: /images/plantuml/usgModule_diagram.png


***************************************
Visualization Streamer Module (cee.vs)
***************************************

The :js:class:`~cee.vs.StreamModel` provides a stream model designed to be efficiently streamed from the Visuzalization Streamer Service (VizService).
The :js:class:`~cee.vs.StreamModel` can visualize all sorts of 3D data and has some direct control of what is shown, e.g. which frame in a sequence of frames to show. 
The overall interaction with the model is handled on the server side, by pushing different data into the VizService. 
The VizService can have multiple streams active, and one StreamModel is connected to a single stream. The connection to the VizService and different streams is handled
through the class :js:class:`~cee.vs.ServerSession`.

See :js:mod:`cee.vs` for more information.

*************************
Geometry Module (cee.geo)
*************************

The :js:class:`geometry model <cee.geo.GeometryModel>` is a  client side (in browser) model suited for models with only geometry or simple scalar results. 
This modes does rebatching of parts and has an optimize renderer capable of handling >300k parts. 
This is the only |ProductName| model with this capability. Can be used with the GeoServer for 
*3D Progressive Object Streaming* of models. This stateless, REST API based server comes with support 
for file and Redis based storage, and can also be extended with other DataStores.

See :js:mod:`cee.geo` for more information.

.. image:: /images/plantuml/geoModule_diagram.png

***********************
Markup Module (cee.mrk)
***********************

The :js:class:`markup model <cee.mrk.MarkupModel>` supports rendering of labels and more simple geometry. It is useful for creating annotations and other 
markup of the 3D model.

See :js:mod:`cee.mrk` for more information.

.. image:: /images/plantuml/mrkModule_diagram.png
