MOAB: Mesh Oriented datABase  (version 5.4.1)
moab::VtkUtil Class Reference

#include <VtkUtil.hpp>

+ Collaboration diagram for moab::VtkUtil:

Static Public Member Functions

static const VtkElemTypeget_vtk_type (EntityType type, unsigned num_nodes)

Static Public Attributes

static const char * vtkTypeNames []
 vtk data type names, indexed by DataType
static const VtkElemType vtkElemTypes []
static const unsigned numVtkElemType = sizeof( VtkUtil::vtkElemTypes ) / sizeof( VtkUtil::vtkElemTypes[0] )
 Lenght of vtkElemTypes.

Detailed Description

General data about VTK files for use by read and write code.

Author:
Jason Kraftcheck

Definition at line 43 of file VtkUtil.hpp.


Member Function Documentation

const VtkElemType * moab::VtkUtil::get_vtk_type ( EntityType  type,
unsigned  num_nodes 
) [static]

Get the VTK type corresponding to a tuple of the MOAB type and number of nodes. num_nodes is ignored for MBPOLYGON type.

Definition at line 125 of file VtkUtil.cpp.

References moab::mb_to_vtk_type, MBPOLYGON, MBPOLYHEDRON, and vtkElemTypes.

Referenced by moab::WriteVtk::gather_mesh(), and moab::WriteVtk::write_elems().

{
    const int i = mb_to_vtk_type[type][0];  // Index for linear type
    const int j = mb_to_vtk_type[type][1];  // Index for quadratic type
    const int k = mb_to_vtk_type[type][2];  // Index for full quadratic type
    if( i )  // If element type is supported at all (if not linear then not quadratic either)
    {
        // If the linear type is requested (all polygons are linear
        // irrespective of the number of nodes), return that.
        if( type == MBPOLYGON || type == MBPOLYHEDRON || vtkElemTypes[i].num_nodes == num_nodes )
            return vtkElemTypes + i;
        // Otherwise if there is a quadratic type and the number of
        // nodes specified corresponds to the quadratic type, return that.
        else if( j && vtkElemTypes[j].num_nodes == num_nodes )
            return vtkElemTypes + j;
        // Otherwise if there is a full quadratic type and the number of
        // nodes specified corresponds to the quadratic type, return that.
        else if( k && vtkElemTypes[k].num_nodes == num_nodes )
            return vtkElemTypes + k;
    }

    return 0;
}

Member Data Documentation

const unsigned moab::VtkUtil::numVtkElemType = sizeof( VtkUtil::vtkElemTypes ) / sizeof( VtkUtil::vtkElemTypes[0] ) [static]

Lenght of vtkElemTypes.

Definition at line 55 of file VtkUtil.hpp.

Referenced by moab::ReadVtk::vtk_read_unstructured_grid().

Vtk types, indexed by VTK type number. For unused VTK type numbers, mb_type will be MBMAXTYPE.

Definition at line 52 of file VtkUtil.hpp.

Referenced by get_vtk_type(), and moab::ReadVtk::vtk_read_unstructured_grid().

const char * moab::VtkUtil::vtkTypeNames [static]
Initial value:
 {
    "unsigned_char",  
    "int",            
    "double",         
    "bit",            
    "unsigned_long",  
}

vtk data type names, indexed by DataType

Definition at line 48 of file VtkUtil.hpp.

Referenced by moab::WriteVtk::write_tag().

List of all members.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines