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 the developer zone, https://developer.techsoft3d.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

img_cs

Cross Sections
Creating a VTFx using cross section element expansion for beams

img_csa

Cross Sections (All types)
Creating a VTFx showing all available cross section element expansion for beams

img_p

Polyhedron
Simple example on creating polyhedron elements