Code examples

../../../_images/tut_vtfxwriter.png

Reading and running the provided examples is a good way to start using the VTFx Component. There are multiple examples included in the distribution showcasing a range of features and levels of complexity. All examples are shipped with Visual Studio project files and Makefiles and are ready to run directly from the Examples folder. The generated VTFx files can be opened in all Ceetron products, including our free viewers. Download the CEETRON Envision Demo Viewer for free from our website, www.ceetron.com.

The main language for the examples are C++. There is also one C# example and one Python example included, but reading and adapting the C++ examples should be trivial. If you are a C# user, please read the topic C# Users: Features and differences. If you are a Python user, please read the topic Python Users: CEETRON Envision for Python.

The minimal example is also available as a tutorial and is a good entry point for starting programming using the VTFx Component. Find this tutorial at Tutorial: My first VTFx.

All the examples are found under the folder /Examples/VTFx/ in the distribution.

img_m

Minimal VTFx file
This example shows how to create a minimal VTFx file with a simple part
consisting of just one element, with only one state and no results or properties.

img_s

Simple VTFx file
Simple VTFx file including result fringes and multiple states. The example
has two simple parts, one scalar result and three time steps. It uses
properties to set up an animation of the results.

img_e

Advanced example
A more advanced example showing multiple parts, two states, various result
types and properties. It demonstrates different ways of populating the blocks.

img_r

Read VTFx file
Reads a VTFx file and prints the content of databases, cases and blocks.

img_a

Append case to VTFx
Opens an existing VTFx file and appends an additional case to it. The
appended case sets draw style on the first part to line and sets color and
opacity on the second part.

img_a2

Append data to VTFx
Opens an existing VTFx file and adds a state. This example also adds scalar
result values for this new state and updates the properties to include this
state in the animation.

img_ci

Cutting plane and isosurface
Showing isosurface and cutting plane features in VTFx. Isosurfaces and
cutting planes are set as properties. This example creates a small part with
a scalar result shown as fringes and adds an isosurface and a cutting plane.

img_tg

Two geometries
Creating a VTFx using two geometries

img_at

Two geometries
Creating a VTFx using adaptive geometries

img_c

Send to cloud
Creating a VTFx and sending it to Ceetron Cloud for viewing