MOAB: Mesh Oriented datABase  (version 5.4.1)
VtkTypeInfo.hpp
Go to the documentation of this file.
00001 /* *****************************************************************
00002     MESQUITE -- The Mesh Quality Improvement Toolkit
00003 
00004     Copyright 2005 Lawrence Livermore National Laboratory.  Under
00005     the terms of Contract B545069 with the University of Wisconsin --
00006     Madison, Lawrence Livermore National Laboratory retains certain
00007     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     This library is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017     Lesser General Public License for more details.
00018 
00019     You should have received a copy of the GNU Lesser General Public License
00020     (lgpl.txt) along with this library; if not, write to the Free Software
00021     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 
00023     [email protected]
00024 
00025   ***************************************************************** */
00026 
00027 #ifndef MSQ_VTK_TYPE_INFO_HPP
00028 #define MSQ_VTK_TYPE_INFO_HPP
00029 
00030 #include "Mesquite.hpp"
00031 #include <sys/types.h>
00032 #include <vector>
00033 
00034 namespace MBMesquite
00035 {
00036 
00037 class MsqError;
00038 
00039 /** A struct describing a mapping between a Mesquite type/node_count
00040  *  combination an a VTK element type.*/
00041 struct MESQUITE_EXPORT VtkTypeInfo
00042 {
00043 
00044     const char* name;
00045 
00046     unsigned vtkType;             //!< The VTK type number
00047     EntityTopology msqType;       //!< The Mesquite element topology for the VTK type
00048     unsigned numNodes;            //!< The number of nodes in the VTK type.
00049     const unsigned* vtkConnOrder; /**< NULL if VTK node ordering is the same as
00050                                    *   Mesquite's internal ordering.  If non-null,
00051                                    *   an array of length VtkTypeInfo::numNodes, indexed
00052                                    *   with the Mesquite connectivity offset and
00053                                    *   containing the corresponding VTK connectivity
00054                                    *   offset
00055                                    */
00056 
00057     /** Get VtkTypeInfo from VTK type number */
00058     static const VtkTypeInfo* find_type( unsigned vtk_type, MsqError& err );
00059     /** Get VtkTypeInfo from Mesquite type and number of nodes */
00060     static const VtkTypeInfo* find_type( EntityTopology msq_type, unsigned num_nodes, MsqError& err );
00061 
00062     /** Reorder element connectivty list for writing to a VTK file
00063      *
00064      * If the VTK node ordering is the same as Mesquite's node ordering
00065      * for the type, the input list is not changed.  If the canonical
00066      * ordering for the elment differs, the passed list will be reordered
00067      * for writing to a VTK file.
00068      */
00069     void mesquiteToVtkOrder( std::vector< size_t >& connectivity_list ) const;
00070 };
00071 
00072 }  // namespace MBMesquite
00073 
00074 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines