Example a/testing/torso_groups: Tests the node/element group behaviour.


The comfile run by this example is as follows:

# Torso test example. Reads in one large node file, and separate element files
# for each layer in the torso. Tests the node/element group behaviour, incl.
# making a special element group showing part of the torso.

# reduce surface quality for smaller vrml output
gfx define tessellation default minimum_divisions "1" refinement_factors "2";

# Create some materials to be given to surfaces of the various torso parts.
# Yellow axes:
gfx create material axes ambient 1 1 0 diffuse 1 1 0 emission 0 0 0 specular 0 0 0 alpha 1 shininess 0 texture none;
# Translucent yellow fat:
gfx create material fat ambient 1 1 1 diffuse 0.9 0.7 0 emission 0 0 0 specular 0 0 0 alpha 0.4 shininess 0 texture none;
# Red heart:
gfx create material heart ambient 1 1 1 diffuse 1 0 0 emission 0 0 0 specular 0 0 0 alpha 1 shininess 0 texture none;
# Slightly pink lungs:
gfx create material lungs ambient 1 1 1 diffuse 0.9 0.3 0.3 emission 0 0 0 specular 0 0 0 alpha 1 shininess 0 texture none;
# Translucent red muscle:
gfx create material muscle ambient 1 1 1 diffuse 1 0.1 0 emission 0 0 0 specular 0 0 0 alpha 0.5 shininess 0 texture none;
# Translucent grey torso:
gfx create material torso ambient 1 1 1 diffuse 0.7 0.7 0.7 emission 0 0 0 specular 0 0 0 alpha 0.3 shininess 0 texture none;

# Draw global axes in the root region's rendition
gfx modify g_element "/" general clear;
gfx modify g_element "/" point as axes glyph axes general size "100.0*100.0*100.0" centre 0,0,0 font default select_on material axes selected_material default_selected;

# Read in the nodes and elements.
gfx read elem example body_fat.exelem
gfx read elem example body_heart.exelem
gfx read elem example body_llung.exelem
gfx read elem example body_muscle.exelem
gfx read elem example body_rlung.exelem
gfx read elem example body_torso.exelem

# Establish lines for the groups:
gfx modify g_element heart lines coordinate coordinates material default
gfx modify g_element llung lines coordinate coordinates material default
gfx modify g_element rlung lines coordinate coordinates material default
gfx modify g_element muscle lines coordinate coordinates material default
gfx modify g_element fat lines coordinate coordinates material default
gfx modify g_element torso lines coordinate coordinates material default

# Establish surfaces in the right materials for the groups:
gfx modify g_element heart surfaces coordinate coordinates material heart
gfx modify g_element llung surfaces coordinate coordinates material lungs
gfx modify g_element rlung surfaces coordinate coordinates material lungs
gfx modify g_element muscle surfaces coordinate coordinates material muscle
gfx modify g_element fat surfaces coordinate coordinates material fat
gfx modify g_element torso surfaces coordinate coordinates material torso
# Create a teletubby element group:
gfx create egroup teletubby region torso;
gfx modify egroup torso/teletubby add 755 756,765..768,777..780,789..792,801..804,813..816,825 826
# Draw surface with a colourful spectrum to the tellytubby!
gfx modify g_element torso/teletubby general clear;
gfx define field torso/mag magnitude field coordinates
gfx modify g_element torso/teletubby surfaces coordinate coordinates position 1 material default data mag spectrum default
gfx modify spectrum default autorange;

# Reorder the groups for fast OpenGL alpha blending to work properly.
gfx set order region heart before torso;
gfx set order region llung before torso;
gfx set order region rlung before torso;
gfx set order region muscle before torso;
gfx set order region fat before torso;

# Export the resulting image to vrml, without axes
gfx modify g_element "/" point as axes invisible;
gfx export vrml file tele_torso.wrl
gfx modify g_element "/" point as axes visible;

Files used by this example are:

Name                Modified     Size

torso_groups.com 17-Mar-2014 3.7k COPYRIGHT 17-Mar-2014 504 body_fat.exelem 17-Mar-2014 204k body_heart.exelem 17-Mar-2014 24k body_llung.exelem 17-Mar-2014 63k body_muscle.exelem 17-Mar-2014 203k body_rlung.exelem 17-Mar-2014 63k body_torso.exelem 17-Mar-2014 204k

Download the entire example:

Name                                    Modified     Size

examples_a_testing_torso_groups.tar.gz 09-Mar-2016 759k

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmgui-wxFailureSun Mar 6 00:06:00 20161
last breakThu Sep 11 00:02:00 20140
cmgui-wx-debugFailureSun Mar 6 00:06:01 20161
last breakThu Sep 11 00:02:00 20141
cmgui-wx-debug-memorycheckFailureSun Mar 6 00:06:03 20161
last breakThu Sep 11 00:02:00 20141
cmgui-wx-debug-valgrindFailureSun Mar 6 00:37:39 201621
last breakTue Feb 24 00:07:00 201522
x86_64-linux
cmgui-wxFailureSun Mar 6 00:01:35 20160
last breakThu Sep 11 00:03:00 20140
cmgui-wx-debugFailureSun Mar 6 00:01:35 20160
last breakThu Sep 11 00:03:00 20140
cmgui-wx-debug-memorycheckFailureSun Mar 6 00:01:35 20160
last breakThu Sep 11 00:03:00 20141
cmgui-wx-debug-valgrindFailureSun Mar 6 00:04:17 201619
last breakSun Mar 6 00:03:00 201619
cmgui-wx-gcc-cad-debug-valgrindSuccessThu Jan 7 00:05:04 201617

Testing status by file:


Html last generated: Wed Mar 9 16:02:47 2016

Input last modified: Wed Mar 9 15:49:36 2016


CMISS Help / Examples / a / testing / torso_groups