Base class for tecplot files Implements useful functions for tecplot file parsing. More...
#include <file.h>
Public Member Functions | |
virtual string | get_mod_name () |
Get the name of the class (tecplot_data) More... | |
tecplot_data (ifstream &infile, ofstream &outfile, bool loud, string filename, int dim, std::vector< std::vector< int > > rFieldMappings, std::vector< index_order > rIndexOrder, std::vector< adj_map > conv_factor, std::vector< adj_map > norm_val) | |
Constructor that initializes values. More... | |
virtual | ~tecplot_data () |
Destructor. More... | |
virtual void | parse () |
Parse the tecplot file. More... | |
Public Member Functions inherited from datafile | |
datafile (ifstream &infile, ofstream &outfile, bool loud, string filename, int dim, std::vector< std::vector< int > > rFieldMappings, std::vector< index_order > rIndexOrder, std::vector< adj_map > conv_factor, std::vector< adj_map > norm_val) | |
Construct data file object using specified information. More... | |
virtual | ~datafile () |
Free used data, delete the object. More... | |
datafile (const datafile &d) | |
Deep copy constructor. More... | |
int | partition_layout (int partition, int n) |
Get the size of n dimension of the specified partition. More... | |
points * | get_points (int partition) |
Get a partitions' points. More... | |
pnt | get_point (int n) |
Get the nth point of the file. More... | |
pnt | get_point (int n, int partition) |
Get the nth point of the specified partition. More... | |
int | get_num_points () |
Get the number of points in the file. More... | |
int | get_num_points (int partition) |
Get the number of points in the specified partition. More... | |
int | get_num_vars () |
Get the number of variables in the file. More... | |
string | get_title () |
Get file title if specified in file header. More... | |
int | get_num_partitions () |
Get number of partition in the file. More... | |
Protected Member Functions | |
void | read_header () |
Read the tecplot header from the file and retrieve the title, variable names, and number of variables. More... | |
int | count_zones () |
Count the number of zones in the tecplot file, starting from the current location of the file stream. More... | |
void | seek_to_zone () |
Seek to the next zone in the file. More... | |
string * | get_zone_header (int zone) |
Read the zone header. More... | |
string * | get_zone_nodes (int zone) |
Retrieve zone point data from the zone body. More... | |
void | zone_error_out (int zone, string zs_err) |
Log an error message with appended zone information so the error can be located. More... | |
void | zone_status_out (int zone, string zs_out) |
Log a status message with appended zone information. More... | |
tpzone * | zone_detect (int zone) |
Read the header information for the specified zone, then create a new zone object based on the type of zone detected. More... | |
Protected Member Functions inherited from datafile | |
void | error_out (string err_ps) |
Log the string specified as an error event. More... | |
void | status_out (string st_ps) |
Log the string specified as a status event. More... | |
void | LogFieldMappings () |
Log the field mapping data from the command line and stored in mFieldMappings. More... | |
int | get_num_dep_vars () |
Get number of dependent variables. More... | |
index_order | get_index_order (int partition) |
Static Private Attributes | |
static const int | BUFFER_SIZE = 512 |
Additional Inherited Members | |
Protected Attributes inherited from datafile | |
string | filename |
ifstream & | infile |
ofstream & | outfile |
bool | loud |
partition ** | data_part |
int | num_partitions |
std::vector< string > | var_names |
string | title |
int | dimensions |
std::vector< adj_map > | conv_factor |
std::vector< adj_map > | norm_val |
std::vector< std::vector< int > > | mFieldMappings |
std::vector< index_order > | mIndexOrder |
Base class for tecplot files Implements useful functions for tecplot file parsing.
tecplot_data | ( | ifstream & | infile, |
ofstream & | outfile, | ||
bool | loud, | ||
string | filename, | ||
int | dim, | ||
std::vector< std::vector< int > > | rFieldMappings, | ||
std::vector< index_order > | rIndexOrder, | ||
std::vector< adj_map > | conv_factor, | ||
std::vector< adj_map > | norm_val | ||
) |
Constructor that initializes values.
Definition at line 186 of file file.cpp.
|
virtual |
|
protected |
Count the number of zones in the tecplot file, starting from the current location of the file stream.
For count of all zones, seek to beginning of file then call.
Definition at line 262 of file file.cpp.
References datafile::infile, and seek_to_zone().
Referenced by parse().
|
virtual |
|
protected |
Read the zone header.
Definition at line 373 of file file.cpp.
References i, datafile::infile, and seek_to_zone().
Referenced by zone_detect().
|
protected |
Retrieve zone point data from the zone body.
Definition at line 414 of file file.cpp.
References BUFFER_SIZE, i, datafile::infile, datafile::num_partitions, and seek_to_zone().
Referenced by zone_detect().
|
virtual |
Parse the tecplot file.
Read the header using read_header(), iterate through each zone and retrieve the zone header and zone body. Create a new partition object and have that object parse the zone. Log and error output.
Reimplemented from datafile.
Definition at line 281 of file file.cpp.
References CGAL::compare(), datafile::conv_factor, count_zones(), datafile::data_part, datafile::error_out(), datafile::get_index_order(), datafile::get_num_dep_vars(), datafile::get_num_vars(), i, datafile::infile, itoa(), datafile::mFieldMappings, datafile::norm_val, datafile::num_partitions, partition::parse_layout(), read_header(), datafile::status_out(), zone_detect(), zone_error_out(), and zone_status_out().
|
protected |
Read the tecplot header from the file and retrieve the title, variable names, and number of variables.
Log the information as a status event.
Definition at line 207 of file file.cpp.
References datafile::infile, itoa(), datafile::LogFieldMappings(), readQuoteExpression(), datafile::status_out(), datafile::title, and datafile::var_names.
Referenced by parse().
|
protected |
Seek to the next zone in the file.
Starting position is the current location of the infile object.
Definition at line 198 of file file.cpp.
References datafile::infile.
Referenced by count_zones(), get_zone_header(), and get_zone_nodes().
|
protected |
Read the header information for the specified zone, then create a new zone object based on the type of zone detected.
zone | Zone number |
Definition at line 340 of file file.cpp.
References CGAL::compare(), get_zone_header(), get_zone_nodes(), readCommaExpression(), and zone_status_out().
Referenced by parse().
|
protected |
Log an error message with appended zone information so the error can be located.
zone | Zone number affected. |
zs_err | Error message. |
Definition at line 252 of file file.cpp.
References datafile::error_out(), and itoa().
Referenced by parse().
|
protected |
Log a status message with appended zone information.
zone | Zone number affected. |
zs_out | Status message. |
Definition at line 245 of file file.cpp.
References itoa(), and datafile::status_out().
Referenced by parse(), and zone_detect().
|
staticprivate |
Definition at line 293 of file file.h.
Referenced by get_zone_nodes().