Read SMF (Simple Model Format) files. More...
#include <ReadSmf.hpp>
Classes | |
struct | cmd_entry |
Public Types | |
typedef ErrorCode(ReadSmf::* | read_cmd) (std::vector< std::string > &argv) |
Public Member Functions | |
ErrorCode | load_file (const char *file_name, const EntityHandle *file_set, const FileOptions &opts, const SubsetList *subset_list=0, const Tag *file_id_tag=0) |
load a file More... | |
ErrorCode | read_tag_values (const char *file_name, const char *tag_name, const FileOptions &opts, std::vector< int > &tag_values_out, const SubsetList *subset_list=0) |
Read tag values from a file. More... | |
ReadSmf (Interface *impl=NULL) | |
Constructor. More... | |
virtual | ~ReadSmf () |
Destructor. More... | |
void | init () |
Public Member Functions inherited from moab::ReaderIface | |
virtual | ~ReaderIface () |
Static Public Member Functions | |
static ReaderIface * | factory (Interface *) |
Protected Member Functions | |
ErrorCode | annotation (char *cmd, std::vector< std::string > &argv) |
void | bad_annotation (const char *cmd) |
ErrorCode | vertex (std::vector< std::string > &) |
ErrorCode | v_normal (std::vector< std::string > &) |
ErrorCode | v_color (std::vector< std::string > &) |
ErrorCode | f_color (std::vector< std::string > &) |
ErrorCode | face (std::vector< std::string > &) |
ErrorCode | begin (std::vector< std::string > &) |
ErrorCode | end (std::vector< std::string > &) |
ErrorCode | set (std::vector< std::string > &) |
ErrorCode | inc (std::vector< std::string > &) |
ErrorCode | dec (std::vector< std::string > &) |
ErrorCode | trans (std::vector< std::string > &) |
ErrorCode | scale (std::vector< std::string > &) |
ErrorCode | rot (std::vector< std::string > &) |
ErrorCode | mmult (std::vector< std::string > &) |
ErrorCode | mload (std::vector< std::string > &) |
ErrorCode | parse_line (char *line) |
ErrorCode | parse_doubles (int count, const std::vector< std::string > &argv, double results[]) |
ErrorCode | parse_mat (const std::vector< std::string > &argv, AffineXform &mat_out) |
ErrorCode | check_length (int count, const std::vector< std::string > &argv) |
Private Attributes | |
ReadUtilIface * | readMeshIface |
Interface * | mdbImpl |
interface instance interface instance More... | |
EntityHandle | mCurrentMeshHandle |
Meshset Handle for the mesh that is currently being read. More... | |
std::string | mPartitionTagName |
A field which, if present and having a single integer for storage, should be used to partition the mesh by range. Defaults to MATERIAL_SET_TAG_NAME. More... | |
char | line [SMF_MAXLINE] |
std::vector< SMF_State > | state |
SMF_ivars | ivar |
int | _numNodes |
int | _numFaces |
std::vector< double > | _coords |
std::vector< int > | _connec |
int | _numNodesInFile |
int | _numElementsInFile |
size_t | lineNo |
size_t | commandNo |
int | versionMajor |
int | versionMinor |
Static Private Attributes | |
static cmd_entry | read_cmds [] |
Read SMF (Simple Model Format) files.
File format is documented at: http://people.sc.fsu.edu/~burkardt/data/smf/smf.txt
Definition at line 39 of file ReadSmf.hpp.
typedef ErrorCode( ReadSmf::* moab::ReadSmf::read_cmd) (std::vector< std::string > &argv) |
Definition at line 64 of file ReadSmf.hpp.
ReadSmf::ReadSmf | ( | Interface * | impl = NULL | ) |
Constructor.
Definition at line 87 of file ReadSmf.cpp.
References _numElementsInFile, _numFaces, _numNodes, _numNodesInFile, ivar, mdbImpl, moab::SMF_ivars::next_face, moab::SMF_ivars::next_vertex, moab::Interface::query_interface(), and readMeshIface.
Referenced by factory().
|
virtual |
Destructor.
Definition at line 97 of file ReadSmf.cpp.
References mdbImpl, readMeshIface, and moab::Interface::release_interface().
|
protected |
Definition at line 208 of file ReadSmf.cpp.
References _numFaces, _numNodes, bad_annotation(), commandNo, lineNo, MB_FILE_WRITE_ERROR, MB_SET_ERR, MB_SUCCESS, streq(), versionMajor, and versionMinor.
Referenced by parse_line().
|
protected |
Definition at line 77 of file ReadSmf.cpp.
Referenced by annotation().
|
protected |
Definition at line 424 of file ReadSmf.cpp.
References ivar, MB_SUCCESS, and state.
|
protected |
Definition at line 341 of file ReadSmf.cpp.
References lineNo, MB_FILE_WRITE_ERROR, MB_SET_ERR, and MB_SUCCESS.
Referenced by face(), parse_doubles(), and rot().
|
protected |
|
protected |
Definition at line 431 of file ReadSmf.cpp.
References lineNo, MB_FILE_WRITE_ERROR, MB_SET_ERR, MB_SUCCESS, and state.
|
protected |
Definition at line 394 of file ReadSmf.cpp.
References MB_SUCCESS.
|
protected |
Definition at line 399 of file ReadSmf.cpp.
References _connec, _numElementsInFile, check_length(), ErrorCode, ivar, lineNo, MB_FILE_WRITE_ERROR, MB_SET_ERR, MB_SUCCESS, moab::SMF_ivars::next_face, and state.
|
static |
Definition at line 82 of file ReadSmf.cpp.
References iface, and ReadSmf().
Referenced by moab::ReaderWriterSet::ReaderWriterSet().
|
protected |
void moab::ReadSmf::init | ( | ) |
|
virtual |
load a file
Implements moab::ReaderIface.
Definition at line 115 of file ReadSmf.cpp.
References _connec, _coords, _numElementsInFile, _numNodesInFile, moab::ReadUtilIface::assign_ids(), commandNo, ErrorCode, moab::ReadUtilIface::get_element_connect(), moab::ReadUtilIface::get_node_coords(), moab::FileOptions::get_option(), ivar, line, lineNo, MB_FILE_DOES_NOT_EXIST, MB_FILE_WRITE_ERROR, MB_SET_ERR, MB_START_ID, MB_SUCCESS, MB_UNSUPPORTED_OPERATION, MBTRI, mPartitionTagName, moab::SMF_ivars::next_face, moab::SMF_ivars::next_vertex, parse_line(), readMeshIface, SMF_MAXLINE, state, moab::ReadUtilIface::update_adjacencies(), versionMajor, and versionMinor.
|
protected |
Definition at line 549 of file ReadSmf.cpp.
References ErrorCode, MB_SUCCESS, parse_mat(), and state.
|
protected |
Definition at line 538 of file ReadSmf.cpp.
References ErrorCode, MB_SUCCESS, parse_mat(), and state.
|
protected |
Definition at line 351 of file ReadSmf.cpp.
References check_length(), ErrorCode, lineNo, MB_FILE_WRITE_ERROR, MB_SET_ERR, and MB_SUCCESS.
Referenced by parse_mat(), rot(), scale(), trans(), and vertex().
|
protected |
Definition at line 277 of file ReadSmf.cpp.
References annotation(), moab::ReadSmf::cmd_entry::cmd, commandNo, ErrorCode, lineNo, MB_FILE_WRITE_ERROR, MB_SET_ERR, MB_SUCCESS, MB_UNSUPPORTED_OPERATION, moab::ReadSmf::cmd_entry::name, read_cmds, streq(), and versionMajor.
Referenced by load_file().
|
protected |
|
virtual |
Read tag values from a file.
Read the list if all integer tag values from the file for a tag that is a single integer value per entity.
file_name | The file to read. |
tag_name | The tag for which to read values |
tag_values_out | Output: The list of tag values. |
subset_list | An array of tag name and value sets specifying the subset of the file to read. If multiple tags are specified, the sets that match all tags (intersection) should be read. |
subset_list_length | The length of the 'subset_list' array. |
Implements moab::ReaderIface.
Definition at line 106 of file ReadSmf.cpp.
References MB_NOT_IMPLEMENTED.
|
protected |
Definition at line 500 of file ReadSmf.cpp.
References moab::angle(), check_length(), ErrorCode, lineNo, MB_FILE_WRITE_ERROR, MB_SET_ERR, MB_SUCCESS, parse_doubles(), moab::AffineXform::rotation(), and state.
|
protected |
Definition at line 487 of file ReadSmf.cpp.
References ErrorCode, MB_SUCCESS, parse_doubles(), moab::AffineXform::scale(), and state.
|
protected |
Definition at line 446 of file ReadSmf.cpp.
References lineNo, MB_FILE_WRITE_ERROR, MB_SET_ERR, MB_SUCCESS, and state.
|
protected |
Definition at line 474 of file ReadSmf.cpp.
References ErrorCode, MB_SUCCESS, parse_doubles(), state, and moab::AffineXform::translation().
|
protected |
Definition at line 389 of file ReadSmf.cpp.
References MB_SUCCESS.
|
protected |
Definition at line 384 of file ReadSmf.cpp.
References MB_SUCCESS.
|
protected |
Definition at line 369 of file ReadSmf.cpp.
References _coords, _numNodesInFile, ErrorCode, ivar, MB_SUCCESS, moab::SMF_ivars::next_vertex, parse_doubles(), and state.
|
private |
Definition at line 124 of file ReadSmf.hpp.
Referenced by face(), and load_file().
|
private |
Definition at line 123 of file ReadSmf.hpp.
Referenced by load_file(), and vertex().
|
private |
Definition at line 126 of file ReadSmf.hpp.
Referenced by face(), load_file(), and ReadSmf().
|
private |
Definition at line 122 of file ReadSmf.hpp.
Referenced by annotation(), and ReadSmf().
|
private |
Definition at line 121 of file ReadSmf.hpp.
Referenced by annotation(), and ReadSmf().
|
private |
Definition at line 125 of file ReadSmf.hpp.
Referenced by load_file(), ReadSmf(), and vertex().
|
private |
Definition at line 128 of file ReadSmf.hpp.
Referenced by annotation(), load_file(), and parse_line().
|
private |
Definition at line 120 of file ReadSmf.hpp.
Referenced by begin(), face(), load_file(), ReadSmf(), and vertex().
|
private |
Definition at line 118 of file ReadSmf.hpp.
Referenced by load_file().
|
private |
Definition at line 127 of file ReadSmf.hpp.
Referenced by annotation(), check_length(), end(), face(), load_file(), parse_doubles(), parse_line(), rot(), and set().
|
private |
Meshset Handle for the mesh that is currently being read.
Definition at line 110 of file ReadSmf.hpp.
|
private |
interface instance interface instance
Definition at line 107 of file ReadSmf.hpp.
Referenced by ReadSmf(), and ~ReadSmf().
|
private |
A field which, if present and having a single integer for storage, should be used to partition the mesh by range. Defaults to MATERIAL_SET_TAG_NAME.
Definition at line 114 of file ReadSmf.hpp.
Referenced by load_file().
|
staticprivate |
Definition at line 117 of file ReadSmf.hpp.
Referenced by parse_line().
|
private |
Definition at line 101 of file ReadSmf.hpp.
Referenced by load_file(), ReadSmf(), and ~ReadSmf().
|
private |
|
private |
Definition at line 129 of file ReadSmf.hpp.
Referenced by annotation(), load_file(), and parse_line().
|
private |
Definition at line 129 of file ReadSmf.hpp.
Referenced by annotation(), and load_file().