MOAB: Mesh Oriented datABase  (version 5.4.1)
cgm2moab.hpp File Reference
#include <iostream>
#include "moab/Interface.hpp"
#include "moab/GeomTopoTool.hpp"
+ Include dependency graph for cgm2moab.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define CHECKERR(M, C)   chkerr( M, C, __LINE__, __FILE__ )

Functions

void chkerr (Interface *mbi, ErrorCode code, int line, const char *file)
void chkerr (Interface &mbi, ErrorCode code, int line, const char *file)
void chkerr (GeomTopoTool &gtt, ErrorCode code, int line, const char *file)

Variables

bool verbose
 program-wide verbose output flag

Define Documentation

#define CHECKERR (   M,
 
)    chkerr( M, C, __LINE__, __FILE__ )

Definition at line 19 of file cgm2moab.hpp.

Referenced by TriStats::leaf(), main(), obbstat_write(), obbvis_create(), and TriStats::TriStats().


Function Documentation

void chkerr ( Interface mbi,
ErrorCode  code,
int  line,
const char *  file 
)

Generic halt-on-error error checking

Definition at line 21 of file cgm2moab.cpp.

References fname, moab::Interface::get_error_string(), moab::Interface::get_last_error(), and MB_SUCCESS.

Referenced by chkerr().

{

    if( code != MB_SUCCESS )
    {
        std::cerr << "Error: " << mbi->get_error_string( code ) << " (" << code << ")" << std::endl;
        std::string message;
        if( MB_SUCCESS == mbi->get_last_error( message ) && !message.empty() )
            std::cerr << "Error message: " << message << std::endl;
        std::string fname = file;
        size_t slash      = fname.find_last_of( '/' );
        if( slash != fname.npos )
        {
            fname = fname.substr( slash + 1 );
        }
        std::cerr << "At " << fname << " line: " << line << std::endl;
        std::exit( EXIT_FAILURE );
    }
}
void chkerr ( Interface mbi,
ErrorCode  code,
int  line,
const char *  file 
)

Definition at line 41 of file cgm2moab.cpp.

References chkerr().

{
    chkerr( &mbi, code, line, file );
}
void chkerr ( GeomTopoTool gtt,
ErrorCode  code,
int  line,
const char *  file 
)

Definition at line 46 of file cgm2moab.cpp.

References chkerr(), and moab::GeomTopoTool::get_moab_instance().

{
    chkerr( gtt.get_moab_instance(), code, line, file );
}

Variable Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines