moab
|
00001 00017 #ifndef WRITE_VTK_HPP 00018 #define WRITE_VTK_HPP 00019 00020 #include <iosfwd> 00021 00022 #include "moab/Forward.hpp" 00023 #include "moab/WriterIface.hpp" 00024 00025 namespace moab { 00026 00027 class WriteUtilIface; 00028 00029 //class MB_DLL_EXPORT WriteVtk : public WriterIface 00030 class WriteVtk : public WriterIface 00031 { 00032 00033 public: 00034 00036 WriteVtk(Interface *impl); 00037 00039 virtual ~WriteVtk(); 00040 00041 static WriterIface* factory( Interface* ); 00042 00044 ErrorCode write_file(const char *file_name, 00045 const bool overwrite, 00046 const FileOptions& opts, 00047 const EntityHandle *output_list, 00048 const int num_sets, 00049 const std::vector<std::string>& qa_list, 00050 const Tag* tag_list = NULL, 00051 int num_tags = 0, 00052 int export_dimension = 3); 00053 00054 private: 00055 00057 ErrorCode gather_mesh( const EntityHandle* set_list, 00058 int num_sets, 00059 Range& nodes, 00060 Range& elems ); 00061 00063 ErrorCode write_header( std::ostream& stream ); 00064 00066 ErrorCode write_nodes( std::ostream& stream, const Range& nodes ); 00067 00069 ErrorCode write_elems( std::ostream& stream, const Range& nodes, const Range& elems ); 00070 00072 ErrorCode write_tags( std::ostream& stream, bool nodes, const Range& entities, 00073 const Tag* tag_list, int num_tags ); 00074 00077 ErrorCode write_tag( std::ostream& stream, Tag tag, const Range& entities, const Range& tagged_entities ); 00078 00080 template <typename T> 00081 ErrorCode write_tag( std::ostream& stream, Tag tag, const Range& entities, const Range& tagged_entities, 00082 const int); 00083 00084 ErrorCode write_bit_tag( std::ostream& stream, Tag tag, const Range& entities, const Range& tagged_entities ); 00086 template <typename T> 00087 void write_data( std::ostream& stream, const std::vector<T>& data, unsigned vals_per_tag ); 00088 00089 Interface* mbImpl; 00090 WriteUtilIface* writeTool; 00091 00092 bool mStrict; // If true, do not write data that cannot fit in strict VTK file format. 00093 00094 }; 00095 00096 } // namespace moab 00097 00098 #endif