MOAB: Mesh Oriented datABase  (version 5.4.1)
DomainClassifierTest.cpp File Reference
#include "Mesquite.hpp"
#include "UnitUtil.hpp"
#include "DomainClassifier.hpp"
#include "MeshDomain1D.hpp"
#include "MsqError.hpp"
#include "MeshImpl.hpp"
#include "MsqVertex.hpp"
#include "PlanarDomain.hpp"
#include <cstdio>
#include <iostream>
#include <algorithm>
+ Include dependency graph for DomainClassifierTest.cpp:

Go to the source code of this file.

Classes

class  DomainClassifierTest

Functions

 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION (DomainClassifierTest,"Unit")
 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION (DomainClassifierTest,"DomainClassifierTest")
static void print_domain (int i, DomainClassifier::DomainSet &set)

Detailed Description

Author:
Jason Kraftcheck

Definition in file DomainClassifierTest.cpp.


Function Documentation

CPPUNIT_TEST_SUITE_NAMED_REGISTRATION ( DomainClassifierTest  ,
"DomainClassifierTest"   
)
static void print_domain ( int  i,
DomainClassifier::DomainSet set 
) [static]

Definition at line 81 of file DomainClassifierTest.cpp.

{
    if( PointDomain* pd = dynamic_cast< PointDomain* >( set.domain ) )
        printf( "%d: PointDomain( %f %f %f ) @ %p\n", i, pd->geom()[0], pd->geom()[1], pd->geom()[2], pd );
    else if( LineDomain* ld = dynamic_cast< LineDomain* >( set.domain ) )
    {
        if( fabs( ld->geom().direction()[0] ) < 1e-6 && fabs( ld->geom().direction()[1] ) < 1e-6 )
            printf( "%d: LineDomain( x = %f, y = %f ) @ %p\n", i, ld->geom().point()[0], ld->geom().point()[1], ld );
        else if( fabs( ld->geom().direction()[1] ) < 1e-6 && fabs( ld->geom().direction()[2] ) < 1e-6 )
            printf( "%d: LineDomain( y = %f, z = %f ) @ %p\n", i, ld->geom().point()[1], ld->geom().point()[2], ld );
        else if( fabs( ld->geom().direction()[0] ) < 1e-6 && fabs( ld->geom().direction()[2] ) < 1e-6 )
            printf( "%d: LineDomain( x = %f, z = %f ) @ %p\n", i, ld->geom().point()[0], ld->geom().point()[2], ld );
        else
            printf( "%d: LineDomain( ? ) @ %p\n", i, ld );
    }
    else if( PlanarDomain* pd = dynamic_cast< PlanarDomain* >( set.domain ) )
    {
        if( fabs( pd->get_normal()[0] ) < 1e-6 && fabs( pd->get_normal()[1] ) < 1e-6 )
            printf( "%d: PlanarDomain( z = %f ) @ %p\n", i, pd->get_origin()[2], pd );
        else if( fabs( pd->get_normal()[1] ) < 1e-6 && fabs( pd->get_normal()[2] ) < 1e-6 )
            printf( "%d: PlanarDomain( x = %f ) @ %p\n", i, pd->get_origin()[1], pd );
        else if( fabs( pd->get_normal()[0] ) < 1e-6 && fabs( pd->get_normal()[2] ) < 1e-6 )
            printf( "%d: PlanarDomain( y = %f ) @ %p\n", i, pd->get_origin()[0], pd );
        else
            printf( "%d: PlanarDomain( ? ) @ %p\n", i, pd );
    }
    else
    {
        printf( "%d: unknown domain type @ %p\n", i, set.domain );
    }

    if( !set.vertices.empty() )
    {
        printf( "  vertices: " );
        std::vector< Mesh::VertexHandle >::iterator vi = set.vertices.begin();
        for( ; vi != set.vertices.end(); ++vi )
            printf( "%lu, ", (unsigned long)*vi );
        printf( "\n" );
    }
    if( !set.elements.empty() )
    {
        printf( "  elements: " );
        std::vector< Mesh::ElementHandle >::iterator ei = set.elements.begin();
        for( ; ei != set.elements.end(); ++ei )
            printf( "%lu, ", (unsigned long)*ei );
        printf( "\n" );
    }
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines