writevtk.cpp

Go to the documentation of this file.
00001 #include <iostream>
00002 #include <string>
00003 #include "ThreeDMTModel.h"
00004 #include "FatalException.h"
00005 #include <fstream>
00006 
00007 using namespace std;
00008 using namespace gplib;
00009 
00010 string version = "$Id: writevtk.cpp 1816 2009-09-07 11:28:35Z mmoorkamp $";
00011 
00012 int main(void)
00013   {
00014     cout
00015         << " This is writevtk, convert Mackie or WinGlink model files to vtk format for display"
00016         << endl;
00017     cout
00018         << " Output format is legacy VTK format, ending '.vtk' is appended to output"
00019         << endl;
00020     cout << " This is Version: " << version << endl << endl;
00021     ThreeDMTModel Model;
00022     string infilename, outfilename;
00023 
00024     int mode;
00025 
00026     cout << "Modelfile: ";
00027     cin >> infilename;
00028     cout << "Type 1 for old Mackie, 2 for Winglink: ";
00029     cin >> mode;
00030 
00031     cout << "Outfile: ";
00032     cin >> outfilename;
00033     try
00034       {
00035         if (mode == 1)
00036           Model.ReadMackie(infilename);
00037         else
00038           Model.ReadWinGLink(infilename);
00039         Model.WriteVTK(outfilename + ".vtk");
00040         Model.WriteNetCDF(outfilename + ".nc");
00041       } catch (const FatalException &e)
00042       {
00043         cerr << e.what() << endl;
00044       }
00045   }

Generated on Tue May 4 16:52:15 2010 for GPLIB++ by  doxygen 1.5.8