Shows how to use glyphs and normalised_window_coordinates to create graph axes.
#Example graph_axes: Display data in a 2D graph style # #================ Read in nodal data ============== # # This file has the potential at 100ms at many nodes. # gfx read nodes $example/potential.0100.exnode.gz time 0; #================ Plot data ============== # By creating a coorindate field which sets one axis as the # first coordinate and the other axis as the second coordinate # you can plot any fields you choose. # Here we will plot the cmiss_number versus the potential. # The potential needs to be scaled so that it's range is similar # to the other axis. gfx define field plotA composite cmiss_number potential; gfx define field plot scale field plotA scale_factors 1 2e5; # Set the coordinate field to use this plot field and draw the nodes. gfx modify g_element potential_points general clear; gfx modify g_element potential_points node_points as pointset coordinate plot glyph sphere general size "1000*1000*1000" centre 0,0,0 select_on material default data potential spectrum default selected_material default_selected; gfx modify spectrum default auto; # You are not restricted to drawing nodes in this way, isosurfaces, # surfaces and lines can all be draw using this coordinate system. #================ Create window ============== # # Make a window to view the data. It is set in 2D mode to disable rotation, but panning and zooming # still work. # gfx create window 1 double_buffer; gfx modify window 1 image scene default light_model default; gfx modify window 1 image add_light default; gfx modify window 1 layout 2d ortho_axes z y eye_spacing 0.25 width 800 height 400; gfx modify window 1 set current_pane 1; gfx modify window 1 background colour 0 0 0 texture none; # Using a distorting_relative_viewport means that the graph will change aspect ratio when the window is resized gfx modify window 1 view parallel eye_point 286120 3.0534e+06 795829 interest_point 286120 3.0534e+06 0 up_vector -0 -1 -0 view_angle 40.7385 near_clipping_plane 7958.29 far_clipping_plane 2.84402e+06 distorting_relative_viewport ndc_placement -1 1 2 2 viewport_coordinates 0 0 1 1; gfx modify window 1 set transform_tool current_pane 1 std_view_angle 40 normal_lines no_antialias fast_transparency blend_normal; #================ Create axes ============== # # Draw a node which is fixed relative to the window and label the axes with the unscaled coordinate fields # using an window coordinate transformation. As these are done with respect to a particular window # that must be made first. # gfx read node $example/axes.exnode; # The coordinate_system normalised_window_coordinates is a special coordinate system which lies in the # screen window space rather than the 3D model space. # (Not needed in new versions of cmgui; can use coordinates directly with normalised_window_fill coordinate system.) #gfx define field ndc_coordinates coordinate_system normalised_window_coordinates composite coordinates; gfx define field inverse_ndc_projection window_projection window 1 from normalised_window_fill to world; gfx define field ndc_labelsA projection field coordinates projection_matrix inverse_ndc_projection; #in old versions of cmgui replace this with: #gfx define field ndc_labelsA window_projection field coordinates window 1 inverse_ndc_projection; gfx define field ndc_labels scale field ndc_labelsA scale_factors 1 5e-6 1; gfx define field ndc_label_x component ndc_labels.1; gfx define field ndc_label_y component ndc_labels.2; #Specify a matrix so we can specify the minor direction gfx define field xaxis constant 1 0 0 0 1 0 0 0 1; gfx define field yaxis constant 0 1 0 1 0 0 0 0 1; #Define a field that is scaled by the actual pixels on the screen to control the label density so #that as the number of pixels reduce so does the number of labels #The viewport_projections include the ndc projection so we have to work from the ndc_labelsA field gfx define field viewport_projection window_projection window 1 from world to window_pixel_bottom_left; gfx define field pixel_scalingA projection field ndc_labelsA projection_matrix viewport_projection; #in old versions of cmgui replace this with: #gfx define field pixel_scalingA window_projection field ndc_labelsA window 1 viewport_projection; #We want the derivatives of this field to be the density gfx define field pixel_scalingB gradient field pixel_scalingA coordinate coordinates; #We need the diagonal components of this gfx define field pixel_scalingC composite pixel_scalingB.1 pixel_scalingB.5 pixel_scalingB.9; gfx define field pixel_scaling multiply fields pixel_scalingC [1,1,1]; #Make the cross ticks stay the same number of pixels long gfx define field xtickscalingA composite 1.0 pixel_scaling.2 1.0; gfx define field xtickscaling divide fields [1 100.0 1] xtickscalingA; gfx define field ytickscalingA composite 1.0 pixel_scaling.1 1.0; gfx define field ytickscaling divide fields [1 100.0 1] ytickscalingA; gfx modify g_element axes general clear; gfx modify g_element axes node_points as xaxis coordinate coordinates normalised_window_fill glyph line_ticks general size "0*1*1" centre 0,0,0 label ndc_label_x ldensity pixel_scaling.1 orientation xaxis scale_factors "1.8*0*0" variable_scale xtickscaling select_on material default selected_material default_selected; gfx modify g_element axes node_points as yaxis coordinate coordinates normalised_window_fill glyph line_ticks general size "0*1*1" centre 0,0,0 label ndc_label_y ldensity pixel_scaling.2 orientation yaxis scale_factors "1.8*0*0" variable_scale ytickscaling select_on material default selected_material default_selected; #gfx modify g_element axes node_points coordinate coordinates normalised_window_fill glyph point general size "0*1*1" centre 0,0,0 label pixel_scaling orientation yaxis scale_factors "1.8*0*0" select_on material default selected_material default_selected; gfx modify window 1 layout 2d ortho_axes z -y eye_spacing 0.25 width 800 height 400; #Try some formatted labels gfx define field plot_labels format_output field plotA format_string "Test %2g %3.1E"; gfx modify g_element potential_points node_points as pointset glyph point general size "1000*1000*1000" centre 0,0,0 select_on material default data potential spectrum default selected_material default_selected label plot_labels; #And try that again with no glyph gfx modify g_element potential_points node_points as pointset glyph none general size "1000*1000*1000" centre 0,0,0 select_on material default data potential spectrum default selected_material default_selected label plot_labels; #Set it back to the original gfx modify g_element potential_points node_points as pointset glyph sphere general size "1000*1000*1000" centre 0,0,0 select_on material default data potential spectrum default selected_material default_selected label none;
Name Modified Size
graph_axes.com 20-Apr-2012 6.7k COPYRIGHT 20-Apr-2012 504 axes.exnode 20-Apr-2012 442 potential.0100.exnode.gz 20-Apr-2012 19k
Name Modified Size
examples_a_backup_graph_axes.tar.gz 12-Aug-2014 44k
Status | Tested | Real time (s) | |
i686-linux | |||
cmgui-wx | Success | Sun Mar 6 00:15:21 2016 | 3 |
cmgui-wx-debug | Success | Sun Mar 6 00:16:32 2016 | 4 |
cmgui-wx-debug-memorycheck | Success | Sun Mar 6 00:15:24 2016 | 3 |
cmgui-wx-debug-valgrind | Failure | Sun Mar 6 01:29:57 2016 | 102 |
last break | Sun Mar 6 01:28:00 2016 | 102 | |
last success | Tue Feb 10 01:25:00 2015 | 91 | |
x86_64-linux | |||
cmgui-wx | Failure | Sun Mar 6 00:01:37 2016 | 0 |
last break | Sun Mar 6 00:01:00 2016 | 0 | |
last success | Wed Jun 3 00:05:00 2015 | 1 | |
cmgui-wx-debug | Failure | Sun Mar 6 00:01:37 2016 | 0 |
last break | Sun Mar 6 00:01:00 2016 | 0 | |
last success | Wed Jun 3 00:06:00 2015 | 2 | |
cmgui-wx-debug-memorycheck | Failure | Sun Mar 6 00:01:37 2016 | 0 |
last break | Sun Mar 6 00:01:00 2016 | 0 | |
last success | Wed Jun 3 00:06:00 2015 | 1 | |
cmgui-wx-debug-valgrind | Failure | Sun Mar 6 00:03:31 2016 | 9 |
last break | Sun Mar 6 00:03:00 2016 | 9 | |
last success | Wed Jun 3 00:46:00 2015 | 63 | |
cmgui-wx-gcc-cad-debug-valgrind | Success | Thu Jan 7 00:02:36 2016 | 7 |
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 | |||
Success | cmgui-wx: | diff test: no differences with generic answer. | |
Success | cmgui-wx-debug: | diff test: no differences with generic answer. | |
Success | cmgui-wx-debug-memorycheck: | diff test: no differences with generic answer. | |
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. |
Html last generated: Sun Mar 6 05:50:57 2016
Input last modified: Fri Apr 20 15:59:22 2012