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