Mesh Oriented datABase  (version 5.4.1)
Array-based unstructured mesh datastructure
VtkUtil.hpp
Go to the documentation of this file.
00001 /**
00002  * MOAB, a Mesh-Oriented datABase, is a software component for creating,
00003  * storing and accessing finite element mesh data.
00004  *
00005  * Copyright 2004 Sandia Corporation.  Under the terms of Contract
00006  * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
00007  * retains certain rights in this software.
00008  *
00009  * This library is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Lesser General Public
00011  * License as published by the Free Software Foundation; either
00012  * version 2.1 of the License, or (at your option) any later version.
00013  *
00014  */
00015 
00016 #ifndef VTK_UTIL_HPP
00017 #define VTK_UTIL_HPP
00018 
00019 #include "moab/EntityType.hpp"
00020 
00021 namespace moab
00022 {
00023 
00024 //! Structure defining relation between MOAB and VTK element
00025 //! types.  VTK had different types for quadratic than linear
00026 //! elements, so a tuple of the MOAB type and number of
00027 //! elements maps to a VTK type.
00028 struct VtkElemType
00029 {
00030     const char* name;            //!< String name for use in error messages
00031     unsigned vtk_type;           //!< VTK integer type
00032     EntityType mb_type;          //!< MOAB type
00033     unsigned num_nodes;          //!< Number of nodes (0 for polygon)
00034     const unsigned* node_order;  //!< VTK element node ordering, indexed by
00035                                  //!< the VTK node position and containing
00036                                  //!< the corresponding MOAB node position.
00037                                  //!< NOTE: This field is NULL if MOAB and VTK
00038                                  //!< ordering is the same!
00039 };
00040 
00041 //! General data about VTK files for use by read and write code.
00042 //! \author Jason Kraftcheck
00043 class VtkUtil
00044 {
00045 
00046   public:
00047     //! vtk data type names, indexed by DataType
00048     static const char* vtkTypeNames[];
00049 
00050     //! Vtk types, indexed by VTK type number.
00051     //! For unused VTK type numbers, mb_type will be MBMAXTYPE.
00052     static const VtkElemType vtkElemTypes[];
00053 
00054     //! Lenght of \ref vtkElemTypes
00055     static const unsigned numVtkElemType;
00056 
00057     //! Get the VTK type corresponding to a tuple of the MOAB type and number of nodes.
00058     //! num_nodes is ignored for MBPOLYGON type.
00059     static const VtkElemType* get_vtk_type( EntityType type, unsigned num_nodes );
00060 };
00061 
00062 }  // namespace moab
00063 
00064 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines