WriteVGF

Synopsis

Writes the contents of a field or array of fields to a dVision VGF format file.


   module WriteVGFCore< src_file="wr_vgf.cxx",
                        cxx_hdr_files="fld/Xfld.h",
                        out_src_file="gen.cxx",
                        out_hdr_file="gen.h",
                        build_dir="iac_proj/wr_vgf">
   {
      cxxmethod+req upd<status=1>(
         filename+read+notify+req,
         in+read,
         top_name+read,
         nobjs+read,
         .err+write,
         .err_str+write);
      string filename<export=2,NEportLevels={2,0}>;
      Mesh+Node_Data &in<export=2,NEportLevels={2,0}>[];
      string top_name<export=2,NEportLevels={2,0}> = "default_avs_field";
      int nobjs<export=2,NEportLevels={2,0}>;
      int err<export=2,NEportLevels={0,2}> = 0;
      string err_str<export=2,NEportLevels={0,2}> = "";
   };

Description

This module parses the arrays of meshes in and then creates an ASCII VGF output file containing the Cell_Sets of 2D elements such as triangles, quads, lines, polylines and polytristrips. The module takes cell mesh topology from the input field structure, and writes them out to a file in ASCII VGF file format.

This format is part of the dVision dVise virtual reality system, which can store 3D geometric objects in the scene in this format. It is able to pass normals through if they exist on the input mesh, colors, and scalar numerical values at nodes using UV texture coordinates.

The cell-set hierarchy is preserved in the file format. As the module takes an array of meshes as its input it able to output an array of objects. This is used by the user macro writeVGF_ARR to output a GroupObject containing a number of Graphic Display objects.

Inputs

&in[]

Reference to an array of Fields which are to be written to the VGF file. Each Field should consist of a Mesh containing Cell_Sets, and Node Data.

filename

The name of the file that should be written to. The parameter is of type string. The filename should specify the full path name of the file.

top_name

The name of the object being written to the file. The parameter is of type string. The VGF file format stores the names of the objects in the file. This parameter allows these names to be specified. The supplied user macros use the standard AVS object names.

nobjs

The number of objects to be written to the file. The parameter is of type int. The user macro writeVGF_ARR uses the GroupObject parameters to set this parameter.

Outputs

err

This flag is used to indicate whether an error has occured. The parameter is of type int. If this parameter is set to 1 then an error has occured within the module and the user should be informed. This can be done by using the parameter to control the visibilty of an err_str label.

err_str

The description of the current error condition. The parameter is of type string. This parameter is used to store a user readable description of the current error. If no error has occured the parameter has a value of "".

Utility Modules

The low-level WriteVGFCore module is used in the User Macros writeVGF, writeVGF_GD and writeVGF_Arr.

Files

iac_proj/wr_vgf/wvgfmods.v contains the WriteVGFCore module V definition.

Other Notes

The low-level WriteVGFMods library containing the module WriteVGFCore does not specify a process. By default the express process will be used.

Author

Ian Curington
Advanced Visual Systems, Ltd.
Hanworth Lane, Chertsey Surrey, UK
KT16 9JX
<a HREF="mailto:ianc@avs.com">ianc@avs.com</a>

Contact

International AVS Centre
Manchester Visualization Centre
Manchester Computing
University of Manchester
Oxford Road
Manchester
United Kingdom
M13 9PL

See Also

writeVGF, writeVGF_GD, writeVGF_ARR, WriteVGF_UI, WriteVGFEg, WriteVGF_ARR_Eg, Write STL