![]() |
Mesh Oriented datABase
(version 5.4.1)
Array-based unstructured mesh datastructure
|
Go to the source code of this file.
Defines | |
#define | MBI mb_instance() |
Functions | |
static Interface * | mb_instance () |
int | main (int argc, char **argv) |
#define MBI mb_instance() |
Definition at line 8 of file quads_to_tris_driver.cpp.
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 14 of file quads_to_tris_driver.cpp.
References ErrorCode, MB_SUCCESS, MBI, and quads_to_tris().
{
if( 2 > argc )
{
std::cout << "Need name of input file with quads." << std::endl;
return 0;
}
// load file from input argument
ErrorCode result;
std::string filename = argv[1];
result = MBI->load_file( filename.c_str() );
if( MB_SUCCESS != result )
{
std::cout << "Error reading file." << std::endl;
return 1;
}
result = quads_to_tris( MBI, 0 );
if( MB_SUCCESS != result )
{
std::cout << "Error converting to tris." << std::endl;
return 1;
}
// Write the file that has been converted from quads to tris.
// Cut off the .h5m
int len1 = filename.length();
filename.erase( len1 - 4 );
std::string filename_new = filename + "_tris.h5m";
result = MBI->write_mesh( filename_new.c_str() );
assert( MB_SUCCESS == result );
return 0;
}
Interface * mb_instance | ( | ) | [static] |
Definition at line 50 of file quads_to_tris_driver.cpp.
{
static Core inst;
return &inst;
}