ReadSLPSTLFile

Synopsis

Reads in either a Pro/Engineer RENDER format file (.SLP) or a Stereo-Lithography (.STL) file and creates field data from it.


  module ReadSLPSTLFile < build_dir="iac_proj/rd_slpst",
                          src_file="rd_slp.cxx",
                          out_src_file="gen.cxx",
                          out_hdr_file="gen.hxx",
                   		  libdeps="FLD",
		                  cxx_hdr_files="fld/Xfld.h"> {
      ReadSLPSTLParams &ReadSLPSTLParams <NEportLevels={2,0}>;
      cxxmethod+req upd<status=1> (
         filename+read+notify+req,
         out+write,
         .err+write,
         .err_str+write
      );
      string filename => ReadSLPSTLParams.filename;
      int err => ReadSLPSTLParams.err;
      string err_str => ReadSLPSTLParams.err_str;
      Field out <export=2,NEportLevels={0,2}>;
  };

Description

This module parses two kinds of files, Pro/Engineer RENDER format files (.SLP) and Stereo-Lithography (.STL) files. Data from these files is read in by the module and put into a Field with one cell_set, a trianglular one. It is assumed that the RENDER format has only two data components - NORMAL and COLOR. These are both read and put into the node_data, since the data is based on the triangle vertices. It is also assumed that there is only one solid in the RENDER file.

The module is capable of reading in both ASCII and binary forms of the STL file format, and converting the patches present into AVS/Express triangle lists. When reading in binary data the module also detects bigendian/littlendian conversion switching.

Inputs

&ReadSLPSTLParams

Reference to the parameter block, which contains real instances of the parameters for the ReadSLPSTLFile function.

filename

Name of the SLP or STL file to be loaded. The parameter is of type string. This is the only input parameter to the ReadSLPSTLFile function, the other parameters are used to generate error information and are set by the ReadSLPSTLFile function. Normally the value of this parameter is found by referring to the parameter block, which is referenced by the &ReadSLPSTLParams input.

Outputs

out

The output field containing field data constructed from the data present in the SLP/STL file.

err

A trigger parameter that is used to display and hide the UI error message as necessary. A value of 0 implies no error message and 1 implies that there is an error message that should be displayed. The parameter is of type int, and is set by the ReadSLPSTLFile module. Setting this value has no affect upon the ReadSLPSTLFile module. Normally the value of this parameter is found by referring to the parameter block, which is referenced by the &ReadSLPSTLParams input.

err_str

Description of error that has occured in the ReadSLPSTLFile function. The parameter is of type string, and is set by the ReadSLPSTLFile module. Setting this value has no affect upon the ReadSLPSTLFile module. Normally the value of this parameter is found by referring to the parameter block, which is referenced by the &ReadSLPSTLParams input.

Utility Macros

The low-level ReadSLPSTLFile module is used in the User Macro readSLPSTL. Additionally, this macro also uses the ReadSLPSTLParams parameter block group object, as does the ReadSLPSTLUI UI Macro.

Example

An example application ReadSLPSTLEg is provided, which loads either a SLP or a STL file, generates a set of field data from it and then displays it using the standard 3d viewer.

Files

iac_proj/rd_slpst/rdslmods.v contains the ReadSLPSTLParams group and the ReadSLPSTLFile module V definitions.

Other Notes

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

Authors

Jeremy Maccelari
Ian Curington

Modifications

Paul G. Lever
Andrew Dodd
Tobias Schiebeck

Contact

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

See Also

ReadSLPSTLParams, ReadSLPSTLUI, readSLPSTL