MOAB: Mesh Oriented datABase  (version 5.4.1)
read_cgm_facet_test.cpp File Reference
#include <iostream>
#include "moab/Interface.hpp"
#include "TestUtil.hpp"
#include "Internals.hpp"
#include "moab/Core.hpp"
#include "MBTagConventions.hpp"
#include "InitCGMA.hpp"
#include "GeometryQueryTool.hpp"
#include "ReadCGM.hpp"
#include "moab/FileOptions.hpp"
+ Include dependency graph for read_cgm_facet_test.cpp:

Go to the source code of this file.

Defines

#define IS_BUILDING_MB
#define OPTION_APPEND(X)

Functions

void read_file (Interface *moab, const char *input_file)
void test_cube_curve_facet ()
void test_cone_curve_facet ()
void read_file (Interface *moab, bool curve_fatal, const char *input_file, ErrorCode check_val, int &curve_fail, int &surface_fail)
int main (int, char **)

Variables

std::string input_cube = "unittest/io/cube.sat"
std::string input_cone = "unittest/io/cone.sat"

Define Documentation

#define IS_BUILDING_MB

Definition at line 4 of file read_cgm_facet_test.cpp.

#define OPTION_APPEND (   X)
Value:
{                                          \
        if( options.length() ) options += ";"; \
        options += ( X );                      \
    }

Function Documentation

int main ( int  ,
char **   
)

Definition at line 101 of file read_cgm_facet_test.cpp.

References RUN_TEST, test_cone_curve_facet(), and test_cube_curve_facet().

{
    int result = 0;

    result += RUN_TEST( test_cube_curve_facet );
#ifndef HAVE_OCC_STEP
    result += RUN_TEST( test_cone_curve_facet );
#endif
    return result;
}
void read_file ( Interface moab,
const char *  input_file 
)

Definition at line 57 of file read_cgm_basic_test.cpp.

References CHECK_ERR, ErrorCode, and moab::Interface::load_file().

{
    InitCGMA::initialize_cgma();
    GeometryQueryTool::instance()->delete_geometry();

    ErrorCode rval = moab->load_file( input_file );CHECK_ERR( rval );
}
void read_file ( Interface moab,
bool  curve_fatal,
const char *  input_file,
ErrorCode  check_val,
int &  curve_fail,
int &  surface_fail 
)

Definition at line 35 of file read_cgm_facet_test.cpp.

References CHECK_EQUAL, ErrorCode, and OPTION_APPEND.

{
    InitCGMA::initialize_cgma();
    GeometryQueryTool::instance()->delete_geometry();
    EntityHandle fs = 0;

    // set the options
    std::string options;
#define OPTION_APPEND( X )                     \
    {                                          \
        if( options.length() ) options += ";"; \
        options += ( X );                      \
    }

    OPTION_APPEND( "CGM_ATTRIBS=no" );
    if( curve_fatal ) OPTION_APPEND( "FATAL_ON_CURVES" );
    OPTION_APPEND( "VERBOSE_CGM_WARNINGS" );

    // set the file options
    FileOptions opts( options.c_str() );

    // new ReadCGM instance
    ReadCGM* RCGM  = new ReadCGM( moab );
    ErrorCode rval = RCGM->load_file( input_file, &fs, opts );
    //  CHKERR(rval);
    curve_fail   = RCGM->get_failed_curve_count();
    surface_fail = RCGM->get_failed_surface_count();
    //  std::cout << curve_fail << " " << surface_fail << std::endl;

    CHECK_EQUAL( rval, check_val );
    CHECK_EQUAL( curve_fail, 0 );
    CHECK_EQUAL( surface_fail, 0 );
}

Definition at line 89 of file read_cgm_facet_test.cpp.

References input_cone, mb, and read_file().

Referenced by main().

{
    // Open the test file
    Core moab;
    Interface* mb    = &moab;
    int curve_fail   = 0;
    int surface_fail = 0;
    // should expect MB_FAILURE since we fail on curves
    read_file( mb, true, input_cone.c_str(), MB_FAILURE, curve_fail, surface_fail );
}

Definition at line 76 of file read_cgm_facet_test.cpp.

References input_cube, mb, MB_SUCCESS, and read_file().

Referenced by main().

{
    // Open the test file
    Core moab;
    Interface* mb    = &moab;
    int curve_fail   = 0;
    int surface_fail = 0;
    // should succeed since we are not fatal error on curves
    read_file( mb, false, input_cube.c_str(), MB_SUCCESS, curve_fail, surface_fail );
}

Variable Documentation

std::string input_cone = "unittest/io/cone.sat"

Definition at line 25 of file read_cgm_facet_test.cpp.

Referenced by test_cone_curve_facet().

std::string input_cube = "unittest/io/cube.sat"

Definition at line 19 of file read_cgm_facet_test.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines