Using a boolean field to determine the visibility of each node/data point. This boolean field can be created at run time as shown below. This example requires cmgui 2.6.1 or greater.
Created May, 2009 by Alan Wu.
# ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License Version # 1.1 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # http://www.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" basis, # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License # for the specific language governing rights and limitations under the # License. # # The Original Code is CMISS Field Dependent Visibility example. # # The Initial Developer of the Original Code is # Auckland Uniservices Ltd, Auckland, New Zealand. # Portions created by the Initial Developer are Copyright (C) 2009 # the Initial Developer. All Rights Reserved. # # Alternatively, the contents of this file may be used under the terms of # either the GNU General Public License Version 2 or later (the "GPL"), or # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), # in which case the provisions of the GPL or the LGPL are applicable instead # of those above. If you wish to allow use of your version of this file only # under the terms of either the GPL or the LGPL, and not to allow others to # use your version of this file under the terms of the MPL, indicate your # decision by deleting the provisions above and replace them with the notice # and other provisions required by the GPL or the LGPL. If you do not delete # the provisions above, a recipient may use your version of this file under # the terms of any one of the MPL, the GPL or the LGPL. # # ***** END LICENSE BLOCK ***** #A short example to demostrate how to control the visiblity of node/data points #using field in cmgui. #Read in the coordinate and the field containing information of #the period of time which each node is visible at. gfx read nodes $example/cube; gfx read elements $example/cube; gfx read nodes $example/line; # create initial visualisation gfx modify g_element "/" general clear; gfx modify g_element cube lines coordinate coordinates material default; #First define a field which contains the value of current time in #time keeper gfx define field time_value time_value; #Compare the current time value with the life time period specified in #the visible_time field. The resultant visibility field will be 1 if #the current time is within the visible_time. gfx define field greater greater_than field visible_time.end time_value; gfx define field less less_than field visible_time.start time_value; gfx define field equal equal_to field visible_time.start time_value; gfx define field less_or_equal or field less equal; gfx define field visibility and field less_or_equal greater; #create a spectrum gfx modify spectrum default clear overwrite_colour; gfx modify spectrum default linear reverse range 1 8 extend_above extend_below rainbow colour_range 0 1 component 1; #Create a set of node points for cube which visibility is controlled by the subgroup field (note command token changed from 'visibility' to 'subgroup'). gfx modify g_element "/" node_points glyph sphere general size "0.1*0.1*0.1" centre 0,0,0 font default subgroup visibility data cmiss_number select_on material default selected_material default_selected; # Old command for cmgui 2.8: #gfx modify g_element cube node_points glyph sphere general size "0.1*0.1*0.1" centre 0,0,0 font default visibility visibility data cmiss_number select_on material default selected_material default_selected; #create a field which is used as the iso-scalar of an iso-surface gfx define field coord.y composite coordinates.y; gfx define field nine constant 9; gfx define field mul multiply field coord.y nine; gfx define field div divide field mul time_value; gfx modify g_element cube iso_surfaces iso_scalar div iso_values 1 use_elements select_on material default data mul spectrum default selected_material default_selected render_shaded; #create a visibility field which controls the visibility of node points in line group. gfx define field line_multiply multiply field coordinates.y nine; gfx define field line_visibility greater_than field time_value line_multiply; #Create a set of node points for line which visibility is controlled by the line_visibility field. gfx define field final_line_visibility and fields line.nodes line_visibility; gfx modify g_element line node_points glyph sheet general size "0.1*0.1*0.1" centre 0,0,0 font default subgroup final_line_visibility select_on material default data line_multiply spectrum default selected_material default_selected; # Old command for cmgui 2.8: #gfx modify g_element line node_points glyph sheet general size "0.1*0.1*0.1" centre 0,0,0 font default visibility line_visibility select_on material default data line_multiply spectrum default selected_material default_selected; gfx cre win 1; gfx modify window 1 view parallel eye_point 3.3986 -1.29312 1.43081 interest_point 0.5 0.5 0.5 up_vector -0.223722 0.139112 0.964674 view_angle 40 near_clipping_plane 0.0353321 far_clipping_plane 12.6265 relative_viewport ndc_placement -1 1 2 2 viewport_coordinates 0 0 1 1; gfx timekeeper default maximum 9; if ($TESTING) { gfx timekeeper default set_time 5; gfx export vrml file field_dependent_visibility.wrl scene default; } else { gfx timekeeper default play; }
Name Modified Size
example_field_dependent_visibility.com 17-Mar-2014 5.3k COPYRIGHT 17-Mar-2014 504 cube.exelem 17-Mar-2014 4.9k cube.exnode 17-Mar-2014 592 line.exnode 17-Mar-2014 451
Name Modified Size
examples_a_field_dependent_visibility.tar.gz 09-Mar-2016 16k
Status | Tested | Real time (s) | |
i686-linux | |||
cmgui-wx | Failure | Sun Mar 6 00:11:09 2016 | 2 |
last break | Tue Feb 24 00:02:00 2015 | 2 | |
cmgui-wx-debug | Failure | Sun Mar 6 00:11:11 2016 | 3 |
last break | Tue Feb 24 00:02:00 2015 | 3 | |
cmgui-wx-debug-memorycheck | Failure | Sun Mar 6 00:14:09 2016 | 2 |
last break | Tue Feb 24 03:13:00 2015 | 1 | |
cmgui-wx-debug-valgrind | Failure | Sun Mar 6 01:00:21 2016 | 36 |
last break | Sun Mar 6 00:59:00 2016 | 36 | |
x86_64-linux | |||
cmgui-wx | Failure | Sun Mar 6 00:01:30 2016 | 0 |
last break | Sun Mar 6 00:01:00 2016 | 0 | |
cmgui-wx-debug | Failure | Sun Mar 6 00:01:30 2016 | 0 |
last break | Sun Mar 6 00:01:00 2016 | 0 | |
cmgui-wx-debug-memorycheck | Failure | Sun Mar 6 00:01:30 2016 | 0 |
last break | Sun Mar 6 00:01:00 2016 | 0 | |
cmgui-wx-debug-valgrind | Failure | Sun Mar 6 00:02:55 2016 | 9 |
last break | Sun Mar 6 00:02:00 2016 | 9 |
x86_64-linux | |||
139 | cmgui-wx: | error exit status 139. | |
139 | cmgui-wx-debug: | error exit status 139. | |
139 | cmgui-wx-debug-memorycheck: | error exit status 139. | |
139 | cmgui-wx-debug-valgrind: | error exit status 139. |
i686-linux | |||
Failure | cmgui-wx: | diff test: differences with generic answer; Test output. | |
Failure | cmgui-wx-debug: | diff test: differences with generic answer; Test output. | |
Failure | cmgui-wx-debug-memorycheck: | diff test: differences with generic answer; Test output. | |
Failure | cmgui-wx-debug-valgrind: | diff test: differences with generic answer; Test output. | |
x86_64-linux | |||
Failure | cmgui-wx: | diff test: differences with generic answer; Test output. | |
Failure | cmgui-wx-debug: | diff test: differences with generic answer; Test output. | |
Failure | cmgui-wx-debug-memorycheck: | diff test: differences with generic answer; Test output. | |
Failure | cmgui-wx-debug-valgrind: | diff test: differences with generic answer; Test output. |
i686-linux | |||
Failure | cmgui-wx: | ndiff test: significant differences with generic answer. | |
Failure | cmgui-wx-debug: | ndiff test: significant differences with generic answer. | |
Failure | cmgui-wx-debug-memorycheck: | ndiff test: significant differences with generic answer. | |
Failure | cmgui-wx-debug-valgrind: | ndiff test: significant differences with generic answer. | |
x86_64-linux | |||
Missing | cmgui-wx: | output file not generated for ndiff; generic answer. | |
Missing | cmgui-wx-debug: | output file not generated for ndiff; generic answer. | |
Missing | cmgui-wx-debug-memorycheck: | output file not generated for ndiff; generic answer. | |
Missing | cmgui-wx-debug-valgrind: | output file not generated for ndiff; generic answer. |
Html last generated: Wed Mar 9 16:02:06 2016
Input last modified: Wed Mar 9 15:49:41 2016