moab
moab::VtkUtil Class Reference

#include <VtkUtil.hpp>

List of all members.

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 42 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 121 of file VtkUtil.cpp.

{
  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 || 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 54 of file VtkUtil.hpp.

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

Definition at line 51 of file VtkUtil.hpp.

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 47 of file VtkUtil.hpp.


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